mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	QML UI: redesign the user notification
The old system of cloud access updates with fake percentages just wasn't helpful. Even worse, it hid a lot important information from the user. This should be more useful (but it will require that we localize the messages sent from the git progress notifications and make them more 'user ready'). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									2d5f023b58
								
							
						
					
					
						commit
						b2b51c833a
					
				
					 9 changed files with 106 additions and 130 deletions
				
			
		| 
						 | 
				
			
			@ -66,16 +66,17 @@
 | 
			
		|||
QProgressDialog *progressDialog = NULL;
 | 
			
		||||
bool progressDialogCanceled = false;
 | 
			
		||||
 | 
			
		||||
extern "C" int updateProgress(bool reset, const char *text)
 | 
			
		||||
extern "C" int updateProgress(const char *text)
 | 
			
		||||
{
 | 
			
		||||
	static int percent;
 | 
			
		||||
 | 
			
		||||
	if (reset)
 | 
			
		||||
		percent = 0;
 | 
			
		||||
	static int progress = 0;
 | 
			
		||||
	if (verbose)
 | 
			
		||||
		qDebug() << "git storage:" << +percent << "% (" << text << ")";
 | 
			
		||||
	if (progressDialog)
 | 
			
		||||
		progressDialog->setValue(percent);
 | 
			
		||||
		qDebug() << "git storage:" << text;
 | 
			
		||||
	if (progressDialog) {
 | 
			
		||||
		progressDialog->setLabelText(text);
 | 
			
		||||
		progressDialog->setValue(++progress);
 | 
			
		||||
		if (progress == 100)
 | 
			
		||||
			progress = 0; // yes this is silly, but we really don't know how long it will take
 | 
			
		||||
	}
 | 
			
		||||
	qApp->processEvents();
 | 
			
		||||
	return progressDialogCanceled;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -2015,7 +2016,7 @@ void MainWindow::showProgressBar()
 | 
			
		|||
 | 
			
		||||
	progressDialog = new QProgressDialog(tr("Contacting cloud service..."), tr("Cancel"), 0, 100, this);
 | 
			
		||||
	progressDialog->setWindowModality(Qt::WindowModal);
 | 
			
		||||
	progressDialog->setMinimumDuration(200);
 | 
			
		||||
	progressDialog->setMinimumDuration(0);
 | 
			
		||||
	progressDialogCanceled = false;
 | 
			
		||||
	connect(progressDialog, SIGNAL(canceled()), this, SLOT(cancelCloudStorageOperation()));
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue