r16899 by fschmid - Fixed Bug #3558: "by layer mode in outline"

scribus-commit scribus-commit at lists.scribus.net
Wed Oct 12 21:27:12 UTC 2011


Author: fschmid
Date: Wed Oct 12 21:27:12 2011
New Revision: 16899

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=16899
Log:
Fixed Bug #3558: "by layer mode in outline"

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

Modified: trunk/Scribus/scribus/commonstrings.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16899&path=/trunk/Scribus/scribus/commonstrings.cpp
==============================================================================
--- trunk/Scribus/scribus/commonstrings.cpp (original)
+++ trunk/Scribus/scribus/commonstrings.cpp Wed Oct 12 21:27:12 2011
@@ -46,16 +46,21 @@
 QString CommonStrings::customPageSize = "";
 QString CommonStrings::trCustomPageSize = "";
 
-QString CommonStrings::itemType_TextFrame  = "";
-QString CommonStrings::itemType_ImageFrame = "";
-QString CommonStrings::itemType_Line       = "";
-QString CommonStrings::itemType_Polygon    = "";
-QString CommonStrings::itemType_Polyline   = "";
-QString CommonStrings::itemType_PathText   = "";
-QString CommonStrings::itemType_LatexFrame = "";
-QString CommonStrings::itemType_OSGFrame   = "";
-QString CommonStrings::itemType_Symbol     = "";
-QString CommonStrings::itemType_Multiple   = "";
+QString CommonStrings::itemType_TextFrame		= "";
+QString CommonStrings::itemType_ImageFrame		= "";
+QString CommonStrings::itemType_Line			= "";
+QString CommonStrings::itemType_Polygon			= "";
+QString CommonStrings::itemType_Polyline		= "";
+QString CommonStrings::itemType_PathText		= "";
+QString CommonStrings::itemType_LatexFrame		= "";
+QString CommonStrings::itemType_OSGFrame		= "";
+QString CommonStrings::itemType_Symbol			= "";
+QString CommonStrings::itemType_Group			= "";
+QString CommonStrings::itemType_RegularPolygon	= "";
+QString CommonStrings::itemType_Arc				= "";
+QString CommonStrings::itemType_Spiral			= "";
+QString CommonStrings::itemType_Table			= "";
+QString CommonStrings::itemType_Multiple		= "";
 
 QString CommonStrings::itemSubType_PDF_PushButton;
 QString CommonStrings::itemSubType_PDF_TextField;
@@ -272,16 +277,21 @@
 	CommonStrings::trYesKey   = tr("&Yes");
 	CommonStrings::trNoKey    = tr("&No");
 
-	CommonStrings::itemType_TextFrame  = tr("Text Frame");
-	CommonStrings::itemType_ImageFrame = tr("Image Frame");
-	CommonStrings::itemType_Line       = tr("Line");
-	CommonStrings::itemType_Polygon    = tr("Polygon");
-	CommonStrings::itemType_Polyline   = tr("Polyline");
-	CommonStrings::itemType_PathText   = tr("Text on a Path");
-	CommonStrings::itemType_LatexFrame = tr("Render Frame");
-	CommonStrings::itemType_OSGFrame   = tr("PDF 3D Annotation");
-	CommonStrings::itemType_Symbol     = tr("Symbol");
-	CommonStrings::itemType_Multiple   = tr("Multiple", "Multiple frame types");
+	CommonStrings::itemType_TextFrame		= tr("Text Frame");
+	CommonStrings::itemType_ImageFrame		= tr("Image Frame");
+	CommonStrings::itemType_Line			= tr("Line");
+	CommonStrings::itemType_Polygon			= tr("Polygon");
+	CommonStrings::itemType_Polyline		= tr("Polyline");
+	CommonStrings::itemType_PathText		= tr("Text on a Path");
+	CommonStrings::itemType_LatexFrame		= tr("Render Frame");
+	CommonStrings::itemType_OSGFrame		= tr("PDF 3D Annotation");
+	CommonStrings::itemType_Symbol			= tr("Symbol");
+	CommonStrings::itemType_Group			= tr("Group");
+	CommonStrings::itemType_RegularPolygon	= tr("Regular Polygon");
+	CommonStrings::itemType_Arc				= tr("Arc");
+	CommonStrings::itemType_Spiral			= tr("Spiral");
+	CommonStrings::itemType_Table			= tr("Table");
+	CommonStrings::itemType_Multiple		= tr("Multiple", "Multiple frame types");
 	CommonStrings::itemSubType_PDF_PushButton     = tr("PDF Push Button");
 	CommonStrings::itemSubType_PDF_TextField      = tr("PDF Text Field");
 	CommonStrings::itemSubType_PDF_CheckBox       = tr("PDF Check Box");

