Skip to content
Snippets Groups Projects
Commit aec7f034 authored by Andreas Bolin's avatar Andreas Bolin
Browse files

cleanup

parent b1d3c9ef
No related branches found
No related tags found
1 merge request!78Add scheduler GUI
Pipeline #72854 passed
...@@ -69,19 +69,13 @@ if __debug__: ...@@ -69,19 +69,13 @@ if __debug__:
# Autocompile the .ui form to a python file. # Autocompile the .ui form to a python file.
try: # PyQt5, try autocompile try: # PyQt5, try autocompile
from qtpy.uic import compileUiDir from qtpy.uic import compileUiDir
# def _map_func(dir: str, file: str) -> tuple[str, str]:
# file_base,_ = os.path.splitext(file)
# return (dir+'/ui/', file_base+'_ui.py')
# uic.compileUiDir('.', map=_map_func)
uic.compileUiDir('.', map=(lambda dir,file: (dir, 'ui_' + file))) uic.compileUiDir('.', map=(lambda dir,file: (dir, 'ui_' + file)))
except: except:
try: # PySide2, try manual compile try: # PySide2, try manual compile
import subprocess import subprocess
os_ = sys.platform os_ = sys.platform
if os_.startswith('linux'): if os_.startswith('linux'):
cmds = ["mkdir -p ui", cmds = ['pyside2-uic -o ui_main_window.py main_window.ui']
"pyside2-uic -o ui_main_window.py main_window.ui"]
for cmd in cmds: for cmd in cmds:
subprocess.call(cmd.split()) subprocess.call(cmd.split())
else: else:
...@@ -262,11 +256,10 @@ class MainWindow(QMainWindow, Ui_MainWindow): ...@@ -262,11 +256,10 @@ class MainWindow(QMainWindow, Ui_MainWindow):
self.splitter_center.moveSplitter(range[1], 1) self.splitter_center.moveSplitter(range[1], 1)
@Slot(bool) @Slot(bool)
def toggle_exit_dialog(self, checked: bool): def toggle_exit_dialog(self, checked: bool) -> None:
s = QSettings() s = QSettings()
s.setValue("mainwindow/hide_exit_dialog", checked) s.setValue("mainwindow/hide_exit_dialog", checked)
@Slot(int, int) @Slot(int, int)
def _splitter_center_moved(self, pos: int, index: int) -> None: def _splitter_center_moved(self, pos: int, index: int) -> None:
"""Callback method used to check if the right widget (info window) """Callback method used to check if the right widget (info window)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment