r17943 by jghali - Remove most use of ScMessageBox class. As order of buttons is now handled automatically in Qt 4.x, ScMessageBox should now be avoided...

scribus-commit scribus-commit at lists.scribus.net
Sun Dec 9 22:58:22 UTC 2012


Author: jghali
Date: Sun Dec  9 22:58:22 2012
New Revision: 17943

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17943
Log:
Remove most use of ScMessageBox class. As order of buttons is now handled automatically in Qt 4.x, ScMessageBox should now be avoided...

Modified:
    trunk/Scribus/scribus/plugins/scriptplugin/pconsole.cpp
    trunk/Scribus/scribus/plugins/short-words/prefs_shortwords.cpp
    trunk/Scribus/scribus/plugins/short-words/swprefsgui.cpp
    trunk/Scribus/scribus/ui/storyeditor.cpp

Modified: trunk/Scribus/scribus/plugins/scriptplugin/pconsole.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17943&path=/trunk/Scribus/scribus/plugins/scriptplugin/pconsole.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/pconsole.cpp (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/pconsole.cpp Sun Dec  9 22:58:22 2012
@@ -22,9 +22,6 @@
 #include "scribuscore.h"
 #include "util_icon.h"
 
-#include "ui/scmessagebox.h"
-
-
 PythonConsole::PythonConsole( QWidget* parent)
 	: QMainWindow( parent )
 {
@@ -231,18 +228,6 @@
 		filename = oldFname;
 		return;
 	}
-	// #10070 : not needed QFileDialog::getSaveFileName() will ask overwrite confirmation by itself
-	/*if (QFile::exists(filename))
-	{
-		QString fn = QDir::toNativeSeparators(filename);
-		if (ScMessageBox::warning(this, CommonStrings::trWarning,
-			"<qt>" + tr(QString("File %1 already exists. Do you want to replace it?").arg(fn).toLocal8Bit().constData()) + "</qt>",
-			QMessageBox::Yes, QMessageBox::No) == QMessageBox::No)
-		{
-			filename = oldFname;
-			return;
-		}
-	}*/
 	slot_save();
 }
 
@@ -256,15 +241,6 @@
 	if (fname.isEmpty())
 		return;
 	QFile f(fname);
