patches/gnome-panel-14-hide-show-weather.diff
author yippi
Mon, 27 Sep 2010 21:07:51 +0000
changeset 20108 51df67ca9307
parent 16388 bfed3836a61c
permissions -rw-r--r--
I had these modules listed as being owned by me, but they are really owned by wangke, correcting.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
16374
3ba67616171c * base-specs/gnome-panel.spec : Bump to 2.27.91
mattman
parents: 16014
diff changeset
     1
/jds/bin/diff -uprN gnome-panel-2.27.91.old/applets/clock/clock.c gnome-panel-2.27.91/applets/clock/clock.c
16388
bfed3836a61c * patches/gnome-panel-14-hide-show-weather.diff : Rework for 2.27.91
mattman
parents: 16374
diff changeset
     2
--- gnome-panel-2.27.91.old/applets/clock/clock.c	2009-08-27 18:45:22.763599000 +0100
bfed3836a61c * patches/gnome-panel-14-hide-show-weather.diff : Rework for 2.27.91
mattman
parents: 16374
diff changeset
     3
+++ gnome-panel-2.27.91/applets/clock/clock.c	2009-08-27 18:57:31.552271000 +0100
16374
3ba67616171c * base-specs/gnome-panel.spec : Bump to 2.27.91
mattman
parents: 16014
diff changeset
     4
@@ -146,6 +146,8 @@ struct _ClockData {
14982
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
     5
 	GtkWidget *minutes_spin;
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
     6
 	GtkWidget *seconds_spin;
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
     7
 	GtkWidget *set_time_button;
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
     8
+	GtkWidget *show_weather_toggle;
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
     9
+	GtkWidget *show_temperature_toggle;
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    10
 
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    11
 	GtkListStore *cities_store;
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    12
         GtkWidget *cities_section;
16374
3ba67616171c * base-specs/gnome-panel.spec : Bump to 2.27.91
mattman
parents: 16014
diff changeset
    13
@@ -234,6 +236,7 @@ static void applet_change_orient (PanelA
14982
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    14
 				  ClockData         *cd);
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    15
 
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    16
 static void edit_hide (GtkWidget *unused, ClockData *cd);
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    17
+static void update_show_weather_toggles (ClockData *cd);
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    18
 static gboolean edit_delete (GtkWidget *unused, GdkEvent *event, ClockData *cd);
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    19
 static void save_cities_store (ClockData *cd);
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    20
 
16388
bfed3836a61c * patches/gnome-panel-14-hide-show-weather.diff : Rework for 2.27.91
mattman
parents: 16374
diff changeset
    21
@@ -1975,11 +1978,38 @@ update_panel_weather (ClockData *cd)
bfed3836a61c * patches/gnome-panel-14-hide-show-weather.diff : Rework for 2.27.91
mattman
parents: 16374
diff changeset
    22
                 gtk_widget_hide (cd->panel_temperature_label);
bfed3836a61c * patches/gnome-panel-14-hide-show-weather.diff : Rework for 2.27.91
mattman
parents: 16374
diff changeset
    23
 
bfed3836a61c * patches/gnome-panel-14-hide-show-weather.diff : Rework for 2.27.91
mattman
parents: 16374
diff changeset
    24
 	if ((cd->show_weather || cd->show_temperature) &&
16374
3ba67616171c * base-specs/gnome-panel.spec : Bump to 2.27.91
mattman
parents: 16014
diff changeset
    25
-	    g_list_length (cd->locations) > 0)
3ba67616171c * base-specs/gnome-panel.spec : Bump to 2.27.91
mattman
parents: 16014
diff changeset
    26
-                gtk_widget_show (cd->weather_obox);
3ba67616171c * base-specs/gnome-panel.spec : Bump to 2.27.91
mattman
parents: 16014
diff changeset
    27
-        else
3ba67616171c * base-specs/gnome-panel.spec : Bump to 2.27.91
mattman
parents: 16014
diff changeset
    28
-                gtk_widget_hide (cd->weather_obox);
16388
bfed3836a61c * patches/gnome-panel-14-hide-show-weather.diff : Rework for 2.27.91
mattman
parents: 16374
diff changeset
    29
+	    g_list_length (cd->locations) > 0) {
14982
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    30
+        ClockLocation *loc = NULL;
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    31
+        GList *locations, *l;
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    32
+        gboolean current_found = FALSE;
16388
bfed3836a61c * patches/gnome-panel-14-hide-show-weather.diff : Rework for 2.27.91
mattman
parents: 16374
diff changeset
    33
 
bfed3836a61c * patches/gnome-panel-14-hide-show-weather.diff : Rework for 2.27.91
mattman
parents: 16374
diff changeset
    34
+        /* need to process locations, if there is no current
bfed3836a61c * patches/gnome-panel-14-hide-show-weather.diff : Rework for 2.27.91
mattman
parents: 16374
diff changeset
    35
+           location then hide the weather/temperature on panel */
16374
3ba67616171c * base-specs/gnome-panel.spec : Bump to 2.27.91
mattman
parents: 16014
diff changeset
    36
+        locations = cd->locations;
14982
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    37
+        for (l = locations; l; l = l->next) {
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    38
+            loc = l->data;
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    39
+            if (clock_location_is_current (loc)) {
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    40
+                current_found = TRUE;
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    41
+                break;
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    42
+            }
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    43
+        }
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    44
+        if (current_found == FALSE) {
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    45
+            /* There is no current location so hide the obox */
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    46
+            gtk_widget_hide(cd->weather_obox);
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    47
+        } else {
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    48
+            gtk_widget_show(cd->weather_obox);
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    49
+        }
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    50
+    } else {
16388
bfed3836a61c * patches/gnome-panel-14-hide-show-weather.diff : Rework for 2.27.91
mattman
parents: 16374
diff changeset
    51
+        gtk_widget_hide (cd->weather_obox);
14982
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    52
+    }
16388
bfed3836a61c * patches/gnome-panel-14-hide-show-weather.diff : Rework for 2.27.91
mattman
parents: 16374
diff changeset
    53
