diff --git a/src/cutecoin/gui/community_tile.py b/src/cutecoin/gui/community_tile.py index 053c731c6ccb44ab8c1a3c1779e623a1f2809824..04fbedc875f7dd77d9e2bd92616f12c23382fd34 100644 --- a/src/cutecoin/gui/community_tile.py +++ b/src/cutecoin/gui/community_tile.py @@ -14,6 +14,7 @@ class CommunityTile(QFrame): super().__init__(parent) self.app = app self.community = community + self.community.inner_data_changed.connect(self.refresh) self.text_label = QLabel() self.setLayout(QVBoxLayout()) self.layout().setSizeConstraint(QLayout.SetFixedSize) diff --git a/src/cutecoin/gui/identities_tab.py b/src/cutecoin/gui/identities_tab.py index 9ae72577eb5e44b3d3ab992b09caa2eeba2015c4..646e59bbc0d2f47676cea3022c94ad3277b68665 100644 --- a/src/cutecoin/gui/identities_tab.py +++ b/src/cutecoin/gui/identities_tab.py @@ -66,9 +66,14 @@ class IdentitiesTabWidget(QWidget, Ui_IdentitiesTab): def change_community(self, community): if self.community: - self.account.identity(self.community).inner_data_changed.disconnect(self.handle_account_identity_change) + try: + self.account.identity(self.community).inner_data_changed.disconnect(self.handle_account_identity_change) + except TypeError as e: + if "disconnect" in str(e): + logging.debug("Disconnect failed between inner_data_changed ans handle_account_identity_changed") + pass if community: - self.account.identity(self.community).inner_data_changed.connect(self.handle_account_identity_change) + self.account.identity(community).inner_data_changed.connect(self.handle_account_identity_change) self.community = community self.table_identities.model().change_community(community) diff --git a/src/cutecoin/gui/process_cfg_community.py b/src/cutecoin/gui/process_cfg_community.py index 9294cf251007631db793fb7090601f9cc1d03a92..6ec9c4913ac3d50a9255637e32342a6a42499174 100644 --- a/src/cutecoin/gui/process_cfg_community.py +++ b/src/cutecoin/gui/process_cfg_community.py @@ -9,7 +9,7 @@ import asyncio from PyQt5.QtWidgets import QDialog, QMenu, QMessageBox, QApplication from PyQt5.QtGui import QCursor -from PyQt5.QtCore import pyqtSlot +from PyQt5.QtCore import pyqtSlot, pyqtSignal from ..gen_resources.community_cfg_uic import Ui_CommunityConfigurationDialog from ..models.peering import PeeringTreeModel @@ -96,6 +96,7 @@ class ProcessConfigureCommunity(QDialog, Ui_CommunityConfigurationDialog): """ Dialog to configure or add a community """ + community_added = pyqtSignal() def __init__(self, app, account, community, password_asker): """ @@ -115,6 +116,7 @@ class ProcessConfigureCommunity(QDialog, Ui_CommunityConfigurationDialog): self.step = None self.nodes = [] + self.community_added.connect(self.add_community_and_close) step_init = StepPageInit(self) step_add_peers = StepPageAddpeers(self) @@ -218,6 +220,7 @@ class ProcessConfigureCommunity(QDialog, Ui_CommunityConfigurationDialog): self.account.broadcast_error.disconnect(self.handle_error) QApplication.restoreOverrideCursor() + @pyqtSlot() def add_community_and_close(self): if self.community not in self.account.communities: self.account.add_community(self.community) @@ -239,6 +242,6 @@ Would you like to publish the key ?""").format(self.account.pubkey)) self.account.broadcast_error.connect(self.handle_error) asyncio.async(self.account.send_selfcert(password, self.community)) else: - self.add_community_and_close() + self.community_added.emit() else: - self.add_community_and_close() + self.community_added.emit()