aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPhilip Kaufmann <phil.kaufmann@t-online.de>2012-05-15 16:57:59 +0200
committerPhilip Kaufmann <phil.kaufmann@t-online.de>2012-05-17 21:49:32 +0200
commitc26f3a9bd117a8f4bdae8b35083d1503a8d136ee (patch)
tree3faca8a1f6f259ffcef82bcd5c8ad4d8ba7c9195 /src
parentcf2f7c30a3b461c8db8703f3d522076fdacd81ba (diff)
add 2 labels to the overviewpage that display Wallet and Transaction status (obsolete or current) / cleanup overviewpage XML ui-file
Diffstat (limited to 'src')
-rw-r--r--src/qt/bitcoingui.cpp4
-rw-r--r--src/qt/forms/overviewpage.ui124
-rw-r--r--src/qt/overviewpage.cpp15
-rw-r--r--src/qt/overviewpage.h1
4 files changed, 98 insertions, 46 deletions
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
index 6b97d97656..1d5ae94682 100644
--- a/src/qt/bitcoingui.cpp
+++ b/src/qt/bitcoingui.cpp
@@ -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())
diff --git a/src/qt/forms/overviewpage.ui b/src/qt/forms/overviewpage.ui
index aeace9f30d..c7143f3670 100644
--- a/src/qt/forms/overviewpage.ui
+++ b/src/qt/forms/overviewpage.ui
@@ -34,14 +34,44 @@
<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>
@@ -63,31 +93,14 @@
</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>
@@ -109,17 +122,20 @@
</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>
@@ -151,30 +167,27 @@
<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>
@@ -182,6 +195,25 @@
</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">
<enum>Qt::Vertical</enum>
diff --git a/src/qt/overviewpage.cpp b/src/qt/overviewpage.cpp
index d0ba377967..e4c742262f 100644
--- a/src/qt/overviewpage.cpp
+++ b/src/qt/overviewpage.cpp
@@ -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);
+}
diff --git a/src/qt/overviewpage.h b/src/qt/overviewpage.h
index 1acd1b7f39..208b324feb 100644
--- a/src/qt/overviewpage.h
+++ b/src/qt/overviewpage.h
@@ -24,6 +24,7 @@ public:
~OverviewPage();
void setModel(WalletModel *model);
+ void showOutOfSyncWarning(bool fShow);
public slots:
void setBalance(qint64 balance, qint64 unconfirmedBalance);