[Xfce4-commits] [panel-plugins/xfce4-weather-plugin] 03/25: Port GTK 2 UI code to Glade

noreply at xfce.org noreply at xfce.org
Mon Sep 17 00:14:00 CEST 2018


This is an automated email from the git hooks/post-receive script.

b   l   u   e   s   a   b   r   e       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository panel-plugins/xfce4-weather-plugin.

commit a7bec35b3dd5cae7c9541a0aa76b968db7557978
Author: Sean Davis <smd.seandavis at gmail.com>
Date:   Sun Sep 9 13:57:44 2018 -0400

    Port GTK 2 UI code to Glade
---
 .gitignore                     |   4 +
 panel-plugin/Makefile.am       |  10 +
 panel-plugin/weather-config.c  | 498 ++++++-----------------------------------
 panel-plugin/weather-config.h  |   3 +-
 panel-plugin/weather-config.ui | 185 +++++++++------
 panel-plugin/weather.c         |  45 ++--
 6 files changed, 227 insertions(+), 518 deletions(-)

diff --git a/.gitignore b/.gitignore
index 5f057ce..00e5ba4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -24,3 +24,7 @@ po/*.gmo
 po/Makefile.in.in
 po/POTFILES
 stamp-*
+panel-plugin/libweather.la
+panel-plugin/weather-config_ui.h
+panel-plugin/weather.desktop
+po/.intltool-merge-cache
diff --git a/panel-plugin/Makefile.am b/panel-plugin/Makefile.am
index 3c63d2d..3c35e13 100644
--- a/panel-plugin/Makefile.am
+++ b/panel-plugin/Makefile.am
@@ -57,6 +57,16 @@ libweather_la_LDFLAGS = \
 	$(PLATFORM_LDFLAGS) \
 	$(UPOWER_GLIB_LIBS)
 
+if MAINTAINER_MODE
+
+BUILT_SOURCES = \
+	weather-config_ui.h
+
+weather-config_ui.h: weather-config.ui
+	exo-csource --static --strip-comments --strip-content --name=weather_config_ui $< >$@
+
+endif
+
 desktopdir = $(datadir)/xfce4/panel/plugins
 desktop_in_files = weather.desktop.in
 desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
diff --git a/panel-plugin/weather-config.c b/panel-plugin/weather-config.c
index 5aff129..d9aa2f6 100644
--- a/panel-plugin/weather-config.c
+++ b/panel-plugin/weather-config.c
@@ -487,150 +487,55 @@ text_timezone_changed(const GtkWidget *entry,
 }
 
 
-static GtkWidget *
+static void
 create_location_page(xfceweather_dialog *dialog)
 {
     GtkWidget *palign, *page, *hbox, *vbox, *label, *image, *sep;
     GtkWidget *button_loc_change;
-    GtkSizeGroup *sg_label, *sg_spin;
-
-    ADD_PAGE(FALSE);
-    sg_label = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
-    sg_spin = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
 
     /* location name */
-    hbox = gtk_hbox_new(FALSE, BORDER);
-    ADD_LABEL(_("Location _name:"), sg_label);
-    dialog->text_loc_name = gtk_entry_new();
+    dialog->text_loc_name = GTK_WIDGET (gtk_builder_get_object (GTK_BUILDER (dialog->builder), "text_loc_name"));
     gtk_entry_set_max_length(GTK_ENTRY(dialog->text_loc_name),
                              LOC_NAME_MAX_LEN);
-    gtk_label_set_mnemonic_widget(GTK_LABEL(label),
-                                  GTK_WIDGET(dialog->text_loc_name));
-    SET_TOOLTIP(dialog->text_loc_name,
-                _("Change the name for the location to your liking. "
-                  "It is used for display and does not affect the location "
-                  "parameters in any way."));
-    gtk_box_pack_start(GTK_BOX(hbox), dialog->text_loc_name, TRUE, TRUE, 0);
-    button_loc_change = gtk_button_new_with_mnemonic(_("Chan_ge..."));
-    image = gtk_image_new_from_stock(GTK_STOCK_FIND, GTK_ICON_SIZE_BUTTON);
-    gtk_button_set_image(GTK_BUTTON(button_loc_change), image);
-    SET_TOOLTIP(button_loc_change, _("Search for a new location and "
-                                     "auto-detect its parameters."));
+
+    button_loc_change = GTK_WIDGET (gtk_builder_get_object (GTK_BUILDER (dialog->builder), "button_loc_change"));
     g_signal_connect(G_OBJECT(button_loc_change), "clicked",
                      G_CALLBACK(cb_findlocation), dialog);
-    gtk_box_pack_start(GTK_BOX(hbox), button_loc_change,
-                       FALSE, FALSE, 0);
+
     if (dialog->pd->location_name)
         gtk_entry_set_text(GTK_ENTRY(dialog->text_loc_name),
                            dialog->pd->location_name);
     else
         gtk_entry_set_text(GTK_ENTRY(dialog->text_loc_name), _("Unset"));
+
     /* update spinner */
-    dialog->update_spinner = gtk_spinner_new();
-    gtk_box_pack_start(GTK_BOX(hbox), dialog->update_spinner, TRUE, TRUE, 0);
-    gtk_box_pack_start(GTK_BOX(page), hbox, FALSE, FALSE, BORDER);
+    dialog->update_spinner = GTK_WIDGET (gtk_builder_get_object (GTK_BUILDER (dialog->builder), "update_spinner"));
 
     /* latitude */
-    vbox = gtk_vbox_new(FALSE, BORDER);
-    hbox = gtk_hbox_new(FALSE, BORDER);
-    ADD_LABEL(_("Latitud_e:"), sg_label);
-    ADD_SPIN(dialog->spin_lat, -90, 90, 1,
-             (string_to_double(dialog->pd->lat, 0)), 6, sg_spin);
-    SET_TOOLTIP(dialog->spin_lat,
-                _("Latitude specifies the north-south position of a point on "
-                  "the Earth's surface. If you change this value manually, "
-                  "you need to provide altitude and timezone manually too."));
-    label = gtk_label_new("°");
-    gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
-    gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
-    gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, BORDER);
+    dialog->spin_lat = GTK_WIDGET (gtk_builder_get_object (GTK_BUILDER (dialog->builder), "spin_lat"));
+    gtk_spin_button_set_value (GTK_SPIN_BUTTON (dialog->spin_lat), string_to_double(dialog->pd->lat, 0));
 
     /* longitude */
-    hbox = gtk_hbox_new(FALSE, BORDER);
-    ADD_LABEL(_("L_ongitude:"), sg_label);
-    ADD_SPIN(dialog->spin_lon, -180, 180, 1,
-             (string_to_double(dialog->pd->lon, 0)), 6, sg_spin);
-    SET_TOOLTIP(dialog->spin_lon,
-                _("Longitude specifies the east-west position of a point on "
-                  "the Earth's surface. If you change this value manually, "
-                  "you need to provide altitude and timezone manually too."));
-    label = gtk_label_new("°");
-    gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
-    gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
-    gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, BORDER);
+    dialog->spin_lon = GTK_WIDGET (gtk_builder_get_object (GTK_BUILDER (dialog->builder), "spin_lon"));
+    gtk_spin_button_set_value (GTK_SPIN_BUTTON (dialog->spin_lon), string_to_double(dialog->pd->lon, 0));
 
     /* altitude */
