r17094 by jghali - add new signal AppModeChanged() to ScribusMainWindow so as to avoid some direct PP calls for making app mode dependent updates

scribus-commit scribus-commit at lists.scribus.net
Sat Dec 17 21:29:31 UTC 2011


Author: jghali
Date: Sat Dec 17 21:29:31 2011
New Revision: 17094

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17094
Log:
add new signal AppModeChanged() to ScribusMainWindow so as to avoid some direct PP calls for making app mode dependent updates

Modified:
    trunk/Scribus/scribus/canvasmode_normal.cpp
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/scribus.h
    trunk/Scribus/scribus/ui/propertiespalette_group.cpp
    trunk/Scribus/scribus/ui/propertiespalette_xyz.cpp
    trunk/Scribus/scribus/ui/propertiespalette_xyz.h

Modified: trunk/Scribus/scribus/canvasmode_normal.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17094&path=/trunk/Scribus/scribus/canvasmode_normal.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_normal.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_normal.cpp Sat Dec 17 21:29:31 2011
@@ -218,7 +218,6 @@
 			{
 				m_view->requestMode(modeEditClip);
 				m_ScMW->scrActions["itemUngroup"]->setEnabled(false);
-				m_ScMW->propertiesPalette->xyzPal->doUnGroup->setEnabled(false);
 			}
 		}
 		else if (currItem->itemType() == PageItem::TextFrame)

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17094&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Sat Dec 17 21:29:31 2011
@@ -1339,13 +1339,14 @@
 				case modeEdit:
 					view->cancelGroupTransaction();
 					break;
+				case modeCopyProperties:
+				case modeEditGradientVectors:
+				case modeEditMeshGradient:
 				case modeLinkFrames:
 				case modeUnlinkFrames:
 				case modeRotation:
-				case modeEditGradientVectors:
-				case modeEditMeshGradient:
-				case modeCopyProperties:
 					view->Deselect(false);
+				case modeEditWeldPoint:
 				case modeEyeDropper:
 				case modeImportObject:
 				case modePanning:
@@ -3095,13 +3096,7 @@
 		scrActions["itemPrintingEnabled"]->setEnabled(true);
 		if (currItem->isGroup())
 		{
-			if (doc->appMode == modeEdit)
-			{
-				propertiesPalette->xyzPal->doUnGroup->setEnabled(false);
-				scrActions["itemUngroup"]->setEnabled(false);
-			}
-			else
-				scrActions["itemUngroup"]->setEnabled(true);
+			scrActions["itemUngroup"]->setEnabled(doc->appMode != modeEdit);
 		}
 		else
 		{
@@ -6612,6 +6607,8 @@
 			activateWindow();
 		PluginManager& pluginManager(PluginManager::instance());
 		pluginManager.enablePluginActionsForSelection(this);
+
+		emit AppModeChanged(oldMode, mode);
 /*
 		QStringList pluginNames(pluginManager.pluginNames(false));
 		ScPlugin* plugin;
@@ -7480,7 +7477,6 @@
 		{
 			view->requestMode(modeEditClip);
 			scrActions["itemUngroup"]->setEnabled(false);
-			propertiesPalette->xyzPal->doUnGroup->setEnabled(false);
 		}
 	}
 	else if (ite->itemType() == PageItem::TextFrame)

Modified: trunk/Scribus/scribus/scribus.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17094&path=/trunk/Scribus/scribus/scribus.h
==============================================================================
--- trunk/Scribus/scribus/scribus.h (original)
+++ trunk/Scribus/scribus/scribus.h Sat Dec 17 21:29:31 2011
@@ -521,6 +521,7 @@
 	void updateTableMenuActions();
 
 signals:
+	void AppModeChanged(int oldMode, int newMode);
 	void TextStyle(const ParagraphStyle&);
 //deprecated: (av)
 	void TextEffects(int);

Modified: trunk/Scribus/scribus/ui/propertiespalette_group.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17094&path=/trunk/Scribus/scribus/ui/propertiespalette_group.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_group.cpp (original)
+++ trunk/Scribus/scribus/ui/propertiespalette_group.cpp Sat Dec 17 21:29:31 2011
@@ -581,7 +581,6 @@
 		m_item->update();
 		m_ScMW->view->requestMode(modeEditClip);
 		m_ScMW->scrActions["itemUngroup"]->setEnabled(false);
-		m_ScMW->propertiesPalette->xyzPal->doUnGroup->setEnabled(false);
 		connect(m_ScMW->nodePalette, SIGNAL(paletteClosed()), this, SLOT(handleShapeEditEnded()));
 		emit shapeEditStarted();
 	}

Modified: trunk/Scribus/scribus/ui/propertiespalette_xyz.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17094&path=/trunk/Scribus/scribus/ui/propertiespalette_xyz.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_xyz.cpp (original)
+++ trunk/Scribus/scribus/ui/propertiespalette_xyz.cpp Sat Dec 17 21:29:31 2011
@@ -149,6 +149,7 @@
 	m_ScMW = mw;
 
 	connect(this, SIGNAL(DocChanged()), m_ScMW, SLOT(slotDocCh()));
+	connect(mw, SIGNAL(AppModeChanged(int, int)), this, SLOT(handleAppModeChanged(int, int)));
 }
 
 void PropertiesPalette_XYZ::setDoc(ScribusDoc *d)
@@ -412,6 +413,11 @@
 		setEnabled(true);
 	}
 	updateSpinBoxConstants();
+}
+
+void PropertiesPalette_XYZ::handleAppModeChanged(int oldMode, int mode)
+{
+	doUnGroup->setEnabled(mode != modeEdit && mode != modeEditClip);
 }
 
 void PropertiesPalette_XYZ::handleSelectionChanged()

Modified: trunk/Scribus/scribus/ui/propertiespalette_xyz.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17094&path=/trunk/Scribus/scribus/ui/propertiespalette_xyz.h
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_xyz.h (original)
+++ trunk/Scribus/scribus/ui/propertiespalette_xyz.h Sat Dec 17 21:29:31 2011
@@ -65,6 +65,7 @@
 	void displayFlippedH(bool);
 	void displayFlippedV(bool);
 
+	void handleAppModeChanged(int oldMode, int mode);
 	void handleSelectionChanged();
 
 private slots:




More information about the scribus-commit mailing list