[Xfce4-commits] <xfce4-weather-plugin:master> Add a spinner to the location page to indicate that a download will be scheduled.
Harald Judt
noreply at xfce.org
Wed Nov 28 00:00:02 CET 2012
Updating branch refs/heads/master
to 4d939ceb37948fac34503d9dee3016aa14df8b4f (commit)
from 2466b5e5044155a356aeaba573312e8a596a6b9a (commit)
commit 4d939ceb37948fac34503d9dee3016aa14df8b4f
Author: Harald Judt <h.judt at gmx.at>
Date: Tue Nov 27 23:00:39 2012 +0100
Add a spinner to the location page to indicate that a download will be scheduled.
After the spinner stops spinning, download will start.
panel-plugin/weather-config.c | 8 +++++++-
panel-plugin/weather-config.h | 1 +
2 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/panel-plugin/weather-config.c b/panel-plugin/weather-config.c
index 6ab95ec..8d53d1c 100644
--- a/panel-plugin/weather-config.c
+++ b/panel-plugin/weather-config.c
@@ -126,6 +126,7 @@ schedule_data_update(gpointer user_data)
data = dialog->wd;
memset(&data->last_data_update, 0, sizeof(data->last_data_update));
memset(&data->last_astro_update, 0, sizeof(data->last_astro_update));
+ gtk_spinner_stop(GTK_SPINNER(dialog->update_spinner));
return FALSE;
}
@@ -137,6 +138,7 @@ schedule_delayed_data_update(xfceweather_dialog *dialog)
if (dialog->timer_id)
g_source_remove(dialog->timer_id);
+ gtk_spinner_start(GTK_SPINNER(dialog->update_spinner));
dialog->timer_id =
g_timeout_add_seconds(UPDATE_TIMER_DELAY,
(GSourceFunc) schedule_data_update, dialog);
@@ -447,12 +449,16 @@ create_location_page(xfceweather_dialog *dialog)
G_CALLBACK(cb_findlocation), dialog);
gtk_box_pack_start(GTK_BOX(hbox), button_loc_change,
FALSE, FALSE, 0);
- gtk_box_pack_start(GTK_BOX(page), hbox, FALSE, FALSE, BORDER);
if (dialog->wd->location_name)
gtk_entry_set_text(GTK_ENTRY(dialog->text_loc_name),
dialog->wd->location_name);
else
gtk_entry_set_text(GTK_ENTRY(dialog->text_loc_name), _("Unset"));
+ /* update spinner */
+ dialog->update_spinner = gtk_spinner_new();
+ gtk_misc_set_alignment(GTK_MISC(dialog->update_spinner), 1, 0.5);
+ gtk_box_pack_start(GTK_BOX(hbox), dialog->update_spinner, TRUE, TRUE, 0);
+ gtk_box_pack_start(GTK_BOX(page), hbox, FALSE, FALSE, BORDER);
/* latitude */
vbox = gtk_vbox_new(FALSE, BORDER);
diff --git a/panel-plugin/weather-config.h b/panel-plugin/weather-config.h
index 4ad5cee..70dd0b7 100644
--- a/panel-plugin/weather-config.h
+++ b/panel-plugin/weather-config.h
@@ -38,6 +38,7 @@ typedef struct {
GtkWidget *spin_alt;
GtkWidget *label_alt_unit;
GtkWidget *spin_timezone;
+ GtkWidget *update_spinner;
/* units page */
GtkWidget *combo_unit_temperature;
More information about the Xfce4-commits
mailing list