r17797 by fschmid - Fixed Bug #11113 by addding a clock like display in the bottom left edge of the view.

scribus-commit scribus-commit at lists.scribus.net
Sat Oct 13 17:04:55 UTC 2012


Author: fschmid
Date: Sat Oct 13 17:04:54 2012
New Revision: 17797

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17797
Log:
Fixed Bug #11113 by addding a clock like display in the bottom left edge of the view.
It can be minimized to a small square with an "A" by clicking on it. Click again on that
"A" to display the clock again.

Added:
    trunk/Scribus/scribus/ui/clockwidget.cpp
    trunk/Scribus/scribus/ui/clockwidget.h
Modified:
    trunk/Scribus/scribus/CMakeLists.txt
    trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/scribusdoc.cpp
    trunk/Scribus/scribus/scribusdoc.h
    trunk/Scribus/scribus/scribusview.cpp
    trunk/Scribus/scribus/scribusview.h

Modified: trunk/Scribus/scribus/CMakeLists.txt
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17797&path=/trunk/Scribus/scribus/CMakeLists.txt
==============================================================================
--- trunk/Scribus/scribus/CMakeLists.txt (original)
+++ trunk/Scribus/scribus/CMakeLists.txt Sat Oct 13 17:04:54 2012
@@ -275,6 +275,7 @@
   ui/charselectenhanced.h
   ui/charzoom.h
   ui/checkDocument.h
+  ui/clockwidget.h
   ui/cmsprefs.h
   ui/cmykfw.h
   ui/collectforoutput_ui.h
@@ -706,6 +707,7 @@
   ui/charselectenhanced.cpp
   ui/charzoom.cpp
   ui/checkDocument.cpp
+  ui/clockwidget.cpp
   ui/cmsprefs.cpp
   ui/cmykfw.cpp
   ui/collectforoutput_ui.cpp

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17797&path=/trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp Sat Oct 13 17:04:54 2012
@@ -726,7 +726,8 @@
 
 	// start auto save timer if needed
 	if (m_Doc->autoSave()  && ScCore->usingGUI())
-		m_Doc->autoSaveTimer->start(m_Doc->autoSaveTime());
+		m_Doc->restartAutoSaveTimer();
+//		m_Doc->autoSaveTimer->start(m_Doc->autoSaveTime());
 	
 	if (m_mwProgressBar!=0)
 		m_mwProgressBar->setValue(reader.characterOffset());

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17797&path=/trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp Sat Oct 13 17:04:54 2012
@@ -1158,7 +1158,8 @@
 
 	// start auto save timer if needed
 	if (m_Doc->autoSave() && ScCore->usingGUI())
-		m_Doc->autoSaveTimer->start(m_Doc->autoSaveTime());
+		m_Doc->restartAutoSaveTimer();
+//		m_Doc->autoSaveTimer->start(m_Doc->autoSaveTime());
 	
 	if (m_mwProgressBar!=0)
 		m_mwProgressBar->setValue(DOC.childNodes().count());

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17797&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp Sat Oct 13 17:04:54 2012
@@ -1817,7 +1817,8 @@
 
 	// start auto save timer if needed
 	if (m_Doc->autoSave()  && ScCore->usingGUI())
-		m_Doc->autoSaveTimer->start(m_Doc->autoSaveTime());
+		m_Doc->restartAutoSaveTimer();
+//		m_Doc->autoSaveTimer->start(m_Doc->autoSaveTime());
 	
 	if (m_mwProgressBar!=0)
 		m_mwProgressBar->setValue(reader.characterOffset());

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17797&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Sat Oct 13 17:04:54 2012
@@ -2068,6 +2068,8 @@
 		connect(ScCore->fileWatcher, SIGNAL(fileChanged(QString)), tempDoc, SLOT(updatePict(QString)));
 		connect(ScCore->fileWatcher, SIGNAL(fileDeleted(QString)), tempDoc, SLOT(removePict(QString)));
 		connect(ScCore->fileWatcher, SIGNAL(dirChanged(QString )), tempDoc, SLOT(updatePictDir(QString )));
+		connect(doc, SIGNAL(updateAutoSaveClock()), view->clockLabel, SLOT(resetTime()));
+		view->clockLabel->resetTime();
 		//scrActions["fileSave"]->setEnabled(false);
 		tempView->cmsToolbarButton->setChecked(tempDoc->HasCMS);
 		undoManager->switchStack(tempDoc->DocName);
@@ -4212,6 +4214,8 @@
 		doc->connectDocSignals();
 		if (doc->autoSave())
 			doc->autoSaveTimer->start(doc->autoSaveTime());
+		connect(doc, SIGNAL(updateAutoSaveClock()), view->clockLabel, SLOT(resetTime()));
+		view->clockLabel->resetTime();
 // 		scrActions["fileSave"]->setEnabled(false);
 		doc->NrItems = bookmarkPalette->BView->NrItems;
 		doc->First = bookmarkPalette->BView->First;

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17797&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Sat Oct 13 17:04:54 2012
@@ -15576,6 +15576,7 @@
 	autoSaveTimer->stop();
 	if (docPrefsData.docSetupPrefs.AutoSave)
 		autoSaveTimer->start(docPrefsData.docSetupPrefs.AutoSaveTime);
