Rename "History" tab to more logical "Transactions", move "Number of transactions...
[novacoin.git] / src / qt / optionsmodel.cpp
index 1528fdf..8f285c6 100644 (file)
@@ -1,11 +1,12 @@
 #include "optionsmodel.h"
-#include "main.h"
-#include "net.h"
+
+#include "headers.h"
 
 #include <QDebug>
 
-OptionsModel::OptionsModel(QObject *parent) :
-    QAbstractListModel(parent)
+OptionsModel::OptionsModel(CWallet *wallet, QObject *parent) :
+    QAbstractListModel(parent),
+    wallet(wallet)
 {
 }
 
@@ -48,7 +49,7 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
     bool successful = true; /* set to false on parse error */
     if(role == Qt::EditRole)
     {
-        CWalletDB walletdb;
+        CWalletDB walletdb(wallet->strWalletFile);
         switch(index.row())
         {
         case StartAtStartup:
@@ -75,7 +76,7 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
             break;
         case ProxyIP:
             {
-                /* Use CAddress to parse IP */
+                // Use CAddress to parse and check IP
                 CAddress addr(value.toString().toStdString() + ":1");
                 if (addr.ip != INADDR_NONE)
                 {
@@ -111,7 +112,7 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
                 }
                 else
                 {
-                    successful = false; /* parse error */
+                    successful = false; // Parse error
                 }
             }
             break;