From 472fe4069ffe65970461c492e49d8858d605e3dc Mon Sep 17 00:00:00 2001 From: ingvar1995 Date: Wed, 24 Feb 2016 20:26:12 +0300 Subject: [PATCH] menu is now shown, main.py update --- src/main.py | 3 ++- src/mainscreen.py | 27 ++++++++++++++------------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/main.py b/src/main.py index 5e1bc6d..2fea8cd 100644 --- a/src/main.py +++ b/src/main.py @@ -6,6 +6,7 @@ import sys from PySide import QtCore, QtGui from callbacks import init_callbacks from bootstrap import node_generator +from util import curr_directory class login(object): @@ -35,7 +36,7 @@ def main(): main function of app. loads loginscreen if needed and starts mainscreen """ app = QtGui.QApplication(sys.argv) - app.setWindowIcon(QtGui.QIcon('images/icon.png')) + app.setWindowIcon(QtGui.QIcon(curr_directory() + '/images/icon.png')) settings = Settings() if not settings['auto_profile']: # show login screen if default profile not found diff --git a/src/mainscreen.py b/src/mainscreen.py index 09fdbd4..e9931cc 100644 --- a/src/mainscreen.py +++ b/src/mainscreen.py @@ -55,16 +55,16 @@ class MainWindow(QtGui.QMainWindow): def setup_menu(self, MainWindow): self.menubar = QtGui.QMenuBar(MainWindow) self.menubar.setObjectName("menubar") - self.menubar.setNativeMenuBar(True) - self.menubar.setHidden(True) + self.menubar.setNativeMenuBar(False) + self.menubar.setMinimumSize(self.width(), 25) + self.menubar.setMaximumSize(self.width(), 25) + self.menubar.setBaseSize(self.width(), 25) self.menuProfile = QtGui.QMenu(self.menubar) self.menuProfile.setObjectName("menuProfile") self.menuSettings = QtGui.QMenu(self.menubar) self.menuSettings.setObjectName("menuSettings") self.menuAbout = QtGui.QMenu(self.menubar) self.menuAbout.setObjectName("menuAbout") - #self.statusbar = QtGui.QStatusBar(MainWindow) - #self.statusbar.setObjectName("statusbar") self.actionAdd_friend = QtGui.QAction(MainWindow) self.actionAdd_friend.setObjectName("actionAdd_friend") self.actionProfile_settings = QtGui.QAction(MainWindow) @@ -209,10 +209,6 @@ class MainWindow(QtGui.QMainWindow): self.callButton.setText(QtGui.QApplication.translate("Form", "Start call", None, QtGui.QApplication.UnicodeUTF8)) QtCore.QMetaObject.connectSlotsByName(Form) - def setup_info_from_tox(self): - self.name.setText(self.tox.self_get_name()) - self.status_message.setText(self.tox.self_get_status_message()) - def initUI(self): main = QtGui.QWidget() grid = QtGui.QGridLayout() @@ -237,11 +233,16 @@ class MainWindow(QtGui.QMainWindow): self.setWindowTitle('Toxygen') def mouseReleaseEvent(self, event): - if self.connection_status.status != TOX_USER_CONNECTION_STATUS['OFFLINE']: - self.connection_status.status += 1 - self.connection_status.status %= TOX_USER_CONNECTION_STATUS['OFFLINE'] - self.tox.self_set_status(self.connection_status.status) - self.connection_status.repaint() + pass + # if self.connection_status.status != TOX_USER_CONNECTION_STATUS['OFFLINE']: + # self.connection_status.status += 1 + # self.connection_status.status %= TOX_USER_CONNECTION_STATUS['OFFLINE'] + # self.tox.self_set_status(self.connection_status.status) + # self.connection_status.repaint() + + def setup_info_from_tox(self): + self.name.setText(self.tox.self_get_name()) + self.status_message.setText(self.tox.self_get_status_message()) # ----------------------------------------------------------------------------------------------------------------- # Functions which called when user click in menu