+	emit updateAutoSaveClock();
 
 /*	FIXME: scribus determines dict by charstyle now, so this setting should go into the doc's default charstyle
 		currDoc->docHyphenator->slotNewDict(ScMW->GetLang(tabHyphenator->language->currentText()));
@@ -15997,3 +15998,11 @@
 	changed();
 	regionsChanged()->update(QRect());
 }
+
+void ScribusDoc::restartAutoSaveTimer()
+{
+	autoSaveTimer->stop();
+	if (docPrefsData.docSetupPrefs.AutoSave)
+		autoSaveTimer->start(docPrefsData.docSetupPrefs.AutoSaveTime);
+	emit updateAutoSaveClock();
+}

Modified: trunk/Scribus/scribus/scribusdoc.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17797&path=/trunk/Scribus/scribus/scribusdoc.h
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.h (original)
+++ trunk/Scribus/scribus/scribusdoc.h Sat Oct 13 17:04:54 2012
@@ -1381,6 +1381,7 @@
 	//! Signal a change in rotation mode (aka basepoint)
 	void rotationMode(int);
 	void updateEditItem();
+	void updateAutoSaveClock();
 	
 public slots:
 	void selectionChanged();
@@ -1621,6 +1622,7 @@
 	void itemSelection_UnWeld();
 	void itemSelection_Weld();
 	void itemSelection_EditWeld();
+	void restartAutoSaveTimer();
 };
 
 Q_DECLARE_METATYPE(ScribusDoc*);

Modified: trunk/Scribus/scribus/scribusview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17797&path=/trunk/Scribus/scribus/scribusview.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusview.cpp (original)
+++ trunk/Scribus/scribus/scribusview.cpp Sat Oct 13 17:04:54 2012
@@ -135,10 +135,7 @@
 #include "plugins/formatidlist.h"
 #include <tiffio.h>
 
-
 using namespace std;
-
-
 
 ScribusView::ScribusView(QWidget* win, ScribusMainWindow* mw, ScribusDoc *doc) :
 	QScrollArea(win),
@@ -340,6 +337,9 @@
 //	connect(m_dragTimer, SIGNAL(timeout()), this, SLOT(dragTimerTimeOut()));
 //	m_dragTimer->stop();
 	m_dragTimerFired = false;
+	clockLabel = new ClockWidget(this, Doc);
+	clockLabel->setGeometry(m_vhRulerHW + 1, height() - m_vhRulerHW - 61, 60, 60);
+	clockLabel->setVisible(false);
 }
 
 ScribusView::~ScribusView()
@@ -2031,6 +2031,16 @@
 	horizRuler->setGeometry(m_vhRulerHW, 1, width()-m_vhRulerHW-1, m_vhRulerHW);
 	vertRuler->setGeometry(1, m_vhRulerHW, m_vhRulerHW, height()-m_vhRulerHW-1);
 	rulerMover->setGeometry(1, 1, m_vhRulerHW, m_vhRulerHW);
+	if (clockLabel->isExpanded())
+	{
+		clockLabel->setGeometry(m_vhRulerHW + 1, height() - m_vhRulerHW - 61, 60, 60);
+		clockLabel->setFixedSize(60, 60);
+	}
+	else
+	{
+		clockLabel->setGeometry(m_vhRulerHW + 1, height() - m_vhRulerHW - 16, 15, 15);
+		clockLabel->setFixedSize(15, 15);
+	}
 	m_canvas->m_viewMode.forceRedraw = true;
 	m_canvas->resetRenderMode();
 	// Per Qt doc, not painting should be done in a resizeEvent,

Modified: trunk/Scribus/scribus/scribusview.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17797&path=/trunk/Scribus/scribus/scribusview.h
==============================================================================
--- trunk/Scribus/scribus/scribusview.h (original)
+++ trunk/Scribus/scribus/scribusview.h Sat Oct 13 17:04:54 2012
@@ -65,6 +65,7 @@
 #include "observable.h"
 #include "scribusapi.h"
 #include "scribusdoc.h"
+#include "ui/clockwidget.h"
 
 class Canvas;
 class CanvasMode;
@@ -83,7 +84,6 @@
 class UndoManager;
 class UndoTransaction;
 class TransactionSettings;
-
 
 /**
  * This class provides an incomplete base for your application view.
@@ -141,6 +141,7 @@
 	QComboBox *unitSwitcher; //Menu for units at bottom of view
 	QComboBox *previewQualitySwitcher; //Menu for image preview quality
 	QComboBox *visualMenu;
+	ClockWidget *clockLabel;
   /** Dokument zu dem die Seite gehoert */
 	ScribusDoc * const Doc;
 	Canvas * const m_canvas;




More information about the scribus-commit mailing list