diff --git a/.travis.yml b/.travis.yml index b57e6fb1fc2bda4d002de0185a808d23796bd772..0a357aacca72442cba8e3bf52595d4f5977f86b1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -51,4 +51,5 @@ script: - coverage run --source=cutecoin.core,cutecoin.gui,cutecoin.models run_tests.py after_success: + - coverage -rm - coveralls diff --git a/README.md b/README.md index ce6c2d6fe756f234921742db4e646eff3f952152..534e05834378be3a6181c003e5018e96be88b830 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ <!-- Landscape | [](https://landscape.io/github/ucoin-io/cutecoin/dev) --> +Coveralls | [](https://coveralls.io/r/ucoin-io/cutecoin) + Travis | [](https://travis-ci.org/ucoin-io/cutecoin) Appveyor | [](https://ci.appveyor.com/project/Insoleet/cutecoin/branch/dev) diff --git a/src/cutecoin/gui/currency_tab.py b/src/cutecoin/gui/currency_tab.py index 2c687842bc6d461c30bd2756f646960184f7c323..2809a02e3d085b5a354a94555b5b3e210ee03f7f 100644 --- a/src/cutecoin/gui/currency_tab.py +++ b/src/cutecoin/gui/currency_tab.py @@ -45,6 +45,14 @@ class CurrencyTabWidget(QWidget, Ui_CurrencyTabWidget): 'warning_certifications': self.tr("Warning : Your could miss certifications soon.") } + + self.tab_community = None + self.tab_wallets = None + self.tab_network = None + self.tab_history = None + + def setupUi(self): + super().setupUi(self) self.tab_community = CommunityTabWidget(self.app, self.app.current_account, self.community, @@ -56,8 +64,32 @@ class CurrencyTabWidget(QWidget, Ui_CurrencyTabWidget): self.community, self.password_asker) + self.tab_history = TransactionsTabWidget(self.app, + self.community, + self.password_asker, + self) + + self.tab_informations = InformationsTabWidget(self.app.current_account, + self.community) + self.tab_network = NetworkTabWidget(self.community) + self.tabs_account.addTab(self.tab_wallets, + QIcon(':/icons/wallet_icon'), + self.tr("Wallets")) + + self.tabs_account.addTab(self.tab_history, + QIcon(':/icons/tx_icon'), + self.tr("Transactions")) + + self.tabs_account.addTab(self.tab_informations, + QIcon(':/icons/informations_icon'), + self.tr("Informations")) + + self.tabs_account.addTab(self.tab_network, + QIcon(":/icons/network_icon"), + self.tr("Network")) + self.community.network.new_block_mined.connect(self.refresh_block) self.community.network.nodes_changed.connect(self.refresh_status) @@ -67,51 +99,17 @@ class CurrencyTabWidget(QWidget, Ui_CurrencyTabWidget): else: self.tabs_account.setEnabled(True) - self.tab_wallets = WalletsTabWidget(self.app, - self.app.current_account, - self.community, - self.password_asker) - self.tabs_account.addTab(self.tab_wallets, - QIcon(':/icons/wallet_icon'), - self.tr("Wallets")) - - self.tab_history = TransactionsTabWidget(self.app, - self.community, - self.password_asker, - self) - self.tabs_account.addTab(self.tab_history, - QIcon(':/icons/tx_icon'), - self.tr("Transactions")) - - self.tab_community = CommunityTabWidget(self.app, - self.app.current_account, - self.community, - self.password_asker, - self) - self.tabs_account.addTab(self.tab_community, - QIcon(':/icons/community_icon'), - self.tr("Community")) - - self.tab_informations = InformationsTabWidget(self.app.current_account, - self.community) - self.tabs_account.addTab(self.tab_informations, - QIcon(':/icons/informations_icon'), - self.tr("Informations")) - - # fix bug refresh_nodes launch on destroyed NetworkTabWidget - #logging.debug('Disconnect community.network.nodes_changed') - #try: - # self.community.network.nodes_changed.disconnect() - #except TypeError: - # logging.debug('No signals on community.network.nodes_changed') - - self.tab_network = NetworkTabWidget(self.community) - self.tabs_account.addTab(self.tab_network, - QIcon(":/icons/network_icon"), - self.tr("Network")) + self.tab_wallets.refresh() + + self.tab_history.refresh() + + self.tab_community.refresh() + self.tab_informations.refresh() + + self.tab_network.refresh() + self.refresh_status() - self.refresh_wallets() @pyqtSlot(str) def display_error(self, error): @@ -184,10 +182,6 @@ class CurrencyTabWidget(QWidget, Ui_CurrencyTabWidget): label_text += " - {0}".format(status_infotext) self.status_label.setText(label_text) - def refresh_wallets(self): - if self.app.current_account: - self.tab_wallets.refresh() - def showEvent(self, event): asyncio.async(self.community.network.discover_network()) self.refresh_status()