Modified: trunk/Scribus/scribus/commonstrings.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16899&path=/trunk/Scribus/scribus/commonstrings.h
==============================================================================
--- trunk/Scribus/scribus/commonstrings.h (original)
+++ trunk/Scribus/scribus/commonstrings.h Wed Oct 12 21:27:12 2011
@@ -116,6 +116,11 @@
 	static QString itemType_LatexFrame;
 	static QString itemType_OSGFrame;
 	static QString itemType_Symbol;
+	static QString itemType_Group;
+	static QString itemType_RegularPolygon;
+	static QString itemType_Arc;
+	static QString itemType_Spiral;
+	static QString itemType_Table;
 	static QString itemType_Multiple;
 
 	static QString itemSubType_PDF_PushButton;

Modified: trunk/Scribus/scribus/pageitem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16899&path=/trunk/Scribus/scribus/pageitem.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem.cpp (original)
+++ trunk/Scribus/scribus/pageitem.cpp Wed Oct 12 21:27:12 2011
@@ -1408,7 +1408,7 @@
 	DrawObj_Pre(p);
 	if (m_Doc->layerOutline(LayerID))
 	{
-		if ((itemType()==TextFrame || itemType()==ImageFrame || itemType()==PathText || itemType()==Line || itemType()==PolyLine))
+		if ((itemType()==TextFrame || itemType()==ImageFrame || itemType()==PathText || itemType()==Line || itemType()==PolyLine /*|| itemType()==Group || itemType()==Symbol*/))
 			DrawObj_Item(p, cullingArea);
 	}
 	else
@@ -1602,47 +1602,47 @@
 void PageItem::DrawObj_Post(ScPainter *p)
 {
 	bool doStroke=true;
-	if (!isGroup())
-	{
-		if (m_Doc->layerOutline(LayerID))
-		{
-			if (itemType()!=Line)
-			{
-				p->setPen(m_Doc->layerMarker(LayerID), 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
-				p->setFillMode(ScPainter::None);
-				p->setBrushOpacity(1.0);
-				p->setPenOpacity(1.0);
-				if (itemType()==PolyLine)
+	if (m_Doc->layerOutline(LayerID))
+	{
+		if (itemType()!=Line)
+		{
+			p->setPen(m_Doc->layerMarker(LayerID), 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+			p->setFillMode(ScPainter::None);
+			p->setBrushOpacity(1.0);
+			p->setPenOpacity(1.0);
+			if (itemType()==PolyLine)
+				p->setupPolygon(&PoLine, false);
+			else if (itemType() == PathText)
+			{
+				if (PoShow)
 					p->setupPolygon(&PoLine, false);
-				else if (itemType() == PathText)
+				else
+					doStroke = false;
+			}
+			else
+				p->setupPolygon(&PoLine);
+			if (doStroke)
+				p->strokePath();
+			if (itemType()==ImageFrame)
+			{
+				if (imageClip.size() != 0)
 				{
-					if (PoShow)
-						p->setupPolygon(&PoLine, false);
-					else
-						doStroke = false;
+					p->setupPolygon(&imageClip);
+					p->strokePath();
 				}
-				else
-					p->setupPolygon(&PoLine);
-				if (doStroke)
-					p->strokePath();
-				if (itemType()==ImageFrame)
-				{
-					if (imageClip.size() != 0)
-					{
-						p->setupPolygon(&imageClip);
-						p->strokePath();
-					}
-				}
-			}
-		}
-		else
-		{
-	#if (CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 9, 4))
+			}
+		}
+	}
+	else
+	{
+		if (!isGroup())
+		{
+#if (CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 9, 4))
 			if (fillBlendmode() != 0)
 				p->endLayer();
-	#else
+#else
 			p->setBlendModeFill(0);
-	#endif
+#endif
 			p->setMaskMode(0);
 			// TODO: Investigate whether itemType()==Table should really be here. I got artifacts without it so keeping it here for now. /estan
 			if (itemType()==PathText || itemType()==PolyLine || itemType()==Spiral || itemType()==Line || itemType()==Symbol || itemType()==Group || itemType()==Table)

Modified: trunk/Scribus/scribus/ui/outlinepalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16899&path=/trunk/Scribus/scribus/ui/outlinepalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/outlinepalette.cpp (original)
+++ trunk/Scribus/scribus/ui/outlinepalette.cpp Wed Oct 12 21:27:12 2011
@@ -18,6 +18,7 @@
 #include <QToolTip>
 #include <QVariant>
 #include <QWidgetAction>
+#include <QSignalMapper>
 #include <QShortcut>
 
 #include "actionmanager.h"
@@ -29,6 +30,7 @@
 #include "scpage.h"
 #include "scribus.h"
 #include "selection.h"
+#include "layers.h"
 #include "undomanager.h"
 #include "util.h"
 #include "util_color.h"
@@ -40,14 +42,18 @@
 {
 	PageObject = NULL;
 	PageItemObject = NULL;
+	DocObject = NULL;
 	type = -1;
+	LayerID = -1;
 }
 
 OutlineTreeItem::OutlineTreeItem(QTreeWidget* parent, OutlineTreeItem* after) : QTreeWidgetItem(parent, after)
 {
 	PageObject = NULL;
 	PageItemObject = NULL;
+	DocObject = NULL;
 	type = -1;
+	LayerID = -1;
 }
 
 OutlineWidget::OutlineWidget(QWidget* parent) : QTreeWidget(parent)
@@ -80,7 +86,23 @@
  			if (item != NULL)
  			{
  				QString tipText("");
- 				if ((item->type == 1) || (item->type == 3) || (item->type == 4))
+				if (item->type == 5)
+				{
+					tipText += "<b>" + tr("Layer is:") + "</b><br><br>";
+					if (item->DocObject->activeLayer() == item->LayerID)
+						tipText += tr("active") + "<br>";
+					if (item->DocObject->layerVisible(item->LayerID))
+						tipText += tr("visible") + "<br>";
+					else
+						tipText += tr("invisible") + "<br>";
+					if (item->DocObject->layerPrintable(item->LayerID))
+						tipText += tr("printing");
+					else
+						tipText += tr("non printing");
+					if (item->DocObject->layerLocked(item->LayerID))
+						tipText += "<br>" + tr("locked");
+				}
+				else if ((item->type == 1) || (item->type == 3) || (item->type == 4))
  				{
  					PageItem *pgItem = item->PageItemObject;
  					switch (pgItem->itemType())
@@ -128,13 +150,19 @@
 							tipText = CommonStrings::itemType_Line;
  							break;
  						case PageItem::Arc:
+							tipText = CommonStrings::itemType_Arc;
+							break;
  						case PageItem::Polygon:
+							tipText = CommonStrings::itemType_Polygon;
+							break;
 						case PageItem::RegularPolygon:
-							tipText = CommonStrings::itemType_Polygon;
+							tipText = CommonStrings::itemType_RegularPolygon;
  							break;
  						case PageItem::PolyLine:
+							tipText = CommonStrings::itemType_Polyline;
+							break;
 						case PageItem::Spiral:
-							tipText = CommonStrings::itemType_Polyline;
+							tipText = CommonStrings::itemType_Spiral;
  							break;
  						case PageItem::PathText:
 							tipText = CommonStrings::itemType_PathText;
@@ -142,12 +170,18 @@
  						case PageItem::Symbol:
 							tipText = CommonStrings::itemType_Symbol;
  							break;
+						case PageItem::Group:
+							tipText = CommonStrings::itemType_Group;
+							break;
+						case PageItem::Table:
+							tipText = CommonStrings::itemType_Table;
+							break;
  						default:
  							break;
- 					}
-					QToolTip::showText(helpEvent->globalPos(), tipText, this);
-					return true;
-				}
+					}
+				}
+				QToolTip::showText(helpEvent->globalPos(), tipText, this);
+				return true;
 			}
 		}
 	}
@@ -196,6 +230,7 @@
 	textIcon = loadIcon("22/insert-text-frame.png");
 	polylineIcon = loadIcon("22/draw-path.png");
 	polygonIcon = loadIcon("22/draw-polygon.png");
+	tableIcon = loadIcon("22/insert-table.png");
 	groupIcon = loadIcon("u_group.png");
 	buttonIcon = loadIcon("22/insert-button.png");
 	textFieldIcon = loadIcon("22/text-field.png");
@@ -273,7 +308,76 @@
 				createContextMenu(currItem, point.x(), point.y());
 			}
 		}
-	}
+		else if (item->type == 5)
+		{
+			QMenu *pmenu = new QMenu();
+			QAction *actVis;
+			QAction *actPrint;
+			QAction *actLock;
+			if (item->DocObject->activeLayer() != item->LayerID)
+			{
+				QAction *actActive;
+				QSignalMapper *signalMapper = new QSignalMapper(this);
+				actActive = pmenu->addAction( tr("Active"));
+				actActive->setCheckable(true);
+				actActive->setChecked(false);
+				signalMapper->setMapping(actActive, item->LayerID);
+				connect(actActive, SIGNAL(triggered()), signalMapper, SLOT(map()));
+				connect(signalMapper, SIGNAL(mapped(int)), this, SLOT(setActiveLayer(int)));
+			}
+			QSignalMapper *signalMapper2 = new QSignalMapper(this);
+			actVis = pmenu->addAction( tr("Visible"));
+			actVis->setCheckable(true);
+			actVis->setChecked(item->DocObject->layerVisible(item->LayerID));
+			signalMapper2->setMapping(actVis, item->LayerID);
+			connect(actVis, SIGNAL(triggered()), signalMapper2, SLOT(map()));
+			connect(signalMapper2, SIGNAL(mapped(int)), this, SLOT(setLayerVisible(int)));
+
+			QSignalMapper *signalMapper3 = new QSignalMapper(this);
+			actPrint = pmenu->addAction( tr("Printing"));
+			actPrint->setCheckable(true);
+			actPrint->setChecked(item->DocObject->layerPrintable(item->LayerID));
+			signalMapper3->setMapping(actPrint, item->LayerID);
+			connect(actPrint, SIGNAL(triggered()), signalMapper3, SLOT(map()));
+			connect(signalMapper3, SIGNAL(mapped(int)), this, SLOT(setLayerPrintable(int)));
+
+			QSignalMapper *signalMapper4 = new QSignalMapper(this);
+			actLock = pmenu->addAction( tr("Locked"));
+			actLock->setCheckable(true);
+			actLock->setChecked(item->DocObject->layerLocked(item->LayerID));
+			signalMapper4->setMapping(actLock, item->LayerID);
+			connect(actLock, SIGNAL(triggered()), signalMapper4, SLOT(map()));
+			connect(signalMapper4, SIGNAL(mapped(int)), this, SLOT(setLayerLocked(int)));
+			qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
+			pmenu->exec(QCursor::pos());
+			delete pmenu;
+		}
+	}
+}
+
+void OutlinePalette::setActiveLayer(int layerID)
+{
+	currDoc->setActiveLayer(layerID);
+	currDoc->scMW()->changeLayer(currDoc->activeLayer());
+}
+
+void OutlinePalette::setLayerVisible(int layerID)
+{
+	currDoc->setLayerVisible(layerID, !currDoc->layerVisible(layerID));
+	currDoc->scMW()->showLayer();
+	currDoc->scMW()->layerPalette->rebuildList();
+}
+
+void OutlinePalette::setLayerLocked(int layerID)
+{
+	currDoc->setLayerLocked(layerID, !currDoc->layerLocked(layerID));
+	currDoc->scMW()->layerPalette->rebuildList();
+}
+
+void OutlinePalette::setLayerPrintable(int layerID)
+{
+	currDoc->setLayerPrintable(layerID, !currDoc->layerPrintable(layerID));
+	currDoc->scMW()->layerPalette->rebuildList();
 }
 
 void OutlinePalette::slotRenameItem()
@@ -507,6 +611,9 @@
 	case PageItem::Symbol:
 		item->setIcon( 0, polygonIcon );
 		break;
+	case PageItem::Table:
+		item->setIcon( 0, tableIcon );
+		break;
 	default:
 		break;
 	}
@@ -592,6 +699,7 @@
 				case 0:
 				case 1:
 				case 2:
+				case 5:
 					ite->setSelected(false);
 					break;
 				case 3:
@@ -602,6 +710,8 @@
 						m_MainWindow->closeActiveWindowMasterPageEditor();
 						currDoc->view()->SelectItemNr(pgItem->ItemNr, false, false);
 					}
+					break;
+				default:
 					break;
 			}
 		}
@@ -749,48 +859,94 @@
 			}
 			page->setText(0, currDoc->MasterPages.at(a)->pageName());
 		}
+		bool hasfreeItems = false;
 		for (int a = 0; a < static_cast<int>(currDoc->DocPages.count()); ++a)
 		{
 			OutlineTreeItem *page = new OutlineTreeItem( item, pagep );
 			page->PageObject = currDoc->DocPages.at(a);
 			page->type = 2;
 			pagep = page;
-			for (int b = 0; b < currDoc->DocItems.count(); ++b)
-			{
-				pgItem = currDoc->DocItems.at(b);
-				if (pgItem->OwnPage == a)
-				{
-					if (!pgItem->isGroup())
+			int layerCount = currDoc->layerCount();
+			if (layerCount > 1)
+			{
+				QList<PageItem*> pgItems;
+				for (int b = 0; b < currDoc->DocItems.count(); ++b)
+				{
+					pgItem = currDoc->DocItems.at(b);
+					if (pgItem->OwnPage == -1)
+						hasfreeItems = true;
+					if (pgItem->OwnPage == a)
+						pgItems.append(pgItem);
+				}
+				ScLayer layer;
+				layer.ID = 0;
+				for (int layerLevel = 0; layerLevel < layerCount; ++layerLevel)
+				{
+					currDoc->Layers.levelToLayer(layer, layerLevel);
+					OutlineTreeItem *ObjLayer = new OutlineTreeItem( page, 0 );
+					ObjLayer->type = 5;
+					ObjLayer->LayerID = layer.ID;
+					ObjLayer->DocObject = currDoc;
+					ObjLayer->setText(0, tr("Layer: \"") + layer.Name + "\"");
+					for (int it = 0; it < pgItems.count(); ++it)
 					{
-						OutlineTreeItem *object = new OutlineTreeItem( page, 0 );
-						object->PageItemObject = pgItem;
-						object->type = 3;
-						object->setText(0, pgItem->itemName());
-						setItemIcon(object, pgItem);
-						object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
+						pgItem = pgItems.at(it);
+						if (pgItem->LayerID != layer.ID)
+							continue;
+						if (!pgItem->isGroup())
+						{
+							OutlineTreeItem *object = new OutlineTreeItem( ObjLayer, 0 );
+							object->PageItemObject = pgItem;
+							object->type = 3;
+							object->setText(0, pgItem->itemName());
+							setItemIcon(object, pgItem);
+							object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
+						}
+						else
+						{
+							OutlineTreeItem *object = new OutlineTreeItem( ObjLayer, 0 );
+							object->PageItemObject = pgItem;
+							object->type = 3;
+							object->setText(0, pgItem->itemName());
+							object->setIcon( 0, groupIcon );
+							object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
+							parseSubGroup(object, &pgItem->groupItemList, 3);
+						}
 					}
-					else
+				}
+			}
+			else
+			{
+				for (int b = 0; b < currDoc->DocItems.count(); ++b)
+				{
+					pgItem = currDoc->DocItems.at(b);
+					if (pgItem->OwnPage == -1)
+						hasfreeItems = true;
+					if (pgItem->OwnPage == a)
 					{
-						OutlineTreeItem *object = new OutlineTreeItem( page, 0 );
-						object->PageItemObject = pgItem;
-						object->type = 3;
-						object->setText(0, pgItem->itemName());
-						object->setIcon( 0, groupIcon );
-						object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
-						parseSubGroup(object, &pgItem->groupItemList, 3);
+						if (!pgItem->isGroup())
+						{
+							OutlineTreeItem *object = new OutlineTreeItem( page, 0 );
+							object->PageItemObject = pgItem;
+							object->type = 3;
+							object->setText(0, pgItem->itemName());
+							setItemIcon(object, pgItem);
+							object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
+						}
+						else
+						{
+							OutlineTreeItem *object = new OutlineTreeItem( page, 0 );
+							object->PageItemObject = pgItem;
+							object->type = 3;
+							object->setText(0, pgItem->itemName());
+							object->setIcon( 0, groupIcon );
+							object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
+							parseSubGroup(object, &pgItem->groupItemList, 3);
+						}
 					}
 				}
 			}
 			page->setText(0, tr("Page ")+tmp.setNum(a+1));
-		}
-		bool hasfreeItems = false;
-		for (int b = 0; b < currDoc->DocItems.count(); ++b)
-		{
-			if (currDoc->DocItems.at(b)->OwnPage == -1)
-			{
-				hasfreeItems = true;
-				break;
-			}
 		}
 		if (hasfreeItems)
 		{
@@ -798,29 +954,79 @@
 			pagep = page;
 			freeObjects = page;
 			page->type = -3;
-			for (int b = 0; b < currDoc->DocItems.count(); ++b)
-			{
-				pgItem = currDoc->DocItems.at(b);
-				if (pgItem->OwnPage == -1)
-				{
-					if (!pgItem->isGroup())
+			int layerCount = currDoc->layerCount();
+			if (layerCount > 1)
+			{
+				QList<PageItem*> pgItems;
+				for (int b = 0; b < currDoc->DocItems.count(); ++b)
+				{
+					pgItem = currDoc->DocItems.at(b);
+					if (pgItem->OwnPage == -1)
+						pgItems.append(pgItem);
+				}
+				ScLayer layer;
+				layer.ID = 0;
+				for (int layerLevel = 0; layerLevel < layerCount; ++layerLevel)
+				{
+					currDoc->Layers.levelToLayer(layer, layerLevel);
+					OutlineTreeItem *ObjLayer = new OutlineTreeItem( page, 0 );
+					ObjLayer->type = 5;
+					ObjLayer->LayerID = layer.ID;
+					ObjLayer->DocObject = currDoc;
+					ObjLayer->setText(0, tr("Layer: \"") + layer.Name + "\"");
+					for (int it = 0; it < pgItems.count(); ++it)
 					{
-						OutlineTreeItem *object = new OutlineTreeItem( page, 0 );
-						object->PageItemObject = pgItem;
-						object->type = 4;
-						object->setText(0, pgItem->itemName());
-						setItemIcon(object, pgItem);
-						object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
+						pgItem = pgItems.at(it);
+						if (pgItem->LayerID != layer.ID)
+							continue;
+						if (!pgItem->isGroup())
+						{
+							OutlineTreeItem *object = new OutlineTreeItem( ObjLayer, 0 );
+							object->PageItemObject = pgItem;
+							object->type = 3;
+							object->setText(0, pgItem->itemName());
+							setItemIcon(object, pgItem);
+							object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
+						}
+						else
+						{
+							OutlineTreeItem *object = new OutlineTreeItem( ObjLayer, 0 );
+							object->PageItemObject = pgItem;
+							object->type = 3;
+							object->setText(0, pgItem->itemName());
+							object->setIcon( 0, groupIcon );
+							object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
+							parseSubGroup(object, &pgItem->groupItemList, 4);
+						}
 					}
-					else
+				}
+			}
+			else
+			{
+				for (int b = 0; b < currDoc->DocItems.count(); ++b)
+				{
+					pgItem = currDoc->DocItems.at(b);
+					if (pgItem->OwnPage == -1)
 					{
-						OutlineTreeItem *object = new OutlineTreeItem( page, 0 );
-						object->PageItemObject = pgItem;
-						object->type = 4;
-						object->setText(0, pgItem->itemName());
-						object->setIcon( 0, groupIcon );
-						object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
-						parseSubGroup(object, &pgItem->groupItemList, 4);
+						if (!pgItem->isGroup())
+						{
+							OutlineTreeItem *object = new OutlineTreeItem( page, 0 );
+							object->PageItemObject = pgItem;
+							object->type = 4;
+							object->setText(0, pgItem->itemName());
+							setItemIcon(object, pgItem);
+							object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
+						}
+						else
+						{
+							OutlineTreeItem *object = new OutlineTreeItem( page, 0 );
+							object->PageItemObject = pgItem;
+							object->type = 4;
+							object->setText(0, pgItem->itemName());
+							object->setIcon( 0, groupIcon );
+							object->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
+							parseSubGroup(object, &pgItem->groupItemList, 4);
+						}
 					}
 				}
 			}

Modified: trunk/Scribus/scribus/ui/outlinepalette.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16899&path=/trunk/Scribus/scribus/ui/outlinepalette.h
==============================================================================
--- trunk/Scribus/scribus/ui/outlinepalette.h (original)
+++ trunk/Scribus/scribus/ui/outlinepalette.h Wed Oct 12 21:27:12 2011
@@ -32,6 +32,8 @@
 	~OutlineTreeItem() {};
 	PageItem *PageItemObject;
 	ScPage *PageObject;
+	ScribusDoc *DocObject;
+	int LayerID;
 	int type;
 };
 
@@ -73,6 +75,10 @@
 	void slotShowSelect(uint SNr, int Nr);
 	void setPaletteShown(bool);
 	void slotRightClick(QPoint point);
+	void setActiveLayer(int layerID);
+	void setLayerVisible(int layerID);
+	void setLayerLocked(int layerID);
+	void setLayerPrintable(int layerID);
 
 signals:
 	void ToggleAllPalettes();
@@ -104,6 +110,7 @@
 	QPixmap polygonIcon;
 	QPixmap polylineIcon;
 	QPixmap groupIcon;
+	QPixmap tableIcon;
 	QPixmap buttonIcon;
 	QPixmap textFieldIcon;
 	QPixmap checkBoxIcon;




More information about the scribus-commit mailing list