[qet] [3519] Add a progress bar on save file action

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 3519
Author:   scorpio810
Date:     2014-11-26 19:48:24 +0100 (Wed, 26 Nov 2014)
Log Message:
-----------
Add a progress bar on save file action

Modified Paths:
--------------
    trunk/sources/qetdiagrameditor.cpp
    trunk/sources/qetdiagrameditor.h

Modified: trunk/sources/qetdiagrameditor.cpp
===================================================================
--- trunk/sources/qetdiagrameditor.cpp	2014-11-26 14:10:00 UTC (rev 3518)
+++ trunk/sources/qetdiagrameditor.cpp	2014-11-26 18:48:24 UTC (rev 3519)
@@ -627,12 +627,18 @@
 		QETResult saved = project_view -> save();
 		if (saved.isOk()) {
 			QETApp::projectsRecentFiles() -> fileWasOpened(project_view -> project() -> filePath());
-
+			//fake progressbar
+			progressBar = new QProgressBar;
+			progressBar -> setAlignment(Qt::AlignLeft);
+			progressBar -> setMaximumSize(180, 19);
+			statusBar()-> addPermanentWidget(progressBar);
+			progressBar -> setFormat(tr("Enregistrement : %p%", "Visual rendering of write files - %p is the progress percentage"));
+			progressBar -> setValue(100);
+			QTimer::singleShot(2000, progressBar, SLOT(hide()));
 			QString title = (project_view -> project() -> title ());
 			if (title.isEmpty()) title = "QElectroTech ";
 			QString filePath = (project_view -> project() -> filePath ());
-
-			statusBar()->showMessage(tr("Projet %1 enregistr\351 dans le repertoire: %2.").arg(title).arg (filePath), 2000);
+			statusBar()-> showMessage(tr("Projet %1 enregistr\351 dans le repertoire: %2.").arg(title).arg (filePath), 2000);
 		} else {
 			showError(saved);
 		}
@@ -648,7 +654,14 @@
 		QETResult save_file = project_view -> saveAs();
 		if (save_file.isOk()) {
 			QETApp::projectsRecentFiles() -> fileWasOpened(project_view -> project() -> filePath());
-
+			//fake progressbar
+			progressBar = new QProgressBar;
+			progressBar -> setAlignment(Qt::AlignLeft);
+			progressBar -> setMaximumSize(180, 19);
+			statusBar()-> addPermanentWidget(progressBar);
+			progressBar -> setFormat(tr("Enregistrement : %p%", "Visual rendering of write files - %p is the progress percentage"));
+			progressBar -> setValue(100);
+			QTimer::singleShot(2000, progressBar, SLOT(hide()));
 			QString title = (project_view -> project() -> title ());
 			if (title.isEmpty()) title = "QElectroTech ";
 			QString filePath = (project_view -> project() -> filePath ());

Modified: trunk/sources/qetdiagrameditor.h
===================================================================
--- trunk/sources/qetdiagrameditor.h	2014-11-26 14:10:00 UTC (rev 3518)
+++ trunk/sources/qetdiagrameditor.h	2014-11-26 18:48:24 UTC (rev 3519)
@@ -210,6 +210,7 @@
 	QAction *close_file;			   ///< Close current project file
 	QAction *save_file;				   ///< Save current project
 	QAction *save_file_as;			   ///< Save current project as a specific file
+	QProgressBar *progressBar;
 
 	private:
 	QMdiArea workspace;


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/