Only reload logs on save if checkboxes changed

This commit is contained in:
cidoku 2025-03-11 14:07:00 -03:00
parent db6ddea0ed
commit e4738b6d9b

View File

@ -234,6 +234,11 @@ class Settings(QtGui.QDialog):
self.savebtn.setFocus()
# 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
def showSettings(self):
if exists("AO2XP.ini"):
self.inifile.read("AO2XP.ini")
@ -292,6 +297,10 @@ class Settings(QtGui.QDialog):
for line in f:
self.callwords_edit.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.tabs.setCurrentIndex(0)
self.show()
@ -333,10 +342,13 @@ class Settings(QtGui.QDialog):
f.write(self.callwords_edit.toPlainText().toUtf8())
self.gamewindow.gamewidget.text_wait_time = self.textstaytime.value()
self.gamewindow.gamewidget.ooclog.set_logfiles()
self.gamewindow.gamewidget.icLog.set_logfiles(self.gamewindow.gamewidget.ooclog.logfile)
self.gamewindow.gamewidget.slide_enabled = self.enableslide.isChecked()
if not (self.savelogs_state == self.savetolog.isChecked() and self.combinelogs_state == self.savetolog_combine.isChecked()):
self.gamewindow.gamewidget.ooclog.set_logfiles()
self.gamewindow.gamewidget.icLog.set_logfiles(self.gamewindow.gamewidget.ooclog.logfile)
if not self.savedemos_state == self.savedemos.isChecked():
if self.savedemos.isChecked():
self.gamewindow.gamewidget.start_demo_recorder()
else: