summaryrefslogtreecommitdiff
path: root/src/connection-editor
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2013-02-24 15:27:16 +0100
committerDan Winship <danw@gnome.org>2013-03-12 15:22:38 -0400
commitd0a18be545b12ab53a1d138f41fae1ba726551dc (patch)
tree3524aa5b98fa767b91d5fc4ef94697963fc34eb5 /src/connection-editor
parenta0396dcb09ad1c145b162978019f3c593bc9fb45 (diff)
downloadnetwork-manager-applet-d0a18be545b12ab53a1d138f41fae1ba726551dc.tar.gz
build: remove GTK_CHECK_VERSION checks
In particular, remove all gtk2-only code.
Diffstat (limited to 'src/connection-editor')
-rw-r--r--src/connection-editor/ce-page.c11
-rw-r--r--src/connection-editor/ip4-routes-dialog.c13
-rw-r--r--src/connection-editor/ip6-routes-dialog.c13
-rw-r--r--src/connection-editor/page-8021x-security.c4
-rw-r--r--src/connection-editor/page-ethernet.c9
-rw-r--r--src/connection-editor/page-general.c24
-rw-r--r--src/connection-editor/page-infiniband.c9
-rw-r--r--src/connection-editor/page-ip4.c13
-rw-r--r--src/connection-editor/page-ip6.c13
-rw-r--r--src/connection-editor/page-mobile.c8
-rw-r--r--src/connection-editor/page-vlan.c5
-rw-r--r--src/connection-editor/page-wifi.c18
-rw-r--r--src/connection-editor/page-wimax.c9
13 files changed, 1 insertions, 148 deletions
diff --git a/src/connection-editor/ce-page.c b/src/connection-editor/ce-page.c
index 18cd2bb6..69102fdd 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 586dd0ad..62932ead 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 2c9d73df..21a9458c 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 643751ef..547709f7 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 e479232f..760a7b5f 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 bc13f731..307d61c1 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 dedd3684..4f20123f 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 73d97d8f..b9aebcc6 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 46974918..a2043679 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 9000e5f7..f199741b 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 a60704f9..08defb46 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 fe92a8b3..a1ff7671 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 9b92a5c9..ef5cd619 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"));