Now the progress bar is shown immediately after clicking the refresh conference butto...
authorPhilipp Spitzer <philipp@spitzer.priv.at>
Tue, 6 Sep 2011 21:17:01 +0000 (21:17 +0000)
committerPhilipp Spitzer <philipp@spitzer.priv.at>
Tue, 6 Sep 2011 21:17:01 +0000 (21:17 +0000)
src/gui/conferenceeditor.cpp

index 910a7d0..d17bad3 100644 (file)
@@ -130,13 +130,11 @@ void ConferenceEditor::removeClicked()
 
 void ConferenceEditor::changeUrlClicked()
 {
-    if (selected_id < 0) {
-        return;
-    }
-    const Conference& selected = Conference::getById(selected_id);
+    if (selected_id < 0) return;
+    const Conference& selectedConf = Conference::getById(selected_id);
 
     bool ok;
-    QString url = QInputDialog::getText(this, "URL Input", "Enter schedule URL", QLineEdit::Normal, selected.url(), &ok);
+    QString url = QInputDialog::getText(this, "URL Input", "Enter schedule URL", QLineEdit::Normal, selectedConf.url(), &ok);
 
     if (ok) {
         emit changeUrlRequested(selected_id, url);
@@ -145,27 +143,21 @@ void ConferenceEditor::changeUrlClicked()
 
 void ConferenceEditor::refreshClicked()
 {
-    if (selected_id < 0) {
-        return;
-    }
-    const Conference& selected = Conference::getById(selected_id);
+    if (selected_id < 0) return;
+    const Conference& selectedConf = Conference::getById(selected_id);
+    QString url = selectedConf.url();
 
-    QString url = selected.url();
-
-    if (!url.isEmpty()) {
-        emit haveConferenceUrl(url);
-    } else {
+    if (url.isEmpty()) {
         static const QString format("Schedule URL for %1 is not set. Enter the schedule URL:");
         bool ok;
-        QString url = QInputDialog::getText(this, "URL Input", format.arg(selected.title()), QLineEdit::Normal, QString(), &ok);
-
-        if (ok) {
-            // first save it, to remain if fetch fails
-            emit changeUrlRequested(selected_id, url);
-            // then fetch
-            emit haveConferenceUrl(url);
-        }
+        QString url = QInputDialog::getText(this, "URL Input", format.arg(selectedConf.title()), QLineEdit::Normal, QString(), &ok);
+        if (!ok) return;
+        // first save it, to remain if fetch fails
+        emit changeUrlRequested(selected_id, url);
     }
+    // fetch
+    importStarted(); // just to show the progress bar
+    emit haveConferenceUrl(url);
 }
 
 void ConferenceEditor::importStarted()