diff options
Diffstat (limited to 'mateweather')
-rw-r--r-- | mateweather/mateweather-applet.c | 7 | ||||
-rw-r--r-- | mateweather/mateweather-dialog.c | 111 | ||||
-rw-r--r-- | mateweather/mateweather-pref.c | 28 |
3 files changed, 0 insertions, 146 deletions
diff --git a/mateweather/mateweather-applet.c b/mateweather/mateweather-applet.c index 59768635..f6e65ce2 100644 --- a/mateweather/mateweather-applet.c +++ b/mateweather/mateweather-applet.c @@ -53,17 +53,10 @@ static void help_cb (GtkAction *action, { GError *error = NULL; -#if GTK_CHECK_VERSION (3, 22, 0) gtk_show_uri_on_window (NULL, "help:mateweather", gtk_get_current_event_time (), &error); -#else - gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (gw_applet->applet)), - "help:mateweather", - gtk_get_current_event_time (), - &error); -#endif if (error) { GtkWidget *dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, diff --git a/mateweather/mateweather-dialog.c b/mateweather/mateweather-dialog.c index 5f7911dc..c2eefea7 100644 --- a/mateweather/mateweather-dialog.c +++ b/mateweather/mateweather-dialog.c @@ -109,17 +109,10 @@ static void response_cb(MateWeatherDialog* dialog, gint id, gpointer data) static void link_cb(GtkButton* button, gpointer data) { -#if GTK_CHECK_VERSION (3, 22, 0) gtk_show_uri_on_window (NULL, "http://www.weather.com/", gtk_get_current_event_time (), NULL); -#else - gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (button)), - "http://www.weather.com/", - gtk_get_current_event_time (), - NULL); -#endif } static gchar* replace_multiple_new_lines(gchar* s) @@ -234,274 +227,170 @@ static void mateweather_dialog_create(MateWeatherDialog* dialog) 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); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (cond_location_lbl), 0.0); -#else - gtk_misc_set_alignment (GTK_MISC (cond_location_lbl), 0.0, 0.5); -#endif 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); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (cond_update_lbl), 0.0); -#else - gtk_misc_set_alignment (GTK_MISC (cond_update_lbl), 0.0, 0.5); -#endif 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); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (cond_cond_lbl), 0.0); -#else - gtk_misc_set_alignment (GTK_MISC (cond_cond_lbl), 0.0, 0.5); -#endif 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); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (cond_sky_lbl), 0.0); -#else - gtk_misc_set_alignment (GTK_MISC (cond_sky_lbl), 0.0, 0.5); -#endif 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); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (cond_temp_lbl), 0.0); -#else - gtk_misc_set_alignment (GTK_MISC (cond_temp_lbl), 0.0, 0.5); -#endif 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); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (cond_apparent_lbl), 0.0); -#else - gtk_misc_set_alignment (GTK_MISC (cond_apparent_lbl), 0.0, 0.5); -#endif 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); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (cond_dew_lbl), 0.0); -#else - gtk_misc_set_alignment (GTK_MISC (cond_dew_lbl), 0.0, 0.5); -#endif 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); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (cond_humidity_lbl), 0.0); -#else - gtk_misc_set_alignment (GTK_MISC (cond_humidity_lbl), 0.0, 0.5); -#endif 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); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (cond_wind_lbl), 0.0); -#else - gtk_misc_set_alignment (GTK_MISC (cond_wind_lbl), 0.0, 0.5); -#endif 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); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (cond_pressure_lbl), 0.0); -#else - gtk_misc_set_alignment (GTK_MISC (cond_pressure_lbl), 0.0, 0.5); -#endif 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); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (cond_vis_lbl), 0.0); -#else - gtk_misc_set_alignment (GTK_MISC (cond_vis_lbl), 0.0, 0.5); -#endif 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); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (cond_sunrise_lbl), 0.0); -#else - gtk_misc_set_alignment (GTK_MISC (cond_sunrise_lbl), 0.0, 0.5); -#endif 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); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (cond_sunset_lbl), 0.0); -#else - gtk_misc_set_alignment (GTK_MISC (cond_sunset_lbl), 0.0, 0.5); -#endif 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); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (priv->cond_location), 0.0); -#else - gtk_misc_set_alignment (GTK_MISC (priv->cond_location), 0.0, 0.5); -#endif 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); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (priv->cond_update), 0.0); -#else - gtk_misc_set_alignment (GTK_MISC (priv->cond_update), 0.0, 0.5); -#endif 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); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (priv->cond_cond), 0.0); -#else - gtk_misc_set_alignment (GTK_MISC (priv->cond_cond), 0.0, 0.5); -#endif 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); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (priv->cond_sky), 0.0); -#else - gtk_misc_set_alignment (GTK_MISC (priv->cond_sky), 0.0, 0.5); -#endif 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); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (priv->cond_temp), 0.0); -#else - gtk_misc_set_alignment (GTK_MISC (priv->cond_temp), 0.0, 0.5); -#endif 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); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (priv->cond_apparent), 0.0); -#else - gtk_misc_set_alignment (GTK_MISC (priv->cond_apparent), 0.0, 0.5); -#endif 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); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (priv->cond_dew), 0.0); -#else - gtk_misc_set_alignment (GTK_MISC (priv->cond_dew), 0.0, 0.5); -#endif 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); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (priv->cond_humidity), 0.0); -#else - gtk_misc_set_alignment (GTK_MISC (priv->cond_humidity), 0.0, 0.5); -#endif 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); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (priv->cond_wind), 0.0); -#else - gtk_misc_set_alignment (GTK_MISC (priv->cond_wind), 0.0, 0.5); -#endif 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); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (priv->cond_pressure), 0.0); -#else - gtk_misc_set_alignment (GTK_MISC (priv->cond_pressure), 0.0, 0.5); -#endif 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); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (priv->cond_vis), 0.0); -#else - gtk_misc_set_alignment (GTK_MISC (priv->cond_vis), 0.0, 0.5); -#endif 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); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (priv->cond_sunrise), 0.0); -#else - gtk_misc_set_alignment (GTK_MISC (priv->cond_sunrise), 0.0, 0.5); -#endif 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); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (priv->cond_sunset), 0.0); -#else - gtk_misc_set_alignment (GTK_MISC (priv->cond_sunset), 0.0, 0.5); -#endif cond_frame_alignment = gtk_alignment_new (0.5, 0, 1, 0); gtk_widget_show (cond_frame_alignment); diff --git a/mateweather/mateweather-pref.c b/mateweather/mateweather-pref.c index ef907583..ba3828bb 100644 --- a/mateweather/mateweather-pref.c +++ b/mateweather/mateweather-pref.c @@ -555,11 +555,7 @@ static GtkWidget* create_hig_category(GtkWidget* main_box, gchar* title) tmp = g_strdup_printf ("<b>%s</b>", title); label = gtk_label_new (NULL); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (label), 0.0); -#else - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); -#endif gtk_label_set_markup (GTK_LABEL (label), tmp); g_free (tmp); gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, FALSE, 0); @@ -744,14 +740,10 @@ static void help_cb(GtkDialog* dialog, MateWeatherPref* pref) current_page = gtk_notebook_get_current_page (GTK_NOTEBOOK (pref->priv->notebook)); uri = g_strdup_printf ("help:mateweather/mateweather-prefs#mateweather-%s", (current_page == 0) ? "metric" : "change-location"); -#if GTK_CHECK_VERSION (3, 22, 0) gtk_show_uri_on_window (GTK_WINDOW (dialog), uri, gtk_get_current_event_time (), &error); -#else - gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (dialog)), uri, gtk_get_current_event_time (), &error); -#endif g_free (uri); if (error) @@ -862,11 +854,7 @@ static void mateweather_pref_create(MateWeatherPref* pref) temp_label = gtk_label_new_with_mnemonic (_("_Temperature unit:")); gtk_label_set_use_markup (GTK_LABEL (temp_label), TRUE); gtk_label_set_justify (GTK_LABEL (temp_label), GTK_JUSTIFY_LEFT); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (temp_label), 0.0); -#else - gtk_misc_set_alignment (GTK_MISC (temp_label), 0.0, 0.5); -#endif gtk_widget_show (temp_label); temp_combo = gtk_combo_box_text_new (); @@ -888,11 +876,7 @@ static void mateweather_pref_create(MateWeatherPref* pref) speed_label = gtk_label_new_with_mnemonic (_("_Wind speed unit:")); gtk_label_set_use_markup (GTK_LABEL (speed_label), TRUE); gtk_label_set_justify (GTK_LABEL (speed_label), GTK_JUSTIFY_LEFT); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (speed_label), 0.0); -#else - gtk_misc_set_alignment (GTK_MISC (speed_label), 0.0, 0.5); -#endif gtk_widget_show (speed_label); speed_combo = gtk_combo_box_text_new (); @@ -919,11 +903,7 @@ static void mateweather_pref_create(MateWeatherPref* pref) pres_label = gtk_label_new_with_mnemonic (_("_Pressure unit:")); gtk_label_set_use_markup (GTK_LABEL (pres_label), TRUE); gtk_label_set_justify (GTK_LABEL (pres_label), GTK_JUSTIFY_LEFT); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (pres_label), 0.0); -#else - gtk_misc_set_alignment (GTK_MISC (pres_label), 0.0, 0.5); -#endif gtk_widget_show (pres_label); pres_combo = gtk_combo_box_text_new (); @@ -953,11 +933,7 @@ static void mateweather_pref_create(MateWeatherPref* pref) dist_label = gtk_label_new_with_mnemonic (_("_Visibility unit:")); gtk_label_set_use_markup (GTK_LABEL (dist_label), TRUE); gtk_label_set_justify (GTK_LABEL (dist_label), GTK_JUSTIFY_LEFT); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (dist_label), 0.0); -#else - gtk_misc_set_alignment (GTK_MISC (dist_label), 0, 0.5); -#endif gtk_widget_show (dist_label); dist_combo = gtk_combo_box_text_new (); @@ -1124,11 +1100,7 @@ static void mateweather_pref_create(MateWeatherPref* pref) gtk_container_add (GTK_CONTAINER (pref->priv->notebook), pref_loc_hbox); tree_label = gtk_label_new_with_mnemonic (_("_Select a location:")); -#if GTK_CHECK_VERSION (3, 16, 0) gtk_label_set_xalign (GTK_LABEL (tree_label), 0.0); -#else - gtk_misc_set_alignment (GTK_MISC (tree_label), 0.0, 0.5); -#endif gtk_box_pack_start (GTK_BOX (pref_loc_hbox), tree_label, FALSE, FALSE, 0); scrolled_window = gtk_scrolled_window_new (NULL, NULL); |