diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2011-05-12 14:44:52 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2011-05-12 14:44:52 +0200 |
commit | df577886e47d62396c343c59b62150eccef44131 (patch) | |
tree | 9e66cf2db7cd9178c3a968255144eb7e2330d4cd | |
parent | 8812ce7b27b48ac55012ede43d59a634da0e2f14 (diff) |
rename to qt standard
-rw-r--r-- | AddressBookDialog.cpp | 7 | ||||
-rw-r--r-- | OptionsDialog.cpp | 7 | ||||
-rw-r--r-- | SendCoinsDialog.cpp | 6 | ||||
-rw-r--r-- | SettingsDialog.cpp | 7 | ||||
-rw-r--r-- | SettingsDialog.h | 18 | ||||
-rw-r--r-- | TODO | 3 | ||||
-rw-r--r-- | aboutdialog.cpp (renamed from AboutDialog.cpp) | 0 | ||||
-rw-r--r-- | aboutdialog.h (renamed from AboutDialog.h) | 0 | ||||
-rw-r--r-- | addressbookdialog.cpp | 19 | ||||
-rw-r--r-- | addressbookdialog.h (renamed from AddressBookDialog.h) | 16 | ||||
-rw-r--r-- | addressbookdialog.ui | 77 | ||||
-rw-r--r-- | addresstablemodel.cpp (renamed from AddressTableModel.cpp) | 0 | ||||
-rw-r--r-- | addresstablemodel.h (renamed from AddressTableModel.h) | 0 | ||||
-rw-r--r-- | bitcoin.pro | 20 | ||||
-rw-r--r-- | bitcoingui.cpp (renamed from BitcoinGUI.cpp) | 17 | ||||
-rw-r--r-- | bitcoingui.h (renamed from BitcoinGUI.h) | 0 | ||||
-rw-r--r-- | mainoptionspage.cpp | 67 | ||||
-rw-r--r-- | mainoptionspage.h | 18 | ||||
-rw-r--r-- | optionsdialog.cpp | 55 | ||||
-rw-r--r-- | optionsdialog.h (renamed from OptionsDialog.h) | 7 | ||||
-rw-r--r-- | sendcoinsdialog.cpp | 14 | ||||
-rw-r--r-- | sendcoinsdialog.h (renamed from SendCoinsDialog.h) | 12 | ||||
-rw-r--r-- | sendcoinsdialog.ui | 146 | ||||
-rw-r--r-- | transactiontablemodel.cpp (renamed from TransactionTableModel.cpp) | 0 | ||||
-rw-r--r-- | transactiontablemodel.h (renamed from TransactionTableModel.h) | 0 |
25 files changed, 447 insertions, 69 deletions
diff --git a/AddressBookDialog.cpp b/AddressBookDialog.cpp deleted file mode 100644 index 7e853ede7b..0000000000 --- a/AddressBookDialog.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include "AddressBookDialog.h" - -AddressBookDialog::AddressBookDialog(QWidget *parent) : - QDialog(parent) -{ -} - diff --git a/OptionsDialog.cpp b/OptionsDialog.cpp deleted file mode 100644 index 891b43f4e5..0000000000 --- a/OptionsDialog.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#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/SendCoinsDialog.cpp b/SendCoinsDialog.cpp deleted file mode 100644 index a89a58dc54..0000000000 --- a/SendCoinsDialog.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include "SendCoinsDialog.h" - -SendCoinsDialog::SendCoinsDialog(QWidget *parent) : - QDialog(parent) -{ -} diff --git a/SettingsDialog.cpp b/SettingsDialog.cpp deleted file mode 100644 index d2ce01ee66..0000000000 --- a/SettingsDialog.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include "SettingsDialog.h" - -SettingsDialog::SettingsDialog(QWidget *parent) : - QDialog(parent) -{ -} - diff --git a/SettingsDialog.h b/SettingsDialog.h deleted file mode 100644 index 7bbfb1f83a..0000000000 --- a/SettingsDialog.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef SETTINGSDIALOG_H -#define SETTINGSDIALOG_H - -#include <QDialog> - -class SettingsDialog : public QDialog -{ - Q_OBJECT -public: - explicit SettingsDialog(QWidget *parent = 0); - -signals: - -public slots: - -}; - -#endif // SETTINGSDIALOG_H @@ -51,3 +51,6 @@ AboutDialog - Translation +- Toolbar icon + +- 'notify' on incoming transaction diff --git a/AboutDialog.cpp b/aboutdialog.cpp index dd2ec9f9b0..dd2ec9f9b0 100644 --- a/AboutDialog.cpp +++ b/aboutdialog.cpp diff --git a/AboutDialog.h b/aboutdialog.h index 1372121099..1372121099 100644 --- a/AboutDialog.h +++ b/aboutdialog.h diff --git a/addressbookdialog.cpp b/addressbookdialog.cpp new file mode 100644 index 0000000000..ca74159d2f --- /dev/null +++ b/addressbookdialog.cpp @@ -0,0 +1,19 @@ +#include "addressbookdialog.h" +#include "ui_addressbookdialog.h" + +AddressBookDialog::AddressBookDialog(QWidget *parent) : + QDialog(parent), + ui(new Ui::AddressBookDialog) +{ + ui->setupUi(this); +} + +AddressBookDialog::~AddressBookDialog() +{ + delete ui; +} + +void AddressBookDialog::setTab(int tab) +{ + +} diff --git a/AddressBookDialog.h b/addressbookdialog.h index 3a27aa62a1..a51c02a794 100644 --- a/AddressBookDialog.h +++ b/addressbookdialog.h @@ -3,16 +3,26 @@ #include <QDialog> +namespace Ui { + class AddressBookDialog; +} + class AddressBookDialog : public QDialog { Q_OBJECT + public: explicit AddressBookDialog(QWidget *parent = 0); + ~AddressBookDialog(); -signals: - -public slots: + enum { + SendingTab = 0, + ReceivingTab = 1 + } Tabs; + void setTab(int tab); +private: + Ui::AddressBookDialog *ui; }; #endif // ADDRESSBOOKDIALOG_H diff --git a/addressbookdialog.ui b/addressbookdialog.ui new file mode 100644 index 0000000000..e646b08ef2 --- /dev/null +++ b/addressbookdialog.ui @@ -0,0 +1,77 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>AddressBookDialog</class> + <widget class="QDialog" name="AddressBookDialog"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>400</width> + <height>300</height> + </rect> + </property> + <property name="windowTitle"> + <string>Dialog</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <spacer name="verticalSpacer"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QDialogButtonBox" name="buttonBox"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="standardButtons"> + <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> + </property> + </widget> + </item> + </layout> + </widget> + <resources/> + <connections> + <connection> + <sender>buttonBox</sender> + <signal>accepted()</signal> + <receiver>AddressBookDialog</receiver> + <slot>accept()</slot> + <hints> + <hint type="sourcelabel"> + <x>248</x> + <y>254</y> + </hint> + <hint type="destinationlabel"> + <x>157</x> + <y>274</y> + </hint> + </hints> + </connection> + <connection> + <sender>buttonBox</sender> + <signal>rejected()</signal> + <receiver>AddressBookDialog</receiver> + <slot>reject()</slot> + <hints> + <hint type="sourcelabel"> + <x>316</x> + <y>260</y> + </hint> + <hint type="destinationlabel"> + <x>286</x> + <y>274</y> + </hint> + </hints> + </connection> + </connections> +</ui> diff --git a/AddressTableModel.cpp b/addresstablemodel.cpp index b25ee3e9ee..b25ee3e9ee 100644 --- a/AddressTableModel.cpp +++ b/addresstablemodel.cpp diff --git a/AddressTableModel.h b/addresstablemodel.h index 490452e11e..490452e11e 100644 --- a/AddressTableModel.h +++ b/addresstablemodel.h diff --git a/bitcoin.pro b/bitcoin.pro index 99a2601ecd..01d93ddb6c 100644 --- a/bitcoin.pro +++ b/bitcoin.pro @@ -10,20 +10,24 @@ INCLUDEPATH += . # Input HEADERS += BitcoinGUI.h \ TransactionTableModel.h \ - SendCoinsDialog.h \ - SettingsDialog.h \ - AddressBookDialog.h \ AboutDialog.h \ AddressTableModel.h \ - OptionsDialog.h + OptionsDialog.h \ + MainOptionsPage.h \ + SendCoinsDialog.h \ + addressbookdialog.h SOURCES += bitcoin.cpp BitcoinGUI.cpp \ TransactionTableModel.cpp \ - SendCoinsDialog.cpp \ - SettingsDialog.cpp \ - AddressBookDialog.cpp \ AboutDialog.cpp \ AddressTableModel.cpp \ - OptionsDialog.cpp + OptionsDialog.cpp \ + MainOptionsPage.cpp \ + SendCoinsDialog.cpp \ + addressbookdialog.cpp RESOURCES += \ bitcoin.qrc + +FORMS += \ + sendcoinsdialog.ui \ + addressbookdialog.ui diff --git a/BitcoinGUI.cpp b/bitcoingui.cpp index 0f122377aa..a3b346ed82 100644 --- a/BitcoinGUI.cpp +++ b/bitcoingui.cpp @@ -5,8 +5,7 @@ */ #include "BitcoinGUI.h" #include "TransactionTableModel.h" -#include "AddressBookDialog.h" -#include "SettingsDialog.h" +#include "addressbookdialog.h" #include "SendCoinsDialog.h" #include "OptionsDialog.h" #include "AboutDialog.h" @@ -144,15 +143,15 @@ BitcoinGUI::BitcoinGUI(QWidget *parent): /* Status bar */ statusBar(); - QLabel *label_connections = new QLabel("6 connections", this); + QLabel *label_connections = new QLabel("6 connections"); label_connections->setFrameStyle(QFrame::Panel | QFrame::Sunken); label_connections->setMinimumWidth(100); - QLabel *label_blocks = new QLabel("6 blocks", this); + QLabel *label_blocks = new QLabel("6 blocks"); label_blocks->setFrameStyle(QFrame::Panel | QFrame::Sunken); label_blocks->setMinimumWidth(100); - QLabel *label_transactions = new QLabel("6 transactions", this); + QLabel *label_transactions = new QLabel("6 transactions"); label_transactions->setFrameStyle(QFrame::Panel | QFrame::Sunken); label_transactions->setMinimumWidth(100); @@ -166,8 +165,8 @@ BitcoinGUI::BitcoinGUI(QWidget *parent): connect(addressbook, SIGNAL(triggered()), this, SLOT(addressbookClicked())); connect(receiving_addresses, SIGNAL(triggered()), this, SLOT(receivingAddressesClicked())); connect(options, SIGNAL(triggered()), this, SLOT(optionsClicked())); - connect(button_new, SIGNAL(triggered()), this, SLOT(newAddressClicked())); - connect(button_clipboard, SIGNAL(triggered()), this, SLOT(copyClipboardClicked())); + connect(button_new, SIGNAL(clicked()), this, SLOT(newAddressClicked())); + connect(button_clipboard, SIGNAL(clicked()), this, SLOT(copyClipboardClicked())); connect(about, SIGNAL(triggered()), this, SLOT(aboutClicked())); } @@ -182,7 +181,7 @@ void BitcoinGUI::addressbookClicked() { qDebug() << "Address book clicked"; AddressBookDialog dlg; - /* TODO: Set tab to "Sending" */ + dlg.setTab(AddressBookDialog::SendingTab); dlg.exec(); } @@ -190,7 +189,7 @@ void BitcoinGUI::receivingAddressesClicked() { qDebug() << "Receiving addresses clicked"; AddressBookDialog dlg; - /* TODO: Set tab to "Receiving" */ + dlg.setTab(AddressBookDialog::ReceivingTab); dlg.exec(); } diff --git a/BitcoinGUI.h b/bitcoingui.h index 0c9edad85c..0c9edad85c 100644 --- a/BitcoinGUI.h +++ b/bitcoingui.h diff --git a/mainoptionspage.cpp b/mainoptionspage.cpp new file mode 100644 index 0000000000..d833a79307 --- /dev/null +++ b/mainoptionspage.cpp @@ -0,0 +1,67 @@ +#include "MainOptionsPage.h" + +#include <QHBoxLayout> +#include <QVBoxLayout> +#include <QCheckBox> +#include <QLabel> +#include <QLineEdit> + +MainOptionsPage::MainOptionsPage(QWidget *parent): + QWidget(parent) +{ + QVBoxLayout *layout = new QVBoxLayout(); + + QCheckBox *bitcoin_at_startup = new QCheckBox(tr("&Start Bitcoin on window system startup")); + layout->addWidget(bitcoin_at_startup); + + QCheckBox *minimize_to_tray = new QCheckBox(tr("&Minimize to the tray instead of the taskbar")); + layout->addWidget(minimize_to_tray); + + QCheckBox *map_port_upnp = new QCheckBox(tr("Map port using &UPnP")); + layout->addWidget(map_port_upnp); + + QCheckBox *minimize_on_close = new QCheckBox(tr("M&inimize on close")); + layout->addWidget(minimize_on_close); + + QCheckBox *connect_socks4 = new QCheckBox(tr("&Connect through socks4 proxy:")); + layout->addWidget(connect_socks4); + + QHBoxLayout *proxy_hbox = new QHBoxLayout(); + proxy_hbox->addSpacing(18); + QLabel *proxy_ip_label = new QLabel(tr("Proxy &IP: ")); + proxy_hbox->addWidget(proxy_ip_label); + QLineEdit *proxy_ip = new QLineEdit(); + proxy_ip->setMaximumWidth(140); + proxy_ip_label->setBuddy(proxy_ip); + proxy_hbox->addWidget(proxy_ip); + QLabel *proxy_port_label = new QLabel(tr("&Port: ")); + proxy_hbox->addWidget(proxy_port_label); + QLineEdit *proxy_port = new QLineEdit(); + proxy_port->setMaximumWidth(55); + proxy_port_label->setBuddy(proxy_port); + proxy_hbox->addWidget(proxy_port); + proxy_hbox->addStretch(1); + + layout->addLayout(proxy_hbox); + QLabel *fee_help = new QLabel(tr("Optional transaction fee per KB that helps make sure your transactions are processed quickly. Most transactions are 1KB. Fee 0.01 recommended.")); + fee_help->setWordWrap(true); + layout->addWidget(fee_help); + + QHBoxLayout *fee_hbox = new QHBoxLayout(); + fee_hbox->addSpacing(18); + QLabel *fee_label = new QLabel(tr("Pay transaction &fee")); + fee_hbox->addWidget(fee_label); + QLineEdit *fee_edit = new QLineEdit(); + fee_edit->setMaximumWidth(70); + fee_label->setBuddy(fee_edit); + fee_hbox->addWidget(fee_edit); + fee_hbox->addStretch(1); + + layout->addLayout(fee_hbox); + + + layout->addStretch(1); /* Extra space at bottom */ + + setLayout(layout); +} + diff --git a/mainoptionspage.h b/mainoptionspage.h new file mode 100644 index 0000000000..de2ef9fcd0 --- /dev/null +++ b/mainoptionspage.h @@ -0,0 +1,18 @@ +#ifndef MAINOPTIONSPAGE_H +#define MAINOPTIONSPAGE_H + +#include <QWidget> + +class MainOptionsPage : public QWidget +{ + Q_OBJECT +public: + explicit MainOptionsPage(QWidget *parent = 0); + +signals: + +public slots: + +}; + +#endif // MAINOPTIONSPAGE_H diff --git a/optionsdialog.cpp b/optionsdialog.cpp new file mode 100644 index 0000000000..a70eadd516 --- /dev/null +++ b/optionsdialog.cpp @@ -0,0 +1,55 @@ +#include "OptionsDialog.h" +#include "MainOptionsPage.h" + +#include <QHBoxLayout> +#include <QVBoxLayout> +#include <QPushButton> + +OptionsDialog::OptionsDialog(QWidget *parent) : + QDialog(parent), contents_widget(0), pages_widget(0) +{ + contents_widget = new QListWidget(); + contents_widget->setMaximumWidth(128); + + pages_widget = new QStackedWidget(); + pages_widget->setMinimumWidth(300); + + QListWidgetItem *item_main = new QListWidgetItem(tr("Main")); + contents_widget->addItem(item_main); + pages_widget->addWidget(new MainOptionsPage(this)); + + contents_widget->setCurrentRow(0); + + QHBoxLayout *main_layout = new QHBoxLayout(); + main_layout->addWidget(contents_widget); + main_layout->addWidget(pages_widget, 1); + + QVBoxLayout *layout = new QVBoxLayout(); + layout->addLayout(main_layout); + + QHBoxLayout *buttons = new QHBoxLayout(); + buttons->addStretch(1); + QPushButton *ok_button = new QPushButton(tr("OK")); + buttons->addWidget(ok_button); + QPushButton *cancel_button = new QPushButton(tr("Cancel")); + buttons->addWidget(cancel_button); + QPushButton *apply_button = new QPushButton(tr("Apply")); + buttons->addWidget(apply_button); + + layout->addLayout(buttons); + + + setLayout(layout); + setWindowTitle(tr("Options")); + + +} + +void OptionsDialog::changePage(QListWidgetItem *current, QListWidgetItem *previous) +{ + Q_UNUSED(previous); + if(current) + { + pages_widget->setCurrentIndex(contents_widget->row(current)); + } +} diff --git a/OptionsDialog.h b/optionsdialog.h index 529eb21478..2a4beaccea 100644 --- a/OptionsDialog.h +++ b/optionsdialog.h @@ -2,6 +2,8 @@ #define OPTIONSDIALOG_H #include <QDialog> +#include <QStackedWidget> +#include <QListWidget> class OptionsDialog : public QDialog { @@ -12,7 +14,12 @@ public: signals: public slots: + void changePage(QListWidgetItem *current, QListWidgetItem *previous); +private: + QListWidget *contents_widget; + QStackedWidget *pages_widget; + void setupMainPage(); }; #endif // OPTIONSDIALOG_H diff --git a/sendcoinsdialog.cpp b/sendcoinsdialog.cpp new file mode 100644 index 0000000000..ef3ade68ac --- /dev/null +++ b/sendcoinsdialog.cpp @@ -0,0 +1,14 @@ +#include "SendCoinsDialog.h" +#include "ui_sendcoinsdialog.h" + +SendCoinsDialog::SendCoinsDialog(QWidget *parent) : + QDialog(parent), + ui(new Ui::SendCoinsDialog) +{ + ui->setupUi(this); +} + +SendCoinsDialog::~SendCoinsDialog() +{ + delete ui; +} diff --git a/SendCoinsDialog.h b/sendcoinsdialog.h index f2720c3738..82fae9cfac 100644 --- a/SendCoinsDialog.h +++ b/sendcoinsdialog.h @@ -3,16 +3,20 @@ #include <QDialog> +namespace Ui { + class SendCoinsDialog; +} + class SendCoinsDialog : public QDialog { Q_OBJECT + public: explicit SendCoinsDialog(QWidget *parent = 0); + ~SendCoinsDialog(); -signals: - -public slots: - +private: + Ui::SendCoinsDialog *ui; }; #endif // SENDCOINSDIALOG_H diff --git a/sendcoinsdialog.ui b/sendcoinsdialog.ui new file mode 100644 index 0000000000..56ec6d3d23 --- /dev/null +++ b/sendcoinsdialog.ui @@ -0,0 +1,146 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>SendCoinsDialog</class> + <widget class="QDialog" name="SendCoinsDialog"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>736</width> + <height>129</height> + </rect> + </property> + <property name="windowTitle"> + <string>Dialog</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <layout class="QGridLayout" name="gridLayout"> + <item row="4" column="0"> + <widget class="QLabel" name="label"> + <property name="text"> + <string>&Amount:</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="buddy"> + <cstring>pay_amount</cstring> + </property> + </widget> + </item> + <item row="3" column="0"> + <widget class="QLabel" name="label_2"> + <property name="text"> + <string>Pay &To:</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="buddy"> + <cstring>pay_to</cstring> + </property> + </widget> + </item> + <item row="3" column="1"> + <widget class="QLineEdit" name="pay_to"/> + </item> + <item row="4" column="1"> + <widget class="QLineEdit" name="pay_amount"> + <property name="maximumSize"> + <size> + <width>145</width> + <height>16777215</height> + </size> + </property> + </widget> + </item> + <item row="3" column="2"> + <widget class="QPushButton" name="pushButton"> + <property name="text"> + <string>&Paste</string> + </property> + </widget> + </item> + <item row="3" column="3"> + <widget class="QPushButton" name="pushButton_2"> + <property name="text"> + <string>Address &Book...</string> + </property> + </widget> + </item> + <item row="2" column="1"> + <widget class="QLabel" name="label_3"> + <property name="font"> + <font> + <pointsize>9</pointsize> + </font> + </property> + <property name="text"> + <string>Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</string> + </property> + </widget> + </item> + </layout> + </item> + <item> + <spacer name="verticalSpacer"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QDialogButtonBox" name="buttonBox"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="standardButtons"> + <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> + </property> + </widget> + </item> + </layout> + </widget> + <resources/> + <connections> + <connection> + <sender>buttonBox</sender> + <signal>accepted()</signal> + <receiver>SendCoinsDialog</receiver> + <slot>accept()</slot> + <hints> + <hint type="sourcelabel"> + <x>248</x> + <y>254</y> + </hint> + <hint type="destinationlabel"> + <x>157</x> + <y>274</y> + </hint> + </hints> + </connection> + <connection> + <sender>buttonBox</sender> + <signal>rejected()</signal> + <receiver>SendCoinsDialog</receiver> + <slot>reject()</slot> + <hints> + <hint type="sourcelabel"> + <x>316</x> + <y>260</y> + </hint> + <hint type="destinationlabel"> + <x>286</x> + <y>274</y> + </hint> + </hints> + </connection> + </connections> +</ui> diff --git a/TransactionTableModel.cpp b/transactiontablemodel.cpp index d36bea211a..d36bea211a 100644 --- a/TransactionTableModel.cpp +++ b/transactiontablemodel.cpp diff --git a/TransactionTableModel.h b/transactiontablemodel.h index 8913f1d94c..8913f1d94c 100644 --- a/TransactionTableModel.h +++ b/transactiontablemodel.h |