diff --git a/client.py b/client.py index 6e57a81..df580e4 100644 --- a/client.py +++ b/client.py @@ -240,4 +240,4 @@ def update_host(self, line: str): else: args = "" - self.data_received.emit(cmd, args) \ No newline at end of file + self.data_received.emit(cmd, args) diff --git a/dialogs/NetworkSettings.py b/dialogs/NetworkSettings.py index cd270d6..a9072f7 100644 --- a/dialogs/NetworkSettings.py +++ b/dialogs/NetworkSettings.py @@ -208,10 +208,7 @@ def find_image(self): return image_directory = self.imagesDirectoryLineEdit.text() if image_directory == "": - warning_dialog( - "The path for the default system image is empty. Set it, plz.", - dialog_type="ok" - ) + warning_dialog("The path for the default system image is empty. Set it, plz.", dialog_type="ok") return if image_directory[-1] != "/": @@ -257,12 +254,6 @@ def __init__(self, parent: NetworkSettings): def setup(self): self.setFileName(self.gif_path) - self.setScaledSize( - QSize().scaled( - self.parent.asdLabel.width(), - self.parent.asdLabel.height(), - Qt.KeepAspectRatio - ) - ) + self.setScaledSize(QSize().scaled(self.parent.asdLabel.width(), self.parent.asdLabel.height(), Qt.KeepAspectRatio)) self.start() - self.parent.asdLabel.setMovie(self) \ No newline at end of file + self.parent.asdLabel.setMovie(self) diff --git a/pinolo.py b/pinolo.py index 9ca6462..f0b7ed3 100644 --- a/pinolo.py +++ b/pinolo.py @@ -39,6 +39,7 @@ # Linter settings from twisted.internet.interfaces import IReactorTCP + reactor: IReactorTCP @@ -311,7 +312,10 @@ def sleep(self): for drive in drives: self.send_command("queued_sleep " + drive.name) - def select_image(self, image_path: str, ): + def select_image( + self, + image_path: str, + ): self.select_system_dialog = SelectSystemDialog(self) self.send_command(f"list_iso {image_path.rstrip('/')}") if self.select_system_dialog.exec_() == QDialog.Accepted: @@ -360,10 +364,7 @@ def get_multiple_drive_selection(self): selected_rows = self.drivesTableView.selectionModel().selectedRows() if len(selected_rows) == 0: - warning_dialog( - "There are no selected drives.", - dialog_type="ok" - ) + warning_dialog("There are no selected drives.", dialog_type="ok") return None for row in selected_rows: @@ -1005,6 +1006,7 @@ def stop(self): # Integrate twisted event loop in pyqt loop import qt5reactor + qt5reactor.install() from twisted.internet import reactor diff --git a/ui/NetworkSettingsDialog.py b/ui/NetworkSettingsDialog.py index c502ebd..8954965 100644 --- a/ui/NetworkSettingsDialog.py +++ b/ui/NetworkSettingsDialog.py @@ -135,6 +135,7 @@ def retranslateUi(self, NetworkSettingsDialog): if __name__ == "__main__": import sys + app = QtWidgets.QApplication(sys.argv) NetworkSettingsDialog = QtWidgets.QDialog() ui = Ui_NetworkSettingsDialog() diff --git a/ui/SelectSystemDialog.py b/ui/SelectSystemDialog.py index 32c48f2..eef3376 100644 --- a/ui/SelectSystemDialog.py +++ b/ui/SelectSystemDialog.py @@ -46,6 +46,7 @@ def retranslateUi(self, SelectSystemDialog): if __name__ == "__main__": import sys + app = QtWidgets.QApplication(sys.argv) SelectSystemDialog = QtWidgets.QDialog() ui = Ui_SelectSystemDialog() diff --git a/ui/SmartDataDialog.py b/ui/SmartDataDialog.py index b1587a1..b9e6b12 100644 --- a/ui/SmartDataDialog.py +++ b/ui/SmartDataDialog.py @@ -71,6 +71,7 @@ def retranslateUi(self, SmartDataDialog): if __name__ == "__main__": import sys + app = QtWidgets.QApplication(sys.argv) SmartDataDialog = QtWidgets.QWidget() ui = Ui_SmartDataDialog() diff --git a/utilities.py b/utilities.py index e9dcf95..f5afe2c 100644 --- a/utilities.py +++ b/utilities.py @@ -97,6 +97,7 @@ def __init__(self): self.tabs = [] self.setTabsClosable(True) self.tabCloseRequested.connect(lambda index: self.removeTab(index)) + def add_tab(self, drive: str, status: Optional[str], uploaded: bool, text: list): widget = QtWidgets.QWidget() layout = QtWidgets.QVBoxLayout()