Changeset View
Changeset View
Standalone View
Standalone View
src/qt/bitcoingui.cpp
Show First 20 Lines • Show All 73 Lines • ▼ Show 20 Lines | |||||
*/ | */ | ||||
const QString BitcoinGUI::DEFAULT_WALLET = "~Default"; | const QString BitcoinGUI::DEFAULT_WALLET = "~Default"; | ||||
BitcoinGUI::BitcoinGUI(const Config *configIn, | BitcoinGUI::BitcoinGUI(const Config *configIn, | ||||
const PlatformStyle *_platformStyle, | const PlatformStyle *_platformStyle, | ||||
const NetworkStyle *networkStyle, QWidget *parent) | const NetworkStyle *networkStyle, QWidget *parent) | ||||
: QMainWindow(parent), enableWallet(false), platformStyle(_platformStyle), | : QMainWindow(parent), enableWallet(false), platformStyle(_platformStyle), | ||||
config(configIn) { | config(configIn) { | ||||
GUIUtil::restoreWindowGeometry("nWindow", QSize(850, 550), this); | QSettings settings; | ||||
if (!restoreGeometry(settings.value("MainWindowGeometry").toByteArray())) { | |||||
// Restore failed (perhaps missing setting), center the window | |||||
move(QApplication::desktop()->availableGeometry().center() - | |||||
frameGeometry().center()); | |||||
} | |||||
QString windowTitle = tr(PACKAGE_NAME) + " - "; | QString windowTitle = tr(PACKAGE_NAME) + " - "; | ||||
#ifdef ENABLE_WALLET | #ifdef ENABLE_WALLET | ||||
enableWallet = WalletModel::isWalletEnabled(); | enableWallet = WalletModel::isWalletEnabled(); | ||||
#endif // ENABLE_WALLET | #endif // ENABLE_WALLET | ||||
if (enableWallet) { | if (enableWallet) { | ||||
windowTitle += tr("Wallet"); | windowTitle += tr("Wallet"); | ||||
} else { | } else { | ||||
▲ Show 20 Lines • Show All 122 Lines • ▼ Show 20 Lines | #ifdef ENABLE_WALLET | ||||
} | } | ||||
#endif | #endif | ||||
} | } | ||||
BitcoinGUI::~BitcoinGUI() { | BitcoinGUI::~BitcoinGUI() { | ||||
// Unsubscribe from notifications from core | // Unsubscribe from notifications from core | ||||
unsubscribeFromCoreSignals(); | unsubscribeFromCoreSignals(); | ||||
GUIUtil::saveWindowGeometry("nWindow", this); | QSettings settings; | ||||
settings.setValue("MainWindowGeometry", saveGeometry()); | |||||
// Hide tray icon, as deleting will let it linger until quit (on Ubuntu) | // Hide tray icon, as deleting will let it linger until quit (on Ubuntu) | ||||
if (trayIcon) { | if (trayIcon) { | ||||
trayIcon->hide(); | trayIcon->hide(); | ||||
} | } | ||||
#ifdef Q_OS_MAC | #ifdef Q_OS_MAC | ||||
delete appMenuBar; | delete appMenuBar; | ||||
MacDockIconHandler::cleanup(); | MacDockIconHandler::cleanup(); | ||||
#endif | #endif | ||||
▲ Show 20 Lines • Show All 1,047 Lines • Show Last 20 Lines |