Updated UserInterface

This commit is contained in:
Andre Jochems
2016-06-02 20:30:07 +02:00
parent 1a5784fa8b
commit 1b7473bcb2
7 changed files with 433 additions and 581 deletions

View File

@@ -35,44 +35,6 @@
<property name="horizontalSpacing"> <property name="horizontalSpacing">
<number>15</number> <number>15</number>
</property> </property>
<item row="1" column="0">
<widget class="QFrame" name="exchangeInfoBox">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="1" column="0">
<layout class="QVBoxLayout" name="verticalLayoutExchanges"/>
</item>
<item row="0" column="0">
<widget class="QLabel" name="lblExchangesHeader">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(166, 27, 31);</string>
</property>
<property name="text">
<string>Exchanges</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QFrame" name="coinInfoBox"> <widget class="QFrame" name="coinInfoBox">
<property name="sizePolicy"> <property name="sizePolicy">
@@ -221,306 +183,6 @@
</item> </item>
<item row="2" column="1"> <item row="2" column="1">
<widget class="QLabel" name="txtCoinSupply"> <widget class="QLabel" name="txtCoinSupply">
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string notr="true">-</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="lblConnections">
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>Number of connections</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="txtConnections">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string notr="true">-</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="lblDifficulty">
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>Difficulty</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLabel" name="txtDifficulty">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string notr="true">-</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="lblHashRate">
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>Network Hashrate</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QLabel" name="txtHashRate">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string notr="true">-</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="lblTransactionCount">
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>Transactions</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QLabel" name="txtTransactionCount">
<property name="font"> <property name="font">
<font> <font>
<weight>75</weight> <weight>75</weight>
@@ -558,11 +220,165 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="0">
<widget class="QLabel" name="lblCoinValue">
<property name="text">
<string>Coin Value</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="txtCoinValue">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>-</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="lblConnections">
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>Number of connections</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLabel" name="txtConnections">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string notr="true">-</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="lblDifficulty">
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>Difficulty</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QLabel" name="txtDifficulty">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string notr="true">-</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="lblHashRate">
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>Network Hashrate</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QLabel" name="txtHashRate">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string notr="true">-</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="1" column="0">
<widget class="QFrame" name="exchangeInfoBox">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="1" column="0">
<layout class="QVBoxLayout" name="verticalLayoutExchanges"/>
</item>
<item row="0" column="0">
<widget class="QLabel" name="lblExchangesHeader">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(166, 27, 31);</string>
</property>
<property name="text">
<string>Exchanges</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout> </layout>
</widget> </widget>
<resources/> <resources/>

View File