-    hbox = gtk_hbox_new(FALSE, BORDER);
-    ADD_LABEL(_("Altitu_de:"), sg_label);
-    ADD_SPIN(dialog->spin_alt, -420, 10000, 1, dialog->pd->msl, 0, sg_spin);
-    SET_TOOLTIP
-        (dialog->spin_alt,
-         _("For locations outside Norway the elevation model that's used by "
-           "the met.no webservice is not very good, so it's usually necessary "
-           "to specify the altitude as an additional parameter, otherwise the "
-           "reported values will not be correct.\n\n"
-           "The plugin tries to auto-detect the altitude using the GeoNames "
-           "webservice, but that might not always be correct too, so you "
-           "can change it here.\n\n"
-           "Altitude is given in meters above sea level, or alternatively "
-           "in feet by changing the unit on the units page. It should match "
-           "the real value roughly, but small differences will have no "
-           "influence on the weather data. Inside Norway, this setting has "
-           "no effect at all."));
-    dialog->label_alt_unit = gtk_label_new(NULL);
-    gtk_misc_set_alignment(GTK_MISC(dialog->label_alt_unit), 0, 0.5);
-    gtk_box_pack_start(GTK_BOX(hbox), dialog->label_alt_unit, FALSE, FALSE, 0);
-    gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, BORDER);
+    dialog->label_alt_unit = GTK_WIDGET (gtk_builder_get_object (GTK_BUILDER (dialog->builder), "label_alt_unit"));
+    dialog->spin_alt = GTK_WIDGET (gtk_builder_get_object (GTK_BUILDER (dialog->builder), "spin_alt"));
+    gtk_spin_button_set_value (GTK_SPIN_BUTTON (dialog->spin_alt), dialog->pd->msl);
 
     /* timezone */
-    hbox = gtk_hbox_new(FALSE, BORDER);
-    ADD_LABEL(_("_Timezone:"), sg_label);
-    dialog->text_timezone = gtk_entry_new();
+    dialog->text_timezone = GTK_WIDGET (gtk_builder_get_object (GTK_BUILDER (dialog->builder), "text_timezone"));
     gtk_entry_set_max_length(GTK_ENTRY(dialog->text_timezone),
                              LOC_NAME_MAX_LEN);
-    gtk_label_set_mnemonic_widget(GTK_LABEL(label),
-                                  GTK_WIDGET(dialog->text_timezone));
-    SET_TOOLTIP
-        (dialog->text_timezone,
-         _("If the chosen location is not in your current timezone, then "
-           "it is necessary to <i>put</i> the plugin into that other "
-           "timezone for the times to be shown correctly. The proper "
-           "timezone will be auto-detected via the GeoNames web service, "
-           "but you might want to correct it if necessary.\n"
-           "Leave this field empty to use the timezone set by your "
-           "system. Invalid entries will cause the use of UTC time, but "
-           "that may also depend on your system."));
-    gtk_box_pack_start(GTK_BOX(hbox), dialog->text_timezone, TRUE, TRUE, 0);
-    gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, BORDER);
     if (dialog->pd->timezone)
         gtk_entry_set_text(GTK_ENTRY(dialog->text_timezone),
                            dialog->pd->timezone);
     else
         gtk_entry_set_text(GTK_ENTRY(dialog->text_timezone), "");
 
-    /* separator */
-    sep = gtk_hseparator_new();
-    gtk_box_pack_start(GTK_BOX(vbox), sep, FALSE, FALSE, BORDER * 2);
-
-    /* instructions for correction of altitude and timezone */
-    hbox = gtk_hbox_new(FALSE, BORDER);
-    label = gtk_label_new(NULL);
-    gtk_label_set_markup
-        (GTK_LABEL(label),
-         _("<i>Please change location name to your liking and "
-           "correct\naltitude and timezone if they are "
-           "not auto-detected correctly.</i>"));
-    gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
-    gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, BORDER/2);
-    gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, BORDER/2);
-    gtk_box_pack_start(GTK_BOX(page), vbox, FALSE, FALSE, 0);
-
     /* set up the altitude spin box and unit label (meters/feet) */
     setup_altitude(dialog);
-
-    g_object_unref(G_OBJECT(sg_label));
-    g_object_unref(G_OBJECT(sg_spin));
-    return palign;
 }
 
 
@@ -952,97 +857,32 @@ combo_apparent_temperature_changed(GtkWidget *combo,
 }
 
 
-static GtkWidget *
+static void
 create_units_page(xfceweather_dialog *dialog)
 {
     GtkWidget *palign, *page, *hbox, *vbox, *label, *sep;
-    GtkSizeGroup *sg_label;
-
-    ADD_PAGE(FALSE);
-    sg_label = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
-    vbox = gtk_vbox_new(FALSE, BORDER);
 
     /* temperature */
-    hbox = gtk_hbox_new(FALSE, BORDER);
-    ADD_LABEL(_("_Temperature:"), sg_label);
-    ADD_COMBO(dialog->combo_unit_temperature);
-    ADD_COMBO_VALUE(dialog->combo_unit_temperature, _("Celsius (°C)"));
-    ADD_COMBO_VALUE(dialog->combo_unit_temperature, _("Fahrenheit (°F)"));
-    gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, BORDER);
+    dialog->combo_unit_temperature = GTK_WIDGET (gtk_builder_get_object (GTK_BUILDER (dialog->builder), "combo_unit_temperature"));
 
     /* atmospheric pressure */
-    hbox = gtk_hbox_new(FALSE, BORDER);
-    ADD_LABEL(_("Barometric _pressure:"), sg_label);
-    ADD_COMBO(dialog->combo_unit_pressure);
-    ADD_COMBO_VALUE(dialog->combo_unit_pressure,
-                    _("Hectopascals (hPa)"));
-    ADD_COMBO_VALUE(dialog->combo_unit_pressure,
-                    _("Inches of mercury (inHg)"));
-    ADD_COMBO_VALUE(dialog->combo_unit_pressure,
-                    _("Pound-force per square inch (psi)"));
-    ADD_COMBO_VALUE(dialog->combo_unit_pressure,
-                    _("Torr (mmHg)"));
-    gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, BORDER);
+    dialog->combo_unit_pressure = GTK_WIDGET (gtk_builder_get_object (GTK_BUILDER (dialog->builder), "combo_unit_pressure"));
 
     /* wind speed */
-    hbox = gtk_hbox_new(FALSE, BORDER);
-    ADD_LABEL(_("_Wind speed:"), sg_label);
-    ADD_COMBO(dialog->combo_unit_windspeed);
-    ADD_COMBO_VALUE(dialog->combo_unit_windspeed,
-                    _("Kilometers per hour (km/h)"));
-    ADD_COMBO_VALUE(dialog->combo_unit_windspeed,
-                    _("Miles per hour (mph)"));
-    ADD_COMBO_VALUE(dialog->combo_unit_windspeed,
-                    _("Meters per second (m/s)"));
-    ADD_COMBO_VALUE(dialog->combo_unit_windspeed,
-                    _("Feet per second (ft/s)"));
-    ADD_COMBO_VALUE(dialog->combo_unit_windspeed,
-                    _("Knots (kt)"));
-    gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, BORDER);
+    dialog->combo_unit_windspeed = GTK_WIDGET (gtk_builder_get_object (GTK_BUILDER (dialog->builder), "combo_unit_windspeed"));
 
     /* precipitation */
-    hbox = gtk_hbox_new(FALSE, BORDER);
-    ADD_LABEL(_("Prec_ipitations:"), sg_label);
-    ADD_COMBO(dialog->combo_unit_precipitation);
-    ADD_COMBO_VALUE(dialog->combo_unit_precipitation,
-                    _("Millimeters (mm)"));
-    ADD_COMBO_VALUE(dialog->combo_unit_precipitation,
-                    _("Inches (in)"));
-    gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, BORDER);
+    dialog->combo_unit_precipitation = GTK_WIDGET (gtk_builder_get_object (GTK_BUILDER (dialog->builder), "combo_unit_precipitation"));
 
     /* altitude */
-    hbox = gtk_hbox_new(FALSE, BORDER);
-    ADD_LABEL(_("Altitu_de:"), sg_label);
-    ADD_COMBO(dialog->combo_unit_altitude);
-    ADD_COMBO_VALUE(dialog->combo_unit_altitude,
-                    _("Meters (m)"));
-    ADD_COMBO_VALUE(dialog->combo_unit_altitude,
-                    _("Feet (ft)"));
-    gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, BORDER);
-
-    /* separator */
-    sep = gtk_hseparator_new();
-    gtk_box_pack_start(GTK_BOX(vbox), sep, FALSE, FALSE, BORDER * 2);
+    dialog->combo_unit_altitude = GTK_WIDGET (gtk_builder_get_object (GTK_BUILDER (dialog->builder), "combo_unit_altitude"));
 
     /* apparent temperature model */
-    hbox = gtk_hbox_new(FALSE, BORDER);
-    ADD_LABEL(_("Apparent te_mperature:"), sg_label);
-    ADD_COMBO(dialog->combo_apparent_temperature);
-    ADD_COMBO_VALUE(dialog->combo_apparent_temperature,
-                    _("Windchill/Heat index"));
-    ADD_COMBO_VALUE(dialog->combo_apparent_temperature,
-                    _("Windchill/Humidex"));
-    ADD_COMBO_VALUE(dialog->combo_apparent_temperature, _("Steadman"));
-    ADD_COMBO_VALUE(dialog->combo_apparent_temperature, _("Quayle-Steadman"));
-    gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, BORDER);
+    dialog->combo_apparent_temperature = GTK_WIDGET (gtk_builder_get_object (GTK_BUILDER (dialog->builder), "combo_apparent_temperature"));
 
     /* initialize widgets with current data */
     if (dialog->pd)
         setup_units(dialog, dialog->pd->units);
-
-    gtk_box_pack_start(GTK_BOX(page), vbox, FALSE, FALSE, 0);
-    g_object_unref(G_OBJECT(sg_label));
-    return palign;
 }
 
 
@@ -1193,7 +1033,7 @@ check_round_values_toggled(GtkWidget *button,
 }
 
 
-static GtkWidget *
+static void
 create_appearance_page(xfceweather_dialog *dialog)
 {
     GtkWidget *palign, *page, *sep, *hbox, *vbox, *label, *image;
@@ -1203,34 +1043,10 @@ create_appearance_page(xfceweather_dialog *dialog)
     gchar *text;
     gint i;
 
-    ADD_PAGE(FALSE);
-    sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
-
     /* icon theme */
-    vbox = gtk_vbox_new(FALSE, BORDER);
-    hbox = gtk_hbox_new(FALSE, BORDER);
-    ADD_LABEL(_("_Icon theme:"), sg);
-    SET_TOOLTIP(label,
-                _("Available icon themes are listed here. You can add icon "
-                  "themes to $HOME/.config/xfce4/weather/icons (or the "
-                  "equivalent directory on your system). Information about "
-                  "how to create or use icon themes can be found in the "
-                  "README file. New icon themes will be detected everytime "
-                  "you open this config dialog."));
-    ADD_COMBO(dialog->combo_icon_theme);
-    gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
-    default_settings = gtk_settings_get_default();
-    g_object_set(default_settings, "gtk-button-images", TRUE, NULL);
-    image = gtk_image_new();
-    gtk_image_set_from_stock(GTK_IMAGE(image), GTK_STOCK_OPEN,
-                             GTK_ICON_SIZE_BUTTON);
-    dialog->button_icons_dir = gtk_button_new();
-    gtk_button_set_image(GTK_BUTTON(dialog->button_icons_dir), image);
-    gtk_box_pack_start(GTK_BOX(hbox), dialog->button_icons_dir,
-                       FALSE, FALSE, 0);
-    SET_TOOLTIP(dialog->button_icons_dir,
-                _("Open the user icon themes directory in your file manager, "
-                  "creating it if necessary."));
+    dialog->combo_icon_theme = GTK_WIDGET (gtk_builder_get_object (GTK_BUILDER (dialog->builder), "combo_icon_theme"));
+    dialog->button_icons_dir = GTK_WIDGET (gtk_builder_get_object (GTK_BUILDER (dialog->builder), "button_icons_dir"));
+
     dialog->icon_themes = find_icon_themes();
     for (i = 0; i < dialog->icon_themes->len; i++) {
         theme = g_array_index(dialog->icon_themes, icon_theme *, i);
@@ -1244,58 +1060,25 @@ create_appearance_page(xfceweather_dialog *dialog)
     }
 
     /* always use small icon in panel */
-    hbox = gtk_hbox_new(FALSE, BORDER);
-    dialog->check_single_row =
-        gtk_check_button_new_with_mnemonic(_("Use only a single _panel row"));
-    SET_TOOLTIP(dialog->check_single_row,
-                _("Check to always use only a single row on a multi-row panel "
-                  "and a small icon in deskbar mode."));
+    dialog->check_single_row = GTK_WIDGET (gtk_builder_get_object (GTK_BUILDER (dialog->builder), "check_single_row"));
     gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->check_single_row),
                                  dialog->pd->single_row);
-    gtk_box_pack_start(GTK_BOX(hbox), dialog->check_single_row,
-                       FALSE, FALSE, 0);
-    gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
-    gtk_box_pack_start(GTK_BOX(page), vbox, FALSE, FALSE, 0);
-
-    sep = gtk_hseparator_new();
-    gtk_box_pack_start(GTK_BOX(page), sep, FALSE, FALSE, BORDER * 2);
 
     /* tooltip style */
-    hbox = gtk_hbox_new(FALSE, BORDER);
-    vbox = gtk_vbox_new(FALSE, BORDER);
-    ADD_LABEL(_("_Tooltip style:"), sg);
-    ADD_COMBO(dialog->combo_tooltip_style);
-    ADD_COMBO_VALUE(dialog->combo_tooltip_style, _("Simple"));
-    ADD_COMBO_VALUE(dialog->combo_tooltip_style, _("Verbose"));
+    dialog->combo_tooltip_style = GTK_WIDGET (gtk_builder_get_object (GTK_BUILDER (dialog->builder), "combo_tooltip_style"));
     SET_COMBO_VALUE(dialog->combo_tooltip_style, dialog->pd->tooltip_style);
-    SET_TOOLTIP(dialog->combo_tooltip_style,
-                _("Choose your preferred tooltip style. Some styles "
-                  "give a lot of useful data, some are clearer but "
-                  "provide less data on a glance."));
-    gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
-    gtk_box_pack_start(GTK_BOX(page), vbox, FALSE, FALSE, 0);
-
-    sep = gtk_hseparator_new();
-    gtk_box_pack_start(GTK_BOX(page), sep, FALSE, FALSE, BORDER * 2);
 
     /* forecast layout */
-    vbox = gtk_vbox_new(FALSE, BORDER);
-    hbox = gtk_hbox_new(FALSE, BORDER);
-    ADD_LABEL(_("_Forecast layout:"), sg);
-    ADD_COMBO(dialog->combo_forecast_layout);
-    ADD_COMBO_VALUE(dialog->combo_forecast_layout, _("Days in columns"));
-    ADD_COMBO_VALUE(dialog->combo_forecast_layout, _("Days in rows"));
+    dialog->combo_forecast_layout = GTK_WIDGET (gtk_builder_get_object (GTK_BUILDER (dialog->builder), "combo_forecast_layout"));
     SET_COMBO_VALUE(dialog->combo_forecast_layout,
                     dialog->pd->forecast_layout);
     combo_forecast_layout_set_tooltip(dialog->combo_forecast_layout);
-    gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
 
     /* number of days shown in forecast */
-    hbox = gtk_hbox_new(FALSE, BORDER);
-    ADD_LABEL(_("_Number of forecast days:"), sg);
-    ADD_SPIN(dialog->spin_forecast_days, 1, MAX_FORECAST_DAYS, 1,
-             (dialog->pd->forecast_days ? dialog->pd->forecast_days : 5),
-             0, NULL);
+    dialog->spin_forecast_days = GTK_WIDGET (gtk_builder_get_object (GTK_BUILDER (dialog->builder), "spin_forecast_days"));
+    gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->spin_forecast_days), 1, MAX_FORECAST_DAYS);
+    gtk_spin_button_set_value (GTK_SPIN_BUTTON (dialog->spin_forecast_days),
+                               (dialog->pd->forecast_days ? dialog->pd->forecast_days : 5));
     text = g_strdup_printf
         (_("Met.no provides forecast data for up to %d days in the "
            "future. Choose how many days will be shown in the forecast "
@@ -1306,27 +1089,11 @@ create_appearance_page(xfceweather_dialog *dialog)
          MAX_FORECAST_DAYS);
     SET_TOOLTIP(dialog->spin_forecast_days, text);
     g_free(text);
-    gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
-    gtk_box_pack_start(GTK_BOX(page), vbox, FALSE, FALSE, 0);
-
-    sep = gtk_hseparator_new();
-    gtk_box_pack_start(GTK_BOX(page), sep, FALSE, FALSE, BORDER * 2);
 
     /* round temperature */
-    vbox = gtk_vbox_new(FALSE, BORDER);
-    dialog->check_round_values =
-        gtk_check_button_new_with_mnemonic(_("_Round values"));
-    SET_TOOLTIP(dialog->check_round_values,
-                _("Check to round values everywhere except on the details "
-                  "page in the summary window."));
-    gtk_box_pack_start(GTK_BOX(vbox), dialog->check_round_values,
-                       FALSE, FALSE, 0);
+    dialog->check_round_values = GTK_WIDGET (gtk_builder_get_object (GTK_BUILDER (dialog->builder), "check_round_values"));
     gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->check_round_values),
                                  dialog->pd->round);
