more refactoring
This commit is contained in:
		
							parent
							
								
									b7ca988b13
								
							
						
					
					
						commit
						b4a5c289f8
					
				
							
								
								
									
										45
									
								
								gameview.py
									
									
									
									
									
								
							
							
						
						
									
										45
									
								
								gameview.py
									
									
									
									
									
								
							| @ -339,12 +339,13 @@ class AOCharMovie(QtGui.QLabel): | ||||
|         placeholderPath = AO2XPpath + "themes/default/oldplaceholder.gif" | ||||
|          | ||||
|         imgPath = "" | ||||
|         downloadCharacters = ini.read_ini_bool("AO2XP.ini", "General", "download characters") | ||||
|          | ||||
|         if apngPath: | ||||
|             imgPath = apngPath | ||||
|             self.usePillow = 1 | ||||
|         else: | ||||
|             if ini.read_ini_bool("AO2XP.ini", "General", "download characters"): | ||||
|             if downloadCharacters: | ||||
|                 url = "base/characters/" + pChar.lower() + "/" + emotePrefix + pEmote.lower() + ".apng" | ||||
|                 url = url.replace(" ", "%20") | ||||
|                 thread.start_new_thread(downloadThread, (url, apngPath)) | ||||
| @ -363,7 +364,7 @@ class AOCharMovie(QtGui.QLabel): | ||||
|                 imgPath = pngPath | ||||
|                 self.usePillow = 0 | ||||
|             else: | ||||
|                 if ini.read_ini_bool("AO2XP.ini", "General", "download characters"): | ||||
|                 if downloadCharacters: | ||||
|                     url = "base/characters/" + pChar.lower() + "/" + emotePrefix + pEmote.lower() + ".png" | ||||
|                     url = url.replace(" ", "%20") | ||||
|                     thread.start_new_thread(downloadThread, (url, pngPath)) | ||||
| @ -382,7 +383,7 @@ class AOCharMovie(QtGui.QLabel): | ||||
|                     imgPath = webpPath | ||||
|                     self.usePillow = 2 | ||||
|                 else: | ||||
|                     if ini.read_ini_bool("AO2XP.ini", "General", "download characters"): | ||||
|                     if downloadCharacters: | ||||
|                         url = "base/characters/" + pChar.lower() + "/"+pEmote.lower() + ".webp" | ||||
|                         url = url.replace(" ", "%20") | ||||
|                         thread.start_new_thread(downloadThread, (url, webpPath)) | ||||
| @ -401,7 +402,7 @@ class AOCharMovie(QtGui.QLabel): | ||||
|                         imgPath = gifPath | ||||
|                         self.usePillow = 0 | ||||
|                     else: | ||||
|                         if ini.read_ini_bool("AO2XP.ini", "General", "download characters"): | ||||
|                         if downloadCharacters: | ||||
|                             url = "base/characters/" + pChar.lower() + "/" + emotePrefix + pEmote.lower() + ".gif" | ||||
|                             url = url.replace(" ", "%20") | ||||
|                             thread.start_new_thread(downloadThread, (url, gifPath)) | ||||
| @ -1362,7 +1363,8 @@ class GUI(QtGui.QWidget): | ||||
|          | ||||
|         # Music list | ||||
|         self.musicItems = QtGui.QListWidget(self.tabMusic) | ||||
|         self.musicItems.itemDoubleClicked.connect(self.onMusicItemClicked) | ||||
|         self.musicItems.itemClicked.connect(self.onMusicItemClicked) | ||||
|         self.musicItems.itemDoubleClicked.connect(self.onMusicItemDoubleClicked) | ||||
|         self.musicSearch = QtGui.QLineEdit(self.tabMusic) | ||||
|         self.musicSearch.setPlaceholderText("Search...") | ||||
|         self.musicSearch.textChanged.connect(self.onMusicSearch) | ||||
| @ -1513,7 +1515,7 @@ class GUI(QtGui.QWidget): | ||||
|         self.btnObjection.clicked.connect(self.ICChatFocus) | ||||
|         self.btnHoldIt = buttons.Objections(self, 1) | ||||
|         self.btnHoldIt.clicked.connect(self.ICChatFocus) | ||||
|         self.objectSound = 0 | ||||
|         self.sndObjection = 0 | ||||
|          | ||||
|         # Judge buttons | ||||
|         self.btnDefenseBar = buttons.PenaltyBars(self, 1) | ||||
| @ -2480,6 +2482,9 @@ class GUI(QtGui.QWidget): | ||||
|         self.stopMusic() | ||||
| 
 | ||||
|     def onMusicItemClicked(self, item): | ||||
|         pass | ||||
|      | ||||
|     def onMusicItemDoubleClicked(self, item): | ||||
|         self.userPickedMusicItem = True | ||||
|         self.sendMC(self.musicList[item.text()]) | ||||
|              | ||||
| @ -3680,31 +3685,32 @@ class GUI(QtGui.QWidget): | ||||
|             charName = str(charName) | ||||
|         except: | ||||
|             print "WARNING: Can't play objection sound if charName is unicode yet" | ||||
|             return | ||||
|      | ||||
|         if self.objectSound: | ||||
|             if audio.handleIsActive(self.objectSound): | ||||
|                 audio.stopHandle(self.objectSound) | ||||
|             audio.freeHandle(self.objectSound) | ||||
|         if self.sndObjection: | ||||
|             if audio.handleIsActive(self.sndObjection): | ||||
|                 audio.stopHandle(self.sndObjection) | ||||
|             audio.freeHandle(self.sndObjection) | ||||
| 
 | ||||
|         objecting = ["holdit", "objection", "takethat", "custom"][objection-1] | ||||
|          | ||||
|         if objecting: | ||||
|             if exists(AOpath + 'characters/' + charName + '/' + objecting + '.wav'): | ||||
|                 self.objectSound = audio.loadHandle(False, AOpath + 'characters/' + charName + '/' + objecting + '.wav', 0, 0, 0) | ||||
|                 self.sndObjection = audio.loadHandle(False, AOpath + 'characters/' + charName + '/' + objecting + '.wav', 0, 0, 0) | ||||
|             elif exists(AOpath + 'characters/' + charName + '/' + objecting + '.opus'): | ||||
|                 self.objectSound = audio.loadHandle(False, AOpath + 'characters/' + charName + '/' + objecting + '.opus', 0, 0, 0) | ||||
|                 self.sndObjection = audio.loadHandle(False, AOpath + 'characters/' + charName + '/' + objecting + '.opus', 0, 0, 0) | ||||
|             else: | ||||
|                 self.objectSound = None | ||||
|                 self.sndObjection = None | ||||
|                 if ini.read_ini_bool("AO2XP.ini", "General", "download sounds", True): | ||||
|                     thread.start_new_thread(downloadThread, ("base/characters/"+charName+"/"+objecting+".wav", AOpath + "characters/"+charName+"/"+objecting.lower() + ".wav")) | ||||
|                     thread.start_new_thread(downloadThread, ("base/characters/"+charName+"/"+objecting+".opus", AOpath + "characters/"+charName+"/"+objecting.lower() + ".wav")) | ||||
| 
 | ||||
|                 if exists(AOpath + 'sounds/general/sfx-objection.opus'): | ||||
|                     self.objectSound = audio.loadHandle(False, AOpath + 'sounds/general/sfx-objection.opus', 0, 0, 0) | ||||
|                     self.sndObjection = audio.loadHandle(False, AOpath + 'sounds/general/sfx-objection.opus', 0, 0, 0) | ||||
|                 else: | ||||
|                     self.objectSound = audio.loadHandle(False, AOpath + 'sounds/general/sfx-objection.wav', 0, 0, 0) | ||||
|             audio.setHandleAttr(self.objectSound, BASS_ATTRIB_VOL, self.sliSoundVolume.value() / 100.0) | ||||
|             audio.playHandle(self.objectSound, True) | ||||
|                     self.sndObjection = audio.loadHandle(False, AOpath + 'sounds/general/sfx-objection.wav', 0, 0, 0) | ||||
|             audio.setHandleAttr(self.sndObjection, BASS_ATTRIB_VOL, self.sliSoundVolume.value() / 100.0) | ||||
|             audio.playHandle(self.sndObjection, True) | ||||
|      | ||||
|     def playSfx(self): | ||||
|         sfxName = self.mChatMessage[SFX] | ||||
| @ -4204,5 +4210,6 @@ class GUI(QtGui.QWidget): | ||||
|                     self.areaItems.item(i).setIcon(QtGui.QIcon(AO2XPpath + "icons/" + "lock.png")) | ||||
|                 else: | ||||
|                     self.areaItems.item(i).setIcon(QtGui.QIcon(AO2XPpath + "icons/" + "house.png")) | ||||
|         except: | ||||
|             print "[debug] Couldn't update areas" | ||||
|         except Exception as e: | ||||
|             print "[debug] Couldn't update areas. Details:" | ||||
|             print "[debug]", e | ||||
							
								
								
									
										463
									
								
								options.py
									
									
									
									
									
								
							
							
						
						
									
										463
									
								
								options.py
									
									
									
									
									
								
							| @ -25,33 +25,33 @@ class Settings(QtGui.QDialog): | ||||
|         self.setWindowFlags(QtCore.Qt.WindowCloseButtonHint) | ||||
|         self.hide() | ||||
|          | ||||
|         main_layout = QtGui.QVBoxLayout(self) | ||||
|         save_layout = QtGui.QHBoxLayout() | ||||
|         layMain = QtGui.QVBoxLayout(self) | ||||
|         laySave = QtGui.QHBoxLayout() | ||||
|          | ||||
|         self.tabs = QtGui.QTabWidget() | ||||
|         self.tabs.resize(320-16, 480-40) | ||||
|         self.tabs.move(8, 8) | ||||
|          | ||||
|         general_tab = QtGui.QWidget() | ||||
|         audio_tab = QtGui.QWidget() | ||||
|         callwords_tab = QtGui.QWidget() | ||||
|         general_layout = QtGui.QVBoxLayout(general_tab) | ||||
|         general_layout.setAlignment(QtCore.Qt.AlignTop) | ||||
|         audio_layout = QtGui.QFormLayout(audio_tab) | ||||
|         audio_layout.setLabelAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter) | ||||
|         audio_layout.setFormAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignLeft | QtCore.Qt.AlignTop) | ||||
|         callwords_layout = QtGui.QVBoxLayout(callwords_tab) | ||||
|         callwords_layout.setAlignment(QtCore.Qt.AlignTop) | ||||
|         tabGeneral = QtGui.QWidget() | ||||
|         tabAudio = QtGui.QWidget() | ||||
|         tabCallwords = QtGui.QWidget() | ||||
|         layGeneral = QtGui.QVBoxLayout(tabGeneral) | ||||
|         layGeneral.setAlignment(QtCore.Qt.AlignTop) | ||||
|         layAudio = QtGui.QFormLayout(tabAudio) | ||||
|         layAudio.setLabelAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter) | ||||
|         layAudio.setFormAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignLeft | QtCore.Qt.AlignTop) | ||||
|         layCallwords = QtGui.QVBoxLayout(tabCallwords) | ||||
|         layCallwords.setAlignment(QtCore.Qt.AlignTop) | ||||
|          | ||||
|         self.savebtn = QtGui.QPushButton() | ||||
|         self.savebtn.setText("Save") | ||||
|         self.savebtn.clicked.connect(self.onSaveClicked) | ||||
|         self.cancelbtn = QtGui.QPushButton() | ||||
|         self.cancelbtn.setText("Cancel") | ||||
|         self.cancelbtn.clicked.connect(self.onCancelClicked) | ||||
|         self.aboutbtn = QtGui.QPushButton() | ||||
|         self.aboutbtn.setText("About...") | ||||
|         self.aboutbtn.clicked.connect(self.onAboutClicked) | ||||
|         self.btnSave = QtGui.QPushButton() | ||||
|         self.btnSave.setText("Save") | ||||
|         self.btnSave.clicked.connect(self.onSaveClicked) | ||||
|         self.btnCancel = QtGui.QPushButton() | ||||
|         self.btnCancel.setText("Cancel") | ||||
|         self.btnCancel.clicked.connect(self.onCancelClicked) | ||||
|         self.btnAbout = QtGui.QPushButton() | ||||
|         self.btnAbout.setText("About...") | ||||
|         self.btnAbout.clicked.connect(self.onAboutClicked) | ||||
|          | ||||
|         separators = [] | ||||
|         for i in range(5): | ||||
| @ -60,279 +60,280 @@ class Settings(QtGui.QDialog): | ||||
|             separators.append(separator) | ||||
|          | ||||
|         ###### General tab ###### | ||||
|         defaultoocname_layout = QtGui.QHBoxLayout() | ||||
|         defaultoocname_label = QtGui.QLabel("Default OOC name") | ||||
|         self.defaultoocname = QtGui.QLineEdit() | ||||
|         defaultoocname_layout.addWidget(defaultoocname_label) | ||||
|         defaultoocname_layout.addWidget(self.defaultoocname) | ||||
|         layDefaultOOCName = QtGui.QHBoxLayout() | ||||
|         lblDefaultOOCName = QtGui.QLabel("Default OOC name") | ||||
|         self.defaultOOCName = QtGui.QLineEdit() | ||||
|         layDefaultOOCName.addWidget(lblDefaultOOCName) | ||||
|         layDefaultOOCName.addWidget(self.defaultOOCName) | ||||
| 
 | ||||
|         defaultshowname_label = QtGui.QLabel("Default showname") | ||||
|         self.defaultshowname = QtGui.QLineEdit() | ||||
|         defaultoocname_layout.addWidget(defaultshowname_label) | ||||
|         defaultoocname_layout.addWidget(self.defaultshowname) | ||||
|         lblDefaultShowname = QtGui.QLabel("Default showname") | ||||
|         self.defaultShowname = QtGui.QLineEdit() | ||||
|         layDefaultOOCName.addWidget(lblDefaultShowname) | ||||
|         layDefaultOOCName.addWidget(self.defaultShowname) | ||||
|          | ||||
|         savetolog_layout = QtGui.QHBoxLayout() | ||||
|         self.savetolog = QtGui.QCheckBox() | ||||
|         self.savetolog.setText("Save chat logs to a file") | ||||
|         self.savetolog.setChecked(False) | ||||
|         self.savetolog_combine = QtGui.QCheckBox() | ||||
|         self.savetolog_combine.setText("Combine OOC and IC chat logs in the same file") | ||||
|         self.savetolog_combine.setChecked(False) | ||||
|         savetolog_layout.addWidget(self.savetolog) | ||||
|         savetolog_layout.addWidget(self.savetolog_combine) | ||||
|         laySaveToLog = QtGui.QHBoxLayout() | ||||
|         self.cbSaveToLog = QtGui.QCheckBox() | ||||
|         self.cbSaveToLog.setText("Save chat logs to a file") | ||||
|         self.cbSaveToLog.setChecked(False) | ||||
|         self.cbCombineLogs = QtGui.QCheckBox() | ||||
|         self.cbCombineLogs.setText("Combine OOC and IC chat logs in the same file") | ||||
|         self.cbCombineLogs.setChecked(False) | ||||
|         laySaveToLog.addWidget(self.cbSaveToLog) | ||||
|         laySaveToLog.addWidget(self.cbCombineLogs) | ||||
|          | ||||
|         savedemos_layout = QtGui.QHBoxLayout() | ||||
|         self.savedemos = QtGui.QCheckBox() | ||||
|         self.savedemos.setText("Record demo files") | ||||
|         self.savedemos.setChecked(False) | ||||
|         savedemos_layout.addWidget(self.savedemos) | ||||
|         laySaveDemos = QtGui.QHBoxLayout() | ||||
|         self.cbSaveDemos = QtGui.QCheckBox() | ||||
|         self.cbSaveDemos.setText("Record demo files") | ||||
|         self.cbSaveDemos.setChecked(False) | ||||
|         laySaveDemos.addWidget(self.cbSaveDemos) | ||||
|                  | ||||
|         textstaytime_layout = QtGui.QHBoxLayout() | ||||
|         textstaytime_label = QtGui.QLabel("Text stay time (milliseconds)") | ||||
|         self.textstaytime = QtGui.QSpinBox() | ||||
|         self.textstaytime.setMinimum(0) | ||||
|         self.textstaytime.setMaximum(10000) | ||||
|         textstaytime_layout.addWidget(textstaytime_label) | ||||
|         textstaytime_layout.addWidget(self.textstaytime) | ||||
|         layTextStayTime = QtGui.QHBoxLayout() | ||||
|         lblTextStayTime = QtGui.QLabel("Text stay time (milliseconds)") | ||||
|         self.sbTextStayTime = QtGui.QSpinBox() | ||||
|         self.sbTextStayTime.setMinimum(0) | ||||
|         self.sbTextStayTime.setMaximum(10000) | ||||
|         layTextStayTime.addWidget(lblTextStayTime) | ||||
|         layTextStayTime.addWidget(self.sbTextStayTime) | ||||
|          | ||||
|         slide_layout = QtGui.QHBoxLayout() | ||||
|         self.enableslide = QtGui.QCheckBox() | ||||
|         self.enableslide.setText("(Experimental) Display courtroom slide (pan-tilt) animations") | ||||
|         self.enableslide.setChecked(True) | ||||
|         slide_layout.addWidget(self.enableslide) | ||||
|         laySlide = QtGui.QHBoxLayout() | ||||
|         self.cbEnableSlide = QtGui.QCheckBox() | ||||
|         self.cbEnableSlide.setText("(Experimental) Display courtroom slide (pan-tilt) animations") | ||||
|         self.cbEnableSlide.setChecked(True) | ||||
|         laySlide.addWidget(self.cbEnableSlide) | ||||
| 
 | ||||
|         allowdownload = QtGui.QLabel() | ||||
|         allowdownload.setText("Automatically download or stream online from WebAO:") | ||||
|         allowdownload_layout = QtGui.QHBoxLayout() | ||||
|         self.allowdownload_chars = QtGui.QCheckBox("Characters") | ||||
|         self.allowdownload_sounds = QtGui.QCheckBox("Sounds") | ||||
|         self.allowdownload_music = QtGui.QCheckBox("Music") | ||||
|         self.allowdownload_evidence = QtGui.QCheckBox("Evidence") | ||||
|         allowdownload_layout.addWidget(self.allowdownload_chars) | ||||
|         allowdownload_layout.addWidget(self.allowdownload_sounds) | ||||
|         allowdownload_layout.addWidget(self.allowdownload_music) | ||||
|         allowdownload_layout.addWidget(self.allowdownload_evidence) | ||||
| 
 | ||||
|         currtheme_layout = QtGui.QHBoxLayout() | ||||
|         currtheme_label = QtGui.QLabel("Current theme") | ||||
|         self.currtheme = QtGui.QComboBox() | ||||
|         layTheme = QtGui.QHBoxLayout() | ||||
|         lblTheme = QtGui.QLabel("Current theme") | ||||
|         self.cbThemes = QtGui.QComboBox() | ||||
|         self.themes = listdir(AO2XPpath + "ao2xp_themes") | ||||
|         for theme in self.themes: | ||||
|             if exists(AO2XPpath + "ao2xp_themes/"+theme+"/theme.py"): | ||||
|                 self.currtheme.addItem(theme) | ||||
|         currtheme_layout.addWidget(currtheme_label) | ||||
|         currtheme_layout.addWidget(self.currtheme) | ||||
|                 self.cbThemes.addItem(theme) | ||||
|         layTheme.addWidget(lblTheme) | ||||
|         layTheme.addWidget(self.cbThemes) | ||||
|          | ||||
|         autoconnect_layout = QtGui.QHBoxLayout() | ||||
|         autoconnect_label = QtGui.QLabel("Connect automatically to this server") | ||||
|         self.autoconnect = QtGui.QComboBox() | ||||
|         layAutoConnect = QtGui.QHBoxLayout() | ||||
|         lblAutoConnect = QtGui.QLabel("Connect automatically to this server") | ||||
|         self.cbServers = QtGui.QComboBox() | ||||
|         layAutoConnect.addWidget(lblAutoConnect) | ||||
|         layAutoConnect.addWidget(self.cbServers) | ||||
| 
 | ||||
|         autopick_layout = QtGui.QHBoxLayout() | ||||
|         autopick_label = QtGui.QLabel("Pick this character automatically on join") | ||||
|         self.autopick = QtGui.QComboBox() | ||||
|         for folder in listdir(unicode(AOpath + 'characters')): | ||||
|             if exists(AOpath + 'characters/' + folder + '/char.ini'): | ||||
|                 self.autopick.addItem(folder) | ||||
|         self.autopick.setEditable(1) | ||||
| 
 | ||||
|         autopick_layout.addWidget(autopick_label) | ||||
|         autopick_layout.addWidget(self.autopick) | ||||
| 
 | ||||
|         autojoinarea_layout = QtGui.QHBoxLayout() | ||||
|         autojoinarea_label = QtGui.QLabel("Go to this area automatically on join") | ||||
|         self.autojoinarea = QtGui.QLineEdit() | ||||
|         autojoinarea_layout.addWidget(autojoinarea_label) | ||||
|         autojoinarea_layout.addWidget(self.autojoinarea) | ||||
| 
 | ||||
|         self.autoconnect.addItem("Always show server list") | ||||
|         self.cbServers.addItem("Always show server list") | ||||
|         if exists('serverlist.txt'): | ||||
|             with open('serverlist.txt') as file: | ||||
|                 for server in [line.rstrip().split(':') for line in file]: | ||||
|                     self.autoconnect.addItem(server[-1]) | ||||
|         autoconnect_layout.addWidget(autoconnect_label) | ||||
|         autoconnect_layout.addWidget(self.autoconnect) | ||||
|                     self.cbServers.addItem(server[-1]) | ||||
| 
 | ||||
|         update_layout = QtGui.QHBoxLayout() | ||||
|         self.check_updates = QtGui.QCheckBox("Check for AO2XP updates on startup") | ||||
|         self.check_updates_btn = QtGui.QPushButton() | ||||
|         self.check_updates_btn.setText("Check now...") | ||||
|         self.check_updates_btn.clicked.connect(self.onUpdateClicked) | ||||
|         update_layout.addWidget(self.check_updates) | ||||
|         update_layout.addWidget(self.check_updates_btn) | ||||
|         layAutoPick = QtGui.QHBoxLayout() | ||||
|         lblAutoPick = QtGui.QLabel("Pick this character automatically on join") | ||||
|         self.cbCharacters = QtGui.QComboBox() | ||||
|         for folder in listdir(unicode(AOpath + 'characters')): | ||||
|             if exists(AOpath + 'characters/' + folder + '/char.ini'): | ||||
|                 self.cbCharacters.addItem(folder) | ||||
|         self.cbCharacters.setEditable(1) | ||||
|         layAutoPick.addWidget(lblAutoPick) | ||||
|         layAutoPick.addWidget(self.cbCharacters) | ||||
| 
 | ||||
|         general_layout.addLayout(defaultoocname_layout) | ||||
|         general_layout.addLayout(savetolog_layout) | ||||
|         general_layout.addLayout(savedemos_layout) | ||||
|         general_layout.addWidget(separators[0]) | ||||
|         general_layout.addLayout(textstaytime_layout) | ||||
|         general_layout.addLayout(slide_layout) | ||||
|         general_layout.addWidget(separators[1]) | ||||
|         general_layout.addLayout(currtheme_layout) | ||||
|         general_layout.addLayout(autoconnect_layout) | ||||
|         general_layout.addLayout(autopick_layout) | ||||
|         general_layout.addLayout(autojoinarea_layout) | ||||
|         general_layout.addWidget(separators[2]) | ||||
|         general_layout.addWidget(allowdownload) | ||||
|         general_layout.addLayout(allowdownload_layout) | ||||
|         general_layout.addWidget(separators[3]) | ||||
|         general_layout.addLayout(update_layout) | ||||
|         layAutoJoinArea = QtGui.QHBoxLayout() | ||||
|         lblAutoJoinArea = QtGui.QLabel("Go to this area automatically on join") | ||||
|         self.autoJoinArea = QtGui.QLineEdit() | ||||
|         layAutoJoinArea.addWidget(lblAutoJoinArea) | ||||
|         layAutoJoinArea.addWidget(self.autoJoinArea) | ||||
|          | ||||
|         lblDownloads = QtGui.QLabel() | ||||
|         lblDownloads.setText("Automatically download or stream online from WebAO:") | ||||
|         layDownloads = QtGui.QHBoxLayout() | ||||
|         self.cbDownloadChars = QtGui.QCheckBox("Characters") | ||||
|         self.cbDownloadSounds = QtGui.QCheckBox("Sounds") | ||||
|         self.cbDownloadMusic = QtGui.QCheckBox("Music") | ||||
|         self.cbDownloadEvidence = QtGui.QCheckBox("Evidence") | ||||
|         layDownloads.addWidget(self.cbDownloadChars) | ||||
|         layDownloads.addWidget(self.cbDownloadSounds) | ||||
|         layDownloads.addWidget(self.cbDownloadMusic) | ||||
|         layDownloads.addWidget(self.cbDownloadEvidence) | ||||
| 
 | ||||
