mirror of
https://github.com/naruxde/revpicommander.git
synced 2025-11-08 16:43:53 +01:00
Bugfix in super call of backgroundworker.py
Change all super calls to default call with no arguments.
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
|
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
|
||||||
|
|
||||||
#define MyAppName "RevPi Commander"
|
#define MyAppName "RevPi Commander"
|
||||||
#define MyAppVersion "0.9.10rc6"
|
#define MyAppVersion "0.9.10rc7"
|
||||||
#define MyAppPublisher "Sven Sager"
|
#define MyAppPublisher "Sven Sager"
|
||||||
#define MyAppURL "https://revpimodio.org/"
|
#define MyAppURL "https://revpimodio.org/"
|
||||||
#define MyAppICO "data\revpicommander.ico"
|
#define MyAppICO "data\revpicommander.ico"
|
||||||
|
|||||||
@@ -4,4 +4,4 @@ __author__ = "Sven Sager"
|
|||||||
__copyright__ = "Copyright (C) 2023 Sven Sager"
|
__copyright__ = "Copyright (C) 2023 Sven Sager"
|
||||||
__license__ = "GPLv2"
|
__license__ = "GPLv2"
|
||||||
__package__ = "revpicommander"
|
__package__ = "revpicommander"
|
||||||
__version__ = "0.9.10rc6"
|
__version__ = "0.9.10rc7"
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class AclManager(QtWidgets.QDialog, Ui_diag_aclmanager):
|
|||||||
"""ACL manager."""
|
"""ACL manager."""
|
||||||
|
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
super(AclManager, self).__init__(parent)
|
super().__init__(parent)
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
self.setFixedSize(self.size())
|
self.setFixedSize(self.size())
|
||||||
|
|
||||||
@@ -91,7 +91,7 @@ class AclManager(QtWidgets.QDialog, Ui_diag_aclmanager):
|
|||||||
return
|
return
|
||||||
|
|
||||||
self.__oldacl = self.__table_to_acl()
|
self.__oldacl = self.__table_to_acl()
|
||||||
super(AclManager, self).accept()
|
super().accept()
|
||||||
|
|
||||||
def closeEvent(self, a0: QtGui.QCloseEvent) -> None:
|
def closeEvent(self, a0: QtGui.QCloseEvent) -> None:
|
||||||
if self._changes_done():
|
if self._changes_done():
|
||||||
@@ -107,12 +107,12 @@ class AclManager(QtWidgets.QDialog, Ui_diag_aclmanager):
|
|||||||
a0.ignore()
|
a0.ignore()
|
||||||
|
|
||||||
def exec(self) -> int:
|
def exec(self) -> int:
|
||||||
return super(AclManager, self).exec()
|
return super().exec()
|
||||||
|
|
||||||
def reject(self) -> None:
|
def reject(self) -> None:
|
||||||
"""Restore old settings."""
|
"""Restore old settings."""
|
||||||
self.setup_acl_manager(self.__oldacl, self.__dict_acltext)
|
self.setup_acl_manager(self.__oldacl, self.__dict_acltext)
|
||||||
super(AclManager, self).reject()
|
super().reject()
|
||||||
|
|
||||||
def setup_acl_manager(self, acl_string: str, acl_texts: dict):
|
def setup_acl_manager(self, acl_string: str, acl_texts: dict):
|
||||||
if type(acl_string) != str:
|
if type(acl_string) != str:
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class AvahiSearchThread(QtCore.QThread):
|
|||||||
updated = QtCore.pyqtSignal(str, str, int, str, str)
|
updated = QtCore.pyqtSignal(str, str, int, str, str)
|
||||||
|
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
super(AvahiSearchThread, self).__init__(parent)
|
super().__init__(parent)
|
||||||
self._cycle_wait_ms = 1000
|
self._cycle_wait_ms = 1000
|
||||||
|
|
||||||
self.re_posix = compile(
|
self.re_posix = compile(
|
||||||
@@ -71,7 +71,7 @@ class AvahiSearchThread(QtCore.QThread):
|
|||||||
class AvahiSearch(QtWidgets.QDialog, Ui_diag_search):
|
class AvahiSearch(QtWidgets.QDialog, Ui_diag_search):
|
||||||
|
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
super(AvahiSearch, self).__init__(parent)
|
super().__init__(parent)
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
|
|
||||||
# Global variables to let parent decide other actions
|
# Global variables to let parent decide other actions
|
||||||
@@ -184,7 +184,7 @@ class AvahiSearch(QtWidgets.QDialog, Ui_diag_search):
|
|||||||
self.connect_settings = None
|
self.connect_settings = None
|
||||||
self.just_save = False
|
self.just_save = False
|
||||||
self._restart_search()
|
self._restart_search()
|
||||||
rc = super(AvahiSearch, self).exec()
|
rc = super().exec()
|
||||||
self._th_zero_conf.requestInterruption()
|
self._th_zero_conf.requestInterruption()
|
||||||
return rc
|
return rc
|
||||||
|
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ class BackgroundWorker(QtCore.QThread):
|
|||||||
status_message = QtCore.pyqtSignal(str)
|
status_message = QtCore.pyqtSignal(str)
|
||||||
|
|
||||||
def __init__(self, parent=None, interruption_text: str = None):
|
def __init__(self, parent=None, interruption_text: str = None):
|
||||||
|
super().__init__(parent)
|
||||||
self._interruption_text = interruption_text or self.tr("User requested cancellation...")
|
self._interruption_text = interruption_text or self.tr("User requested cancellation...")
|
||||||
super(BackgroundWorker, self).__init__(parent)
|
|
||||||
|
|
||||||
def check_cancel(self) -> bool:
|
def check_cancel(self) -> bool:
|
||||||
"""
|
"""
|
||||||
@@ -73,9 +73,9 @@ class BackgroundWaiter(BackgroundWorker):
|
|||||||
"""Just wait an amount of time and show progress bar."""
|
"""Just wait an amount of time and show progress bar."""
|
||||||
|
|
||||||
def __init__(self, seconds: int, status_message: str, parent=None, interruption_text: str = None):
|
def __init__(self, seconds: int, status_message: str, parent=None, interruption_text: str = None):
|
||||||
|
super().__init__(parent, interruption_text)
|
||||||
self._status_message = status_message
|
self._status_message = status_message
|
||||||
self._wait_steps = seconds * 4
|
self._wait_steps = seconds * 4
|
||||||
super().__init__(parent, interruption_text)
|
|
||||||
|
|
||||||
def run(self) -> None:
|
def run(self) -> None:
|
||||||
log.debug("BackgroundWaiter.run")
|
log.debug("BackgroundWaiter.run")
|
||||||
@@ -101,7 +101,7 @@ class WorkerDialog(QtWidgets.QDialog, Ui_diag_backgroundworker):
|
|||||||
:param worker_thread: Thread with the logic work to do
|
:param worker_thread: Thread with the logic work to do
|
||||||
:param parent: QtWidget
|
:param parent: QtWidget
|
||||||
"""
|
"""
|
||||||
super(WorkerDialog, self).__init__(parent)
|
super().__init__(parent)
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
|
|
||||||
self._canceled = False
|
self._canceled = False
|
||||||
@@ -117,7 +117,7 @@ class WorkerDialog(QtWidgets.QDialog, Ui_diag_backgroundworker):
|
|||||||
|
|
||||||
def exec(self) -> int:
|
def exec(self) -> int:
|
||||||
self._th.start()
|
self._th.start()
|
||||||
return super(WorkerDialog, self).exec()
|
return super().exec()
|
||||||
|
|
||||||
@QtCore.pyqtSlot()
|
@QtCore.pyqtSlot()
|
||||||
def on_th_finished(self) -> None:
|
def on_th_finished(self) -> None:
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ class PsValues(QtCore.QThread):
|
|||||||
process_image_received = QtCore.pyqtSignal(Binary)
|
process_image_received = QtCore.pyqtSignal(Binary)
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(PsValues, self).__init__()
|
super().__init__()
|
||||||
self._cycle_time = 200
|
self._cycle_time = 200
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
@@ -55,7 +55,7 @@ class DebugControl(QtWidgets.QWidget, Ui_wid_debugcontrol):
|
|||||||
"""Debug controller for main window."""
|
"""Debug controller for main window."""
|
||||||
|
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
super(DebugControl, self).__init__(parent)
|
super().__init__(parent)
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
|
|
||||||
self.dict_devices = {}
|
self.dict_devices = {}
|
||||||
@@ -284,7 +284,7 @@ class DebugControl(QtWidgets.QWidget, Ui_wid_debugcontrol):
|
|||||||
self.cbx_refresh.setChecked(False)
|
self.cbx_refresh.setChecked(False)
|
||||||
self._destroy_io_view()
|
self._destroy_io_view()
|
||||||
|
|
||||||
super(DebugControl, self).deleteLater()
|
super().deleteLater()
|
||||||
|
|
||||||
def reload_devices(self):
|
def reload_devices(self):
|
||||||
"""Rebuild GUI depending on devices and ios of Revolution Pi."""
|
"""Rebuild GUI depending on devices and ios of Revolution Pi."""
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class DebugIos(QtWidgets.QMainWindow, Ui_win_debugios):
|
|||||||
search_class = (QtWidgets.QLineEdit, QtWidgets.QDoubleSpinBox, QtWidgets.QCheckBox)
|
search_class = (QtWidgets.QLineEdit, QtWidgets.QDoubleSpinBox, QtWidgets.QCheckBox)
|
||||||
|
|
||||||
def __init__(self, position: int, name: str, inputs: list, outputs: list, parent=None):
|
def __init__(self, position: int, name: str, inputs: list, outputs: list, parent=None):
|
||||||
super(DebugIos, self).__init__(parent)
|
super().__init__(parent)
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
|
|
||||||
self.restoreGeometry(helper.cm.settings.debug_geos.get(position, b''))
|
self.restoreGeometry(helper.cm.settings.debug_geos.get(position, b''))
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ class ConnectionManager(QtCore.QThread):
|
|||||||
"""After errors the connection is established again, could have other port information (SSH)."""
|
"""After errors the connection is established again, could have other port information (SSH)."""
|
||||||
|
|
||||||
def __init__(self, parent=None, cycle_time_ms=1000):
|
def __init__(self, parent=None, cycle_time_ms=1000):
|
||||||
super(ConnectionManager, self).__init__(parent)
|
super().__init__(parent)
|
||||||
|
|
||||||
self._cli = None
|
self._cli = None
|
||||||
self._cli_connect = Queue()
|
self._cli_connect = Queue()
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class MqttManager(QtWidgets.QDialog, Ui_diag_mqtt):
|
|||||||
"""MQTT settings for option window."""
|
"""MQTT settings for option window."""
|
||||||
|
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
super(MqttManager, self).__init__(parent)
|
super().__init__(parent)
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
self.setFixedSize(self.size())
|
self.setFixedSize(self.size())
|
||||||
|
|
||||||
@@ -72,7 +72,7 @@ class MqttManager(QtWidgets.QDialog, Ui_diag_mqtt):
|
|||||||
self.dc["mqttusername"] = self.txt_username.text()
|
self.dc["mqttusername"] = self.txt_username.text()
|
||||||
self.dc["mqttpassword"] = self.txt_password.text()
|
self.dc["mqttpassword"] = self.txt_password.text()
|
||||||
self.dc["mqttclient_id"] = self.txt_client_id.text()
|
self.dc["mqttclient_id"] = self.txt_client_id.text()
|
||||||
super(MqttManager, self).accept()
|
super().accept()
|
||||||
|
|
||||||
def closeEvent(self, a0: QtGui.QCloseEvent) -> None:
|
def closeEvent(self, a0: QtGui.QCloseEvent) -> None:
|
||||||
if self._changesdone():
|
if self._changesdone():
|
||||||
@@ -95,12 +95,12 @@ class MqttManager(QtWidgets.QDialog, Ui_diag_mqtt):
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
return QtWidgets.QDialog.Rejected
|
return QtWidgets.QDialog.Rejected
|
||||||
return super(MqttManager, self).exec()
|
return super().exec()
|
||||||
|
|
||||||
def reject(self) -> None:
|
def reject(self) -> None:
|
||||||
"""Reject settings."""
|
"""Reject settings."""
|
||||||
self._load_settings()
|
self._load_settings()
|
||||||
super(MqttManager, self).reject()
|
super().reject()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def read_only(self):
|
def read_only(self):
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ class RevPiCommander(QtWidgets.QMainWindow, Ui_win_revpicommander):
|
|||||||
|
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
"""Init main program."""
|
"""Init main program."""
|
||||||
super(RevPiCommander, self).__init__(parent)
|
super().__init__(parent)
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
|
|
||||||
self.wid_debugcontrol = None # type: DebugControl
|
self.wid_debugcontrol = None # type: DebugControl
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ class NodeType(IntEnum):
|
|||||||
class UploadFiles(BackgroundWorker):
|
class UploadFiles(BackgroundWorker):
|
||||||
|
|
||||||
def __init__(self, file_list: list, parent):
|
def __init__(self, file_list: list, parent):
|
||||||
super(UploadFiles, self).__init__(parent)
|
super().__init__(parent)
|
||||||
self.ec = 1
|
self.ec = 1
|
||||||
self.file_list = file_list
|
self.file_list = file_list
|
||||||
self.plc_program_included = False # Will be True, when opt_program was found in files
|
self.plc_program_included = False # Will be True, when opt_program was found in files
|
||||||
@@ -76,7 +76,7 @@ class UploadFiles(BackgroundWorker):
|
|||||||
class RevPiFiles(QtWidgets.QMainWindow, Ui_win_files):
|
class RevPiFiles(QtWidgets.QMainWindow, Ui_win_files):
|
||||||
|
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
super(RevPiFiles, self).__init__(parent)
|
super().__init__(parent)
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
|
|
||||||
self.dc_settings = {}
|
self.dc_settings = {}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class RevPiInfo(QtWidgets.QDialog, Ui_diag_revpiinfo):
|
|||||||
"""Version information window."""
|
"""Version information window."""
|
||||||
|
|
||||||
def __init__(self, version: str, parent=None):
|
def __init__(self, version: str, parent=None):
|
||||||
super(RevPiInfo, self).__init__(parent)
|
super().__init__(parent)
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
|
|
||||||
self._debug_load = False
|
self._debug_load = False
|
||||||
@@ -28,7 +28,7 @@ class RevPiInfo(QtWidgets.QDialog, Ui_diag_revpiinfo):
|
|||||||
if helper.cm.connected else "-"
|
if helper.cm.connected else "-"
|
||||||
)
|
)
|
||||||
self._load_lst_files()
|
self._load_lst_files()
|
||||||
return super(RevPiInfo, self).exec()
|
return super().exec()
|
||||||
|
|
||||||
def lbl_version_mousePressEvent(self, a0: QtGui.QMouseEvent):
|
def lbl_version_mousePressEvent(self, a0: QtGui.QMouseEvent):
|
||||||
if a0.button() == QtCore.Qt.MidButton:
|
if a0.button() == QtCore.Qt.MidButton:
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ class DataThread(QtCore.QThread):
|
|||||||
"""log_type, success, text"""
|
"""log_type, success, text"""
|
||||||
|
|
||||||
def __init__(self, parent=None, cycle_time=1000):
|
def __init__(self, parent=None, cycle_time=1000):
|
||||||
super(DataThread, self).__init__(parent)
|
super().__init__(parent)
|
||||||
|
|
||||||
self._cycle_time = cycle_time
|
self._cycle_time = cycle_time
|
||||||
self._paused = True
|
self._paused = True
|
||||||
@@ -113,7 +113,7 @@ class RevPiLogfile(QtWidgets.QMainWindow, Ui_win_revpilogfile):
|
|||||||
|
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
u"""Init RevPiLogfile-Class."""
|
u"""Init RevPiLogfile-Class."""
|
||||||
super(RevPiLogfile, self).__init__(parent)
|
super().__init__(parent)
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
|
|
||||||
self.th_data = DataThread(self)
|
self.th_data = DataThread(self)
|
||||||
@@ -138,11 +138,11 @@ class RevPiLogfile(QtWidgets.QMainWindow, Ui_win_revpilogfile):
|
|||||||
|
|
||||||
def hideEvent(self, a0: QtGui.QHideEvent) -> None:
|
def hideEvent(self, a0: QtGui.QHideEvent) -> None:
|
||||||
self.th_data.pause()
|
self.th_data.pause()
|
||||||
super(RevPiLogfile, self).hideEvent(a0)
|
super().hideEvent(a0)
|
||||||
|
|
||||||
def showEvent(self, a0: QtGui.QShowEvent) -> None:
|
def showEvent(self, a0: QtGui.QShowEvent) -> None:
|
||||||
self.th_data.resume()
|
self.th_data.resume()
|
||||||
super(RevPiLogfile, self).showEvent(a0)
|
super().showEvent(a0)
|
||||||
|
|
||||||
def _load_gui_settings(self):
|
def _load_gui_settings(self):
|
||||||
self.restoreGeometry(helper.settings.value("logfile/geo", b''))
|
self.restoreGeometry(helper.settings.value("logfile/geo", b''))
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ class RevPiOption(QtWidgets.QDialog, Ui_diag_options):
|
|||||||
"""Set options of RevPiPyLoad."""
|
"""Set options of RevPiPyLoad."""
|
||||||
|
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
super(RevPiOption, self).__init__(parent)
|
super().__init__(parent)
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
self.setFixedSize(self.size())
|
self.setFixedSize(self.size())
|
||||||
|
|
||||||
@@ -179,7 +179,7 @@ class RevPiOption(QtWidgets.QDialog, Ui_diag_options):
|
|||||||
|
|
||||||
def accept(self) -> None:
|
def accept(self) -> None:
|
||||||
if not self._changesdone():
|
if not self._changesdone():
|
||||||
super(RevPiOption, self).accept()
|
super().accept()
|
||||||
return
|
return
|
||||||
|
|
||||||
ask = QtWidgets.QMessageBox.question(
|
ask = QtWidgets.QMessageBox.question(
|
||||||
@@ -227,7 +227,7 @@ class RevPiOption(QtWidgets.QDialog, Ui_diag_options):
|
|||||||
)
|
)
|
||||||
|
|
||||||
if saved:
|
if saved:
|
||||||
super(RevPiOption, self).accept()
|
super().accept()
|
||||||
else:
|
else:
|
||||||
QtWidgets.QMessageBox.critical(
|
QtWidgets.QMessageBox.critical(
|
||||||
self, self.tr("Error"), self.tr(
|
self, self.tr("Error"), self.tr(
|
||||||
@@ -295,12 +295,12 @@ class RevPiOption(QtWidgets.QDialog, Ui_diag_options):
|
|||||||
"color: green" if running else "color: red"
|
"color: green" if running else "color: red"
|
||||||
)
|
)
|
||||||
|
|
||||||
return super(RevPiOption, self).exec()
|
return super().exec()
|
||||||
|
|
||||||
def reject(self) -> None:
|
def reject(self) -> None:
|
||||||
"""Reject all sub windows and reload settings."""
|
"""Reject all sub windows and reload settings."""
|
||||||
self._load_settings()
|
self._load_settings()
|
||||||
super(RevPiOption, self).reject()
|
super().reject()
|
||||||
|
|
||||||
@QtCore.pyqtSlot(int)
|
@QtCore.pyqtSlot(int)
|
||||||
def on_cbb_replace_io_currentIndexChanged(self, index: int):
|
def on_cbb_replace_io_currentIndexChanged(self, index: int):
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ class RevPiPlcList(QtWidgets.QDialog, Ui_diag_connections):
|
|||||||
"""Manage your saved connections."""
|
"""Manage your saved connections."""
|
||||||
|
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
super(RevPiPlcList, self).__init__(parent)
|
super().__init__(parent)
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
self.__default_port = 55123
|
self.__default_port = 55123
|
||||||
|
|
||||||
@@ -124,7 +124,7 @@ class RevPiPlcList(QtWidgets.QDialog, Ui_diag_connections):
|
|||||||
revpi_settings.save_settings()
|
revpi_settings.save_settings()
|
||||||
|
|
||||||
self.changes = False
|
self.changes = False
|
||||||
super(RevPiPlcList, self).accept()
|
super().accept()
|
||||||
|
|
||||||
def closeEvent(self, a0: QtGui.QCloseEvent) -> None:
|
def closeEvent(self, a0: QtGui.QCloseEvent) -> None:
|
||||||
pi.logger.debug("RevPiPlcList.closeEvent")
|
pi.logger.debug("RevPiPlcList.closeEvent")
|
||||||
@@ -142,7 +142,7 @@ class RevPiPlcList(QtWidgets.QDialog, Ui_diag_connections):
|
|||||||
|
|
||||||
def exec(self) -> int:
|
def exec(self) -> int:
|
||||||
self._load_settings()
|
self._load_settings()
|
||||||
return super(RevPiPlcList, self).exec()
|
return super().exec()
|
||||||
|
|
||||||
def exec_with_presets(self, presets: RevPiSettings) -> int:
|
def exec_with_presets(self, presets: RevPiSettings) -> int:
|
||||||
"""
|
"""
|
||||||
@@ -153,7 +153,7 @@ class RevPiPlcList(QtWidgets.QDialog, Ui_diag_connections):
|
|||||||
"""
|
"""
|
||||||
self._load_settings()
|
self._load_settings()
|
||||||
self.on_btn_add_clicked(presets)
|
self.on_btn_add_clicked(presets)
|
||||||
return super(RevPiPlcList, self).exec()
|
return super().exec()
|
||||||
|
|
||||||
@QtCore.pyqtSlot(QtWidgets.QAbstractButton)
|
@QtCore.pyqtSlot(QtWidgets.QAbstractButton)
|
||||||
def on_btn_box_clicked(self, button: QtWidgets.QAbstractButton):
|
def on_btn_box_clicked(self, button: QtWidgets.QAbstractButton):
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class RevPiProgram(QtWidgets.QDialog, Ui_diag_program):
|
|||||||
"""Program options of RevPiPyLoad."""
|
"""Program options of RevPiPyLoad."""
|
||||||
|
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
super(RevPiProgram, self).__init__(parent)
|
super().__init__(parent)
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
self.setFixedSize(self.size())
|
self.setFixedSize(self.size())
|
||||||
|
|
||||||
@@ -103,7 +103,7 @@ class RevPiProgram(QtWidgets.QDialog, Ui_diag_program):
|
|||||||
def accept(self) -> None:
|
def accept(self) -> None:
|
||||||
# todo: After upload ask for restart pcl program?
|
# todo: After upload ask for restart pcl program?
|
||||||
if not self._changesdone():
|
if not self._changesdone():
|
||||||
super(RevPiProgram, self).accept()
|
super().accept()
|
||||||
return
|
return
|
||||||
|
|
||||||
if self.cbb_plcprogram.currentText() == "":
|
if self.cbb_plcprogram.currentText() == "":
|
||||||
@@ -138,7 +138,7 @@ class RevPiProgram(QtWidgets.QDialog, Ui_diag_program):
|
|||||||
)
|
)
|
||||||
|
|
||||||
if saved:
|
if saved:
|
||||||
super(RevPiProgram, self).accept()
|
super().accept()
|
||||||
else:
|
else:
|
||||||
QtWidgets.QMessageBox.critical(
|
QtWidgets.QMessageBox.critical(
|
||||||
self, self.tr("Error"), self.tr(
|
self, self.tr("Error"), self.tr(
|
||||||
@@ -174,12 +174,12 @@ class RevPiProgram(QtWidgets.QDialog, Ui_diag_program):
|
|||||||
self._load_settings()
|
self._load_settings()
|
||||||
self._apply_acl()
|
self._apply_acl()
|
||||||
|
|
||||||
return super(RevPiProgram, self).exec()
|
return super().exec()
|
||||||
|
|
||||||
def reject(self) -> None:
|
def reject(self) -> None:
|
||||||
"""Reject all sub windows and reload settings."""
|
"""Reject all sub windows and reload settings."""
|
||||||
self._load_settings()
|
self._load_settings()
|
||||||
super(RevPiProgram, self).reject()
|
super().reject()
|
||||||
|
|
||||||
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
||||||
# region # REGION: PLC program
|
# region # REGION: PLC program
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ class Simulator(QtWidgets.QDialog, Ui_diag_simulator):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
super(Simulator, self).__init__(parent)
|
super().__init__(parent)
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
self.clean_procimg = False
|
self.clean_procimg = False
|
||||||
self.max_items = 5
|
self.max_items = 5
|
||||||
@@ -69,7 +69,7 @@ class Simulator(QtWidgets.QDialog, Ui_diag_simulator):
|
|||||||
|
|
||||||
self.clean_procimg = self.sender() is self.btn_start_empty
|
self.clean_procimg = self.sender() is self.btn_start_empty
|
||||||
|
|
||||||
super(Simulator, self).accept()
|
super().accept()
|
||||||
|
|
||||||
def closeEvent(self, a0: QtGui.QCloseEvent) -> None:
|
def closeEvent(self, a0: QtGui.QCloseEvent) -> None:
|
||||||
self._save_gui()
|
self._save_gui()
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class SSHAuth(QtWidgets.QDialog, Ui_diag_sshauth):
|
|||||||
"""
|
"""
|
||||||
log.debug("SSHAuth.__init__")
|
log.debug("SSHAuth.__init__")
|
||||||
|
|
||||||
super(SSHAuth, self).__init__(parent)
|
super().__init__(parent)
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
|
|
||||||
self._in_keyring = False
|
self._in_keyring = False
|
||||||
|
|||||||
Reference in New Issue
Block a user