forked from Qortal/qortal
Merge remote-tracking branch 'qm/status-on-icon' into update-splash
This commit is contained in:
commit
3c47f6917a
@ -854,6 +854,7 @@ public class Controller extends Thread {
|
||||
private void updateSysTray() {
|
||||
if (NTP.getTime() == null) {
|
||||
SysTray.getInstance().setToolTipText(Translator.INSTANCE.translate("SysTray", "SYNCHRONIZING_CLOCK"));
|
||||
SysTray.getInstance().setTrayIcon(1);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -867,14 +868,22 @@ public class Controller extends Thread {
|
||||
String actionText;
|
||||
|
||||
synchronized (this.syncLock) {
|
||||
if (this.isMintingPossible)
|
||||
if (this.isMintingPossible) {
|
||||
actionText = Translator.INSTANCE.translate("SysTray", "MINTING_ENABLED");
|
||||
else if (this.isSynchronizing)
|
||||
SysTray.getInstance().setTrayIcon(2);
|
||||
}
|
||||
else if (this.isSynchronizing) {
|
||||
actionText = String.format("%s - %d%%", Translator.INSTANCE.translate("SysTray", "SYNCHRONIZING_BLOCKCHAIN"), this.syncPercent);
|
||||
else if (numberOfPeers < Settings.getInstance().getMinBlockchainPeers())
|
||||
SysTray.getInstance().setTrayIcon(3);
|
||||
}
|
||||
else if (numberOfPeers < Settings.getInstance().getMinBlockchainPeers()) {
|
||||
actionText = Translator.INSTANCE.translate("SysTray", "CONNECTING");
|
||||
else
|
||||
SysTray.getInstance().setTrayIcon(3);
|
||||
}
|
||||
else {
|
||||
actionText = Translator.INSTANCE.translate("SysTray", "MINTING_DISABLED");
|
||||
SysTray.getInstance().setTrayIcon(4);
|
||||
}
|
||||
}
|
||||
|
||||
String tooltip = String.format("%s - %d %s - %s %d", actionText, numberOfPeers, connectionsText, heightText, height) + "\n" + String.format("Build version: %s", this.buildVersion);
|
||||
|
@ -48,6 +48,9 @@ public class SplashFrame {
|
||||
List<Image> icons = new ArrayList<>();
|
||||
icons.add(Gui.loadImage("icons/icon16.png"));
|
||||
icons.add(Gui.loadImage("icons/icon32.png"));
|
||||
icons.add(Gui.loadImage("icons/icon32c.png"));
|
||||
icons.add(Gui.loadImage("icons/icon32m.png"));
|
||||
icons.add(Gui.loadImage("icons/icon32n.png"));
|
||||
icons.add(Gui.loadImage("icons/icon64.png"));
|
||||
icons.add(Gui.loadImage("icons/icon128.png"));
|
||||
this.splashDialog.setIconImages(icons);
|
||||
|
@ -289,6 +289,25 @@ public class SysTray {
|
||||
this.trayIcon.setToolTip(text);
|
||||
}
|
||||
|
||||
public void setTrayIcon(int iconid) {
|
||||
if (trayIcon != null) {
|
||||
switch (iconid) {
|
||||
case 1:
|
||||
this.trayIcon.setImage(Gui.loadImage("icons/icon32c.png"));
|
||||
break;
|
||||
case 2:
|
||||
this.trayIcon.setImage(Gui.loadImage("icons/icon32m.png"));
|
||||
break;
|
||||
case 3:
|
||||
this.trayIcon.setImage(Gui.loadImage("icons/icon32n.png"));
|
||||
break;
|
||||
case 4:
|
||||
this.trayIcon.setImage(Gui.loadImage("icons/icon32.png"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void dispose() {
|
||||
if (trayIcon != null)
|
||||
SystemTray.getSystemTray().remove(this.trayIcon);
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 694 B |
BIN
src/main/resources/images/icons/icon32c.png
Normal file
BIN
src/main/resources/images/icons/icon32c.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 987 B |
BIN
src/main/resources/images/icons/icon32m.png
Normal file
BIN
src/main/resources/images/icons/icon32m.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 762 B |
BIN
src/main/resources/images/icons/icon32n.png
Normal file
BIN
src/main/resources/images/icons/icon32n.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 676 B |
Loading…
x
Reference in New Issue
Block a user