-
-    gtk_box_pack_start(GTK_BOX(page), vbox, FALSE, FALSE, 0);
-    g_object_unref(G_OBJECT(sg));
-    return palign;
 }
 
 
@@ -1439,25 +1206,6 @@ button_scrollbox_color_set(GtkWidget *button,
 }
 
 
-static GtkWidget *
-make_label(void)
-{
-    GtkWidget *widget, *menu;
-    gint i;
-
-    menu = gtk_menu_new();
-    widget = gtk_option_menu_new();
-    for (i = 0; i < OPTIONS_N; i++) {
-        labeloption opt = labeloptions[i];
-
-        gtk_menu_shell_append(GTK_MENU_SHELL(menu),
-                              gtk_menu_item_new_with_label(_(opt.name)));
-    }
-    gtk_option_menu_set_menu(GTK_OPTION_MENU(widget), menu);
-    return widget;
-}
-
-
 static void
 update_scrollbox_labels(xfceweather_dialog *dialog)
 {
@@ -1515,12 +1263,13 @@ option_i(const data_types opt)
 static void
 options_datatypes_set_tooltip(GtkWidget *optmenu)
 {
+    gint history, opt = OPTIONS_N;
+    
     /* TRANSLATORS: Fallback value, usually never shown. */
     gchar *text = _("Choose the value to add to the list below. "
                     "Values can be added more than once.");
-    gint history, opt = OPTIONS_N;
 
-    history = gtk_option_menu_get_history(GTK_OPTION_MENU(optmenu));
+    history = gtk_combo_box_get_active (GTK_COMBO_BOX (optmenu));
     if (G_LIKELY(history > -1) && history < OPTIONS_N)
         opt = labeloptions[history].number;
 
@@ -1695,11 +1444,9 @@ button_add_option_clicked(GtkWidget *widget,
                           gpointer user_data)
 {
     xfceweather_dialog *dialog = (xfceweather_dialog *) user_data;
-    gint history;
+    gint index = gtk_combo_box_get_active (GTK_COMBO_BOX (dialog->options_datatypes));
 
-    history =
-        gtk_option_menu_get_history(GTK_OPTION_MENU(dialog->options_datatypes));
-    add_model_option(dialog->model_datatypes, history);
+    add_model_option(dialog->model_datatypes, index);
     update_scrollbox_labels(dialog);
     return FALSE;
 }
@@ -1790,144 +1537,63 @@ check_scrollbox_animate_toggled(GtkWidget *button,
 }
 
 
-static GtkWidget *
+static void
 create_scrollbox_page(xfceweather_dialog *dialog)
 {
     GtkWidget *palign, *page, *hbox, *table, *scroll, *label, *image, *sep;
     GtkSizeGroup *sg_misc, *sg_button;
-    GtkWidget *button_add, *button_del, *button_up, *button_down;
+    GtkWidget *button;
     GtkTreeViewColumn *column;
     GtkCellRenderer *renderer;
     data_types type;
     gint i, n;
 
-    ADD_PAGE(FALSE);
-    sg_misc = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
-
     /* show scrollbox */
-    hbox = gtk_hbox_new(FALSE, BORDER);
-    dialog->check_scrollbox_show =
-        gtk_check_button_new_with_mnemonic(_("Show scroll_box"));
-    SET_TOOLTIP(dialog->check_scrollbox_show,
-                _("Hide the scrollbox to save valuable space on the panel. "
-                  "Most interesting information is also provided in the "
-                  "tooltip - provided you choose an appropriate tooltip "
-                  "style - that is shown when hovering over the icon."));
-    gtk_box_pack_start(GTK_BOX(hbox), dialog->check_scrollbox_show,
-                       TRUE, TRUE, 0);
+    dialog->check_scrollbox_show = GTK_WIDGET (gtk_builder_get_object (GTK_BUILDER (dialog->builder), "check_scrollbox_show"));
     gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON
                                  (dialog->check_scrollbox_show),
                                  dialog->pd->show_scrollbox);
 
     /* values to show at once (multiple lines) */
-    label = gtk_label_new_with_mnemonic(_("Li_nes:"));
-    gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
-    gtk_box_pack_start(GTK_BOX(hbox), label, TRUE, TRUE, 0);
-    ADD_SPIN(dialog->spin_scrollbox_lines, 1, MAX_SCROLLBOX_LINES, 1,
-             dialog->pd->scrollbox_lines, 0, sg_misc);
-    SET_TOOLTIP(dialog->spin_scrollbox_lines,
-                _("Decide how many values should be shown at once in the "
-                  "scrollbox. You can choose a smaller font or enlarge the "
-                  "panel to make more lines fit."));
-    gtk_box_pack_start(GTK_BOX(page), hbox, FALSE, FALSE, 0);
+    dialog->spin_scrollbox_lines = GTK_WIDGET (gtk_builder_get_object (GTK_BUILDER (dialog->builder), "spin_scrollbox_lines"));
+    gtk_spin_button_set_range (GTK_SPIN_BUTTON (dialog->spin_scrollbox_lines), 1, MAX_SCROLLBOX_LINES);
+    gtk_spin_button_set_value (GTK_SPIN_BUTTON (dialog->spin_scrollbox_lines), dialog->pd->scrollbox_lines);
 
     /* font and color */
-    hbox = gtk_hbox_new(FALSE, BORDER);
-    label = gtk_label_new(_("Font and color:"));
-    gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
-    gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
-    dialog->button_scrollbox_font =
-        gtk_button_new_with_mnemonic(_("Select _font"));
-    SET_TOOLTIP(dialog->button_scrollbox_font,
-                _("Choose a font you like and set it to a smaller or larger "
-                  "size. Middle-click on the button to unset the font and use "
-                  "your theme's default."));
-    gtk_box_pack_start(GTK_BOX(hbox), dialog->button_scrollbox_font,
-                       TRUE, TRUE, 0);
+    dialog->button_scrollbox_font = GTK_WIDGET (gtk_builder_get_object (GTK_BUILDER (dialog->builder), "button_scrollbox_font"));
     if (dialog->pd->scrollbox_font)
         gtk_button_set_label(GTK_BUTTON(dialog->button_scrollbox_font),
                              dialog->pd->scrollbox_font);
-    dialog->button_scrollbox_color =
-        gtk_color_button_new_with_color(&(dialog->pd->scrollbox_color));
-    gtk_size_group_add_widget(sg_misc, dialog->button_scrollbox_color);
-    SET_TOOLTIP(dialog->button_scrollbox_color,
-                _("There may be problems with some themes that cause the "
-                  "scrollbox text to be hardly readable. If this is the case "
-                  "or you simply want it to appear in another color, then "
-                  "you can change it using this button. Middle-click on the "
-                  "button to unset the scrollbox text color."));
-    gtk_box_pack_start(GTK_BOX(hbox), dialog->button_scrollbox_color,
-                       FALSE, FALSE, 0 );
-    gtk_box_pack_start(GTK_BOX(page), hbox, FALSE, FALSE, 0);
-
-    /* separator */
-    sep = gtk_hseparator_new();
-    gtk_box_pack_start(GTK_BOX(page), sep, FALSE, FALSE, BORDER * 2);
+    dialog->button_scrollbox_color = GTK_WIDGET (gtk_builder_get_object (GTK_BUILDER (dialog->builder), "button_scrollbox_color"));
+    gtk_color_button_set_color (GTK_COLOR_BUTTON (dialog->button_scrollbox_color), &(dialog->pd->scrollbox_color));
 
     /* labels and buttons */
-    hbox = gtk_hbox_new(FALSE, BORDER);
-    sg_button = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
-    dialog->options_datatypes = make_label();
-    gtk_box_pack_start(GTK_BOX(hbox), dialog->options_datatypes, TRUE, TRUE, 0);
+    dialog->options_datatypes = GTK_WIDGET (gtk_builder_get_object (GTK_BUILDER (dialog->builder), "options_datatypes"));
     options_datatypes_set_tooltip(dialog->options_datatypes);
     dialog->model_datatypes = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT);
-    dialog->list_datatypes =
-        gtk_tree_view_new_with_model(GTK_TREE_MODEL(dialog->model_datatypes));
+    dialog->list_datatypes = GTK_WIDGET (gtk_builder_get_object (GTK_BUILDER (dialog->builder), "list_datatypes"));
+    gtk_tree_view_set_model (GTK_TREE_VIEW (dialog->list_datatypes), GTK_TREE_MODEL(dialog->model_datatypes));
     renderer = gtk_cell_renderer_text_new();
     column =
         gtk_tree_view_column_new_with_attributes(_("Labels to d_isplay"),
                                                  renderer, "text", 0, NULL);
-    SET_TOOLTIP(dialog->list_datatypes,
-                _("These are the values that will be shown in the scrollbox. "
-                  "Select a single value here and click the appropriate button "
-                  "to remove it or move it up and down in the list."));
     gtk_tree_view_append_column(GTK_TREE_VIEW(dialog->list_datatypes), column);
-    gtk_widget_set_size_request(dialog->options_datatypes, 300, -1);
 
     /* button "add" */
-    ADD_LABEL_EDIT_BUTTON(button_add, _("A_dd"),
-                          GTK_STOCK_ADD, button_add_option_clicked);
-    SET_TOOLTIP(button_add,
-                _("Add the selected value to the labels that should be "
-                  "displayed in the scrollbox."));
-    gtk_box_pack_start(GTK_BOX(hbox), button_add, FALSE, FALSE, 0);
-    gtk_box_pack_start(GTK_BOX(page), hbox, FALSE, FALSE, 0);
-
-    /* labels to display */
-    hbox = gtk_hbox_new(FALSE, BORDER);
-    scroll = gtk_scrolled_window_new(NULL, NULL);
-    gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll),
-                                   GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
-    gtk_container_add(GTK_CONTAINER(scroll), dialog->list_datatypes);
-    gtk_box_pack_start(GTK_BOX(hbox), scroll, TRUE, TRUE, 0);
+    button = GTK_WIDGET (gtk_builder_get_object (GTK_BUILDER (dialog->builder), "button_add"));
+    g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(button_add_option_clicked), dialog);
 
     /* button "remove" */
