From de639aa1cd9096344a560ff583ea259ba61c2f85 Mon Sep 17 00:00:00 2001 From: il-palmi Date: Sun, 10 Nov 2024 22:00:58 +0100 Subject: [PATCH] Removed get_tarallo_id method and commented code --- pinolo.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/pinolo.py b/pinolo.py index 6aa8a4d..9ca6462 100644 --- a/pinolo.py +++ b/pinolo.py @@ -371,13 +371,6 @@ def get_multiple_drive_selection(self): return drives - def get_tarallo_id(self, drive: str): - for row in range(self.drivesTableView.rowCount()): - item = self.drivesTableView.item(row, DRIVES_TABLE_NAME) - if item.text() == drive: - return self.drivesTableView.item(row, DRIVES_TABLE_TARALLO_ID).text() - return None - def show_smart_data(self): rows = self.drivesTableView.selectionModel().selectedRows() if len(rows) == 0: @@ -598,8 +591,6 @@ def gui_update(self, command: str, command_data: str): "You did not enter the root password.\n" "Some commands may not work correctly.\n" "Refresh to insert the password.", dialog_type="ok" ) - # self.check_disk_usage() - def closeEvent(self, a0: QCloseEvent) -> None: """ This function is called when the window is closed. @@ -928,6 +919,18 @@ def update_data(self, command_data: List[dict]): drive.update(drive_data) continue + def get_selected_drives(self, rows: List[QModelIndex]) -> List[Drive]: + if rows is None: + return None + drives = [] + for index in rows: + drives.append(self.drives[index.row()]) + return drives + + def store_smart_data(self, command_data: dict): + for drive in self.drives: + if drive.name == command_data["disk"]: + drive.smart_data = {"output": command_data["output"], "status": command_data["status"]} def _resize_columns(self): for column in range(3):