From 5fc3a0f70784051ba213948cbee0763e1c241c19 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Thu, 23 Aug 2012 12:20:49 +0200 Subject: [PATCH 1/2] remove FIRST_CLASS_MESSAGING support from the client - removes the FIRST_CLASS_MESSAGING support from the client, which was no default setting anyway --- bitcoin-qt.pro | 6 ------ src/qt/bitcoingui.cpp | 42 ------------------------------------------ src/qt/bitcoingui.h | 1 - 3 files changed, 49 deletions(-) diff --git a/bitcoin-qt.pro b/bitcoin-qt.pro index bf0c87e7e3..12dfcffe69 100644 --- a/bitcoin-qt.pro +++ b/bitcoin-qt.pro @@ -65,12 +65,6 @@ contains(USE_DBUS, 1) { QT += dbus } -# use: qmake "FIRST_CLASS_MESSAGING=1" -contains(FIRST_CLASS_MESSAGING, 1) { - message(Building with first-class messaging) - DEFINES += FIRST_CLASS_MESSAGING -} - # use: qmake "USE_IPV6=1" ( enabled by default; default) # or: qmake "USE_IPV6=0" (disabled by default) # or: qmake "USE_IPV6=-" (not supported) diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 27b974b5c6..0ad8e95e13 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -115,9 +115,6 @@ BitcoinGUI::BitcoinGUI(QWidget *parent): centralWidget->addWidget(addressBookPage); centralWidget->addWidget(receiveCoinsPage); centralWidget->addWidget(sendCoinsPage); -#ifdef FIRST_CLASS_MESSAGING - centralWidget->addWidget(signVerifyMessageDialog); -#endif setCentralWidget(centralWidget); // Create status bar @@ -233,13 +230,6 @@ void BitcoinGUI::createActions() verifyMessageAction->setToolTip(tr("Verify a message to ensure it was signed with a specified Bitcoin address")); tabGroup->addAction(verifyMessageAction); -#ifdef FIRST_CLASS_MESSAGING - firstClassMessagingAction = new QAction(QIcon(":/icons/edit"), tr("S&ignatures"), this); - firstClassMessagingAction->setToolTip(signMessageAction->toolTip() + QString(". / ") + verifyMessageAction->toolTip() + QString(".")); - firstClassMessagingAction->setCheckable(true); - tabGroup->addAction(firstClassMessagingAction); -#endif - connect(overviewAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(overviewAction, SIGNAL(triggered()), this, SLOT(gotoOverviewPage())); connect(historyAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); @@ -254,11 +244,6 @@ void BitcoinGUI::createActions() connect(signMessageAction, SIGNAL(triggered()), this, SLOT(gotoSignMessageTab())); connect(verifyMessageAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(verifyMessageAction, SIGNAL(triggered()), this, SLOT(gotoVerifyMessageTab())); -#ifdef FIRST_CLASS_MESSAGING - connect(firstClassMessagingAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); - // Always start with the sign message tab for FIRST_CLASS_MESSAGING - connect(firstClassMessagingAction, SIGNAL(triggered()), this, SLOT(gotoSignMessageTab())); -#endif quitAction = new QAction(QIcon(":/icons/quit"), tr("E&xit"), this); quitAction->setToolTip(tr("Quit application")); @@ -310,10 +295,8 @@ void BitcoinGUI::createMenuBar() QMenu *file = appMenuBar->addMenu(tr("&File")); file->addAction(backupWalletAction); file->addAction(exportAction); -#ifndef FIRST_CLASS_MESSAGING file->addAction(signMessageAction); file->addAction(verifyMessageAction); -#endif file->addSeparator(); file->addAction(quitAction); @@ -339,9 +322,6 @@ void BitcoinGUI::createToolBars() toolbar->addAction(receiveCoinsAction); toolbar->addAction(historyAction); toolbar->addAction(addressBookAction); -#ifdef FIRST_CLASS_MESSAGING - toolbar->addAction(firstClassMessagingAction); -#endif QToolBar *toolbar2 = addToolBar(tr("Actions toolbar")); toolbar2->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); @@ -441,9 +421,7 @@ void BitcoinGUI::createTrayIcon() trayIconMenu->addSeparator(); trayIconMenu->addAction(sendCoinsAction); trayIconMenu->addAction(receiveCoinsAction); -#ifndef FIRST_CLASS_MESSAGING trayIconMenu->addSeparator(); -#endif trayIconMenu->addAction(signMessageAction); trayIconMenu->addAction(verifyMessageAction); trayIconMenu->addSeparator(); @@ -747,18 +725,8 @@ void BitcoinGUI::gotoSendCoinsPage() void BitcoinGUI::gotoSignMessageTab(QString addr) { -#ifdef FIRST_CLASS_MESSAGING - firstClassMessagingAction->setChecked(true); - centralWidget->setCurrentWidget(signVerifyMessageDialog); - - exportAction->setEnabled(false); - disconnect(exportAction, SIGNAL(triggered()), 0, 0); - - signVerifyMessageDialog->showTab_SM(false); -#else // call show() in showTab_SM() signVerifyMessageDialog->showTab_SM(true); -#endif if(!addr.isEmpty()) signVerifyMessageDialog->setAddress_SM(addr); @@ -766,18 +734,8 @@ void BitcoinGUI::gotoSignMessageTab(QString addr) void BitcoinGUI::gotoVerifyMessageTab(QString addr) { -#ifdef FIRST_CLASS_MESSAGING - firstClassMessagingAction->setChecked(true); - centralWidget->setCurrentWidget(signVerifyMessageDialog); - - exportAction->setEnabled(false); - disconnect(exportAction, SIGNAL(triggered()), 0, 0); - - signVerifyMessageDialog->showTab_VM(false); -#else // call show() in showTab_VM() signVerifyMessageDialog->showTab_VM(true); -#endif if(!addr.isEmpty()) signVerifyMessageDialog->setAddress_VM(addr); diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h index acf84eb941..7f2022c28b 100644 --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -80,7 +80,6 @@ private: QAction *addressBookAction; QAction *signMessageAction; QAction *verifyMessageAction; - QAction *firstClassMessagingAction; QAction *aboutAction; QAction *receiveCoinsAction; QAction *optionsAction; From 382e9e25ffb12d26fe6f28442466376107aca9d7 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Wed, 29 Aug 2012 10:12:34 +0200 Subject: [PATCH 2/2] Qt: re-order GUI code - re-order Qt Actions and connect() calls to match the real GUI layout, which makes things easier to read and understand - remove signMessageAction and verifyMessageAction from tabGroup as we didn't use them anyway (as tooltips are not displayed in the menu remove these too) - update 2 comments --- src/qt/bitcoingui.cpp | 59 +++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 33 deletions(-) diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 0ad8e95e13..4e8bc8d31b 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -198,6 +198,18 @@ void BitcoinGUI::createActions() overviewAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_1)); tabGroup->addAction(overviewAction); + sendCoinsAction = new QAction(QIcon(":/icons/send"), tr("&Send coins"), this); + sendCoinsAction->setToolTip(tr("Send coins to a Bitcoin address")); + sendCoinsAction->setCheckable(true); + sendCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_2)); + tabGroup->addAction(sendCoinsAction); + + receiveCoinsAction = new QAction(QIcon(":/icons/receiving_addresses"), tr("&Receive coins"), this); + receiveCoinsAction->setToolTip(tr("Show the list of addresses for receiving payments")); + receiveCoinsAction->setCheckable(true); + receiveCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_3)); + tabGroup->addAction(receiveCoinsAction); + historyAction = new QAction(QIcon(":/icons/history"), tr("&Transactions"), this); historyAction->setToolTip(tr("Browse transaction history")); historyAction->setCheckable(true); @@ -210,40 +222,16 @@ void BitcoinGUI::createActions() addressBookAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_5)); tabGroup->addAction(addressBookAction); - receiveCoinsAction = new QAction(QIcon(":/icons/receiving_addresses"), tr("&Receive coins"), this); - receiveCoinsAction->setToolTip(tr("Show the list of addresses for receiving payments")); - receiveCoinsAction->setCheckable(true); - receiveCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_3)); - tabGroup->addAction(receiveCoinsAction); - - sendCoinsAction = new QAction(QIcon(":/icons/send"), tr("&Send coins"), this); - sendCoinsAction->setToolTip(tr("Send coins to a Bitcoin address")); - sendCoinsAction->setCheckable(true); - sendCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_2)); - tabGroup->addAction(sendCoinsAction); - - signMessageAction = new QAction(QIcon(":/icons/edit"), tr("Sign &message..."), this); - signMessageAction->setToolTip(tr("Sign a message to prove you own a Bitcoin address")); - tabGroup->addAction(signMessageAction); - - verifyMessageAction = new QAction(QIcon(":/icons/transaction_0"), tr("&Verify message..."), this); - verifyMessageAction->setToolTip(tr("Verify a message to ensure it was signed with a specified Bitcoin address")); - tabGroup->addAction(verifyMessageAction); - connect(overviewAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(overviewAction, SIGNAL(triggered()), this, SLOT(gotoOverviewPage())); + connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); + connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(gotoSendCoinsPage())); + connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); + connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(gotoReceiveCoinsPage())); connect(historyAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(historyAction, SIGNAL(triggered()), this, SLOT(gotoHistoryPage())); connect(addressBookAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(addressBookAction, SIGNAL(triggered()), this, SLOT(gotoAddressBookPage())); - connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); - connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(gotoReceiveCoinsPage())); - connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); - connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(gotoSendCoinsPage())); - connect(signMessageAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); - connect(signMessageAction, SIGNAL(triggered()), this, SLOT(gotoSignMessageTab())); - connect(verifyMessageAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); - connect(verifyMessageAction, SIGNAL(triggered()), this, SLOT(gotoVerifyMessageTab())); quitAction = new QAction(QIcon(":/icons/quit"), tr("E&xit"), this); quitAction->setToolTip(tr("Quit application")); @@ -259,8 +247,6 @@ void BitcoinGUI::createActions() optionsAction->setToolTip(tr("Modify configuration options for Bitcoin")); optionsAction->setMenuRole(QAction::PreferencesRole); toggleHideAction = new QAction(QIcon(":/icons/bitcoin"), tr("&Show / Hide"), this); - exportAction = new QAction(QIcon(":/icons/export"), tr("&Export..."), this); - exportAction->setToolTip(tr("Export the data in the current tab to a file")); encryptWalletAction = new QAction(QIcon(":/icons/lock_closed"), tr("&Encrypt Wallet..."), this); encryptWalletAction->setToolTip(tr("Encrypt or decrypt wallet")); encryptWalletAction->setCheckable(true); @@ -268,17 +254,24 @@ void BitcoinGUI::createActions() backupWalletAction->setToolTip(tr("Backup wallet to another location")); changePassphraseAction = new QAction(QIcon(":/icons/key"), tr("&Change Passphrase..."), this); changePassphraseAction->setToolTip(tr("Change the passphrase used for wallet encryption")); + signMessageAction = new QAction(QIcon(":/icons/edit"), tr("Sign &message..."), this); + verifyMessageAction = new QAction(QIcon(":/icons/transaction_0"), tr("&Verify message..."), this); + + exportAction = new QAction(QIcon(":/icons/export"), tr("&Export..."), this); + exportAction->setToolTip(tr("Export the data in the current tab to a file")); openRPCConsoleAction = new QAction(QIcon(":/icons/debugwindow"), tr("&Debug window"), this); openRPCConsoleAction->setToolTip(tr("Open debugging and diagnostic console")); connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit())); - connect(optionsAction, SIGNAL(triggered()), this, SLOT(optionsClicked())); connect(aboutAction, SIGNAL(triggered()), this, SLOT(aboutClicked())); connect(aboutQtAction, SIGNAL(triggered()), qApp, SLOT(aboutQt())); + connect(optionsAction, SIGNAL(triggered()), this, SLOT(optionsClicked())); connect(toggleHideAction, SIGNAL(triggered()), this, SLOT(toggleHidden())); connect(encryptWalletAction, SIGNAL(triggered(bool)), this, SLOT(encryptWallet(bool))); connect(backupWalletAction, SIGNAL(triggered()), this, SLOT(backupWallet())); connect(changePassphraseAction, SIGNAL(triggered()), this, SLOT(changePassphrase())); + connect(signMessageAction, SIGNAL(triggered()), this, SLOT(gotoSignMessageTab())); + connect(verifyMessageAction, SIGNAL(triggered()), this, SLOT(gotoVerifyMessageTab())); } void BitcoinGUI::createMenuBar() @@ -479,7 +472,7 @@ void BitcoinGUI::setNumConnections(int count) void BitcoinGUI::setNumBlocks(int count, int nTotalBlocks) { - // don't show / hide progressBar and its label if we have no connection(s) to the network + // don't show / hide progress bar and it's label if we have no connection to the network if (!clientModel || clientModel->getNumConnections() == 0) { progressBarLabel->setVisible(false); @@ -517,7 +510,7 @@ void BitcoinGUI::setNumBlocks(int count, int nTotalBlocks) tooltip = tr("Downloaded %1 blocks of transaction history.").arg(count); } - // Override progressBarLabel text and hide progressBar, when we have warnings to display + // Override progressBarLabel text and hide progress bar, when we have warnings to display if (!strStatusBarWarnings.isEmpty()) { progressBarLabel->setText(strStatusBarWarnings);