add all (unpopulated) dialogs

This commit is contained in:
Wladimir J. van der Laan 2011-05-08 22:23:31 +02:00
parent 4d27c96033
commit 1355cfe131
17 changed files with 169 additions and 211 deletions

2
.gitignore vendored
View file

@ -1,2 +1,4 @@
*~
*.o
moc_*.cpp
*.pro.user

6
AboutDialog.cpp Normal file
View file

@ -0,0 +1,6 @@
#include "AboutDialog.h"
AboutDialog::AboutDialog(QWidget *parent) :
QDialog(parent)
{
}

18
AboutDialog.h Normal file
View file

@ -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

7
AddressBookDialog.cpp Normal file
View file

@ -0,0 +1,7 @@
#include "AddressBookDialog.h"
AddressBookDialog::AddressBookDialog(QWidget *parent) :
QDialog(parent)
{
}

18
AddressBookDialog.h Normal file
View file

@ -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

View file

@ -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");

View file

@ -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);

6
SendCoinsDialog.cpp Normal file
View file

@ -0,0 +1,6 @@
#include "SendCoinsDialog.h"
SendCoinsDialog::SendCoinsDialog(QWidget *parent) :
QDialog(parent)
{
}

18
SendCoinsDialog.h Normal file
View file

@ -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

7
SettingsDialog.cpp Normal file
View file

@ -0,0 +1,7 @@
#include "SettingsDialog.h"
SettingsDialog::SettingsDialog(QWidget *parent) :
QDialog(parent)
{
}

18
SettingsDialog.h Normal file
View file

@ -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

5
TODO
View file

@ -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

View file

@ -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)
{
return columns[section];
if(orientation == Qt::Horizontal)
{
return columns[section];
}
} else if (role == Qt::TextAlignmentRole)
{
return column_alignments[section];
}
return QVariant();
}

View file

@ -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;

View file

@ -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

View file

@ -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>

View file

@ -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