remove transparency effect and windows-specific code for now, it's not working as...
[novacoin.git] / src / qt / optionsdialog.cpp
index 4f3a82d..0eeb6f8 100644 (file)
@@ -3,6 +3,8 @@
 #include "bitcoinamountfield.h"
 #include "monitoreddatamapper.h"
 #include "guiutil.h"
+#include "bitcoinunits.h"
+#include "qvaluecombobox.h"
 
 #include <QHBoxLayout>
 #include <QVBoxLayout>
@@ -17,7 +19,6 @@
 #include <QDoubleValidator>
 #include <QRegExpValidator>
 #include <QDialogButtonBox>
-#include <QDebug>
 
 /* First page of options */
 class MainOptionsPage : public QWidget
@@ -49,7 +50,8 @@ public:
 
     void setMapper(MonitoredDataMapper *mapper);
 private:
-    QLineEdit *unit;
+    QValueComboBox *unit;
+    QCheckBox *display_addresses;
 signals:
 
 public slots:
@@ -72,7 +74,7 @@ OptionsDialog::OptionsDialog(QWidget *parent):
     pages_widget->addWidget(main_page);
 
     QListWidgetItem *item_display = new QListWidgetItem(tr("Display"));
-    //contents_widget->addItem(item_display);
+    contents_widget->addItem(item_display);
     display_page = new DisplayOptionsPage(this);
     pages_widget->addWidget(display_page);
 
@@ -103,7 +105,6 @@ OptionsDialog::OptionsDialog(QWidget *parent):
     connect(mapper, SIGNAL(currentIndexChanged(int)), this, SLOT(disableApply()));
 
     /* Event bindings */
-    qDebug() << "setup";
     connect(contents_widget, SIGNAL(currentRowChanged(int)), this, SLOT(changePage(int)));
     connect(buttonbox->button(QDialogButtonBox::Ok), SIGNAL(clicked()), this, SLOT(okClicked()));
     connect(buttonbox->button(QDialogButtonBox::Cancel), SIGNAL(clicked()), this, SLOT(cancelClicked()));
@@ -123,7 +124,6 @@ void OptionsDialog::setModel(OptionsModel *model)
 
 void OptionsDialog::changePage(int index)
 {
-    qDebug() << "page" << index;
     pages_widget->setCurrentIndex(index);
 }
 
@@ -248,16 +248,23 @@ DisplayOptionsPage::DisplayOptionsPage(QWidget *parent):
         QWidget(parent)
 {
     QVBoxLayout *layout = new QVBoxLayout();
+
     QHBoxLayout *unit_hbox = new QHBoxLayout();
     unit_hbox->addSpacing(18);
-    QLabel *unit_label = new QLabel(tr("&Unit: "));
+    QLabel *unit_label = new QLabel(tr("&Unit to show amounts in: "));
     unit_hbox->addWidget(unit_label);
-    unit = new QLineEdit();
+    unit = new QValueComboBox(this);
+    unit->setModel(new BitcoinUnits(this));
+    unit->setToolTip(tr("Choose the default subdivision unit to show in the interface, and when sending coins"));
 
     unit_label->setBuddy(unit);
     unit_hbox->addWidget(unit);
 
     layout->addLayout(unit_hbox);
+
+    display_addresses = new QCheckBox(tr("Display addresses in transaction list"), this);
+    layout->addWidget(display_addresses);
+
     layout->addStretch();
 
     setLayout(layout);
@@ -265,4 +272,6 @@ DisplayOptionsPage::DisplayOptionsPage(QWidget *parent):
 
 void DisplayOptionsPage::setMapper(MonitoredDataMapper *mapper)
 {
+    mapper->addMapping(unit, OptionsModel::DisplayUnit);
+    mapper->addMapping(display_addresses, OptionsModel::DisplayAddresses);
 }