From e256d3fa6affdae25e5b99186501c19eaeea03ac Mon Sep 17 00:00:00 2001 From: Mark Liversedge Date: Sun, 2 Dec 2012 08:16:35 +0000 Subject: [PATCH] UI Nits: Importing GTC Export screen updates When importing a GTC export (which contains multiple ride files in a single .TCX) the screen update stalls whilst the file is split. The import dialog is half drawn and looks ugly to the user for a split second. We now delay updates until the export has been expanded into separate files, which means there is a slightly longer delay as the file is initially processed, but the screen updates are cleaner. --- src/RideImportWizard.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/RideImportWizard.cpp b/src/RideImportWizard.cpp index 869d28856..c37553aba 100644 --- a/src/RideImportWizard.cpp +++ b/src/RideImportWizard.cpp @@ -254,9 +254,9 @@ RideImportWizard::process() } - QApplication::processEvents(); if (aborted) { done(0); } repaint(); + QApplication::processEvents(); // Pass 2 - Read in with the relevant RideFileReader method @@ -273,8 +273,10 @@ RideImportWizard::process() tableWidget->item(i,5)->setText(tr("Parsing...")); tableWidget->setCurrentCell(i,5); QApplication::processEvents(); + if (aborted) { done(0); } this->repaint(); + QApplication::processEvents(); QList rides; RideFile *ride = RideFileFactory::instance().openRideFile(mainWindow, thisfile, errors, &rides); @@ -295,6 +297,7 @@ RideImportWizard::process() (willhave > 9 && willhave < 17) ? 8 : 0), 118 + (willhave > 16 ? 17*20 : (willhave+1) * 20)); + // ok so create a temporary file and add to the tableWidget int counter = 0; foreach(RideFile *extracted, rides) { @@ -355,8 +358,8 @@ RideImportWizard::process() counter++; tableWidget->adjustSize(); - QApplication::processEvents(); } + QApplication::processEvents(); // progress bar needs to adjust...