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

Refactored Wot tab

parent f424a779
No related branches found
No related tags found
No related merge requests found
...@@ -15,9 +15,9 @@ ...@@ -15,9 +15,9 @@
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<item> <item>
<widget class="QTabWidget" name="tabs_community"> <widget class="QTabWidget" name="tabs_information">
<property name="currentIndex"> <property name="currentIndex">
<number>1</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="tab_members"> <widget class="QWidget" name="tab_members">
<attribute name="title"> <attribute name="title">
...@@ -57,12 +57,6 @@ ...@@ -57,12 +57,6 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="tab_wot">
<attribute name="title">
<string>Wot</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2"/>
</widget>
</widget> </widget>
</item> </item>
</layout> </layout>
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>Form</class> <class>WotTabWidget</class>
<widget class="QWidget" name="Form"> <widget class="QWidget" name="WotTabWidget">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
</widget> </widget>
</item> </item>
<item row="1" column="0" colspan="2"> <item row="1" column="0" colspan="2">
<widget class="View" name="graphicsView"> <widget class="WotView" name="graphicsView">
<property name="viewportUpdateMode"> <property name="viewportUpdateMode">
<enum>QGraphicsView::BoundingRectViewportUpdate</enum> <enum>QGraphicsView::BoundingRectViewportUpdate</enum>
</property> </property>
...@@ -45,9 +45,9 @@ ...@@ -45,9 +45,9 @@
</widget> </widget>
<customwidgets> <customwidgets>
<customwidget> <customwidget>
<class>View</class> <class>WotView</class>
<extends>QGraphicsView</extends> <extends>QGraphicsView</extends>
<header>cutecoin.wot.qt.view.h</header> <header>cutecoin.gui.views.wot</header>
</customwidget> </customwidget>
</customwidgets> </customwidgets>
<resources/> <resources/>
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
<connection> <connection>
<sender>pushButtonReset</sender> <sender>pushButtonReset</sender>
<signal>clicked()</signal> <signal>clicked()</signal>
<receiver>Form</receiver> <receiver>WotTabWidget</receiver>
<slot>reset()</slot> <slot>reset()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
<connection> <connection>
<sender>comboBoxSearch</sender> <sender>comboBoxSearch</sender>
<signal>currentIndexChanged(int)</signal> <signal>currentIndexChanged(int)</signal>
<receiver>Form</receiver> <receiver>WotTabWidget</receiver>
<slot>select_node()</slot> <slot>select_node()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
......
...@@ -9,7 +9,7 @@ from PyQt5.QtWidgets import QWidget, QErrorMessage ...@@ -9,7 +9,7 @@ from PyQt5.QtWidgets import QWidget, QErrorMessage
from cutecoin.models.members import MembersListModel from cutecoin.models.members import MembersListModel
from cutecoin.gen_resources.community_tab_uic import Ui_CommunityTabWidget from cutecoin.gen_resources.community_tab_uic import Ui_CommunityTabWidget
from cutecoin.gui.add_contact import AddContactDialog from cutecoin.gui.add_contact import AddContactDialog
from cutecoin.wot.qt.form import Form from cutecoin.gui.wot_tab import WotTabWidget
class CommunityTabWidget(QWidget, Ui_CommunityTabWidget): class CommunityTabWidget(QWidget, Ui_CommunityTabWidget):
...@@ -35,8 +35,7 @@ class CommunityTabWidget(QWidget, Ui_CommunityTabWidget): ...@@ -35,8 +35,7 @@ class CommunityTabWidget(QWidget, Ui_CommunityTabWidget):
self.button_membership.setText("Send membership demand") self.button_membership.setText("Send membership demand")
self.button_membership.clicked.connect(self.send_membership_demand) self.button_membership.clicked.connect(self.send_membership_demand)
# create wot widget self.tabs_information.addTab(WotTabWidget(account, community), "Wot")
self.verticalLayout_2.addWidget(Form(account, community))
def add_member_as_contact(self, index): def add_member_as_contact(self, index):
members_model = self.list_community_members.model() members_model = self.list_community_members.model()
......
...@@ -25,7 +25,7 @@ class MainWindow(QMainWindow, Ui_MainWindow): ...@@ -25,7 +25,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
Constructor Constructor
''' '''
# Set up the user interface from Designer. # Set up the user interface from Designer.
super(MainWindow, self).__init__() super().__init__()
self.setupUi(self) self.setupUi(self)
self.app = app self.app = app
self.refresh() self.refresh()
......
...@@ -131,7 +131,7 @@ class ProcessConfigureAccount(QDialog, Ui_AccountConfigurationDialog): ...@@ -131,7 +131,7 @@ class ProcessConfigureAccount(QDialog, Ui_AccountConfigurationDialog):
Constructor Constructor
''' '''
# Set up the user interface from Designer. # Set up the user interface from Designer.
super(ProcessConfigureAccount, self).__init__() super().__init__()
self.setupUi(self) self.setupUi(self)
self.account = account self.account = account
self.app = app self.app = app
......
...@@ -92,7 +92,7 @@ class ProcessConfigureCommunity(QDialog, Ui_CommunityConfigurationDialog): ...@@ -92,7 +92,7 @@ class ProcessConfigureCommunity(QDialog, Ui_CommunityConfigurationDialog):
''' '''
Constructor Constructor
''' '''
super(ProcessConfigureCommunity, self).__init__() super().__init__()
self.setupUi(self) self.setupUi(self)
self.community = community self.community = community
self.account = account self.account = account
......
...@@ -20,7 +20,7 @@ class TransferMoneyDialog(QDialog, Ui_TransferMoneyDialog): ...@@ -20,7 +20,7 @@ class TransferMoneyDialog(QDialog, Ui_TransferMoneyDialog):
''' '''
Constructor Constructor
''' '''
super(TransferMoneyDialog, self).__init__() super().__init__()
self.setupUi(self) self.setupUi(self)
self.sender = sender self.sender = sender
self.recipient_trusts = [] self.recipient_trusts = []
......
...@@ -14,14 +14,14 @@ ARC_STATUS_STRONG = 1 ...@@ -14,14 +14,14 @@ ARC_STATUS_STRONG = 1
ARC_STATUS_WEAK = 2 ARC_STATUS_WEAK = 2
class View(QGraphicsView): class WotView(QGraphicsView):
def __init__(self, parent=None): def __init__(self, parent=None):
""" """
Create View to display scene Create View to display scene
:param parent: [Optional, default=None] Parent widget :param parent: [Optional, default=None] Parent widget
""" """
super(View, self).__init__(parent) super(WotView, self).__init__(parent)
self.setScene(Scene(self)) self.setScene(Scene(self))
......
...@@ -4,12 +4,12 @@ import time ...@@ -4,12 +4,12 @@ import time
import datetime import datetime
from PyQt5.QtWidgets import QWidget from PyQt5.QtWidgets import QWidget
from cutecoin.gen_resources.wot_form_uic import Ui_Form from ..gen_resources.wot_tab_uic import Ui_WotTabWidget
from cutecoin.wot.qt.view import NODE_STATUS_HIGHLIGHTED, NODE_STATUS_SELECTED, ARC_STATUS_STRONG, ARC_STATUS_WEAK from cutecoin.gui.views.wot import NODE_STATUS_HIGHLIGHTED, NODE_STATUS_SELECTED, ARC_STATUS_STRONG, ARC_STATUS_WEAK
from ucoinpy.api import bma from ucoinpy.api import bma
class Form(QWidget, Ui_Form): class WotTabWidget(QWidget, Ui_WotTabWidget):
def __init__(self, account, community, parent=None): def __init__(self, account, community, parent=None):
""" """
...@@ -18,7 +18,7 @@ class Form(QWidget, Ui_Form): ...@@ -18,7 +18,7 @@ class Form(QWidget, Ui_Form):
:param parent: :param parent:
:return: :return:
""" """
super(Form, self).__init__(parent) super().__init__(parent)
# construct from qtDesigner # construct from qtDesigner
self.setupUi(self) self.setupUi(self)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment