Merge branch 'master' of github.com:Qortal/qortal

This commit is contained in:
CalDescent 2021-07-30 09:00:54 +01:00
commit 476d613e20
10 changed files with 70 additions and 26 deletions

View File

@ -25,6 +25,12 @@ public class CrossChainTradeSummary {
@XmlJavaTypeAdapter(value = org.qortal.api.AmountTypeAdapter.class) @XmlJavaTypeAdapter(value = org.qortal.api.AmountTypeAdapter.class)
private long foreignAmount; private long foreignAmount;
private String atAddress;
private String sellerAddress;
private String buyerReceivingAddress;
protected CrossChainTradeSummary() { protected CrossChainTradeSummary() {
/* For JAXB */ /* For JAXB */
} }
@ -34,6 +40,9 @@ public class CrossChainTradeSummary {
this.qortAmount = crossChainTradeData.qortAmount; this.qortAmount = crossChainTradeData.qortAmount;
this.foreignAmount = crossChainTradeData.expectedForeignAmount; this.foreignAmount = crossChainTradeData.expectedForeignAmount;
this.btcAmount = this.foreignAmount; this.btcAmount = this.foreignAmount;
this.sellerAddress = crossChainTradeData.qortalCreator;
this.buyerReceivingAddress = crossChainTradeData.qortalPartnerReceivingAddress;
this.atAddress = crossChainTradeData.qortalAtAddress;
} }
public long getTradeTimestamp() { public long getTradeTimestamp() {
@ -48,7 +57,11 @@ public class CrossChainTradeSummary {
return this.btcAmount; return this.btcAmount;
} }
public long getForeignAmount() { public long getForeignAmount() { return this.foreignAmount; }
return this.foreignAmount;
} public String getAtAddress() { return this.atAddress; }
public String getSellerAddress() { return this.sellerAddress; }
public String getBuyerReceivingAddressAddress() { return this.buyerReceivingAddress; }
} }

View File

@ -854,6 +854,7 @@ public class Controller extends Thread {
private void updateSysTray() { private void updateSysTray() {
if (NTP.getTime() == null) { if (NTP.getTime() == null) {
SysTray.getInstance().setToolTipText(Translator.INSTANCE.translate("SysTray", "SYNCHRONIZING_CLOCK")); SysTray.getInstance().setToolTipText(Translator.INSTANCE.translate("SysTray", "SYNCHRONIZING_CLOCK"));
SysTray.getInstance().setTrayIcon(1);
return; return;
} }
@ -867,14 +868,22 @@ public class Controller extends Thread {
String actionText; String actionText;
synchronized (this.syncLock) { synchronized (this.syncLock) {
if (this.isMintingPossible) if (this.isMintingPossible) {
actionText = Translator.INSTANCE.translate("SysTray", "MINTING_ENABLED"); 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); 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"); actionText = Translator.INSTANCE.translate("SysTray", "CONNECTING");
else SysTray.getInstance().setTrayIcon(3);
}
else {
actionText = Translator.INSTANCE.translate("SysTray", "MINTING_DISABLED"); 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); String tooltip = String.format("%s - %d %s - %s %d", actionText, numberOfPeers, connectionsText, heightText, height) + "\n" + String.format("Build version: %s", this.buildVersion);

View File

@ -1,15 +1,11 @@
package org.qortal.gui; package org.qortal.gui;
import java.awt.BorderLayout; import java.awt.*;
import java.awt.Image;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import javax.swing.JDialog; import javax.swing.*;
import javax.swing.JPanel;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
@ -19,46 +15,53 @@ public class SplashFrame {
protected static final Logger LOGGER = LogManager.getLogger(SplashFrame.class); protected static final Logger LOGGER = LogManager.getLogger(SplashFrame.class);
private static SplashFrame instance; private static SplashFrame instance;
private JDialog splashDialog; private JFrame splashDialog;
@SuppressWarnings("serial") @SuppressWarnings("serial")
public static class SplashPanel extends JPanel { public static class SplashPanel extends JPanel {
private BufferedImage image; private BufferedImage image;
private String defaultSplash = "Qlogo_512.png";
public SplashPanel() { public SplashPanel() {
image = Gui.loadImage("splash.png"); image = Gui.loadImage(defaultSplash);
this.setPreferredSize(new Dimension(image.getWidth(), image.getHeight()));
this.setLayout(new BorderLayout()); setOpaque(false);
setLayout(new GridBagLayout());
} }
@Override @Override
protected void paintComponent(Graphics g) { protected void paintComponent(Graphics g) {
super.paintComponent(g); super.paintComponent(g);
g.drawImage(image, 0, 0, null); g.drawImage(image, 0, 0, getWidth(), getHeight(), this);
}
@Override
public Dimension getPreferredSize() {
return new Dimension(500, 500);
} }
} }
private SplashFrame() { private SplashFrame() {
this.splashDialog = new JDialog(); this.splashDialog = new JFrame();
List<Image> icons = new ArrayList<>(); List<Image> icons = new ArrayList<>();
icons.add(Gui.loadImage("icons/icon16.png")); icons.add(Gui.loadImage("icons/icon16.png"));
icons.add(Gui.loadImage("icons/icon32.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/icon64.png"));
icons.add(Gui.loadImage("icons/icon128.png")); icons.add(Gui.loadImage("icons/icon128.png"));
this.splashDialog.setIconImages(icons); this.splashDialog.setIconImages(icons);
this.splashDialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); this.splashDialog.getContentPane().add(new SplashPanel());
this.splashDialog.setTitle("qortal"); this.splashDialog.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
this.splashDialog.setContentPane(new SplashPanel());
this.splashDialog.setUndecorated(true); this.splashDialog.setUndecorated(true);
this.splashDialog.setModal(false);
this.splashDialog.pack(); this.splashDialog.pack();
this.splashDialog.setLocationRelativeTo(null); this.splashDialog.setLocationRelativeTo(null);
this.splashDialog.toFront(); this.splashDialog.setBackground(new Color(0,0,0,0));
this.splashDialog.setVisible(true); this.splashDialog.setVisible(true);
this.splashDialog.repaint();
} }
public static SplashFrame getInstance() { public static SplashFrame getInstance() {

View File

@ -289,6 +289,25 @@ public class SysTray {
this.trayIcon.setToolTip(text); 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() { public void dispose() {
if (trayIcon != null) if (trayIcon != null)
SystemTray.getSystemTray().remove(this.trayIcon); SystemTray.getSystemTray().remove(this.trayIcon);

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 694 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 987 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 762 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 676 B

0
src/main/resources/images/splash.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 77 KiB

After

Width:  |  Height:  |  Size: 77 KiB