r17971 by fschmid - Added a special button to the lower left part of the canvas to end our special edit modes.

scribus-commit scribus-commit at lists.scribus.net
Wed Dec 19 20:23:39 UTC 2012


Author: fschmid
Date: Wed Dec 19 20:23:39 2012
New Revision: 17971

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17971
Log:
Added a special button to the lower left part of the canvas to end our special edit modes.
Disabled Autosave during special edit modes.

Modified:
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/scribus.h
    trunk/Scribus/scribus/scribusview.cpp
    trunk/Scribus/scribus/scribusview.h
    trunk/Scribus/scribus/ui/clockwidget.cpp

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17971&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Wed Dec 19 20:23:39 2012
@@ -8732,6 +8732,12 @@
 {
 	if (HaveDoc)
 	{
+		m_WasAutoSave = doc->autoSave();
+		if (m_WasAutoSave)
+		{
+			doc->autoSaveTimer->stop();
+			doc->setAutoSave(false);
+		}
 		view->Deselect(true);
 		storedPageNum = doc->currentPageNumber();
 		storedViewXCoor = view->contentsX();
@@ -8799,6 +8805,11 @@
 void ScribusMainWindow::editSymbolEnd()
 {
 	view->hideSymbolPage();
+	if (m_WasAutoSave)
+	{
+		doc->setAutoSave(true);
+		doc->restartAutoSaveTimer();
+	}
 	slotSelect();
 	scrActions["editMasterPages"]->setEnabled(true);
 	scrActions["fileNew"]->setEnabled(true);
@@ -8856,6 +8867,12 @@
 {
 	if (HaveDoc)
 	{
+		m_WasAutoSave = doc->autoSave();
+		if (m_WasAutoSave)
+		{
+			doc->autoSaveTimer->stop();
+			doc->setAutoSave(false);
+		}
 		view->Deselect(true);
 		storedPageNum = doc->currentPageNumber();
 		storedViewXCoor = view->contentsX();
@@ -8908,6 +8925,11 @@
 void ScribusMainWindow::editInlineEnd()
 {
 	view->hideInlinePage();
+	if (m_WasAutoSave)
+	{
+		doc->setAutoSave(true);
+		doc->restartAutoSaveTimer();
+	}
 	slotSelect();
 	scrActions["editMasterPages"]->setEnabled(true);
 	scrActions["fileNew"]->setEnabled(true);
@@ -8967,6 +8989,12 @@
 		return;
 
 	view->Deselect(true);
+	m_WasAutoSave = doc->autoSave();
+	if (m_WasAutoSave)
+	{
+		doc->autoSaveTimer->stop();
+		doc->setAutoSave(false);
+	}
 
 	if (doc->masterPageMode())
 	{
@@ -9022,6 +9050,11 @@
 {
 	view->setScale(storedViewScale);
 	view->hideMasterPage();
+	if (m_WasAutoSave)
+	{
+		doc->setAutoSave(true);
+		doc->restartAutoSaveTimer();
+	}
 	slotSelect();
 	scrActions["editMasterPages"]->setEnabled(true);
 	scrActions["fileNew"]->setEnabled(true);

Modified: trunk/Scribus/scribus/scribus.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17971&path=/trunk/Scribus/scribus/scribus.h
==============================================================================
--- trunk/Scribus/scribus/scribus.h (original)
+++ trunk/Scribus/scribus/scribus.h Wed Dec 19 20:23:39 2012
@@ -634,6 +634,7 @@
 	void insertMark(MarkType);
 	bool insertMarkDialog(PageItem_TextFrame* item, MarkType mT, ScItemsState* &is);
 	int m_marksCount; //remember marks count from last call
+	bool m_WasAutoSave;
 };
 
 #endif

Modified: trunk/Scribus/scribus/scribusview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17971&path=/trunk/Scribus/scribus/scribusview.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusview.cpp (original)
+++ trunk/Scribus/scribus/scribusview.cpp Wed Dec 19 20:23:39 2012
@@ -347,7 +347,6 @@
 	connect(cmsToolbarButton, SIGNAL(clicked()), this, SLOT(toggleCMS()));
 	connect(visualMenu, SIGNAL(activated(int)), this, SLOT(switchPreviewVisual(int)));
 	connect(this, SIGNAL(HaveSel(int)), Doc, SLOT(selectionChanged()));
-	languageChange();
 // Commented out to fix bug #7865
 //	m_dragTimer = new QTimer(this);
 //	connect(m_dragTimer, SIGNAL(timeout()), this, SLOT(dragTimerTimeOut()));
@@ -356,7 +355,12 @@
 	clockLabel = new ClockWidget(this, Doc);
 	clockLabel->setGeometry(m_vhRulerHW + 1, height() - m_vhRulerHW - 61, 60, 60);
 	clockLabel->setVisible(false);
+	endEditButton = new QPushButton(loadIcon("22/exit.png"), tr("End Edit"), this);
+	endEditButton->setGeometry(m_vhRulerHW + 1, height() - m_vhRulerHW - endEditButton->minimumSizeHint().height() - 1, endEditButton->minimumSizeHint().width(), endEditButton->minimumSizeHint().height());
+	endEditButton->setVisible(false);
+	connect(endEditButton, SIGNAL(clicked()), m_ScMW, SLOT(slotFileClose()));
 	editOnPreviewToolbarButton->hide();
+	languageChange();
 }
 
 ScribusView::~ScribusView()
@@ -395,6 +399,7 @@
 	previewToolbarButton->setToolTip( tr("Enable/disable the Preview Mode"));
 	editOnPreviewToolbarButton->setToolTip( tr("Enable/disable editing the Preview Mode"));
 	visualMenu->setToolTip( tr("Select the visual appearance of the display. You can choose between normal and several color blindness forms"));
+	endEditButton->setToolTip( tr("Click here to leave this special edit mode."));
 	disconnect(visualMenu, SIGNAL(activated(int)), this, SLOT(switchPreviewVisual(int)));
 	visualMenu->clear();
 	visualMenu->addItem(CommonStrings::trVisionNormal);
@@ -2116,6 +2121,7 @@
 		clockLabel->setGeometry(m_vhRulerHW + 1, height() - m_vhRulerHW - 16, 15, 15);
 		clockLabel->setFixedSize(15, 15);
 	}
+	endEditButton->setGeometry(m_vhRulerHW + 1, height() - m_vhRulerHW - endEditButton->minimumSizeHint().height() - 1, endEditButton->minimumSizeHint().width(), endEditButton->minimumSizeHint().height());
 	m_canvas->m_viewMode.forceRedraw = true;
 	m_canvas->resetRenderMode();
 	// Per Qt doc, not painting should be done in a resizeEvent,
@@ -2730,6 +2736,7 @@
 	oldY = qRound(Doc->currentPage()->yOffset()- 10);
 	SetCPo(Doc->currentPage()->xOffset() - 10, Doc->currentPage()->yOffset() - 10);
 	updateOn = true;
+	endEditButton->setVisible(true);
 	DrawNew();
 }
 
@@ -2740,6 +2747,7 @@
 		this->requestMode(modeNormal);
 	Doc->setMasterPageMode(false);
 	pageSelector->setEnabled(true);
+	endEditButton->setVisible(false);
 	resizeContents(qRound((Doc->maxCanvasCoordinate.x() - Doc->minCanvasCoordinate.x()) * m_canvas->scale()), qRound((Doc->maxCanvasCoordinate.y() - Doc->minCanvasCoordinate.y()) * m_canvas->scale()));
 }
 
@@ -2759,6 +2767,7 @@
 	oldY = qRound(Doc->currentPage()->yOffset()- 10);
 	SetCPo(Doc->currentPage()->xOffset() - 10, Doc->currentPage()->yOffset() - 10);
 	updateOn = true;
+	endEditButton->setVisible(true);
 	DrawNew();
 }
 
@@ -2770,6 +2779,7 @@
 		this->requestMode(modeNormal);
 	Doc->setSymbolEditMode(false);
 	updatesOn(true);
+	endEditButton->setVisible(false);
 	Doc->setCurrentPage(Doc->Pages->at(0));
 	pageSelector->setEnabled(true);
 	layerMenu->setEnabled(true);
@@ -2792,6 +2802,7 @@
 	oldY = qRound(Doc->currentPage()->yOffset()- 10);
 	SetCPo(Doc->currentPage()->xOffset() - 10, Doc->currentPage()->yOffset() - 10);
 	updateOn = true;
+	endEditButton->setVisible(true);
 	DrawNew();
 }
 
@@ -2803,6 +2814,7 @@
 		this->requestMode(modeNormal);
 	Doc->setInlineEditMode(false);
 	updatesOn(true);
+	endEditButton->setVisible(false);
 	Doc->setCurrentPage(Doc->Pages->at(0));
 	pageSelector->setEnabled(true);
 	layerMenu->setEnabled(true);

Modified: trunk/Scribus/scribus/scribusview.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17971&path=/trunk/Scribus/scribus/scribusview.h
==============================================================================
--- trunk/Scribus/scribus/scribusview.h (original)
+++ trunk/Scribus/scribus/scribusview.h Wed Dec 19 20:23:39 2012
@@ -144,6 +144,7 @@
 	QComboBox *previewQualitySwitcher; //Menu for image preview quality
 	QComboBox *visualMenu;
 	ClockWidget *clockLabel;
+	QPushButton *endEditButton;
   /** Dokument zu dem die Seite gehoert */
 	ScribusDoc * const Doc;
 	Canvas * const m_canvas;

Modified: trunk/Scribus/scribus/ui/clockwidget.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17971&path=/trunk/Scribus/scribus/ui/clockwidget.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/clockwidget.cpp (original)
+++ trunk/Scribus/scribus/ui/clockwidget.cpp Wed Dec 19 20:23:39 2012
@@ -107,7 +107,7 @@
 
 void ClockWidget::updateDisplay()
 {
-	if (m_doc->autoSave() && m_doc->autoSaveClockDisplay())
+	if (m_doc->autoSave() && m_doc->autoSaveClockDisplay() && (m_doc->appMode == modeNormal))
 	{
 		if (!isVisible())
 			setVisible(true);




More information about the scribus-commit mailing list