[gnome-bluetooth] Use accessor functions instead direct access. Second patch



commit dfa3317cb5bfc22e76443a3500b8306f5bfb3e65
Author: Javier Jardón <jjardon gnome org>
Date:   Sun Dec 20 20:37:21 2009 +0100

    Use accessor functions instead direct access. Second patch
    
    Partially fixes https://bugzilla.gnome.org/show_bug.cgi?id=587418

 applet/main.c |    9 +++++----
 sendto/main.c |   10 ++++++----
 2 files changed, 11 insertions(+), 8 deletions(-)
---
diff --git a/applet/main.c b/applet/main.c
index ee80ade..37b44a5 100644
--- a/applet/main.c
+++ b/applet/main.c
@@ -109,7 +109,7 @@ void browse_callback(GObject *widget, gpointer user_data)
 
 	address = g_strdup (g_object_get_data (widget, "address"));
 	if (address == NULL) {
-		GtkWidget *dialog, *selector;
+		GtkWidget *dialog, *selector, *content_area;
 		int response_id;
 
 		dialog = gtk_dialog_new_with_buttons(_("Select Device to Browse"), NULL,
@@ -122,7 +122,8 @@ void browse_callback(GObject *widget, gpointer user_data)
 		gtk_window_set_default_size(GTK_WINDOW(dialog), 480, 400);
 
 		gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
-		gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 2);
+		content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
+		gtk_box_set_spacing (GTK_BOX (content_area), 2);
 
 		selector = bluetooth_chooser_new(_("Select device to browse"));
 		gtk_container_set_border_width(GTK_CONTAINER(selector), 5);
@@ -136,7 +137,7 @@ void browse_callback(GObject *widget, gpointer user_data)
 			     NULL);
 		g_signal_connect(selector, "selected-device-changed",
 				 G_CALLBACK(select_device_changed), dialog);
-		gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), selector);
+		gtk_container_add (GTK_CONTAINER (content_area), selector);
 
 		address = NULL;
 		response_id = gtk_dialog_run (GTK_DIALOG (dialog));
@@ -557,7 +558,7 @@ action_set_bold (GtkUIManager *manager, GtkAction *action, const char *path)
 
 	label = gtk_action_get_label (action);
 	str = g_strdup_printf ("<b>%s</b>", label);
-	gtk_label_set_markup (GTK_LABEL (GTK_BIN (widget)->child), str);
+	gtk_label_set_markup (GTK_LABEL (gtk_bin_get_child (GTK_BIN (widget))), str);
 	g_free (str);
 }
 
diff --git a/sendto/main.c b/sendto/main.c
index bb4763e..5552184 100644
--- a/sendto/main.c
+++ b/sendto/main.c
@@ -263,7 +263,8 @@ static void create_window(void)
 	vbox = gtk_vbox_new(FALSE, 0);
 	gtk_box_set_spacing(GTK_BOX(vbox), 6);
 	gtk_container_set_border_width(GTK_CONTAINER(vbox), 6);
-	gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), vbox);
+	gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
+	                   vbox);
 
 	label = gtk_label_new(NULL);
 	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
@@ -633,7 +634,7 @@ select_device_changed(BluetoothChooser *sel,
 static char *
 show_browse_dialog (char **device_name)
 {
-	GtkWidget *dialog, *selector, *send_button, *image;
+	GtkWidget *dialog, *selector, *send_button, *image, *content_area;
 	char *bdaddr;
 	int response_id;
 
@@ -649,7 +650,8 @@ show_browse_dialog (char **device_name)
 	gtk_window_set_default_size(GTK_WINDOW(dialog), 480, 400);
 
 	gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
-	gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 2);
+	content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
+	gtk_box_set_spacing (GTK_BOX (content_area), 2);
 
 	selector = bluetooth_chooser_new("Select device to send files to");
 	gtk_container_set_border_width(GTK_CONTAINER(selector), 5);
@@ -661,7 +663,7 @@ show_browse_dialog (char **device_name)
 		     NULL);
 	g_signal_connect(selector, "selected-device-changed",
 			 G_CALLBACK(select_device_changed), dialog);
-	gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), selector);
+	gtk_container_add (GTK_CONTAINER (content_area), selector);
 	bluetooth_chooser_start_discovery (BLUETOOTH_CHOOSER (selector));
 
 	bdaddr = NULL;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]