Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fixes from new rom object #53

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions sf2000ROM.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@ 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)


"""
Note that this will change the filename as well
"""
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
Expand Down
14 changes: 11 additions & 3 deletions tadpole.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -635,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:
Expand Down