|         layUpdate = QtGui.QHBoxLayout() | ||||
|         self.cbCheckUpdates = QtGui.QCheckBox("Check for AO2XP updates on startup") | ||||
|         self.btnCheckUpdatesNow = QtGui.QPushButton() | ||||
|         self.btnCheckUpdatesNow.setText("Check now...") | ||||
|         self.btnCheckUpdatesNow.clicked.connect(self.onUpdateClicked) | ||||
|         layUpdate.addWidget(self.cbCheckUpdates) | ||||
|         layUpdate.addWidget(self.btnCheckUpdatesNow) | ||||
|          | ||||
|         layGeneral.addLayout(layDefaultOOCName) | ||||
|         layGeneral.addLayout(laySaveToLog) | ||||
|         layGeneral.addLayout(laySaveDemos) | ||||
|         layGeneral.addWidget(separators[0]) | ||||
|         layGeneral.addLayout(layTextStayTime) | ||||
|         layGeneral.addLayout(laySlide) | ||||
|         layGeneral.addWidget(separators[1]) | ||||
|         layGeneral.addLayout(layTheme) | ||||
|         layGeneral.addLayout(layAutoConnect) | ||||
|         layGeneral.addLayout(layAutoPick) | ||||
|         layGeneral.addLayout(layAutoJoinArea) | ||||
|         layGeneral.addWidget(separators[2]) | ||||
|         layGeneral.addWidget(lblDownloads) | ||||
|         layGeneral.addLayout(layDownloads) | ||||
|         layGeneral.addWidget(separators[3]) | ||||
|         layGeneral.addLayout(layUpdate) | ||||
| 
 | ||||
|         ###### Audio tab ###### | ||||
|         device_label = QtGui.QLabel("Audio device") | ||||
|         self.device_list = QtGui.QComboBox() | ||||
|         audio_layout.setWidget(0, QtGui.QFormLayout.LabelRole, device_label) | ||||
|         audio_layout.setWidget(0, QtGui.QFormLayout.FieldRole, self.device_list) | ||||
|         audio_layout.setWidget(1, QtGui.QFormLayout.FieldRole, separators[4]) | ||||
|         lblAudioDevice = QtGui.QLabel("Audio device") | ||||
|         self.cbDevices = QtGui.QComboBox() | ||||
|         layAudio.setWidget(0, QtGui.QFormLayout.LabelRole, lblAudioDevice) | ||||
|         layAudio.setWidget(0, QtGui.QFormLayout.FieldRole, self.cbDevices) | ||||
|         layAudio.setWidget(1, QtGui.QFormLayout.FieldRole, separators[4]) | ||||
| 
 | ||||
|         volumelabel = QtGui.QLabel("Sound volume") | ||||
|         musiclabel = QtGui.QLabel("Music") | ||||
|         soundlabel = QtGui.QLabel("Sounds") | ||||
|         bliplabel = QtGui.QLabel("Blips") | ||||
|         lblMusicVolume = QtGui.QLabel("Music") | ||||
|         lblSoundVolume = QtGui.QLabel("Sounds") | ||||
|         lblBlipsVolume = QtGui.QLabel("Blips") | ||||
|         self.sliMusicVolume = QtGui.QSlider(QtCore.Qt.Horizontal, self) | ||||
|         self.sliSoundVolume = QtGui.QSlider(QtCore.Qt.Horizontal, self) | ||||
|         self.sliBlipsVolume = QtGui.QSlider(QtCore.Qt.Horizontal, self) | ||||
|         self.sliMusicVolume.setRange(0, 100) | ||||
|         self.sliSoundVolume.setRange(0, 100) | ||||
|         self.sliBlipsVolume.setRange(0, 100) | ||||
|         audio_layout.setWidget(2, QtGui.QFormLayout.LabelRole, musiclabel) | ||||
|         audio_layout.setWidget(2, QtGui.QFormLayout.FieldRole, self.sliMusicVolume) | ||||
|         audio_layout.setWidget(3, QtGui.QFormLayout.LabelRole, soundlabel) | ||||
|         audio_layout.setWidget(3, QtGui.QFormLayout.FieldRole, self.sliSoundVolume) | ||||
|         audio_layout.setWidget(4, QtGui.QFormLayout.LabelRole, bliplabel) | ||||
|         audio_layout.setWidget(4, QtGui.QFormLayout.FieldRole, self.sliBlipsVolume) | ||||
|         layAudio.setWidget(2, QtGui.QFormLayout.LabelRole, lblMusicVolume) | ||||
|         layAudio.setWidget(2, QtGui.QFormLayout.FieldRole, self.sliMusicVolume) | ||||
|         layAudio.setWidget(3, QtGui.QFormLayout.LabelRole, lblSoundVolume) | ||||
|         layAudio.setWidget(3, QtGui.QFormLayout.FieldRole, self.sliSoundVolume) | ||||
|         layAudio.setWidget(4, QtGui.QFormLayout.LabelRole, lblBlipsVolume) | ||||
|         layAudio.setWidget(4, QtGui.QFormLayout.FieldRole, self.sliBlipsVolume) | ||||
| 
 | ||||
|         self.reloadaudio = QtGui.QPushButton(text="Reload audio system") | ||||
|         self.reloadaudio.clicked.connect(self.onReloadAudio) | ||||
|         audio_layout.setWidget(5, QtGui.QFormLayout.FieldRole, self.reloadaudio) | ||||
|         self.btnReloadAudioSystem = QtGui.QPushButton(text="Reload audio system") | ||||
|         self.btnReloadAudioSystem.clicked.connect(self.onReloadAudioSystemClicked) | ||||
|         layAudio.setWidget(5, QtGui.QFormLayout.FieldRole, self.btnReloadAudioSystem) | ||||
| 
 | ||||
|         for device in audio.getDevices(): | ||||
|             self.device_list.addItem(device) | ||||
|             self.cbDevices.addItem(device) | ||||
| 
 | ||||