+        
14982
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    54
+    if (g_list_length (cd->locations) <= 0) {
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    55
+        if (cd->panel_weather_icon)
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    56
+            gtk_image_set_from_pixbuf (GTK_IMAGE (cd->panel_weather_icon),
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    57
+                                       NULL);
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    58
+        if (cd->panel_temperature_label)
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    59
+            gtk_label_set_text (GTK_LABEL (cd->panel_temperature_label), "");
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    60
+    }
16388
bfed3836a61c * patches/gnome-panel-14-hide-show-weather.diff : Rework for 2.27.91
mattman
parents: 16374
diff changeset
    61
 	gtk_widget_queue_resize (cd->applet);
14982
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    62
 }
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    63
 
16388
bfed3836a61c * patches/gnome-panel-14-hide-show-weather.diff : Rework for 2.27.91
mattman
parents: 16374
diff changeset
    64
@@ -2074,19 +2104,7 @@ locations_changed (ClockData *cd)
14982
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    65
 	ClockLocation *loc;
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    66
 	glong id;
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    67
 
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    68
-	if (!cd->locations) {
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    69
-		if (cd->weather_obox)
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    70
-			gtk_widget_hide (cd->weather_obox);
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    71
-		if (cd->panel_weather_icon)
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    72
-			gtk_image_set_from_pixbuf (GTK_IMAGE (cd->panel_weather_icon),
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    73
-						   NULL);
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    74
-		if (cd->panel_temperature_label)
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    75
-			gtk_label_set_text (GTK_LABEL (cd->panel_temperature_label),
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    76
-					    "");
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    77
-	} else {
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    78
-		if (cd->weather_obox)
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    79
-			gtk_widget_show (cd->weather_obox);
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    80
-	}
16388
bfed3836a61c * patches/gnome-panel-14-hide-show-weather.diff : Rework for 2.27.91
mattman
parents: 16374
diff changeset
    81
+    update_panel_weather (cd);
14982
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    82
 
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    83
 	for (l = cd->locations; l; l = l->next) {
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    84
 		loc = l->data;
16388
bfed3836a61c * patches/gnome-panel-14-hide-show-weather.diff : Rework for 2.27.91
mattman
parents: 16374
diff changeset
    85
@@ -3121,12 +3139,25 @@ edit_clear (ClockData *cd)
14982
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    86
 }
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    87
 
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    88
 static void
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    89
+update_show_weather_toggles(ClockData *cd)
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    90
+{
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    91
+        if (g_list_length (cd->locations) <= 0) {
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    92
+            gtk_widget_set_sensitive (cd->show_weather_toggle, FALSE);
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    93
+            gtk_widget_set_sensitive (cd->show_temperature_toggle, FALSE);
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    94
+        } else {
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    95
+            gtk_widget_set_sensitive (cd->show_weather_toggle, TRUE);
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    96
+            gtk_widget_set_sensitive (cd->show_temperature_toggle, TRUE);
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    97
+        }
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    98
+}
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    99
+
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   100
+static void
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   101
 edit_hide (GtkWidget *unused, ClockData *cd)
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   102
 {
16374
3ba67616171c * base-specs/gnome-panel.spec : Bump to 2.27.91
mattman
parents: 16014
diff changeset
   103
         GtkWidget *edit_window = _clock_get_widget (cd, "edit-location-window");
14982
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   104
 
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   105
         gtk_widget_hide (edit_window);
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   106
         edit_clear (cd);
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   107
+        update_show_weather_toggles (cd);
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   108
 }
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   109
 
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   110
 static gboolean
16388
bfed3836a61c * patches/gnome-panel-14-hide-show-weather.diff : Rework for 2.27.91
mattman
parents: 16374
diff changeset
   111
@@ -3197,6 +3228,8 @@ run_prefs_locations_remove (GtkButton *b
14982
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   112
         GtkTreeSelection *sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (cd->prefs_locations));
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   113
 
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   114
         gtk_tree_selection_selected_foreach (sel, remove_tree_row, cd);
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   115
+        update_panel_weather (cd);
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   116
+        update_show_weather_toggles (cd);
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   117
 }
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   118
 
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   119
 static void
16388
bfed3836a61c * patches/gnome-panel-14-hide-show-weather.diff : Rework for 2.27.91
mattman
parents: 16374
diff changeset
   120
@@ -3413,17 +3446,22 @@ fill_prefs_window (ClockData *cd)
14982
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   121
                           G_CALLBACK (set_show_seconds_cb), cd);
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   122
 
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   123
 	/* Set the "Show weather" checkbox */
16374
3ba67616171c * base-specs/gnome-panel.spec : Bump to 2.27.91
mattman
parents: 16014
diff changeset
   124
-	widget = _clock_get_widget (cd, "weather_check");
14982
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   125
-	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), cd->show_weather);
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   126
-	g_signal_connect (widget, "toggled",
16388
bfed3836a61c * patches/gnome-panel-14-hide-show-weather.diff : Rework for 2.27.91
mattman
parents: 16374
diff changeset
   127
+	cd->show_weather_toggle = _clock_get_widget (cd, "weather_check");
14982
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   128
+	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cd->show_weather_toggle),
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   129
+                                  cd->show_weather);
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   130
+	g_signal_connect (cd->show_weather_toggle, "toggled",
16388
bfed3836a61c * patches/gnome-panel-14-hide-show-weather.diff : Rework for 2.27.91
mattman
parents: 16374
diff changeset
   131
                           G_CALLBACK (set_show_weather_cb), cd);
14982
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   132
 
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   133
 	/* Set the "Show temperature" checkbox */
16374
3ba67616171c * base-specs/gnome-panel.spec : Bump to 2.27.91
mattman
parents: 16014
diff changeset
   134
-	widget = _clock_get_widget (cd, "temperature_check");
14982
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   135
-	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), cd->show_temperature);
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   136
-	g_signal_connect (widget, "toggled",
16388
bfed3836a61c * patches/gnome-panel-14-hide-show-weather.diff : Rework for 2.27.91
mattman
parents: 16374
diff changeset
   137
+	cd->show_temperature_toggle = _clock_get_widget (cd, "temperature_check");
14982
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   138
+	gtk_toggle_button_set_active (
16388
bfed3836a61c * patches/gnome-panel-14-hide-show-weather.diff : Rework for 2.27.91
mattman
parents: 16374
diff changeset
   139
+        GTK_TOGGLE_BUTTON (cd->show_temperature_toggle), cd->show_temperature);
14982
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   140
+	g_signal_connect (cd->show_temperature_toggle, "toggled",
16388
bfed3836a61c * patches/gnome-panel-14-hide-show-weather.diff : Rework for 2.27.91
mattman
parents: 16374
diff changeset
   141
                           G_CALLBACK (set_show_temperature_cb), cd);
bfed3836a61c * patches/gnome-panel-14-hide-show-weather.diff : Rework for 2.27.91
mattman
parents: 16374
diff changeset
   142
 
bfed3836a61c * patches/gnome-panel-14-hide-show-weather.diff : Rework for 2.27.91
mattman
parents: 16374
diff changeset
   143
+    /* If no Locations then cannot show/hide weather/temperature */
bfed3836a61c * patches/gnome-panel-14-hide-show-weather.diff : Rework for 2.27.91
mattman
parents: 16374
diff changeset
   144
+    update_show_weather_toggles (cd);
14982
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   145
+
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   146
 	/* Fill the Cities list */
16374
3ba67616171c * base-specs/gnome-panel.spec : Bump to 2.27.91
mattman
parents: 16014
diff changeset
   147
 	widget = _clock_get_widget (cd, "cities_list");
16388
bfed3836a61c * patches/gnome-panel-14-hide-show-weather.diff : Rework for 2.27.91
mattman
parents: 16374
diff changeset
   148
 
bfed3836a61c * patches/gnome-panel-14-hide-show-weather.diff : Rework for 2.27.91
mattman
parents: 16374
diff changeset
   149
@@ -3490,8 +3528,10 @@ ensure_prefs_window_is_created (ClockDat
14982
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   150
         GtkTreeSelection *selection;
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   151
         GWeatherLocation *world;
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   152
 
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   153
-        if (cd->prefs_window)
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   154
+        if (cd->prefs_window) {
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   155
+                update_show_weather_toggles (cd);
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   156
                 return;
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   157
+        }
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   158
 
16374
3ba67616171c * base-specs/gnome-panel.spec : Bump to 2.27.91
mattman
parents: 16014
diff changeset
   159
         cd->prefs_window = _clock_get_widget (cd, "prefs-window");
14982
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
   160