@@ -38,230 +38,265 @@
<number>7</number> <number>7</number>
</property> </property>
<item> <item>
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="groupBox">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>470</width> <width>470</width>
<height>0</height> <height>0</height>
</size> </size>
</property>
<property name="maximumSize">
<size>
<width>470</width>
<height>16777215</height>
</size>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<property name="topMargin">
<number>7</number>
</property> </property>
<property name="maximumSize"> <property name="bottomMargin">
<size> <number>7</number>
<width>470</width>
<height>16777215</height>
</size>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_4"> <item>
<property name="topMargin"> <layout class="QFormLayout" name="formLayout_2">
<number>7</number> <property name="fieldGrowthPolicy">
</property> <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
<property name="bottomMargin"> </property>
<number>7</number> <property name="horizontalSpacing">
</property> <number>12</number>
<item> </property>
<layout class="QFormLayout" name="formLayout_2"> <property name="verticalSpacing">
<property name="fieldGrowthPolicy"> <number>12</number>
<enum>QFormLayout::AllNonFixedFieldsGrow</enum> </property>
</property> <item row="0" column="0" colspan="2">
<property name="horizontalSpacing"> <layout class="QHBoxLayout" name="horizontalLayout_4">
<number>12</number> <item>
</property> <widget class="QLabel" name="label_5">
<property name="verticalSpacing"> <property name="font">
<number>12</number> <font>
</property> <pointsize>10</pointsize>
<item row="0" column="0" colspan="2"> <weight>75</weight>
<layout class="QHBoxLayout" name="horizontalLayout_4"> <bold>true</bold>
<item> </font>
<widget class="QLabel" name="label_5"> </property>
<property name="font"> <property name="styleSheet">
<font> <string notr="true">color: rgb(166, 27, 31);</string>
<pointsize>10</pointsize> </property>
<weight>75</weight> <property name="text">
<bold>true</bold> <string>Wallet</string>
</font> </property>
</property> </widget>
<property name="styleSheet"> </item>
<string notr="true">color: rgb(166, 27, 31);</string> <item>
</property> <spacer name="horizontalSpacer_2">
<property name="text"> <property name="orientation">
<string>Wallet</string> <enum>Qt::Horizontal</enum>
</property> </property>
</widget> <property name="sizeHint" stdset="0">
</item> <size>
<item> <width>40</width>
<spacer name="horizontalSpacer_2"> <height>20</height>
<property name="orientation"> </size>
<enum>Qt::Horizontal</enum> </property>
</property> </spacer>
<property name="sizeHint" stdset="0"> </item>
<size> <item>
<width>40</width> <widget class="QLabel" name="labelWalletStatus">
<height>20</height> <property name="toolTip">
</size> <string>The displayed information may be out of date. Your wallet automatically synchronizes with the CasinoCoin network after a connection is established, but this process has not completed yet.</string>
</property> </property>
</spacer> <property name="styleSheet">
</item> <string notr="true">color: rgb(166, 27, 31);</string>
<item> </property>
<widget class="QLabel" name="labelWalletStatus"> <property name="text">
<property name="toolTip"> <string notr="true">(out of sync)</string>
<string>The displayed information may be out of date. Your wallet automatically synchronizes with the CasinoCoin network after a connection is established, but this process has not completed yet.</string> </property>
</property> <property name="alignment">
<property name="styleSheet"> <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
<string notr="true">color: rgb(166, 27, 31);</string> </property>
</property> </widget>
<property name="text"> </item>
<string notr="true">(out of sync)</string> </layout>
</property> </item>
<property name="alignment"> <item row="1" column="0">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> <widget class="QLabel" name="labelBalanceText">
</property> <property name="text">
</widget> <string>Balance:</string>
</item> </property>
</layout> </widget>
</item> </item>
<item row="1" column="0"> <item row="1" column="1">
<widget class="QLabel" name="labelBalanceText"> <widget class="QLabel" name="labelBalance">
<property name="text"> <property name="font">
<string>Balance:</string> <font>
</property> <pointsize>10</pointsize>
</widget> <weight>75</weight>
</item> <bold>true</bold>
<item row="1" column="1"> </font>
<widget class="QLabel" name="labelBalance"> </property>
<property name="font"> <property name="cursor">
<font> <cursorShape>IBeamCursor</cursorShape>
<pointsize>10</pointsize> </property>
<weight>75</weight> <property name="toolTip">
<bold>true</bold> <string>Your current balance</string>
</font> </property>
</property> <property name="text">
<property name="cursor"> <string notr="true">0 CSC</string>
<cursorShape>IBeamCursor</cursorShape> </property>
</property> <property name="alignment">
<property name="toolTip"> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
<string>Your current balance</string> </property>
</property> <property name="textInteractionFlags">
<property name="text"> <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
<string notr="true">0 CSC</string> </property>
</property> </widget>
<property name="alignment"> </item>
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <item row="2" column="0">
</property> <widget class="QLabel" name="labelUnconfirmedText">
<property name="textInteractionFlags"> <property name="text">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> <string>Unconfirmed:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0"> <item row="2" column="1">
<widget class="QLabel" name="labelUnconfirmedText"> <widget class="QLabel" name="labelUnconfirmed">
<property name="text"> <property name="font">
<string>Unconfirmed:</string> <font>
</property> <weight>75</weight>
</widget> <bold>true</bold>
</item> </font>
<item row="2" column="1"> </property>
<widget class="QLabel" name="labelUnconfirmed"> <property name="cursor">
<property name="font"> <cursorShape>IBeamCursor</cursorShape>
<font> </property>
<weight>75</weight> <property name="toolTip">
<bold>true</bold> <string>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</string>
</font> </property>
</property> <property name="text">
<property name="cursor"> <string notr="true">0 CSC</string>
<cursorShape>IBeamCursor</cursorShape> </property>
</property> <property name="alignment">
<property name="toolTip"> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
<string>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</string> </property>
</property> <property name="textInteractionFlags">
<property name="text"> <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
<string notr="true">0 CSC</string> </property>
</property> </widget>
<property name="alignment"> </item>
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <item row="3" column="0">
</property> <widget class="QLabel" name="labelImmatureText">
<property name="textInteractionFlags"> <property name="text">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> <string>Immature:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="0"> <item row="3" column="1">
<widget class="QLabel" name="labelImmatureText"> <widget class="QLabel" name="labelImmature">
<property name="text"> <property name="font">
<string>Immature:</string> <font>
</property> <weight>75</weight>
</widget> <bold>true</bold>
</item> </font>
<item row="3" column="1"> </property>
<widget class="QLabel" name="labelImmature"> <property name="toolTip">
<property name="font"> <string>Mined balance that has not yet matured</string>
<font> </property>
<weight>75</weight> <property name="text">
<bold>true</bold> <string notr="true">0 CSC</string>
</font> </property>
</property> <property name="alignment">
<property name="toolTip"> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
<string>Mined balance that has not yet matured</string> </property>
</property> <property name="textInteractionFlags">
<property name="text"> <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
<string notr="true">0 CSC</string> </property>
</property> </widget>
<property name="alignment"> </item>
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <item row="4" column="0">
</property> <widget class="QLabel" name="labelBalanceFiatText">
<property name="textInteractionFlags"> <property name="text">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> <string>Estimated Fiat Balance:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="0"> <item row="4" column="1">
<widget class="QLabel" name="labelBalanceFiatText"> <widget class="QLabel" name="labelBalanceFiat">
<property name="text"> <property name="font">
<string>Estimated Fiat Balance:</string> <font>
</property> <weight>75</weight>
</widget> <bold>true</bold>
</item> </font>
<item row="4" column="1"> </property>
<widget class="QLabel" name="labelBalanceFiat"> <property name="toolTip">
<property name="font"> <string>Estimated Fiat balance calculated against current market value</string>
<font> </property>
<weight>75</weight> <property name="text">
<bold>true</bold> <string notr="true">0</string>
</font> </property>
</property> <property name="alignment">
<property name="toolTip"> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
<string>Estimated Fiat balance calculated against current market value</string> </property>
</property> <property name="textInteractionFlags">
<property name="text"> <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
<string notr="true">0</string> </property>
</property> </widget>
<property name="alignment"> </item>
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <item row="5" column="0">
</property> <widget class="QLabel" name="lblTransactionCount">
<property name="textInteractionFlags"> <property name="styleSheet">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> <string notr="true"/>
</property> </property>
</widget> <property name="text">
</item> <string>Transactions:</string>
<item row="5" column="0" colspan="2"> </property>
<spacer name="verticalSpacer"> <property name="wordWrap">
<property name="orientation"> <bool>true</bool>
<enum>Qt::Vertical</enum> </property>
</property> </widget>
<property name="sizeHint" stdset="0"> </item>
<size> <item row="5" column="1">
<width>20</width> <widget class="QLabel" name="txtTransactionCount">
<height>100</height> <property name="font">
</size> <font>
</property> <weight>75</weight>
</spacer> <bold>true</bold>
</item> </font>
</layout> </property>
</item> <property name="styleSheet">
<item> <string notr="true"/>
<layout class="QVBoxLayout" name="verticalLayoutAdvertWidget"/> </property>
</item> <property name="text">
</layout> <string notr="true">-</string>
</widget> </property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="6" column="0" colspan="2">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>100</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayoutAdvertWidget"/>
</item>
</layout>
</widget>
</item> </item>
</layout> </layout>
</item> </item>