-    table = gtk_table_new(4, 1, TRUE);
-    ADD_LABEL_EDIT_BUTTON(button_del, _("_Remove"),
-                          GTK_STOCK_REMOVE, button_del_option_clicked);
-    SET_TOOLTIP(button_del,
-                _("Select a value in the list of labels to display and click "
-                  "this button to remove it."));
-    gtk_table_attach_defaults(GTK_TABLE(table), button_del, 0, 1, 0, 1);
+    button = GTK_WIDGET (gtk_builder_get_object (GTK_BUILDER (dialog->builder), "button_del"));
+    g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(button_del_option_clicked), dialog);
 
     /* button "move up" */
-    ADD_LABEL_EDIT_BUTTON(button_up, _("Move u_p"),
-                          GTK_STOCK_GO_UP, button_up_option_clicked);
-    SET_TOOLTIP(button_up,
-                _("Move the selected value up in the list of labels "
-                  "to display."));
-    gtk_table_attach_defaults(GTK_TABLE(table), button_up, 0, 1, 2, 3);
+    button = GTK_WIDGET (gtk_builder_get_object (GTK_BUILDER (dialog->builder), "button_up"));
+    g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(button_up_option_clicked), dialog);
 
     /* button "move down" */
-    ADD_LABEL_EDIT_BUTTON(button_down, _("Move do_wn"),
-                          GTK_STOCK_GO_DOWN, button_down_option_clicked);
-    SET_TOOLTIP(button_down,
-                _("Move the selected value down in the list of labels "
-                  "to display."));
-    gtk_table_attach_defaults(GTK_TABLE(table), button_down, 0, 1, 3, 4);
-
-    gtk_box_pack_start(GTK_BOX(hbox), table, FALSE, FALSE, 0);
-    gtk_box_pack_start(GTK_BOX(page), hbox, FALSE, FALSE, 0);
+    button = GTK_WIDGET (gtk_builder_get_object (GTK_BUILDER (dialog->builder), "button_down"));
+    g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(button_down_option_clicked), dialog);
 
     if (dialog->pd->labels->len > 0) {
         for (i = 0; i < dialog->pd->labels->len; i++) {
@@ -1938,22 +1604,10 @@ create_scrollbox_page(xfceweather_dialog *dialog)
         }
     }
 
-    dialog->check_scrollbox_animate = gtk_check_button_new_with_mnemonic
-        (_("Animate _transitions between labels"));
+    dialog->check_scrollbox_animate = GTK_WIDGET (gtk_builder_get_object (GTK_BUILDER (dialog->builder), "check_scrollbox_animate"));
     gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON
                                  (dialog->check_scrollbox_animate),
                                  dialog->pd->scrollbox_animate);
-    SET_TOOLTIP(dialog->check_scrollbox_animate,
-                _("Scroll the current displayed value(s) out and the "
-                  "new value(s) in instead of simply changing them. "
-                  "Uncheck this option if you find the animation too "
-                  "distracting."));
-    gtk_box_pack_start(GTK_BOX(page), dialog->check_scrollbox_animate,
-                       FALSE, FALSE, 0);
-
-    g_object_unref(G_OBJECT(sg_misc));
-    g_object_unref(G_OBJECT(sg_button));
-    return palign;
 }
 
 
