Skip to content
Snippets Groups Projects
Commit b4e599f5 authored by inso's avatar inso
Browse files

Diverse fixes in connection ui

parent 70531a3b
No related branches found
No related tags found
No related merge requests found
......@@ -32,7 +32,7 @@
<item>
<widget class="QPushButton" name="button_register">
<property name="text">
<string>Register a new account</string>
<string>Register a new identity</string>
</property>
<property name="icon">
<iconset resource="../../../../../res/icons/icons.qrc">
......@@ -49,7 +49,7 @@
<item>
<widget class="QPushButton" name="button_connect">
<property name="text">
<string>Connect with an existing account</string>
<string>Connect with an existing identity</string>
</property>
<property name="icon">
<iconset resource="../../../../../res/icons/icons.qrc">
......@@ -102,22 +102,9 @@
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Account parameters</string>
<string>Connection parameters</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<spacer name="verticalSpacer_3">
<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>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
......@@ -132,49 +119,6 @@
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_8">
<property name="topMargin">
<number>6</number>
</property>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="button_delete">
<property name="styleSheet">
<string notr="true">color: rgb(255, 0, 0);</string>
</property>
<property name="text">
<string>Delete account</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_4">
<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>
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
......@@ -356,6 +300,19 @@
</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>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="topMargin">
......@@ -404,19 +361,6 @@
</widget>
</widget>
</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>
<item>
<widget class="QLabel" name="label_currency">
<property name="text">
......
......@@ -74,23 +74,10 @@ class ConnectionConfigController(QObject):
:return:
"""
connection_cfg = cls.create(parent, app)
connection_cfg.view.set_creation_layout()
connection_cfg.view.set_creation_layout(app.currency)
asyncio.ensure_future(connection_cfg.process())
return connection_cfg
@classmethod
def modify_connection(cls, parent, app, connection):
"""
Open a dialog to modify an existing account
:param parent:
:param app:
:param account:
:return:
"""
connection_cfg = cls.create(parent, app, connection=connection)
#connection_cfg.view.set_modification_layout(account.name)
connection_cfg._current_step = 1
def init_nodes_page(self):
self.view.set_steps_buttons_visible(True)
model = self.model.init_nodes_model()
......@@ -150,6 +137,7 @@ class ConnectionConfigController(QObject):
self._logger.debug("Wallet mode")
self.view.button_next.clicked.connect(self.check_wallet)
self.view.edit_uid.hide()
self.view.label_action.hide()
self.view.stacked_pages.setCurrentWidget(self.view.page_connection)
connection_identity = await self.step_key
......
......@@ -104,23 +104,11 @@ class ConnectionConfigView(QDialog, Ui_ConnectionConfigurationDialog):
def set_nodes_model(self, model):
self.tree_peers.setModel(model)
def set_creation_layout(self):
def set_creation_layout(self, currency):
"""
Hide unecessary buttons and display correct title
"""
self.setWindowTitle(self.tr("New account"))
self.button_delete.hide()
def set_modification_layout(self, account_name):
"""
Hide unecessary widgets for account modification
and display correct title
:return:
"""
self.label_action.setText("Edit account uid")
self.edit_account_name.setPlaceholderText(account_name)
self.button_next.setEnabled(True)
self.setWindowTitle(self.tr("Configure {0}".format(account_name)))
self.setWindowTitle(self.tr("New connection to {0} network").format(currency))
def action_show_pubkey(self):
salt = self.edit_salt.text()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment