Mercurial > pidgin.yaz
comparison pidgin/gtkprefs.c @ 21056:9e45c28b4b2b
Fix some leaking GtkSizeGroups.
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Tue, 30 Oct 2007 04:28:31 +0000 |
parents | fe1b44022884 |
children | 68fc9d5c43f7 |
comparison
equal
deleted
inserted
replaced
21055:a0b0f988667e | 21056:9e45c28b4b2b |
---|---|
954 gtk_size_group_add_widget(sg, label); | 954 gtk_size_group_add_widget(sg, label); |
955 | 955 |
956 g_list_free(names); | 956 g_list_free(names); |
957 | 957 |
958 gtk_widget_show_all(ret); | 958 gtk_widget_show_all(ret); |
959 g_object_unref(sg); | |
959 return ret; | 960 return ret; |
960 } | 961 } |
961 | 962 |
962 #if GTK_CHECK_VERSION(2,4,0) | 963 #if GTK_CHECK_VERSION(2,4,0) |
963 static void | 964 static void |
1129 network_page() | 1130 network_page() |
1130 { | 1131 { |
1131 GtkWidget *ret; | 1132 GtkWidget *ret; |
1132 GtkWidget *vbox, *hbox, *entry; | 1133 GtkWidget *vbox, *hbox, *entry; |
1133 GtkWidget *table, *label, *auto_ip_checkbox, *ports_checkbox, *spin_button; | 1134 GtkWidget *table, *label, *auto_ip_checkbox, *ports_checkbox, *spin_button; |
1134 GtkWidget *warning, *proxy_button; | 1135 GtkWidget *warning = NULL, *proxy_button = NULL; |
1135 GtkSizeGroup *sg; | 1136 GtkSizeGroup *sg; |
1136 PurpleProxyInfo *proxy_info = NULL; | 1137 PurpleProxyInfo *proxy_info = NULL; |
1137 | 1138 |
1138 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); | 1139 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
1139 gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER); | 1140 gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER); |
1191 gtk_widget_set_sensitive(GTK_WIDGET(table), FALSE); | 1192 gtk_widget_set_sensitive(GTK_WIDGET(table), FALSE); |
1192 } | 1193 } |
1193 | 1194 |
1194 g_signal_connect(G_OBJECT(auto_ip_checkbox), "clicked", | 1195 g_signal_connect(G_OBJECT(auto_ip_checkbox), "clicked", |
1195 G_CALLBACK(pidgin_toggle_sensitive), table); | 1196 G_CALLBACK(pidgin_toggle_sensitive), table); |
1197 | |
1198 g_object_unref(sg); | |
1196 | 1199 |
1197 vbox = pidgin_make_frame (ret, _("Ports")); | 1200 vbox = pidgin_make_frame (ret, _("Ports")); |
1198 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | 1201 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
1199 | 1202 |
1200 ports_checkbox = pidgin_prefs_checkbox(_("_Manually specify range of ports to listen on"), | 1203 ports_checkbox = pidgin_prefs_checkbox(_("_Manually specify range of ports to listen on"), |
1335 purple_proxy_info_get_password(proxy_info)); | 1338 purple_proxy_info_get_password(proxy_info)); |
1336 pidgin_set_accessible_label (entry, label); | 1339 pidgin_set_accessible_label (entry, label); |
1337 } | 1340 } |
1338 | 1341 |
1339 gtk_widget_show_all(ret); | 1342 gtk_widget_show_all(ret); |
1343 g_object_unref(sg); | |
1340 /* Only hide table if not running gnome otherwise we hide the IP address table! */ | 1344 /* Only hide table if not running gnome otherwise we hide the IP address table! */ |
1341 if (!purple_running_gnome() && (proxy_info == NULL || | 1345 if (!purple_running_gnome() && (proxy_info == NULL || |
1342 purple_proxy_info_get_type(proxy_info) == PURPLE_PROXY_NONE || | 1346 purple_proxy_info_get_type(proxy_info) == PURPLE_PROXY_NONE || |
1343 purple_proxy_info_get_type(proxy_info) == PURPLE_PROXY_USE_ENVVAR)) { | 1347 purple_proxy_info_get_type(proxy_info) == PURPLE_PROXY_USE_ENVVAR)) { |
1344 gtk_widget_hide(table); | 1348 gtk_widget_hide(table); |
1345 } else { | 1349 } else if (purple_running_gnome()) { |
1346 gchar *path; | 1350 gchar *path; |
1347 path = g_find_program_in_path("gnome-network-preferences"); | 1351 path = g_find_program_in_path("gnome-network-preferences"); |
1348 if (path != NULL) { | 1352 if (path != NULL) { |
1349 gtk_widget_set_sensitive(proxy_button, TRUE); | 1353 gtk_widget_set_sensitive(proxy_button, TRUE); |
1350 gtk_widget_hide(warning); | 1354 gtk_widget_hide(warning); |
1499 g_signal_connect(G_OBJECT(entry), "focus-out-event", | 1503 g_signal_connect(G_OBJECT(entry), "focus-out-event", |
1500 G_CALLBACK(manual_browser_set), NULL); | 1504 G_CALLBACK(manual_browser_set), NULL); |
1501 pidgin_set_accessible_label (entry, label); | 1505 pidgin_set_accessible_label (entry, label); |
1502 | 1506 |
1503 gtk_widget_show_all(ret); | 1507 gtk_widget_show_all(ret); |
1508 g_object_unref(sg); | |
1504 return ret; | 1509 return ret; |
1505 } | 1510 } |
1506 #endif /*_WIN32*/ | 1511 #endif /*_WIN32*/ |
1507 | 1512 |
1508 static GtkWidget * | 1513 static GtkWidget * |
1940 button = gtk_button_new_with_label(_("Choose...")); | 1945 button = gtk_button_new_with_label(_("Choose...")); |
1941 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(select_sound), NULL); | 1946 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(select_sound), NULL); |
1942 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); | 1947 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); |
1943 | 1948 |
1944 gtk_widget_show_all(ret); | 1949 gtk_widget_show_all(ret); |
1950 g_object_unref(sg); | |
1945 | 1951 |
1946 return ret; | 1952 return ret; |
1947 } | 1953 } |
1948 | 1954 |
1949 | 1955 |
2065 gtk_widget_set_sensitive(GTK_WIDGET(menu), FALSE); | 2071 gtk_widget_set_sensitive(GTK_WIDGET(menu), FALSE); |
2066 gtk_widget_set_sensitive(GTK_WIDGET(label), FALSE); | 2072 gtk_widget_set_sensitive(GTK_WIDGET(label), FALSE); |
2067 } | 2073 } |
2068 | 2074 |
2069 gtk_widget_show_all(ret); | 2075 gtk_widget_show_all(ret); |
2076 g_object_unref(sg); | |
2070 | 2077 |
2071 return ret; | 2078 return ret; |
2072 } | 2079 } |
2073 | 2080 |
2074 static int | 2081 static int |