summaryrefslogtreecommitdiff
path: root/mateweather
diff options
context:
space:
mode:
authormonsta <[email protected]>2016-11-22 17:47:06 +0300
committermonsta <[email protected]>2016-11-22 17:47:06 +0300
commitf7acf55db3ab4b97d60faae24555a07b6b08d43c (patch)
tree6feb99e63f801161642669b01c9ce0c217e60d0b /mateweather
parent45354a60352e05eba7e66e24a171e713876d71e9 (diff)
downloadmate-applets-f7acf55db3ab4b97d60faae24555a07b6b08d43c.tar.bz2
mate-applets-f7acf55db3ab4b97d60faae24555a07b6b08d43c.tar.xz
move to GTK+3 (>= 3.14), drop GTK+2 code and --with-gtk build option
and require mate-panel >= 1.17 WARNING: use GTK+3 build of libmateweather for this build. that lib is not migrated to GTK+3 only as we will possibly use libgweather instead of it.
Diffstat (limited to 'mateweather')
-rw-r--r--mateweather/mateweather-applet.c21
-rw-r--r--mateweather/mateweather-dialog.c188
-rw-r--r--mateweather/mateweather-pref.c50
3 files changed, 18 insertions, 241 deletions
diff --git a/mateweather/mateweather-applet.c b/mateweather/mateweather-applet.c
index 9d774e55..88840803 100644
--- a/mateweather/mateweather-applet.c
+++ b/mateweather/mateweather-applet.c
@@ -41,11 +41,6 @@
#define MAX_CONSECUTIVE_FAULTS (3)
-#if GTK_CHECK_VERSION (3, 0, 0)
-#define gtk_hbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_VERTICAL,Y)
-#define gtk_vbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_HORIZONTAL,Y)
-#endif
-
static void about_cb (GtkAction *action,
MateWeatherApplet *gw_applet)
{
@@ -152,12 +147,8 @@ static void place_widgets (MateWeatherApplet *gw_applet)
gw_applet->image = gtk_image_new_from_icon_name(icon_name, GTK_ICON_SIZE_BUTTON);
if (icon_name != NULL) {
-#if GTK_CHECK_VERSION(3, 0, 0)
gtk_widget_show (gw_applet->image);
gtk_widget_get_preferred_size (gw_applet->image, &req, NULL);
-#else
- gtk_widget_size_request(gw_applet->image, &req);
-#endif
if (horizontal)
total_size += req.height;
else
@@ -173,12 +164,8 @@ static void place_widgets (MateWeatherApplet *gw_applet)
gtk_label_set_text(GTK_LABEL(gw_applet->label), temp);
/* Check the label size to determine box layout */
-#if GTK_CHECK_VERSION(3, 0, 0)
gtk_widget_show (gw_applet->label);
gtk_widget_get_preferred_size (gw_applet->label, &req, NULL);
-#else
- gtk_widget_size_request(gw_applet->label, &req);
-#endif
if (horizontal)
total_size += req.height;
else
@@ -189,13 +176,13 @@ static void place_widgets (MateWeatherApplet *gw_applet)
gtk_widget_destroy (gw_applet->box);
if (horizontal && (total_size <= panel_size))
- gw_applet->box = gtk_vbox_new(FALSE, 0);
+ gw_applet->box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
else if (horizontal && (total_size > panel_size))
- gw_applet->box = gtk_hbox_new(FALSE, 2);
+ gw_applet->box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
else if (!horizontal && (total_size <= panel_size))
- gw_applet->box = gtk_hbox_new(FALSE, 2);
+ gw_applet->box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
else
- gw_applet->box = gtk_vbox_new(FALSE, 0);
+ gw_applet->box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
/* Rebuild the applet it's visual area */
gtk_container_add (GTK_CONTAINER (gw_applet->container), gw_applet->box);
diff --git a/mateweather/mateweather-dialog.c b/mateweather/mateweather-dialog.c
index 30e5a042..dc14080d 100644
--- a/mateweather/mateweather-dialog.c
+++ b/mateweather/mateweather-dialog.c
@@ -27,11 +27,6 @@
#include "mateweather-pref.h"
#include "mateweather-dialog.h"
-#if GTK_CHECK_VERSION (3, 0, 0)
-#define gtk_vbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_VERTICAL,Y)
-#define gtk_hbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_HORIZONTAL,Y)
-#endif
-
struct _MateWeatherDialogPrivate {
GtkWidget* cond_location;
GtkWidget* cond_update;
@@ -156,11 +151,7 @@ static void mateweather_dialog_create(MateWeatherDialog* dialog)
GtkWidget *weather_vbox;
GtkWidget *weather_notebook;
GtkWidget *cond_hbox;
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkWidget *cond_grid;
-#else
- GtkWidget *cond_table;
-#endif
GtkWidget *cond_location_lbl;
GtkWidget *cond_update_lbl;
GtkWidget *cond_temp_lbl;
@@ -220,12 +211,11 @@ static void mateweather_dialog_create(MateWeatherDialog* dialog)
gtk_widget_show (weather_notebook);
gtk_box_pack_start (GTK_BOX (weather_vbox), weather_notebook, TRUE, TRUE, 0);
- cond_hbox = gtk_hbox_new (FALSE, 2);
+ 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);
-#if GTK_CHECK_VERSION (3, 0, 0)
cond_grid = gtk_grid_new ();
gtk_widget_show (cond_grid);
gtk_box_pack_start (GTK_BOX (cond_hbox), cond_grid, TRUE, TRUE, 0);
@@ -236,20 +226,6 @@ static void mateweather_dialog_create(MateWeatherDialog* dialog)
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);
-#else
- cond_table = gtk_table_new (13, 2, FALSE);
- gtk_widget_show (cond_table);
- gtk_box_pack_start (GTK_BOX (cond_hbox), cond_table, TRUE, TRUE, 0);
- gtk_container_set_border_width (GTK_CONTAINER (cond_table), 12);
- gtk_table_set_row_spacings (GTK_TABLE (cond_table), 6);
- gtk_table_set_col_spacings (GTK_TABLE (cond_table), 12);
-
- cond_location_lbl = gtk_label_new (_("City:"));
- gtk_widget_show (cond_location_lbl);
- gtk_table_attach (GTK_TABLE (cond_table), cond_location_lbl, 0, 1, 0, 1,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
-#endif
gtk_label_set_justify (GTK_LABEL (cond_location_lbl), GTK_JUSTIFY_LEFT);
#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (cond_location_lbl), 0.0);
@@ -259,13 +235,7 @@ static void mateweather_dialog_create(MateWeatherDialog* dialog)
cond_update_lbl = gtk_label_new (_("Last update:"));
gtk_widget_show (cond_update_lbl);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_grid_attach (GTK_GRID (cond_grid), cond_update_lbl, 0, 1, 1, 1);
-#else
- gtk_table_attach (GTK_TABLE (cond_table), cond_update_lbl, 0, 1, 1, 2,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
-#endif
gtk_label_set_justify (GTK_LABEL (cond_update_lbl), GTK_JUSTIFY_LEFT);
#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (cond_update_lbl), 0.0);
@@ -275,13 +245,7 @@ static void mateweather_dialog_create(MateWeatherDialog* dialog)
cond_cond_lbl = gtk_label_new (_("Conditions:"));
gtk_widget_show (cond_cond_lbl);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_grid_attach (GTK_GRID (cond_grid), cond_cond_lbl, 0, 2, 1, 1);
-#else
- gtk_table_attach (GTK_TABLE (cond_table), cond_cond_lbl, 0, 1, 2, 3,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
-#endif
gtk_label_set_justify (GTK_LABEL (cond_cond_lbl), GTK_JUSTIFY_LEFT);
#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (cond_cond_lbl), 0.0);
@@ -291,13 +255,7 @@ static void mateweather_dialog_create(MateWeatherDialog* dialog)
cond_sky_lbl = gtk_label_new (_("Sky:"));
gtk_widget_show (cond_sky_lbl);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_grid_attach (GTK_GRID (cond_grid), cond_sky_lbl, 0, 3, 1, 1);
-#else
- gtk_table_attach (GTK_TABLE (cond_table), cond_sky_lbl, 0, 1, 3, 4,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
-#endif
gtk_label_set_justify (GTK_LABEL (cond_sky_lbl), GTK_JUSTIFY_LEFT);
#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (cond_sky_lbl), 0.0);
@@ -307,13 +265,7 @@ static void mateweather_dialog_create(MateWeatherDialog* dialog)
cond_temp_lbl = gtk_label_new (_("Temperature:"));
gtk_widget_show (cond_temp_lbl);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_grid_attach (GTK_GRID (cond_grid), cond_temp_lbl, 0, 4, 1, 1);
-#else
- gtk_table_attach (GTK_TABLE (cond_table), cond_temp_lbl, 0, 1, 4, 5,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
-#endif
gtk_label_set_justify (GTK_LABEL (cond_temp_lbl), GTK_JUSTIFY_LEFT);
#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (cond_temp_lbl), 0.0);
@@ -323,13 +275,7 @@ static void mateweather_dialog_create(MateWeatherDialog* dialog)
cond_apparent_lbl = gtk_label_new (_("Feels like:"));
gtk_widget_show (cond_apparent_lbl);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_grid_attach (GTK_GRID (cond_grid), cond_apparent_lbl, 0, 5, 1, 1);
-#else
- gtk_table_attach (GTK_TABLE (cond_table), cond_apparent_lbl, 0, 1, 5, 6,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
-#endif
gtk_label_set_justify (GTK_LABEL (cond_apparent_lbl), GTK_JUSTIFY_LEFT);
#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (cond_apparent_lbl), 0.0);
@@ -339,13 +285,7 @@ static void mateweather_dialog_create(MateWeatherDialog* dialog)
cond_dew_lbl = gtk_label_new (_("Dew point:"));
gtk_widget_show (cond_dew_lbl);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_grid_attach (GTK_GRID (cond_grid), cond_dew_lbl, 0, 6, 1, 1);
-#else
- gtk_table_attach (GTK_TABLE (cond_table), cond_dew_lbl, 0, 1, 6, 7,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
-#endif
gtk_label_set_justify (GTK_LABEL (cond_dew_lbl), GTK_JUSTIFY_LEFT);
#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (cond_dew_lbl), 0.0);
@@ -355,13 +295,7 @@ static void mateweather_dialog_create(MateWeatherDialog* dialog)
cond_humidity_lbl = gtk_label_new (_("Relative humidity:"));
gtk_widget_show (cond_humidity_lbl);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_grid_attach (GTK_GRID (cond_grid), cond_humidity_lbl, 0, 7, 1, 1);
-#else
- gtk_table_attach (GTK_TABLE (cond_table), cond_humidity_lbl, 0, 1, 7, 8,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
-#endif
gtk_label_set_justify (GTK_LABEL (cond_humidity_lbl), GTK_JUSTIFY_LEFT);
#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (cond_humidity_lbl), 0.0);
@@ -371,13 +305,7 @@ static void mateweather_dialog_create(MateWeatherDialog* dialog)
cond_wind_lbl = gtk_label_new (_("Wind:"));
gtk_widget_show (cond_wind_lbl);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_grid_attach (GTK_GRID (cond_grid), cond_wind_lbl, 0, 8, 1, 1);
-#else
- gtk_table_attach (GTK_TABLE (cond_table), cond_wind_lbl, 0, 1, 8, 9,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
-#endif
gtk_label_set_justify (GTK_LABEL (cond_wind_lbl), GTK_JUSTIFY_LEFT);
#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (cond_wind_lbl), 0.0);
@@ -387,13 +315,7 @@ static void mateweather_dialog_create(MateWeatherDialog* dialog)
cond_pressure_lbl = gtk_label_new (_("Pressure:"));
gtk_widget_show (cond_pressure_lbl);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_grid_attach (GTK_GRID (cond_grid), cond_pressure_lbl, 0, 9, 1, 1);
-#else
- gtk_table_attach (GTK_TABLE (cond_table), cond_pressure_lbl, 0, 1, 9, 10,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
-#endif
gtk_label_set_justify (GTK_LABEL (cond_pressure_lbl), GTK_JUSTIFY_LEFT);
#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (cond_pressure_lbl), 0.0);
@@ -403,13 +325,7 @@ static void mateweather_dialog_create(MateWeatherDialog* dialog)
cond_vis_lbl = gtk_label_new (_("Visibility:"));
gtk_widget_show (cond_vis_lbl);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_grid_attach (GTK_GRID (cond_grid), cond_vis_lbl, 0, 10, 1, 1);
-#else
- gtk_table_attach (GTK_TABLE (cond_table), cond_vis_lbl, 0, 1, 10, 11,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
-#endif
gtk_label_set_justify (GTK_LABEL (cond_vis_lbl), GTK_JUSTIFY_LEFT);
#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (cond_vis_lbl), 0.0);
@@ -419,13 +335,7 @@ static void mateweather_dialog_create(MateWeatherDialog* dialog)
cond_sunrise_lbl = gtk_label_new (_("Sunrise:"));
gtk_widget_show (cond_sunrise_lbl);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_grid_attach (GTK_GRID (cond_grid), cond_sunrise_lbl, 0, 11, 1, 1);
-#else
- gtk_table_attach (GTK_TABLE (cond_table), cond_sunrise_lbl, 0, 1, 11, 12,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
-#endif
gtk_label_set_justify (GTK_LABEL (cond_sunrise_lbl), GTK_JUSTIFY_LEFT);
#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (cond_sunrise_lbl), 0.0);
@@ -435,13 +345,7 @@ static void mateweather_dialog_create(MateWeatherDialog* dialog)
cond_sunset_lbl = gtk_label_new (_("Sunset:"));
gtk_widget_show (cond_sunset_lbl);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_grid_attach (GTK_GRID (cond_grid), cond_sunset_lbl, 0, 12, 1, 1);
-#else
- gtk_table_attach (GTK_TABLE (cond_table), cond_sunset_lbl, 0, 1, 12, 13,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
-#endif
gtk_label_set_justify (GTK_LABEL (cond_sunset_lbl), GTK_JUSTIFY_LEFT);
#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (cond_sunset_lbl), 0.0);
@@ -451,13 +355,7 @@ static void mateweather_dialog_create(MateWeatherDialog* dialog)
priv->cond_location = gtk_label_new ("");
gtk_widget_show (priv->cond_location);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_grid_attach (GTK_GRID (cond_grid), priv->cond_location, 1, 0, 1, 1);
-#else
- gtk_table_attach (GTK_TABLE (cond_table), priv->cond_location, 1, 2, 0, 1,
- (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
-#endif
gtk_label_set_selectable (GTK_LABEL (priv->cond_location), TRUE);
gtk_label_set_justify (GTK_LABEL (priv->cond_location), GTK_JUSTIFY_LEFT);
#if GTK_CHECK_VERSION (3, 16, 0)
@@ -468,13 +366,7 @@ static void mateweather_dialog_create(MateWeatherDialog* dialog)
priv->cond_update = gtk_label_new ("");
gtk_widget_show (priv->cond_update);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_grid_attach (GTK_GRID (cond_grid), priv->cond_update, 1, 1, 1, 1);
-#else
- gtk_table_attach (GTK_TABLE (cond_table), priv->cond_update, 1, 2, 1, 2,
- (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
-#endif
gtk_label_set_selectable (GTK_LABEL (priv->cond_update), TRUE);
gtk_label_set_justify (GTK_LABEL (priv->cond_update), GTK_JUSTIFY_LEFT);
#if GTK_CHECK_VERSION (3, 16, 0)
@@ -485,13 +377,7 @@ static void mateweather_dialog_create(MateWeatherDialog* dialog)
priv->cond_cond = gtk_label_new ("");
gtk_widget_show (priv->cond_cond);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_grid_attach (GTK_GRID (cond_grid), priv->cond_cond, 1, 2, 1, 1);
-#else
- gtk_table_attach (GTK_TABLE (cond_table), priv->cond_cond, 1, 2, 2, 3,
- (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
-#endif
gtk_label_set_selectable (GTK_LABEL (priv->cond_cond), TRUE);
gtk_label_set_justify (GTK_LABEL (priv->cond_cond), GTK_JUSTIFY_LEFT);
#if GTK_CHECK_VERSION (3, 16, 0)
@@ -502,13 +388,7 @@ static void mateweather_dialog_create(MateWeatherDialog* dialog)
priv->cond_sky = gtk_label_new ("");
gtk_widget_show (priv->cond_sky);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_grid_attach (GTK_GRID (cond_grid), priv->cond_sky, 1, 3, 1, 1);
-#else
- gtk_table_attach (GTK_TABLE (cond_table), priv->cond_sky, 1, 2, 3, 4,
- (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
-#endif
gtk_label_set_selectable (GTK_LABEL (priv->cond_sky), TRUE);
gtk_label_set_justify (GTK_LABEL (priv->cond_sky), GTK_JUSTIFY_LEFT);
#if GTK_CHECK_VERSION (3, 16, 0)
@@ -519,13 +399,7 @@ static void mateweather_dialog_create(MateWeatherDialog* dialog)
priv->cond_temp = gtk_label_new ("");
gtk_widget_show (priv->cond_temp);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_grid_attach (GTK_GRID (cond_grid), priv->cond_temp, 1, 4, 1, 1);
-#else
- gtk_table_attach (GTK_TABLE (cond_table), priv->cond_temp, 1, 2, 4, 5,
- (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
-#endif
gtk_label_set_selectable (GTK_LABEL (priv->cond_temp), TRUE);
gtk_label_set_justify (GTK_LABEL (priv->cond_temp), GTK_JUSTIFY_LEFT);
#if GTK_CHECK_VERSION (3, 16, 0)
@@ -536,13 +410,7 @@ static void mateweather_dialog_create(MateWeatherDialog* dialog)
priv->cond_apparent = gtk_label_new ("");
gtk_widget_show (priv->cond_apparent);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_grid_attach (GTK_GRID (cond_grid), priv->cond_apparent, 1, 5, 1, 1);
-#else
- gtk_table_attach (GTK_TABLE (cond_table), priv->cond_apparent, 1, 2, 5, 6,
- (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
-#endif
gtk_label_set_selectable (GTK_LABEL (priv->cond_apparent), TRUE);
gtk_label_set_justify (GTK_LABEL (priv->cond_apparent), GTK_JUSTIFY_LEFT);
#if GTK_CHECK_VERSION (3, 16, 0)
@@ -553,13 +421,7 @@ static void mateweather_dialog_create(MateWeatherDialog* dialog)
priv->cond_dew = gtk_label_new ("");
gtk_widget_show (priv->cond_dew);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_grid_attach (GTK_GRID (cond_grid), priv->cond_dew, 1, 6, 1, 1);
-#else
- gtk_table_attach (GTK_TABLE (cond_table), priv->cond_dew, 1, 2, 6, 7,
- (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
-#endif
gtk_label_set_selectable (GTK_LABEL (priv->cond_dew), TRUE);
gtk_label_set_justify (GTK_LABEL (priv->cond_dew), GTK_JUSTIFY_LEFT);
#if GTK_CHECK_VERSION (3, 16, 0)
@@ -570,13 +432,7 @@ static void mateweather_dialog_create(MateWeatherDialog* dialog)
priv->cond_humidity = gtk_label_new ("");
gtk_widget_show (priv->cond_humidity);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_grid_attach (GTK_GRID (cond_grid), priv->cond_humidity, 1, 7, 1, 1);
-#else
- gtk_table_attach (GTK_TABLE (cond_table), priv->cond_humidity, 1, 2, 7, 8,
- (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
-#endif
gtk_label_set_selectable (GTK_LABEL (priv->cond_humidity), TRUE);
gtk_label_set_justify (GTK_LABEL (priv->cond_humidity), GTK_JUSTIFY_LEFT);
#if GTK_CHECK_VERSION (3, 16, 0)
@@ -587,13 +443,7 @@ static void mateweather_dialog_create(MateWeatherDialog* dialog)
priv->cond_wind = gtk_label_new ("");
gtk_widget_show (priv->cond_wind);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_grid_attach (GTK_GRID (cond_grid), priv->cond_wind, 1, 8, 1, 1);
-#else
- gtk_table_attach (GTK_TABLE (cond_table), priv->cond_wind, 1, 2, 8, 9,
- (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
-#endif
gtk_label_set_selectable (GTK_LABEL (priv->cond_wind), TRUE);
gtk_label_set_justify (GTK_LABEL (priv->cond_wind), GTK_JUSTIFY_LEFT);
#if GTK_CHECK_VERSION (3, 16, 0)
@@ -604,13 +454,7 @@ static void mateweather_dialog_create(MateWeatherDialog* dialog)
priv->cond_pressure = gtk_label_new ("");
gtk_widget_show (priv->cond_pressure);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_grid_attach (GTK_GRID (cond_grid), priv->cond_pressure, 1, 9, 1, 1);
-#else
- gtk_table_attach (GTK_TABLE (cond_table), priv->cond_pressure, 1, 2, 9, 10,
- (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
-#endif
gtk_label_set_selectable (GTK_LABEL (priv->cond_pressure), TRUE);
gtk_label_set_justify (GTK_LABEL (priv->cond_pressure), GTK_JUSTIFY_LEFT);
#if GTK_CHECK_VERSION (3, 16, 0)
@@ -621,13 +465,7 @@ static void mateweather_dialog_create(MateWeatherDialog* dialog)
priv->cond_vis = gtk_label_new ("");
gtk_widget_show (priv->cond_vis);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_grid_attach (GTK_GRID (cond_grid), priv->cond_vis, 1, 10, 1, 1);
-#else
- gtk_table_attach (GTK_TABLE (cond_table), priv->cond_vis, 1, 2, 10, 11,
- (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
-#endif
gtk_label_set_selectable (GTK_LABEL (priv->cond_vis), TRUE);
gtk_label_set_justify (GTK_LABEL (priv->cond_vis), GTK_JUSTIFY_LEFT);
#if GTK_CHECK_VERSION (3, 16, 0)
@@ -638,13 +476,7 @@ static void mateweather_dialog_create(MateWeatherDialog* dialog)
priv->cond_sunrise = gtk_label_new ("");
gtk_widget_show (priv->cond_sunrise);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_grid_attach (GTK_GRID (cond_grid), priv->cond_sunrise, 1, 11, 1, 1);
-#else
- gtk_table_attach (GTK_TABLE (cond_table), priv->cond_sunrise, 1, 2, 11, 12,
- (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
-#endif
gtk_label_set_selectable (GTK_LABEL (priv->cond_sunrise), TRUE);
gtk_label_set_justify (GTK_LABEL (priv->cond_sunrise), GTK_JUSTIFY_LEFT);
#if GTK_CHECK_VERSION (3, 16, 0)
@@ -655,13 +487,7 @@ static void mateweather_dialog_create(MateWeatherDialog* dialog)
priv->cond_sunset = gtk_label_new ("");
gtk_widget_show (priv->cond_sunset);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_grid_attach (GTK_GRID (cond_grid), priv->cond_sunset, 1, 12, 1, 1);
-#else
- gtk_table_attach (GTK_TABLE (cond_table), priv->cond_sunset, 1, 2, 12, 13,
- (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
-#endif
gtk_label_set_selectable (GTK_LABEL (priv->cond_sunset), TRUE);
gtk_label_set_justify (GTK_LABEL (priv->cond_sunset), GTK_JUSTIFY_LEFT);
#if GTK_CHECK_VERSION (3, 16, 0)
@@ -685,7 +511,7 @@ static void mateweather_dialog_create(MateWeatherDialog* dialog)
if (gw_applet->mateweather_pref.location->zone_valid) {
- forecast_hbox = gtk_hbox_new(FALSE, 0);
+ forecast_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_container_set_border_width (GTK_CONTAINER (forecast_hbox), 12);
gtk_widget_show (forecast_hbox);
@@ -717,7 +543,7 @@ static void mateweather_dialog_create(MateWeatherDialog* dialog)
radar_note_lbl = gtk_label_new_with_mnemonic (_("Radar Map"));
gtk_widget_show (radar_note_lbl);
- radar_vbox = gtk_vbox_new (FALSE, 6);
+ 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);
@@ -734,11 +560,7 @@ static void mateweather_dialog_create(MateWeatherDialog* dialog)
ebox = gtk_event_box_new ();
gtk_widget_show (ebox);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_container_add (GTK_CONTAINER (imagescroll_window),ebox);
-#else
- gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(imagescroll_window),ebox);
-#endif
gtk_box_pack_start (GTK_BOX (radar_vbox), imagescroll_window, TRUE, TRUE, 0);
gtk_widget_show (priv->radar_image);
gtk_widget_show (imagescroll_window);
@@ -824,11 +646,7 @@ void mateweather_dialog_update(MateWeatherDialog* dialog)
if (gw_applet->mateweather_pref.location->zone_valid) {
font_desc = get_system_monospace_font ();
if (font_desc) {
-#if GTK_CHECK_VERSION(3,0,0)
gtk_widget_override_font (priv->forecast_text, font_desc);
-#else
- gtk_widget_modify_font (priv->forecast_text, font_desc);
-#endif
pango_font_description_free (font_desc);
}
diff --git a/mateweather/mateweather-pref.c b/mateweather/mateweather-pref.c
index d2b31c0b..dc9338d0 100644
--- a/mateweather/mateweather-pref.c
+++ b/mateweather/mateweather-pref.c
@@ -37,11 +37,6 @@
#define NEVER_SENSITIVE "never_sensitive"
-#if GTK_CHECK_VERSION (3, 0, 0)
-#define gtk_vbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_VERTICAL,Y)
-#define gtk_hbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_HORIZONTAL,Y)
-#endif
-
struct _MateWeatherPrefPrivate {
GtkWidget* basic_temp_combo;
GtkWidget* basic_speed_combo;
@@ -553,7 +548,7 @@ static GtkWidget* create_hig_category(GtkWidget* main_box, gchar* title)
GtkWidget*label;
gchar* tmp;
- vbox = gtk_vbox_new (FALSE, 6);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_box_pack_start (GTK_BOX (main_box), vbox, FALSE, FALSE, 0);
tmp = g_strdup_printf ("<b>%s</b>", title);
@@ -567,13 +562,13 @@ static GtkWidget* create_hig_category(GtkWidget* main_box, gchar* title)
g_free (tmp);
gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, FALSE, 0);
- hbox = gtk_hbox_new (FALSE, 0);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
label = gtk_label_new (" ");
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
- vbox2 = gtk_vbox_new (FALSE, 6);
+ vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_box_pack_start (GTK_BOX (hbox), vbox2, TRUE, TRUE, 0);
return vbox2;
@@ -802,11 +797,7 @@ static void mateweather_pref_create(MateWeatherPref* pref)
GtkWidget* pres_combo;
GtkWidget* dist_label;
GtkWidget* dist_combo;
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkWidget* unit_grid;
-#else
- GtkWidget* unit_table;
-#endif
GtkWidget* pref_find_label;
GtkWidget* pref_find_hbox;
GtkWidget* image;
@@ -833,7 +824,7 @@ static void mateweather_pref_create(MateWeatherPref* pref)
* General settings page.
*/
- pref_basic_vbox = gtk_vbox_new (FALSE, 18);
+ pref_basic_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 18);
gtk_container_set_border_width (GTK_CONTAINER (pref_basic_vbox), 12);
gtk_container_add (GTK_CONTAINER (pref_notebook), pref_basic_vbox);
@@ -971,7 +962,6 @@ static void mateweather_pref_create(MateWeatherPref* pref)
if ( ! g_settings_is_writable (pref->priv->applet->settings, "distance-unit"))
hard_set_sensitive (pref->priv->basic_dist_combo, FALSE);
-#if GTK_CHECK_VERSION (3, 0, 0)
unit_grid = gtk_grid_new ();
gtk_grid_set_row_spacing(GTK_GRID(unit_grid), 6);
gtk_grid_set_column_spacing(GTK_GRID(unit_grid), 12);
@@ -988,20 +978,6 @@ static void mateweather_pref_create(MateWeatherPref* pref)
gtk_grid_attach(GTK_GRID(unit_grid), dist_label, 0, 3, 1, 1);
gtk_grid_attach(GTK_GRID(unit_grid), dist_combo, 1, 3, 1, 1);
gtk_widget_show(unit_grid);
-#else
- unit_table = gtk_table_new(5, 2, FALSE);
- gtk_table_set_row_spacings(GTK_TABLE(unit_table), 6);
- gtk_table_set_col_spacings(GTK_TABLE(unit_table), 12);
- gtk_table_attach(GTK_TABLE(unit_table), temp_label, 0, 1, 0, 1, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0);
- gtk_table_attach_defaults(GTK_TABLE(unit_table), temp_combo, 1, 2, 0, 1);
- gtk_table_attach(GTK_TABLE(unit_table), speed_label, 0, 1, 1, 2, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0);
- gtk_table_attach_defaults(GTK_TABLE(unit_table), speed_combo, 1, 2, 1, 2);
- gtk_table_attach(GTK_TABLE(unit_table), pres_label, 0, 1, 2, 3, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0);
- gtk_table_attach_defaults(GTK_TABLE(unit_table), pres_combo, 1, 2, 2, 3);
- gtk_table_attach(GTK_TABLE(unit_table), dist_label, 0, 1, 3, 4, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0);
- gtk_table_attach_defaults(GTK_TABLE(unit_table), dist_combo, 1, 2, 3, 4);
- gtk_widget_show(unit_table);
-#endif
g_signal_connect (temp_combo, "changed", G_CALLBACK (temp_combo_changed_cb), pref);
g_signal_connect (speed_combo, "changed", G_CALLBACK (speed_combo_changed_cb), pref);
@@ -1019,7 +995,7 @@ static void mateweather_pref_create(MateWeatherPref* pref)
hard_set_sensitive(pref->priv->basic_radar_btn, FALSE);
}
- radar_toggle_hbox = gtk_hbox_new(FALSE, 12);
+ radar_toggle_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
gtk_widget_show(radar_toggle_hbox);
label = gtk_label_new (" ");
@@ -1037,7 +1013,7 @@ static void mateweather_pref_create(MateWeatherPref* pref)
hard_set_sensitive (pref->priv->basic_radar_url_btn, FALSE);
}
- pref->priv->basic_radar_url_hbox = gtk_hbox_new (FALSE, 12);
+ pref->priv->basic_radar_url_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
gtk_widget_show (pref->priv->basic_radar_url_hbox);
label = gtk_label_new (" ");
@@ -1071,7 +1047,7 @@ static void mateweather_pref_create(MateWeatherPref* pref)
frame = create_hig_category (pref_basic_vbox, _("Update"));
- pref_basic_update_hbox = gtk_hbox_new (FALSE, 12);
+ pref_basic_update_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
pref_basic_update_lbl = gtk_label_new_with_mnemonic (_("_Automatically update every:"));
gtk_widget_show (pref_basic_update_lbl);
@@ -1095,7 +1071,7 @@ static void mateweather_pref_create(MateWeatherPref* pref)
hard_set_sensitive (pref_basic_update_sec_lbl, FALSE);
}
- value_hbox = gtk_hbox_new (FALSE, 6);
+ value_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
gtk_box_pack_start (GTK_BOX (pref_basic_update_hbox), pref_basic_update_alignment, FALSE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (pref_basic_update_hbox), value_hbox, FALSE, FALSE, 0);
@@ -1106,13 +1082,9 @@ static void mateweather_pref_create(MateWeatherPref* pref)
frame = create_hig_category (pref_basic_vbox, _("Display"));
- vbox = gtk_vbox_new (FALSE, 6);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_box_pack_start (GTK_BOX (vbox), unit_grid, TRUE, TRUE, 0);
-#else
- gtk_box_pack_start (GTK_BOX (vbox), unit_table, TRUE, TRUE, 0);
-#endif
#ifdef RADARMAP
gtk_box_pack_start (GTK_BOX (vbox), pref->priv->basic_radar_btn, TRUE, TRUE, 0);
@@ -1134,7 +1106,7 @@ static void mateweather_pref_create(MateWeatherPref* pref)
/*
* Location page.
*/
- pref_loc_hbox = gtk_vbox_new (FALSE, 6);
+ pref_loc_hbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_container_set_border_width (GTK_CONTAINER (pref_loc_hbox), 12);
gtk_container_add (GTK_CONTAINER (pref_notebook), pref_loc_hbox);
@@ -1163,7 +1135,7 @@ static void mateweather_pref_create(MateWeatherPref* pref)
gtk_box_pack_start (GTK_BOX (pref_loc_hbox), scrolled_window, TRUE, TRUE, 0);
load_locations(pref);
- pref_find_hbox = gtk_hbox_new (FALSE, 6);
+ pref_find_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
pref_find_label = gtk_label_new (_("_Find:"));
gtk_label_set_use_underline (GTK_LABEL (pref_find_label), TRUE);