From c13e7b0f873e4857f1ce7924c0a72609df3ddca2 Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Fri, 24 Jul 2020 01:08:02 +0530 Subject: platform independent library and image paths, flake8 compliant --- src/frontEnd/Application.py | 80 +++++++++++++++++++++++++++------------------ 1 file changed, 48 insertions(+), 32 deletions(-) (limited to 'src/frontEnd/Application.py') diff --git a/src/frontEnd/Application.py b/src/frontEnd/Application.py index 92013409..6eaf4c9c 100644 --- a/src/frontEnd/Application.py +++ b/src/frontEnd/Application.py @@ -13,10 +13,18 @@ # MODIFIED: Rahul Paknikar, rahulp@iitb.ac.in # ORGANIZATION: eSim team at FOSSEE, IIT Bombay. # CREATED: Tuesday 24 February 2015 -# REVISION: Friday 14 February 2020 +# REVISION: Friday 24 July 2020 # ========================================================================= -from frontEnd import pathmagic # noqa +import os + +if os.name == 'nt': # noqa + init_path = '' + from frontEnd import pathmagic # noqa:F401 +else: + import pathmagic # noqa:F401 + init_path = '../../' + from PyQt4 import QtGui, QtCore from configuration.Appconfig import Appconfig from projManagement.openProject import OpenProjectInfo @@ -27,11 +35,10 @@ from projManagement import Worker from frontEnd import ProjectExplorer from frontEnd import Workspace from frontEnd import DockArea -import time from PyQt4.Qt import QSize -import sys -import os import shutil +import time +import sys # Its our main window of application. @@ -64,10 +71,10 @@ class Application(QtGui.QMainWindow): self.obj_appconfig._app_heigth) self.setWindowTitle(self.obj_appconfig._APPLICATION) self.showMaximized() - self.setWindowIcon(QtGui.QIcon('images/logo.png')) + self.setWindowIcon(QtGui.QIcon(init_path + 'images/logo.png')) self.systemTrayIcon = QtGui.QSystemTrayIcon(self) - self.systemTrayIcon.setIcon(QtGui.QIcon('images/logo.png')) + self.systemTrayIcon.setIcon(QtGui.QIcon(init_path + 'images/logo.png')) self.systemTrayIcon.setVisible(True) def initToolBar(self): @@ -83,28 +90,28 @@ class Application(QtGui.QMainWindow): """ # Top Tool bar self.newproj = QtGui.QAction( - QtGui.QIcon('images/newProject.png'), + QtGui.QIcon(init_path + 'images/newProject.png'), 'New Project', self ) self.newproj.setShortcut('Ctrl+N') self.newproj.triggered.connect(self.new_project) self.openproj = QtGui.QAction( - QtGui.QIcon('images/openProject.png'), + QtGui.QIcon(init_path + 'images/openProject.png'), 'Open Project', self ) self.openproj.setShortcut('Ctrl+O') self.openproj.triggered.connect(self.open_project) self.closeproj = QtGui.QAction( - QtGui.QIcon('images/closeProject.png'), + QtGui.QIcon(init_path + 'images/closeProject.png'), 'Close Project', self ) self.closeproj.setShortcut('Ctrl+X') self.closeproj.triggered.connect(self.close_project) self.wrkspce = QtGui.QAction( - QtGui.QIcon('images/workspace.ico'), + QtGui.QIcon(init_path + 'images/workspace.ico'), 'Change Workspace', self ) self.wrkspce.setShortcut('Ctrl+W') @@ -114,17 +121,17 @@ class Application(QtGui.QMainWindow): self.validate_mode() if self.online_flag is True: self.switchmode = QtGui.QAction(QtGui.QIcon( - 'images/online.png'), + init_path + 'images/online.png'), 'Go Offline', self ) elif self.online_flag is False: self.switchmode = QtGui.QAction(QtGui.QIcon( - 'images/offline.png'), + init_path + 'images/offline.png'), 'Go Online', self ) elif self.online_flag is None: self.switchmode = QtGui.QAction(QtGui.QIcon( - 'images/disable.png'), + init_path + 'images/disable.png'), 'Mode switching has been disabled. ' + 'Default mode set to offline', self ) @@ -133,7 +140,8 @@ class Application(QtGui.QMainWindow): self.switchmode.triggered.connect(self.change_mode) self.helpfile = QtGui.QAction( - QtGui.QIcon('images/helpProject.png'), 'Help', self + QtGui.QIcon(init_path + 'images/helpProject.png'), + 'Help', self ) self.helpfile.setShortcut('Ctrl+H') self.helpfile.triggered.connect(self.help_project) @@ -156,7 +164,7 @@ class Application(QtGui.QMainWindow): self.logo = QtGui.QLabel() self.logopic = QtGui.QPixmap( os.path.join( - os.path.abspath(''), 'images', 'fosseeLogo.png' + os.path.abspath(''), init_path + 'images', 'fosseeLogo.png' )) self.logopic = self.logopic.scaled( QSize(150, 150), QtCore.Qt.KeepAspectRatio) @@ -166,45 +174,49 @@ class Application(QtGui.QMainWindow): # Left Tool bar Action Widget self.kicad = QtGui.QAction( - QtGui.QIcon('images/kicad.png'), + QtGui.QIcon(init_path + 'images/kicad.png'), 'Open Schematic', self ) self.kicad.triggered.connect(self.obj_kicad.openSchematic) self.conversion = QtGui.QAction( - QtGui.QIcon('images/ki-ng.png'), + QtGui.QIcon(init_path + 'images/ki-ng.png'), 'Convert Kicad to Ngspice', self ) self.conversion.triggered.connect(self.obj_kicad.openKicadToNgspice) self.ngspice = QtGui.QAction( - QtGui.QIcon('images/ngspice.png'), 'Simulation', self + QtGui.QIcon(init_path + 'images/ngspice.png'), + 'Simulation', self ) self.ngspice.triggered.connect(self.open_ngspice) self.model = QtGui.QAction( - QtGui.QIcon('images/model.png'), 'Model Editor', self + QtGui.QIcon(init_path + 'images/model.png'), + 'Model Editor', self ) self.model.triggered.connect(self.open_modelEditor) self.subcircuit = QtGui.QAction( - QtGui.QIcon('images/subckt.png'), 'Subcircuit', self + QtGui.QIcon(init_path + 'images/subckt.png'), + 'Subcircuit', self ) self.subcircuit.triggered.connect(self.open_subcircuit) self.nghdl = QtGui.QAction( - QtGui.QIcon('images/nghdl.png'), 'Nghdl', self + QtGui.QIcon(init_path + 'images/nghdl.png'), 'Nghdl', self ) self.nghdl.triggered.connect(self.open_nghdl) self.omedit = QtGui.QAction( - QtGui.QIcon('images/omedit.png'), + QtGui.QIcon(init_path + 'images/omedit.png'), 'Modelica Converter', self ) self.omedit.triggered.connect(self.open_OMedit) self.omoptim = QtGui.QAction( - QtGui.QIcon('images/omoptim.png'), 'OM Optimisation', self + QtGui.QIcon(init_path + 'images/omoptim.png'), + 'OM Optimisation', self ) self.omoptim.triggered.connect(self.open_OMoptim) @@ -398,10 +410,14 @@ class Application(QtGui.QMainWindow): "/fp-lib-table-online") # Restore original files - shutil.copy('library/supportFiles/fp-lib-table-online', - self.obj_appconfig.kicad_path + "/") - shutil.copy('library/supportFiles/fp-lib-table', - self.obj_appconfig.kicad_path + "/") + shutil.copy( + init_path + 'library/supportFiles/fp-lib-table-online', + self.obj_appconfig.kicad_path + "/" + ) + shutil.copy( + init_path + 'library/supportFiles/fp-lib-table', + self.obj_appconfig.kicad_path + "/" + ) self.online_flag = False else: @@ -442,7 +458,7 @@ class Application(QtGui.QMainWindow): self.obj_appconfig.kicad_path + "/fp-lib-table" ) self.switchmode.setIcon( - QtGui.QIcon('images/offline.png') + QtGui.QIcon(init_path + 'images/offline.png') ) self.switchmode.setText('Go Online') self.switchmode.setEnabled(True) @@ -460,7 +476,7 @@ class Application(QtGui.QMainWindow): self.obj_appconfig.kicad_path + "/fp-lib-table" ) self.switchmode.setIcon( - QtGui.QIcon('images/online.png') + QtGui.QIcon(init_path + 'images/online.png') ) self.switchmode.setText('Go Offline') self.switchmode.setEnabled(True) @@ -468,7 +484,7 @@ class Application(QtGui.QMainWindow): elif self.online_flag is None: self.switchmode.setIcon( - QtGui.QIcon('images/disable.png') + QtGui.QIcon(init_path + 'images/disable.png') ) self.switchmode.setText( 'Mode switching has been ' + @@ -798,7 +814,7 @@ def main(args): print("Starting eSim......") app = QtGui.QApplication(args) - splash_pix = QtGui.QPixmap('images/splash_screen_esim.png') + splash_pix = QtGui.QPixmap(init_path + 'images/splash_screen_esim.png') splash = QtGui.QSplashScreen(splash_pix, QtCore.Qt.WindowStaysOnTopHint) splash.setMask(splash_pix.mask()) splash.show() -- cgit From cde494dc77c0d48cffa1e9aca77121fec0e94cf0 Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Fri, 24 Jul 2020 01:57:19 +0530 Subject: fixed modality of workspace dialog with splash screen --- src/frontEnd/Application.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/frontEnd/Application.py') diff --git a/src/frontEnd/Application.py b/src/frontEnd/Application.py index 6eaf4c9c..cb7a7527 100644 --- a/src/frontEnd/Application.py +++ b/src/frontEnd/Application.py @@ -19,8 +19,8 @@ import os if os.name == 'nt': # noqa - init_path = '' from frontEnd import pathmagic # noqa:F401 + init_path = '' else: import pathmagic # noqa:F401 init_path = '../../' @@ -814,11 +814,15 @@ def main(args): print("Starting eSim......") app = QtGui.QApplication(args) + appView = Application() + appView.hide() + splash_pix = QtGui.QPixmap(init_path + 'images/splash_screen_esim.png') - splash = QtGui.QSplashScreen(splash_pix, QtCore.Qt.WindowStaysOnTopHint) + splash = QtGui.QSplashScreen(appView, splash_pix, QtCore.Qt.WindowStaysOnTopHint) splash.setMask(splash_pix.mask()) + splash.setDisabled(True) splash.show() - appView = Application() + appView.splash = splash appView.obj_workspace.returnWhetherClickedOrNot(appView) @@ -830,10 +834,10 @@ def main(args): file.close() except IOError: work = 0 + if work != 0: appView.obj_workspace.defaultWorkspace() else: - appView.hide() appView.obj_workspace.show() sys.exit(app.exec_()) -- cgit From 2eb6697de529a643127599070771a0278e9817b3 Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Mon, 3 Aug 2020 12:03:41 +0530 Subject: ported GUI to PyQt5 --- src/frontEnd/Application.py | 108 ++++++++++++++++++++++---------------------- 1 file changed, 55 insertions(+), 53 deletions(-) (limited to 'src/frontEnd/Application.py') diff --git a/src/frontEnd/Application.py b/src/frontEnd/Application.py index cb7a7527..d373e695 100644 --- a/src/frontEnd/Application.py +++ b/src/frontEnd/Application.py @@ -11,9 +11,9 @@ # NOTES: --- # AUTHOR: Fahim Khan, fahim.elex@gmail.com # MODIFIED: Rahul Paknikar, rahulp@iitb.ac.in -# ORGANIZATION: eSim team at FOSSEE, IIT Bombay. +# ORGANIZATION: eSim Team at FOSSEE, IIT Bombay # CREATED: Tuesday 24 February 2015 -# REVISION: Friday 24 July 2020 +# REVISION: Saturday 25 July 2020 # ========================================================================= import os @@ -25,7 +25,7 @@ else: import pathmagic # noqa:F401 init_path = '../../' -from PyQt4 import QtGui, QtCore +from PyQt5 import QtGui, QtCore, QtWidgets from configuration.Appconfig import Appconfig from projManagement.openProject import OpenProjectInfo from projManagement.newProject import NewProjectInfo @@ -35,14 +35,14 @@ from projManagement import Worker from frontEnd import ProjectExplorer from frontEnd import Workspace from frontEnd import DockArea -from PyQt4.Qt import QSize +from PyQt5.Qt import QSize import shutil import time import sys # Its our main window of application. -class Application(QtGui.QMainWindow): +class Application(QtWidgets.QMainWindow): """This class initializes all objects used in this file.""" global project_name @@ -50,7 +50,7 @@ class Application(QtGui.QMainWindow): """Initialize main Application window.""" # Calling __init__ of super class - QtGui.QMainWindow.__init__(self, *args) + QtWidgets.QMainWindow.__init__(self, *args) # Flag for mode of operation. Default is set to offline mode. self.online_flag = False @@ -73,7 +73,7 @@ class Application(QtGui.QMainWindow): self.showMaximized() self.setWindowIcon(QtGui.QIcon(init_path + 'images/logo.png')) - self.systemTrayIcon = QtGui.QSystemTrayIcon(self) + self.systemTrayIcon = QtWidgets.QSystemTrayIcon(self) self.systemTrayIcon.setIcon(QtGui.QIcon(init_path + 'images/logo.png')) self.systemTrayIcon.setVisible(True) @@ -89,28 +89,28 @@ class Application(QtGui.QMainWindow): Converter, OM Optimisation) """ # Top Tool bar - self.newproj = QtGui.QAction( + self.newproj = QtWidgets.QAction( QtGui.QIcon(init_path + 'images/newProject.png'), 'New Project', self ) self.newproj.setShortcut('Ctrl+N') self.newproj.triggered.connect(self.new_project) - self.openproj = QtGui.QAction( + self.openproj = QtWidgets.QAction( QtGui.QIcon(init_path + 'images/openProject.png'), 'Open Project', self ) self.openproj.setShortcut('Ctrl+O') self.openproj.triggered.connect(self.open_project) - self.closeproj = QtGui.QAction( + self.closeproj = QtWidgets.QAction( QtGui.QIcon(init_path + 'images/closeProject.png'), 'Close Project', self ) self.closeproj.setShortcut('Ctrl+X') self.closeproj.triggered.connect(self.close_project) - self.wrkspce = QtGui.QAction( + self.wrkspce = QtWidgets.QAction( QtGui.QIcon(init_path + 'images/workspace.ico'), 'Change Workspace', self ) @@ -120,17 +120,17 @@ class Application(QtGui.QMainWindow): self.switchmode = None self.validate_mode() if self.online_flag is True: - self.switchmode = QtGui.QAction(QtGui.QIcon( + self.switchmode = QtWidgets.QAction(QtGui.QIcon( init_path + 'images/online.png'), 'Go Offline', self ) elif self.online_flag is False: - self.switchmode = QtGui.QAction(QtGui.QIcon( + self.switchmode = QtWidgets.QAction(QtGui.QIcon( init_path + 'images/offline.png'), 'Go Online', self ) elif self.online_flag is None: - self.switchmode = QtGui.QAction(QtGui.QIcon( + self.switchmode = QtWidgets.QAction(QtGui.QIcon( init_path + 'images/disable.png'), 'Mode switching has been disabled. ' + 'Default mode set to offline', self @@ -139,7 +139,7 @@ class Application(QtGui.QMainWindow): self.switchmode.setShortcut('Ctrl+G') self.switchmode.triggered.connect(self.change_mode) - self.helpfile = QtGui.QAction( + self.helpfile = QtWidgets.QAction( QtGui.QIcon(init_path + 'images/helpProject.png'), 'Help', self ) @@ -156,12 +156,12 @@ class Application(QtGui.QMainWindow): # This part is setting fossee logo to the right # corner in the application window. - self.spacer = QtGui.QWidget() + self.spacer = QtWidgets.QWidget() self.spacer.setSizePolicy( - QtGui.QSizePolicy.Expanding, - QtGui.QSizePolicy.Expanding) + QtWidgets.QSizePolicy.Expanding, + QtWidgets.QSizePolicy.Expanding) self.topToolbar.addWidget(self.spacer) - self.logo = QtGui.QLabel() + self.logo = QtWidgets.QLabel() self.logopic = QtGui.QPixmap( os.path.join( os.path.abspath(''), init_path + 'images', 'fosseeLogo.png' @@ -173,55 +173,55 @@ class Application(QtGui.QMainWindow): self.topToolbar.addWidget(self.logo) # Left Tool bar Action Widget - self.kicad = QtGui.QAction( + self.kicad = QtWidgets.QAction( QtGui.QIcon(init_path + 'images/kicad.png'), 'Open Schematic', self ) self.kicad.triggered.connect(self.obj_kicad.openSchematic) - self.conversion = QtGui.QAction( + self.conversion = QtWidgets.QAction( QtGui.QIcon(init_path + 'images/ki-ng.png'), 'Convert Kicad to Ngspice', self ) self.conversion.triggered.connect(self.obj_kicad.openKicadToNgspice) - self.ngspice = QtGui.QAction( + self.ngspice = QtWidgets.QAction( QtGui.QIcon(init_path + 'images/ngspice.png'), 'Simulation', self ) self.ngspice.triggered.connect(self.open_ngspice) - self.model = QtGui.QAction( + self.model = QtWidgets.QAction( QtGui.QIcon(init_path + 'images/model.png'), 'Model Editor', self ) self.model.triggered.connect(self.open_modelEditor) - self.subcircuit = QtGui.QAction( + self.subcircuit = QtWidgets.QAction( QtGui.QIcon(init_path + 'images/subckt.png'), 'Subcircuit', self ) self.subcircuit.triggered.connect(self.open_subcircuit) - self.nghdl = QtGui.QAction( + self.nghdl = QtWidgets.QAction( QtGui.QIcon(init_path + 'images/nghdl.png'), 'Nghdl', self ) self.nghdl.triggered.connect(self.open_nghdl) - self.omedit = QtGui.QAction( + self.omedit = QtWidgets.QAction( QtGui.QIcon(init_path + 'images/omedit.png'), 'Modelica Converter', self ) self.omedit.triggered.connect(self.open_OMedit) - self.omoptim = QtGui.QAction( + self.omoptim = QtWidgets.QAction( QtGui.QIcon(init_path + 'images/omoptim.png'), 'OM Optimisation', self ) self.omoptim.triggered.connect(self.open_OMoptim) # Adding Action Widget to tool bar - self.lefttoolbar = QtGui.QToolBar('Left ToolBar') + self.lefttoolbar = QtWidgets.QToolBar('Left ToolBar') self.addToolBar(QtCore.Qt.LeftToolBarArea, self.lefttoolbar) self.lefttoolbar.addAction(self.kicad) self.lefttoolbar.addAction(self.conversion) @@ -254,12 +254,12 @@ class Application(QtGui.QMainWindow): ''' exit_msg = "Are you sure you want to exit the program?" exit_msg += " All unsaved data will be lost." - reply = QtGui.QMessageBox.question( - self, 'Message', exit_msg, QtGui.QMessageBox.Yes, - QtGui.QMessageBox.No + reply = QtWidgets.QMessageBox.question( + self, 'Message', exit_msg, QtWidgets.QMessageBox.Yes, + QtWidgets.QMessageBox.No ) - if reply == QtGui.QMessageBox.Yes: + if reply == QtWidgets.QMessageBox.Yes: for proc in self.obj_appconfig.procThread_list: try: proc.terminate() @@ -283,12 +283,12 @@ class Application(QtGui.QMainWindow): event.accept() self.systemTrayIcon.showMessage('Exit', 'eSim is Closed.') - elif reply == QtGui.QMessageBox.No: + elif reply == QtWidgets.QMessageBox.No: event.ignore() def new_project(self): """This function call New Project Info class.""" - text, ok = QtGui.QInputDialog.getText( + text, ok = QtWidgets.QInputDialog.getText( self, 'New Project Info', 'Enter Project Name:' ) if ok: @@ -492,7 +492,7 @@ class Application(QtGui.QMainWindow): ) self.switchmode.setEnabled(False) else: - self.msg = QtGui.QErrorMessage() + self.msg = QtWidgets.QErrorMessage() self.msg.setWindowTitle("Error Message") self.msg.setModal(True) self.msg.showMessage( @@ -544,7 +544,7 @@ class Application(QtGui.QMainWindow): try: self.obj_Mainview.obj_dockarea.plottingEditor() except Exception as e: - self.msg = QtGui.QErrorMessage() + self.msg = QtWidgets.QErrorMessage() self.msg.setModal(True) self.msg.setWindowTitle("Error Message") self.msg.showMessage( @@ -556,7 +556,7 @@ class Application(QtGui.QMainWindow): self.obj_appconfig.print_error('Exception Message : ' + str(e)) else: - self.msg = QtGui.QErrorMessage() + self.msg = QtWidgets.QErrorMessage() self.msg.setModal(True) self.msg.setWindowTitle("Error Message") self.msg.showMessage( @@ -597,7 +597,7 @@ class Application(QtGui.QMainWindow): self.obj_workThread = Worker.WorkerThread(self.cmd) self.obj_workThread.start() else: - self.msg = QtGui.QErrorMessage() + self.msg = QtWidgets.QErrorMessage() self.msg.setModal(True) self.msg.setWindowTitle('NGHDL Error') self.msg.showMessage('Error while opening NGHDL. ' + @@ -651,7 +651,7 @@ class Application(QtGui.QMainWindow): self.obj_workThread2 = Worker.WorkerThread(self.cmd2) self.obj_workThread2.start() else: - self.msg = QtGui.QMessageBox() + self.msg = QtWidgets.QMessageBox() self.msgContent = "There was an error while opening OMEdit.
\ Please make sure OpenModelica is installed in your\ @@ -671,7 +671,7 @@ class Application(QtGui.QMainWindow): self.msg.exec_() except Exception as e: - self.msg = QtGui.QErrorMessage() + self.msg = QtWidgets.QErrorMessage() self.msg.setModal(True) self.msg.setWindowTitle( "Ngspice to Modelica conversion error") @@ -685,7 +685,7 @@ class Application(QtGui.QMainWindow): self.obj_Mainview.obj_dockarea.modelicaEditor(self.projDir) else: - self.msg = QtGui.QErrorMessage() + self.msg = QtWidgets.QErrorMessage() self.msg.setModal(True) self.msg.setWindowTitle("Missing Ngspice netlist") self.msg.showMessage( @@ -694,7 +694,7 @@ class Application(QtGui.QMainWindow): ) self.msg.exec_() else: - self.msg = QtGui.QErrorMessage() + self.msg = QtWidgets.QErrorMessage() self.msg.setModal(True) self.msg.setWindowTitle("Error Message") self.msg.showMessage( @@ -721,7 +721,7 @@ class Application(QtGui.QMainWindow): self.obj_workThread = Worker.WorkerThread(self.cmd) self.obj_workThread.start() else: - self.msg = QtGui.QMessageBox() + self.msg = QtWidgets.QMessageBox() self.msgContent = ( "There was an error while opening OMOptim.
" "Please make sure OpenModelica is installed in your" @@ -742,7 +742,7 @@ class Application(QtGui.QMainWindow): # This class initialize the Main View of Application -class MainView(QtGui.QWidget): +class MainView(QtWidgets.QWidget): """ This class defines whole view and style of main page: @@ -756,20 +756,20 @@ class MainView(QtGui.QWidget): def __init__(self, *args): # call init method of superclass - QtGui.QWidget.__init__(self, *args) + QtWidgets.QWidget.__init__(self, *args) self.obj_appconfig = Appconfig() - self.leftSplit = QtGui.QSplitter() - self.middleSplit = QtGui.QSplitter() + self.leftSplit = QtWidgets.QSplitter() + self.middleSplit = QtWidgets.QSplitter() - self.mainLayout = QtGui.QVBoxLayout() + self.mainLayout = QtWidgets.QVBoxLayout() # Intermediate Widget - self.middleContainer = QtGui.QWidget() - self.middleContainerLayout = QtGui.QVBoxLayout() + self.middleContainer = QtWidgets.QWidget() + self.middleContainerLayout = QtWidgets.QVBoxLayout() # Area to be included in MainView - self.noteArea = QtGui.QTextEdit() + self.noteArea = QtWidgets.QTextEdit() self.noteArea.setReadOnly(True) self.obj_appconfig.noteArea['Note'] = self.noteArea self.obj_appconfig.noteArea['Note'].append( @@ -812,13 +812,15 @@ def main(args): by this function. """ print("Starting eSim......") - app = QtGui.QApplication(args) + app = QtWidgets.QApplication(args) appView = Application() appView.hide() splash_pix = QtGui.QPixmap(init_path + 'images/splash_screen_esim.png') - splash = QtGui.QSplashScreen(appView, splash_pix, QtCore.Qt.WindowStaysOnTopHint) + splash = QtWidgets.QSplashScreen( + appView, splash_pix, QtCore.Qt.WindowStaysOnTopHint + ) splash.setMask(splash_pix.mask()) splash.setDisabled(True) splash.show() -- cgit From 8846bcac1b640aacf9d9fc7c6063dd9bf736098e Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Mon, 3 Aug 2020 12:58:02 +0530 Subject: added app name and version info; removed system tray --- src/frontEnd/Application.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/frontEnd/Application.py') diff --git a/src/frontEnd/Application.py b/src/frontEnd/Application.py index d373e695..43109f7d 100644 --- a/src/frontEnd/Application.py +++ b/src/frontEnd/Application.py @@ -13,7 +13,7 @@ # MODIFIED: Rahul Paknikar, rahulp@iitb.ac.in # ORGANIZATION: eSim Team at FOSSEE, IIT Bombay # CREATED: Tuesday 24 February 2015 -# REVISION: Saturday 25 July 2020 +# REVISION: Saturday 01 August 2020 # ========================================================================= import os @@ -69,13 +69,15 @@ class Application(QtWidgets.QMainWindow): self.obj_appconfig._app_ypos, self.obj_appconfig._app_width, self.obj_appconfig._app_heigth) - self.setWindowTitle(self.obj_appconfig._APPLICATION) + self.setWindowTitle( + self.obj_appconfig._APPLICATION + "-" + self.obj_appconfig._VERSION + ) self.showMaximized() self.setWindowIcon(QtGui.QIcon(init_path + 'images/logo.png')) - self.systemTrayIcon = QtWidgets.QSystemTrayIcon(self) - self.systemTrayIcon.setIcon(QtGui.QIcon(init_path + 'images/logo.png')) - self.systemTrayIcon.setVisible(True) + # self.systemTrayIcon = QtWidgets.QSystemTrayIcon(self) + # self.systemTrayIcon.setIcon(QtGui.QIcon(init_path + 'images/logo.png')) + # self.systemTrayIcon.setVisible(True) def initToolBar(self): """ @@ -800,8 +802,8 @@ class MainView(QtWidgets.QWidget): # Adding to main Layout self.mainLayout.addWidget(self.leftSplit) - self.leftSplit.setSizes([self.width() / 4.5, self.height()]) - self.middleSplit.setSizes([self.width(), self.height() / 2]) + self.leftSplit.setSizes([self.width() // 4.5, self.height()]) + self.middleSplit.setSizes([self.width(), self.height() // 2]) self.setLayout(self.mainLayout) @@ -813,6 +815,7 @@ def main(args): """ print("Starting eSim......") app = QtWidgets.QApplication(args) + app.setApplicationName("eSim") appView = Application() appView.hide() -- cgit From 7871e58975d75eb2b02928f7a48d29113bebeb2b Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Sat, 8 Aug 2020 19:06:45 +0530 Subject: resolved pep8 issues --- src/frontEnd/Application.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/frontEnd/Application.py') diff --git a/src/frontEnd/Application.py b/src/frontEnd/Application.py index 43109f7d..506f2fd8 100644 --- a/src/frontEnd/Application.py +++ b/src/frontEnd/Application.py @@ -76,7 +76,9 @@ class Application(QtWidgets.QMainWindow): self.setWindowIcon(QtGui.QIcon(init_path + 'images/logo.png')) # self.systemTrayIcon = QtWidgets.QSystemTrayIcon(self) - # self.systemTrayIcon.setIcon(QtGui.QIcon(init_path + 'images/logo.png')) + # self.systemTrayIcon.setIcon( + # QtGui.QIcon(init_path + 'images/logo.png') + # ) # self.systemTrayIcon.setVisible(True) def initToolBar(self): -- cgit