Fix questionSaveMBox close on non-Windows platform

Signed-off-by: Loren Eteval <loren.eteval@proton.me>
This commit is contained in:
Loren Eteval
2025-02-16 22:12:06 +08:00
parent cacfd176b7
commit bdedf9f6b4
2 changed files with 8 additions and 4 deletions
+1 -1
View File
@@ -638,7 +638,7 @@ class UserServersQTableWidget(QTranslatable, AppQTableWidget):
self.testDownloadSpeedTimer.timeout.connect(self.handleTestDownloadSpeedJob)
# Text Editor Window
self.textEditorWindow = TextEditorWindow()
self.textEditorWindow = TextEditorWindow(parent=self.parent())
# Must set before flush all
self.setColumnCount(len(self.Headers))
+7 -3
View File
@@ -115,7 +115,7 @@ class TextEditorWindow(AppQMainWindow):
super().__init__(*args, **kwargs)
self.customWindowTitle = ''
self.setWindowModality(QtCore.Qt.WindowModality.ApplicationModal)
self.setWindowModality(QtCore.Qt.WindowModality.WindowModal)
self.setFixedSize(450, int(450 * GOLDEN_RATIO))
# Current editing index
@@ -273,12 +273,16 @@ class TextEditorWindow(AppQMainWindow):
assert isinstance(saveMBox, QuestionSaveMBox)
if saveMBox.button0 == button:
# Save
if self.save():
saveMBox.close()
self.hide()
if saveMBox.button1 == button:
elif saveMBox.button1 == button:
# Discard
self.markAsSaved()
saveMBox.close()
self.hide()
if saveMBox.button2 == button:
elif saveMBox.button2 == button:
# Cancel. Do nothing
pass