]> Git Repo - VerusCoin.git/commitdiff
add 2 labels to the overviewpage that display Wallet and Transaction status (obsolete...
authorPhilip Kaufmann <[email protected]>
Tue, 15 May 2012 14:57:59 +0000 (16:57 +0200)
committerPhilip Kaufmann <[email protected]>
Thu, 17 May 2012 19:49:32 +0000 (21:49 +0200)
src/qt/bitcoingui.cpp
src/qt/forms/overviewpage.ui
src/qt/overviewpage.cpp
src/qt/overviewpage.h

index 6b97d97656d7859d0b69fdcf9228168be963d777..1d5ae94682efdbf41ad8bc700e6b45d95a281da4 100644 (file)
@@ -574,12 +574,16 @@ void BitcoinGUI::setNumBlocks(int count)
     {
         tooltip = tr("Up to date") + QString(".<br>") + tooltip;
         labelBlocksIcon->setPixmap(QIcon(":/icons/synced").pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE));
+
+        overviewPage->showOutOfSyncWarning(false);
     }
     else
     {
         tooltip = tr("Catching up...") + QString("<br>") + tooltip;
         labelBlocksIcon->setMovie(syncIconMovie);
         syncIconMovie->start();
+
+        overviewPage->showOutOfSyncWarning(true);
     }
 
     if(!text.isEmpty())
index aeace9f30dda6bcd13b159bbe0f10bf3e76a5493..c7143f3670fb883df960817aab2d9bf2977a3619 100644 (file)
         <property name="verticalSpacing">
          <number>12</number>
         </property>
-        <item row="2" column="0">
+        <item row="0" column="0">
+         <widget class="QLabel" name="label_5">
+          <property name="font">
+           <font>
+            <pointsize>11</pointsize>
+            <weight>75</weight>
+            <bold>true</bold>
+           </font>
+          </property>
+          <property name="text">
+           <string>Wallet</string>
+          </property>
+         </widget>
+        </item>
+        <item row="0" column="1">
+         <widget class="QLabel" name="labelWalletStatus">
+          <property name="font">
+           <font>
+            <weight>75</weight>
+            <bold>true</bold>
+           </font>
+          </property>
+          <property name="toolTip">
+           <string>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</string>
+          </property>
+          <property name="text">
+           <string notr="true">(out of sync)</string>
+          </property>
+         </widget>
+        </item>
+        <item row="1" column="0">
          <widget class="QLabel" name="label">
           <property name="text">
            <string>Balance:</string>
           </property>
          </widget>
         </item>
-        <item row="2" column="1">
+        <item row="1" column="1">
          <widget class="QLabel" name="labelBalance">
           <property name="font">
            <font>
           </property>
          </widget>
         </item>
-        <item row="4" column="0">
-         <widget class="QLabel" name="label_2">
-          <property name="text">
-           <string>Number of transactions:</string>
-          </property>
-         </widget>
-        </item>
-        <item row="4" column="1">
-         <widget class="QLabel" name="labelNumTransactions">
-          <property name="toolTip">
-           <string>Total number of transactions in wallet</string>
-          </property>
-          <property name="text">
-           <string>0</string>
-          </property>
-         </widget>
-        </item>
-        <item row="3" column="0">
+        <item row="2" column="0">
          <widget class="QLabel" name="label_3">
           <property name="text">
            <string>Unconfirmed:</string>
           </property>
          </widget>
         </item>
-        <item row="3" column="1">
+        <item row="2" column="1">
          <widget class="QLabel" name="labelUnconfirmed">
           <property name="font">
            <font>
           </property>
          </widget>
         </item>
-        <item row="1" column="0">
-         <widget class="QLabel" name="label_5">
-          <property name="font">
-           <font>
-            <pointsize>11</pointsize>
-            <weight>75</weight>
-            <bold>true</bold>
-           </font>
+        <item row="3" column="0">
+         <widget class="QLabel" name="label_2">
+          <property name="text">
+           <string>Number of transactions:</string>
+          </property>
+         </widget>
+        </item>
+        <item row="3" column="1">
+         <widget class="QLabel" name="labelNumTransactions">
+          <property name="toolTip">
+           <string>Total number of transactions in wallet</string>
           </property>
           <property name="text">
