aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator
diff options
context:
space:
mode:
authorDamian Minkov <damencho@jitsi.org>2010-10-07 13:22:19 +0000
committerDamian Minkov <damencho@jitsi.org>2010-10-07 13:22:19 +0000
commitc747c01113dbfc49f3dcd7315e9cb169996a5368 (patch)
treeaf2fd7eecc1d405913e083870390fe39d77af0ed /src/net/java/sip/communicator
parentfcee9e5a8877300ae1aa322263f3ac0968ab0826 (diff)
downloadjitsi-c747c01113dbfc49f3dcd7315e9cb169996a5368.zip
jitsi-c747c01113dbfc49f3dcd7315e9cb169996a5368.tar.gz
jitsi-c747c01113dbfc49f3dcd7315e9cb169996a5368.tar.bz2
Add DND icon to tray/notification/dock icons.
Diffstat (limited to 'src/net/java/sip/communicator')
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/presence/GlobalStatusSelectorBox.java7
-rw-r--r--src/net/java/sip/communicator/impl/osdependent/jdic/SystrayServiceJdicImpl.java20
-rw-r--r--src/net/java/sip/communicator/service/systray/SystrayService.java9
3 files changed, 33 insertions, 3 deletions
diff --git a/src/net/java/sip/communicator/impl/gui/main/presence/GlobalStatusSelectorBox.java b/src/net/java/sip/communicator/impl/gui/main/presence/GlobalStatusSelectorBox.java
index fc82f27..fe9f1fa 100644
--- a/src/net/java/sip/communicator/impl/gui/main/presence/GlobalStatusSelectorBox.java
+++ b/src/net/java/sip/communicator/impl/gui/main/presence/GlobalStatusSelectorBox.java
@@ -677,6 +677,10 @@ public class GlobalStatusSelectorBox
{
imgType = SystrayService.SC_IMG_OFFLINE_TYPE;
}
+ else if(status < PresenceStatus.AWAY_THRESHOLD)
+ {
+ imgType = SystrayService.SC_IMG_DND_TYPE;
+ }
else if(status < PresenceStatus.AVAILABLE_THRESHOLD)
{
imgType = SystrayService.SC_IMG_AWAY_TYPE;
@@ -973,6 +977,9 @@ public class GlobalStatusSelectorBox
ffcItem.setIcon(new ImageIcon(ImageLoader.getImage(
ImageLoader.USER_FFC_ICON)));
+ dndItem.setIcon(new ImageIcon(ImageLoader.getImage(
+ ImageLoader.USER_DND_ICON)));
+
awayItem.setIcon(new ImageIcon(ImageLoader.getImage(
ImageLoader.USER_AWAY_ICON)));
diff --git a/src/net/java/sip/communicator/impl/osdependent/jdic/SystrayServiceJdicImpl.java b/src/net/java/sip/communicator/impl/osdependent/jdic/SystrayServiceJdicImpl.java
index 1859035..41fc52a 100644
--- a/src/net/java/sip/communicator/impl/osdependent/jdic/SystrayServiceJdicImpl.java
+++ b/src/net/java/sip/communicator/impl/osdependent/jdic/SystrayServiceJdicImpl.java
@@ -92,6 +92,8 @@ public class SystrayServiceJdicImpl
private ImageIcon logoIconFFC;
+ private ImageIcon logoIconDND;
+
private ImageIcon logoIconWhite;
private ImageIcon envelopeIcon;
@@ -109,6 +111,8 @@ public class SystrayServiceJdicImpl
private URL dockIconFFC;
+ private URL dockIconDND;
+
private Image originalDockImage = null;
private boolean initialized = false;
@@ -162,6 +166,8 @@ public class SystrayServiceJdicImpl
"service.systray.TRAY_ICON_WINDOWS_AWAY");
logoIconFFC = Resources.getImage(
"service.systray.TRAY_ICON_WINDOWS_FFC");
+ logoIconDND = Resources.getImage(
+ "service.systray.TRAY_ICON_WINDOWS_DND");
envelopeIcon = Resources.getImage(
"service.systray.MESSAGE_ICON_WINDOWS");
} // If we're running under MacOSX, we use a special black and
@@ -183,6 +189,7 @@ public class SystrayServiceJdicImpl
"service.systray.TRAY_ICON_OFFLINE");
logoIconAway = Resources.getImage("service.systray.TRAY_ICON_AWAY");
logoIconFFC = Resources.getImage("service.systray.TRAY_ICON_FFC");
+ logoIconDND = Resources.getImage("service.systray.TRAY_ICON_DND");
envelopeIcon = Resources.getImage("service.systray.MESSAGE_ICON");
}
@@ -208,7 +215,10 @@ public class SystrayServiceJdicImpl
"service.systray.DOCK_ICON_OFFLINE");
dockIconAway = Resources.getImageURL(
"service.systray.DOCK_ICON_AWAY");
- dockIconFFC = Resources.getImageURL("service.systray.DOCK_ICON_FFC");
+ dockIconFFC =
+ Resources.getImageURL("service.systray.DOCK_ICON_FFC");
+ dockIconDND =
+ Resources.getImageURL("service.systray.DOCK_ICON_DND");
}
//Show/hide the contact list when user clicks on the systray.
@@ -478,6 +488,11 @@ public class SystrayServiceJdicImpl
if (!isMac)
toChangeSystrayIcon = logoIconFFC;
}
+ else if (imageType == SystrayService.SC_IMG_DND_TYPE)
+ {
+ if (!isMac)
+ toChangeSystrayIcon = logoIconDND;
+ }
else if (imageType == SystrayService.ENVELOPE_IMG_TYPE)
{
toChangeSystrayIcon
@@ -509,6 +524,9 @@ public class SystrayServiceJdicImpl
case SystrayService.SC_IMG_FFC_TYPE:
toChangeDockIcon = dockIconFFC;
break;
+ case SystrayService.SC_IMG_DND_TYPE:
+ toChangeDockIcon = dockIconDND;
+ break;
}
try
diff --git a/src/net/java/sip/communicator/service/systray/SystrayService.java b/src/net/java/sip/communicator/service/systray/SystrayService.java
index 0ebb3e6..65c6bf9 100644
--- a/src/net/java/sip/communicator/service/systray/SystrayService.java
+++ b/src/net/java/sip/communicator/service/systray/SystrayService.java
@@ -47,16 +47,21 @@ public interface SystrayService
public static final int SC_IMG_OFFLINE_TYPE = 2;
/**
- * Image type corresponding to the sip-communicator offline icon
+ * Image type corresponding to the sip-communicator away icon
*/
public static final int SC_IMG_AWAY_TYPE = 3;
/**
- * Image type corresponding to the sip-communicator offline icon
+ * Image type corresponding to the sip-communicator free for chat icon
*/
public static final int SC_IMG_FFC_TYPE = 4;
/**
+ * Image type corresponding to the sip-communicator do not disturb icon
+ */
+ public static final int SC_IMG_DND_TYPE = 5;
+
+ /**
* Image type corresponding to the envelope icon
*/
public static final int ENVELOPE_IMG_TYPE = 1;