Use resource system
This commit is contained in:
parent
1355cfe131
commit
13740b7ed1
5 changed files with 52 additions and 13 deletions
6
AddressTableModel.cpp
Normal file
6
AddressTableModel.cpp
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
#include "AddressTableModel.h"
|
||||||
|
|
||||||
|
AddressTableModel::AddressTableModel(QObject *parent) :
|
||||||
|
QAbstractTableModel(parent)
|
||||||
|
{
|
||||||
|
}
|
18
AddressTableModel.h
Normal file
18
AddressTableModel.h
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
#ifndef ADDRESSTABLEMODEL_H
|
||||||
|
#define ADDRESSTABLEMODEL_H
|
||||||
|
|
||||||
|
#include <QAbstractTableModel>
|
||||||
|
|
||||||
|
class AddressTableModel : public QAbstractTableModel
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
explicit AddressTableModel(QObject *parent = 0);
|
||||||
|
|
||||||
|
signals:
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // ADDRESSTABLEMODEL_H
|
|
@ -19,6 +19,7 @@
|
||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QHeaderView>
|
#include <QHeaderView>
|
||||||
|
#include <QLocale>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
@ -27,12 +28,12 @@ BitcoinGUI::BitcoinGUI(QWidget *parent):
|
||||||
{
|
{
|
||||||
resize(850, 550);
|
resize(850, 550);
|
||||||
setWindowTitle("Bitcoin");
|
setWindowTitle("Bitcoin");
|
||||||
setWindowIcon(QIcon("bitcoin.png"));
|
setWindowIcon(QIcon(":icons/bitcoin"));
|
||||||
|
|
||||||
QAction *quit = new QAction(QIcon("quit.png"), "&Quit", this);
|
QAction *quit = new QAction(QIcon(":/icons/quit"), "&Quit", this);
|
||||||
QAction *sendcoins = new QAction(QIcon("send.png"), "&Send coins", this);
|
QAction *sendcoins = new QAction(QIcon(":/icons/send"), "&Send coins", this);
|
||||||
QAction *addressbook = new QAction(QIcon("address-book.png"), "&Address book", this);
|
QAction *addressbook = new QAction(QIcon(":/icons/address-book"), "&Address book", this);
|
||||||
QAction *about = new QAction(QIcon("bitcoin.png"), "&About", this);
|
QAction *about = new QAction(QIcon(":/icons/bitcoin"), "&About", this);
|
||||||
|
|
||||||
/* Menus */
|
/* Menus */
|
||||||
QMenu *file = menuBar()->addMenu("&File");
|
QMenu *file = menuBar()->addMenu("&File");
|
||||||
|
@ -66,9 +67,10 @@ BitcoinGUI::BitcoinGUI(QWidget *parent):
|
||||||
|
|
||||||
/* Balance: <balance> */
|
/* Balance: <balance> */
|
||||||
QHBoxLayout *hbox_balance = new QHBoxLayout();
|
QHBoxLayout *hbox_balance = new QHBoxLayout();
|
||||||
hbox_balance->addWidget(new QLabel("Balance:"));
|
hbox_balance->addWidget(new QLabel(tr("Balance:")));
|
||||||
hbox_balance->addSpacing(5);/* Add some spacing between the label and the text */
|
hbox_balance->addSpacing(5);/* Add some spacing between the label and the text */
|
||||||
QLabel *label_balance = new QLabel("1,234.54");
|
|
||||||
|
QLabel *label_balance = new QLabel(QLocale::system().toString(1345.54)); /* TODO: use locale to format amount */
|
||||||
label_balance->setFont(QFont("Teletype"));
|
label_balance->setFont(QFont("Teletype"));
|
||||||
hbox_balance->addWidget(label_balance);
|
hbox_balance->addWidget(label_balance);
|
||||||
hbox_balance->addStretch(1);
|
hbox_balance->addStretch(1);
|
||||||
|
@ -106,10 +108,10 @@ BitcoinGUI::BitcoinGUI(QWidget *parent):
|
||||||
/* TODO: alignment; debit/credit columns must align right */
|
/* TODO: alignment; debit/credit columns must align right */
|
||||||
|
|
||||||
QTabBar *tabs = new QTabBar(this);
|
QTabBar *tabs = new QTabBar(this);
|
||||||
tabs->addTab("All transactions");
|
tabs->addTab(tr("All transactions"));
|
||||||
tabs->addTab("Sent/Received");
|
tabs->addTab(tr("Sent/Received"));
|
||||||
tabs->addTab("Sent");
|
tabs->addTab(tr("Sent"));
|
||||||
tabs->addTab("Received");
|
tabs->addTab(tr("Received"));
|
||||||
|
|
||||||
vbox->addWidget(tabs);
|
vbox->addWidget(tabs);
|
||||||
vbox->addWidget(transaction_table);
|
vbox->addWidget(transaction_table);
|
||||||
|
|
|
@ -13,10 +13,15 @@ HEADERS += BitcoinGUI.h \
|
||||||
SendCoinsDialog.h \
|
SendCoinsDialog.h \
|
||||||
SettingsDialog.h \
|
SettingsDialog.h \
|
||||||
AddressBookDialog.h \
|
AddressBookDialog.h \
|
||||||
AboutDialog.h
|
AboutDialog.h \
|
||||||
|
AddressTableModel.h
|
||||||
SOURCES += bitcoin.cpp BitcoinGUI.cpp \
|
SOURCES += bitcoin.cpp BitcoinGUI.cpp \
|
||||||
TransactionTableModel.cpp \
|
TransactionTableModel.cpp \
|
||||||
SendCoinsDialog.cpp \
|
SendCoinsDialog.cpp \
|
||||||
SettingsDialog.cpp \
|
SettingsDialog.cpp \
|
||||||
AddressBookDialog.cpp \
|
AddressBookDialog.cpp \
|
||||||
AboutDialog.cpp
|
AboutDialog.cpp \
|
||||||
|
AddressTableModel.cpp
|
||||||
|
|
||||||
|
RESOURCES += \
|
||||||
|
bitcoin.qrc
|
||||||
|
|
8
bitcoin.qrc
Normal file
8
bitcoin.qrc
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
<RCC>
|
||||||
|
<qresource prefix="/icons">
|
||||||
|
<file alias="address-book">res/icons/address-book.png</file>
|
||||||
|
<file alias="bitcoin">res/icons/bitcoin.png</file>
|
||||||
|
<file alias="quit">res/icons/quit.png</file>
|
||||||
|
<file alias="send">res/icons/send.png</file>
|
||||||
|
</qresource>
|
||||||
|
</RCC>
|
Loading…
Reference in a new issue