|         ###### Callwords tab ###### | ||||
|         self.callwords_edit = QtGui.QTextEdit() | ||||
|         self.callwords = QtGui.QTextEdit() | ||||
|          | ||||
|         callwords_wordwrap = QtGui.QCheckBox("Word Wrap") | ||||
|         callwords_wordwrap.setChecked(True) | ||||
|         callwords_wordwrap.stateChanged.connect(self.callwordsWordWrapCheckbox) | ||||
|         cbCallwordsWordWrap = QtGui.QCheckBox("Word Wrap") | ||||
|         cbCallwordsWordWrap.setChecked(True) | ||||
|         cbCallwordsWordWrap.stateChanged.connect(self.callwordsWordWrapCheckbox) | ||||
|          | ||||
|         callwords_instructions = QtGui.QLabel() | ||||
|         callwords_instructions.setText("Separate callwords with newlines (ENTER key).") | ||||
|         cbCallwordsInstructions = QtGui.QLabel() | ||||
|         cbCallwordsInstructions.setText("Separate callwords with newlines (ENTER key).") | ||||
|          | ||||
|         callwords_layout.addWidget(self.callwords_edit) | ||||
|         callwords_layout.addWidget(callwords_wordwrap, 0, QtCore.Qt.AlignRight) | ||||
|         callwords_layout.addWidget(callwords_instructions) | ||||
|         layCallwords.addWidget(self.callwords) | ||||
|         layCallwords.addWidget(cbCallwordsWordWrap, 0, QtCore.Qt.AlignRight) | ||||
|         layCallwords.addWidget(cbCallwordsInstructions) | ||||
|          | ||||
|         self.tabs.addTab(general_tab, "General") | ||||
|         self.tabs.addTab(audio_tab, "Audio") | ||||
|         self.tabs.addTab(callwords_tab, "Callwords") | ||||
|         ### Main settings window | ||||
|          | ||||
|         save_layout.addWidget(self.savebtn, 100, QtCore.Qt.AlignRight) | ||||
|         save_layout.addWidget(self.cancelbtn, 0, QtCore.Qt.AlignRight) | ||||
|         save_layout.addWidget(self.aboutbtn, 0, QtCore.Qt.AlignLeft) | ||||
|         main_layout.addWidget(self.tabs) | ||||
|         main_layout.addLayout(save_layout) | ||||
|         self.tabs.addTab(tabGeneral, "General") | ||||
|         self.tabs.addTab(tabAudio, "Audio") | ||||
|         self.tabs.addTab(tabCallwords, "Callwords") | ||||
|          | ||||
|         self.savebtn.setFocus() | ||||
|         laySave.addWidget(self.btnSave, 100, QtCore.Qt.AlignRight) | ||||
|         laySave.addWidget(self.btnCancel, 0, QtCore.Qt.AlignRight) | ||||
|         laySave.addWidget(self.btnAbout, 0, QtCore.Qt.AlignLeft) | ||||
|         layMain.addWidget(self.tabs) | ||||
|         layMain.addLayout(laySave) | ||||
|          | ||||
|         # If they're different from the respective checkbox on save, tell the gui to start/stop logging | ||||
|         self.savelogs_state = False | ||||
|         self.combinelogs_state = False | ||||
|         self.savedemos_state = False | ||||
|         self.theme_state = "" | ||||
|         self.btnSave.setFocus() | ||||
|          | ||||
|         # If they're different from the respective checkbox on save, tell the | ||||
|         # gui to start/stop logging | ||||
|         self.saveLogsState = False | ||||
|         self.combineLogsState = False | ||||
|         self.saveDemosState = False | ||||
|         self.themeState = "" | ||||
|      | ||||
|     def showSettings(self): | ||||
|         if exists("AO2XP.ini"): | ||||
|             self.inifile.read("AO2XP.ini") | ||||
|             self.savetolog.setChecked(ini.read_ini_bool(self.inifile, "General", "save logs", False)) | ||||
|             self.savetolog_combine.setChecked(ini.read_ini_bool(self.inifile, "General", "combined logs", False)) | ||||
|             self.savedemos.setChecked(ini.read_ini_bool(self.inifile, "General", "record demos", False)) | ||||
|             self.cbSaveToLog.setChecked(ini.read_ini_bool(self.inifile, "General", "save logs", False)) | ||||
|             self.cbCombineLogs.setChecked(ini.read_ini_bool(self.inifile, "General", "combined logs", False)) | ||||
|             self.cbSaveDemos.setChecked(ini.read_ini_bool(self.inifile, "General", "record demos", False)) | ||||
|             try: | ||||
|                 self.defaultoocname.setText(ini.read_ini(self.inifile, "General", "OOC name").decode("utf-8")) | ||||
|                 self.defaultOOCName.setText(ini.read_ini(self.inifile, "General", "OOC name").decode("utf-8")) | ||||
|             except: | ||||
|                 self.defaultoocname.setText(ini.read_ini(self.inifile, "General", "OOC name")) | ||||
|                 self.defaultOOCName.setText(ini.read_ini(self.inifile, "General", "OOC name")) | ||||
|             try: | ||||
|                 self.defaultshowname.setText(ini.read_ini(self.inifile, "General", "showname").decode("utf-8")) | ||||
|                 self.defaultShowname.setText(ini.read_ini(self.inifile, "General", "showname").decode("utf-8")) | ||||
|             except: | ||||
|                 self.defaultshowname.setText(ini.read_ini(self.inifile, "General", "showname")) | ||||
|             self.enableslide.setChecked(ini.read_ini_bool(self.inifile, "General", "slide", False)) | ||||
|             self.allowdownload_chars.setChecked(ini.read_ini_bool(self.inifile, "General", "download characters", False)) | ||||
|             self.allowdownload_sounds.setChecked(ini.read_ini_bool(self.inifile, "General", "download sounds", False)) | ||||
|             self.allowdownload_music.setChecked(ini.read_ini_bool(self.inifile, "General", "download music")) | ||||
|             self.allowdownload_evidence.setChecked(ini.read_ini_bool(self.inifile, "General", "download evidence", False)) | ||||
|             self.currtheme.setCurrentIndex(self.themes.index(ini.read_ini(self.inifile, "General", "theme", "default"))) | ||||
|             self.autoconnect.setCurrentIndex(ini.read_ini_int(self.inifile, "General", "auto connect", -1) + 1) | ||||
|             self.autopick.setEditText(ini.read_ini(self.inifile, "General", "auto pick").decode('utf-8')) | ||||
|             self.autojoinarea.setText(ini.read_ini(self.inifile, "General", "auto join area").decode('utf-8')) | ||||
|             self.textstaytime.setValue(ini.read_ini_int(self.inifile, "General", "text stay time", 200)) | ||||
|                 self.defaultShowname.setText(ini.read_ini(self.inifile, "General", "showname")) | ||||
|             self.cbEnableSlide.setChecked(ini.read_ini_bool(self.inifile, "General", "slide", False)) | ||||
|             self.cbDownloadChars.setChecked(ini.read_ini_bool(self.inifile, "General", "download characters", False)) | ||||
|             self.cbDownloadSounds.setChecked(ini.read_ini_bool(self.inifile, "General", "download sounds", False)) | ||||
|             self.cbDownloadMusic.setChecked(ini.read_ini_bool(self.inifile, "General", "download music")) | ||||
|             self.cbDownloadEvidence.setChecked(ini.read_ini_bool(self.inifile, "General", "download evidence", False)) | ||||
|             self.cbThemes.setCurrentIndex(self.themes.index(ini.read_ini(self.inifile, "General", "theme", "default"))) | ||||
|             self.cbServers.setCurrentIndex(ini.read_ini_int(self.inifile, "General", "auto connect", -1) + 1) | ||||
|             self.cbCharacters.setEditText(ini.read_ini(self.inifile, "General", "auto pick").decode('utf-8')) | ||||
|             self.autoJoinArea.setText(ini.read_ini(self.inifile, "General", "auto join area").decode('utf-8')) | ||||
|             self.sbTextStayTime.setValue(ini.read_ini_int(self.inifile, "General", "text stay time", 200)) | ||||
| 
 | ||||