-           <string>Wallet</string>
+           <string notr="true">0</string>
           </property>
          </widget>
         </item>
        <property name="frameShadow">
         <enum>QFrame::Raised</enum>
        </property>
-       <layout class="QVBoxLayout" name="verticalLayout">
-        <item>
+       <layout class="QFormLayout" name="formLayout">
+        <item row="0" column="0">
          <widget class="QLabel" name="label_4">
           <property name="text">
            <string>&lt;b&gt;Recent transactions&lt;/b&gt;</string>
           </property>
          </widget>
         </item>
-        <item>
-         <widget class="QListView" name="listTransactions">
-          <property name="styleSheet">
-           <string notr="true">QListView { background:transparent }</string>
-          </property>
-          <property name="frameShape">
-           <enum>QFrame::NoFrame</enum>
-          </property>
-          <property name="verticalScrollBarPolicy">
-           <enum>Qt::ScrollBarAlwaysOff</enum>
+        <item row="0" column="1">
+         <widget class="QLabel" name="labelTransactionsStatus">
+          <property name="font">
+           <font>
+            <weight>75</weight>
+            <bold>true</bold>
+           </font>
           </property>
-          <property name="horizontalScrollBarPolicy">
-           <enum>Qt::ScrollBarAlwaysOff</enum>
+          <property name="toolTip">
+           <string>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</string>
           </property>
-          <property name="selectionMode">
-           <enum>QAbstractItemView::NoSelection</enum>
+          <property name="text">
+           <string notr="true">(out of sync)</string>
           </property>
          </widget>
         </item>
        </layout>
       </widget>
      </item>
+     <item>
+      <widget class="QListView" name="listTransactions">
+       <property name="styleSheet">
+        <string notr="true">QListView { background: transparent; }</string>
+       </property>
+       <property name="frameShape">
+        <enum>QFrame::NoFrame</enum>
+       </property>
+       <property name="verticalScrollBarPolicy">
+        <enum>Qt::ScrollBarAlwaysOff</enum>
+       </property>
+       <property name="horizontalScrollBarPolicy">
+        <enum>Qt::ScrollBarAlwaysOff</enum>
+       </property>
+       <property name="selectionMode">
+        <enum>QAbstractItemView::NoSelection</enum>
+       </property>
+      </widget>
+     </item>
      <item>
       <spacer name="verticalSpacer_2">
        <property name="orientation">
index d0ba37796767f79af9c833cd660c0ed104a26ae4..e4c742262fff23e800ec071a6319a0f947d9ac19 100644 (file)
@@ -105,6 +105,15 @@ OverviewPage::OverviewPage(QWidget *parent) :
     ui->listTransactions->setAttribute(Qt::WA_MacShowFocusRect, false);
 
     connect(ui->listTransactions, SIGNAL(clicked(QModelIndex)), this, SLOT(handleTransactionClicked(QModelIndex)));
+
+    // init "out of sync" warning labels
+    ui->labelWalletStatus->setText("(" + tr("out of sync") + ")");
+    ui->labelWalletStatus->setStyleSheet("QLabel { color: red; }");
+    ui->labelTransactionsStatus->setText("(" + tr("out of sync") + ")");
+    ui->labelTransactionsStatus->setStyleSheet("QLabel { color: red; }");
+
+    // start with displaying the "out of sync" warnings
+    showOutOfSyncWarning(true);
 }
 
 void OverviewPage::handleTransactionClicked(const QModelIndex &index)
@@ -169,3 +178,9 @@ void OverviewPage::displayUnitChanged()
     txdelegate->unit = model->getOptionsModel()->getDisplayUnit();
     ui->listTransactions->update();
 }
+
+void OverviewPage::showOutOfSyncWarning(bool fShow)
+{
+    ui->labelWalletStatus->setVisible(fShow);
+    ui->labelTransactionsStatus->setVisible(fShow);
+}
index 1acd1b7f3981605f1ad7cf62ae1bd1520b121752..208b324feb6c7a8a56067d089c9cfbc7a0de1752 100644 (file)
@@ -24,6 +24,7 @@ public:
     ~OverviewPage();
 
     void setModel(WalletModel *model);
+    void showOutOfSyncWarning(bool fShow);
 
 public slots:
     void setBalance(qint64 balance, qint64 unconfirmedBalance);
This page took 0.038236 seconds and 4 git commands to generate.