diff --git a/build.bat b/build.bat index 770fc85..92fbd4f 100644 --- a/build.bat +++ b/build.bat @@ -1,5 +1,5 @@ @echo off -set ver=0.5.1 +set ver=1.0.0 rem build script for the distributable versions of tadpole if not exist "venv\" ( py -m venv venv diff --git a/tadpole.py b/tadpole.py index 1ac31f2..e9b2ae1 100644 --- a/tadpole.py +++ b/tadpole.py @@ -173,7 +173,7 @@ def __init__(self): self.btn_delete_roms = QPushButton("Delete selcted ROMs...") self.btn_delete_roms.setEnabled(False) selector_layout.addWidget(self.btn_delete_roms) - self.btn_delete_roms.clicked.connect(self.deleteROMs) + self.btn_delete_roms.clicked.connect(self.deleteAllSelectedROMs) # Game Table Widget self.tbl_gamelist = QTableWidget() @@ -336,7 +336,7 @@ def loadMenus(self): self.menu_roms.addAction(BackupAllSaves_action) # Help Menu self.menu_help = self.menuBar().addMenu("&Help") - action_sf2000_boot_light = QAction(QIcon(self.style().standardIcon(QStyle.StandardPixmap.SP_DialogSaveButton)), "Fix SF2000 not booting - Attemps to fix only the firmaware file (bisrv.asd) ", self, triggered=self.FixSF2000BootLight) + action_sf2000_boot_light = QAction(QIcon(self.style().standardIcon(QStyle.StandardPixmap.SP_DialogSaveButton)), "Fix SF2000 not booting - Attempts to fix only the firmware file (bisrv.asd) ", self, triggered=self.FixSF2000BootLight) self.menu_help.addAction(action_sf2000_boot_light) action_sf2000_boot = QAction(QIcon(self.style().standardIcon(QStyle.StandardPixmap.SP_DialogSaveButton)), "Fix SF2000 not booting - Reformats SD card and reinstalls all OS files", self, triggered=self.FixSF2000Boot) self.menu_help.addAction(action_sf2000_boot) @@ -792,11 +792,6 @@ def deleteROM(self, rom_path): if ret == qm.Yes: try: tadpole_functions.deleteROM(rom_path) - #if console == 'ARCADE': - # arcadeZIPROM = tadpole_functions.extractFileNameFromZFB(rom_path) - # arcadeZIPPath = os.path.join(drive, console, 'bin', arcadeZIPROM) - # os.remove(arcadeZIPPath) - #os.remove(rom_path) except Exception: QMessageBox.about(self, "Error","Could not delete file.") RunFrogTool(drive,console) @@ -1128,8 +1123,10 @@ def addShortcutImages(self): if os.path.exists('currentBackground.temp.png'): os.remove('currentBackground.temp.png') - # TODO this should call the existing delete function rather than doubling up - def deleteROMs(self): + """ + Action function to find all selected ROMs and delete them, then runfrogtool and reload the table + """ + def deleteAllSelectedROMs(self): drive = self.combobox_drive.currentText() console = self.combobox_console.currentText() qm = QMessageBox @@ -1141,17 +1138,12 @@ def deleteROMs(self): try: objGame = self.ROMList[item.row()] result = tadpole_functions.deleteROM(objGame.ROMlocation) - #if console == 'ARCADE': - # arcadeZIPROM = tadpole_functions.extractFileNameFromZFB(objGame.ROMlocation) - # arcadeZIPPath = os.path.join(drive, console, 'bin', arcadeZIPROM) - # os.remove(arcadeZIPPath) - #os.remove(objGame.ROMlocation) except Exception: result = False if result: - QMessageBox.about(self, "Success",f"Successfully deleted selected ROMs.") + QMessageBox.about(self, "Success",f"Successfully deleted all selected ROMs.") else: - QMessageBox.about(self, "Error","Could not delete ROM.") + QMessageBox.about(self, "Error","An error occurred while trying to delete the ROMs. PLease check the log file.") RunFrogTool(drive,console) def copyUserSelectedDirectoryButton(self): diff --git a/tadpole_functions.py b/tadpole_functions.py index fdfb1a8..3f2e937 100644 --- a/tadpole_functions.py +++ b/tadpole_functions.py @@ -898,7 +898,7 @@ def createZFBFile(drive, pngPath, romPath): return False def deleteROM(ROMfilePath): - print(f"Tadpole_functions~ Deleting ROM: {ROMfilePath}") + logging.info(f"Tadpole_functions~ Deleting ROM: {ROMfilePath}") ext = os.path.splitext(ROMfilePath)[1] if(ext == ".zfb"): #ROM is arcade, need to also delete the zip file in bin print("Arcade ROM") @@ -907,7 +907,7 @@ def deleteROM(ROMfilePath): try: os.remove(os.path.join(base,"bin",arcadezip)) except: - logging.error(f"ERROR: tadpole_functions~deleteROM: failed to delete arcadezip ({arcadezip})") + logging.error(f"ERROR: tadpole_functions~deleteROM: failed to delete arcadezip ({ROMfilePath})") # We dont return False here because the main point is to delete the provided ROMfilePath file # Delete the zxx file try: diff --git a/versioninfo b/versioninfo index bbdf264..2c4368f 100644 --- a/versioninfo +++ b/versioninfo @@ -1,7 +1,7 @@ VSVersionInfo( ffi=FixedFileInfo( - filevers=(0, 5, 1, 0), - prodvers=(0, 5, 1, 0), + filevers=(1, 0, 0, 0), + prodvers=(1, 0, 0, 0), mask=0x3f, flags=0x0, OS=0x4, @@ -15,12 +15,12 @@ VSVersionInfo( u'080904B0', [StringStruct(u'CompanyName', u'EricGoldstein'), StringStruct(u'FileDescription', u'tadpole'), - StringStruct(u'FileVersion', u'0.5.1'), + StringStruct(u'FileVersion', u'1.0.0'), StringStruct(u'InternalName', u'tadpole'), StringStruct(u'LegalCopyright', u'by EricGoldstein 2023'), StringStruct(u'OriginalFilename', u'tadpole.exe'), StringStruct(u'ProductName', u'tadpole'), - StringStruct(u'ProductVersion', u'0.5.1')]) + StringStruct(u'ProductVersion', u'1.0.0')]) ]), VarFileInfo([VarStruct(u'Translation', [2057, 1200])]) ]