diff --git a/src/sakia/gui/homescreen/homescreen.py b/src/sakia/gui/homescreen/homescreen.py deleted file mode 100644 index 081f313358d69736dc9134bde521dd7baaeec58c..0000000000000000000000000000000000000000 --- a/src/sakia/gui/homescreen/homescreen.py +++ /dev/null @@ -1,56 +0,0 @@ -""" -Created on 31 janv. 2015 - -@author: vit -""" - - -class HomeScreenWidget(QWidget, Ui_HomescreenWidget): - """ - classdocs - """ - - def __init__(self, parent, app, status_label): - """ - Constructor - """ - super().__init__() - self.setupUi(self) - self.app = app - self.frame_communities = FrameCommunities(self) - self.layout().addWidget(self.frame_communities) - self.status_label = status_label - - def refresh(self): - self.frame_communities.refresh(self.app) - if self.app.current_account: - self.frame_connected.show() - self.label_connected.setText(self.tr("Connected as {0}".format(self.app.current_account.name))) - self.frame_disconnected.hide() - else: - self.frame_disconnected.show() - self.frame_connected.hide() - - def referential_changed(self): - self.frame_communities.refresh_content() - - def showEvent(self, QShowEvent): - """ - - :param QShowEvent: - :return: - """ - self.frame_communities.refresh_content() - self.status_label.setText("") - - def changeEvent(self, event): - """ - Intercepte LanguageChange event to translate UI - :param QEvent QEvent: Event - :return: - """ - if event.type() == QEvent.LanguageChange: - self.retranslateUi(self) - return super(HomeScreenWidget, self).changeEvent(event) - - diff --git a/src/sakia/gui/homescreen/homescreen.ui b/src/sakia/gui/homescreen/homescreen.ui index f326a247071175967a5e8908579dd6ec4ee79212..97f5d8bfb627f44bd79556a0ea732b3ceb179b92 100644 --- a/src/sakia/gui/homescreen/homescreen.ui +++ b/src/sakia/gui/homescreen/homescreen.ui @@ -19,179 +19,10 @@ <property name="windowTitle"> <string>Form</string> </property> - <layout class="QVBoxLayout" name="verticalLayout"> - <item> - <widget class="QFrame" name="frame_connected"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <layout class="QHBoxLayout" name="horizontalLayout"> - <property name="sizeConstraint"> - <enum>QLayout::SetMaximumSize</enum> - </property> - <item> - <widget class="QLabel" name="label_connected"> - <property name="styleSheet"> - <string notr="true"> font-size:12pt; font-weight:600;</string> - </property> - <property name="text"> - <string>Connected as</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="button_add_community"> - <property name="text"> - <string>Add a community</string> - </property> - <property name="icon"> - <iconset resource="../icons/icons.qrc"> - <normaloff>:/icons/add_community</normaloff>:/icons/add_community</iconset> - </property> - <property name="iconSize"> - <size> - <width>32</width> - <height>32</height> - </size> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="button_disconnect"> - <property name="text"> - <string>Disconnect</string> - </property> - <property name="icon"> - <iconset resource="../icons/icons.qrc"> - <normaloff>:/icons/logout</normaloff>:/icons/logout</iconset> - </property> - <property name="iconSize"> - <size> - <width>32</width> - <height>32</height> - </size> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QFrame" name="frame_disconnected"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <layout class="QHBoxLayout" name="horizontalLayout_2"> - <item> - <widget class="QLabel" name="label_disconnected"> - <property name="text"> - <string><html><head/><body><p><span style=" font-size:12pt; font-weight:600;">Not Connected</span></p></body></html></string> - </property> - </widget> - </item> - <item> - <widget class="QToolButton" name="toolbutton_connect"> - <property name="text"> - <string>Connect</string> - </property> - <property name="icon"> - <iconset resource="../icons/icons.qrc"> - <normaloff>:/icons/connect_icon</normaloff>:/icons/connect_icon</iconset> - </property> - <property name="iconSize"> - <size> - <width>32</width> - <height>32</height> - </size> - </property> - <property name="popupMode"> - <enum>QToolButton::MenuButtonPopup</enum> - </property> - <property name="toolButtonStyle"> - <enum>Qt::ToolButtonTextBesideIcon</enum> - </property> - </widget> - </item> - <item> - <widget class="QToolButton" name="toolbutton_new_account"> - <property name="text"> - <string>New account</string> - </property> - <property name="icon"> - <iconset resource="../icons/icons.qrc"> - <normaloff>:/icons/add_account_icon</normaloff>:/icons/add_account_icon</iconset> - </property> - <property name="iconSize"> - <size> - <width>32</width> - <height>32</height> - </size> - </property> - <property name="popupMode"> - <enum>QToolButton::MenuButtonPopup</enum> - </property> - <property name="toolButtonStyle"> - <enum>Qt::ToolButtonTextBesideIcon</enum> - </property> - <property name="autoRaise"> - <bool>false</bool> - </property> - <property name="arrowType"> - <enum>Qt::NoArrow</enum> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_5"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - </item> - </layout> + <layout class="QVBoxLayout" name="verticalLayout"/> </widget> <resources> - <include location="../icons/icons.qrc"/> + <include location="../../../../res/icons/icons.qrc"/> </resources> <connections/> </ui> diff --git a/src/sakia/gui/homescreen/model.py b/src/sakia/gui/homescreen/model.py index af5b2f6cba174e0e714acc637010ed1b85f40ecc..c306fb2b2a860edb18d955c2f017f2212a32bc68 100644 --- a/src/sakia/gui/homescreen/model.py +++ b/src/sakia/gui/homescreen/model.py @@ -9,3 +9,7 @@ class HomeScreenModel(ComponentModel): def __init__(self, parent, app): super().__init__(parent) self.app = app + + @property + def account(self): + return self.app.current_account \ No newline at end of file