r17909 by fschmid - First committ to make the "Preview Mode" look more like in other Applications

scribus-commit scribus-commit at lists.scribus.net
Sun Nov 25 20:52:43 UTC 2012


Author: fschmid
Date: Sun Nov 25 20:52:42 2012
New Revision: 17909

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17909
Log:
First committ to make the "Preview Mode" look more like in other Applications 
- No more editing possible.
- PDF Links linking to the same document are working now when activated.

Modified:
    trunk/Scribus/scribus/canvas.cpp
    trunk/Scribus/scribus/canvasmode_normal.cpp
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/scribus.h
    trunk/Scribus/scribus/scribusview.cpp
    trunk/Scribus/scribus/ui/annota.cpp
    trunk/Scribus/scribus/ui/inlinepalette.cpp
    trunk/Scribus/scribus/ui/outlinepalette.cpp
    trunk/Scribus/scribus/ui/propertiespalette.cpp
    trunk/Scribus/scribus/ui/symbolpalette.cpp

Modified: trunk/Scribus/scribus/canvas.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17909&path=/trunk/Scribus/scribus/canvas.cpp
==============================================================================
--- trunk/Scribus/scribus/canvas.cpp (original)
+++ trunk/Scribus/scribus/canvas.cpp Sun Nov 25 20:52:42 2012
@@ -473,6 +473,11 @@
 	{
 		currItem = m_doc->Items->at(currNr);
 		if ((m_doc->masterPageMode())  && (!((currItem->OwnPage == -1) || (currItem->OwnPage == static_cast<int>(m_doc->currentPage()->pageNr())))))
+		{
+			--currNr;
+			continue;
+		}
+		if (m_doc->drawAsPreview && !currItem->isAnnotation())
 		{
 			--currNr;
 			continue;
@@ -988,6 +993,9 @@
 	if (!m_doc->masterPageMode())
 	{
 		drawBackgroundPageOutlines(painter, clipx, clipy, clipw, cliph);
+		m_viewMode.linkedFramesToShow.clear();
+		QRectF clip = QRectF(clipx, clipy, clipw, cliph);
+		DrawPageBorder(painter, clip);
 		if (m_viewMode.viewAsPreview)
 		{
 			FPointArray PoLine;
@@ -996,11 +1004,6 @@
 		}
 		else
 			painter->beginLayer(1.0, 0);
-		
-		m_viewMode.linkedFramesToShow.clear();
-		QRectF clip = QRectF(clipx, clipy, clipw, cliph);
-		if (!m_viewMode.viewAsPreview)
-			DrawPageBorder(painter, clip);
 		int renderStackCount = m_doc->guidesPrefs().renderStackOrder.count();
 		for (int r = 0; r < renderStackCount; r++)
 		{
@@ -1610,7 +1613,7 @@
 void Canvas::drawBackgroundPageOutlines(ScPainter* painter, int clipx, int clipy, int clipw, int cliph)
 {
 	uint docPagesCount=m_doc->Pages->count();
-	if (PrefsManager::instance()->appPrefs.displayPrefs.showPageShadow && !m_viewMode.viewAsPreview)
+	if (PrefsManager::instance()->appPrefs.displayPrefs.showPageShadow)
 	{
 		painter->setBrush(QColor(128,128,128));
 		painter->setAntialiasing(false);
@@ -1621,6 +1624,8 @@
 		{
 			actPg = m_doc->Pages->at(a);
 			m_doc->getBleeds(actPg, pageBleeds);
+			if (m_viewMode.viewAsPreview)
+				pageBleeds.resetToZero();
 			double blx = (actPg->xOffset() - pageBleeds.Left) * m_viewMode.scale;
 			double bly = (actPg->yOffset() - pageBleeds.Top) * m_viewMode.scale;
 			double blw = (actPg->width() + pageBleeds.Left + pageBleeds.Right) * m_viewMode.scale;

Modified: trunk/Scribus/scribus/canvasmode_normal.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17909&path=/trunk/Scribus/scribus/canvasmode_normal.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_normal.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_normal.cpp Sun Nov 25 20:52:42 2012
@@ -99,7 +99,7 @@
 	if (m_canvas->m_viewMode.operItemMoving)
 		drawOutline(p, 1.0, 1.0, m_objectDeltaPos.x(), m_objectDeltaPos.y());
 	else
-		drawSelection(p, true);
+		drawSelection(p, !m_doc->drawAsPreview);
 }
 
 void CanvasMode_Normal::enterEvent(QEvent *)
@@ -152,6 +152,8 @@
 {
 	m->accept();
 	m_canvas->m_viewMode.m_MouseButtonPressed = false;
+	if (m_doc->drawAsPreview)
+		return;
 	m_canvas->resetRenderMode();
 //	m_view->stopDragTimer();
 	PageItem *currItem = 0;
@@ -357,16 +359,52 @@
 		hoveredItem = m_canvas->itemUnderCursor(m->globalPos(), hoveredItem, m->modifiers());
 		if (hoveredItem)
 		{
-			if (hoveredItem->asTextFrame() && hoveredItem->frameOverflows())
-			{
-				if (m_canvas->cursorOverTextFrameControl(m->globalPos(), hoveredItem))
-				{
-					QToolTip::showText(m->globalPos() + QPoint(5, 5), tr("Overflow Characters: %1").arg(hoveredItem->frameOverflowCount()), m_canvas);
-				}
+			if (m_doc->drawAsPreview)
+			{
+				if (hoveredItem->isAnnotation())
+				{
+					QString toolT = "";
+					if (!hoveredItem->annotation().ToolTip().isEmpty())
+						toolT = hoveredItem->annotation().ToolTip();
+					if (hoveredItem->annotation().Type() == 2)
+					{
+						if (!hoveredItem->annotation().RollOver().isEmpty())
+							toolT = hoveredItem->annotation().RollOver();
+						else if (!hoveredItem->annotation().Down().isEmpty())
+							toolT = hoveredItem->annotation().Down();
+					}
+					else if (hoveredItem->annotation().Type() == 11)
+					{
+						if (hoveredItem->annotation().ActionType() == 2)
+							toolT = QString( tr("Go to Page %1").arg(hoveredItem->annotation().Ziel() + 1));
+						else if (hoveredItem->annotation().ActionType() == 8)
+							toolT = QString( tr("Go to URL %1").arg(hoveredItem->annotation().Extern()));
+						else if (hoveredItem->annotation().ActionType() == 9)
+							toolT = QString( tr("Go to Page %1 in File %2").arg(hoveredItem->annotation().Ziel() + 1).arg(hoveredItem->annotation().Extern()));
+						qApp->changeOverrideCursor(QCursor(Qt::PointingHandCursor));
+					}
+					if (toolT.isEmpty())
+						toolT = hoveredItem->itemText.plainText();
+					if (!toolT.isEmpty())
+						QToolTip::showText(m->globalPos() + QPoint(5, 5), toolT, m_canvas);
+				}
+				else
+					if (QToolTip::isVisible())
+						QToolTip::hideText();
 			}
 			else
-				if (QToolTip::isVisible())
-					QToolTip::hideText();
+			{
+				if (hoveredItem->asTextFrame() && hoveredItem->frameOverflows())
+				{
+					if (m_canvas->cursorOverTextFrameControl(m->globalPos(), hoveredItem))
+					{
+						QToolTip::showText(m->globalPos() + QPoint(5, 5), tr("Overflow Characters: %1").arg(hoveredItem->frameOverflowCount()), m_canvas);
+					}
+				}
+				else
+					if (QToolTip::isVisible())
+						QToolTip::hideText();
+			}
 		}
 		else
 		{
@@ -375,7 +413,8 @@
 		}
 	}
 	//>>#10116
-
+	if (m_doc->drawAsPreview)
+		return;
 	if ((GetItem(&currItem)) && (!shiftSelItems))
 	{
 		newX = qRound(mousePointDoc.x()); //m_view->translateToDoc(m->x(), m->y()).x());
@@ -779,7 +818,7 @@
 
 	if ((GetItem(&currItem)) && (!m_lastPosWasOverGuide))
 	{
-		if ((currItem->asLine()) && (!m_doc->m_Selection->isMultipleSelection()))
+		if ((currItem->asLine()) && (!m_doc->m_Selection->isMultipleSelection()) && (!m_doc->drawAsPreview))
 		{
 			if (!lineMoveGesture)
 				lineMoveGesture = new LineMove(this);
@@ -794,7 +833,7 @@
 		else
 		{
 			bool isMS=m_doc->m_Selection->isMultipleSelection();
-			if (isMS || (!isMS && (!currItem->locked() && !currItem->sizeLocked())))
+			if ((isMS || (!isMS && (!currItem->locked() && !currItem->sizeLocked()))) && (!m_doc->drawAsPreview))
 			{
 				if (!resizeGesture)
 					resizeGesture = new ResizeGesture(this);
@@ -812,7 +851,7 @@
 		
 		qApp->changeOverrideCursor(Qt::ClosedHandCursor);
 #if 1				
-		if (m_doc->m_Selection->isMultipleSelection())
+		if (m_doc->m_Selection->isMultipleSelection() && (!m_doc->drawAsPreview))
 		{
 			m_canvas->PaintSizeRect(QRect());
 			double gx, gy, gh, gw;
@@ -853,14 +892,14 @@
 				m_doc->m_Selection->delaySignalsOn();
 				m_view->updatesOn(false);
 				SeleItem(m); //Where we send the mouse press event to select an item
-				if (GetItem(&currItem))
+				if (GetItem(&currItem) && (!m_doc->drawAsPreview))
 					frameResizeHandle = m_canvas->frameHitTest(QPointF(mousePointDoc.x(),mousePointDoc.y()), currItem);
 				else
 					frameResizeHandle = 0;
 				m_view->updatesOn(true);
 				m_doc->m_Selection->delaySignalsOff();
 			}
-			if ((currItem && !currItem->locked() && frameResizeHandle > 0) == false)
+			if ((currItem && !currItem->locked() && frameResizeHandle > 0) == false && (!m_doc->drawAsPreview))
 			{
 				m_mouseCurrentPoint = m_mousePressPoint = m_mouseSavedPoint = mousePointDoc;
 			}
@@ -918,12 +957,12 @@
 	m_view->redrawMarker->hide();
 //	m_view->stopDragTimer();
 	//m_canvas->update(); //ugly in a mouseReleaseEvent!!!!!!!
-	if ((!GetItem(&currItem)) && (m->button() == Qt::RightButton) && (!m_doc->DragP))
+	if ((!GetItem(&currItem)) && (m->button() == Qt::RightButton) && (!m_doc->DragP) && (!m_doc->drawAsPreview))
 	{
 		createContextMenu(NULL, mousePointDoc.x(), mousePointDoc.y());
 		return;
 	}
-	if ((GetItem(&currItem)) && (m->button() == Qt::RightButton) && (!m_doc->DragP))
+	if ((GetItem(&currItem)) && (m->button() == Qt::RightButton) && (!m_doc->DragP) && (!m_doc->drawAsPreview))
 	{
 		createContextMenu(currItem, mousePointDoc.x(), mousePointDoc.y());
 		return;
@@ -931,7 +970,7 @@
 	//<<#10116: Click on overflow icon to get into link frame mode
 	PageItem* clickedItem=NULL;
 	clickedItem = m_canvas->itemUnderCursor(m->globalPos(), clickedItem, m->modifiers());
-	if (clickedItem && clickedItem->asTextFrame())
+	if (clickedItem && clickedItem->asTextFrame() && (!m_doc->drawAsPreview))
 	{
 		if (clickedItem->frameOverflows())
 		{
@@ -1171,17 +1210,57 @@
 	for (int i = 0; i < m_doc->m_Selection->count(); ++i)
 		m_doc->m_Selection->itemAt(i)->checkChanges(true);
 	//Commit drag created items to undo manager.
-	if (m_doc->m_Selection->itemAt(0)!=NULL)
-	{
-		m_doc->itemAddCommit(m_doc->m_Selection->itemAt(0));
+	if (m_doc->m_Selection->count() > 0)
+	{
+		if (m_doc->m_Selection->itemAt(0)!=NULL)
+		{
+			m_doc->itemAddCommit(m_doc->m_Selection->itemAt(0));
+		}
 	}
 	//Make sure the Zoom spinbox and page selector dont have focus if we click on the canvas
 	m_view->zoomSpinBox->clearFocus();
 	m_view->pageSelector->clearFocus();
-	if (m_doc->m_Selection->itemAt(0) != 0) // is there the old clip stored for the undo action
-	{
-		currItem = m_doc->m_Selection->itemAt(0);
-		m_doc->nodeEdit.finishTransaction(currItem);
+	if (m_doc->m_Selection->count() > 0)
+	{
+		if (m_doc->m_Selection->itemAt(0) != 0) // is there the old clip stored for the undo action
+		{
+			currItem = m_doc->m_Selection->itemAt(0);
+			m_doc->nodeEdit.finishTransaction(currItem);
+		}
+	}
+	if (m_doc->drawAsPreview)
+	{
+		if (m_doc->m_Selection->count() == 1)
+		{
+			currItem = m_doc->m_Selection->itemAt(0);
+			if (currItem->isAnnotation())
+			{
+				if (currItem->annotation().Type() == 11)
+				{
+					if (currItem->annotation().ActionType() == 2)
+					{
+						m_view->Deselect(true);
+						if (currItem->annotation().Ziel() < m_doc->Pages->count())
+							m_view->GotoPage(currItem->annotation().Ziel());
+						else
+						{
+							QString message = tr("Page %1 does not exist!").arg(currItem->annotation().Ziel() + 1);
+							QMessageBox::warning(m_view, CommonStrings::trWarning, message, CommonStrings::tr_OK);
+						}
+					}
+					else if (currItem->annotation().ActionType() == 8)
+					{
+						QString message = tr("Link Target is Web URL.\nURL: %1").arg(currItem->annotation().Extern());
+						QMessageBox::information(m_view, tr("Information"), message, CommonStrings::tr_OK);
+					}
+					else if (currItem->annotation().ActionType() == 9)
+					{
+						QString message = tr("Link Target is external File.\nFile: %1\nPage: %2").arg(currItem->annotation().Extern()).arg(currItem->annotation().Ziel() + 1);
+						QMessageBox::information(m_view, tr("Information"), message, CommonStrings::tr_OK);
+					}
+				}
+			}
+		}
 	}
 }
 
@@ -1336,6 +1415,8 @@
 			if ((m->modifiers() == SELECT_BENEATH) && m_canvas->frameHitTest(QPointF(mousePointDoc.x(),mousePointDoc.y()), currItem) >= 0)
 				m_doc->m_Selection->clear();
 			//CB: #7186: This was prependItem, does not seem to need to be anymore with current select code
+			if (m_doc->drawAsPreview)
+				m_doc->m_Selection->clear();
 			m_doc->m_Selection->addItem(currItem);
 			if ( (m->modifiers() & SELECT_IN_GROUP) && (!currItem->isGroup()))
 			{

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17909&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Sun Nov 25 20:52:42 2012
@@ -620,7 +620,6 @@
 	connect(inlinePalette, SIGNAL(objectDropped(QString)), this, SLOT(PutToInline(QString)));
 	inlinePalette->installEventFilter(this);
 	inlinePalette->hide();
-	
 
 	undoPalette = new UndoPalette(this, "undoPalette");
 	undoPalette->installEventFilter(this);
@@ -2514,6 +2513,7 @@
 		scrActions["toolsPDFAnnot3D"]->setEnabled(true);
 #endif
 		pagePalette->enablePalette(true);
+		setPreviewToolbar();
 	}
 	scrMenuMgr->setMenuEnabled("ItemLayer", doc->layerCount() > 1);
 }
@@ -8991,6 +8991,8 @@
 #ifdef HAVE_OSG
 	scrActions["toolsPDFAnnot3D"]->setEnabled(false);
 #endif
+	scrActions["viewPreviewMode"]->setEnabled(false);
+	view->previewToolbarButton->setEnabled(false);
 }
 
 void ScribusMainWindow::manageMasterPagesEnd()
@@ -9028,6 +9030,8 @@
 #ifdef HAVE_OSG
 	scrActions["toolsPDFAnnot3D"]->setEnabled(true);
 #endif
+	scrActions["viewPreviewMode"]->setEnabled(true);
+	view->previewToolbarButton->setEnabled(true);
 	uint pageCount=doc->DocPages.count();
 	for (uint c=0; c<pageCount; ++c)
 		Apply_MasterPage(doc->DocPages.at(c)->MPageNam, c, false);
@@ -11232,3 +11236,13 @@
 	delete editMDialog;
 	return docWasChanged;
 }
+
+void ScribusMainWindow::setPreviewToolbar()
+{
+	modeToolBar->setEnabled(!doc->drawAsPreview);
+	editToolBar->setEnabled(!doc->drawAsPreview);
+	pdfToolBar->setEnabled(!doc->drawAsPreview);
+	symbolPalette->setEnabled(!doc->drawAsPreview);
+	inlinePalette->setEnabled(!doc->drawAsPreview);
+	undoPalette->setEnabled(!doc->drawAsPreview);
+}

Modified: trunk/Scribus/scribus/scribus.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17909&path=/trunk/Scribus/scribus/scribus.h
==============================================================================
--- trunk/Scribus/scribus/scribus.h (original)
+++ trunk/Scribus/scribus/scribus.h Sun Nov 25 20:52:42 2012
@@ -183,6 +183,7 @@
 	void restoreUngrouping(SimpleState *state, bool isUndo);
 	void restoreAddPage(SimpleState *state, bool isUndo);
 	void restoreDeletePage(SimpleState *state, bool isUndo);
+	void setPreviewToolbar();
 	struct CopyContentsBuffer contentsBuffer;
 	bool internalCopy;
 	QString internalCopyBuffer;

Modified: trunk/Scribus/scribus/scribusview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17909&path=/trunk/Scribus/scribus/scribusview.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusview.cpp (original)
+++ trunk/Scribus/scribus/scribusview.cpp Sun Nov 25 20:52:42 2012
@@ -424,9 +424,12 @@
 
 void ScribusView::togglePreview()
 {
+	this->requestMode(modeNormal);
+	Deselect(true);
 	undoManager->setUndoEnabled(false);
 	m_canvas->m_viewMode.viewAsPreview = !m_canvas->m_viewMode.viewAsPreview;
 	Doc->drawAsPreview = m_canvas->m_viewMode.viewAsPreview;
+	m_ScMW->propertiesPalette->setEnabled(!m_canvas->m_viewMode.viewAsPreview);
 	if (m_canvas->m_viewMode.viewAsPreview)
 	{
 		storedFramesShown = Doc->guidesPrefs().framesShown;
@@ -460,6 +463,7 @@
 	m_ScMW->scrActions["viewShowBaseline"]->setEnabled(!m_canvas->m_viewMode.viewAsPreview);
 	m_ScMW->scrActions["viewShowTextChain"]->setEnabled(!m_canvas->m_viewMode.viewAsPreview);
 	m_ScMW->scrActions["viewShowTextControls"]->setEnabled(!m_canvas->m_viewMode.viewAsPreview);
+	m_ScMW->setPreviewToolbar();
 #if OPTION_USE_QTOOLBUTTON
 	previewToolbarButton->setChecked(m_canvas->m_viewMode.viewAsPreview);
 #endif

Modified: trunk/Scribus/scribus/ui/annota.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17909&path=/trunk/Scribus/scribus/ui/annota.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/annota.cpp (original)
+++ trunk/Scribus/scribus/ui/annota.cpp Sun Nov 25 20:52:42 2012
@@ -145,6 +145,7 @@
 	SpinBox1->setDecimals(0);
 	SpinBox1->setMinimum(1);
 	SpinBox1->setMaximum(((item->annotation().ActionType() == 7) || (item->annotation().ActionType() == 9)) ? 1000 : Seite);
+	SpinBox1->setSuffix("");
 	TextLabel3 = new QLabel( tr("&Page:"), GroupBox1);
 	TextLabel3->setBuddy(SpinBox1);
 	GroupBox1Layout->addWidget( TextLabel3, 2, 0 );

Modified: trunk/Scribus/scribus/ui/inlinepalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17909&path=/trunk/Scribus/scribus/ui/inlinepalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/inlinepalette.cpp (original)
+++ trunk/Scribus/scribus/ui/inlinepalette.cpp Sun Nov 25 20:52:42 2012
@@ -215,15 +215,22 @@
 	else
 		currDoc = newDoc;
 	if (currDoc == NULL)
+	{
 		InlineViewWidget->clear();
-	else
+		setEnabled(true);
+	}
+	else
+	{
+		setEnabled(!currDoc->drawAsPreview);
 		updateItemList();
+	}
 }
 
 void InlinePalette::unsetDoc()
 {
 	currDoc = NULL;
 	InlineViewWidget->clear();
+	setEnabled(true);
 }
 
 void InlinePalette::handleUpdateRequest(int updateFlags)

Modified: trunk/Scribus/scribus/ui/outlinepalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17909&path=/trunk/Scribus/scribus/ui/outlinepalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/outlinepalette.cpp (original)
+++ trunk/Scribus/scribus/ui/outlinepalette.cpp Sun Nov 25 20:52:42 2012
@@ -475,6 +475,8 @@
 		return;
 	if (!ite->isSelected())
 		slotMultiSelect();
+	if (currDoc->drawAsPreview)
+		return;
 	OutlineTreeItem *item = (OutlineTreeItem*)ite;
 	
 	if (item != NULL)
@@ -862,6 +864,8 @@
 		return;
 	if (currDoc==NULL)
 		return;
+	if (currDoc->drawAsPreview)
+		return;
 	disconnect(reportDisplay, SIGNAL(itemSelectionChanged()), this, SLOT(slotMultiSelect()));
 	selectionTriggered = true;
 	QList<QTreeWidgetItem *> items = reportDisplay->selectedItems();
@@ -909,6 +913,8 @@
 void OutlinePalette::slotSelect(QTreeWidgetItem* ite, int)
 {
 	if (!m_MainWindow || m_MainWindow->scriptIsRunning())
+		return;
+	if (currDoc->drawAsPreview)
 		return;
 	selectionTriggered = true;
 	OutlineTreeItem *item = (OutlineTreeItem*)ite;
@@ -954,6 +960,8 @@
 void OutlinePalette::slotDoubleClick(QTreeWidgetItem* ite, int)
 {
 	if (!m_MainWindow || m_MainWindow->scriptIsRunning())
+		return;
+	if (currDoc->drawAsPreview)
 		return;
 	OutlineTreeItem *item = (OutlineTreeItem*)ite;
 	PageItem *pgItem = NULL;

Modified: trunk/Scribus/scribus/ui/propertiespalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17909&path=/trunk/Scribus/scribus/ui/propertiespalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette.cpp (original)
+++ trunk/Scribus/scribus/ui/propertiespalette.cpp Sun Nov 25 20:52:42 2012
@@ -216,6 +216,7 @@
 
 	m_doc = d;
 	m_item = NULL;
+	setEnabled(!m_doc->drawAsPreview);
 	Cpal->setDocument(m_doc);
 	Cpal->setCurrentItem(NULL);
 	Tpal->setDocument(m_doc);
@@ -248,7 +249,7 @@
 		disconnect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
 		disconnect(m_doc             , SIGNAL(docChanged())      , this, SLOT(handleSelectionChanged()));
 	}
-
+	setEnabled(true);
 	m_haveDoc = false;
 	m_haveItem = false;
 	m_doc=NULL;

Modified: trunk/Scribus/scribus/ui/symbolpalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17909&path=/trunk/Scribus/scribus/ui/symbolpalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/symbolpalette.cpp (original)
+++ trunk/Scribus/scribus/ui/symbolpalette.cpp Sun Nov 25 20:52:42 2012
@@ -202,15 +202,22 @@
 	else
 		currDoc = newDoc;
 	if (currDoc == NULL)
+	{
 		SymbolViewWidget->clear();
-	else
+		setEnabled(true);
+	}
+	else
+	{
+		setEnabled(!currDoc->drawAsPreview);
 		updateSymbolList();
+	}
 }
 
 void SymbolPalette::unsetDoc()
 {
 	currDoc = NULL;
 	SymbolViewWidget->clear();
+	setEnabled(true);
 }
 
 void SymbolPalette::handleUpdateRequest(int updateFlags)




More information about the scribus-commit mailing list