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