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

Diverse fixes in connection ui

parent 70531a3b
Branches
Tags
No related merge requests found
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<item> <item>
<widget class="QPushButton" name="button_register"> <widget class="QPushButton" name="button_register">
<property name="text"> <property name="text">
<string>Register a new account</string> <string>Register a new identity</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../../../../../res/icons/icons.qrc"> <iconset resource="../../../../../res/icons/icons.qrc">
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
<item> <item>
<widget class="QPushButton" name="button_connect"> <widget class="QPushButton" name="button_connect">
<property name="text"> <property name="text">
<string>Connect with an existing account</string> <string>Connect with an existing identity</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../../../../../res/icons/icons.qrc"> <iconset resource="../../../../../res/icons/icons.qrc">
...@@ -102,22 +102,9 @@ ...@@ -102,22 +102,9 @@
<item> <item>
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="groupBox">
<property name="title"> <property name="title">
<string>Account parameters</string> <string>Connection parameters</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_2"> <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> <item>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<item> <item>
...@@ -132,49 +119,6 @@ ...@@ -132,49 +119,6 @@
</item> </item>
</layout> </layout>
</item> </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> <item>
<layout class="QVBoxLayout" name="verticalLayout_6"> <layout class="QVBoxLayout" name="verticalLayout_6">
<item> <item>
...@@ -356,6 +300,19 @@ ...@@ -356,6 +300,19 @@
</item> </item>
</layout> </layout>
</item> </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> <item>
<layout class="QHBoxLayout" name="horizontalLayout_4"> <layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="topMargin"> <property name="topMargin">
...@@ -404,19 +361,6 @@ ...@@ -404,19 +361,6 @@
</widget> </widget>
</widget> </widget>
</item> </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> <item>
<widget class="QLabel" name="label_currency"> <widget class="QLabel" name="label_currency">
<property name="text"> <property name="text">
......
...@@ -74,23 +74,10 @@ class ConnectionConfigController(QObject): ...@@ -74,23 +74,10 @@ class ConnectionConfigController(QObject):
:return: :return:
""" """
connection_cfg = cls.create(parent, app) 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()) asyncio.ensure_future(connection_cfg.process())
return connection_cfg 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): def init_nodes_page(self):
self.view.set_steps_buttons_visible(True) self.view.set_steps_buttons_visible(True)
model = self.model.init_nodes_model() model = self.model.init_nodes_model()
...@@ -150,6 +137,7 @@ class ConnectionConfigController(QObject): ...@@ -150,6 +137,7 @@ class ConnectionConfigController(QObject):
self._logger.debug("Wallet mode") self._logger.debug("Wallet mode")
self.view.button_next.clicked.connect(self.check_wallet) self.view.button_next.clicked.connect(self.check_wallet)
self.view.edit_uid.hide() self.view.edit_uid.hide()
self.view.label_action.hide()
self.view.stacked_pages.setCurrentWidget(self.view.page_connection) self.view.stacked_pages.setCurrentWidget(self.view.page_connection)
connection_identity = await self.step_key connection_identity = await self.step_key
......
...@@ -104,23 +104,11 @@ class ConnectionConfigView(QDialog, Ui_ConnectionConfigurationDialog): ...@@ -104,23 +104,11 @@ class ConnectionConfigView(QDialog, Ui_ConnectionConfigurationDialog):
def set_nodes_model(self, model): def set_nodes_model(self, model):
self.tree_peers.setModel(model) self.tree_peers.setModel(model)
def set_creation_layout(self): def set_creation_layout(self, currency):
""" """
Hide unecessary buttons and display correct title Hide unecessary buttons and display correct title
""" """
self.setWindowTitle(self.tr("New account")) self.setWindowTitle(self.tr("New connection to {0} network").format(currency))
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)))
def action_show_pubkey(self): def action_show_pubkey(self):
salt = self.edit_salt.text() salt = self.edit_salt.text()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment