r21262 by fschmid -

scribus-commit scribus-commit at lists.scribus.net
Sat Apr 30 10:28:44 UTC 2016


Author: fschmid
Date: Sat Apr 30 10:28:44 2016
New Revision: 21262

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=21262
Log:
Fixed Bug #13992: Node Editor lacks a preview function

Modified:
    trunk/Scribus/scribus/canvasmode_nodeedit.cpp
    trunk/Scribus/scribus/nodeeditcontext.cpp
    trunk/Scribus/scribus/nodeeditcontext.h
    trunk/Scribus/scribus/ui/nodeeditpalette.cpp
    trunk/Scribus/scribus/ui/nodeeditpalette.h

Modified: trunk/Scribus/scribus/canvasmode_nodeedit.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21262&path=/trunk/Scribus/scribus/canvasmode_nodeedit.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_nodeedit.cpp	(original)
+++ trunk/Scribus/scribus/canvasmode_nodeedit.cpp	Sat Apr 30 10:28:44 2016
@@ -54,6 +54,8 @@
 {
 	double x, y;
 	if (m_doc->m_Selection->count() == 0)
+		return;
+	if (m_doc->nodeEdit.previewMode())
 		return;
 	PageItem* currItem = m_doc->m_Selection->itemAt(0);
 	FPointArray cli;

Modified: trunk/Scribus/scribus/nodeeditcontext.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21262&path=/trunk/Scribus/scribus/nodeeditcontext.cpp
==============================================================================
--- trunk/Scribus/scribus/nodeeditcontext.cpp	(original)
+++ trunk/Scribus/scribus/nodeeditcontext.cpp	Sat Apr 30 10:28:44 2016
@@ -17,7 +17,8 @@
 	m_MoveSym(false),
 	m_SelNode(),
 	m_oldItemX(0.0),
-	m_oldItemY(0.0)
+	m_oldItemY(0.0),
+	m_preview(false)
 {
 }
 
@@ -46,9 +47,13 @@
 	nodeTransaction.reset();
 	m_MoveSym = false;
 	m_SelNode.clear();
-}
-
-
+	m_preview = false;
+}
+
+void NodeEditContext::setPreviewMode(bool mode)
+{
+	m_preview = mode;
+}
 
 FPointArray NodeEditContext::beginTransaction(PageItem* currItem)
 {

Modified: trunk/Scribus/scribus/nodeeditcontext.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21262&path=/trunk/Scribus/scribus/nodeeditcontext.h
==============================================================================
--- trunk/Scribus/scribus/nodeeditcontext.h	(original)
+++ trunk/Scribus/scribus/nodeeditcontext.h	Sat Apr 30 10:28:44 2016
@@ -58,6 +58,8 @@
 		bool hasNodeSelected();
 		void deselect();
 		void reset();
+		void setPreviewMode(bool mode);
+		bool previewMode() { return m_preview; }
 		int submode() { return m_submode; }
 		void setSubMode(int i) { m_submode = i; }
 		void reset1Control(PageItem* currItem);
@@ -86,5 +88,6 @@
 		QList<int> m_SelNode;
 		double m_oldItemX;
 		double m_oldItemY;
+		bool m_preview;
 };
 #endif

Modified: trunk/Scribus/scribus/ui/nodeeditpalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21262&path=/trunk/Scribus/scribus/ui/nodeeditpalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/nodeeditpalette.cpp	(original)
+++ trunk/Scribus/scribus/ui/nodeeditpalette.cpp	Sat Apr 30 10:28:44 2016
@@ -234,6 +234,11 @@
 
 	QSpacerItem* spacer = new QSpacerItem( 3, 3, QSizePolicy::Fixed, QSizePolicy::Fixed );
 	vboxLayout->addItem(spacer);
+
+	PreviewMode = new QCheckBox(this);
+	PreviewMode->setChecked(false);
+	vboxLayout->addWidget(PreviewMode);
+
 	AbsMode = new QGroupBox( "&Absolute Coordinates", this );
 	AbsMode->setCheckable(true);
 	AbsMode->setChecked(false);
@@ -339,6 +344,7 @@
 	connect(ResetCont, SIGNAL(clicked()), this, SLOT(ResetContour()));
 	connect(ResetContClip, SIGNAL(clicked()), this, SLOT(ResetContourToImageClip()));
 	connect(ResetShape2Clip, SIGNAL(clicked()), this, SLOT(ResetShapeToImageClip()));
+	connect(PreviewMode, SIGNAL(clicked()), this, SLOT(TogglePreview()));
 }
 
 void NodePalette::disconnectSignals()
@@ -374,6 +380,7 @@
 	disconnect(ResetCont, SIGNAL(clicked()), this, SLOT(ResetContour()));
 	disconnect(ResetContClip, SIGNAL(clicked()), this, SLOT(ResetContourToImageClip()));
 	disconnect(ResetShape2Clip, SIGNAL(clicked()), this, SLOT(ResetShapeToImageClip()));
+	disconnect(PreviewMode, SIGNAL(clicked()), this, SLOT(TogglePreview()));
 }
 
 void NodePalette::setDoc(ScribusDoc *dc, ScribusView *vi)
@@ -729,6 +736,15 @@
 	connect(YSpin, SIGNAL(valueChanged(double)), this, SLOT(MovePoint()));
 }
 
+void NodePalette::TogglePreview()
+{
+	if (m_doc != 0)
+	{
+		m_doc->nodeEdit.setPreviewMode(PreviewMode->isChecked());
+		m_doc->regionsChanged()->update(QRectF());
+	}
+}
+
 void NodePalette::HaveNode(bool have, bool mov)
 {
 	if (m_doc==0)
@@ -910,6 +926,7 @@
 		m_doc->nodeEdit.setSegP1(-1);
 		m_doc->nodeEdit.setSegP2(-1);
 		m_doc->nodeEdit.selNode().clear();
+		m_doc->nodeEdit.setPreviewMode(false);
 		EditCont->setChecked(false);
 		ToggleConMode();
 		PageItem *currItem = m_doc->m_Selection->itemAt(0);
@@ -932,6 +949,7 @@
 		m_doc->nodeEdit.setSegP1(-1);
 		m_doc->nodeEdit.setSegP2(-1);
 		m_doc->nodeEdit.selNode().clear();
+		m_doc->nodeEdit.setPreviewMode(false);
 		EditCont->setChecked(false);
 		ToggleConMode();
 		PageItem *currItem = m_doc->m_Selection->itemAt(0);
@@ -958,6 +976,7 @@
 		m_doc->nodeEdit.setSegP1(-1);
 		m_doc->nodeEdit.setSegP2(-1);
 		m_doc->nodeEdit.selNode().clear();
+		m_doc->nodeEdit.setPreviewMode(false);
 		PageItem *currItem = m_doc->m_Selection->itemAt(0);
 		if (EditCont->isChecked())
 			currItem->ContourLine = itemContourPath.copy();
@@ -1008,6 +1027,7 @@
 	absToPage->setText( tr("to Page"));
 	TextLabel1->setText( tr("&X-Pos:"));
 	TextLabel2->setText( tr("&Y-Pos:"));
+	PreviewMode->setText( tr("Preview Object"));
 	EditCont->setText( tr("Edit &Contour Line"));
 	ResetCont->setText( tr("&Reset Contour Line"));
 	ResetContClip->setText( tr("Set Contour to Image Clip"));

Modified: trunk/Scribus/scribus/ui/nodeeditpalette.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21262&path=/trunk/Scribus/scribus/ui/nodeeditpalette.h
==============================================================================
--- trunk/Scribus/scribus/ui/nodeeditpalette.h	(original)
+++ trunk/Scribus/scribus/ui/nodeeditpalette.h	Sat Apr 30 10:28:44 2016
@@ -61,6 +61,7 @@
 	QToolButton* Shrink;
 	QToolButton* Enlarge;
 	QToolButton* Reduce;
+	QCheckBox* PreviewMode;
 	QGroupBox* AbsMode;
 	QRadioButton* absToCanvas;
 	QRadioButton* absToPage;
@@ -109,6 +110,7 @@
 	void ShearD();
 	void ToggleAbsMode();
 	void ToggleConMode();
+	void TogglePreview();
 
 public slots:
 	void MoveN();




More information about the scribus-commit mailing list