diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2011-05-08 22:23:31 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2011-05-08 22:23:31 +0200 |
commit | 1355cfe131e9bbaa209f79f7d9987a73b69285d3 (patch) | |
tree | 953ea9c0a05bbd924fb6a6b97673eea8f5d71842 | |
parent | 4d27c960336f1cbf7c3bc741bb389826e628859b (diff) | |
download | bitcoin-1355cfe131e9bbaa209f79f7d9987a73b69285d3.tar.xz |
add all (unpopulated) dialogs
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | AboutDialog.cpp | 6 | ||||
-rw-r--r-- | AboutDialog.h | 18 | ||||
-rw-r--r-- | AddressBookDialog.cpp | 7 | ||||
-rw-r--r-- | AddressBookDialog.h | 18 | ||||
-rw-r--r-- | BitcoinGUI.cpp | 18 | ||||
-rw-r--r-- | BitcoinGUI.h | 14 | ||||
-rw-r--r-- | SendCoinsDialog.cpp | 6 | ||||
-rw-r--r-- | SendCoinsDialog.h | 18 | ||||
-rw-r--r-- | SettingsDialog.cpp | 7 | ||||
-rw-r--r-- | SettingsDialog.h | 18 | ||||
-rw-r--r-- | TODO | 5 | ||||
-rw-r--r-- | TransactionTableModel.cpp | 25 | ||||
-rw-r--r-- | TransactionTableModel.h | 14 | ||||
-rw-r--r-- | bitcoin.pro | 12 | ||||
-rw-r--r-- | bitcoin.pro.user | 113 | ||||
-rw-r--r-- | moc_BitcoinGUI.cpp | 79 |
17 files changed, 169 insertions, 211 deletions
diff --git a/.gitignore b/.gitignore index d6ff91a9ea..a261fd9c2e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ *~ *.o +moc_*.cpp +*.pro.user diff --git a/AboutDialog.cpp b/AboutDialog.cpp new file mode 100644 index 0000000000..dd2ec9f9b0 --- /dev/null +++ b/AboutDialog.cpp @@ -0,0 +1,6 @@ +#include "AboutDialog.h" + +AboutDialog::AboutDialog(QWidget *parent) : + QDialog(parent) +{ +} diff --git a/AboutDialog.h b/AboutDialog.h new file mode 100644 index 0000000000..1372121099 --- /dev/null +++ b/AboutDialog.h @@ -0,0 +1,18 @@ +#ifndef ABOUTDIALOG_H +#define ABOUTDIALOG_H + +#include <QDialog> + +class AboutDialog : public QDialog +{ + Q_OBJECT +public: + explicit AboutDialog(QWidget *parent = 0); + +signals: + +public slots: + +}; + +#endif // ABOUTDIALOG_H diff --git a/AddressBookDialog.cpp b/AddressBookDialog.cpp new file mode 100644 index 0000000000..7e853ede7b --- /dev/null +++ b/AddressBookDialog.cpp @@ -0,0 +1,7 @@ +#include "AddressBookDialog.h" + +AddressBookDialog::AddressBookDialog(QWidget *parent) : + QDialog(parent) +{ +} + diff --git a/AddressBookDialog.h b/AddressBookDialog.h new file mode 100644 index 0000000000..3a27aa62a1 --- /dev/null +++ b/AddressBookDialog.h @@ -0,0 +1,18 @@ +#ifndef ADDRESSBOOKDIALOG_H +#define ADDRESSBOOKDIALOG_H + +#include <QDialog> + +class AddressBookDialog : public QDialog +{ + Q_OBJECT +public: + explicit AddressBookDialog(QWidget *parent = 0); + +signals: + +public slots: + +}; + +#endif // ADDRESSBOOKDIALOG_H diff --git a/BitcoinGUI.cpp b/BitcoinGUI.cpp index 0b81f72faa..f07b828098 100644 --- a/BitcoinGUI.cpp +++ b/BitcoinGUI.cpp @@ -18,6 +18,7 @@ #include <QTableView> #include <QLineEdit> #include <QPushButton> +#include <QHeaderView> #include <iostream> @@ -86,9 +87,24 @@ BitcoinGUI::BitcoinGUI(QWidget *parent): * QAbstractItemView::ExtendedSelection */ QTableView *transaction_table = new QTableView(this); + TransactionTableModel *transaction_model = new TransactionTableModel(this); transaction_table->setModel(transaction_model); - + transaction_table->setSelectionBehavior(QAbstractItemView::SelectRows); + transaction_table->setSelectionMode(QAbstractItemView::ExtendedSelection); + + transaction_table->horizontalHeader()->resizeSection( + TransactionTableModel::Status, 112); + transaction_table->horizontalHeader()->resizeSection( + TransactionTableModel::Date, 112); + transaction_table->horizontalHeader()->setResizeMode( + TransactionTableModel::Description, QHeaderView::Stretch); + transaction_table->horizontalHeader()->resizeSection( + TransactionTableModel::Debit, 79); + transaction_table->horizontalHeader()->resizeSection( + TransactionTableModel::Credit, 79); + /* TODO: alignment; debit/credit columns must align right */ + QTabBar *tabs = new QTabBar(this); tabs->addTab("All transactions"); tabs->addTab("Sent/Received"); diff --git a/BitcoinGUI.h b/BitcoinGUI.h index e4ff2fe61a..590bb3efb7 100644 --- a/BitcoinGUI.h +++ b/BitcoinGUI.h @@ -1,5 +1,5 @@ -#ifndef H_BITCOINGUI -#define H_BITCOINGUI +#ifndef BITCOINGUI_H +#define BITCOINGUI_H #include <QMainWindow> @@ -7,14 +7,14 @@ class BitcoinGUI : public QMainWindow { Q_OBJECT public: - BitcoinGUI(QWidget *parent = 0); + explicit BitcoinGUI(QWidget *parent = 0); /* Transaction table tab indices */ enum { - ALL_TRANSACTIONS = 0, - SENT_RECEIVED = 1, - SENT = 2, - RECEIVED = 3 + AllTransactions = 0, + SentReceived = 1, + Sent = 2, + Received = 3 } TabIndex; private slots: void currentChanged(int tab); diff --git a/SendCoinsDialog.cpp b/SendCoinsDialog.cpp new file mode 100644 index 0000000000..a89a58dc54 --- /dev/null +++ b/SendCoinsDialog.cpp @@ -0,0 +1,6 @@ +#include "SendCoinsDialog.h" + +SendCoinsDialog::SendCoinsDialog(QWidget *parent) : + QDialog(parent) +{ +} diff --git a/SendCoinsDialog.h b/SendCoinsDialog.h new file mode 100644 index 0000000000..f2720c3738 --- /dev/null +++ b/SendCoinsDialog.h @@ -0,0 +1,18 @@ +#ifndef SENDCOINSDIALOG_H +#define SENDCOINSDIALOG_H + +#include <QDialog> + +class SendCoinsDialog : public QDialog +{ + Q_OBJECT +public: + explicit SendCoinsDialog(QWidget *parent = 0); + +signals: + +public slots: + +}; + +#endif // SENDCOINSDIALOG_H diff --git a/SettingsDialog.cpp b/SettingsDialog.cpp new file mode 100644 index 0000000000..d2ce01ee66 --- /dev/null +++ b/SettingsDialog.cpp @@ -0,0 +1,7 @@ +#include "SettingsDialog.h" + +SettingsDialog::SettingsDialog(QWidget *parent) : + QDialog(parent) +{ +} + diff --git a/SettingsDialog.h b/SettingsDialog.h new file mode 100644 index 0000000000..7bbfb1f83a --- /dev/null +++ b/SettingsDialog.h @@ -0,0 +1,18 @@ +#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 @@ -23,6 +23,9 @@ Table [columns]: Credit ** Table should be the same in all tabs. Do we really need different widgets? + -> yes, to have different proxy views + + ** Table rows are much too high? Status bar: Permanent status indicators: @@ -46,5 +49,5 @@ AboutDialog - Address Book icon - - Translation + diff --git a/TransactionTableModel.cpp b/TransactionTableModel.cpp index 0f35296061..e5cf258167 100644 --- a/TransactionTableModel.cpp +++ b/TransactionTableModel.cpp @@ -1,5 +1,14 @@ #include "TransactionTableModel.h" +/* Credit and Debit columns are right-aligned as they contain numbers */ +static Qt::AlignmentFlag column_alignments[] = { + Qt::AlignLeft, + Qt::AlignLeft, + Qt::AlignLeft, + Qt::AlignRight, + Qt::AlignRight + }; + TransactionTableModel::TransactionTableModel(QObject *parent): QAbstractTableModel(parent) { @@ -28,18 +37,24 @@ QVariant TransactionTableModel::data(const QModelIndex &index, int role) const /* index.row(), index.column() */ /* Return QString */ return QString("test"); + } else if (role == Qt::TextAlignmentRole) + { + return column_alignments[index.column()]; } return QVariant(); } QVariant TransactionTableModel::headerData(int section, Qt::Orientation orientation, int role) const { - if(role != Qt::DisplayRole) - return QVariant(); - - if(orientation == Qt::Horizontal) + if(role == Qt::DisplayRole) + { + if(orientation == Qt::Horizontal) + { + return columns[section]; + } + } else if (role == Qt::TextAlignmentRole) { - return columns[section]; + return column_alignments[section]; } return QVariant(); } diff --git a/TransactionTableModel.h b/TransactionTableModel.h index 9071ed6688..8913f1d94c 100644 --- a/TransactionTableModel.h +++ b/TransactionTableModel.h @@ -1,5 +1,5 @@ -#ifndef H_TRANSACTIONTABLEMODEL -#define H_TRANSACTIONTABLEMODEL +#ifndef TRANSACTIONTABLEMODEL_H +#define TRANSACTIONTABLEMODEL_H #include <QAbstractTableModel> #include <QStringList> @@ -8,7 +8,15 @@ class TransactionTableModel : public QAbstractTableModel { Q_OBJECT public: - TransactionTableModel(QObject *parent = 0); + explicit TransactionTableModel(QObject *parent = 0); + + enum { + Status = 0, + Date = 1, + Description = 2, + Debit = 3, + Credit = 4 + } ColumnIndex; int rowCount(const QModelIndex &parent) const; int columnCount(const QModelIndex &parent) const; diff --git a/bitcoin.pro b/bitcoin.pro index 26a3216f4b..4f794ac693 100644 --- a/bitcoin.pro +++ b/bitcoin.pro @@ -9,6 +9,14 @@ INCLUDEPATH += . # Input HEADERS += BitcoinGUI.h \ - TransactionTableModel.h + TransactionTableModel.h \ + SendCoinsDialog.h \ + SettingsDialog.h \ + AddressBookDialog.h \ + AboutDialog.h SOURCES += bitcoin.cpp BitcoinGUI.cpp \ - TransactionTableModel.cpp + TransactionTableModel.cpp \ + SendCoinsDialog.cpp \ + SettingsDialog.cpp \ + AddressBookDialog.cpp \ + AboutDialog.cpp diff --git a/bitcoin.pro.user b/bitcoin.pro.user deleted file mode 100644 index 48022383df..0000000000 --- a/bitcoin.pro.user +++ /dev/null @@ -1,113 +0,0 @@ -<!DOCTYPE QtCreatorProject> -<qtcreator> - <data> - <variable>ProjectExplorer.Project.ActiveTarget</variable> - <value type="int">0</value> - </data> - <data> - <variable>ProjectExplorer.Project.EditorSettings</variable> - <valuemap type="QVariantMap"> - <value key="EditorConfiguration.Codec" type="QByteArray">System</value> - </valuemap> - </data> - <data> - <variable>ProjectExplorer.Project.Target.0</variable> - <valuemap type="QVariantMap"> - <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Desktop</value> - <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Target.DesktopTarget</value> - <value key="ProjectExplorer.Target.ActiveBuildConfiguration" type="int">0</value> - <value key="ProjectExplorer.Target.ActiveRunConfiguration" type="int">0</value> - <valuemap key="ProjectExplorer.Target.BuildConfiguration.0" type="QVariantMap"> - <valuemap key="ProjectExplorer.BuildConfiguration.BuildStep.0" type="QVariantMap"> - <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">qmake</value> - <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QtProjectManager.QMakeBuildStep</value> - <valuelist key="QtProjectManager.QMakeBuildStep.QMakeArguments" type="QVariantList"/> - </valuemap> - <valuemap key="ProjectExplorer.BuildConfiguration.BuildStep.1" type="QVariantMap"> - <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Make</value> - <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value> - <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">false</value> - <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"/> - <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value> - </valuemap> - <value key="ProjectExplorer.BuildConfiguration.BuildStepsCount" type="int">2</value> - <valuemap key="ProjectExplorer.BuildConfiguration.CleanStep.0" type="QVariantMap"> - <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Make</value> - <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value> - <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">true</value> - <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"> - <value type="QString">clean</value> - </valuelist> - <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value> - </valuemap> - <value key="ProjectExplorer.BuildConfiguration.CleanStepsCount" type="int">1</value> - <value key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment" type="bool">false</value> - <valuelist key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges" type="QVariantList"/> - <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Debug</value> - <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value> - <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">2</value> - <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">/store/orion/projects/bitcoin/bitcoin-qt</value> - <value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">4</value> - <value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">0</value> - <value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">false</value> - </valuemap> - <valuemap key="ProjectExplorer.Target.BuildConfiguration.1" type="QVariantMap"> - <valuemap key="ProjectExplorer.BuildConfiguration.BuildStep.0" type="QVariantMap"> - <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">qmake</value> - <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QtProjectManager.QMakeBuildStep</value> - <valuelist key="QtProjectManager.QMakeBuildStep.QMakeArguments" type="QVariantList"/> - </valuemap> - <valuemap key="ProjectExplorer.BuildConfiguration.BuildStep.1" type="QVariantMap"> - <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Make</value> - <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value> - <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">false</value> - <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"/> - <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value> - </valuemap> - <value key="ProjectExplorer.BuildConfiguration.BuildStepsCount" type="int">2</value> - <valuemap key="ProjectExplorer.BuildConfiguration.CleanStep.0" type="QVariantMap"> - <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Make</value> - <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value> - <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">true</value> - <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"> - <value type="QString">clean</value> - </valuelist> - <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value> - </valuemap> - <value key="ProjectExplorer.BuildConfiguration.CleanStepsCount" type="int">1</value> - <value key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment" type="bool">false</value> - <valuelist key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges" type="QVariantList"/> - <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Release</value> - <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value> - <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">0</value> - <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">/store/orion/projects/bitcoin/bitcoin-qt</value> - <value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">4</value> - <value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">0</value> - <value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">false</value> - </valuemap> - <value key="ProjectExplorer.Target.BuildConfigurationCount" type="int">2</value> - <valuemap key="ProjectExplorer.Target.RunConfiguration.0" type="QVariantMap"> - <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">bitcoin</value> - <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4RunConfiguration</value> - <value key="Qt4ProjectManager.Qt4RunConfiguration.BaseEnvironmentBase" type="int">2</value> - <valuelist key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments" type="QVariantList"/> - <value key="Qt4ProjectManager.Qt4RunConfiguration.ProFile" type="QString">bitcoin.pro</value> - <value key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix" type="bool">false</value> - <value key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal" type="bool">false</value> - <valuelist key="Qt4ProjectManager.Qt4RunConfiguration.UserEnvironmentChanges" type="QVariantList"/> - <value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetName" type="bool">false</value> - <value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetWorkingDirectory" type="bool">false</value> - <value key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory" type="QString"></value> - </valuemap> - <value key="ProjectExplorer.Target.RunConfigurationCount" type="int">1</value> - </valuemap> - </data> - <data> - <variable>ProjectExplorer.Project.TargetCount</variable> - <value type="int">1</value> - </data> - <data> - <variable>ProjectExplorer.Project.Updater.FileVersion</variable> - <value type="int">4</value> - </data> -</qtcreator> diff --git a/moc_BitcoinGUI.cpp b/moc_BitcoinGUI.cpp deleted file mode 100644 index 3c024d3178..0000000000 --- a/moc_BitcoinGUI.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -** Meta object code from reading C++ file 'BitcoinGUI.h' -** -** Created: Sat May 7 20:43:39 2011 -** by: The Qt Meta Object Compiler version 62 (Qt 4.7.0) -** -** WARNING! All changes made in this file will be lost! -*****************************************************************************/ - -#include "BitcoinGUI.h" -#if !defined(Q_MOC_OUTPUT_REVISION) -#error "The header file 'BitcoinGUI.h' doesn't include <QObject>." -#elif Q_MOC_OUTPUT_REVISION != 62 -#error "This file was generated using the moc from 4.7.0. It" -#error "cannot be used with the include files from this version of Qt." -#error "(The moc has changed too much.)" -#endif - -QT_BEGIN_MOC_NAMESPACE -static const uint qt_meta_data_BitcoinGUI[] = { - - // content: - 5, // revision - 0, // classname - 0, 0, // classinfo - 1, 14, // methods - 0, 0, // properties - 0, 0, // enums/sets - 0, 0, // constructors - 0, // flags - 0, // signalCount - - // slots: signature, parameters, type, tag, flags - 16, 12, 11, 11, 0x08, - - 0 // eod -}; - -static const char qt_meta_stringdata_BitcoinGUI[] = { - "BitcoinGUI\0\0tab\0currentChanged(int)\0" -}; - -const QMetaObject BitcoinGUI::staticMetaObject = { - { &QMainWindow::staticMetaObject, qt_meta_stringdata_BitcoinGUI, - qt_meta_data_BitcoinGUI, 0 } -}; - -#ifdef Q_NO_DATA_RELOCATION -const QMetaObject &BitcoinGUI::getStaticMetaObject() { return staticMetaObject; } -#endif //Q_NO_DATA_RELOCATION - -const QMetaObject *BitcoinGUI::metaObject() const -{ - return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; -} - -void *BitcoinGUI::qt_metacast(const char *_clname) -{ - if (!_clname) return 0; - if (!strcmp(_clname, qt_meta_stringdata_BitcoinGUI)) - return static_cast<void*>(const_cast< BitcoinGUI*>(this)); - return QMainWindow::qt_metacast(_clname); -} - -int BitcoinGUI::qt_metacall(QMetaObject::Call _c, int _id, void **_a) -{ - _id = QMainWindow::qt_metacall(_c, _id, _a); - if (_id < 0) - return _id; - if (_c == QMetaObject::InvokeMetaMethod) { - switch (_id) { - case 0: currentChanged((*reinterpret_cast< int(*)>(_a[1]))); break; - default: ; - } - _id -= 1; - } - return _id; -} -QT_END_MOC_NAMESPACE |