@@ -2073,34 +1727,22 @@ setup_notebook_signals(xfceweather_dialog *dialog)
 
 xfceweather_dialog *
 create_config_dialog(plugin_data *data,
-                     GtkWidget *vbox)
+                     GtkBuilder  *builder)
 {
     xfceweather_dialog *dialog;
 
     dialog = g_slice_new0(xfceweather_dialog);
     dialog->pd = (plugin_data *) data;
-    dialog->dialog = gtk_widget_get_toplevel(vbox);
-
-    dialog->notebook = gtk_notebook_new();
-    gtk_notebook_append_page(GTK_NOTEBOOK(dialog->notebook),
-                             create_location_page(dialog),
-                             gtk_label_new_with_mnemonic(_("_Location")));
-    gtk_notebook_append_page(GTK_NOTEBOOK(dialog->notebook),
-                             create_units_page(dialog),
-                             gtk_label_new_with_mnemonic(_("_Units")));
-    gtk_notebook_append_page(GTK_NOTEBOOK(dialog->notebook),
-                             create_appearance_page(dialog),
-                             gtk_label_new_with_mnemonic(_("_Appearance")));
-    gtk_notebook_append_page(GTK_NOTEBOOK(dialog->notebook),
-                             create_scrollbox_page(dialog),
-                             gtk_label_new_with_mnemonic(_("_Scrollbox")));
+    dialog->dialog = GTK_WIDGET (gtk_builder_get_object (GTK_BUILDER (builder), "dialog"));
+    dialog->builder = builder;
+
+    dialog->notebook = GTK_WIDGET (gtk_builder_get_object (GTK_BUILDER (builder), "notebook"));
+    create_location_page(dialog);
+    create_units_page(dialog);
+    create_appearance_page(dialog);
+    create_scrollbox_page(dialog);
+
     setup_notebook_signals(dialog);
-    gtk_box_pack_start(GTK_BOX(vbox), dialog->notebook, TRUE, TRUE, 0);
-    gtk_widget_show(GTK_WIDGET(vbox));
-    gtk_widget_hide(GTK_WIDGET(dialog->update_spinner));
-#if !LIBXFCE4PANEL_CHECK_VERSION(4,9,0)
-    gtk_widget_hide(GTK_WIDGET(dialog->check_single_row));
-#endif
 
     /* automatically detect current location if it is yet unknown */
     if (!(dialog->pd->lat && dialog->pd->lon))
diff --git a/panel-plugin/weather-config.h b/panel-plugin/weather-config.h
index 7ba743b..76ec1ca 100644
--- a/panel-plugin/weather-config.h
+++ b/panel-plugin/weather-config.h
@@ -31,6 +31,7 @@ typedef struct {
     GtkWidget *notebook;
     plugin_data *pd;
     guint timer_id;
+    GtkBuilder *builder;
 
     /* location page */
     GtkWidget *text_loc_name;
@@ -72,7 +73,7 @@ typedef struct {
 
 
 xfceweather_dialog *create_config_dialog(plugin_data *data,
-                                         GtkWidget *vbox);
+                                         GtkBuilder  *builder);
 
 G_END_DECLS
 
diff --git a/panel-plugin/weather-config.ui b/panel-plugin/weather-config.ui
index 5c71fdb..39a87cb 100644
--- a/panel-plugin/weather-config.ui
+++ b/panel-plugin/weather-config.ui
@@ -1,8 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!-- Generated with glade 3.22.1 -->
 <interface>
-  <requires lib="gtk+" version="3.20"/>
-  <requires lib="libxfce4ui-2" version="4.12"/>
+  <requires lib="gtk+" version="2.24"/>
   <object class="GtkAdjustment" id="adjustment1">
     <property name="lower">1</property>
     <property name="upper">10</property>
@@ -15,6 +14,24 @@
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
   </object>
+  <object class="GtkAdjustment" id="adjustment3">
+    <property name="lower">-90</property>
+    <property name="upper">90</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
+  <object class="GtkAdjustment" id="adjustment4">
+    <property name="lower">-180</property>
+    <property name="upper">180</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
+  <object class="GtkAdjustment" id="adjustment5">
+    <property name="lower">-420</property>
+    <property name="upper">10000</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
   <object class="GtkImage" id="image1">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
@@ -46,21 +63,22 @@
     <property name="icon_name">down</property>
   </object>
   <object class="GtkListStore" id="liststore1"/>
-  <object class="XfceTitledDialog" id="dialog">
+  <object class="GtkDialog" id="dialog">
     <property name="can_focus">False</property>
     <property name="title" translatable="yes">Weather Update</property>
     <property name="default_width">430</property>
     <property name="default_height">430</property>
+    <property name="destroy_with_parent">True</property>
     <property name="icon_name">xfce4-weather</property>
     <property name="type_hint">dialog</property>
     <property name="subtitle" translatable="yes">Preferences</property>
     <child internal-child="vbox">
-      <object class="GtkBox">
+      <object class="GtkVBox" id="box1">
         <property name="can_focus">False</property>
         <property name="orientation">vertical</property>
         <property name="spacing">2</property>
         <child internal-child="action_area">
-          <object class="GtkButtonBox">
+          <object class="GtkButtonBox" id="buttonbox1">
             <property name="can_focus">False</property>
             <property name="layout_style">end</property>
             <child>
@@ -100,12 +118,12 @@
           </packing>
         </child>
         <child>
-          <object class="GtkNotebook">
+          <object class="GtkNotebook" id="notebook">
             <property name="visible">True</property>
             <property name="can_focus">True</property>
             <property name="border_width">6</property>
             <child>
-              <object class="GtkGrid">
+              <object class="GtkTable" id="grid1">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <property name="valign">start</property>
@@ -113,11 +131,12 @@
                 <property name="row_spacing">6</property>
                 <property name="column_spacing">12</property>
                 <child>
-                  <object class="GtkLabel">
+                  <object class="GtkLabel" id="label1">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="label" translatable="yes">Location _name:</property>
                     <property name="use_underline">True</property>
+                    <property name="mnemonic_widget">text_loc_name</property>
                     <property name="xalign">0</property>
                   </object>
                   <packing>
@@ -126,11 +145,12 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkLabel">
+                  <object class="GtkLabel" id="label2">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="label" translatable="yes">Latitud_e:</property>
                     <property name="use_underline">True</property>
+                    <property name="mnemonic_widget">spin_lat</property>
                     <property name="xalign">0</property>
                   </object>
                   <packing>
@@ -139,11 +159,12 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkLabel">
+                  <object class="GtkLabel" id="label3">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="label" translatable="yes">L_ongitude:</property>
                     <property name="use_underline">True</property>
+                    <property name="mnemonic_widget">spin_lon</property>
                     <property name="xalign">0</property>
                   </object>
                   <packing>
@@ -152,11 +173,12 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkLabel">
+                  <object class="GtkLabel" id="label4">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="label" translatable="yes">Altitu_de:</property>
                     <property name="use_underline">True</property>
+                    <property name="mnemonic_widget">spin_alt</property>
                     <property name="xalign">0</property>
                   </object>
                   <packing>
@@ -165,11 +187,12 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkLabel">
+                  <object class="GtkLabel" id="label5">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="label" translatable="yes">_Timezone:</property>
                     <property name="use_underline">True</property>
+                    <property name="mnemonic_widget">text_timezone</property>
                     <property name="xalign">0</property>
                   </object>
                   <packing>
@@ -178,7 +201,7 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkSeparator">
+                  <object class="GtkHSeparator" id="separator1">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="margin_top">6</property>
@@ -191,7 +214,7 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkLabel">
+                  <object class="GtkLabel" id="label6">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="label" translatable="yes">Please change location name to your liking and correct alltitude and timezone if they are not auto-detected correctly.</property>
@@ -234,7 +257,7 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkBox">
+                  <object class="GtkHBox" id="box2">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="spacing">6</property>
@@ -244,6 +267,7 @@
                         <property name="can_focus">True</property>
                         <property name="tooltip_text" translatable="yes">Latitude specifies the north-south position of a point on the Earth's surface. If you change this value manually, you need to provide altitude and timezone manually too.</property>
                         <property name="width_chars">11</property>
+                        <property name="adjustment">adjustment3</property>
                         <property name="digits">6</property>
                       </object>
                       <packing>
@@ -253,7 +277,7 @@
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkLabel">
+                      <object class="GtkLabel" id="label7">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <property name="label" translatable="yes">°</property>
@@ -272,7 +296,7 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkBox">
+                  <object class="GtkHBox" id="box3">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="spacing">6</property>
@@ -282,6 +306,7 @@
                         <property name="can_focus">True</property>
                         <property name="tooltip_text" translatable="yes">Longitude specifies the east-west position of a point on the Earth's surface. If you change this value manually, you need to provide altitude and timezone manually too.</property>
                         <property name="width_chars">11</property>
+                        <property name="adjustment">adjustment4</property>
                         <property name="digits">6</property>
                       </object>
                       <packing>
@@ -291,7 +316,7 @@
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkLabel">
+                      <object class="GtkLabel" id="label8">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <property name="label" translatable="yes">°</property>
@@ -310,7 +335,7 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkBox">
+                  <object class="GtkHBox" id="box4">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="spacing">6</property>
@@ -324,6 +349,7 @@ The plugin tries to auto-detect the altitude using the GeoNames webservice, but
 
 Altitude is given in meters above sea level, or alternatively in feet by changing the unit on the units page. It should match the real value roughly, but small differences will have no influence on the weather data. Inside Norway, this setting has no effect at all.</property>
                         <property name="width_chars">11</property>
+                        <property name="adjustment">adjustment5</property>
                       </object>
                       <packing>
                         <property name="expand">False</property>
@@ -332,7 +358,7 @@ Altitude is given in meters above sea level, or alternatively in feet by changin
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkLabel">
+                      <object class="GtkLabel" id="label_alt_unit">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <property name="label" translatable="yes">feet</property>
@@ -363,10 +389,21 @@ Leave this field empty to use the timezone set by your system. Invalid entries w
                     <property name="width">2</property>
                   </packing>
                 </child>
+                <child>
+                  <object class="GtkSpinButton" id="update_spinner">
+                    <property name="can_focus">True</property>
+                    <property name="no_show_all">True</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">7</property>
+                    <property name="width">3</property>
+                  </packing>
+                </child>
               </object>
             </child>
             <child type="tab">
-              <object class="GtkLabel">
+              <object class="GtkLabel" id="label9">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <property name="label" translatable="yes">_Location</property>
@@ -377,7 +414,7 @@ Leave this field empty to use the timezone set by your system. Invalid entries w
               </packing>
             </child>
             <child>
-              <object class="GtkGrid">
+              <object class="GtkTable" id="grid2">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <property name="valign">start</property>
@@ -385,11 +422,12 @@ Leave this field empty to use the timezone set by your system. Invalid entries w
                 <property name="row_spacing">6</property>
                 <property name="column_spacing">12</property>
                 <child>
-                  <object class="GtkLabel">
+                  <object class="GtkLabel" id="label10">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="label" translatable="yes">_Temperature:</property>
                     <property name="use_underline">True</property>
+                    <property name="mnemonic_widget">combo_unit_temperature</property>
                     <property name="xalign">0</property>
                   </object>
                   <packing>
@@ -398,11 +436,12 @@ Leave this field empty to use the timezone set by your system. Invalid entries w
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkLabel">
+                  <object class="GtkLabel" id="label11">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="label" translatable="yes">Barometric _pressure:</property>
                     <property name="use_underline">True</property>
+                    <property name="mnemonic_widget">combo_unit_pressure</property>
                     <property name="xalign">0</property>
                   </object>
                   <packing>
@@ -411,11 +450,12 @@ Leave this field empty to use the timezone set by your system. Invalid entries w
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkLabel">
+                  <object class="GtkLabel" id="label12">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="label" translatable="yes">_Wind speed:</property>
                     <property name="use_underline">True</property>
+                    <property name="mnemonic_widget">combo_unit_windspeed</property>
                     <property name="xalign">0</property>
                   </object>
                   <packing>
@@ -424,11 +464,12 @@ Leave this field empty to use the timezone set by your system. Invalid entries w
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkLabel">
+                  <object class="GtkLabel" id="label13">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="label" translatable="yes">Prec_ipitations:</property>
                     <property name="use_underline">True</property>
+                    <property name="mnemonic_widget">combo_unit_precipitation</property>
                     <property name="xalign">0</property>
                   </object>
                   <packing>
@@ -437,11 +478,12 @@ Leave this field empty to use the timezone set by your system. Invalid entries w
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkLabel">
+                  <object class="GtkLabel" id="label14">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="label" translatable="yes">Altitu_de:</property>
                     <property name="use_underline">True</property>
+                    <property name="mnemonic_widget">combo_unit_altitude</property>
                     <property name="xalign">0</property>
                   </object>
                   <packing>
@@ -450,7 +492,7 @@ Leave this field empty to use the timezone set by your system. Invalid entries w
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkSeparator">
+                  <object class="GtkHSeparator" id="separator2">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="margin_top">6</property>
@@ -463,11 +505,12 @@ Leave this field empty to use the timezone set by your system. Invalid entries w
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkLabel">
+                  <object class="GtkLabel" id="label15">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="label" translatable="yes">Apparent te_mperature:</property>
                     <property name="use_underline">True</property>
+                    <property name="mnemonic_widget">combo_apparent_temperature</property>
                   </object>
                   <packing>
                     <property name="left_attach">0</property>
@@ -572,7 +615,7 @@ Leave this field empty to use the timezone set by your system. Invalid entries w
               </packing>
             </child>
             <child type="tab">
-              <object class="GtkLabel">
+              <object class="GtkLabel" id="label16">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <property name="label" translatable="yes">_Units</property>
@@ -584,18 +627,20 @@ Leave this field empty to use the timezone set by your system. Invalid entries w
               </packing>
             </child>
             <child>
-              <object class="GtkGrid">
+              <object class="GtkTable" id="grid3">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <property name="border_width">12</property>
                 <property name="row_spacing">6</property>
                 <property name="column_spacing">12</property>
                 <child>
-                  <object class="GtkLabel">
+                  <object class="GtkLabel" id="label17">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
+                    <property name="tooltip_text" translatable="yes">Available icon themes are listed here. You can add icon themes to $HOME/.config/xfce4/weather/icons (or the equivalent directory on your system). Information about how to create or use icon themes can be found in the README file. New icon themes will be detected everytime you open this config dialog.</property>
                     <property name="label" translatable="yes">_Icon theme:</property>
                     <property name="use_underline">True</property>
+                    <property name="mnemonic_widget">combo_icon_theme</property>
                     <property name="xalign">0</property>
                   </object>
                   <packing>
@@ -604,7 +649,7 @@ Leave this field empty to use the timezone set by your system. Invalid entries w
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkBox">
+                  <object class="GtkHBox" id="box5">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="hexpand">True</property>
@@ -613,7 +658,6 @@ Leave this field empty to use the timezone set by your system. Invalid entries w
                       <object class="GtkComboBoxText" id="combo_icon_theme">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="tooltip_text" translatable="yes">Available icon themes are listed here. You can add icon themes to $HOME/.config/xfce4/weather/icons (or the equivalent directory on your system). Information about how to create or use icon themes can be found in the README file. New icon themes will be detected everytime you open this config dialog.</property>
                       </object>
                       <packing>
                         <property name="expand">True</property>
@@ -658,7 +702,7 @@ Leave this field empty to use the timezone set by your system. Invalid entries w
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkSeparator">
+                  <object class="GtkHSeparator" id="separator3">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="margin_top">6</property>
@@ -671,11 +715,12 @@ Leave this field empty to use the timezone set by your system. Invalid entries w
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkLabel">
+                  <object class="GtkLabel" id="label18">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="label" translatable="yes">_Tooltip style:</property>
                     <property name="use_underline">True</property>
+                    <property name="mnemonic_widget">combo_tooltip_style</property>
                     <property name="xalign">0</property>
                   </object>
                   <packing>
@@ -699,7 +744,7 @@ Leave this field empty to use the timezone set by your system. Invalid entries w
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkSeparator">
+                  <object class="GtkHSeparator" id="label19">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="margin_top">6</property>
@@ -712,11 +757,12 @@ Leave this field empty to use the timezone set by your system. Invalid entries w
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkLabel">
+                  <object class="GtkLabel" id="label20">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="label" translatable="yes">_Forecast layout:</property>
                     <property name="use_underline">True</property>
+                    <property name="mnemonic_widget">combo_forecast_layout</property>
                     <property name="xalign">0</property>
                   </object>
                   <packing>
@@ -739,11 +785,12 @@ Leave this field empty to use the timezone set by your system. Invalid entries w
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkLabel">
+                  <object class="GtkLabel" id="label21">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="label" translatable="yes">_Number of forecast days:</property>
                     <property name="use_underline">True</property>
+                    <property name="mnemonic_widget">spin_forecast_days</property>
                     <property name="xalign">0</property>
                   </object>
                   <packing>
@@ -755,7 +802,6 @@ Leave this field empty to use the timezone set by your system. Invalid entries w
                   <object class="GtkSpinButton" id="spin_forecast_days">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
-                    <property name="tooltip_text" translatable="yes">Met.no provides forecast data for up to 5 days in the future. Choose how many days will be shown in the forecast tab in the summary window. On slower computers, a lower number might help against lags when opening the window. Note however that usually forecasts for more than three days in the future are unreliable at best ;-)</property>
                     <property name="halign">start</property>
                     <property name="adjustment">adjustment1</property>
                     <property name="numeric">True</property>
@@ -767,7 +813,7 @@ Leave this field empty to use the timezone set by your system. Invalid entries w
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkSeparator">
+                  <object class="GtkHSeparator" id="separator4">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="margin_top">6</property>
@@ -800,7 +846,7 @@ Leave this field empty to use the timezone set by your system. Invalid entries w
               </packing>
             </child>
             <child type="tab">
-              <object class="GtkLabel">
+              <object class="GtkLabel" id="label22">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <property name="label" translatable="yes">_Appearance</property>
@@ -812,7 +858,7 @@ Leave this field empty to use the timezone set by your system. Invalid entries w
               </packing>
             </child>
             <child>
-              <object class="GtkGrid">
+              <object class="GtkTable" id="grid4">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <property name="border_width">12</property>
@@ -834,12 +880,13 @@ Leave this field empty to use the timezone set by your system. Invalid entries w
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkLabel">
+                  <object class="GtkLabel" id="label23">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="hexpand">True</property>
                     <property name="label" translatable="yes">Li_nes:</property>
                     <property name="use_underline">True</property>
+                    <property name="mnemonic_widget">spin_scrollbox_lines</property>
                     <property name="xalign">1</property>
                   </object>
                   <packing>
@@ -863,7 +910,7 @@ Leave this field empty to use the timezone set by your system. Invalid entries w
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkLabel">
+                  <object class="GtkLabel" id="label24">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="label" translatable="yes">Font and color:</property>
@@ -875,20 +922,6 @@ Leave this field empty to use the timezone set by your system. Invalid entries w
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkFontButton" id="button_scrollbox_font">
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="receives_default">True</property>
-                    <property name="tooltip_text" translatable="yes">Choose a font you like and set it to a smaller or larger size. Middle-click on the button to unset the font and use your theme's default.</property>
-                    <property name="font">Sans 12</property>
-                    <property name="preview_text"/>
-                  </object>
-                  <packing>
-                    <property name="left_attach">1</property>
-                    <property name="top_attach">1</property>
-                  </packing>
-                </child>
-                <child>
                   <object class="GtkColorButton" id="button_scrollbox_color">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
@@ -901,7 +934,7 @@ Leave this field empty to use the timezone set by your system. Invalid entries w
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkSeparator">
+                  <object class="GtkHSeparator" id="separator5">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="margin_top">6</property>
@@ -914,7 +947,7 @@ Leave this field empty to use the timezone set by your system. Invalid entries w
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkGrid">
+                  <object class="GtkTable" id="grid5">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="hexpand">True</property>
@@ -950,14 +983,14 @@ Leave this field empty to use the timezone set by your system. Invalid entries w
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkScrolledWindow">
+                      <object class="GtkScrolledWindow" id="scrollwindow1">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="hexpand">True</property>
                         <property name="vexpand">True</property>
                         <property name="shadow_type">in</property>
                         <child>
-                          <object class="GtkViewport">
+                          <object class="GtkViewport" id="viewport1">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
                             <child>
@@ -967,7 +1000,7 @@ Leave this field empty to use the timezone set by your system. Invalid entries w
                                 <property name="tooltip_text" translatable="yes">These are the values that will be shown in the scrollbox. Select a single value here and click the appropriate button to remove it or move it up and down in the list.</property>
                                 <property name="model">liststore1</property>
                                 <child internal-child="selection">
-                                  <object class="GtkTreeSelection"/>
+                                  <object class="GtkTreeSelection" id="selection1" />
                                 </child>
                               </object>
                             </child>
@@ -980,7 +1013,7 @@ Leave this field empty to use the timezone set by your system. Invalid entries w
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkBox">
+                      <object class="GtkVBox" id="box6">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <property name="orientation">vertical</property>
@@ -1018,7 +1051,7 @@ Leave this field empty to use the timezone set by your system. Invalid entries w
                           </packing>
                         </child>
                         <child>
-                          <object class="GtkSeparator">
+                          <object class="GtkHSeparator" id="separator6">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
                             <property name="opacity">0</property>
@@ -1093,13 +1126,27 @@ Leave this field empty to use the timezone set by your system. Invalid entries w
                     <property name="width">3</property>
                   </packing>
                 </child>
+                <child>
+                  <object class="GtkButton" id="button_scrollbox_font">
+                    <property name="label" translatable="yes">Select _font</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">True</property>
+                    <property name="tooltip_text" translatable="yes">Choose a font you like and set it to a smaller or larger size. Middle-click on the button to unset the font and use your theme's default.</property>
+                    <property name="use_underline">True</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="top_attach">1</property>
+                  </packing>
+                </child>
               </object>
               <packing>
                 <property name="position">3</property>
               </packing>
             </child>
             <child type="tab">
-              <object class="GtkLabel">
+              <object class="GtkLabel" id="label25">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <property name="label" translatable="yes">_Scrollbox</property>
@@ -1119,5 +1166,9 @@ Leave this field empty to use the timezone set by your system. Invalid entries w
         </child>
       </object>
     </child>
+    <action-widgets>
+      <action-widget response="-11">help_button</action-widget>
+      <action-widget response="-7">close_button</action-widget>
+    </action-widgets>
   </object>
 </interface>
diff --git a/panel-plugin/weather.c b/panel-plugin/weather.c
index c096795..baced65 100644
--- a/panel-plugin/weather.c
+++ b/panel-plugin/weather.c
@@ -37,6 +37,8 @@
 #include "weather-scrollbox.h"
 #include "weather-debug.h"
 
+#include "weather-config_ui.h"
+
 #define XFCEWEATHER_ROOT "weather"
 #define CACHE_FILE_MAX_AGE (48 * 3600)
 #define BORDER (8)
@@ -1631,32 +1633,31 @@ static void
 xfceweather_create_options(XfcePanelPlugin *plugin,
                            plugin_data *data)
 {
-    GtkWidget *dlg, *vbox;
+    GtkWidget *dlg;
+    GtkBuilder *builder;
     xfceweather_dialog *dialog;
+    GError *error = NULL;
+    gint response;
 
     xfce_panel_plugin_block_menu(plugin);
 
-    dlg = xfce_titled_dialog_new_with_buttons(_("Weather Update"),
-                                              GTK_WINDOW
-                                              (gtk_widget_get_toplevel
-                                               (GTK_WIDGET(plugin))),
-                                              GTK_DIALOG_DESTROY_WITH_PARENT |
-                                              GTK_DIALOG_NO_SEPARATOR,
-                                              GTK_STOCK_HELP, GTK_RESPONSE_HELP,
-                                              GTK_STOCK_CLOSE, GTK_RESPONSE_OK,
-                                              NULL);
-
-    gtk_container_set_border_width(GTK_CONTAINER(dlg), 2);
-    gtk_window_set_icon_name(GTK_WINDOW(dlg), "xfce4-settings");
-
-    vbox = gtk_vbox_new(FALSE, BORDER);
-    gtk_container_set_border_width(GTK_CONTAINER(vbox), BORDER - 2);
-    gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dlg)->vbox), vbox, TRUE, TRUE, 0);
-
-    dialog = create_config_dialog(data, vbox);
-    g_signal_connect(G_OBJECT(dlg), "response",
-                     G_CALLBACK(xfceweather_dialog_response), dialog);
-    gtk_widget_show(dlg);
+    builder = gtk_builder_new ();
+    if (gtk_builder_add_from_string (builder, weather_config_ui,
+                                     weather_config_ui_length, &error) != 0)
+    {
+        dlg = gtk_builder_get_object (builder, "dialog");
+        gtk_window_set_transient_for (GTK_WINDOW (dlg), 
+                                      (gtk_widget_get_toplevel
+                                       (GTK_WIDGET(plugin))));
+
+        dialog = create_config_dialog(data, builder);
+
+        gtk_widget_show_all (GTK_WIDGET (dlg));
+        response = gtk_dialog_run(GTK_DIALOG (dlg));
+        xfceweather_dialog_response(dlg, response, dialog);
+    } {
+        g_warning ("%s", error->message);
+    }
 }
 
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list