Migrating from 2.0 branch.

git-svn-id: http://svn.igniterealtime.org/svn/repos/spark/trunk@6311 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Derek DeMoro
2006-12-05 14:30:35 +00:00
committed by derek
parent 850b2b3ac6
commit 64a53231b7
5 changed files with 102 additions and 53 deletions

View File

@ -91,7 +91,7 @@ public final class Notifications implements ActionListener, MainWindowListener {
unavaliableIcon = SparkRes.getImageIcon(SparkRes.MESSAGE_AWAY);
busyIcon = SparkRes.getImageIcon(SparkRes.MESSAGE_DND);
trayIcon = new TrayIcon(availableIcon);
trayIcon.setToolTip("Spark"); // NORES
trayIcon.setToolTip("Spark Client"); // NORES
JPopupMenu popupMenu = new JPopupMenu(Res.getString("title.tray.information"));
@ -161,6 +161,12 @@ public final class Notifications implements ActionListener, MainWindowListener {
else {
trayIcon.setIcon(busyIcon);
}
// Get Status Text
if (presence != null) {
String status = presence.getStatus();
trayIcon.setToolTip("Spark Client\n" + status);
}
}
/**
@ -233,7 +239,13 @@ public final class Notifications implements ActionListener, MainWindowListener {
public void actionPerformed(ActionEvent e) {
Object o = e.getSource();
if (!(o instanceof JMenuItem)) {
showMainWindow();
if (SparkManager.getMainWindow().isVisible()) {
SparkManager.getMainWindow().setVisible(false);
hideMenu.setEnabled(false);
}
else {
showMainWindow();
}
return;
}
@ -284,6 +296,8 @@ public final class Notifications implements ActionListener, MainWindowListener {
notificationDialog.setVisible(false);
hideMenu.setEnabled(true);
SparkManager.getMainWindow().toFront();
}