[network-manager-applet/danw/deps: 8/11] build: remove GTK_CHECK_VERSION checks
- From: Dan Winship <danw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-applet/danw/deps: 8/11] build: remove GTK_CHECK_VERSION checks
- Date: Tue, 26 Feb 2013 09:36:18 +0000 (UTC)
commit fef423449a620baf7ffb4badedd2547047b21af1
Author: Dan Winship <danw gnome org>
Date: Sun Feb 24 15:27:16 2013 +0100
build: remove GTK_CHECK_VERSION checks
In particular, remove all gtk2-only code.
src/ap-menu-item.c | 6 +--
src/applet-dialogs.c | 31 +------------
src/applet.c | 66 ++-------------------------
src/connection-editor/ce-page.c | 11 +----
src/connection-editor/ip4-routes-dialog.c | 13 -----
src/connection-editor/ip6-routes-dialog.c | 13 -----
src/connection-editor/page-8021x-security.c | 4 --
src/connection-editor/page-ethernet.c | 9 ----
src/connection-editor/page-general.c | 24 ----------
src/connection-editor/page-infiniband.c | 9 ----
src/connection-editor/page-ip4.c | 13 -----
src/connection-editor/page-ip6.c | 13 -----
src/connection-editor/page-mobile.c | 8 ---
src/connection-editor/page-vlan.c | 5 --
src/connection-editor/page-wifi.c | 18 -------
src/connection-editor/page-wimax.c | 9 ----
src/gnome-bluetooth/bt-widget.c | 12 -----
src/libnm-gtk/nm-mobile-wizard.c | 60 +++---------------------
src/mb-menu-item.c | 6 +--
src/mobile-helpers.c | 4 --
20 files changed, 17 insertions(+), 317 deletions(-)
---
diff --git a/src/ap-menu-item.c b/src/ap-menu-item.c
index c757ec7..500ad06 100644
--- a/src/ap-menu-item.c
+++ b/src/ap-menu-item.c
@@ -39,11 +39,7 @@ G_DEFINE_TYPE (NMNetworkMenuItem, nm_network_menu_item, GTK_TYPE_IMAGE_MENU_ITEM
static void
nm_network_menu_item_init (NMNetworkMenuItem * item)
{
-#if GTK_CHECK_VERSION(3,1,6)
- item->hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
-#else
- item->hbox = gtk_hbox_new (FALSE, 6);
-#endif
+ item->hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
item->ssid = gtk_label_new (NULL);
gtk_misc_set_alignment (GTK_MISC (item->ssid), 0.0, 0.5);
diff --git a/src/applet-dialogs.c b/src/applet-dialogs.c
index 60754d4..58081bb 100644
--- a/src/applet-dialogs.c
+++ b/src/applet-dialogs.c
@@ -906,34 +906,9 @@ applet_info_dialog_show (NMApplet *applet)
gdk_x11_get_server_time (gtk_widget_get_window (dialog)));
}
-#if !GTK_CHECK_VERSION(2,23,0)
-static void
-about_dialog_handle_url_cb (GtkAboutDialog *about, const gchar *url, gpointer data)
-{
- gboolean ret;
- char *cmdline;
- GdkScreen *screen;
-
- screen = gtk_window_get_screen (GTK_WINDOW (about));
-
- cmdline = g_strconcat ("gnome-open ", url, NULL);
- ret = gdk_spawn_command_line_on_screen (screen, cmdline, NULL);
- g_free (cmdline);
-
- if (ret == FALSE) {
- cmdline = g_strconcat ("xdg-open ", url, NULL);
- ret = gdk_spawn_command_line_on_screen (screen, cmdline, NULL);
- g_free (cmdline);
- }
-}
-#endif
-
void
applet_about_dialog_show (NMApplet *applet)
{
-#if !GTK_CHECK_VERSION(2,23,0)
- gtk_about_dialog_set_url_hook (about_dialog_handle_url_cb, NULL, NULL);
-#endif
gtk_show_about_dialog (NULL,
"version", VERSION,
"copyright", _("Copyright \xc2\xa9 2004-2011 Red Hat, Inc.\n"
@@ -1001,11 +976,7 @@ applet_mobile_password_dialog_new (NMConnection *connection,
w = gtk_alignment_new (0.5, 0.5, 0, 1.0);
gtk_box_pack_start (vbox, w, TRUE, TRUE, 0);
-#if GTK_CHECK_VERSION(3,1,6)
- box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6));
-#else
- box = GTK_BOX (gtk_hbox_new (FALSE, 6));
-#endif
+ box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6));
gtk_container_set_border_width (GTK_CONTAINER (box), 6);
gtk_container_add (GTK_CONTAINER (w), GTK_WIDGET (box));
diff --git a/src/applet.c b/src/applet.c
index ce5b457..01647a2 100644
--- a/src/applet.c
+++ b/src/applet.c
@@ -676,30 +676,18 @@ applet_menu_item_add_complex_separator_helper (GtkWidget *menu,
int pos)
{
GtkWidget *menu_item = gtk_image_menu_item_new ();
-#if GTK_CHECK_VERSION(3,1,6)
GtkWidget *box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
-#else
- GtkWidget *box = gtk_hbox_new (FALSE, 0);
-#endif
GtkWidget *xlabel = NULL;
if (label) {
xlabel = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (xlabel), label);
-#if GTK_CHECK_VERSION(3,1,6)
gtk_box_pack_start (GTK_BOX (box), gtk_separator_new (GTK_ORIENTATION_HORIZONTAL), TRUE,
TRUE, 0);
-#else
- gtk_box_pack_start (GTK_BOX (box), gtk_hseparator_new (), TRUE, TRUE, 0);
-#endif
gtk_box_pack_start (GTK_BOX (box), xlabel, FALSE, FALSE, 2);
}
-#if GTK_CHECK_VERSION(3,1,6)
gtk_box_pack_start (GTK_BOX (box), gtk_separator_new (GTK_ORIENTATION_HORIZONTAL), TRUE, TRUE, 0);
-#else
- gtk_box_pack_start (GTK_BOX (box), gtk_hseparator_new (), TRUE, TRUE, 0);
-#endif
g_object_set (G_OBJECT (menu_item),
"child", box,
@@ -748,6 +736,7 @@ menu_item_draw_generic (GtkWidget *widget, cairo_t *cr)
GtkWidget *label;
PangoFontDescription *desc;
PangoLayout *layout;
+ GtkStyleContext *style;
int width = 0, height = 0, owidth, oheight;
gdouble extraheight = 0, extrawidth = 0;
const char *text;
@@ -759,21 +748,10 @@ menu_item_draw_generic (GtkWidget *widget, cairo_t *cr)
text = gtk_label_get_text (GTK_LABEL (label));
layout = pango_cairo_create_layout (cr);
-#if GTK_CHECK_VERSION(2,20,0) && !GTK_CHECK_VERSION(2,91,6)
- {
- GtkStyle *style;
- style = gtk_widget_get_style (widget);
- desc = pango_font_description_copy (style->font_desc);
- }
-#else
- {
- GtkStyleContext *style;
- style = gtk_widget_get_style_context (widget);
- gtk_style_context_get (style, gtk_style_context_get_state (style),
- "font", &desc,
- NULL);
- }
-#endif
+ style = gtk_widget_get_style_context (widget);
+ gtk_style_context_get (style, gtk_style_context_get_state (style),
+ "font", &desc,
+ NULL);
pango_font_description_set_variant (desc, PANGO_VARIANT_SMALL_CAPS);
pango_font_description_set_weight (desc, PANGO_WEIGHT_SEMIBOLD);
pango_layout_set_font_description (layout, desc);
@@ -805,42 +783,12 @@ menu_item_draw_generic (GtkWidget *widget, cairo_t *cr)
gtk_widget_set_size_request (widget, width + 2 * xpadding, height + ypadding + postpadding);
}
-#if GTK_CHECK_VERSION(2,90,7)
static gboolean
menu_title_item_draw (GtkWidget *widget, cairo_t *cr, gpointer user_data)
{
menu_item_draw_generic (widget, cr);
return TRUE;
}
-#else
-static gboolean
-menu_title_item_expose (GtkWidget *widget, GdkEventExpose *event)
-{
- GtkAllocation allocation;
- cairo_t *cr;
-
- cr = gdk_cairo_create (gtk_widget_get_window (widget));
-
- /* The drawing area we get is the whole menu; clip the drawing to the
- * event area, which should just be our menu item.
- */
- cairo_rectangle (cr,
- event->area.x, event->area.y,
- event->area.width, event->area.height);
- cairo_clip (cr);
-
- /* We also need to reposition the cairo context so that (0, 0) is the
- * top-left of where we're supposed to start drawing.
- */
- gtk_widget_get_allocation (widget, &allocation);
- cairo_translate (cr, allocation.x, allocation.y);
-
- menu_item_draw_generic (widget, cr);
-
- cairo_destroy (cr);
- return TRUE;
-}
-#endif
GtkWidget *
applet_menu_item_create_device_item_helper (NMDevice *device,
@@ -851,11 +799,7 @@ applet_menu_item_create_device_item_helper (NMDevice *device,
item = gtk_menu_item_new_with_mnemonic (text);
gtk_widget_set_sensitive (item, FALSE);
-#if GTK_CHECK_VERSION(2,90,7)
g_signal_connect (item, "draw", G_CALLBACK (menu_title_item_draw), NULL);
-#else
- g_signal_connect (item, "expose-event", G_CALLBACK (menu_title_item_expose), NULL);
-#endif
return item;
}
diff --git a/src/connection-editor/ce-page.c b/src/connection-editor/ce-page.c
index 18cd2bb..69102fd 100644
--- a/src/connection-editor/ce-page.c
+++ b/src/connection-editor/ce-page.c
@@ -166,11 +166,7 @@ ce_page_setup_mac_combo (CEPage *self, GtkComboBox *combo,
current_mac_len = -1;
for (iter = mac_list; iter && *iter; iter++) {
-#if GTK_CHECK_VERSION (2,24,0)
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), *iter);
-#else
- gtk_combo_box_append_text (combo, *iter);
-#endif
if ( current_mac
&& g_ascii_strncasecmp (*iter, current_mac, current_mac_len) == 0
&& ((*iter)[current_mac_len] == '\0' || (*iter)[current_mac_len] == ' '))
@@ -178,13 +174,8 @@ ce_page_setup_mac_combo (CEPage *self, GtkComboBox *combo,
}
if (current_mac) {
- if (!active_mac) {
-#if GTK_CHECK_VERSION (2,24,0)
+ if (!active_mac)
gtk_combo_box_text_prepend_text (GTK_COMBO_BOX_TEXT (combo), current_mac);
-#else
- gtk_combo_box_prepend_text (combo, current_mac_str);
-#endif
- }
entry = gtk_bin_get_child (GTK_BIN (combo));
if (entry)
diff --git a/src/connection-editor/ip4-routes-dialog.c b/src/connection-editor/ip4-routes-dialog.c
index 586dd0a..62932ea 100644
--- a/src/connection-editor/ip4-routes-dialog.c
+++ b/src/connection-editor/ip4-routes-dialog.c
@@ -421,11 +421,7 @@ cell_changed_cb (GtkEditable *editable,
{
char *cell_text;
guint column;
-#if GTK_CHECK_VERSION(3,0,0)
GdkRGBA rgba;
-#else
- GdkColor color;
-#endif
gboolean value_valid = FALSE;
const char *colorname = NULL;
@@ -471,13 +467,8 @@ cell_changed_cb (GtkEditable *editable,
/* Change cell's background color while editing */
colorname = value_valid ? "lightgreen" : "red";
-#if GTK_CHECK_VERSION(3,0,0)
gdk_rgba_parse (&rgba, colorname);
gtk_widget_override_background_color (GTK_WIDGET (editable), GTK_STATE_NORMAL, &rgba);
-#else
- gdk_color_parse (colorname, &color);
- gtk_widget_modify_base (GTK_WIDGET (editable), GTK_STATE_NORMAL, &color);
-#endif
g_free (cell_text);
return FALSE;
@@ -488,10 +479,6 @@ key_pressed_cb (GtkWidget *widget,
GdkEvent *event,
gpointer user_data)
{
-#if !GDK_KEY_Tab
- #define GDK_KEY_Tab GDK_Tab
-#endif
-
GdkKeymapKey *keys = NULL;
gint n_keys;
diff --git a/src/connection-editor/ip6-routes-dialog.c b/src/connection-editor/ip6-routes-dialog.c
index dd50c86..491f298 100644
--- a/src/connection-editor/ip6-routes-dialog.c
+++ b/src/connection-editor/ip6-routes-dialog.c
@@ -372,11 +372,7 @@ cell_changed_cb (GtkEditable *editable,
{
char *cell_text;
guint column;
-#if GTK_CHECK_VERSION(3,0,0)
GdkRGBA rgba;
-#else
- GdkColor color;
-#endif
gboolean value_valid = FALSE;
const char *colorname = NULL;
@@ -412,13 +408,8 @@ cell_changed_cb (GtkEditable *editable,
/* Change cell's background color while editing */
colorname = value_valid ? "lightgreen" : "red";
-#if GTK_CHECK_VERSION(3,0,0)
gdk_rgba_parse (&rgba, colorname);
gtk_widget_override_background_color (GTK_WIDGET (editable), GTK_STATE_NORMAL, &rgba);
-#else
- gdk_color_parse (colorname, &color);
- gtk_widget_modify_base (GTK_WIDGET (editable), GTK_STATE_NORMAL, &color);
-#endif
g_free (cell_text);
return FALSE;
@@ -429,10 +420,6 @@ key_pressed_cb (GtkWidget *widget,
GdkEvent *event,
gpointer user_data)
{
-#if !GDK_KEY_Tab
- #define GDK_KEY_Tab GDK_Tab
-#endif
-
GdkKeymapKey *keys = NULL;
gint n_keys;
diff --git a/src/connection-editor/page-8021x-security.c b/src/connection-editor/page-8021x-security.c
index 643751e..547709f 100644
--- a/src/connection-editor/page-8021x-security.c
+++ b/src/connection-editor/page-8021x-security.c
@@ -127,11 +127,7 @@ ce_page_8021x_security_new (NMConnection *connection,
parent = CE_PAGE (self);
priv = CE_PAGE_8021X_SECURITY_GET_PRIVATE (self);
-#if GTK_CHECK_VERSION (3,1,6)
parent->page = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
-#else
- parent->page = gtk_vbox_new (FALSE, 6);
-#endif
g_object_ref_sink (G_OBJECT (parent->page));
gtk_container_set_border_width (GTK_CONTAINER (parent->page), 6);
diff --git a/src/connection-editor/page-ethernet.c b/src/connection-editor/page-ethernet.c
index e479232..760a7b5 100644
--- a/src/connection-editor/page-ethernet.c
+++ b/src/connection-editor/page-ethernet.c
@@ -42,11 +42,7 @@ G_DEFINE_TYPE (CEPageEthernet, ce_page_ethernet, CE_TYPE_PAGE)
typedef struct {
NMSettingWired *setting;
-#if GTK_CHECK_VERSION(2,24,0)
GtkComboBoxText *device_mac; /* Permanent MAC of the device */
-#else
- GtkComboBoxEntry *device_mac;
-#endif
GtkEntry *cloned_mac; /* Cloned MAC - used for MAC spoofing */
GtkComboBox *port;
GtkComboBox *speed;
@@ -84,13 +80,8 @@ ethernet_private_init (CEPageEthernet *self)
builder = CE_PAGE (self)->builder;
-#if GTK_CHECK_VERSION(2,24,0)
priv->device_mac = GTK_COMBO_BOX_TEXT (gtk_combo_box_text_new_with_entry ());
gtk_combo_box_set_entry_text_column (GTK_COMBO_BOX (priv->device_mac), 0);
-#else
- priv->device_mac = GTK_COMBO_BOX_ENTRY (gtk_combo_box_entry_new_text ());
- gtk_combo_box_entry_set_text_column (GTK_COMBO_BOX_ENTRY (priv->device_mac), 0);
-#endif
gtk_widget_set_tooltip_text (GTK_WIDGET (priv->device_mac),
_("This option locks this connection to the network device specified by
its permanent MAC address entered here. Example: 00:11:22:33:44:55"));
diff --git a/src/connection-editor/page-general.c b/src/connection-editor/page-general.c
index bc13f73..307d61c 100644
--- a/src/connection-editor/page-general.c
+++ b/src/connection-editor/page-general.c
@@ -37,11 +37,7 @@ typedef struct {
gboolean is_vpn;
-#if GTK_CHECK_VERSION(2,24,0)
GtkComboBoxText *firewall_zone;
-#else
- GtkComboBox *firewall_zone;
-#endif
char **zones;
gboolean got_zones;
@@ -128,11 +124,7 @@ general_private_init (CEPageGeneral *self)
builder = CE_PAGE (self)->builder;
/*-- Firewall zone --*/
-#if GTK_CHECK_VERSION(2,24,0)
priv->firewall_zone = GTK_COMBO_BOX_TEXT (gtk_combo_box_text_new ());
-#else
- priv->firewall_zone = GTK_COMBO_BOX (gtk_combo_box_new_text ());
-#endif
align = GTK_WIDGET (gtk_builder_get_object (builder, "firewall_zone_alignment"));
gtk_container_add (GTK_CONTAINER (align), GTK_WIDGET (priv->firewall_zone));
@@ -198,29 +190,17 @@ populate_firewall_zones_ui (CEPageGeneral *self)
s_zone = nm_setting_connection_get_zone (setting);
/* Always add "fake" 'Default' zone for default firewall settings */
-#if GTK_CHECK_VERSION (2,24,0)
gtk_combo_box_text_append_text (priv->firewall_zone, FIREWALL_ZONE_DEFAULT);
-#else
- gtk_combo_box_append_text (priv->firewall_zone, FIREWALL_ZONE_DEFAULT);
-#endif
for (zone_ptr = priv->zones, idx = 0; zone_ptr && *zone_ptr; zone_ptr++, idx++) {
-#if GTK_CHECK_VERSION (2,24,0)
gtk_combo_box_text_append_text (priv->firewall_zone, *zone_ptr);
-#else
- gtk_combo_box_append_text (priv->firewall_zone, *zone_ptr);
-#endif
if (g_strcmp0 (s_zone, *zone_ptr) == 0)
combo_idx = idx + 1;
}
if (s_zone && combo_idx == 0) {
/* Unknown zone in connection setting - add it to combobox */
-#if GTK_CHECK_VERSION (2,24,0)
gtk_combo_box_text_append_text (priv->firewall_zone, s_zone);
-#else
- gtk_combo_box_append_text (priv->firewall_zone, s_zone);
-#endif
combo_idx = idx + 1;
}
gtk_combo_box_set_active (GTK_COMBO_BOX (priv->firewall_zone), combo_idx);
@@ -380,11 +360,7 @@ ui_to_setting (CEPageGeneral *self)
* are received from FirewallD asynchronously; got_zones indicates we are ready.
*/
if (priv->got_zones) {
-#if GTK_CHECK_VERSION (2,24,0)
zone = gtk_combo_box_text_get_active_text (priv->firewall_zone);
-#else
- zone = gtk_combo_box_get_active_text (priv->firewall_zone);
-#endif
if (g_strcmp0 (zone, FIREWALL_ZONE_DEFAULT) == 0)
zone = NULL;
diff --git a/src/connection-editor/page-infiniband.c b/src/connection-editor/page-infiniband.c
index dedd368..4f20123 100644
--- a/src/connection-editor/page-infiniband.c
+++ b/src/connection-editor/page-infiniband.c
@@ -40,11 +40,7 @@ G_DEFINE_TYPE (CEPageInfiniband, ce_page_infiniband, CE_TYPE_PAGE)
typedef struct {
NMSettingInfiniband *setting;
-#if GTK_CHECK_VERSION(2,24,0)
GtkComboBoxText *device_mac; /* Permanent MAC of the device */
-#else
- GtkComboBoxEntry *device_mac;
-#endif
GtkComboBox *transport_mode;
GtkSpinButton *mtu;
@@ -68,13 +64,8 @@ infiniband_private_init (CEPageInfiniband *self)
builder = CE_PAGE (self)->builder;
-#if GTK_CHECK_VERSION(2,24,0)
priv->device_mac = GTK_COMBO_BOX_TEXT (gtk_combo_box_text_new_with_entry ());
gtk_combo_box_set_entry_text_column (GTK_COMBO_BOX (priv->device_mac), 0);
-#else
- priv->device_mac = GTK_COMBO_BOX_ENTRY (gtk_combo_box_entry_new_text ());
- gtk_combo_box_entry_set_text_column (GTK_COMBO_BOX_ENTRY (priv->device_mac), 0);
-#endif
gtk_widget_set_tooltip_text (GTK_WIDGET (priv->device_mac),
_("This option locks this connection to the network device specified by
its permanent MAC address entered here. Example: 00:11:22:33:44:55"));
diff --git a/src/connection-editor/page-ip4.c b/src/connection-editor/page-ip4.c
index 73d97d8..b9aebcc 100644
--- a/src/connection-editor/page-ip4.c
+++ b/src/connection-editor/page-ip4.c
@@ -695,11 +695,7 @@ cell_changed_cb (GtkEditable *editable,
{
char *cell_text;
guint column;
-#if GTK_CHECK_VERSION(3,0,0)
GdkRGBA rgba;
-#else
- GdkColor color;
-#endif
gboolean value_valid = FALSE;
const char *colorname = NULL;
@@ -721,13 +717,8 @@ cell_changed_cb (GtkEditable *editable,
/* Change cell's background color while editing */
colorname = value_valid ? "lightgreen" : "red";
-#if GTK_CHECK_VERSION(3,0,0)
gdk_rgba_parse (&rgba, colorname);
gtk_widget_override_background_color (GTK_WIDGET (editable), GTK_STATE_NORMAL, &rgba);
-#else
- gdk_color_parse (colorname, &color);
- gtk_widget_modify_base (GTK_WIDGET (editable), GTK_STATE_NORMAL, &color);
-#endif
g_free (cell_text);
return FALSE;
@@ -738,10 +729,6 @@ key_pressed_cb (GtkWidget *widget,
GdkEvent *event,
gpointer user_data)
{
-#if !GDK_KEY_Tab
- #define GDK_KEY_Tab GDK_Tab
-#endif
-
GdkKeymapKey *keys = NULL;
gint n_keys;
diff --git a/src/connection-editor/page-ip6.c b/src/connection-editor/page-ip6.c
index 4697491..a204367 100644
--- a/src/connection-editor/page-ip6.c
+++ b/src/connection-editor/page-ip6.c
@@ -651,11 +651,7 @@ cell_changed_cb (GtkEditable *editable,
{
char *cell_text;
guint column;
-#if GTK_CHECK_VERSION(3,0,0)
GdkRGBA rgba;
-#else
- GdkColor color;
-#endif
gboolean value_valid = FALSE;
const char *colorname = NULL;
@@ -682,13 +678,8 @@ cell_changed_cb (GtkEditable *editable,
/* Change cell's background color while editing */
colorname = value_valid ? "lightgreen" : "red";
-#if GTK_CHECK_VERSION(3,0,0)
gdk_rgba_parse (&rgba, colorname);
gtk_widget_override_background_color (GTK_WIDGET (editable), GTK_STATE_NORMAL, &rgba);
-#else
- gdk_color_parse (colorname, &color);
- gtk_widget_modify_base (GTK_WIDGET (editable), GTK_STATE_NORMAL, &color);
-#endif
g_free (cell_text);
return FALSE;
@@ -699,10 +690,6 @@ key_pressed_cb (GtkWidget *widget,
GdkEvent *event,
gpointer user_data)
{
-#if !GDK_KEY_Tab
- #define GDK_KEY_Tab GDK_Tab
-#endif
-
GdkKeymapKey *keys = NULL;
gint n_keys;
diff --git a/src/connection-editor/page-mobile.c b/src/connection-editor/page-mobile.c
index 9000e5f..f199741 100644
--- a/src/connection-editor/page-mobile.c
+++ b/src/connection-editor/page-mobile.c
@@ -671,11 +671,7 @@ mobile_connection_new (GtkWindow *parent,
gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 12, 12, 12, 12);
gtk_box_pack_start (GTK_BOX (content), alignment, TRUE, FALSE, 6);
-#if GTK_CHECK_VERSION (3,1,6)
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
-#else
- hbox = gtk_hbox_new (FALSE, 6);
-#endif
gtk_container_add (GTK_CONTAINER (alignment), hbox);
image = gtk_image_new_from_icon_name ("nm-device-wwan", GTK_ICON_SIZE_DIALOG);
@@ -683,11 +679,7 @@ mobile_connection_new (GtkWindow *parent,
gtk_misc_set_padding (GTK_MISC (image), 0, 6);
gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 6);
-#if GTK_CHECK_VERSION (3,1,6)
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
-#else
- vbox = gtk_vbox_new (FALSE, 6);
-#endif
gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, FALSE, 0);
label = gtk_label_new (_("Select the technology your mobile broadband provider uses. If you are
unsure, ask your provider."));
diff --git a/src/connection-editor/page-vlan.c b/src/connection-editor/page-vlan.c
index a60704f..08defb4 100644
--- a/src/connection-editor/page-vlan.c
+++ b/src/connection-editor/page-vlan.c
@@ -77,13 +77,8 @@ vlan_private_init (CEPageVlan *self)
builder = CE_PAGE (self)->builder;
-#if GTK_CHECK_VERSION(2,24,0)
priv->parent = GTK_COMBO_BOX (gtk_combo_box_text_new_with_entry ());
gtk_combo_box_set_entry_text_column (priv->parent, 0);
-#else
- priv->parent = GTK_COMBO_BOX (gtk_combo_box_entry_new_text ());
- gtk_combo_box_entry_set_text_column (GTK_COMBO_BOX_ENTRY (priv->parent), 0);
-#endif
priv->parent_entry = GTK_ENTRY (gtk_bin_get_child (GTK_BIN (priv->parent)));
align = GTK_WIDGET (gtk_builder_get_object (builder, "vlan_parent_alignment"));
diff --git a/src/connection-editor/page-wifi.c b/src/connection-editor/page-wifi.c
index aa26a82..65e62b8 100644
--- a/src/connection-editor/page-wifi.c
+++ b/src/connection-editor/page-wifi.c
@@ -43,16 +43,8 @@ typedef struct {
NMSettingWireless *setting;
GtkEntry *ssid;
-#if GTK_CHECK_VERSION (2,24,0)
GtkComboBoxText *bssid;
-#else
- GtkComboBoxEntry *bssid;
-#endif
-#if GTK_CHECK_VERSION (2,24,0)
GtkComboBoxText *device_mac; /* Permanent MAC of the device */
-#else
- GtkComboBoxEntry *device_mac;
-#endif
GtkEntry *cloned_mac; /* Cloned MAC - used for MAC spoofing */
GtkComboBox *mode;
GtkComboBox *band;
@@ -87,13 +79,8 @@ wifi_private_init (CEPageWifi *self)
priv->channel = GTK_SPIN_BUTTON (gtk_builder_get_object (builder, "wifi_channel"));
/* BSSID */
-#if GTK_CHECK_VERSION(2,24,0)
priv->bssid = GTK_COMBO_BOX_TEXT (gtk_combo_box_text_new_with_entry ());
gtk_combo_box_set_entry_text_column (GTK_COMBO_BOX (priv->bssid), 0);
-#else
- priv->bssid = GTK_COMBO_BOX_ENTRY (gtk_combo_box_entry_new_text ());
- gtk_combo_box_entry_set_text_column (GTK_COMBO_BOX_ENTRY (priv->bssid), 0);
-#endif
gtk_widget_set_tooltip_text (GTK_WIDGET (priv->bssid),
_("This option locks this connection to the Wi-Fi access point (AP)
specified by the BSSID entered here. Example: 00:11:22:33:44:55"));
@@ -102,13 +89,8 @@ wifi_private_init (CEPageWifi *self)
gtk_widget_show_all (GTK_WIDGET (priv->bssid));
/* Device MAC */
-#if GTK_CHECK_VERSION(2,24,0)
priv->device_mac = GTK_COMBO_BOX_TEXT (gtk_combo_box_text_new_with_entry ());
gtk_combo_box_set_entry_text_column (GTK_COMBO_BOX (priv->device_mac), 0);
-#else
- priv->device_mac = GTK_COMBO_BOX_ENTRY (gtk_combo_box_entry_new_text ());
- gtk_combo_box_entry_set_text_column (GTK_COMBO_BOX_ENTRY (priv->device_mac), 0);
-#endif
gtk_widget_set_tooltip_text (GTK_WIDGET (priv->device_mac),
_("This option locks this connection to the network device specified by
its permanent MAC address entered here. Example: 00:11:22:33:44:55"));
diff --git a/src/connection-editor/page-wimax.c b/src/connection-editor/page-wimax.c
index 9b92a5c..ef5cd61 100644
--- a/src/connection-editor/page-wimax.c
+++ b/src/connection-editor/page-wimax.c
@@ -38,11 +38,7 @@ typedef struct {
NMSettingWimax *setting;
GtkEntry *name;
-#if GTK_CHECK_VERSION (2,24,0)
GtkComboBoxText *device_mac; /* Permanent MAC of the device */
-#else
- GtkComboBoxEntry *device_mac;
-#endif
gboolean disposed;
} CEPageWimaxPrivate;
@@ -59,13 +55,8 @@ wimax_private_init (CEPageWimax *self)
priv->name = GTK_ENTRY (gtk_builder_get_object (builder, "wimax_name"));
-#if GTK_CHECK_VERSION(2,24,0)
priv->device_mac = GTK_COMBO_BOX_TEXT (gtk_combo_box_text_new_with_entry ());
gtk_combo_box_set_entry_text_column (GTK_COMBO_BOX (priv->device_mac), 0);
-#else
- priv->device_mac = GTK_COMBO_BOX_ENTRY (gtk_combo_box_entry_new_text ());
- gtk_combo_box_entry_set_text_column (GTK_COMBO_BOX_ENTRY (priv->device_mac), 0);
-#endif
gtk_widget_set_tooltip_text (GTK_WIDGET (priv->device_mac),
_("This option locks this connection to the network device specified by
its permanent MAC address entered here. Example: 00:11:22:33:44:55"));
diff --git a/src/gnome-bluetooth/bt-widget.c b/src/gnome-bluetooth/bt-widget.c
index 6757fc2..3195d6f 100644
--- a/src/gnome-bluetooth/bt-widget.c
+++ b/src/gnome-bluetooth/bt-widget.c
@@ -432,11 +432,7 @@ get_config_widgets (const char *bdaddr, const char **uuids)
info->sigids = g_slist_prepend (info->sigids, GUINT_TO_POINTER (id));
/* UI setup */
-#if GTK_CHECK_VERSION (3,1,6)
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
-#else
- vbox = gtk_vbox_new (FALSE, 6);
-#endif
g_object_set_data_full (G_OBJECT (vbox), "info", info, widget_info_destroy);
busy = nma_bt_device_get_busy (device);
@@ -459,19 +455,11 @@ get_config_widgets (const char *bdaddr, const char **uuids)
set_dun_button_sensitive (info, !busy);
}
-#if GTK_CHECK_VERSION (3,1,6)
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
-#else
- hbox = gtk_hbox_new (FALSE, 6);
-#endif
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 6);
/* Spinner's hbox */
-#if GTK_CHECK_VERSION (3,1,6)
info->hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
-#else
- info->hbox = gtk_hbox_new (FALSE, 6);
-#endif
gtk_box_pack_start (GTK_BOX (hbox), info->hbox, FALSE, FALSE, 0);
device_busy_cb (device, NULL, info);
diff --git a/src/libnm-gtk/nm-mobile-wizard.c b/src/libnm-gtk/nm-mobile-wizard.c
index a29d4b5..d270acc 100644
--- a/src/libnm-gtk/nm-mobile-wizard.c
+++ b/src/libnm-gtk/nm-mobile-wizard.c
@@ -199,11 +199,7 @@ confirm_setup (NMAMobileWizard *self)
{
GtkWidget *vbox, *label, *alignment, *pbox;
-#if GTK_CHECK_VERSION(3,1,6)
- vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
-#else
- vbox = gtk_vbox_new (FALSE, 6);
-#endif
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
label = gtk_label_new (_("Your mobile broadband connection is configured with the following
settings:"));
gtk_widget_set_size_request (label, 500, -1);
@@ -240,11 +236,7 @@ confirm_setup (NMAMobileWizard *self)
alignment = gtk_alignment_new (0, 0.5, 0, 0);
gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 0, 0, 25, 0);
-#if GTK_CHECK_VERSION(3,1,6)
- pbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
-#else
- pbox = gtk_vbox_new (FALSE, 0);
-#endif
+ pbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add (GTK_CONTAINER (alignment), pbox);
gtk_box_pack_start (GTK_BOX (vbox), alignment, FALSE, FALSE, 0);
@@ -483,11 +475,7 @@ plan_setup (NMAMobileWizard *self)
GtkWidget *vbox, *label, *alignment, *hbox, *image;
GtkCellRenderer *renderer;
-#if GTK_CHECK_VERSION(3,1,6)
- vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
-#else
- vbox = gtk_vbox_new (FALSE, 6);
-#endif
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
label = gtk_label_new_with_mnemonic (_("_Select your plan:"));
@@ -529,11 +517,7 @@ plan_setup (NMAMobileWizard *self)
gtk_container_add (GTK_CONTAINER (alignment), self->plan_unlisted_entry);
gtk_box_pack_start (GTK_BOX (vbox), alignment, FALSE, FALSE, 0);
-#if GTK_CHECK_VERSION(3,1,6)
- hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
-#else
- hbox = gtk_hbox_new (FALSE, 6);
-#endif
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_DIALOG);
gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0.0);
gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
@@ -744,11 +728,7 @@ providers_setup (NMAMobileWizard *self)
GtkTreeViewColumn *column;
GtkTreeSelection *selection;
-#if GTK_CHECK_VERSION(3,1,6)
- vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
-#else
- vbox = gtk_vbox_new (FALSE, 6);
-#endif
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
self->providers_view_radio = gtk_radio_button_new_with_mnemonic (NULL, _("Select your provider from a
_list:"));
@@ -813,23 +793,11 @@ providers_setup (NMAMobileWizard *self)
gtk_table_attach (GTK_TABLE (unlisted_table), alignment,
1, 2, 0, 1, GTK_EXPAND | GTK_FILL, 0, 6, 6);
-#if GTK_CHECK_VERSION(2,23,0)
self->provider_unlisted_type_combo = gtk_combo_box_text_new ();
-#else
- self->provider_unlisted_type_combo = gtk_combo_box_new_text ();
-#endif
gtk_label_set_mnemonic_widget (GTK_LABEL (label), self->provider_unlisted_type_combo);
-#if GTK_CHECK_VERSION(2,23,0)
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (self->provider_unlisted_type_combo),
-#else
- gtk_combo_box_append_text (GTK_COMBO_BOX (self->provider_unlisted_type_combo),
-#endif
_("My provider uses GSM technology (GPRS, EDGE, UMTS, HSPA)"));
-#if GTK_CHECK_VERSION(2,23,0)
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (self->provider_unlisted_type_combo),
-#else
- gtk_combo_box_append_text (GTK_COMBO_BOX (self->provider_unlisted_type_combo),
-#endif
_("My provider uses CDMA technology (1xRTT, EVDO)"));
gtk_combo_box_set_active (GTK_COMBO_BOX (self->provider_unlisted_type_combo), 0);
@@ -1091,11 +1059,7 @@ country_setup (NMAMobileWizard *self)
GtkTreeSelection *selection;
GtkTreeIter unlisted_iter;
-#if GTK_CHECK_VERSION(3,1,6)
- vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
-#else
- vbox = gtk_vbox_new (FALSE, 6);
-#endif
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
label = gtk_label_new (_("Country or Region List:"));
gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
@@ -1392,11 +1356,7 @@ intro_setup (NMAMobileWizard *self)
GtkCellRenderer *renderer;
char *s;
-#if GTK_CHECK_VERSION(3,1,6)
- vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
-#else
- vbox = gtk_vbox_new (FALSE, 6);
-#endif
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
label = gtk_label_new (_("This assistant helps you easily set up a mobile broadband connection to a
cellular (3G) network."));
@@ -1411,11 +1371,7 @@ intro_setup (NMAMobileWizard *self)
alignment = gtk_alignment_new (0, 0, 1, 0);
gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 0, 25, 25, 0);
-#if GTK_CHECK_VERSION(3,1,6)
- info_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
-#else
- info_vbox = gtk_vbox_new (FALSE, 6);
-#endif
+ info_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_container_add (GTK_CONTAINER (alignment), info_vbox);
gtk_box_pack_start (GTK_BOX (vbox), alignment, FALSE, FALSE, 6);
diff --git a/src/mb-menu-item.c b/src/mb-menu-item.c
index 7a5fb7f..4512a02 100644
--- a/src/mb-menu-item.c
+++ b/src/mb-menu-item.c
@@ -199,11 +199,7 @@ nm_mb_menu_item_init (NMMbMenuItem *self)
{
NMMbMenuItemPrivate *priv = NM_MB_MENU_ITEM_GET_PRIVATE (self);
-#if GTK_CHECK_VERSION(3,1,6)
- priv->hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
-#else
- priv->hbox = gtk_hbox_new (FALSE, 6);
-#endif
+ priv->hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
priv->desc = gtk_label_new (NULL);
gtk_misc_set_alignment (GTK_MISC (priv->desc), 0.0, 0.5);
diff --git a/src/mobile-helpers.c b/src/mobile-helpers.c
index 4c1db5f..adc45d9 100644
--- a/src/mobile-helpers.c
+++ b/src/mobile-helpers.c
@@ -461,11 +461,7 @@ ask_for_pin (GtkEntry **out_secret_entry)
w = gtk_alignment_new (0.5, 0.5, 0, 1.0);
gtk_box_pack_start (vbox, w, TRUE, TRUE, 0);
-#if GTK_CHECK_VERSION(3,1,6)
box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6));
-#else
- box = GTK_BOX (gtk_hbox_new (FALSE, 6));
-#endif
gtk_container_set_border_width (GTK_CONTAINER (box), 6);
gtk_container_add (GTK_CONTAINER (w), GTK_WIDGET (box));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]