|
|
@ -26,7 +26,7 @@ |
|
|
|
#include "guiutil.h" |
|
|
|
#include "guiutil.h" |
|
|
|
#include "rpcconsole.h" |
|
|
|
#include "rpcconsole.h" |
|
|
|
|
|
|
|
|
|
|
|
#ifdef Q_WS_MAC |
|
|
|
#ifdef Q_OS_MAC |
|
|
|
#include "macdockiconhandler.h" |
|
|
|
#include "macdockiconhandler.h" |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
@ -70,7 +70,7 @@ BitcoinGUI::BitcoinGUI(QWidget *parent): |
|
|
|
{ |
|
|
|
{ |
|
|
|
resize(850, 550); |
|
|
|
resize(850, 550); |
|
|
|
setWindowTitle(tr("Bitcoin") + " - " + tr("Wallet")); |
|
|
|
setWindowTitle(tr("Bitcoin") + " - " + tr("Wallet")); |
|
|
|
#ifndef Q_WS_MAC |
|
|
|
#ifndef Q_OS_MAC |
|
|
|
qApp->setWindowIcon(QIcon(":icons/bitcoin")); |
|
|
|
qApp->setWindowIcon(QIcon(":icons/bitcoin")); |
|
|
|
setWindowIcon(QIcon(":icons/bitcoin")); |
|
|
|
setWindowIcon(QIcon(":icons/bitcoin")); |
|
|
|
#else |
|
|
|
#else |
|
|
@ -183,7 +183,7 @@ BitcoinGUI::~BitcoinGUI() |
|
|
|
{ |
|
|
|
{ |
|
|
|
if(trayIcon) // Hide tray icon, as deleting will let it linger until quit (on Ubuntu)
|
|
|
|
if(trayIcon) // Hide tray icon, as deleting will let it linger until quit (on Ubuntu)
|
|
|
|
trayIcon->hide(); |
|
|
|
trayIcon->hide(); |
|
|
|
#ifdef Q_WS_MAC |
|
|
|
#ifdef Q_OS_MAC |
|
|
|
delete appMenuBar; |
|
|
|
delete appMenuBar; |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
} |
|
|
|
} |
|
|
@ -276,7 +276,7 @@ void BitcoinGUI::createActions() |
|
|
|
|
|
|
|
|
|
|
|
void BitcoinGUI::createMenuBar() |
|
|
|
void BitcoinGUI::createMenuBar() |
|
|
|
{ |
|
|
|
{ |
|
|
|
#ifdef Q_WS_MAC |
|
|
|
#ifdef Q_OS_MAC |
|
|
|
// Create a decoupled menu bar on Mac which stays even if the window is closed
|
|
|
|
// Create a decoupled menu bar on Mac which stays even if the window is closed
|
|
|
|
appMenuBar = new QMenuBar(); |
|
|
|
appMenuBar = new QMenuBar(); |
|
|
|
#else |
|
|
|
#else |
|
|
@ -330,7 +330,7 @@ void BitcoinGUI::setClientModel(ClientModel *clientModel) |
|
|
|
if(clientModel->isTestNet()) |
|
|
|
if(clientModel->isTestNet()) |
|
|
|
{ |
|
|
|
{ |
|
|
|
setWindowTitle(windowTitle() + QString(" ") + tr("[testnet]")); |
|
|
|
setWindowTitle(windowTitle() + QString(" ") + tr("[testnet]")); |
|
|
|
#ifndef Q_WS_MAC |
|
|
|
#ifndef Q_OS_MAC |
|
|
|
qApp->setWindowIcon(QIcon(":icons/bitcoin_testnet")); |
|
|
|
qApp->setWindowIcon(QIcon(":icons/bitcoin_testnet")); |
|
|
|
setWindowIcon(QIcon(":icons/bitcoin_testnet")); |
|
|
|
setWindowIcon(QIcon(":icons/bitcoin_testnet")); |
|
|
|
#else |
|
|
|
#else |
|
|
@ -394,7 +394,7 @@ void BitcoinGUI::setWalletModel(WalletModel *walletModel) |
|
|
|
void BitcoinGUI::createTrayIcon() |
|
|
|
void BitcoinGUI::createTrayIcon() |
|
|
|
{ |
|
|
|
{ |
|
|
|
QMenu *trayIconMenu; |
|
|
|
QMenu *trayIconMenu; |
|
|
|
#ifndef Q_WS_MAC |
|
|
|
#ifndef Q_OS_MAC |
|
|
|
trayIcon = new QSystemTrayIcon(this); |
|
|
|
trayIcon = new QSystemTrayIcon(this); |
|
|
|
trayIconMenu = new QMenu(this); |
|
|
|
trayIconMenu = new QMenu(this); |
|
|
|
trayIcon->setContextMenu(trayIconMenu); |
|
|
|
trayIcon->setContextMenu(trayIconMenu); |
|
|
@ -420,7 +420,7 @@ void BitcoinGUI::createTrayIcon() |
|
|
|
trayIconMenu->addSeparator(); |
|
|
|
trayIconMenu->addSeparator(); |
|
|
|
trayIconMenu->addAction(optionsAction); |
|
|
|
trayIconMenu->addAction(optionsAction); |
|
|
|
trayIconMenu->addAction(openRPCConsoleAction); |
|
|
|
trayIconMenu->addAction(openRPCConsoleAction); |
|
|
|
#ifndef Q_WS_MAC // This is built-in on Mac
|
|
|
|
#ifndef Q_OS_MAC // This is built-in on Mac
|
|
|
|
trayIconMenu->addSeparator(); |
|
|
|
trayIconMenu->addSeparator(); |
|
|
|
trayIconMenu->addAction(quitAction); |
|
|
|
trayIconMenu->addAction(quitAction); |
|
|
|
#endif |
|
|
|
#endif |
|
|
@ -428,7 +428,7 @@ void BitcoinGUI::createTrayIcon() |
|
|
|
notificator = new Notificator(qApp->applicationName(), trayIcon); |
|
|
|
notificator = new Notificator(qApp->applicationName(), trayIcon); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#ifndef Q_WS_MAC |
|
|
|
#ifndef Q_OS_MAC |
|
|
|
void BitcoinGUI::trayIconActivated(QSystemTrayIcon::ActivationReason reason) |
|
|
|
void BitcoinGUI::trayIconActivated(QSystemTrayIcon::ActivationReason reason) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if(reason == QSystemTrayIcon::Trigger) |
|
|
|
if(reason == QSystemTrayIcon::Trigger) |
|
|
@ -589,7 +589,7 @@ void BitcoinGUI::error(const QString &title, const QString &message, bool modal) |
|
|
|
void BitcoinGUI::changeEvent(QEvent *e) |
|
|
|
void BitcoinGUI::changeEvent(QEvent *e) |
|
|
|
{ |
|
|
|
{ |
|
|
|
QMainWindow::changeEvent(e); |
|
|
|
QMainWindow::changeEvent(e); |
|
|
|
#ifndef Q_WS_MAC // Ignored on Mac
|
|
|
|
#ifndef Q_OS_MAC // Ignored on Mac
|
|
|
|
if(e->type() == QEvent::WindowStateChange) |
|
|
|
if(e->type() == QEvent::WindowStateChange) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if(clientModel && clientModel->getOptionsModel()->getMinimizeToTray()) |
|
|
|
if(clientModel && clientModel->getOptionsModel()->getMinimizeToTray()) |
|
|
@ -609,7 +609,7 @@ void BitcoinGUI::closeEvent(QCloseEvent *event) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if(clientModel) |
|
|
|
if(clientModel) |
|
|
|
{ |
|
|
|
{ |
|
|
|
#ifndef Q_WS_MAC // Ignored on Mac
|
|
|
|
#ifndef Q_OS_MAC // Ignored on Mac
|
|
|
|
if(!clientModel->getOptionsModel()->getMinimizeToTray() && |
|
|
|
if(!clientModel->getOptionsModel()->getMinimizeToTray() && |
|
|
|
!clientModel->getOptionsModel()->getMinimizeOnClose()) |
|
|
|
!clientModel->getOptionsModel()->getMinimizeOnClose()) |
|
|
|
{ |
|
|
|
{ |
|
|
|