diff options
Diffstat (limited to 'src/qt')
-rw-r--r-- | src/qt/aboutdialog.cpp | 7 | ||||
-rw-r--r-- | src/qt/addressbookpage.cpp | 4 | ||||
-rw-r--r-- | src/qt/addressbookpage.h | 3 | ||||
-rw-r--r-- | src/qt/bitcoingui.cpp | 23 | ||||
-rw-r--r-- | src/qt/bitcoingui.h | 2 | ||||
-rw-r--r-- | src/qt/forms/addressbookpage.ui | 14 | ||||
-rw-r--r-- | src/qt/res/bitcoin-qt.rc | 3 | ||||
-rw-r--r-- | src/qt/walletview.cpp | 30 |
8 files changed, 44 insertions, 42 deletions
diff --git a/src/qt/aboutdialog.cpp b/src/qt/aboutdialog.cpp index 755413b2bb..57818b8a27 100644 --- a/src/qt/aboutdialog.cpp +++ b/src/qt/aboutdialog.cpp @@ -2,10 +2,7 @@ #include "ui_aboutdialog.h" #include "clientmodel.h" - -// Copyright year (2009-this) -// Todo: update this when changing our copyright comments in the source -const int ABOUTDIALOG_COPYRIGHT_YEAR = 2013; +#include "clientversion.h" AboutDialog::AboutDialog(QWidget *parent) : QDialog(parent), @@ -14,7 +11,7 @@ AboutDialog::AboutDialog(QWidget *parent) : ui->setupUi(this); // Set current copyright year - ui->copyrightLabel->setText(tr("Copyright") + QString(" © ") + tr("2009-%1 The Bitcoin developers").arg(ABOUTDIALOG_COPYRIGHT_YEAR)); + ui->copyrightLabel->setText(tr("Copyright") + QString(" © ") + tr("2009-%1 The Bitcoin developers").arg(COPYRIGHT_YEAR)); } void AboutDialog::setModel(ClientModel *model) diff --git a/src/qt/addressbookpage.cpp b/src/qt/addressbookpage.cpp index 23c69fef21..8529c88b39 100644 --- a/src/qt/addressbookpage.cpp +++ b/src/qt/addressbookpage.cpp @@ -33,6 +33,7 @@ AddressBookPage::AddressBookPage(Mode mode, Tabs tab, QWidget *parent) : ui->deleteAddress->setIcon(QIcon()); ui->verifyMessage->setIcon(QIcon()); ui->signMessage->setIcon(QIcon()); + ui->exportButton->setIcon(QIcon()); #endif #ifndef USE_QRCODE @@ -45,6 +46,7 @@ AddressBookPage::AddressBookPage(Mode mode, Tabs tab, QWidget *parent) : connect(ui->tableView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(accept())); ui->tableView->setEditTriggers(QAbstractItemView::NoEditTriggers); ui->tableView->setFocus(); + ui->exportButton->hide(); break; case ForEditing: ui->buttonBox->setVisible(false); @@ -323,7 +325,7 @@ void AddressBookPage::done(int retval) QDialog::done(retval); } -void AddressBookPage::exportClicked() +void AddressBookPage::on_exportButton_clicked() { // CSV is currently the only supported format QString filename = GUIUtil::getSaveFileName( diff --git a/src/qt/addressbookpage.h b/src/qt/addressbookpage.h index 0631781685..34465aa65f 100644 --- a/src/qt/addressbookpage.h +++ b/src/qt/addressbookpage.h @@ -43,7 +43,6 @@ public: public slots: void done(int retval); - void exportClicked(); private: Ui::AddressBookPage *ui; @@ -76,6 +75,8 @@ private slots: void onCopyLabelAction(); /** Edit currently selected address entry (no button) */ void onEditAction(); + /** Export button clicked */ + void on_exportButton_clicked(); /** Set button states based on selected tab and selection */ void selectionChanged(); diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 27272e69e1..14d738d9da 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -236,9 +236,6 @@ void BitcoinGUI::createActions() verifyMessageAction = new QAction(QIcon(":/icons/transaction_0"), tr("&Verify message..."), this); verifyMessageAction->setStatusTip(tr("Verify messages to ensure they were signed with specified Bitcoin addresses")); - exportAction = new QAction(QIcon(":/icons/export"), tr("&Export..."), this); - exportAction->setStatusTip(tr("Export the data in the current tab to a file")); - exportAction->setToolTip(exportAction->statusTip()); openRPCConsoleAction = new QAction(QIcon(":/icons/debugwindow"), tr("&Debug window"), this); openRPCConsoleAction->setStatusTip(tr("Open debugging and diagnostic console")); @@ -267,7 +264,6 @@ void BitcoinGUI::createMenuBar() // Configure the menus QMenu *file = appMenuBar->addMenu(tr("&File")); file->addAction(backupWalletAction); - file->addAction(exportAction); file->addAction(signMessageAction); file->addAction(verifyMessageAction); file->addSeparator(); @@ -295,10 +291,6 @@ void BitcoinGUI::createToolBars() toolbar->addAction(receiveCoinsAction); toolbar->addAction(historyAction); toolbar->addAction(addressBookAction); - - QToolBar *toolbar2 = addToolBar(tr("Actions toolbar")); - toolbar2->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); - toolbar2->addAction(exportAction); } void BitcoinGUI::setClientModel(ClientModel *clientModel) @@ -611,25 +603,28 @@ void BitcoinGUI::setNumBlocks(int count, int nTotalBlocks) void BitcoinGUI::message(const QString &title, const QString &message, unsigned int style, bool *ret) { - QString strTitle = tr("Bitcoin") + " - "; + QString strTitle = tr("Bitcoin"); // default title // Default to information icon int nMBoxIcon = QMessageBox::Information; int nNotifyIcon = Notificator::Information; - // Check for usage of predefined title + // Override title based on style + QString msgType; switch (style) { case CClientUIInterface::MSG_ERROR: - strTitle += tr("Error"); + msgType = tr("Error"); break; case CClientUIInterface::MSG_WARNING: - strTitle += tr("Warning"); + msgType = tr("Warning"); break; case CClientUIInterface::MSG_INFORMATION: - strTitle += tr("Information"); + msgType = tr("Information"); break; default: - strTitle += title; // Use supplied title + msgType = title; // Use supplied title } + if (!msgType.isEmpty()) + strTitle += " - " + msgType; // Check for error/warning icon if (style & CClientUIInterface::ICON_ERROR) { diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h index 5f7ef746f9..f361a62a41 100644 --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -67,7 +67,6 @@ public: QAction * getAddressBookAction() { return addressBookAction; } QAction * getReceiveCoinsAction() { return receiveCoinsAction; } QAction * getSendCoinsAction() { return sendCoinsAction; } - QAction * getExportAction() { return exportAction; } protected: void changeEvent(QEvent *e); @@ -98,7 +97,6 @@ private: QAction *receiveCoinsAction; QAction *optionsAction; QAction *toggleHideAction; - QAction *exportAction; QAction *encryptWalletAction; QAction *backupWalletAction; QAction *changePassphraseAction; diff --git a/src/qt/forms/addressbookpage.ui b/src/qt/forms/addressbookpage.ui index 3cf307384a..a2a7da34dd 100644 --- a/src/qt/forms/addressbookpage.ui +++ b/src/qt/forms/addressbookpage.ui @@ -149,6 +149,20 @@ </spacer> </item> <item> + <widget class="QPushButton" name="exportButton"> + <property name="toolTip"> + <string>Export the data in the current tab to a file</string> + </property> + <property name="text"> + <string>&Export</string> + </property> + <property name="icon"> + <iconset resource="../bitcoin.qrc"> + <normaloff>:/icons/export</normaloff>:/icons/export</iconset> + </property> + </widget> + </item> + <item> <widget class="QDialogButtonBox" name="buttonBox"> <property name="sizePolicy"> <sizepolicy hsizetype="Maximum" vsizetype="Fixed"> diff --git a/src/qt/res/bitcoin-qt.rc b/src/qt/res/bitcoin-qt.rc index 5af328b6f9..3e3672a835 100644 --- a/src/qt/res/bitcoin-qt.rc +++ b/src/qt/res/bitcoin-qt.rc @@ -8,6 +8,7 @@ IDI_ICON2 ICON DISCARDABLE "icons/bitcoin_testnet.ico" #define VER_PRODUCTVERSION_STR STRINGIZE(CLIENT_VERSION_MAJOR) "." STRINGIZE(CLIENT_VERSION_MINOR) "." STRINGIZE(CLIENT_VERSION_REVISION) "." STRINGIZE(CLIENT_VERSION_BUILD) #define VER_FILEVERSION VER_PRODUCTVERSION #define VER_FILEVERSION_STR VER_PRODUCTVERSION_STR +#define COPYRIGHT_STR "2009-" STRINGIZE(COPYRIGHT_YEAR) " The Bitcoin developers" VS_VERSION_INFO VERSIONINFO FILEVERSION VER_FILEVERSION @@ -23,7 +24,7 @@ BEGIN VALUE "FileDescription", "Bitcoin-Qt (OSS GUI client for Bitcoin)" VALUE "FileVersion", VER_FILEVERSION_STR VALUE "InternalName", "bitcoin-qt" - VALUE "LegalCopyright", "2009-2013 The Bitcoin developers" + VALUE "LegalCopyright", COPYRIGHT_STR VALUE "LegalTrademarks1", "Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php." VALUE "OriginalFilename", "bitcoin-qt.exe" VALUE "ProductName", "Bitcoin-Qt" diff --git a/src/qt/walletview.cpp b/src/qt/walletview.cpp index 1d02b81fb6..727b48ded7 100644 --- a/src/qt/walletview.cpp +++ b/src/qt/walletview.cpp @@ -23,6 +23,7 @@ #include <QAction> #include <QDesktopServices> #include <QFileDialog> +#include <QPushButton> WalletView::WalletView(QWidget *parent, BitcoinGUI *_gui): QStackedWidget(parent), @@ -35,8 +36,17 @@ WalletView::WalletView(QWidget *parent, BitcoinGUI *_gui): transactionsPage = new QWidget(this); QVBoxLayout *vbox = new QVBoxLayout(); + QHBoxLayout *hbox_buttons = new QHBoxLayout(); transactionView = new TransactionView(this); vbox->addWidget(transactionView); + QPushButton *exportButton = new QPushButton("&Export", this); + exportButton->setToolTip(tr("Export the data in the current tab to a file")); +#ifndef Q_OS_MAC // Icons on push buttons are very uncommon on Mac + exportButton->setIcon(QIcon(":/icons/export")); +#endif + hbox_buttons->addStretch(); + hbox_buttons->addWidget(exportButton); + vbox->addLayout(hbox_buttons); transactionsPage->setLayout(vbox); addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab); @@ -66,6 +76,8 @@ WalletView::WalletView(QWidget *parent, BitcoinGUI *_gui): connect(addressBookPage, SIGNAL(verifyMessage(QString)), this, SLOT(gotoVerifyMessageTab(QString))); // Clicking on "Sign Message" in the receive coins page opens the sign message tab in the Sign/Verify Message dialog connect(receiveCoinsPage, SIGNAL(signMessage(QString)), this, SLOT(gotoSignMessageTab(QString))); + // Clicking on "Export" allows to export the transaction list + connect(exportButton, SIGNAL(clicked()), transactionView, SLOT(exportClicked())); gotoOverviewPage(); } @@ -142,39 +154,24 @@ void WalletView::gotoOverviewPage() { gui->getOverviewAction()->setChecked(true); setCurrentWidget(overviewPage); - - gui->getExportAction()->setEnabled(false); - disconnect(gui->getExportAction(), SIGNAL(triggered()), 0, 0); } void WalletView::gotoHistoryPage() { gui->getHistoryAction()->setChecked(true); setCurrentWidget(transactionsPage); - - gui->getExportAction()->setEnabled(true); - disconnect(gui->getExportAction(), SIGNAL(triggered()), 0, 0); - connect(gui->getExportAction(), SIGNAL(triggered()), transactionView, SLOT(exportClicked())); } void WalletView::gotoAddressBookPage() { gui->getAddressBookAction()->setChecked(true); setCurrentWidget(addressBookPage); - - gui->getExportAction()->setEnabled(true); - disconnect(gui->getExportAction(), SIGNAL(triggered()), 0, 0); - connect(gui->getExportAction(), SIGNAL(triggered()), addressBookPage, SLOT(exportClicked())); } void WalletView::gotoReceiveCoinsPage() { gui->getReceiveCoinsAction()->setChecked(true); setCurrentWidget(receiveCoinsPage); - - gui->getExportAction()->setEnabled(true); - disconnect(gui->getExportAction(), SIGNAL(triggered()), 0, 0); - connect(gui->getExportAction(), SIGNAL(triggered()), receiveCoinsPage, SLOT(exportClicked())); } void WalletView::gotoSendCoinsPage(QString addr) @@ -182,9 +179,6 @@ void WalletView::gotoSendCoinsPage(QString addr) gui->getSendCoinsAction()->setChecked(true); setCurrentWidget(sendCoinsPage); - gui->getExportAction()->setEnabled(false); - disconnect(gui->getExportAction(), SIGNAL(triggered()), 0, 0); - if (!addr.isEmpty()) sendCoinsPage->setAddress(addr); } |