View File

@@ -25,12 +25,6 @@ InfoPage::InfoPage(QWidget *parent) :
void InfoPage::setWalletModel(WalletModel *model) void InfoPage::setWalletModel(WalletModel *model)
{ {
this->walletModel = model; this->walletModel = model;
if(model)
{
// subscribe to transaction changes
connect(model, SIGNAL(numTransactionsChanged(int)), this, SLOT(setNumTransactions(int)));
setNumTransactions(model->getNumTransactions());
}
} }
void InfoPage::setClientModel(ClientModel *model) void InfoPage::setClientModel(ClientModel *model)
@@ -65,11 +59,6 @@ void InfoPage::setNumBlocks(int count, int countOfPeers)
} }
} }
void InfoPage::setNumTransactions(int count)
{
ui->txtTransactionCount->setText(QString::number(count));
}
double InfoPage::GetNetworkHashRate(int lookup, int height) { double InfoPage::GetNetworkHashRate(int lookup, int height) {
CBlockIndex *pb = pindexBest; CBlockIndex *pb = pindexBest;
@@ -119,7 +108,8 @@ void InfoPage::createExchangesWidget()
ui->verticalLayoutExchanges->addWidget( exchangesWidget->dockQmlToWidget() ); ui->verticalLayoutExchanges->addWidget( exchangesWidget->dockQmlToWidget() );
} }
void InfoPage::setCoinFiatValue(QString coinValue) void InfoPage::setCoinValues(QString coinValue, QString coinFiatValue)
{ {
ui->txtCoinFiatValue->setText(coinValue); ui->txtCoinValue->setText(coinValue);
ui->txtCoinFiatValue->setText(coinFiatValue);
} }

View File

@@ -20,10 +20,8 @@ public slots:
void setNumConnections(int count); void setNumConnections(int count);
/** Set number of blocks shown in the UI */ /** Set number of blocks shown in the UI */
void setNumBlocks(int count, int countOfPeers); void setNumBlocks(int count, int countOfPeers);
/** Set number of transactions shown in the UI */ /** Set coin values */
void setNumTransactions(int count); void setCoinValues(const QString coinValue, const QString coinFiatValue);
/** Set Fiat coin value */
void setCoinFiatValue(const QString coinValue);
public: public:
explicit InfoPage(QWidget *parent = 0); explicit InfoPage(QWidget *parent = 0);

