[LyX/master] Fix #10328.

Richard Kimberly Heck rikiheck at lyx.org
Sun Aug 9 16:36:00 UTC 2020


commit c9bb6994572939fc55da935c3f13ef43cf2e5840
Author: Richard Kimberly Heck <rikiheck at lyx.org>
Date:   Sun Aug 9 13:00:41 2020 -0400

    Fix #10328.
    
    Change title of LyX's windows to conform to the usual pattern.
---
 src/frontends/qt/DialogView.cpp        |    2 +-
 src/frontends/qt/GuiAlert.cpp          |   44 +++++++++++++-------------------
 src/frontends/qt/GuiDialog.cpp         |    2 +-
 src/frontends/qt/ui/ToggleWarningUi.ui |    2 +-
 4 files changed, 21 insertions(+), 29 deletions(-)

diff --git a/src/frontends/qt/DialogView.cpp b/src/frontends/qt/DialogView.cpp
index 9b114ec..1c973b4 100644
--- a/src/frontends/qt/DialogView.cpp
+++ b/src/frontends/qt/DialogView.cpp
@@ -18,7 +18,7 @@ namespace lyx {
 namespace frontend {
 
 DialogView::DialogView(GuiView & lv, QString const & name, QString const & title)
-	: QDialog(&lv), Dialog(lv, name, "LyX: " + title)
+	: QDialog(&lv), Dialog(lv, name, title)
 {
 	connect(&lv, SIGNAL(bufferViewChanged()),
 	        this, SLOT(onBufferViewChanged()));
diff --git a/src/frontends/qt/GuiAlert.cpp b/src/frontends/qt/GuiAlert.cpp
index 886e0cb..8b626a9 100644
--- a/src/frontends/qt/GuiAlert.cpp
+++ b/src/frontends/qt/GuiAlert.cpp
@@ -75,14 +75,14 @@ docstring toPlainText(docstring const & msg)
 }
 
 
-int doPrompt(docstring const & title0, docstring const & question,
+int doPrompt(docstring const & title, docstring const & question,
 		  int default_button, int cancel_button,
 		  docstring const & b1, docstring const & b2,
 		  docstring const & b3, docstring const & b4)
 {
-	//lyxerr << "PROMPT" << title0 << "FOCUS: " << qApp->focusWidget() << endl;
+	//lyxerr << "PROMPT" << title << "FOCUS: " << qApp->focusWidget() << endl;
 	if (!use_gui || lyxerr.debugging()) {
-		lyxerr << toPlainText(title0) << '\n'
+		lyxerr << toPlainText(title) << '\n'
 		       << "----------------------------------------\n"
 		       << toPlainText(question) << endl;
 
@@ -97,8 +97,6 @@ int doPrompt(docstring const & title0, docstring const & question,
 			return default_button;
 	}
 
-	docstring const title = bformat(_("LyX: %1$s"), title0);
-
 	/// Long operation in progress prevents user from Ok-ing the error dialog
 	bool long_op = theApp()->longOperationStarted();
 	if (long_op)
@@ -137,7 +135,7 @@ int doPrompt(docstring const & title0, docstring const & question,
 	return res;
 }
 
-int prompt(docstring const & title0, docstring const & question,
+int prompt(docstring const & title, docstring const & question,
 		  int default_button, int cancel_button,
 		  docstring const & b0, docstring const & b1,
 		  docstring const & b2, docstring const & b3)
@@ -147,22 +145,20 @@ int prompt(docstring const & title0, docstring const & question,
 #else
 	return doPrompt(
 #endif
-				title0, question, default_button,
+				title, question, default_button,
 				cancel_button, b0, b1, b2, b3);
 }
 
-void doWarning(docstring const & title0, docstring const & message,
+void doWarning(docstring const & title, docstring const & message,
 	     bool const & askshowagain)
 {
-	lyxerr << "Warning: " << toPlainText(title0) << '\n'
+	lyxerr << "Warning: " << toPlainText(title) << '\n'
 	       << "----------------------------------------\n"
 	       << toPlainText(message) << endl;
 
 	if (!use_gui)
 		return;
 
-	docstring const title = bformat(_("LyX: %1$s"), title0);
-
 	if (theApp() == 0) {
 		noAppDialog(toqstr(title), toqstr(message), QMessageBox::Warning);
 		return;
@@ -193,7 +189,7 @@ void doWarning(docstring const & title0, docstring const & message,
 		theApp()->startLongOperation();
 }
 
-void warning(docstring const & title0, docstring const & message,
+void warning(docstring const & title, docstring const & message,
 	     bool const & askshowagain)
 {
 #ifdef EXPORT_in_THREAD
@@ -201,12 +197,12 @@ void warning(docstring const & title0, docstring const & message,
 #else
 	doWarning(
 #endif
-				title0, message, askshowagain);
+				title, message, askshowagain);
 }
 
-void doError(docstring const & title0, docstring const & message, bool backtrace)
+void doError(docstring const & title, docstring const & message, bool backtrace)
 {
-	lyxerr << "Error: " << toPlainText(title0) << '\n'
+	lyxerr << "Error: " << toPlainText(title) << '\n'
 	       << "----------------------------------------\n"
 	       << toPlainText(message) << endl;
 
@@ -217,8 +213,6 @@ void doError(docstring const & title0, docstring const & message, bool backtrace
 	if (!use_gui)
 		return;
 
-	docstring const title = bformat(_("LyX: %1$s"), title0);
-
 	if (theApp() == 0) {
 		noAppDialog(toqstr(title), toqstr(message), QMessageBox::Critical);
 		return;
@@ -243,28 +237,26 @@ void doError(docstring const & title0, docstring const & message, bool backtrace
 		theApp()->startLongOperation();
 }
 
-void error(docstring const & title0, docstring const & message, bool backtrace)
+void error(docstring const & title, docstring const & message, bool backtrace)
 {
 #ifdef EXPORT_in_THREAD
 	InGuiThread<void>().call(&doError,
 #else
 	doError(
 #endif
-				title0, message, backtrace);
+				title, message, backtrace);
 }
 
-void doInformation(docstring const & title0, docstring const & message)
+void doInformation(docstring const & title, docstring const & message)
 {
 	if (!use_gui || lyxerr.debugging())
-		lyxerr << toPlainText(title0) << '\n'
+		lyxerr << toPlainText(title) << '\n'
 		       << "----------------------------------------\n"
 		       << toPlainText(message) << endl;
 
 	if (!use_gui)
 		return;
 
-	docstring const title = bformat(_("LyX: %1$s"), title0);
-
 	if (theApp() == 0) {
 		noAppDialog(toqstr(title), toqstr(message), QMessageBox::Information);
 		return;
@@ -288,14 +280,14 @@ void doInformation(docstring const & title0, docstring const & message)
 		theApp()->startLongOperation();
 }
 
-void information(docstring const & title0, docstring const & message)
+void information(docstring const & title, docstring const & message)
 {
 #ifdef EXPORT_in_THREAD
 	InGuiThread<void>().call(&doInformation,
 #else
 	doInformation(
 #endif
-				title0, message);
+				title, message);
 }
 
 bool doAskForText(docstring & response, docstring const & msg,
@@ -312,7 +304,7 @@ bool doAskForText(docstring & response, docstring const & msg,
 		}
 	}
 
-	docstring const title = bformat(_("LyX: %1$s"), msg);
+	docstring const title = bformat(_("%1$s"), msg);
 
 	/// Long operation in progress prevents user from Ok-ing the error dialog
 	bool long_op = theApp()->longOperationStarted();
diff --git a/src/frontends/qt/GuiDialog.cpp b/src/frontends/qt/GuiDialog.cpp
index 8778886..3426c79 100644
--- a/src/frontends/qt/GuiDialog.cpp
+++ b/src/frontends/qt/GuiDialog.cpp
@@ -26,7 +26,7 @@ namespace lyx {
 namespace frontend {
 
 GuiDialog::GuiDialog(GuiView & lv, QString const & name, QString const & title)
-	: QDialog(&lv), Dialog(lv, name, "LyX: " + title), updating_(false),
+	: QDialog(&lv), Dialog(lv, name, title), updating_(false),
 	  is_closing_(false)
 {
 	connect(&lv, SIGNAL(bufferViewChanged()),
diff --git a/src/frontends/qt/ui/ToggleWarningUi.ui b/src/frontends/qt/ui/ToggleWarningUi.ui
index 47562f5..1b8b746 100644
--- a/src/frontends/qt/ui/ToggleWarningUi.ui
+++ b/src/frontends/qt/ui/ToggleWarningUi.ui
@@ -11,7 +11,7 @@
    </rect>
   </property>
   <property name="windowTitle">
-   <string>LyX: Enter text</string>
+   <string>Enter text</string>
   </property>
   <property name="sizeGripEnabled">
    <bool>true</bool>


More information about the lyx-cvs mailing list