summaryrefslogtreecommitdiff
path: root/mateweather
diff options
context:
space:
mode:
authorrbuj <[email protected]>2020-07-18 12:08:59 +0200
committerraveit65 <[email protected]>2020-07-26 17:43:49 +0200
commit4b463e46b85ac0d8235c0edd201f1597e9398500 (patch)
tree5fbf6524c58bb37ffd00eb026ae7280e8b11abe8 /mateweather
parent1c0b07583766c974631f1e6e3630e0d15e782a98 (diff)
downloadmate-applets-4b463e46b85ac0d8235c0edd201f1597e9398500.tar.bz2
mate-applets-4b463e46b85ac0d8235c0edd201f1597e9398500.tar.xz
mateweather: Add mateweather-dialog.ui
Diffstat (limited to 'mateweather')
-rw-r--r--mateweather/Makefile.am26
-rw-r--r--mateweather/mateweather-applet.c87
-rw-r--r--mateweather/mateweather-dialog.c616
-rw-r--r--mateweather/mateweather-dialog.h34
-rw-r--r--mateweather/mateweather-dialog.ui549
-rw-r--r--mateweather/mateweather-resources.gresource.xml7
-rw-r--r--mateweather/mateweather.h1
7 files changed, 766 insertions, 554 deletions
diff --git a/mateweather/Makefile.am b/mateweather/Makefile.am
index dd80e547..07e7884c 100644
--- a/mateweather/Makefile.am
+++ b/mateweather/Makefile.am
@@ -5,7 +5,7 @@ SUBDIRS = docs
AM_CPPFLAGS = \
-I$(srcdir) \
-I$(top_srcdir) \
- -DMATEWEATHER_MENU_UI_DIR=\""$(uidir)"\" \
+ -DWEATHER_RESOURCE_PATH=\""/org/mate/mate-applets/mateweather/"\" \
$(MATE_APPLETS4_CFLAGS) \
$(LIBNOTIFY_CFLAGS) \
$(LIBMATEWEATHER_CFLAGS) \
@@ -13,6 +13,8 @@ AM_CPPFLAGS = \
libexec_PROGRAMS = mateweather-applet
+BUILT_SOURCES = mateweather-resources.c mateweather-resources.h
+nodist_mateweather_applet_SOURCES = $(BUILT_SOURCES)
mateweather_applet_SOURCES = \
mateweather.h \
main.c \
@@ -27,8 +29,11 @@ mateweather_applet_LDADD = \
$(MATE_LIBS2_LIBS) \
$(LIBMATEWEATHER_LIBS)
-uidir = $(datadir)/mate/ui
-ui_DATA = mateweather-applet-menu.xml
+mateweather-resources.c: mateweather-resources.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/mateweather-resources.gresource.xml)
+ $(AM_V_GEN)$(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate --c-name mateweather $<
+
+mateweather-resources.h: mateweather-resources.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/mateweather-resources.gresource.xml)
+ $(AM_V_GEN)$(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate --c-name mateweather $<
appletdir = $(datadir)/mate-panel/applets
applet_in_files = org.mate.applets.MateWeatherApplet.mate-panel-applet.desktop.in
@@ -52,11 +57,18 @@ org.mate.panel.applet.MateWeatherAppletFactory.service: $(service_in_files)
-e "s|\@LIBEXECDIR\@|$(libexecdir)|" \
$< > $@
-CLEANFILES = $(applet_DATA) $(applet_in_files) $(service_DATA)
+CLEANFILES = \
+ $(applet_DATA) \
+ $(applet_in_files) \
+ $(service_DATA) \
+ $(BUILT_SOURCES)
-EXTRA_DIST = \
- $(applet_in_files).in \
- $(service_in_files) \
+EXTRA_DIST = \
+ mateweather-applet-menu.xml \
+ mateweather-dialog.ui \
+ mateweather-resources.gresource.xml \
+ $(applet_in_files).in \
+ $(service_in_files) \
$(ui_DATA)
-include $(top_srcdir)/git.mk
diff --git a/mateweather/mateweather-applet.c b/mateweather/mateweather-applet.c
index 92332224..68041c59 100644
--- a/mateweather/mateweather-applet.c
+++ b/mateweather/mateweather-applet.c
@@ -11,8 +11,8 @@
*/
#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h>
+#endif /* HAVE_CONFIG_H */
#include <stdio.h>
#include <stdlib.h>
@@ -58,7 +58,7 @@ static void help_cb (GtkAction *action,
gtk_get_current_event_time (),
&error);
- if (error) {
+ if (error) {
GtkWidget *dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
_("There was an error displaying help: %s"), error->message);
g_signal_connect (G_OBJECT (dialog), "response", G_CALLBACK (gtk_widget_destroy), NULL);
@@ -128,9 +128,9 @@ static void place_widgets (MateWeatherApplet *gw_applet)
int total_size = 0;
gboolean horizontal = FALSE;
int panel_size = gw_applet->size;
- const gchar *temp;
+ const gchar *temp;
const gchar *icon_name;
-
+
switch (gw_applet->orient) {
case MATE_PANEL_APPLET_ORIENT_LEFT:
case MATE_PANEL_APPLET_ORIENT_RIGHT:
@@ -144,7 +144,7 @@ static void place_widgets (MateWeatherApplet *gw_applet)
/* Create the weather icon */
icon_name = weather_info_get_icon_name (gw_applet->mateweather_info);
- gw_applet->image = gtk_image_new_from_icon_name(icon_name, GTK_ICON_SIZE_BUTTON);
+ gw_applet->image = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_BUTTON);
if (icon_name != NULL) {
gtk_widget_show (gw_applet->image);
@@ -157,10 +157,10 @@ static void place_widgets (MateWeatherApplet *gw_applet)
/* Create the temperature label */
gw_applet->label = gtk_label_new("0\302\260F");
-
+
/* Update temperature text */
temp = weather_info_get_temp_summary(gw_applet->mateweather_info);
- if (temp)
+ if (temp)
gtk_label_set_text(GTK_LABEL(gw_applet->label), temp);
/* Check the label size to determine box layout */
@@ -174,14 +174,14 @@ static void place_widgets (MateWeatherApplet *gw_applet)
/* Pack the box */
if (gw_applet->box)
gtk_widget_destroy (gw_applet->box);
-
+
if (horizontal && (total_size <= panel_size))
gw_applet->box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
else if (horizontal && (total_size > panel_size))
gw_applet->box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
else if (!horizontal && (total_size <= panel_size))
gw_applet->box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
- else
+ else
gw_applet->box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
/* better for vertical panels */
@@ -201,7 +201,7 @@ static void place_widgets (MateWeatherApplet *gw_applet)
static void change_orient_cb (MatePanelApplet *w, MatePanelAppletOrient o, gpointer data)
{
MateWeatherApplet *gw_applet = (MateWeatherApplet *)data;
-
+
gw_applet->orient = o;
place_widgets(gw_applet);
return;
@@ -210,7 +210,7 @@ static void change_orient_cb (MatePanelApplet *w, MatePanelAppletOrient o, gpoin
static void size_allocate_cb(MatePanelApplet *w, GtkAllocation *allocation, gpointer data)
{
MateWeatherApplet *gw_applet = (MateWeatherApplet *)data;
-
+
if ((gw_applet->orient == MATE_PANEL_APPLET_ORIENT_LEFT) || (gw_applet->orient == MATE_PANEL_APPLET_ORIENT_RIGHT)) {
if (gw_applet->size == allocation->width)
return;
@@ -220,7 +220,7 @@ static void size_allocate_cb(MatePanelApplet *w, GtkAllocation *allocation, gpoi
return;
gw_applet->size = allocation->height;
}
-
+
place_widgets(gw_applet);
return;
}
@@ -237,17 +237,17 @@ static gboolean clicked_cb (GtkWidget *widget, GdkEventButton *ev, gpointer data
details_cb (NULL, gw_applet);
else
gtk_widget_destroy (GTK_WIDGET (gw_applet->details_dialog));
-
+
return TRUE;
}
-
+
return FALSE;
}
-static gboolean
+static gboolean
key_press_cb (GtkWidget *widget, GdkEventKey *event, MateWeatherApplet *gw_applet)
{
- switch (event->keyval) {
+ switch (event->keyval) {
case GDK_KEY_u:
if (event->state == GDK_CONTROL_MASK) {
mateweather_update (gw_applet);
@@ -259,7 +259,7 @@ key_press_cb (GtkWidget *widget, GdkEventKey *event, MateWeatherApplet *gw_apple
details_cb (NULL, gw_applet);
return TRUE;
}
- break;
+ break;
case GDK_KEY_KP_Enter:
case GDK_KEY_ISO_Enter:
case GDK_KEY_3270_Enter:
@@ -284,7 +284,6 @@ network_changed (GNetworkMonitor *monitor, gboolean available, MateWeatherApplet
}
}
-
static void
applet_destroy (GtkWidget *widget, MateWeatherApplet *gw_applet)
{
@@ -300,12 +299,12 @@ applet_destroy (GtkWidget *widget, MateWeatherApplet *gw_applet)
g_source_remove(gw_applet->timeout_tag);
gw_applet->timeout_tag = 0;
}
-
+
if (gw_applet->suncalc_timeout_tag > 0) {
g_source_remove(gw_applet->suncalc_timeout_tag);
gw_applet->suncalc_timeout_tag = 0;
}
-
+
if (gw_applet->settings) {
g_object_unref (gw_applet->settings);
gw_applet->settings = NULL;
@@ -322,7 +321,6 @@ applet_destroy (GtkWidget *widget, MateWeatherApplet *gw_applet)
void mateweather_applet_create (MateWeatherApplet *gw_applet)
{
GtkActionGroup *action_group;
- gchar *ui_path;
AtkObject *atk_obj;
GNetworkMonitor*monitor;
@@ -336,7 +334,7 @@ void mateweather_applet_create (MateWeatherApplet *gw_applet)
gw_applet->mateweather_pref.speed_unit = SPEED_UNIT_INVALID;
gw_applet->mateweather_pref.pressure_unit = PRESSURE_UNIT_INVALID;
gw_applet->mateweather_pref.distance_unit = DISTANCE_UNIT_INVALID;
-
+
mate_panel_applet_set_flags (gw_applet->applet, MATE_PANEL_APPLET_EXPAND_MINOR);
mate_panel_applet_set_background_widget(gw_applet->applet,
@@ -350,13 +348,13 @@ void mateweather_applet_create (MateWeatherApplet *gw_applet)
G_CALLBACK(change_orient_cb), gw_applet);
g_signal_connect (G_OBJECT(gw_applet->applet), "size_allocate",
G_CALLBACK(size_allocate_cb), gw_applet);
- g_signal_connect (G_OBJECT(gw_applet->applet), "destroy",
+ g_signal_connect (G_OBJECT(gw_applet->applet), "destroy",
G_CALLBACK (applet_destroy), gw_applet);
g_signal_connect (G_OBJECT(gw_applet->applet), "button_press_event",
G_CALLBACK(clicked_cb), gw_applet);
- g_signal_connect (G_OBJECT(gw_applet->applet), "key_press_event",
+ g_signal_connect (G_OBJECT(gw_applet->applet), "key_press_event",
G_CALLBACK(key_press_cb), gw_applet);
-
+
gtk_widget_set_tooltip_text (GTK_WIDGET(gw_applet->applet), _("MATE Weather"));
atk_obj = gtk_widget_get_accessible (GTK_WIDGET (gw_applet->applet));
@@ -373,10 +371,9 @@ void mateweather_applet_create (MateWeatherApplet *gw_applet)
weather_applet_menu_actions,
G_N_ELEMENTS (weather_applet_menu_actions),
gw_applet);
- ui_path = g_build_filename (MATEWEATHER_MENU_UI_DIR, "mateweather-applet-menu.xml", NULL);
- mate_panel_applet_setup_menu_from_file (gw_applet->applet,
- ui_path, action_group);
- g_free (ui_path);
+ mate_panel_applet_setup_menu_from_resource (gw_applet->applet,
+ WEATHER_RESOURCE_PATH "mateweather-applet-menu.xml",
+ action_group);
if (mate_panel_applet_get_locked_down (gw_applet->applet)) {
GtkAction *action;
@@ -385,8 +382,8 @@ void mateweather_applet_create (MateWeatherApplet *gw_applet)
gtk_action_set_visible (action, FALSE);
}
g_object_unref (action_group);
-
- place_widgets(gw_applet);
+
+ place_widgets(gw_applet);
monitor = g_network_monitor_get_default();
g_signal_connect (monitor, "network-changed",
@@ -395,7 +392,7 @@ void mateweather_applet_create (MateWeatherApplet *gw_applet)
gint timeout_cb (gpointer data)
{
MateWeatherApplet *gw_applet = (MateWeatherApplet *)data;
-
+
mateweather_update(gw_applet);
return 0; /* Do not repeat timeout (will be reset by mateweather_update) */
}
@@ -434,13 +431,13 @@ update_finish (WeatherInfo *info, gpointer data)
{
gw_fault_counter = 0;
icon_name = weather_info_get_icon_name (gw_applet->mateweather_info);
- gtk_image_set_from_icon_name (GTK_IMAGE(gw_applet->image),
+ gtk_image_set_from_icon_name (GTK_IMAGE(gw_applet->image),
icon_name, GTK_ICON_SIZE_BUTTON);
-
- gtk_label_set_text (GTK_LABEL (gw_applet->label),
+
+ gtk_label_set_text (GTK_LABEL (gw_applet->label),
weather_info_get_temp_summary(
gw_applet->mateweather_info));
-
+
s = weather_info_get_weather_summary (gw_applet->mateweather_info);
gtk_widget_set_tooltip_text (GTK_WIDGET (gw_applet->applet), s);
g_free (s);
@@ -457,7 +454,7 @@ update_finish (WeatherInfo *info, gpointer data)
if (gw_applet->mateweather_pref.show_notifications)
{
NotifyNotification *n;
-
+
/* Show notifications if possible */
if (!notify_is_initted ())
notify_init (_("Weather Forecast"));
@@ -466,7 +463,7 @@ update_finish (WeatherInfo *info, gpointer data)
{
GError *error = NULL;
const char *icon;
-
+
/* Show notification */
message = g_strdup_printf ("%s: %s",
weather_info_get_location_name (info),
@@ -480,16 +477,16 @@ update_finish (WeatherInfo *info, gpointer data)
icon = weather_info_get_icon_name (gw_applet->mateweather_info);
if (icon == NULL)
icon = "stock-unknown";
-
+
n = notify_notification_new (message, detail, icon);
-
+
notify_notification_show (n, &error);
if (error)
{
g_warning ("%s", error->message);
g_error_free (error);
}
-
+
g_free (message);
g_free (detail);
}
@@ -519,8 +516,8 @@ void mateweather_update (MateWeatherApplet *gw_applet)
const gchar *icon_name;
icon_name = weather_info_get_icon_name(gw_applet->mateweather_info);
- gtk_image_set_from_icon_name (GTK_IMAGE (gw_applet->image),
- icon_name, GTK_ICON_SIZE_BUTTON);
+ gtk_image_set_from_icon_name (GTK_IMAGE (gw_applet->image),
+ icon_name, GTK_ICON_SIZE_BUTTON);
gtk_widget_set_tooltip_text (GTK_WIDGET(gw_applet->applet), _("Updating..."));
/* Set preferred forecast type */
@@ -539,7 +536,7 @@ void mateweather_update (MateWeatherApplet *gw_applet)
prefs.distance_unit = gw_applet->mateweather_pref.distance_unit;
/* Update current conditions */
- if (gw_applet->mateweather_info &&
+ if (gw_applet->mateweather_info &&
weather_location_equal(weather_info_get_location(gw_applet->mateweather_info),
gw_applet->mateweather_pref.location)) {
weather_info_update(gw_applet->mateweather_info, &prefs,
diff --git a/mateweather/mateweather-dialog.c b/mateweather/mateweather-dialog.c
index e8ff29ae..b677094d 100644
--- a/mateweather/mateweather-dialog.c
+++ b/mateweather/mateweather-dialog.c
@@ -11,8 +11,8 @@
*/
#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h>
+#endif /* HAVE_CONFIG_H */
#include <stdio.h>
#include <stdlib.h>
@@ -27,84 +27,56 @@
#include "mateweather-pref.h"
#include "mateweather-dialog.h"
-struct _MateWeatherDialogPrivate {
- GtkWidget* cond_location;
- GtkWidget* cond_update;
- GtkWidget* cond_cond;
- GtkWidget* cond_sky;
- GtkWidget* cond_temp;
- GtkWidget* cond_dew;
- GtkWidget* cond_humidity;
- GtkWidget* cond_wind;
- GtkWidget* cond_pressure;
- GtkWidget* cond_vis;
- GtkWidget* cond_apparent;
- GtkWidget* cond_sunrise;
- GtkWidget* cond_sunset;
- GtkWidget* cond_image;
- GtkWidget* forecast_text;
- GtkWidget* radar_image;
-
- MateWeatherApplet* applet;
+struct _MateWeatherDialog {
+ GtkDialog parent;
+
+ GtkWidget *weather_notebook;
+ GtkWidget *cond_location;
+ GtkWidget *cond_update;
+ GtkWidget *cond_cond;
+ GtkWidget *cond_sky;
+ GtkWidget *cond_temp;
+ GtkWidget *cond_dew;
+ GtkWidget *cond_humidity;
+ GtkWidget *cond_wind;
+ GtkWidget *cond_pressure;
+ GtkWidget *cond_vis;
+ GtkWidget *cond_apparent;
+ GtkWidget *cond_sunrise;
+ GtkWidget *cond_sunset;
+ GtkWidget *cond_image;
+ GtkWidget *forecast_text;
+ GtkWidget *radar_image;
+
+ MateWeatherApplet *applet;
};
enum {
- PROP_0,
- PROP_MATEWEATHER_APPLET,
+ PROP_0,
+ PROP_MATEWEATHER_APPLET,
};
-G_DEFINE_TYPE_WITH_PRIVATE (MateWeatherDialog, mateweather_dialog, GTK_TYPE_DIALOG);
+G_DEFINE_TYPE (MateWeatherDialog, mateweather_dialog, GTK_TYPE_DIALOG);
#define MONOSPACE_FONT_SCHEMA "org.mate.interface"
#define MONOSPACE_FONT_KEY "monospace-font-name"
-static void mateweather_dialog_save_geometry(MateWeatherDialog* dialog)
-{
-#if 0
- GSettings* settings;
- int w, h;
-
- gtk_window_get_size (GTK_WINDOW (dialog), &w, &h);
-
- settings = dialog->priv->applet->settings;
-
- /* FIXME those keys are not in org.mate.weather! */
- g_settings_set_int (settings, "dialog-width", w);
- g_settings_set_int (settings, "dialog-height", h);
-#endif
-}
-
-static void mateweather_dialog_load_geometry(MateWeatherDialog* dialog)
-{
-#if 0
- GSettings* settings;
- int w, h;
-
- settings = dialog->priv->applet->settings;
-
- /* FIXME those keys are not in org.mate.weather! */
- w = g_settings_get_int (settings, "dialog-width");
- h = g_settings_get_int (settings, "dialog-height");
-
- if (w > 0 && h > 0)
- {
- gtk_window_resize(GTK_WINDOW(dialog), w, h);
- }
-#endif
-}
-
-static void response_cb(MateWeatherDialog* dialog, gint id, gpointer data)
+static void
+response_cb (MateWeatherDialog *dialog,
+ gint id,
+ gpointer data)
{
if (id == GTK_RESPONSE_OK) {
- mateweather_update (dialog->priv->applet);
-
- mateweather_dialog_update (dialog);
+ mateweather_update (dialog->applet);
+ mateweather_dialog_update (dialog);
} else {
- gtk_widget_destroy (GTK_WIDGET(dialog));
+ gtk_widget_destroy (GTK_WIDGET (dialog));
}
}
-static void link_cb(GtkButton* button, gpointer data)
+static void
+link_cb (GtkButton *button,
+ gpointer data)
{
gtk_show_uri_on_window (NULL,
"http://www.weather.com/",
@@ -112,7 +84,8 @@ static void link_cb(GtkButton* button, gpointer data)
NULL);
}
-static gchar* replace_multiple_new_lines(gchar* s)
+static gchar*
+replace_multiple_new_lines(gchar* s)
{
gchar *prev_s = s;
gint count;
@@ -140,350 +113,6 @@ static gchar* replace_multiple_new_lines(gchar* s)
return prev_s;
}
-static void mateweather_dialog_create(MateWeatherDialog* dialog)
-{
- MateWeatherDialogPrivate *priv;
- MateWeatherApplet *gw_applet;
-
- GtkWidget *weather_vbox;
- GtkWidget *weather_notebook;
- GtkWidget *cond_hbox;
- GtkWidget *cond_grid;
- GtkWidget *cond_location_lbl;
- GtkWidget *cond_update_lbl;
- GtkWidget *cond_temp_lbl;
- GtkWidget *cond_cond_lbl;
- GtkWidget *cond_sky_lbl;
- GtkWidget *cond_wind_lbl;
- GtkWidget *cond_humidity_lbl;
- GtkWidget *cond_pressure_lbl;
- GtkWidget *cond_vis_lbl;
- GtkWidget *cond_dew_lbl;
- GtkWidget *cond_apparent_lbl;
- GtkWidget *cond_sunrise_lbl;
- GtkWidget *cond_sunset_lbl;
- GtkWidget *cond_vbox;
- GtkWidget *current_note_lbl;
- GtkWidget *forecast_note_lbl;
- GtkWidget *radar_note_lbl;
- GtkWidget *radar_vbox;
- GtkWidget *radar_link_btn;
- GtkWidget *radar_link_box;
- GtkWidget *forecast_hbox;
- GtkWidget *ebox;
- GtkWidget *scrolled_window;
- GtkWidget *imagescroll_window;
-
- priv = dialog->priv;
- gw_applet = priv->applet;
-
- g_object_set (dialog, "destroy-with-parent", TRUE, NULL);
- gtk_window_set_title (GTK_WINDOW (dialog), _("Details"));
- gtk_dialog_add_buttons (GTK_DIALOG (dialog),
- _("_Update"), GTK_RESPONSE_OK,
- "gtk-close", GTK_RESPONSE_CLOSE,
- NULL);
- gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CLOSE);
- gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
- gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), 2);
- gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
-
- if (gw_applet->mateweather_pref.radar_enabled)
- gtk_window_set_default_size (GTK_WINDOW (dialog), 570,440);
- else
- gtk_window_set_default_size (GTK_WINDOW (dialog), 590, 340);
-
- gtk_window_set_screen (GTK_WINDOW (dialog),
- gtk_widget_get_screen (GTK_WIDGET (gw_applet->applet)));
- mateweather_dialog_load_geometry (dialog);
-
- /* Must come after load geometry, otherwise it will get reset. */
- gtk_window_set_resizable (GTK_WINDOW (dialog), TRUE);
-
- weather_vbox = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
- gtk_widget_show (weather_vbox);
-
- weather_notebook = gtk_notebook_new ();
- gtk_container_set_border_width (GTK_CONTAINER (weather_notebook), 5);
- gtk_widget_show (weather_notebook);
- gtk_box_pack_start (GTK_BOX (weather_vbox), weather_notebook, TRUE, TRUE, 0);
-
- cond_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
- gtk_widget_show (cond_hbox);
- gtk_container_add (GTK_CONTAINER (weather_notebook), cond_hbox);
- gtk_container_set_border_width (GTK_CONTAINER (cond_hbox), 4);
-
- cond_grid = gtk_grid_new ();
- gtk_widget_show (cond_grid);
- gtk_box_pack_start (GTK_BOX (cond_hbox), cond_grid, TRUE, TRUE, 0);
- gtk_container_set_border_width (GTK_CONTAINER (cond_grid), 12);
- gtk_grid_set_row_spacing (GTK_GRID (cond_grid), 6);
- gtk_grid_set_column_spacing (GTK_GRID (cond_grid), 12);
-
- cond_location_lbl = gtk_label_new (_("City:"));
- gtk_widget_show (cond_location_lbl);
- gtk_grid_attach (GTK_GRID (cond_grid), cond_location_lbl, 0, 0, 1, 1);
- gtk_label_set_justify (GTK_LABEL (cond_location_lbl), GTK_JUSTIFY_LEFT);
- gtk_label_set_xalign (GTK_LABEL (cond_location_lbl), 0.0);
-
- cond_update_lbl = gtk_label_new (_("Last update:"));
- gtk_widget_show (cond_update_lbl);
- gtk_grid_attach (GTK_GRID (cond_grid), cond_update_lbl, 0, 1, 1, 1);
- gtk_label_set_justify (GTK_LABEL (cond_update_lbl), GTK_JUSTIFY_LEFT);
- gtk_label_set_xalign (GTK_LABEL (cond_update_lbl), 0.0);
-
- cond_cond_lbl = gtk_label_new (_("Conditions:"));
- gtk_widget_show (cond_cond_lbl);
- gtk_grid_attach (GTK_GRID (cond_grid), cond_cond_lbl, 0, 2, 1, 1);
- gtk_label_set_justify (GTK_LABEL (cond_cond_lbl), GTK_JUSTIFY_LEFT);
- gtk_label_set_xalign (GTK_LABEL (cond_cond_lbl), 0.0);
-
- cond_sky_lbl = gtk_label_new (_("Sky:"));
- gtk_widget_show (cond_sky_lbl);
- gtk_grid_attach (GTK_GRID (cond_grid), cond_sky_lbl, 0, 3, 1, 1);
- gtk_label_set_justify (GTK_LABEL (cond_sky_lbl), GTK_JUSTIFY_LEFT);
- gtk_label_set_xalign (GTK_LABEL (cond_sky_lbl), 0.0);
-
- cond_temp_lbl = gtk_label_new (_("Temperature:"));
- gtk_widget_show (cond_temp_lbl);
- gtk_grid_attach (GTK_GRID (cond_grid), cond_temp_lbl, 0, 4, 1, 1);
- gtk_label_set_justify (GTK_LABEL (cond_temp_lbl), GTK_JUSTIFY_LEFT);
- gtk_label_set_xalign (GTK_LABEL (cond_temp_lbl), 0.0);
-
- cond_apparent_lbl = gtk_label_new (_("Feels like:"));
- gtk_widget_show (cond_apparent_lbl);
- gtk_grid_attach (GTK_GRID (cond_grid), cond_apparent_lbl, 0, 5, 1, 1);
- gtk_label_set_justify (GTK_LABEL (cond_apparent_lbl), GTK_JUSTIFY_LEFT);
- gtk_label_set_xalign (GTK_LABEL (cond_apparent_lbl), 0.0);
-
- cond_dew_lbl = gtk_label_new (_("Dew point:"));
- gtk_widget_show (cond_dew_lbl);
- gtk_grid_attach (GTK_GRID (cond_grid), cond_dew_lbl, 0, 6, 1, 1);
- gtk_label_set_justify (GTK_LABEL (cond_dew_lbl), GTK_JUSTIFY_LEFT);
- gtk_label_set_xalign (GTK_LABEL (cond_dew_lbl), 0.0);
-
- cond_humidity_lbl = gtk_label_new (_("Relative humidity:"));
- gtk_widget_show (cond_humidity_lbl);
- gtk_grid_attach (GTK_GRID (cond_grid), cond_humidity_lbl, 0, 7, 1, 1);
- gtk_label_set_justify (GTK_LABEL (cond_humidity_lbl), GTK_JUSTIFY_LEFT);
- gtk_label_set_xalign (GTK_LABEL (cond_humidity_lbl), 0.0);
-
- cond_wind_lbl = gtk_label_new (_("Wind:"));
- gtk_widget_show (cond_wind_lbl);
- gtk_grid_attach (GTK_GRID (cond_grid), cond_wind_lbl, 0, 8, 1, 1);
- gtk_label_set_justify (GTK_LABEL (cond_wind_lbl), GTK_JUSTIFY_LEFT);
- gtk_label_set_xalign (GTK_LABEL (cond_wind_lbl), 0.0);
-
- cond_pressure_lbl = gtk_label_new (_("Pressure:"));
- gtk_widget_show (cond_pressure_lbl);
- gtk_grid_attach (GTK_GRID (cond_grid), cond_pressure_lbl, 0, 9, 1, 1);
- gtk_label_set_justify (GTK_LABEL (cond_pressure_lbl), GTK_JUSTIFY_LEFT);
- gtk_label_set_xalign (GTK_LABEL (cond_pressure_lbl), 0.0);
-
- cond_vis_lbl = gtk_label_new (_("Visibility:"));
- gtk_widget_show (cond_vis_lbl);
- gtk_grid_attach (GTK_GRID (cond_grid), cond_vis_lbl, 0, 10, 1, 1);
- gtk_label_set_justify (GTK_LABEL (cond_vis_lbl), GTK_JUSTIFY_LEFT);
- gtk_label_set_xalign (GTK_LABEL (cond_vis_lbl), 0.0);
-
- cond_sunrise_lbl = gtk_label_new (_("Sunrise:"));
- gtk_widget_show (cond_sunrise_lbl);
- gtk_grid_attach (GTK_GRID (cond_grid), cond_sunrise_lbl, 0, 11, 1, 1);
- gtk_label_set_justify (GTK_LABEL (cond_sunrise_lbl), GTK_JUSTIFY_LEFT);
- gtk_label_set_xalign (GTK_LABEL (cond_sunrise_lbl), 0.0);
-
- cond_sunset_lbl = gtk_label_new (_("Sunset:"));
- gtk_widget_show (cond_sunset_lbl);
- gtk_grid_attach (GTK_GRID (cond_grid), cond_sunset_lbl, 0, 12, 1, 1);
- gtk_label_set_justify (GTK_LABEL (cond_sunset_lbl), GTK_JUSTIFY_LEFT);
- gtk_label_set_xalign (GTK_LABEL (cond_sunset_lbl), 0.0);
-
- priv->cond_location = gtk_label_new ("");
- gtk_widget_show (priv->cond_location);
- gtk_grid_attach (GTK_GRID (cond_grid), priv->cond_location, 1, 0, 1, 1);
- gtk_label_set_selectable (GTK_LABEL (priv->cond_location), TRUE);
- gtk_label_set_justify (GTK_LABEL (priv->cond_location), GTK_JUSTIFY_LEFT);
- gtk_label_set_xalign (GTK_LABEL (priv->cond_location), 0.0);
-
- priv->cond_update = gtk_label_new ("");
- gtk_widget_show (priv->cond_update);
- gtk_grid_attach (GTK_GRID (cond_grid), priv->cond_update, 1, 1, 1, 1);
- gtk_label_set_selectable (GTK_LABEL (priv->cond_update), TRUE);
- gtk_label_set_justify (GTK_LABEL (priv->cond_update), GTK_JUSTIFY_LEFT);
- gtk_label_set_xalign (GTK_LABEL (priv->cond_update), 0.0);
-
- priv->cond_cond = gtk_label_new ("");
- gtk_widget_show (priv->cond_cond);
- gtk_grid_attach (GTK_GRID (cond_grid), priv->cond_cond, 1, 2, 1, 1);
- gtk_label_set_selectable (GTK_LABEL (priv->cond_cond), TRUE);
- gtk_label_set_justify (GTK_LABEL (priv->cond_cond), GTK_JUSTIFY_LEFT);
- gtk_label_set_xalign (GTK_LABEL (priv->cond_cond), 0.0);
-
- priv->cond_sky = gtk_label_new ("");
- gtk_widget_show (priv->cond_sky);
- gtk_grid_attach (GTK_GRID (cond_grid), priv->cond_sky, 1, 3, 1, 1);
- gtk_label_set_selectable (GTK_LABEL (priv->cond_sky), TRUE);
- gtk_label_set_justify (GTK_LABEL (priv->cond_sky), GTK_JUSTIFY_LEFT);
- gtk_label_set_xalign (GTK_LABEL (priv->cond_sky), 0.0);
-
- priv->cond_temp = gtk_label_new ("");
- gtk_widget_show (priv->cond_temp);
- gtk_grid_attach (GTK_GRID (cond_grid), priv->cond_temp, 1, 4, 1, 1);
- gtk_label_set_selectable (GTK_LABEL (priv->cond_temp), TRUE);
- gtk_label_set_justify (GTK_LABEL (priv->cond_temp), GTK_JUSTIFY_LEFT);
- gtk_label_set_xalign (GTK_LABEL (priv->cond_temp), 0.0);
-
- priv->cond_apparent = gtk_label_new ("");
- gtk_widget_show (priv->cond_apparent);
- gtk_grid_attach (GTK_GRID (cond_grid), priv->cond_apparent, 1, 5, 1, 1);
- gtk_label_set_selectable (GTK_LABEL (priv->cond_apparent), TRUE);
- gtk_label_set_justify (GTK_LABEL (priv->cond_apparent), GTK_JUSTIFY_LEFT);
- gtk_label_set_xalign (GTK_LABEL (priv->cond_apparent), 0.0);
-
- priv->cond_dew = gtk_label_new ("");
- gtk_widget_show (priv->cond_dew);
- gtk_grid_attach (GTK_GRID (cond_grid), priv->cond_dew, 1, 6, 1, 1);
- gtk_label_set_selectable (GTK_LABEL (priv->cond_dew), TRUE);
- gtk_label_set_justify (GTK_LABEL (priv->cond_dew), GTK_JUSTIFY_LEFT);
- gtk_label_set_xalign (GTK_LABEL (priv->cond_dew), 0.0);
-
- priv->cond_humidity = gtk_label_new ("");
- gtk_widget_show (priv->cond_humidity);
- gtk_grid_attach (GTK_GRID (cond_grid), priv->cond_humidity, 1, 7, 1, 1);
- gtk_label_set_selectable (GTK_LABEL (priv->cond_humidity), TRUE);
- gtk_label_set_justify (GTK_LABEL (priv->cond_humidity), GTK_JUSTIFY_LEFT);
- gtk_label_set_xalign (GTK_LABEL (priv->cond_humidity), 0.0);
-
- priv->cond_wind = gtk_label_new ("");
- gtk_widget_show (priv->cond_wind);
- gtk_grid_attach (GTK_GRID (cond_grid), priv->cond_wind, 1, 8, 1, 1);
- gtk_label_set_selectable (GTK_LABEL (priv->cond_wind), TRUE);
- gtk_label_set_justify (GTK_LABEL (priv->cond_wind), GTK_JUSTIFY_LEFT);
- gtk_label_set_xalign (GTK_LABEL (priv->cond_wind), 0.0);
-
- priv->cond_pressure = gtk_label_new ("");
- gtk_widget_show (priv->cond_pressure);
- gtk_grid_attach (GTK_GRID (cond_grid), priv->cond_pressure, 1, 9, 1, 1);
- gtk_label_set_selectable (GTK_LABEL (priv->cond_pressure), TRUE);
- gtk_label_set_justify (GTK_LABEL (priv->cond_pressure), GTK_JUSTIFY_LEFT);
- gtk_label_set_xalign (GTK_LABEL (priv->cond_pressure), 0.0);
-
- priv->cond_vis = gtk_label_new ("");
- gtk_widget_show (priv->cond_vis);
- gtk_grid_attach (GTK_GRID (cond_grid), priv->cond_vis, 1, 10, 1, 1);
- gtk_label_set_selectable (GTK_LABEL (priv->cond_vis), TRUE);
- gtk_label_set_justify (GTK_LABEL (priv->cond_vis), GTK_JUSTIFY_LEFT);
- gtk_label_set_xalign (GTK_LABEL (priv->cond_vis), 0.0);
-
- priv->cond_sunrise = gtk_label_new ("");
- gtk_widget_show (priv->cond_sunrise);
- gtk_grid_attach (GTK_GRID (cond_grid), priv->cond_sunrise, 1, 11, 1, 1);
- gtk_label_set_selectable (GTK_LABEL (priv->cond_sunrise), TRUE);
- gtk_label_set_justify (GTK_LABEL (priv->cond_sunrise), GTK_JUSTIFY_LEFT);
- gtk_label_set_xalign (GTK_LABEL (priv->cond_sunrise), 0.0);
-
- priv->cond_sunset = gtk_label_new ("");
- gtk_widget_show (priv->cond_sunset);
- gtk_grid_attach (GTK_GRID (cond_grid), priv->cond_sunset, 1, 12, 1, 1);
- gtk_label_set_selectable (GTK_LABEL (priv->cond_sunset), TRUE);
- gtk_label_set_justify (GTK_LABEL (priv->cond_sunset), GTK_JUSTIFY_LEFT);
- gtk_label_set_xalign (GTK_LABEL (priv->cond_sunset), 0.0);
-
- cond_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2);
- gtk_widget_set_valign (cond_vbox, GTK_ALIGN_START);
- gtk_widget_set_vexpand (cond_vbox, TRUE);
- gtk_widget_show (cond_vbox);
- gtk_box_pack_end (GTK_BOX (cond_hbox), cond_vbox, FALSE, FALSE, 0);
- gtk_container_set_border_width (GTK_CONTAINER (cond_vbox), 2);
-
- priv->cond_image = gtk_image_new_from_icon_name ("stock-unknown", GTK_ICON_SIZE_BUTTON);
- gtk_widget_show (priv->cond_image);
- gtk_container_add (GTK_CONTAINER (cond_vbox), priv->cond_image);
-
- current_note_lbl = gtk_label_new (_("Current Conditions"));
- gtk_widget_show (current_note_lbl);
- gtk_notebook_set_tab_label (GTK_NOTEBOOK (weather_notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (weather_notebook), 0), current_note_lbl);
-
- if (gw_applet->mateweather_pref.location->zone_valid) {
-
- forecast_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
- gtk_container_set_border_width (GTK_CONTAINER (forecast_hbox), 12);
- gtk_widget_show (forecast_hbox);
-
- scrolled_window = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
- GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
- gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_window),
- GTK_SHADOW_ETCHED_IN);
-
- priv->forecast_text = gtk_text_view_new ();
- set_access_namedesc (priv->forecast_text, _("Forecast Report"), _("See the ForeCast Details"));
- gtk_container_add (GTK_CONTAINER (scrolled_window), priv->forecast_text);
- gtk_text_view_set_editable (GTK_TEXT_VIEW (priv->forecast_text), FALSE);
- gtk_text_view_set_left_margin (GTK_TEXT_VIEW (priv->forecast_text), 6);
- gtk_widget_show (priv->forecast_text);
- gtk_widget_show (scrolled_window);
- gtk_box_pack_start (GTK_BOX (forecast_hbox), scrolled_window, TRUE, TRUE, 0);
-
- gtk_container_add (GTK_CONTAINER (weather_notebook), forecast_hbox);
-
- forecast_note_lbl = gtk_label_new (_("Forecast"));
- gtk_widget_show (forecast_note_lbl);
- gtk_notebook_set_tab_label (GTK_NOTEBOOK (weather_notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (weather_notebook), 1), forecast_note_lbl);
-
- }
-
- if (gw_applet->mateweather_pref.radar_enabled) {
-
- radar_note_lbl = gtk_label_new_with_mnemonic (_("Radar Map"));
- gtk_widget_show (radar_note_lbl);
-
- radar_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
- gtk_widget_show (radar_vbox);
- gtk_notebook_append_page (GTK_NOTEBOOK (weather_notebook), radar_vbox, radar_note_lbl);
- gtk_container_set_border_width (GTK_CONTAINER (radar_vbox), 6);
-
- priv->radar_image = gtk_image_new ();
-
- imagescroll_window = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (imagescroll_window),
- GTK_POLICY_AUTOMATIC,
- GTK_POLICY_AUTOMATIC);
- gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (imagescroll_window),
- GTK_SHADOW_ETCHED_IN);
-
- ebox = gtk_event_box_new ();
- gtk_widget_show (ebox);
-
- gtk_container_add (GTK_CONTAINER (imagescroll_window),ebox);
- gtk_box_pack_start (GTK_BOX (radar_vbox), imagescroll_window, TRUE, TRUE, 0);
- gtk_widget_show (priv->radar_image);
- gtk_widget_show (imagescroll_window);
-
- gtk_container_add (GTK_CONTAINER (ebox), priv->radar_image);
-
- radar_link_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
- gtk_widget_set_halign (radar_link_box, GTK_ALIGN_CENTER);
- gtk_widget_set_hexpand (radar_link_box, TRUE);
- gtk_widget_show (radar_link_box);
- gtk_box_pack_start (GTK_BOX (radar_vbox), radar_link_box, FALSE, FALSE, 0);
-
- radar_link_btn = gtk_button_new_with_mnemonic (_("_Visit Weather.com"));
- set_access_namedesc (radar_link_btn, _("Visit Weather.com"), _("Click to Enter Weather.com"));
- gtk_widget_set_size_request (radar_link_btn, 450, -2);
- gtk_widget_show (radar_link_btn);
- if (!g_settings_get_boolean (gw_applet->settings, "use-custom-radar-url"))
- gtk_container_add (GTK_CONTAINER (radar_link_box), radar_link_btn);
-
- g_signal_connect (G_OBJECT (radar_link_btn), "clicked",
- G_CALLBACK (link_cb), NULL);
-
- }
-
- g_signal_connect (G_OBJECT (dialog), "response", G_CALLBACK (response_cb), NULL);
-
-}
-
static PangoFontDescription* get_system_monospace_font(void)
{
PangoFontDescription *desc = NULL;
@@ -549,100 +178,123 @@ override_widget_font (GtkWidget *widget,
g_free (size);
}
-void mateweather_dialog_update(MateWeatherDialog* dialog)
+void
+mateweather_dialog_update (MateWeatherDialog *dialog)
{
- MateWeatherDialogPrivate *priv;
- MateWeatherApplet *gw_applet;
+ WeatherInfo *info;
gchar *forecast;
GtkTextBuffer *buffer;
PangoFontDescription *font_desc;
const gchar *icon_name;
- priv = dialog->priv;
- gw_applet = priv->applet;
-
/* Check for parallel network update in progress */
- if(gw_applet->mateweather_info == NULL)
+ if (dialog->applet->mateweather_info == NULL)
return;
+ info = dialog->applet->mateweather_info;
+
/* Update icon */
- icon_name = weather_info_get_icon_name (gw_applet->mateweather_info);
- gtk_image_set_from_icon_name (GTK_IMAGE (priv->cond_image),
+ icon_name = weather_info_get_icon_name (info);
+ gtk_image_set_from_icon_name (GTK_IMAGE (dialog->cond_image),
icon_name, GTK_ICON_SIZE_DIALOG);
/* Update current condition fields and forecast */
- gtk_label_set_text(GTK_LABEL(priv->cond_location), weather_info_get_location_name(gw_applet->mateweather_info));
- gtk_label_set_text(GTK_LABEL(priv->cond_update), weather_info_get_update(gw_applet->mateweather_info));
- gtk_label_set_text(GTK_LABEL(priv->cond_cond), weather_info_get_conditions(gw_applet->mateweather_info));
- gtk_label_set_text(GTK_LABEL(priv->cond_sky), weather_info_get_sky(gw_applet->mateweather_info));
- gtk_label_set_text(GTK_LABEL(priv->cond_temp), weather_info_get_temp(gw_applet->mateweather_info));
- gtk_label_set_text(GTK_LABEL(priv->cond_apparent), weather_info_get_apparent(gw_applet->mateweather_info));
- gtk_label_set_text(GTK_LABEL(priv->cond_dew), weather_info_get_dew(gw_applet->mateweather_info));
- gtk_label_set_text(GTK_LABEL(priv->cond_humidity), weather_info_get_humidity(gw_applet->mateweather_info));
- gtk_label_set_text(GTK_LABEL(priv->cond_wind), weather_info_get_wind(gw_applet->mateweather_info));
- gtk_label_set_text(GTK_LABEL(priv->cond_pressure), weather_info_get_pressure(gw_applet->mateweather_info));
- gtk_label_set_text(GTK_LABEL(priv->cond_vis), weather_info_get_visibility(gw_applet->mateweather_info));
- gtk_label_set_text(GTK_LABEL(priv->cond_sunrise), weather_info_get_sunrise(gw_applet->mateweather_info));
- gtk_label_set_text(GTK_LABEL(priv->cond_sunset), weather_info_get_sunset(gw_applet->mateweather_info));
+ gtk_label_set_text (GTK_LABEL (dialog->cond_location), weather_info_get_location_name (info));
+ gtk_label_set_text (GTK_LABEL (dialog->cond_update), weather_info_get_update (info));
+ gtk_label_set_text (GTK_LABEL (dialog->cond_cond), weather_info_get_conditions (info));
+ gtk_label_set_text (GTK_LABEL (dialog->cond_sky), weather_info_get_sky (info));
+ gtk_label_set_text (GTK_LABEL (dialog->cond_temp), weather_info_get_temp (info));
+ gtk_label_set_text (GTK_LABEL (dialog->cond_apparent), weather_info_get_apparent (info));
+ gtk_label_set_text (GTK_LABEL (dialog->cond_dew), weather_info_get_dew (info));
+ gtk_label_set_text (GTK_LABEL (dialog->cond_humidity), weather_info_get_humidity (info));
+ gtk_label_set_text (GTK_LABEL (dialog->cond_wind), weather_info_get_wind (info));
+ gtk_label_set_text (GTK_LABEL (dialog->cond_pressure), weather_info_get_pressure (info));
+ gtk_label_set_text (GTK_LABEL (dialog->cond_vis), weather_info_get_visibility (info));
+ gtk_label_set_text (GTK_LABEL (dialog->cond_sunrise), weather_info_get_sunrise (info));
+ gtk_label_set_text (GTK_LABEL (dialog->cond_sunset), weather_info_get_sunset (info));
/* Update forecast */
- if (gw_applet->mateweather_pref.location->zone_valid) {
+ if (dialog->applet->mateweather_pref.location->zone_valid) {
font_desc = get_system_monospace_font ();
if (font_desc) {
- override_widget_font (priv->forecast_text, font_desc);
+ override_widget_font (dialog->forecast_text, font_desc);
pango_font_description_free (font_desc);
}
- buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->forecast_text));
- forecast = g_strdup(weather_info_get_forecast(gw_applet->mateweather_info));
+ buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (dialog->forecast_text));
+ forecast = g_strdup (weather_info_get_forecast (dialog->applet->mateweather_info));
if (forecast) {
- forecast = g_strstrip(replace_multiple_new_lines(forecast));
- gtk_text_buffer_set_text(buffer, forecast, -1);
- g_free(forecast);
+ forecast = g_strstrip (replace_multiple_new_lines (forecast));
+ gtk_text_buffer_set_text (buffer, forecast, -1);
+ g_free (forecast);
} else {
- gtk_text_buffer_set_text(buffer, _("Forecast not currently available for this location."), -1);
+ gtk_text_buffer_set_text (buffer, _("Forecast not currently available for this location."), -1);
}
+ gtk_widget_show (gtk_notebook_get_nth_page (GTK_NOTEBOOK (dialog->weather_notebook), 1));
+ } else {
+ gtk_widget_hide (gtk_notebook_get_nth_page (GTK_NOTEBOOK (dialog->weather_notebook), 1));
}
/* Update radar map */
- if (gw_applet->mateweather_pref.radar_enabled) {
+ if (dialog->applet->mateweather_pref.radar_enabled) {
GdkPixbufAnimation *radar;
- radar = weather_info_get_radar (gw_applet->mateweather_info);
+ radar = weather_info_get_radar (info);
if (radar) {
- gtk_image_set_from_animation (GTK_IMAGE (priv->radar_image), radar);
+ gtk_image_set_from_animation (GTK_IMAGE (dialog->radar_image), radar);
}
+ gtk_widget_show (gtk_notebook_get_nth_page (GTK_NOTEBOOK (dialog->weather_notebook), 2));
+ gtk_window_set_default_size (GTK_WINDOW (dialog), 570, 440);
+ } else {
+ gtk_widget_hide (gtk_notebook_get_nth_page (GTK_NOTEBOOK (dialog->weather_notebook), 2));
+ gtk_window_set_default_size (GTK_WINDOW (dialog), 590, 340);
}
}
-static void mateweather_dialog_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec)
+static void
+mateweather_dialog_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
- MateWeatherDialog *dialog = MATEWEATHER_DIALOG (object);
+ MateWeatherDialog *dialog;
+
+ dialog = MATEWEATHER_DIALOG (object);
switch (prop_id) {
- case PROP_MATEWEATHER_APPLET:
- dialog->priv->applet = g_value_get_pointer (value);
- break;
+ case PROP_MATEWEATHER_APPLET:
+ dialog->applet = g_value_get_pointer (value);
+ break;
}
}
-static void mateweather_dialog_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec)
+static void
+mateweather_dialog_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
{
- MateWeatherDialog *dialog = MATEWEATHER_DIALOG (object);
+ MateWeatherDialog *dialog;
+
+ dialog = MATEWEATHER_DIALOG (object);
switch (prop_id) {
case PROP_MATEWEATHER_APPLET:
- g_value_set_pointer (value, dialog->priv->applet);
+ g_value_set_pointer (value, dialog->applet);
break;
}
}
-static void mateweather_dialog_init(MateWeatherDialog* self)
+static void
+mateweather_dialog_init (MateWeatherDialog *dialog)
{
- self->priv = mateweather_dialog_get_instance_private (self);
+ gtk_widget_init_template (GTK_WIDGET (dialog));
}
-static GObject* mateweather_dialog_constructor(GType type, guint n_construct_params, GObjectConstructParam* construct_params)
+static GObject*
+mateweather_dialog_constructor (GType type,
+ guint n_construct_params,
+ GObjectConstructParam *construct_params)
{
GObject *object;
MateWeatherDialog *self;
@@ -651,40 +303,58 @@ static GObject* mateweather_dialog_constructor(GType type, guint n_construct_par
constructor (type, n_construct_params, construct_params);
self = MATEWEATHER_DIALOG (object);
- mateweather_dialog_create (self);
mateweather_dialog_update (self);
return object;
}
-GtkWidget* mateweather_dialog_new(MateWeatherApplet* applet)
+GtkWidget*
+mateweather_dialog_new (MateWeatherApplet *applet)
{
- return g_object_new(MATEWEATHER_TYPE_DIALOG,
- "mateweather-applet", applet,
- NULL);
+ return g_object_new(MATEWEATHER_TYPE_DIALOG,
+ "mateweather-applet", applet,
+ NULL);
}
-static void mateweather_dialog_unrealize(GtkWidget* widget)
-{
- MateWeatherDialog* self = MATEWEATHER_DIALOG(widget);
-
- mateweather_dialog_save_geometry(self);
-
- GTK_WIDGET_CLASS(mateweather_dialog_parent_class)->unrealize(widget);
-}
-
-static void mateweather_dialog_class_init(MateWeatherDialogClass* klass)
+static void
+mateweather_dialog_class_init (MateWeatherDialogClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
- mateweather_dialog_parent_class = g_type_class_peek_parent (klass);
-
object_class->set_property = mateweather_dialog_set_property;
object_class->get_property = mateweather_dialog_get_property;
object_class->constructor = mateweather_dialog_constructor;
- widget_class->unrealize = mateweather_dialog_unrealize;
/* This becomes an OBJECT property when MateWeatherApplet is redone */
- g_object_class_install_property(object_class, PROP_MATEWEATHER_APPLET, g_param_spec_pointer ("mateweather-applet", "MateWeather Applet", "The MateWeather Applet", G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+ g_object_class_install_property (object_class,
+ PROP_MATEWEATHER_APPLET,
+ g_param_spec_pointer ("mateweather-applet",
+ "MateWeather Applet",
+ "The MateWeather Applet",
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+
+ gtk_widget_class_set_template_from_resource (widget_class,
+ WEATHER_RESOURCE_PATH "mateweather-dialog.ui");
+
+ gtk_widget_class_bind_template_child (widget_class, MateWeatherDialog, weather_notebook);
+ gtk_widget_class_bind_template_child (widget_class, MateWeatherDialog, cond_location);
+ gtk_widget_class_bind_template_child (widget_class, MateWeatherDialog, cond_update);
+ gtk_widget_class_bind_template_child (widget_class, MateWeatherDialog, cond_cond);
+ gtk_widget_class_bind_template_child (widget_class, MateWeatherDialog, cond_sky);
+ gtk_widget_class_bind_template_child (widget_class, MateWeatherDialog, cond_temp);
+ gtk_widget_class_bind_template_child (widget_class, MateWeatherDialog, cond_dew);
+ gtk_widget_class_bind_template_child (widget_class, MateWeatherDialog, cond_humidity);
+ gtk_widget_class_bind_template_child (widget_class, MateWeatherDialog, cond_wind);
+ gtk_widget_class_bind_template_child (widget_class, MateWeatherDialog, cond_pressure);
+ gtk_widget_class_bind_template_child (widget_class, MateWeatherDialog, cond_vis);
+ gtk_widget_class_bind_template_child (widget_class, MateWeatherDialog, cond_apparent);
+ gtk_widget_class_bind_template_child (widget_class, MateWeatherDialog, cond_sunrise);
+ gtk_widget_class_bind_template_child (widget_class, MateWeatherDialog, cond_sunset);
+ gtk_widget_class_bind_template_child (widget_class, MateWeatherDialog, cond_image);
+ gtk_widget_class_bind_template_child (widget_class, MateWeatherDialog, forecast_text);
+ gtk_widget_class_bind_template_child (widget_class, MateWeatherDialog, radar_image);
+
+ gtk_widget_class_bind_template_callback (widget_class, response_cb);
+ gtk_widget_class_bind_template_callback (widget_class, link_cb);
}
diff --git a/mateweather/mateweather-dialog.h b/mateweather/mateweather-dialog.h
index 69aa734d..0eaf0b50 100644
--- a/mateweather/mateweather-dialog.h
+++ b/mateweather/mateweather-dialog.h
@@ -21,34 +21,12 @@
G_BEGIN_DECLS
-#define MATEWEATHER_TYPE_DIALOG (mateweather_dialog_get_type ())
-#define MATEWEATHER_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MATEWEATHER_TYPE_DIALOG, MateWeatherDialog))
-#define MATEWEATHER_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MATEWEATHER_TYPE_DIALOG, MateWeatherDialogClass))
-#define MATEWEATHER_IS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MATEWEATHER_TYPE_DIALOG))
-#define MATEWEATHER_IS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MATEWEATHER_TYPE_DIALOG))
-#define MATEWEATHER_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MATEWEATHER_TYPE_DIALOG, MateWeatherDialogClass))
-
-typedef struct _MateWeatherDialog MateWeatherDialog;
-typedef struct _MateWeatherDialogPrivate MateWeatherDialogPrivate;
-typedef struct _MateWeatherDialogClass MateWeatherDialogClass;
-
-struct _MateWeatherDialog
-{
- GtkDialog parent;
-
- /* private */
- MateWeatherDialogPrivate *priv;
-};
-
-
-struct _MateWeatherDialogClass
-{
- GtkDialogClass parent_class;
-};
-
-GType mateweather_dialog_get_type (void);
-GtkWidget *mateweather_dialog_new (MateWeatherApplet *applet);
-void mateweather_dialog_update (MateWeatherDialog *dialog);
+#define MATEWEATHER_TYPE_DIALOG mateweather_dialog_get_type ()
+G_DECLARE_FINAL_TYPE (MateWeatherDialog, mateweather_dialog,
+ MATEWEATHER, DIALOG, GtkDialog)
+
+GtkWidget *mateweather_dialog_new (MateWeatherApplet *applet);
+void mateweather_dialog_update (MateWeatherDialog *dialog);
G_END_DECLS
diff --git a/mateweather/mateweather-dialog.ui b/mateweather/mateweather-dialog.ui
new file mode 100644
index 00000000..e370ac7e
--- /dev/null
+++ b/mateweather/mateweather-dialog.ui
@@ -0,0 +1,549 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.36.0 -->
+<interface>
+ <requires lib="gtk+" version="3.22"/>
+ <object class="GtkImage" id="close_img">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="icon_name">window-close</property>
+ </object>
+ <template class="MateWeatherDialog" parent="GtkDialog">
+ <property name="can_focus">False</property>
+ <property name="border_width">12</property>
+ <property name="title" translatable="yes">Details</property>
+ <property name="default_width">590</property>
+ <property name="default_height">340</property>
+ <property name="destroy_with_parent">True</property>
+ <property name="type_hint">dialog</property>
+ <signal name="response" handler="response_cb" swapped="no"/>
+ <child internal-child="vbox">
+ <object class="GtkBox">
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">12</property>
+ <child internal-child="action_area">
+ <object class="GtkButtonBox">
+ <property name="can_focus">False</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="button1">
+ <property name="label" translatable="yes">_Update</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_underline">True</property>
+ <property name="always_show_image">True</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="button2">
+ <property name="label" translatable="yes">_Close</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="image">close_img</property>
+ <property name="use_underline">True</property>
+ <property name="always_show_image">True</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkNotebook" id="weather_notebook">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="border_width">12</property>
+ <child>
+ <object class="GtkGrid">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="row_spacing">6</property>
+ <property name="column_spacing">12</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes">City:</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes">Last update:</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes">Conditions:</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes">Sky:</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes">Temperature:</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes">Feels like:</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">5</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes">Dew point:</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">6</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes">Relative humidity:</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">7</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes">Wind:</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">8</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes">Pressure:</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">9</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes">Visibility:</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">10</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes">Sunrise:</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">11</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes">Sunset:</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">12</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="cond_location">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="cond_update">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="cond_cond">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="cond_sky">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="cond_temp">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="cond_apparent">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">5</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="cond_dew">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">6</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="cond_humidity">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">7</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="cond_wind">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">8</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="cond_pressure">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">9</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="cond_vis">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">10</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="cond_sunrise">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">11</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="cond_sunset">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">12</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkImage" id="cond_image">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="valign">start</property>
+ <property name="icon_name">stock-unknown</property>
+ <property name="icon_size">6</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Current Conditions</property>
+ </object>
+ <packing>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="border_width">12</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkScrolledWindow">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkTextView" id="forecast_text">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="editable">False</property>
+ <property name="left_margin">6</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="forecast_text-atkobject">
+ <property name="AtkObject::accessible-name" translatable="yes">Forecast Report</property>
+ <property name="AtkObject::accessible-description" translatable="yes">See the ForeCast Details</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Forecast</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="border_width">12</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkScrolledWindow">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkViewport">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkImage" id="radar_image">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="stock">gtk-missing-image</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="radar_link_btn">
+ <property name="label" translatable="yes">_Visit Weather.com</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_underline">True</property>
+ <signal name="clicked" handler="link_cb" swapped="no"/>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="radar_link_btn-atkobject">
+ <property name="AtkObject::accessible-name" translatable="yes">Visit Weather.com</property>
+ <property name="AtkObject::accessible-description" translatable="yes">Click to Enter Weather.com</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Radar Map</property>
+ </object>
+ <packing>
+ <property name="position">2</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="-5">button1</action-widget>
+ <action-widget response="-7">button2</action-widget>
+ </action-widgets>
+ <child type="titlebar">
+ <placeholder/>
+ </child>
+ </template>
+</interface>
diff --git a/mateweather/mateweather-resources.gresource.xml b/mateweather/mateweather-resources.gresource.xml
new file mode 100644
index 00000000..db4b5d57
--- /dev/null
+++ b/mateweather/mateweather-resources.gresource.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+ <gresource prefix="/org/mate/mate-applets/mateweather">
+ <file compressed="true">mateweather-applet-menu.xml</file>
+ <file compressed="true">mateweather-dialog.ui</file>
+ </gresource>
+</gresources>
diff --git a/mateweather/mateweather.h b/mateweather/mateweather.h
index f486017c..fa492849 100644
--- a/mateweather/mateweather.h
+++ b/mateweather/mateweather.h
@@ -18,7 +18,6 @@
#include <libmateweather/mateweather-prefs.h>
-
/* Radar map on by default. */
#define RADARMAP