|             self.check_updates.setChecked(ini.read_ini_bool(self.inifile, "General", "install updates", False)) # Automatic updates are opt-in! | ||||
|             self.cbCheckUpdates.setChecked(ini.read_ini_bool(self.inifile, "General", "install updates", False)) # Automatic updates are opt-in! | ||||
| 
 | ||||
|             self.device_list.setCurrentIndex(ini.read_ini_int(self.inifile, "Audio", "device", audio.getCurrDevice())) | ||||
|             self.cbDevices.setCurrentIndex(ini.read_ini_int(self.inifile, "Audio", "device", audio.getCurrDevice())) | ||||
|             self.sliMusicVolume.setValue(ini.read_ini_int(self.inifile, "Audio", "Music volume", 100)) | ||||
|             self.sliSoundVolume.setValue(ini.read_ini_int(self.inifile, "Audio", "Sound volume", 100)) | ||||
|             self.sliBlipsVolume.setValue(ini.read_ini_int(self.inifile, "Audio", "Blip volume", 100)) | ||||
|         else: | ||||
|             self.savetolog.setChecked(False) | ||||
|             self.savetolog_combine.setChecked(False) | ||||
|             self.savedemos.setChecked(False) | ||||
|             self.defaultoocname.setText("") | ||||
|             self.defaultshowname.setText("") | ||||
|             self.enableslide.setChecked(False) | ||||
|             self.allowdownload_sounds.setChecked(True) | ||||
|             self.allowdownload_music.setChecked(True) | ||||
|             self.allowdownload_evidence.setChecked(True) | ||||
|             self.currtheme.setCurrentIndex(self.themes.index("default")) | ||||
|             self.check_updates.setChecked(False) | ||||
|             self.textstaytime.setValue(200) | ||||
|             self.autopick.setEditText("") | ||||
|             self.autojoinarea.setText("") | ||||
|             self.cbSaveToLog.setChecked(False) | ||||
|             self.cbCombineLogs.setChecked(False) | ||||
|             self.cbSaveDemos.setChecked(False) | ||||
|             self.defaultOOCName.setText("") | ||||
|             self.defaultShowname.setText("") | ||||
|             self.cbEnableSlide.setChecked(False) | ||||
|             self.cbDownloadSounds.setChecked(True) | ||||
|             self.cbDownloadMusic.setChecked(True) | ||||
|             self.cbDownloadEvidence.setChecked(True) | ||||
|             self.cbThemes.setCurrentIndex(self.themes.index("default")) | ||||
|             self.cbCheckUpdates.setChecked(False) | ||||
|             self.sbTextStayTime.setValue(200) | ||||
|             self.cbCharacters.setEditText("") | ||||
|             self.autoJoinArea.setText("") | ||||
| 
 | ||||
|             self.device_list.setCurrentIndex(audio.getCurrDevice()) | ||||
|             self.cbDevices.setCurrentIndex(audio.getCurrDevice()) | ||||
|             self.sliMusicVolume.setValue(100) | ||||
|             self.sliSoundVolume.setValue(100) | ||||
|             self.sliBlipsVolume.setValue(100) | ||||
|          | ||||
|         self.callwords_edit.clear() | ||||
|         self.callwords.clear() | ||||
|         if exists(AO2XPpath + "callwords.ini"): | ||||
|             with open(AO2XPpath + "callwords.ini") as f: | ||||
|                 for line in f: | ||||
|                     self.callwords_edit.append(line.rstrip().decode("utf-8")) | ||||
|                     self.callwords.append(line.rstrip().decode("utf-8")) | ||||
|          | ||||
|         self.savelogs_state = self.savetolog.isChecked() | ||||
|         self.combinelogs_state = self.savetolog_combine.isChecked() | ||||
|         self.savedemos_state = self.savedemos.isChecked() | ||||
|         self.theme_state = self.currtheme.currentText() | ||||
|         self.saveLogsState = self.cbSaveToLog.isChecked() | ||||
|         self.combineLogsState = self.cbCombineLogs.isChecked() | ||||
|         self.saveDemosState = self.cbSaveDemos.isChecked() | ||||
|         self.themeState = self.cbThemes.currentText() | ||||
|          | ||||
|         self.tabs.setCurrentIndex(0) | ||||
|         self.show() | ||||
|      | ||||
|     def callwordsWordWrapCheckbox(self, newstate): | ||||
|         if newstate: | ||||
|             self.callwords_edit.setWordWrapMode(QtGui.QTextOption.WrapAtWordBoundaryOrAnywhere) | ||||
|             self.callwords.setWordWrapMode(QtGui.QTextOption.WrapAtWordBoundaryOrAnywhere) | ||||
|         else: | ||||
|             self.callwords_edit.setWordWrapMode(0) | ||||
|             self.callwords.setWordWrapMode(0) | ||||
|      | ||||
|     def onSaveClicked(self): | ||||
|         if not self.inifile.has_section("General"): self.inifile.add_section("General") | ||||
|         if not self.inifile.has_section("Audio"): self.inifile.add_section("Audio") | ||||
|         self.inifile.set("General", "save logs", self.savetolog.isChecked()) | ||||
|         self.inifile.set("General", "combined logs", self.savetolog_combine.isChecked()) | ||||
|         self.inifile.set("General", "record demos", self.savedemos.isChecked()) | ||||
|         self.inifile.set("General", "OOC name", self.defaultoocname.text().toUtf8()) | ||||
|         self.inifile.set("General", "showname", self.defaultshowname.text().toUtf8()) | ||||
|         self.inifile.set("General", "text stay time", self.textstaytime.value()) | ||||
|         self.inifile.set("General", "slide", self.enableslide.isChecked()) | ||||
|         self.inifile.set("General", "download characters", self.allowdownload_chars.isChecked()) | ||||
|         self.inifile.set("General", "download sounds", self.allowdownload_sounds.isChecked()) | ||||
|         self.inifile.set("General", "download music", self.allowdownload_music.isChecked()) | ||||
|         self.inifile.set("General", "download evidence", self.allowdownload_evidence.isChecked()) | ||||
|         self.inifile.set("General", "theme", self.currtheme.currentText()) | ||||
|         self.inifile.set("General", "auto connect", self.autoconnect.currentIndex() - 1) | ||||
|         self.inifile.set("General", "auto pick", self.autopick.currentText().toUtf8()) | ||||
|         self.inifile.set("General", "auto join area", self.autojoinarea.text().toUtf8()) | ||||
|         self.inifile.set("General", "install updates", self.check_updates.isChecked()) | ||||
|         self.inifile.set("General", "save logs", self.cbSaveToLog.isChecked()) | ||||
|         self.inifile.set("General", "combined logs", self.cbCombineLogs.isChecked()) | ||||
|         self.inifile.set("General", "record demos", self.cbSaveDemos.isChecked()) | ||||
|         self.inifile.set("General", "OOC name", self.defaultOOCName.text().toUtf8()) | ||||
|         self.inifile.set("General", "showname", self.defaultShowname.text().toUtf8()) | ||||
|         self.inifile.set("General", "text stay time", self.sbTextStayTime.value()) | ||||
|         self.inifile.set("General", "slide", self.cbEnableSlide.isChecked()) | ||||
|         self.inifile.set("General", "download characters", self.cbDownloadChars.isChecked()) | ||||
|         self.inifile.set("General", "download sounds", self.cbDownloadSounds.isChecked()) | ||||
|         self.inifile.set("General", "download music", self.cbDownloadMusic.isChecked()) | ||||
|         self.inifile.set("General", "download evidence", self.cbDownloadEvidence.isChecked()) | ||||
|         self.inifile.set("General", "theme", self.cbThemes.currentText()) | ||||
|         self.inifile.set("General", "auto connect", self.cbServers.currentIndex() - 1) | ||||
|         self.inifile.set("General", "auto pick", self.cbCharacters.currentText().toUtf8()) | ||||
|         self.inifile.set("General", "auto join area", self.autoJoinArea.text().toUtf8()) | ||||
|         self.inifile.set("General", "install updates", self.cbCheckUpdates.isChecked()) | ||||
| 
 | ||||
|         self.inifile.set("Audio", "device", self.device_list.currentIndex()) | ||||
|         self.inifile.set("Audio", "device", self.cbDevices.currentIndex()) | ||||
|         self.inifile.set("Audio", "Music volume", self.sliMusicVolume.value()) | ||||
|         self.inifile.set("Audio", "Sound volume", self.sliSoundVolume.value()) | ||||
|         self.inifile.set("Audio", "Blip volume", self.sliBlipsVolume.value()) | ||||
| @ -341,27 +342,27 @@ class Settings(QtGui.QDialog): | ||||
|             self.inifile.write(f) | ||||
|          | ||||
|         with open(AO2XPpath + "callwords.ini", "w") as f: | ||||
|             f.write(self.callwords_edit.toPlainText().toUtf8()) | ||||
|             f.write(self.callwords.toPlainText().toUtf8()) | ||||
|              | ||||
|         self.gamewindow.gamewidget.textWaitTime = self.textstaytime.value() | ||||
|         self.gamewindow.gamewidget.textWaitTime = self.sbTextStayTime.value() | ||||
|          | ||||
|         slideEnabled = self.enableslide.isChecked() | ||||
|         slideEnabled = self.cbEnableSlide.isChecked() | ||||
|         self.gamewindow.gamewidget.slideEnabled = slideEnabled | ||||
|         self.gamewindow.gamewidget.cbSlide.setEnabled(slideEnabled) | ||||
|          | ||||
|         if not slideEnabled: | ||||
|             self.gamewindow.gamewidget.cbSlide.setChecked(False) | ||||
|              | ||||
|         if not self.theme_state == self.currtheme.currentText(): | ||||
|         if not self.themeState == self.cbThemes.currentText(): | ||||
|             self.gamewindow.gamewidget.loadTheme(True) | ||||
|          | ||||
|         if not self.gamewindow.gamewidget.demoPlaying: | ||||
|             if not (self.savelogs_state == self.savetolog.isChecked() and self.combinelogs_state == self.savetolog_combine.isChecked()): | ||||
|             if not (self.saveLogsState == self.cbSaveToLog.isChecked() and self.combineLogsState == self.cbCombineLogs.isChecked()): | ||||
|                 self.gamewindow.gamewidget.OOCLog.setLogFiles() | ||||
|                 self.gamewindow.gamewidget.ICLog.setLogFiles(self.gamewindow.gamewidget.OOCLog.logfile) | ||||
|              | ||||
|             if not self.savedemos_state == self.savedemos.isChecked(): | ||||
|                 if self.savedemos.isChecked(): | ||||
|             if not self.saveDemosState == self.cbSaveDemos.isChecked(): | ||||
|                 if self.cbSaveDemos.isChecked(): | ||||
|                     self.gamewindow.gamewidget.startDemoRecorder() | ||||
|                 else: | ||||
|                     self.gamewindow.gamewidget.demoRecorder = None | ||||
| @ -380,10 +381,8 @@ class Settings(QtGui.QDialog): | ||||
|         if code == 0: | ||||
|             subprocess.Popen(["./AO2XPupdat"]) | ||||
|             _exit(0) | ||||
|         #elif osname == "Darwin": # bundle | ||||
|         #    os.chdir(Cocoa.NSBundle.mainBundle().resourcePath()) # return to Resources folder | ||||
| 
 | ||||
|     def onReloadAudio(self): | ||||
|     def onReloadAudioSystemClicked(self): | ||||
|         audio.free() | ||||
|         audio.init() | ||||
|         print "[audio] Reloaded audio system" | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user