diff --git a/res/icons/.directory b/res/icons/.directory new file mode 100644 index 0000000000000000000000000000000000000000..3be210363988903713c784f95f6e80c82e8d46cc --- /dev/null +++ b/res/icons/.directory @@ -0,0 +1,6 @@ +[Dolphin] +PreviewsShown=true +SortRole=date +Timestamp=2015,3,14,11,40,36 +Version=3 +ViewMode=1 diff --git a/res/icons/AUTHORS b/res/icons/AUTHORS index 0a9bc15fbcb18d091c2fa41a848706895c03c62d..172dbd597bbb10b31963335274cc56696dc94ec5 100644 --- a/res/icons/AUTHORS +++ b/res/icons/AUTHORS @@ -8,3 +8,6 @@ noun_29542_cc.svg : Created by Chris Kerr noun_43022_cc.svg : Created by Jon Prepeluh noun_63271_cc.svg : Created by Mark Shorter noun_43022_cc.svg : Created by Piotrek Chuchla +noun_7440_cc.svg : Created by Yuri Mamae +noun_62479_cc.svg : Created by Bridget Gahagan +noun_76373_cc.svg : Created by João Paulo \ No newline at end of file diff --git a/res/icons/icons.qrc b/res/icons/icons.qrc index af660cdf8ad598e40f15df78567b8c1cbcc55d33..804d8a04aeb678fc22dbf7a87813a923d114dbdd 100644 --- a/res/icons/icons.qrc +++ b/res/icons/icons.qrc @@ -1,5 +1,8 @@ <RCC> <qresource prefix="icons"> + <file alias="add_account_icon">noun_7440_cc.svg</file> + <file alias="ucoin_info_icon">noun_76373_cc.svg</file> + <file alias="import_icon">noun_62479_cc.svg</file> <file alias="network_icon">noun_21549_cc.svg</file> <file alias="member_icon">iconmonstr-user-icon.svg</file> <file alias="informations_icon">iconmonstr-info-2-icon.svg</file> diff --git a/res/icons/noun_62479_cc.svg b/res/icons/noun_62479_cc.svg new file mode 100644 index 0000000000000000000000000000000000000000..a22a87c97d0baa8c01c9ab0f60069e6d37faecfb --- /dev/null +++ b/res/icons/noun_62479_cc.svg @@ -0,0 +1,49 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + version="1.1" + id="Layer_1" + x="0px" + y="0px" + width="90px" + height="90px" + viewBox="4.5 -9.0 90.0 121.5" + enable-background="new 0 0 90 90" + xml:space="preserve" + inkscape:version="0.91 r13725" + sodipodi:docname="noun_62479_cc.svg"><metadata + id="metadata15"><rdf:RDF><cc:Work + rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs + id="defs13" /><sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="640" + inkscape:window-height="480" + id="namedview11" + showgrid="false" + inkscape:zoom="2.6222222" + inkscape:cx="45" + inkscape:cy="31.338977" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="0" + inkscape:current-layer="Layer_1" /><polygon + points="54.686,56.338 54.686,35.182 49.943,35.182 49.943,48.187 9.812,8.054 6.458,11.407 46.646,51.596 33.531,51.596 33.531,56.338 " + id="polygon3" + transform="matrix(1.4579929,0,0,1.4579929,-16.457719,-17.188675)" /><path + d="m 59.193161,15.343521 c -3.971573,0 -7.908154,0.503008 -11.700393,1.494443 l 1.749591,6.689272 c 3.220707,-0.84272 6.569717,-1.269912 9.950802,-1.269912 21.635157,0 39.237509,17.600891 39.237509,39.236048 0,21.633699 -17.602352,39.233128 -39.237509,39.233128 -21.633699,0 -39.233132,-17.599429 -39.233132,-39.233128 0,-3.470023 0.451978,-6.907971 1.34427,-10.219073 l -6.67615,-1.799163 c -1.049755,3.897215 -1.581922,7.94023 -1.581922,12.018236 0,25.444888 20.702041,46.146938 46.146934,46.146938 25.447809,0 46.151309,-20.70205 46.151309,-46.146938 0.001,-25.446351 -20.7035,-46.149851 -46.151309,-46.149851 z" + id="path5" + inkscape:connector-curvature="0" /></svg> \ No newline at end of file diff --git a/res/icons/noun_7440_cc.svg b/res/icons/noun_7440_cc.svg new file mode 100644 index 0000000000000000000000000000000000000000..19712a466f729184de572f9ac2f4189eb46abe9b --- /dev/null +++ b/res/icons/noun_7440_cc.svg @@ -0,0 +1,71 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:ns="http://ns.adobe.com/SaveForWeb/1.0/" + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + version="1.1" + id="Layer_1" + x="0px" + y="0px" + width="100px" + height="100px" + viewBox="5.0 -10.0 100.0 135.0" + enable-background="new 0 0 100 100" + xml:space="preserve" + inkscape:version="0.91 r13725" + sodipodi:docname="noun_7440_cc.svg"><defs + id="defs21" /><sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1366" + inkscape:window-height="725" + id="namedview19" + showgrid="false" + inkscape:zoom="2.36" + inkscape:cx="50" + inkscape:cy="50" + inkscape:window-x="-7" + inkscape:window-y="17" + inkscape:window-maximized="1" + inkscape:current-layer="Layer_1" /><metadata + id="metadata3"><ns:sfw><ns:slices /><ns:sliceSourceBounds + x="0.083" + y="-99.397" + width="99.612" + height="99.046" + bottomLeftOrigin="true" /></ns:sfw><rdf:RDF><cc:Work + rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><path + d="m 76.049064,20.333886 c 0,15.511169 -12.573022,39.463143 -28.082885,39.463143 -15.509864,0 -28.084192,-23.951974 -28.084192,-39.463143 0,-15.5098639 12.574328,-28.0828859 28.084192,-28.0828859 15.509863,0 28.082885,12.573022 28.082885,28.0828859 z" + id="path5" + inkscape:connector-curvature="0" + style="fill:#000000" /><g + id="g7" + transform="matrix(1.3064237,0,0,1.3064237,-8.125127,-8.2075549)"><rect + x="84.732002" + y="17.913" + width="7.165" + height="22.761" + id="rect9" + style="fill:#000000" /><rect + x="76.935997" + y="25.711" + width="22.76" + height="7.1659999" + id="rect11" + style="fill:#000000" /></g><path + d="m 92.93328,56.840592 c 0,0 -12.412327,-2.906793 -27.440119,-4.496711 -4.89909,5.946841 -10.963509,10.038561 -17.528289,10.038561 -6.566086,0 -12.629198,-4.09172 -17.530901,-10.038561 -15.026486,1.589918 -27.4388183,4.496711 -27.4388183,4.496711 -6.0814032,0 -11.0131526,4.930444 -11.0131526,11.013153 l 0,42.781455 c 0,6.08271 4.9317494,11.01316 11.0131526,11.01316 l 89.9381273,0 c 6.0801,0 11.01316,-4.92914 11.01316,-11.01316 l 0,-42.781455 c 0,-6.082709 -4.93175,-11.013153 -11.01316,-11.013153 z" + id="path13" + inkscape:connector-curvature="0" + style="fill:#000000" /></svg> \ No newline at end of file diff --git a/res/icons/noun_76373_cc.svg b/res/icons/noun_76373_cc.svg new file mode 100644 index 0000000000000000000000000000000000000000..2679707d282061d5c6a2cf9256c27cc310d54bde --- /dev/null +++ b/res/icons/noun_76373_cc.svg @@ -0,0 +1,139 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + version="1.1" + id="Your_Icon" + x="0px" + y="0px" + width="100px" + height="100px" + viewBox="5.0 -10.0 100.0 135.0" + enable-background="new 0 0 100 100" + xml:space="preserve" + inkscape:version="0.91 r13725" + sodipodi:docname="noun_76373_cc.svg"><metadata + id="metadata71"><rdf:RDF><cc:Work + rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs + id="defs69" /><sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="640" + inkscape:window-height="480" + id="namedview67" + showgrid="false" + inkscape:zoom="2.36" + inkscape:cx="39.201211" + inkscape:cy="50" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="0" + inkscape:current-layer="Your_Icon" /><g + id="g3" + transform="matrix(1.3295413,0,0,1.3295413,-12.784498,-9.4181654)"><path + d="m 79.978,96 -55.52,0 c -7.72,0 -14,-6.279 -14,-14 l 0,-64 c 0,-7.72 6.28,-14 14,-14 l 55.52,0 c 7.72,0 14,6.28 14,14 l 0,64 c 0,7.721 -6.281,14 -14,14 z M 24.458,8 c -5.514,0 -10,4.486 -10,10 l 0,64 c 0,5.514 4.486,10 10,10 l 55.52,0 c 5.514,0 10,-4.486 10,-10 l 0,-64 c 0,-5.514 -4.486,-10 -10,-10 l -55.52,0 z" + id="path5" + inkscape:connector-curvature="0" /></g><g + id="g7" + transform="matrix(1.3295413,0,0,1.3295413,-12.784498,-9.4181654)"><path + d="m 52.218,77.5 c -15.164,0 -27.5,-12.336 -27.5,-27.5 0,-15.163 12.336,-27.5 27.5,-27.5 15.163,0 27.5,12.337 27.5,27.5 0,15.164 -12.337,27.5 -27.5,27.5 z m 0,-51 c -12.958,0 -23.5,10.542 -23.5,23.5 0,12.959 10.542,23.5 23.5,23.5 12.958,0 23.5,-10.541 23.5,-23.5 0,-12.958 -10.542,-23.5 -23.5,-23.5 z" + id="path9" + inkscape:connector-curvature="0" /></g><g + id="g11" + transform="matrix(1.3295413,0,0,1.3295413,-12.784498,-9.4181654)"><rect + x="6.0219998" + y="48" + width="13" + height="4" + id="rect13" /></g><g + id="g15" + transform="matrix(1.3295413,0,0,1.3295413,-12.784498,-9.4181654)"><rect + x="6.0219998" + y="58" + width="13" + height="4" + id="rect17" /></g><g + id="g19" + transform="matrix(1.3295413,0,0,1.3295413,-12.784498,-9.4181654)"><rect + x="6.0219998" + y="68" + width="13" + height="4" + id="rect21" /></g><g + id="g23" + transform="matrix(1.3295413,0,0,1.3295413,-12.784498,-9.4181654)"><rect + x="6.0219998" + y="18" + width="13" + height="4" + id="rect25" /></g><g + id="g27" + transform="matrix(1.3295413,0,0,1.3295413,-12.784498,-9.4181654)"><rect + x="6.0949998" + y="28" + width="12.855" + height="4" + id="rect29" /></g><g + id="g31" + transform="matrix(1.3295413,0,0,1.3295413,-12.784498,-9.4181654)"><rect + x="6.0219998" + y="38" + width="13" + height="4" + id="rect33" /></g><g + id="g35" + transform="matrix(1.3295413,0,0,1.3295413,-12.784498,-9.4181654)"><rect + x="6.0219998" + y="78" + width="13" + height="4" + id="rect37" /></g><g + id="g39" + transform="matrix(1.3295413,0,0,1.3295413,-12.784498,-9.4181654)"><g + id="g41"><circle + cx="52.219002" + cy="37.063" + r="1" + id="circle43" /><circle + cx="52.219002" + cy="37.063" + r="2" + id="circle45" /></g><g + id="g47"><path + d="m 52.218,39.063 -0.082,-0.002 c -1.102,-0.046 -1.961,-0.979 -1.916,-2.08 0.045,-1.076 0.922,-1.919 1.998,-1.919 1.182,0.047 2.041,0.979 1.998,2.081 -0.045,1.079 -0.924,1.92 -1.998,1.92 z m 0,-2 c 0,0 0,0 -0.002,0 l 0.002,1 0,-1 z" + id="path49" + inkscape:connector-curvature="0" /><path + d="M 52.218,40.063 52.113,40.06 c -1.67,-0.069 -2.959,-1.469 -2.892,-3.12 0.067,-1.614 1.384,-2.878 2.997,-2.878 1.764,0.069 3.063,1.439 2.997,3.12 -0.068,1.617 -1.384,2.881 -2.997,2.881 z m -0.04,-2 0.04,1 -0.04,-1 z m 1.038,-1.001 0,0.056 c 0,-0.005 10e-4,-0.011 10e-4,-0.016 0.022,-0.567 -0.425,-1.016 -1.039,-1.04 -0.498,0.001 -0.937,0.423 -0.959,0.961 0,0.014 -10e-4,0.027 -10e-4,0.041 l 1.998,-0.002 z" + id="path51" + inkscape:connector-curvature="0" /></g></g><g + id="g53" + transform="matrix(1.3295413,0,0,1.3295413,-12.784498,-9.4181654)"><rect + x="46.995998" + y="42.063" + width="7.2509999" + height="3" + id="rect55" /></g><g + id="g57" + transform="matrix(1.3295413,0,0,1.3295413,-12.784498,-9.4181654)"><rect + x="46.997002" + y="61.938" + width="10.442" + height="3" + id="rect59" /></g><rect + x="53.943848" + y="50.328758" + width="5.3952785" + height="22.600872" + id="rect61" /></svg> \ No newline at end of file diff --git a/res/ui/homescreen.ui b/res/ui/homescreen.ui new file mode 100644 index 0000000000000000000000000000000000000000..5175ab847228391bdad450b76f7c4b4ea4e08438 --- /dev/null +++ b/res/ui/homescreen.ui @@ -0,0 +1,158 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>HomeScreenWidget</class> + <widget class="QWidget" name="HomeScreenWidget"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>400</width> + <height>301</height> + </rect> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="windowTitle"> + <string>Form</string> + </property> + <property name="styleSheet"> + <string notr="true">QToolButton { + font-size: 14pt; + font-weight: bold; +}</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <spacer name="verticalSpacer_2"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QLabel" name="label_welcome"> + <property name="text"> + <string><html><head/><body><p align="center"><span style=" font-size:xx-large; font-weight:600;">Welcome to Cutecoin !</span></p><p>Would you like to...</p></body></html></string> + </property> + <property name="textFormat"> + <enum>Qt::RichText</enum> + </property> + </widget> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout"> + <property name="topMargin"> + <number>6</number> + </property> + <item> + <widget class="QToolButton" name="button_new"> + <property name="text"> + <string>Create a new account</string> + </property> + <property name="icon"> + <iconset resource="../icons/icons.qrc"> + <normaloff>:/icons/add_account_icon</normaloff>:/icons/add_account_icon</iconset> + </property> + <property name="iconSize"> + <size> + <width>32</width> + <height>32</height> + </size> + </property> + <property name="toolButtonStyle"> + <enum>Qt::ToolButtonFollowStyle</enum> + </property> + <property name="autoRaise"> + <bool>false</bool> + </property> + <property name="arrowType"> + <enum>Qt::NoArrow</enum> + </property> + </widget> + </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <property name="topMargin"> + <number>6</number> + </property> + <item> + <widget class="QToolButton" name="button_import"> + <property name="text"> + <string>Import an existing account</string> + </property> + <property name="icon"> + <iconset resource="../icons/icons.qrc"> + <normaloff>:/icons/import_icon</normaloff>:/icons/import_icon</iconset> + </property> + <property name="iconSize"> + <size> + <width>32</width> + <height>32</height> + </size> + </property> + <property name="toolButtonStyle"> + <enum>Qt::ToolButtonFollowStyle</enum> + </property> + </widget> + </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_3"> + <property name="topMargin"> + <number>6</number> + </property> + <item> + <widget class="QToolButton" name="button_info"> + <property name="text"> + <string>Get to know more about ucoin</string> + </property> + <property name="icon"> + <iconset resource="../icons/icons.qrc"> + <normaloff>:/icons/ucoin_info_icon</normaloff>:/icons/ucoin_info_icon</iconset> + </property> + <property name="iconSize"> + <size> + <width>32</width> + <height>32</height> + </size> + </property> + <property name="toolButtonStyle"> + <enum>Qt::ToolButtonFollowStyle</enum> + </property> + </widget> + </item> + </layout> + </item> + <item> + <spacer name="verticalSpacer"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <resources> + <include location="../icons/icons.qrc"/> + </resources> + <connections/> +</ui> diff --git a/src/cutecoin/core/account.py b/src/cutecoin/core/account.py index 9d14503a1310efea6fa00a757f22f98a2b59bf34..38622cffb4c465cbb3a57d75da8c1527d3f5133c 100644 --- a/src/cutecoin/core/account.py +++ b/src/cutecoin/core/account.py @@ -98,7 +98,7 @@ class Account(QObject): :param str name: The account name, same as network identity uid :return: A new empty account object ''' - account = cls(None, None, name, [], [], [], []) + account = cls(None, None, name, [], [], []) return account @classmethod diff --git a/src/cutecoin/core/app.py b/src/cutecoin/core/app.py index 3268a00786ace5da22bc1b5911ab80bcdbe683bb..8f0d043269fc14bf58402b48bfcb80d8cb5a60ee 100644 --- a/src/cutecoin/core/app.py +++ b/src/cutecoin/core/app.py @@ -67,8 +67,7 @@ class Application(QObject): if a == name: raise NameAlreadyExists(a) - account = Account.create(name, - config.parameters) + account = Account.create(name) return account diff --git a/src/cutecoin/core/net/node.py b/src/cutecoin/core/net/node.py index 9ddefd1c081abf2a6277fb0dc8c72f50297f2612..1fd819567498959b38b9d5ed86722d69bdb7ce82 100644 --- a/src/cutecoin/core/net/node.py +++ b/src/cutecoin/core/net/node.py @@ -69,7 +69,7 @@ class Node(QObject): if peer.currency != currency: raise InvalidNodeCurrency(peer.currency, currency) - node = cls(peer.currency, peer.endpoints, peer.pubkey, 0, Node.ONLINE, 0) + node = cls(peer.currency, peer.endpoints, peer.pubkey, 0, Node.ONLINE) node.refresh_state() return node diff --git a/src/cutecoin/gui/homescreen.py b/src/cutecoin/gui/homescreen.py new file mode 100644 index 0000000000000000000000000000000000000000..e31275ec98e598355ba3bae05ae00ae116bca919 --- /dev/null +++ b/src/cutecoin/gui/homescreen.py @@ -0,0 +1,21 @@ +""" +Created on 31 janv. 2015 + +@author: vit +""" + +from PyQt5.QtWidgets import QWidget +from ..gen_resources.homescreen_uic import Ui_HomeScreenWidget + + +class HomeScreenWidget(QWidget, Ui_HomeScreenWidget): + """ + classdocs + """ + + def __init__(self): + """ + Constructor + """ + super().__init__() + self.setupUi(self) diff --git a/src/cutecoin/gui/mainwindow.py b/src/cutecoin/gui/mainwindow.py index c9c0775bbe6c6b1c19c8effd6d3c8f44fca5a1a0..40d0c4a09220223167a0ccbaf62c71616b7add32 100644 --- a/src/cutecoin/gui/mainwindow.py +++ b/src/cutecoin/gui/mainwindow.py @@ -3,23 +3,27 @@ Created on 1 févr. 2014 @author: inso ''' -from cutecoin.gen_resources.mainwindow_uic import Ui_MainWindow +from ..gen_resources.mainwindow_uic import Ui_MainWindow +from ..gen_resources.about_uic import Ui_AboutPopup +from ..gen_resources.homescreen_uic import Ui_HomeScreenWidget + from PyQt5.QtWidgets import QMainWindow, QAction, QFileDialog, QProgressBar, \ QMessageBox, QLabel, QComboBox, QDialog -from PyQt5.QtCore import QSignalMapper, QModelIndex, QObject, QThread, \ - pyqtSlot, pyqtSignal, QDate, QDateTime, QTimer -from PyQt5.QtGui import QIcon +from PyQt5.QtCore import QSignalMapper, QObject, QThread, \ + pyqtSlot, pyqtSignal, QDate, QDateTime, QTimer, QUrl +from PyQt5.QtGui import QIcon, QDesktopServices + from .process_cfg_account import ProcessConfigureAccount from .transfer import TransferMoneyDialog from .currency_tab import CurrencyTabWidget -from cutecoin.gui.contact import ConfigureContactDialog +from .contact import ConfigureContactDialog from .import_account import ImportAccountDialog from .certification import CertificationDialog from .password_asker import PasswordAskerDialog from ..tools.exceptions import NoPeerAvailable +from .homescreen import HomeScreenWidget from ..core.account import Account from ..__init__ import __version__ -from cutecoin.gen_resources.about_uic import Ui_AboutPopup import logging import requests @@ -97,6 +101,14 @@ class MainWindow(QMainWindow, Ui_MainWindow): self.loader.loaded.connect(self.loader_thread.quit) self.loader.connection_error.connect(self.display_error) self.loader_thread.started.connect(self.loader.load) + + self.homescreen = HomeScreenWidget() + self.centralWidget().layout().addWidget(self.homescreen) + self.homescreen.button_new.clicked.connect(self.open_add_account_dialog) + self.homescreen.button_import.clicked.connect(self.import_account) + self.open_ucoin_info = lambda: QDesktopServices.openUrl(QUrl("http://ucoin.io/theoretical/")) + self.homescreen.button_info.clicked.connect(self.open_ucoin_info) + #TODO: There are too much refresh() calls on startup self.refresh() @@ -160,6 +172,7 @@ class MainWindow(QMainWindow, Ui_MainWindow): self.status_label.setText("Loading account {0}".format(account_name)) self.loader.set_account_name(account_name) self.loader_thread.start(QThread.LowPriority) + self.homescreen.setEnabled(False) def open_transfer_money_dialog(self): dialog = TransferMoneyDialog(self.app.current_account, @@ -276,6 +289,8 @@ class MainWindow(QMainWindow, Ui_MainWindow): signal_mapper.mapped[str].connect(self.action_change_account) if self.app.current_account is None: + self.currencies_tabwidget.hide() + self.homescreen.show() self.setWindowTitle("CuteCoin {0}".format(__version__)) self.menu_contacts.setEnabled(False) self.menu_actions.setEnabled(False) @@ -285,6 +300,8 @@ class MainWindow(QMainWindow, Ui_MainWindow): self.status_label.setText("") self.password_asker = None else: + self.currencies_tabwidget.show() + self.homescreen.hide() self.action_set_as_default.setEnabled(self.app.current_account.name != self.app.default_account) self.password_asker = PasswordAskerDialog(self.app.current_account) diff --git a/src/cutecoin/models/communities.py b/src/cutecoin/models/communities.py index b039663929c33ae04230126b1eb0f2f5fd8e20c8..2e1479b5de3da5939c4829066f25f8c7ff4ad911 100644 --- a/src/cutecoin/models/communities.py +++ b/src/cutecoin/models/communities.py @@ -27,7 +27,7 @@ class CommunitiesListModel(QAbstractListModel): if role == Qt.DisplayRole: row = index.row() - value = self.communities[row].name() + value = self.communities[row].name return value def flags(self, index):