aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@gmail.com>2015-05-17 18:50:22 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-05-17 15:02:57 -0700
commit253d9ff300e7d3f871fb67c5a16463c08fdef519 (patch)
tree5d9e6b41c01baa988087e957ce90db3fed9b2306
parentc2f77353eea26462311964f33515f7f91136abe9 (diff)
downloadsubsurface-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>
-rw-r--r--qt-ui/maintab.cpp17
-rw-r--r--qt-ui/maintab.ui28
2 files changed, 32 insertions, 13 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);
diff --git a/qt-ui/maintab.ui b/qt-ui/maintab.ui
index bfa93b5b5..da8cabecb 100644
--- a/qt-ui/maintab.ui
+++ b/qt-ui/maintab.ui
@@ -22,8 +22,7 @@
<number>0</number>
</property>
<item row="2" column="1">
- <widget class="KMessageWidget" name="diveNotesMessage" native="true">
- </widget>
+ <widget class="KMessageWidget" name="diveNotesMessage" native="true"/>
</item>
<item row="3" column="1">
<widget class="QScrollArea" name="scrollArea">
@@ -41,8 +40,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>441</width>
- <height>753</height>
+ <width>417</width>
+ <height>744</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
@@ -142,6 +141,9 @@
</property>
</widget>
</item>
+ <item>
+ <widget class="QtWaitingSpinner" name="waitingSpinner" native="true"/>
+ </item>
</layout>
</item>
<item>
@@ -385,8 +387,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>68</width>
- <height>40</height>
+ <width>98</width>
+ <height>55</height>
</rect>
</property>
<layout class="QGridLayout" name="equipmentTabScrollAreaLayout">
@@ -441,8 +443,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>441</width>
- <height>363</height>
+ <width>330</width>
+ <height>334</height>
</rect>
</property>
<layout class="QGridLayout" name="diveInfoScrollAreaLayout">
@@ -758,8 +760,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>446</width>
- <height>215</height>
+ <width>328</width>
+ <height>208</height>
</rect>
</property>
<layout class="QGridLayout" name="statsScrollAreaLayout">
@@ -1009,6 +1011,12 @@
<extends>QListView</extends>
<header>divepicturewidget.h</header>
</customwidget>
+ <customwidget>
+ <class>QtWaitingSpinner</class>
+ <extends>QWidget</extends>
+ <header>qtwaitingspinner.h</header>
+ <container>1</container>
+ </customwidget>
</customwidgets>
<tabstops>
<tabstop>dateEdit</tabstop>