diff options
author | Tomaz Canabrava <tomaz.canabrava@gmail.com> | 2015-05-17 18:50:22 -0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-05-17 15:02:57 -0700 |
commit | 253d9ff300e7d3f871fb67c5a16463c08fdef519 (patch) | |
tree | 5d9e6b41c01baa988087e957ce90db3fed9b2306 /qt-ui/maintab.cpp | |
parent | c2f77353eea26462311964f33515f7f91136abe9 (diff) | |
download | subsurface-253d9ff300e7d3f871fb67c5a16463c08fdef519.tar.gz |
Use the QtWaitingSpinner instead of blocking the MainTab
We shouldn't allow the user to change the location when we are probing
the web for the correct places if we are updating an old file from
Subsurface. This makes use of a pleasant spinner that works beautifully.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/maintab.cpp')
-rw-r--r-- | qt-ui/maintab.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index dff005774..fd760445b 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -186,6 +186,15 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent), ui.socialNetworks->setVisible(false); #endif + ui.waitingSpinner->setRoundness(70.0); + ui.waitingSpinner->setMinimumTrailOpacity(15.0); + ui.waitingSpinner->setTrailFadePercentage(70.0); + ui.waitingSpinner->setNumberOfLines(8); + ui.waitingSpinner->setLineLength(5); + ui.waitingSpinner->setLineWidth(3); + ui.waitingSpinner->setInnerRadius(5); + ui.waitingSpinner->setRevolutionsPerSecond(1); + acceptingEdit = false; } @@ -202,12 +211,14 @@ MainTab::~MainTab() void MainTab::enableGeoLoockupEdition() { - setEnabled(true); + ui.waitingSpinner->stop(); + ui.manageDiveSite->show(); } void MainTab::disableGeoLoockupEdition() { - setDisabled(true); + ui.waitingSpinner->start(); + ui.manageDiveSite->hide(); } void MainTab::prepareDiveSiteEdit() { @@ -407,7 +418,7 @@ void MainTab::updateDiveInfo(bool clear) // don't execute this while adding / planning a dive if (editMode == ADD || editMode == MANUALLY_ADDED_DIVE || MainWindow::instance()->graphics()->isPlanner()) return; - if (!isEnabled() && !clear && !ReverseGeoLoockupThread::instance()->isRunning()) + if (!isEnabled() && !clear ) setEnabled(true); if (isEnabled() && clear) setEnabled(false); |