r16999 by fschmid - Fixed Bug 10271: "Content edit access through the "outilines" window", this is now done by doubleclicking on the item in the outlines window.

scribus-commit scribus-commit at lists.scribus.net
Sun Nov 20 21:18:23 UTC 2011


Author: fschmid
Date: Sun Nov 20 21:18:23 2011
New Revision: 16999

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=16999
Log:
Fixed Bug 10271: "Content edit access through the "outilines" window", this is now done by doubleclicking on the item in the outlines window.

Modified:
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/scribus.h
    trunk/Scribus/scribus/ui/outlinepalette.cpp
    trunk/Scribus/scribus/ui/outlinepalette.h

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16999&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Sun Nov 20 21:18:23 2011
@@ -587,6 +587,7 @@
 	connect(docCheckerPalette, SIGNAL(selectMasterPage(QString)), this, SLOT(manageMasterPages(QString)));
 //	connect(outlinePalette, SIGNAL(selectElement(int, int, bool)), this, SLOT(selectItemsFromOutlines(int, int, bool)));
 	connect(outlinePalette, SIGNAL(selectElementByItem(PageItem *, bool)), this, SLOT(selectItemsFromOutlines(PageItem *, bool)));
+	connect(outlinePalette, SIGNAL(editElementByItem(PageItem *)), this, SLOT(editItemsFromOutlines(PageItem *)));
 	connect(outlinePalette, SIGNAL(selectPage(int)), this, SLOT(selectPagesFromOutlines(int)));
 	connect(outlinePalette, SIGNAL(selectMasterPage(QString)), this, SLOT(manageMasterPages(QString)));
 	connect(propertiesPalette->textPal->paraStyleCombo, SIGNAL(newStyle(const QString&)), this, SLOT(setNewParStyle(const QString&)));
@@ -7498,6 +7499,76 @@
 	delete dia;
 }
 
+void ScribusMainWindow::editItemsFromOutlines(PageItem *ite)
+{
+	if (ite->locked())
+		return;
+	if (doc->m_Selection->count() != 0)
+	{
+		if (doc->m_Selection->itemAt(0) != ite)
+		{
+			if (ite->isGroup())
+				selectItemsFromOutlines(ite, true);
+			else
+				selectItemsFromOutlines(ite, false);
+		}
+	}
+	if (ite->asLatexFrame())
+	{
+		if (ite->imageShown())
+			view->requestMode(modeEdit);
+	}
+#ifdef HAVE_OSG
+	else if (ite->asOSGFrame())
+		view->requestMode(submodeEditExternal);
+#endif
+	else if ((ite->itemType() == PageItem::Polygon) || (ite->itemType() == PageItem::PolyLine) || (ite->itemType() == PageItem::Group) || (ite->itemType() == PageItem::ImageFrame) || (ite->itemType() == PageItem::PathText))
+	{
+		if (ite->itemType() == PageItem::ImageFrame)
+		{
+			if (ite->Pfile.isEmpty())
+				view->requestMode(submodeLoadPic);
+			else if (!ite->PictureIsAvailable)
+				view->requestMode(submodeStatusPic);
+			else if (ite->imageShown())
+				view->requestMode(modeEdit);
+		}
+		else if (ite->itemType() == PageItem::TextFrame)
+			view->requestMode(modeEdit);
+		else
+		{
+			view->requestMode(modeEditClip);
+			scrActions["itemUngroup"]->setEnabled(false);
+			propertiesPalette->xyzPal->doUnGroup->setEnabled(false);
+		}
+	}
+	else if (ite->itemType() == PageItem::TextFrame)
+	{
+		if (ite->isAnnotation())
+		{
+			qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
+			view->requestMode(submodeAnnotProps);
+		}
+		else if (doc->appMode != modeEdit)
+		{
+			view->requestMode(modeEdit);
+		}
+	}
+	else if (ite->asSymbolFrame())
+	{
+		if (!doc->symbolEditMode())
+			view->requestMode(submodeEditSymbol);
+	}
+	else if (ite->asArc())
+		view->requestMode(modeEditArc);
+	else if (ite->asRegularPolygon())
+		view->requestMode(modeEditPolygon);
+	else if (ite->asSpiral())
+		view->requestMode(modeEditSpiral);
+	else if (ite->asTable())
+		view->requestMode(modeEditTable);
+}
+
 void ScribusMainWindow::selectItemsFromOutlines(PageItem* ite, bool single)
 {
 	if (HaveDoc && doc->appMode == modeEditClip)
@@ -7534,7 +7605,7 @@
 		}
 	}
 }
-
+/*
 void ScribusMainWindow::selectItemsFromOutlines(int Page, int Item, bool single)
 {
 	if (HaveDoc && doc->appMode == modeEditClip)
@@ -7581,7 +7652,7 @@
 		}
 	}
 }
-
+*/
 void ScribusMainWindow::selectPagesFromOutlines(int Page)
 {
 	if (HaveDoc && doc->appMode == modeEditClip)

Modified: trunk/Scribus/scribus/scribus.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16999&path=/trunk/Scribus/scribus/scribus.h
==============================================================================
--- trunk/Scribus/scribus/scribus.h (original)
+++ trunk/Scribus/scribus/scribus.h Sun Nov 20 21:18:23 2011
@@ -485,8 +485,9 @@
 	void setNewParStyle(const QString& name);
 	void setNewCharStyle(const QString& name);
 	void setAlignmentValue(int a);
+	void editItemsFromOutlines(PageItem *ite);
 	void selectItemsFromOutlines(PageItem *ite, bool single = false);
-	void selectItemsFromOutlines(int ScPage, int Item, bool single = false);
+//	void selectItemsFromOutlines(int ScPage, int Item, bool single = false);
 	void selectPagesFromOutlines(int ScPage);
 	void doPrintPreview();
 	void printPreview();

Modified: trunk/Scribus/scribus/ui/outlinepalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16999&path=/trunk/Scribus/scribus/ui/outlinepalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/outlinepalette.cpp (original)
+++ trunk/Scribus/scribus/ui/outlinepalette.cpp Sun Nov 20 21:18:23 2011
@@ -433,6 +433,7 @@
 	connect(reportDisplay, SIGNAL(itemChanged(QTreeWidgetItem*, int)), this, SLOT(slotDoRename(QTreeWidgetItem*, int)));
 	connect(filterEdit, SIGNAL(textChanged(const QString&)), this, SLOT(filterTree(const QString&)));
 //	connect(filterShortcut, SIGNAL(activated()), filterEdit, SLOT(setFocus()));
+	connect(reportDisplay, SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int)), this, SLOT(slotDoubleClick(QTreeWidgetItem*, int)));
 }
 
 void OutlinePalette::setMainWindow(ScribusMainWindow *mw)
@@ -905,7 +906,7 @@
 	connect(reportDisplay, SIGNAL(itemSelectionChanged()), this, SLOT(slotMultiSelect()));
 }
 
-void OutlinePalette::slotSelect(QTreeWidgetItem* ite, int col)
+void OutlinePalette::slotSelect(QTreeWidgetItem* ite, int)
 {
 	if (!m_MainWindow || m_MainWindow->scriptIsRunning())
 		return;
@@ -948,6 +949,31 @@
 			break;
 	}
 	selectionTriggered = false;
+}
+
+void OutlinePalette::slotDoubleClick(QTreeWidgetItem* ite, int)
+{
+	if (!m_MainWindow || m_MainWindow->scriptIsRunning())
+		return;
+	OutlineTreeItem *item = (OutlineTreeItem*)ite;
+	PageItem *pgItem = NULL;
+	switch (item->type)
+	{
+		case 1:
+			if (!currDoc->masterPageMode())
+				emit selectMasterPage(item->PageItemObject->OnMasterPage);
+			pgItem = item->PageItemObject;
+			emit editElementByItem(pgItem);
+			break;
+		case 3:
+		case 4:
+			pgItem = item->PageItemObject;
+			m_MainWindow->closeActiveWindowMasterPageEditor();
+			emit editElementByItem(pgItem);
+			break;
+		default:
+			break;
+	}
 }
 
 void OutlinePalette::BuildTree(bool storeVals)
@@ -992,7 +1018,7 @@
 				object->type = 3;
 				object->setText(0, pgItem->itemName());
 				setItemIcon(object, pgItem);
-				object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled);
+				object->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled);
 			}
 			else
 			{
@@ -1003,7 +1029,7 @@
 				object->type = 3;
 				object->setText(0, pgItem->itemName());
 				object->setIcon( 0, groupIcon );
-				object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled);
+				object->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled);
 				parseSubGroup(object, &pgItem->groupItemList, 3, currDoc->Pages->at(0));
 			}
 		}
@@ -1033,7 +1059,7 @@
 						object->type = 1;
 						object->setText(0, pgItem->itemName());
 						setItemIcon(object, pgItem);
-						object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
+						object->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
 					}
 					else
 					{
@@ -1044,7 +1070,7 @@
 						object->type = 1;
 						object->setText(0, pgItem->itemName());
 						object->setIcon( 0, groupIcon );
-						object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
+						object->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
 						parseSubGroup(object, &pgItem->groupItemList, 1, currDoc->MasterPages.at(a));
 					}
 				}
@@ -1096,7 +1122,7 @@
 							object->type = 3;
 							object->setText(0, pgItem->itemName());
 							setItemIcon(object, pgItem);
-							object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled);
+							object->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled);
 						}
 						else
 						{
@@ -1107,7 +1133,7 @@
 							object->type = 3;
 							object->setText(0, pgItem->itemName());
 							object->setIcon( 0, groupIcon );
-							object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled);
+							object->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled);
 							parseSubGroup(object, &pgItem->groupItemList, 3, currDoc->DocPages.at(a));
 						}
 					}
@@ -1131,7 +1157,7 @@
 							object->type = 3;
 							object->setText(0, pgItem->itemName());
 							setItemIcon(object, pgItem);
-							object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled);
+							object->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled);
 						}
 						else
 						{
@@ -1142,7 +1168,7 @@
 							object->type = 3;
 							object->setText(0, pgItem->itemName());
 							object->setIcon( 0, groupIcon );
-							object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled);
+							object->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled);
 							parseSubGroup(object, &pgItem->groupItemList, 3, currDoc->DocPages.at(a));
 						}
 					}
@@ -1192,7 +1218,7 @@
 							object->type = 4;
 							object->setText(0, pgItem->itemName());
 							setItemIcon(object, pgItem);
-							object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
+							object->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
 						}
 						else
 						{
@@ -1203,7 +1229,7 @@
 							object->type = 4;
 							object->setText(0, pgItem->itemName());
 							object->setIcon( 0, groupIcon );
-							object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
+							object->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
 							parseSubGroup(object, &pgItem->groupItemList, 4, NULL);
 						}
 					}
@@ -1225,7 +1251,7 @@
 							object->type = 4;
 							object->setText(0, pgItem->itemName());
 							setItemIcon(object, pgItem);
-							object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
+							object->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
 						}
 						else
 						{
@@ -1236,7 +1262,7 @@
 							object->type = 4;
 							object->setText(0, pgItem->itemName());
 							object->setIcon( 0, groupIcon );
-							object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
+							object->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
 							parseSubGroup(object, &pgItem->groupItemList, 4, NULL);
 						}
 					}
@@ -1302,10 +1328,9 @@
 			grp->setText(0, pgItem->itemName());
 			setItemIcon(grp, pgItem);
 			if (itemType == 3)
-				grp->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled);
+				grp->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled);
 			else
-				grp->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
-//			grp->setFlags(Qt::ItemIsEnabled);
+				grp->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
 		}
 		else
 		{
@@ -1317,10 +1342,9 @@
 			grp->setText(0, pgItem->itemName());
 			grp->setIcon( 0, groupIcon );
 			if (itemType == 3)
-				grp->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled);
+				grp->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled);
 			else
-				grp->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
-//			grp->setFlags(Qt::ItemIsEnabled);
+				grp->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
 			parseSubGroup(grp, &pgItem->groupItemList, itemType, a);
 		}
 	}

Modified: trunk/Scribus/scribus/ui/outlinepalette.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16999&path=/trunk/Scribus/scribus/ui/outlinepalette.h
==============================================================================
--- trunk/Scribus/scribus/ui/outlinepalette.h (original)
+++ trunk/Scribus/scribus/ui/outlinepalette.h Sun Nov 20 21:18:23 2011
@@ -84,6 +84,7 @@
 signals:
 	void ToggleAllPalettes();
 	void selectElementByItem(PageItem *, bool);
+	void editElementByItem(PageItem *);
 	void selectPage(int);
 	void selectMasterPage(QString);
 
@@ -92,6 +93,7 @@
 	void slotDoRename(QTreeWidgetItem* ite, int col);
 	void slotMultiSelect();
 	void slotSelect(QTreeWidgetItem* ite, int col);
+	void slotDoubleClick(QTreeWidgetItem* ite, int col);
 protected:
 	void filterTree();
 	void clearPalette();




More information about the scribus-commit mailing list