[Xfce4-commits] <xfce4-weather-plugin:master> Set correct defaults in weather configuration.

Harald Judt noreply at xfce.org
Fri Jul 13 16:50:23 CEST 2012


Updating branch refs/heads/master
         to 87a7b6a8959bdbabdd35c360166d6985ae67f98e (commit)
       from 781a78c8fcda778181ad0d5b0954b655ed038b09 (commit)

commit 87a7b6a8959bdbabdd35c360166d6985ae67f98e
Author: Harald Judt <h.judt at gmx.at>
Date:   Thu Jul 12 13:22:14 2012 +0200

    Set correct defaults in weather configuration.

 panel-plugin/weather-config.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/panel-plugin/weather-config.c b/panel-plugin/weather-config.c
index bc07470..0c10a2a 100644
--- a/panel-plugin/weather-config.c
+++ b/panel-plugin/weather-config.c
@@ -387,10 +387,8 @@ create_config_dialog (xfceweather_data *data,
   gtk_label_set_mnemonic_widget(GTK_LABEL(label),
                                 GTK_WIDGET(dialog->combo_unit_system));
 
-  if(dialog->wd != NULL && dialog->wd->unit_system == IMPERIAL)
-    gtk_combo_box_set_active(GTK_COMBO_BOX(dialog->combo_unit_system), IMPERIAL);
-  else
-    gtk_combo_box_set_active(GTK_COMBO_BOX(dialog->combo_unit_system), METRIC);
+  gtk_combo_box_set_active(GTK_COMBO_BOX(dialog->combo_unit_system),
+                           dialog->wd->unit_system);
 
   hbox = gtk_hbox_new (FALSE, BORDER);
   gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
@@ -516,7 +514,7 @@ create_config_dialog (xfceweather_data *data,
   label = gtk_label_new_with_mnemonic (_("Number of _forecast days:"));
   dialog->spin_forecast_days = gtk_spin_button_new_with_range (1, MAX_FORECAST_DAYS, 1);
   gtk_spin_button_set_value (GTK_SPIN_BUTTON (dialog->spin_forecast_days),
-                             dialog->wd->forecast_days);
+                             (dialog->wd->forecast_days) ? dialog->wd->forecast_days : 5);
   gtk_label_set_mnemonic_widget(GTK_LABEL (label),
                                 GTK_WIDGET (dialog->spin_forecast_days));
 


More information about the Xfce4-commits mailing list