diff --git a/Furious/Widget/UserServersQTableWidget.py b/Furious/Widget/UserServersQTableWidget.py index 758efb49..f1325a0a 100644 --- a/Furious/Widget/UserServersQTableWidget.py +++ b/Furious/Widget/UserServersQTableWidget.py @@ -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)) diff --git a/Furious/Window/TextEditorWindow.py b/Furious/Window/TextEditorWindow.py index 7670c50c..58a45b83 100644 --- a/Furious/Window/TextEditorWindow.py +++ b/Furious/Window/TextEditorWindow.py @@ -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