-	// #10070 : not needed QFileDialog::getSaveFileName() will ask overwrite confirmation by itself
-	/*if (f.exists())
-	{
-		QString fn = QDir::toNativeSeparators(filename);
-		if (QMessageBox::warning(this, CommonStrings::trWarning,
-			"<qt>" + tr(QString("File %1 already exists. Do you want to replace it?").arg(fn).toLocal8Bit().constData()) + "</qt>",
-			QMessageBox::Yes, QMessageBox::No) == QMessageBox::No)
-			return;
-	}*/
 	// save
 	if (f.open(QIODevice::WriteOnly))
 	{

Modified: trunk/Scribus/scribus/plugins/short-words/prefs_shortwords.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17943&path=/trunk/Scribus/scribus/plugins/short-words/prefs_shortwords.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/short-words/prefs_shortwords.cpp (original)
+++ trunk/Scribus/scribus/plugins/short-words/prefs_shortwords.cpp Sun Dec  9 22:58:22 2012
@@ -5,9 +5,10 @@
 for which a new license (GPL+exception) is in place.
 */
 
+#include <QMessageBox>
+
 #include "prefs_shortwords.h"
 #include "prefsstructs.h"
-#include "ui/scmessagebox.h"
 #include "swsyntaxhighlighter.h"
 #include "version.h"
 #include "scpaths.h"
@@ -66,12 +67,11 @@
 {
 	if (cfgEdit->document()->isModified() && QFile::exists(RC_PATH_USR))
 	{
-		if ((ScMessageBox::warning(this, tr("Short Words"),
+		if ((QMessageBox::warning(this, tr("Short Words"),
 				"<qt>" + tr("User configuration exists already. "
 						"Do you really want to overwrite it?") + "</qt>",
-				CommonStrings::trYes,
-				CommonStrings::trNo, 0, 0, 1)
-			) == 1)
+				QMessageBox::Yes|QMessageBox::No)
+			) == QMessageBox::No)
 			return;
 	}
 

Modified: trunk/Scribus/scribus/plugins/short-words/swprefsgui.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17943&path=/trunk/Scribus/scribus/plugins/short-words/swprefsgui.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/short-words/swprefsgui.cpp (original)
+++ trunk/Scribus/scribus/plugins/short-words/swprefsgui.cpp Sun Dec  9 22:58:22 2012
@@ -10,20 +10,18 @@
 #include "scpaths.h"
 #include "commonstrings.h"
 
+#include <QDir>
 #include <QGridLayout>
 #include <QHBoxLayout>
 #include <QVBoxLayout>
+#include <QLabel>
+#include <QMessageBox>
+#include <QPushButton>
+#include <QSpacerItem>
+#include <QTextCodec>
+#include <QTextEdit>
 #include <QTextStream>
-#include <QTextEdit>
-#include <QLabel>
-#include <QPushButton>
 #include <QToolTip>
-#include <QSpacerItem>
-#include <QFile>
-#include <QTextCodec>
-#include <QDir>
-
-#include "ui/scmessagebox.h"
 
 SWPrefsGui::SWPrefsGui(QWidget* parent ) : PrefsPanel(parent)
 {
@@ -108,12 +106,11 @@
 {
 	if (cfgEdit->document()->isModified() && QFile::exists(RC_PATH_USR))
 	{
-		if ((ScMessageBox::warning(this, tr("Short Words"),
+		if ((QMessageBox::warning(this, tr("Short Words"),
 				"<qt>" + tr("User configuration exists already. "
 						"Do you really want to overwrite it?") + "</qt>",
-				CommonStrings::trYes,
-				CommonStrings::trNo, 0, 0, 1)
-			) == 1)
+				QMessageBox::Yes|QMessageBox::No)
+			) == QMessageBox::No)
 			return;
 	}
 

Modified: trunk/Scribus/scribus/ui/storyeditor.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17943&path=/trunk/Scribus/scribus/ui/storyeditor.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/storyeditor.cpp (original)
+++ trunk/Scribus/scribus/ui/storyeditor.cpp Sun Dec  9 22:58:22 2012
@@ -38,6 +38,7 @@
 #include <QLabel>
 #include <QList>
 #include <QPair>
+#include <QMessageBox>
 #include <QMouseEvent>
 #include <QPaintEvent>
 #include <QPalette>
@@ -65,7 +66,6 @@
 #include "prefsfile.h"
 #include "prefsmanager.h"
 #include "scfonts.h"
-#include "scmessagebox.h"
 #include "scplugin.h"
 #include "scraction.h"
 #include "scribuscore.h"
@@ -2154,7 +2154,7 @@
 	if (textChanged)
 	{
 		blockUpdate = true;
-		int t = ScMessageBox::warning(this, CommonStrings::trWarning,
+		int t = QMessageBox::warning(this, CommonStrings::trWarning,
 									tr("Do you want to save your changes?"),
 									QMessageBox::Yes|QMessageBox::Default,
 									QMessageBox::No,
@@ -2751,7 +2751,7 @@
 	if (textChanged)
 	{
 		blockUpdate = true;
-		int t = ScMessageBox::warning(this, CommonStrings::trWarning,
+		int t = QMessageBox::warning(this, CommonStrings::trWarning,
 									 tr("Do you really want to lose all your changes?"),
 									 QMessageBox::Yes, QMessageBox::No | QMessageBox::Default);
 		qApp->processEvents();
@@ -2780,7 +2780,7 @@
 	if (!Editor->document()->isEmpty())
 	{
 		blockUpdate = true;
-		int t = ScMessageBox::warning(this, CommonStrings::trWarning,
+		int t = QMessageBox::warning(this, CommonStrings::trWarning,
 								 tr("Do you really want to clear all your text?"),
 								 QMessageBox::Yes, QMessageBox::No | QMessageBox::Default);
 		qApp->processEvents();




More information about the scribus-commit mailing list