From 8a5f04b7d01869781833d9f6d6eba82b33eef1b6 Mon Sep 17 00:00:00 2001 From: jasongrieves Date: Mon, 25 Sep 2023 16:14:29 -0700 Subject: [PATCH 1/3] change names back to include extensions --- sf2000ROM.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sf2000ROM.py b/sf2000ROM.py index fffb09c..0c72b3d 100644 --- a/sf2000ROM.py +++ b/sf2000ROM.py @@ -13,7 +13,8 @@ def __init__(self, location): if not os.path.isfile(location): raise Exception self.ROMlocation = location - self.title = os.path.splitext(os.path.basename(location))[0] + #self.title = os.path.splitext(os.path.basename(location))[0] + self.title = os.path.basename(location) """ From 283ca92c0db4c84b98411df86f32442e20c3199a Mon Sep 17 00:00:00 2001 From: jasongrieves Date: Mon, 25 Sep 2023 16:55:49 -0700 Subject: [PATCH 2/3] fixing bugs --- sf2000ROM.py | 4 ++-- tadpole.py | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/sf2000ROM.py b/sf2000ROM.py index 0c72b3d..2727241 100644 --- a/sf2000ROM.py +++ b/sf2000ROM.py @@ -22,8 +22,8 @@ def __init__(self, location): """ def setTitle(self, newTitle): try: - ext = os.path.splitext(self.ROMlocation)[1] - newPath = os.path.join(os.path.dirname(self.ROMlocation),newTitle+ext) + #ext = os.path.splitext(self.ROMlocation)[1] + newPath = os.path.join(os.path.dirname(self.ROMlocation),newTitle) os.rename(self.ROMlocation, newPath) self.ROMlocation = newPath self.title = newTitle diff --git a/tadpole.py b/tadpole.py index bd0e293..c22940b 100644 --- a/tadpole.py +++ b/tadpole.py @@ -620,11 +620,19 @@ def loadMenus(self): def catchTableCellChanged(self,changedRow,changedColumn): + console = self.combobox_console.currentText() print(f"Changed Cell for ({changedRow},{changedColumn})") if self.columns[changedColumn] == self._static_columns_GameName: # Update the game name - self.ROMList[changedRow].setTitle(self.sender().itemAt(changedColumn,changedRow).text()) - + romFullName = self.sender().itemAt(changedColumn,changedRow).text() + romExt = os.path.splitext(os.path.basename(romFullName))[1] + consoleExt = frogtool.zxx_ext[console] + consoleExt = f'.' + consoleExt + if romExt != consoleExt: + QMessageBox.about(self, "Error","You can't change the extension.") + self.loadROMsToTable() + return + self.ROMList[changedRow].setTitle(romFullName) def catchTableCellClicked(self, clickedRow, clickedColumn): print(f"clicked Cell for ({clickedRow},{clickedColumn})") drive = self.combobox_drive.currentText() From ce47eda76b342441f545cf68134d2b43542c093e Mon Sep 17 00:00:00 2001 From: jasongrieves Date: Mon, 25 Sep 2023 17:02:28 -0700 Subject: [PATCH 3/3] spelling error fix in comment --- tadpole.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tadpole.py b/tadpole.py index c22940b..b969d42 100644 --- a/tadpole.py +++ b/tadpole.py @@ -643,7 +643,7 @@ def catchTableCellClicked(self, clickedRow, clickedColumn): viewThumbnail(os.path.join(drive, system, gamename.text())) elif self.tbl_gamelist.horizontalHeaderItem(clickedColumn).text() == self._static_columns_Delete: deleteROM(os.path.join(drive, system, gamename.text())) - #Only enable deleting when selcted + #Only enable deleting when games are selected if clickedColumn == 0: selected = self.tbl_gamelist.selectedItems() if selected: