|
|
@ -54,6 +54,8 @@ |
|
|
|
#include <QUrl> |
|
|
|
#include <QUrl> |
|
|
|
#include <QMimeData> |
|
|
|
#include <QMimeData> |
|
|
|
#include <QStyle> |
|
|
|
#include <QStyle> |
|
|
|
|
|
|
|
#include <QSettings> |
|
|
|
|
|
|
|
#include <QDesktopWidget> |
|
|
|
|
|
|
|
|
|
|
|
#include <iostream> |
|
|
|
#include <iostream> |
|
|
|
|
|
|
|
|
|
|
@ -69,7 +71,7 @@ BitcoinGUI::BitcoinGUI(QWidget *parent): |
|
|
|
rpcConsole(0), |
|
|
|
rpcConsole(0), |
|
|
|
prevBlocks(0) |
|
|
|
prevBlocks(0) |
|
|
|
{ |
|
|
|
{ |
|
|
|
resize(850, 550); |
|
|
|
restoreWindowGeometry(); |
|
|
|
setWindowTitle(tr("Bitcoin") + " - " + tr("Wallet")); |
|
|
|
setWindowTitle(tr("Bitcoin") + " - " + tr("Wallet")); |
|
|
|
#ifndef Q_OS_MAC |
|
|
|
#ifndef Q_OS_MAC |
|
|
|
qApp->setWindowIcon(QIcon(":icons/bitcoin")); |
|
|
|
qApp->setWindowIcon(QIcon(":icons/bitcoin")); |
|
|
@ -187,6 +189,7 @@ BitcoinGUI::BitcoinGUI(QWidget *parent): |
|
|
|
|
|
|
|
|
|
|
|
BitcoinGUI::~BitcoinGUI() |
|
|
|
BitcoinGUI::~BitcoinGUI() |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
saveWindowGeometry(); |
|
|
|
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_OS_MAC |
|
|
|
#ifdef Q_OS_MAC |
|
|
@ -468,6 +471,28 @@ void BitcoinGUI::trayIconActivated(QSystemTrayIcon::ActivationReason reason) |
|
|
|
} |
|
|
|
} |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void BitcoinGUI::saveWindowGeometry() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
QSettings settings; |
|
|
|
|
|
|
|
settings.setValue("nWindowPos", pos()); |
|
|
|
|
|
|
|
settings.setValue("nWindowSize", size()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void BitcoinGUI::restoreWindowGeometry() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
QSettings settings; |
|
|
|
|
|
|
|
QPoint pos = settings.value("nWindowPos").toPoint(); |
|
|
|
|
|
|
|
QSize size = settings.value("nWindowSize", QSize(850, 550)).toSize(); |
|
|
|
|
|
|
|
if (!pos.x() && !pos.y()) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
QRect screen = qApp->desktop()->screenGeometry(); |
|
|
|
|
|
|
|
pos.setX((screen.width()-size.width())/2); |
|
|
|
|
|
|
|
pos.setY((screen.height()-size.height())/2); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
resize(size); |
|
|
|
|
|
|
|
move(pos); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void BitcoinGUI::optionsClicked() |
|
|
|
void BitcoinGUI::optionsClicked() |
|
|
|
{ |
|
|
|
{ |
|
|
|
if(!clientModel || !clientModel->getOptionsModel()) |
|
|
|
if(!clientModel || !clientModel->getOptionsModel()) |
|
|
|