Merge pull request #762 from laanwj/qtprogressfix
authorWladimir J. van der Laan <laanwj@gmail.com>
Tue, 17 Jan 2012 08:35:16 +0000 (00:35 -0800)
committerWladimir J. van der Laan <laanwj@gmail.com>
Tue, 17 Jan 2012 08:35:16 +0000 (00:35 -0800)
Revert to global progress indication, also fix the build

src/qt/bitcoingui.cpp
src/qt/optionsmodel.cpp

index d4ce8a7..d77279d 100644 (file)
@@ -417,7 +417,6 @@ void BitcoinGUI::setNumBlocks(int count)
 {
     if(!clientModel)
         return;
-    int initTotal = clientModel->getNumBlocksAtStartup();
     int total = clientModel->getNumBlocksOfPeers();
     QString tooltip;
 
@@ -428,8 +427,8 @@ void BitcoinGUI::setNumBlocks(int count)
             progressBarLabel->setVisible(true);
             progressBarLabel->setText(tr("Synchronizing with network..."));
             progressBar->setVisible(true);
-            progressBar->setMaximum(total - initTotal);
-            progressBar->setValue(count - initTotal);
+            progressBar->setMaximum(total);
+            progressBar->setValue(count);
         }
         else
         {
index 3237845..edc1d61 100644 (file)
@@ -40,7 +40,7 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const
         case ProxyIP:
             return QVariant(QString::fromStdString(addrProxy.ToStringIP()));
         case ProxyPort:
-            return QVariant(QString::fromStdString(addrProxy.ToStringPort()));
+            return QVariant(addrProxy.GetPort());
         case Fee:
             return QVariant(nTransactionFee);
         case DisplayUnit:
@@ -87,7 +87,7 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
         case ProxyIP:
             {
                 // Use CAddress to parse and check IP
-                CAddress addr(value.toString().toStdString() + ":1");
+                CNetAddr addr(value.toString().toStdString());
                 if (addr.IsValid())
                 {
                     addrProxy.SetIP(addr);