Adds an icon in taskbar to authentication window if the application UI is not yet loaded.

fix-message-formatting 5208
Damian Minkov 12 years ago
parent f3eed41040
commit f197fa4f87

@ -188,7 +188,12 @@ public AuthenticationWindow(String server,
String errorMessage,
String signupLink)
{
super(false);
super(
(Window)(DesktopUtilActivator.getUIService() == null ?
null :
DesktopUtilActivator.getUIService()
.getExportedWindow(ExportedWindow.MAIN_WINDOW)),
false);
this.windowTitle = windowTitle;
this.windowText = windowText;

@ -84,6 +84,23 @@ public SIPCommDialog(Frame owner)
this.init();
}
/**
* Creates an instance of <tt>SIPCommDialog</tt> by specifying the
* <tt>Frame</tt> owner.
* @param owner the owner of this dialog
*/
public SIPCommDialog(Window owner)
{
super(owner);
this.init();
if(owner == null)
{
SIPCommFrame.updateIconImages(this);
}
}
/**
* Creates an instance of <tt>SIPCommDialog</tt> by specifying explicitly
* if the size and location properties are saved. By default size and
@ -128,6 +145,21 @@ public SIPCommDialog(Frame owner, boolean isSaveSizeAndLocation)
this.isSaveSizeAndLocation = isSaveSizeAndLocation;
}
/**
* Creates an instance of <tt>SIPCommDialog</tt> by specifying the owner
* of this dialog and indicating whether to save the size and location
* properties.
* @param owner the owner of this dialog
* @param isSaveSizeAndLocation indicates whether to save the size and
* location of this dialog
*/
public SIPCommDialog(Window owner, boolean isSaveSizeAndLocation)
{
this(owner);
this.isSaveSizeAndLocation = isSaveSizeAndLocation;
}
/**
* Initializes this dialog.
*/

@ -118,38 +118,46 @@ public SIPCommFrame()
* Initialize default values.
*/
private void init()
{
updateIconImages(this);
}
/**
* Sets the list of icons to the <tt>window</tt>.
* @param window the window, which icons will be updated.
*/
public static void updateIconImages(Window window)
{
try
{
Method m = Window.class.getMethod("setIconImages", List.class);
List<Image> logos = new ArrayList<Image>(6)
{
private static final long serialVersionUID = 0L;
{
add(DesktopUtilActivator.getImage(
"service.gui.SIP_COMMUNICATOR_LOGO"));
"service.gui.SIP_COMMUNICATOR_LOGO"));
add(DesktopUtilActivator.getImage(
"service.gui.SIP_COMMUNICATOR_LOGO_20x20"));
"service.gui.SIP_COMMUNICATOR_LOGO_20x20"));
add(DesktopUtilActivator.getImage(
"service.gui.SIP_COMMUNICATOR_LOGO_32x32"));
"service.gui.SIP_COMMUNICATOR_LOGO_32x32"));
add(DesktopUtilActivator.getImage(
"service.gui.SIP_COMMUNICATOR_LOGO_45x45"));
"service.gui.SIP_COMMUNICATOR_LOGO_45x45"));
add(DesktopUtilActivator.getImage(
"service.gui.SIP_COMMUNICATOR_LOGO_64x64"));
"service.gui.SIP_COMMUNICATOR_LOGO_64x64"));
add(DesktopUtilActivator.getImage(
"service.gui.SIP_COMMUNICATOR_LOGO_128x128"));
"service.gui.SIP_COMMUNICATOR_LOGO_128x128"));
}
};
m.invoke(this, logos);
window.setIconImages(logos);
// In order to have the same icon when using option panes
m.invoke(JOptionPane.getRootFrame(), logos);
JOptionPane.getRootFrame().setIconImages(logos);
}
catch (Exception e)
{
Image scLogo
= DesktopUtilActivator.getImage("service.gui.SIP_COMMUNICATOR_LOGO");
Image scLogo = DesktopUtilActivator.getImage(
"service.gui.SIP_COMMUNICATOR_LOGO");
setIconImage(scLogo);
window.setIconImage(scLogo);
// In order to have the same icon when using option panes
JOptionPane.getRootFrame().setIconImage(scLogo);
}

Loading…
Cancel
Save