summaryrefslogtreecommitdiff
path: root/capplets/network/mate-network-properties.c
diff options
context:
space:
mode:
Diffstat (limited to 'capplets/network/mate-network-properties.c')
-rw-r--r--capplets/network/mate-network-properties.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/capplets/network/mate-network-properties.c b/capplets/network/mate-network-properties.c
index d1eaa515..b64f5439 100644
--- a/capplets/network/mate-network-properties.c
+++ b/capplets/network/mate-network-properties.c
@@ -41,14 +41,14 @@
*/
/*
- * FIXME use enum from gsettings-desktop-schema
+ * use enum from gsettings-desktop-schema
* http://git.gnome.org/browse/gsettings-desktop-schemas/tree/headers/gdesktop-enums.h#n26
*/
-enum ProxyMode
+enum GDesktopProxyMode
{
- PROXYMODE_NONE,
- PROXYMODE_MANUAL,
- PROXYMODE_AUTO
+ G_DESKTOP_PROXY_MODE_NONE,
+ G_DESKTOP_PROXY_MODE_MANUAL,
+ G_DESKTOP_PROXY_MODE_AUTO
};
enum {
@@ -176,12 +176,13 @@ static void
cb_add_url (GtkButton *button, gpointer data)
{
GtkBuilder *builder = GTK_BUILDER (data);
- gchar *new_url = NULL;
- new_url = g_strdup (gtk_entry_get_text (GTK_ENTRY (gtk_builder_get_object (builder, "entry_url"))));
- if (strlen (new_url) == 0)
+ const gchar *entry_text = gtk_entry_get_text (GTK_ENTRY (gtk_builder_get_object (builder, "entry_url")));
+ if (entry_text == NULL || strlen (entry_text) == 0) {
return;
- ignore_hosts = g_slist_append(ignore_hosts, new_url);
+ }
+
+ ignore_hosts = g_slist_append(ignore_hosts, g_strdup (entry_text));
populate_listmodel(GTK_LIST_STORE(model), ignore_hosts);
gtk_entry_set_text(GTK_ENTRY (gtk_builder_get_object (builder,
"entry_url")), "");
@@ -318,16 +319,16 @@ proxy_mode_gsettings_changed (GSettings *settings,
{
int mode;
mode = g_settings_get_enum (settings, PROXY_MODE_KEY);
- if (mode == PROXYMODE_NONE)
+ if (mode == G_DESKTOP_PROXY_MODE_NONE)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object(builder, "none_radiobutton")), TRUE);
- else if (mode == PROXYMODE_AUTO)
+ else if (mode == G_DESKTOP_PROXY_MODE_AUTO)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object(builder, "auto_radiobutton")), TRUE);
- else if (mode == PROXYMODE_MANUAL)
+ else if (mode == G_DESKTOP_PROXY_MODE_MANUAL)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object(builder, "manual_radiobutton")), TRUE);
gtk_widget_set_sensitive (_gtk_builder_get_widget (builder, "manual_box"),
- mode == PROXYMODE_MANUAL);
+ mode == G_DESKTOP_PROXY_MODE_MANUAL);
gtk_widget_set_sensitive (_gtk_builder_get_widget (builder, "auto_box"),
- mode == PROXYMODE_AUTO);
+ mode == G_DESKTOP_PROXY_MODE_AUTO);
}
static void