From 8812ce7b27b48ac55012ede43d59a634da0e2f14 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 12 May 2011 09:40:40 +0200 Subject: [PATCH] add options dialog, spawn dialogs at the right place --- BitcoinGUI.cpp | 32 +++++++++++++++++++++++++++----- BitcoinGUI.h | 2 ++ OptionsDialog.cpp | 7 +++++++ OptionsDialog.h | 18 ++++++++++++++++++ bitcoin.pro | 6 ++++-- 5 files changed, 58 insertions(+), 7 deletions(-) create mode 100644 OptionsDialog.cpp create mode 100644 OptionsDialog.h diff --git a/BitcoinGUI.cpp b/BitcoinGUI.cpp index 0d7fbf4b2..0f122377a 100644 --- a/BitcoinGUI.cpp +++ b/BitcoinGUI.cpp @@ -8,6 +8,8 @@ #include "AddressBookDialog.h" #include "SettingsDialog.h" #include "SendCoinsDialog.h" +#include "OptionsDialog.h" +#include "AboutDialog.h" #include #include @@ -166,34 +168,54 @@ BitcoinGUI::BitcoinGUI(QWidget *parent): connect(options, SIGNAL(triggered()), this, SLOT(optionsClicked())); connect(button_new, SIGNAL(triggered()), this, SLOT(newAddressClicked())); connect(button_clipboard, SIGNAL(triggered()), this, SLOT(copyClipboardClicked())); + connect(about, SIGNAL(triggered()), this, SLOT(aboutClicked())); } void BitcoinGUI::sendcoinsClicked() { qDebug() << "Send coins clicked"; + SendCoinsDialog dlg; + dlg.exec(); } void BitcoinGUI::addressbookClicked() { qDebug() << "Address book clicked"; -} - -void BitcoinGUI::optionsClicked() -{ - qDebug() << "Options clicked"; + AddressBookDialog dlg; + /* TODO: Set tab to "Sending" */ + dlg.exec(); } void BitcoinGUI::receivingAddressesClicked() { qDebug() << "Receiving addresses clicked"; + AddressBookDialog dlg; + /* TODO: Set tab to "Receiving" */ + dlg.exec(); +} + +void BitcoinGUI::optionsClicked() +{ + qDebug() << "Options clicked"; + OptionsDialog dlg; + dlg.exec(); +} + +void BitcoinGUI::aboutClicked() +{ + qDebug() << "About clicked"; + AboutDialog dlg; + dlg.exec(); } void BitcoinGUI::newAddressClicked() { qDebug() << "New address clicked"; + /* TODO: generate new address */ } void BitcoinGUI::copyClipboardClicked() { qDebug() << "Copy to clipboard"; + /* TODO: copy to clipboard */ } diff --git a/BitcoinGUI.h b/BitcoinGUI.h index 63d28c29d..0c9edad85 100644 --- a/BitcoinGUI.h +++ b/BitcoinGUI.h @@ -21,6 +21,8 @@ private slots: void addressbookClicked(); void optionsClicked(); void receivingAddressesClicked(); + void aboutClicked(); + void newAddressClicked(); void copyClipboardClicked(); }; diff --git a/OptionsDialog.cpp b/OptionsDialog.cpp new file mode 100644 index 000000000..891b43f4e --- /dev/null +++ b/OptionsDialog.cpp @@ -0,0 +1,7 @@ +#include "OptionsDialog.h" +/* TODO example: http://doc.trolltech.com/4.7/dialogs-configdialog-configdialog-cpp.html */ + +OptionsDialog::OptionsDialog(QWidget *parent) : + QDialog(parent) +{ +} diff --git a/OptionsDialog.h b/OptionsDialog.h new file mode 100644 index 000000000..529eb2147 --- /dev/null +++ b/OptionsDialog.h @@ -0,0 +1,18 @@ +#ifndef OPTIONSDIALOG_H +#define OPTIONSDIALOG_H + +#include + +class OptionsDialog : public QDialog +{ + Q_OBJECT +public: + explicit OptionsDialog(QWidget *parent = 0); + +signals: + +public slots: + +}; + +#endif // OPTIONSDIALOG_H diff --git a/bitcoin.pro b/bitcoin.pro index b28b45f44..99a2601ec 100644 --- a/bitcoin.pro +++ b/bitcoin.pro @@ -14,14 +14,16 @@ HEADERS += BitcoinGUI.h \ SettingsDialog.h \ AddressBookDialog.h \ AboutDialog.h \ - AddressTableModel.h + AddressTableModel.h \ + OptionsDialog.h SOURCES += bitcoin.cpp BitcoinGUI.cpp \ TransactionTableModel.cpp \ SendCoinsDialog.cpp \ SettingsDialog.cpp \ AddressBookDialog.cpp \ AboutDialog.cpp \ - AddressTableModel.cpp + AddressTableModel.cpp \ + OptionsDialog.cpp RESOURCES += \ bitcoin.qrc