[frogr] Add a title to all the dialogs showing progress bars



commit 4f24ef2a9359e0c3f74916fc50cbd43ca8ebaa3f
Author: Mario Sanchez Prada <msanchez gnome org>
Date:   Tue Jun 23 17:36:45 2015 +0100

    Add a title to all the dialogs showing progress bars

 src/frogr-controller.c |   26 ++++++++++++++++++++++++--
 src/frogr-main-view.c  |    4 ++--
 src/frogr-main-view.h  |    2 +-
 3 files changed, 27 insertions(+), 5 deletions(-)
---
diff --git a/src/frogr-controller.c b/src/frogr-controller.c
index 272233a..6dc4096 100644
--- a/src/frogr-controller.c
+++ b/src/frogr-controller.c
@@ -2363,7 +2363,29 @@ _show_progress_on_idle (gpointer data)
   frogr_main_view_pulse_progress (priv->mainview);
   if (show_dialog)
     {
-      frogr_main_view_show_progress (priv->mainview, text);
+      gchar *title = NULL;
+
+      switch (activity)
+        {
+        case FETCHING_TOKEN_REPLACEMENT:
+        case FETCHING_AUTH_URL:
+        case FETCHING_AUTH_TOKEN:
+          title = g_strdup_printf (_("Authorize %s"), APP_SHORTNAME);
+          break;
+
+        case FETCHING_PHOTOSETS:
+        case FETCHING_GROUPS:
+        case FETCHING_TAGS:
+          title = g_strdup_printf (_("Fetching information"));
+          break;
+
+        default:
+          title = g_strdup ("");
+        }
+
+      frogr_main_view_show_progress (priv->mainview, title, text);
+      g_free (title);
+
       return G_SOURCE_CONTINUE;
     }
   else
@@ -3167,7 +3189,7 @@ frogr_controller_upload_pictures (FrogrController *self, GSList *pictures)
 
       /* Load the pictures! */
       _set_state (self, FROGR_STATE_UPLOADING_PICTURES);
-      frogr_main_view_show_progress (priv->mainview, NULL);
+      frogr_main_view_show_progress (priv->mainview, _("Uploading Pictures"), NULL);
       _upload_next_picture (self, up_data);
     }
 }
diff --git a/src/frogr-main-view.c b/src/frogr-main-view.c
index 0f235cc..868db83 100644
--- a/src/frogr-main-view.c
+++ b/src/frogr-main-view.c
@@ -460,7 +460,6 @@ _initialize_ui (FrogrMainView *self)
                                      GTK_RESPONSE_CANCEL, TRUE);
   gtk_container_set_border_width (GTK_CONTAINER (progress_dialog), 6);
   gtk_window_set_default_size (GTK_WINDOW (progress_dialog), 250, -1);
-  gtk_window_set_title (GTK_WINDOW (progress_dialog), _("Uploading Pictures"));
 
   progress_vbox = gtk_message_dialog_get_message_area (GTK_MESSAGE_DIALOG (progress_dialog));
   progress_label = gtk_label_new (NULL);
@@ -2608,7 +2607,7 @@ frogr_main_view_set_status_text (FrogrMainView *self,
 }
 
 void
-frogr_main_view_show_progress (FrogrMainView *self, const gchar *text)
+frogr_main_view_show_progress (FrogrMainView *self, const gchar *title, const gchar *text)
 {
   FrogrMainViewPrivate *priv = NULL;
 
@@ -2622,6 +2621,7 @@ frogr_main_view_show_progress (FrogrMainView *self, const gchar *text)
   priv->progress_is_showing = TRUE;
 
   gtk_label_set_text (GTK_LABEL (priv->progress_label), text ? text : "");
+  gtk_window_set_title (GTK_WINDOW (priv->progress_dialog), title);
 
   /* Reset values */
   gtk_progress_bar_set_text (GTK_PROGRESS_BAR (priv->progress_bar), "");
diff --git a/src/frogr-main-view.h b/src/frogr-main-view.h
index 4e4429a..b1196f7 100644
--- a/src/frogr-main-view.h
+++ b/src/frogr-main-view.h
@@ -55,7 +55,7 @@ void frogr_main_view_update_project_path (FrogrMainView *self, const gchar *path
 
 void frogr_main_view_set_status_text (FrogrMainView *self, const gchar *text);
 
-void frogr_main_view_show_progress (FrogrMainView *self, const gchar *text);
+void frogr_main_view_show_progress (FrogrMainView *self, const gchar *title, const gchar *text);
 
 void frogr_main_view_set_progress_description (FrogrMainView *self, const gchar *text);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]