add music item from gui + option to edit music.ini with default editor
This commit is contained in:
		
							parent
							
								
									9bb049f7d1
								
							
						
					
					
						commit
						b3fd870981
					
				
							
								
								
									
										18
									
								
								gameview.py
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								gameview.py
									
									
									
									
									
								
							| @ -1930,11 +1930,20 @@ 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("=", "") | ||||
|         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 url and ok: | ||||
|                 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() | ||||
| @ -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 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user