diff --git a/gameview.py b/gameview.py index 8f46f92..ae796f1 100644 --- a/gameview.py +++ b/gameview.py @@ -1930,14 +1930,23 @@ class GUI(QtGui.QWidget): QtGui.QApplication.clipboard().setText(self.musicItems.currentItem().text()) def onActMusicAddTriggered(self): - title, ok = QtGui.QInputDialog.getText(self, "Add new song", "Please enter a title for the song.") - if title and ok: - title.replace("=", "") - url, ok = QtGui.QInputDialog.getText(self, "Add new song", "Please enter an URL for the song.") - if url and ok: + title, ok = QtGui.QInputDialog.getText(self, "Add new song", "Please enter a title for the song. Leave this empty to add a separator that acts as music stop.") + url = QtCore.QString("") + if ok: + ok = False + if not title: + title = QtCore.QString("--------------------------") + ok = True + if not ok: + url, ok = QtGui.QInputDialog.getText(self, "Add new song", "Please enter an URL for the song.") + if ok: + title.replace("=", "-") + if ok: + if not url: + url = "~stop.mp3" with open(AO2XPpath + "music.ini", "ab") as f: f.write(("\n" + title + " = " + url).toUtf8()) - self.onActMusicRefreshTriggered() + self.onActMusicRefreshTriggered() def onActMusicEditTriggered(self): pass @@ -1958,7 +1967,6 @@ class GUI(QtGui.QWidget): if not init: self.musicItems.clear() self.loadAllMusic() - print self.musicListPrivate def onActMusicSwitchTriggered(self): self.privateMusicSelected = not self.privateMusicSelected