Wladimir J. van der Laan 14 years ago
parent
commit
3a7abc2c77
  1. 6
      TODO
  2. 15
      aboutdialog.cpp
  3. 13
      aboutdialog.h
  4. 162
      aboutdialog.ui
  5. 20
      addressbookdialog.cpp
  6. 6
      addressbookdialog.h
  7. 121
      addressbookdialog.ui
  8. 11
      bitcoin.pro
  9. 3
      bitcoin.qrc
  10. 2
      bitcoingui.cpp
  11. BIN
      res/icons/address-book.png
  12. BIN
      res/icons/send.png
  13. BIN
      res/images/about.png
  14. 23
      sendcoinsdialog.cpp
  15. 6
      sendcoinsdialog.h
  16. 70
      sendcoinsdialog.ui

6
TODO

@ -54,3 +54,9 @@ AboutDialog
- Toolbar icon - Toolbar icon
- 'notify' on incoming transaction - 'notify' on incoming transaction
- AddressTableModel
- Name / Label
- Address
- Delete / Copy to clipboard based on tab

15
aboutdialog.cpp

@ -1,6 +1,19 @@
#include "aboutdialog.h" #include "aboutdialog.h"
#include "ui_aboutdialog.h"
AboutDialog::AboutDialog(QWidget *parent) : AboutDialog::AboutDialog(QWidget *parent) :
QDialog(parent) QDialog(parent),
ui(new Ui::AboutDialog)
{ {
ui->setupUi(this);
}
AboutDialog::~AboutDialog()
{
delete ui;
}
void AboutDialog::on_buttonBox_accepted()
{
close();
} }

13
aboutdialog.h

@ -3,16 +3,23 @@
#include <QDialog> #include <QDialog>
namespace Ui {
class AboutDialog;
}
class AboutDialog : public QDialog class AboutDialog : public QDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit AboutDialog(QWidget *parent = 0); explicit AboutDialog(QWidget *parent = 0);
~AboutDialog();
signals: private:
Ui::AboutDialog *ui;
public slots:
private slots:
void on_buttonBox_accepted();
}; };
#endif // ABOUTDIALOG_H #endif // ABOUTDIALOG_H

162
aboutdialog.ui

@ -0,0 +1,162 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>AboutDialog</class>
<widget class="QDialog" name="AboutDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>593</width>
<height>319</height>
</rect>
</property>
<property name="windowTitle">
<string>About Bitcoin</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_4">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Ignored">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="bitcoin.qrc">:/images/about</pixmap>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<spacer name="verticalSpacer_2">
<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>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>&lt;b&gt;Bitcoin&lt;/b&gt; version</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>0.3.666-beta</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Copyright (c) 2009-2011 Bitcoin Developers
This is experimental software.
Distributed under the MIT/X11 software license, see the accompanying file license.txt or http://www.opensource.org/licenses/mit-license.php.
This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</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::Ok</set>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources>
<include location="bitcoin.qrc"/>
</resources>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>AboutDialog</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>AboutDialog</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>

20
addressbookdialog.cpp

@ -14,6 +14,26 @@ AddressBookDialog::~AddressBookDialog()
} }
void AddressBookDialog::setTab(int tab) void AddressBookDialog::setTab(int tab)
{
ui->tabWidget->setCurrentIndex(tab);
}
void AddressBookDialog::on_OKButton_clicked()
{
accept();
}
void AddressBookDialog::on_copyToClipboard_clicked()
{
}
void AddressBookDialog::on_editButton_clicked()
{
}
void AddressBookDialog::on_newAddressButton_clicked()
{ {
} }

6
addressbookdialog.h

@ -23,6 +23,12 @@ public:
void setTab(int tab); void setTab(int tab);
private: private:
Ui::AddressBookDialog *ui; Ui::AddressBookDialog *ui;
private slots:
void on_newAddressButton_clicked();
void on_editButton_clicked();
void on_copyToClipboard_clicked();
void on_OKButton_clicked();
}; };
#endif // ADDRESSBOOKDIALOG_H #endif // ADDRESSBOOKDIALOG_H

121
addressbookdialog.ui

@ -6,72 +6,101 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>400</width> <width>591</width>
<height>300</height> <height>347</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Dialog</string> <string>Address Book</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<spacer name="verticalSpacer"> <widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>1</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>Sending</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QTableView" name="tableView"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>Receiving</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>These are your Bitcoin addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you. The highlighted address is displayed in the main window.</string>
</property>
<property name="textFormat">
<enum>Qt::AutoText</enum>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QTableView" name="tableView_2"/>
</item>
</layout>
</widget>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>20</width> <width>40</width>
<height>40</height> <height>20</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QDialogButtonBox" name="buttonBox"> <widget class="QPushButton" name="copyToClipboard">
<property name="orientation"> <property name="text">
<enum>Qt::Horizontal</enum> <string>Copy to Clipboard</string>
</property> </property>
<property name="standardButtons"> </widget>
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> </item>
<item>
<widget class="QPushButton" name="editButton">
<property name="text">
<string>Edit...</string>
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QPushButton" name="newAddressButton">
<property name="text">
<string>New Address...</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="OKButton">
<property name="text">
<string>OK</string>
</property>
</widget>
</item>
</layout>
</item>
</layout> </layout>
</widget> </widget>
<resources/> <resources/>
<connections> <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> </ui>

11
bitcoin.pro