View File

@@ -219,6 +219,10 @@ void OverviewPage::setWalletModel(WalletModel *model)
// set visibility of adverts widget // set visibility of adverts widget
updateDisplayPromotions(model->getOptionsModel()->getDisplayPromotions()); updateDisplayPromotions(model->getOptionsModel()->getDisplayPromotions());
// subscribe to transaction changes
connect(model, SIGNAL(numTransactionsChanged(int)), this, SLOT(setNumTransactions(int)));
setNumTransactions(model->getNumTransactions());
} }
// update the display unit, to not use the default ("BTC") // update the display unit, to not use the default ("BTC")
@@ -263,6 +267,7 @@ void OverviewPage::updateCoinInfoFromWeb( JsonCoinInfoParser* coinInfoParser )
{ {
qDebug() << "CoinInfo ID: " << coinInfoParser->getCoinInfo().find("ID").value().toDouble(); qDebug() << "CoinInfo ID: " << coinInfoParser->getCoinInfo().find("ID").value().toDouble();
qDebug() << "CoinInfo InfoTime: " <<coinInfoParser->getCoinInfo().find("InfoTime").value().toString(); qDebug() << "CoinInfo InfoTime: " <<coinInfoParser->getCoinInfo().find("InfoTime").value().toString();
qDebug() << "CoinInfo CoinValue: " << QString::number( coinInfoParser->getCoinInfo().find("PriceBTC").value().toDouble(), 'f', 8 );
// save the coin information // save the coin information
coinInformation = coinInfoParser->getCoinInfo(); coinInformation = coinInfoParser->getCoinInfo();
// calculate and set the estimated fiat balance // calculate and set the estimated fiat balance
@@ -277,10 +282,12 @@ void OverviewPage::updateFiatBalance(int currency)
if(!coinInformation.isEmpty()) if(!coinInformation.isEmpty())
{ {
QString conversionCurrency = QString("Price").append(Currencies::name(currency)); QString conversionCurrency = QString("Price").append(Currencies::name(currency));
QString coinValue = QString::number( coinInformation.find("PriceBTC").value().toDouble(), 'f', 8 );
double currencyValue = coinInformation.find(conversionCurrency).value().toDouble(); double currencyValue = coinInformation.find(conversionCurrency).value().toDouble();
// create formated fiat value
QString formattedFiatValue = Currencies::format(currency, currencyValue, true, 4, false);
// emit signal for change value // emit signal for change value
QString coinValue = Currencies::format(currency, currencyValue, true, 4, false); emit coinValueChanged(coinValue, formattedFiatValue);
emit coinFiatValueChanged(coinValue);
// calculate and set fiat balance // calculate and set fiat balance
double fiatBalance = currentBalance * currencyValue; double fiatBalance = currentBalance * currencyValue;
QString fiatBalanceString = Currencies::format(currency,fiatBalance,true, 2, true); QString fiatBalanceString = Currencies::format(currency,fiatBalance,true, 2, true);
@@ -301,6 +308,11 @@ void OverviewPage::updateDisplayPromotions(bool checked)
} }
} }
void OverviewPage::setNumTransactions(int count)
{
ui->txtTransactionCount->setText(QString::number(count));
}
OverviewPage::~OverviewPage() OverviewPage::~OverviewPage()
{ {
delete ui; delete ui;

View File

@@ -36,10 +36,11 @@ public:
public slots: public slots:
void setBalance(qint64 balance, qint64 unconfirmedBalance, qint64 immatureBalance); void setBalance(qint64 balance, qint64 unconfirmedBalance, qint64 immatureBalance);
void setNumTransactions(int count);
signals: signals:
void transactionClicked(const QModelIndex &index); void transactionClicked(const QModelIndex &index);
void coinFiatValueChanged(const QString formattedCoinFiatValue); void coinValueChanged(const QString coinValue, const QString formattedCoinFiatValue);
private: private:
Ui::OverviewPage *ui; Ui::OverviewPage *ui;

View File

@@ -92,7 +92,7 @@ WalletView::WalletView(QWidget *parent, BitcoinGUI *_gui):
// Clicking on "Export" allows to export the transaction list // Clicking on "Export" allows to export the transaction list
connect(exportButton, SIGNAL(clicked()), transactionView, SLOT(exportClicked())); connect(exportButton, SIGNAL(clicked()), transactionView, SLOT(exportClicked()));
// subscribe to coin value changes // subscribe to coin value changes
connect(overviewPage, SIGNAL(coinFiatValueChanged(const QString)), infoPage, SLOT(setCoinFiatValue(const QString))); connect(overviewPage, SIGNAL(coinValueChanged(const QString, const QString)), infoPage, SLOT(setCoinValues(const QString, const QString)));
gotoOverviewPage(); gotoOverviewPage();
} }