r19367 by craig - Stop this nonsense of exiting modes with the doc MDI window close button

scribus-commit scribus-commit at lists.scribus.net
Thu Jul 24 18:53:39 UTC 2014


Author: craig
Date: Thu Jul 24 18:53:39 2014
New Revision: 19367

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19367
Log:
Stop this nonsense of exiting modes with the doc MDI window close button

Modified:
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/scribus.h
    trunk/Scribus/scribus/scribusview.cpp
    trunk/Scribus/scribus/scribuswin.cpp

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19367&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Thu Jul 24 18:53:39 2014
@@ -4675,28 +4675,13 @@
 
 bool ScribusMainWindow::slotFileClose()
 {
-	if (doc->symbolEditMode())
-	{
-		editSymbolEnd();
-		return true;
-	}
-	else if (doc->inlineEditMode())
-	{
-		editInlineEnd();
-		return true;
-	}
-	else if (doc->masterPageMode())
-	{
-		editMasterPagesEnd();
-		return true;
-	}
 	ScribusWin* tw = ActWin;
 	mdiArea->closeActiveSubWindow();
+	windowsMenuAboutToShow();
 	if (tw == ActWin)
 		return false;
 	else
 		return true;
-	windowsMenuAboutToShow();
 }
 
 bool ScribusMainWindow::DoFileClose()
@@ -4892,6 +4877,16 @@
 	disconnect(printer, SIGNAL(doPreview()), this, SLOT(doPrintPreview()));
 	delete printer;
 	mainWindowStatusLabel->setText( tr("Ready"));
+}
+
+void ScribusMainWindow::slotEndSpecialEdit()
+{
+	if (doc->symbolEditMode())
+		editSymbolEnd();
+	else if (doc->inlineEditMode())
+		editInlineEnd();
+	else if (doc->masterPageMode())
+		editMasterPagesEnd();
 }
 
 bool ScribusMainWindow::doPrint(PrintOptions &options, QString& error)

Modified: trunk/Scribus/scribus/scribus.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19367&path=/trunk/Scribus/scribus/scribus.h
==============================================================================
--- trunk/Scribus/scribus/scribus.h (original)
+++ trunk/Scribus/scribus/scribus.h Thu Jul 24 18:53:39 2014
@@ -363,6 +363,7 @@
 	/** \brief print the actual file */
 	void slotFilePrint();
 	void slotReallyPrint();
+	void slotEndSpecialEdit();
 	/*!
 	\author Franz Schmid
 	\brief Generate and print PostScript from a doc

Modified: trunk/Scribus/scribus/scribusview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19367&path=/trunk/Scribus/scribus/scribusview.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusview.cpp (original)
+++ trunk/Scribus/scribus/scribusview.cpp Thu Jul 24 18:53:39 2014
@@ -229,7 +229,7 @@
 	endEditButton = new QPushButton(loadIcon("22/exit.png"), tr("End Edit"), this);
 	endEditButton->setGeometry(m_vhRulerHW + 1, height() - m_vhRulerHW - endEditButton->minimumSizeHint().height() - 1, endEditButton->minimumSizeHint().width(), endEditButton->minimumSizeHint().height());
 	endEditButton->setVisible(false);
-	connect(endEditButton, SIGNAL(clicked()), m_ScMW, SLOT(slotFileClose()));
+	connect(endEditButton, SIGNAL(clicked()), m_ScMW, SLOT(slotEndSpecialEdit()));
 
 	m_oldSnapToElem = Doc->SnapElement;
 	languageChange();

Modified: trunk/Scribus/scribus/scribuswin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19367&path=/trunk/Scribus/scribus/scribuswin.cpp
==============================================================================
--- trunk/Scribus/scribus/scribuswin.cpp (original)
+++ trunk/Scribus/scribus/scribuswin.cpp Thu Jul 24 18:53:39 2014
@@ -66,53 +66,32 @@
 {
 	activateWindow();
 	m_MainWindow->newActWin(getSubWin());
-	if (m_Doc->symbolEditMode())
+	if (m_Doc->isModified() && (m_Doc->viewCount == 1))
 	{
-		m_MainWindow->editSymbolEnd();
-		ce->ignore();
-		return;
-	}
-	else if (m_Doc->inlineEditMode())
-	{
-		m_MainWindow->editInlineEnd();
-		ce->ignore();
-		return;
-	}
-	else if (m_Doc->masterPageMode())
-	{
-		m_MainWindow->editMasterPagesEnd();
-		ce->ignore();
-		return;
-	}
-	else
-	{
-		if (m_Doc->isModified() && (m_Doc->viewCount == 1))
+		int exit = QMessageBox::information(m_MainWindow, CommonStrings::trWarning, tr("Document:")+" "+
+											QDir::toNativeSeparators(m_Doc->DocName)+"\n"+
+											tr("has been changed since the last save."),
+											QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel,
+											QMessageBox::Cancel);
+		if (exit == QMessageBox::Cancel)
 		{
-			int exit = QMessageBox::information(m_MainWindow, CommonStrings::trWarning, tr("Document:")+" "+
-												QDir::toNativeSeparators(m_Doc->DocName)+"\n"+
-												tr("has been changed since the last save."),
-												QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel,
-												QMessageBox::Cancel);
-			if (exit == QMessageBox::Cancel)
+			ce->ignore();
+			return;
+		}
+		if (exit == QMessageBox::Save)
+		{
+			if (m_MainWindow->slotFileSave())
+			{
+				if (m_Doc == m_MainWindow->storyEditor->currentDocument())
+					m_MainWindow->storyEditor->close();
+			}
+			else
 			{
 				ce->ignore();
 				return;
 			}
-			if (exit == QMessageBox::Save)
-			{
-				if (m_MainWindow->slotFileSave())
-				{
-					if (m_Doc == m_MainWindow->storyEditor->currentDocument())
-						m_MainWindow->storyEditor->close();
-				}
-				else
-				{
-					ce->ignore();
-					return;
-				}
-			}
 		}
-		m_MainWindow->DoFileClose();
 	}
+	m_MainWindow->DoFileClose();
 	ce->accept();
 }




More information about the scribus-commit mailing list