@ -10,24 +10,25 @@ INCLUDEPATH += .
# Input # Input
HEADERS += bitcoingui.h \ HEADERS += bitcoingui.h \
transactiontablemodel.h \ transactiontablemodel.h \
aboutdialog.h \
addresstablemodel.h \ addresstablemodel.h \
optionsdialog.h \ optionsdialog.h \
mainoptionspage.h \ mainoptionspage.h \
sendcoinsdialog.h \ sendcoinsdialog.h \
addressbookdialog.h addressbookdialog.h \
aboutdialog.h
SOURCES += bitcoin.cpp bitcoingui.cpp \ SOURCES += bitcoin.cpp bitcoingui.cpp \
transactiontablemodel.cpp \ transactiontablemodel.cpp \
aboutdialog.cpp \
addresstablemodel.cpp \ addresstablemodel.cpp \
optionsdialog.cpp \ optionsdialog.cpp \
mainoptionspage.cpp \ mainoptionspage.cpp \
sendcoinsdialog.cpp \ sendcoinsdialog.cpp \
addressbookdialog.cpp addressbookdialog.cpp \
aboutdialog.cpp
RESOURCES += \ RESOURCES += \
bitcoin.qrc bitcoin.qrc
FORMS += \ FORMS += \
sendcoinsdialog.ui \ sendcoinsdialog.ui \
addressbookdialog.ui addressbookdialog.ui \
aboutdialog.ui

3
bitcoin.qrc

@ -5,4 +5,7 @@
<file alias="quit">res/icons/quit.png</file> <file alias="quit">res/icons/quit.png</file>
<file alias="send">res/icons/send.png</file> <file alias="send">res/icons/send.png</file>
</qresource> </qresource>
<qresource prefix="/images">
<file alias="about">res/images/about.png</file>
</qresource>
</RCC> </RCC>

2
bitcoingui.cpp

@ -41,7 +41,7 @@ BitcoinGUI::BitcoinGUI(QWidget *parent):
QAction *quit = new QAction(QIcon(":/icons/quit"), tr("&Quit"), this); QAction *quit = new QAction(QIcon(":/icons/quit"), tr("&Quit"), this);
QAction *sendcoins = new QAction(QIcon(":/icons/send"), tr("&Send coins"), this); QAction *sendcoins = new QAction(QIcon(":/icons/send"), tr("&Send coins"), this);
QAction *addressbook = new QAction(QIcon(":/icons/address-book"), tr("&Address book"), this); QAction *addressbook = new QAction(QIcon(":/icons/address-book"), tr("&Address Book"), this);
QAction *about = new QAction(QIcon(":/icons/bitcoin"), tr("&About"), this); QAction *about = new QAction(QIcon(":/icons/bitcoin"), tr("&About"), this);
QAction *receiving_addresses = new QAction(QIcon(":/icons/receiving-addresses"), tr("Your &Receiving Addresses..."), this); QAction *receiving_addresses = new QAction(QIcon(":/icons/receiving-addresses"), tr("Your &Receiving Addresses..."), this);
QAction *options = new QAction(QIcon(":/icons/options"), tr("&Options..."), this); QAction *options = new QAction(QIcon(":/icons/options"), tr("&Options..."), this);

BIN
res/icons/address-book.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 656 B

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
res/icons/send.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 938 B

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
res/images/about.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

23
sendcoinsdialog.cpp

@ -1,6 +1,8 @@
#include "sendcoinsdialog.h" #include "sendcoinsdialog.h"
#include "ui_sendcoinsdialog.h" #include "ui_sendcoinsdialog.h"
#include "addressbookdialog.h"
SendCoinsDialog::SendCoinsDialog(QWidget *parent) : SendCoinsDialog::SendCoinsDialog(QWidget *parent) :
QDialog(parent), QDialog(parent),
ui(new Ui::SendCoinsDialog) ui(new Ui::SendCoinsDialog)
@ -12,3 +14,24 @@ SendCoinsDialog::~SendCoinsDialog()
{ {
delete ui; delete ui;
} }
void SendCoinsDialog::on_sendButton_clicked()
{
accept();
}
void SendCoinsDialog::on_cancelButton_clicked()
{
reject();
}
void SendCoinsDialog::on_pasteButton_clicked()
{
}
void SendCoinsDialog::on_addressBookButton_clicked()
{
AddressBookDialog dlg;
dlg.exec();
}

6
sendcoinsdialog.h

@ -17,6 +17,12 @@ public:
private: private:
Ui::SendCoinsDialog *ui; Ui::SendCoinsDialog *ui;
private slots:
void on_addressBookButton_clicked();
void on_pasteButton_clicked();
void on_cancelButton_clicked();
void on_sendButton_clicked();
}; };
#endif // SENDCOINSDIALOG_H #endif // SENDCOINSDIALOG_H

70
sendcoinsdialog.ui

@ -7,11 +7,11 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>736</width> <width>736</width>
<height>129</height> <height>140</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Dialog</string> <string>Send Coins</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
@ -56,14 +56,14 @@
</widget> </widget>
</item> </item>
<item row="3" column="2"> <item row="3" column="2">
<widget class="QPushButton" name="pushButton"> <widget class="QPushButton" name="pasteButton">
<property name="text"> <property name="text">
<string>&amp;Paste</string> <string>&amp;Paste</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="3"> <item row="3" column="3">
<widget class="QPushButton" name="pushButton_2"> <widget class="QPushButton" name="addressBookButton">
<property name="text"> <property name="text">
<string>Address &amp;Book...</string> <string>Address &amp;Book...</string>
</property> </property>
@ -97,50 +97,38 @@
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QDialogButtonBox" name="buttonBox"> <layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="standardButtons"> <property name="sizeHint" stdset="0">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> <size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="sendButton">
<property name="text">
<string>&amp;Send</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="cancelButton">
<property name="text">
<string>Cancel</string>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</item>
</layout>
</widget> </widget>
<resources/> <resources/>
<connections> <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> </ui>

Loading…
Cancel
Save