-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmainprogram.py
More file actions
48 lines (35 loc) · 1.52 KB
/
mainprogram.py
File metadata and controls
48 lines (35 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import locale # language settings for date/time
import os # allows file operations and direct command line execution
import sys # command line arguments
from PyQt5 import QtGui, QtCore, QtWidgets
from nwbgui.mainwindow import Ui_MainWindow
from src import interface, menuactions
#######################################
# Compile QT File
#######################################
qtCompilePrefStr = 'pyuic5 '\
+ os.path.join(os.path.dirname(os.path.abspath(__file__)), 'nwbgui/mainwindow.ui')\
+ ' -o ' + os.path.join(os.path.dirname(os.path.abspath(__file__)), 'nwbgui/mainwindow.py')
print(qtCompilePrefStr)
os.system(qtCompilePrefStr)
#######################################################
# Main Window
#######################################################
class NWB_GUI () :
def __init__(self, dialog):
self.dialog = dialog
self.gui = Ui_MainWindow()
self.gui.setupUi(dialog)
# Define helper classes
self.gui_interface = interface.NWBGUI_Interface(self, self.gui)
self.gui_menuactions = menuactions.NWBGUI_MenuActions(self.dialog, self.gui, self.gui_interface)
#######################################################
## Start the QT window
#######################################################
if __name__ == '__main__' :
app = QtWidgets.QApplication(sys.argv)
mainwindow = QtWidgets.QMainWindow()
locale.setlocale(locale.LC_TIME, "en_GB.utf8")
pth1 = NWB_GUI(mainwindow)
mainwindow.show()
sys.exit(app.exec_())