[evolution-webcal] Bug 612469 - Using accessor functions instead of direct pointers
- From: Andre Klapper <aklapper src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-webcal] Bug 612469 - Using accessor functions instead of direct pointers
- Date: Wed, 14 Apr 2010 14:42:22 +0000 (UTC)
commit 21c7cfd93bb69f351452a415392e4748df0a561f
Author: Roberto Guido <bob4mail gmail com>
Date: Tue Apr 13 17:14:49 2010 +0200
Bug 612469 - Using accessor functions instead of direct pointers
src/evolution-webcal-notify.c | 30 ++++++++++++++++++------------
1 files changed, 18 insertions(+), 12 deletions(-)
---
diff --git a/src/evolution-webcal-notify.c b/src/evolution-webcal-notify.c
index 8b0d61b..8cb110b 100644
--- a/src/evolution-webcal-notify.c
+++ b/src/evolution-webcal-notify.c
@@ -62,15 +62,17 @@ static void e_webcal_label_size_allocate_cb (GtkWidget *widget,
gpointer user_data) {
gint width, height;
GtkWidget *label;
+ GtkAllocation current_allocation;
label = user_data;
gtk_widget_get_size_request (label, &width, &height);
+ gtk_widget_get_allocation (label, ¤t_allocation);
if (allocation->width > 1 &&
- allocation->width != (width + label->allocation.x)) {
+ allocation->width != (width + current_allocation.x)) {
gtk_widget_set_size_request (label,
- allocation->width - label->allocation.x,
+ allocation->width - current_allocation.x,
-1);
gtk_container_check_resize (GTK_CONTAINER (widget));
}
@@ -117,6 +119,7 @@ void e_webcal_display_error (const gchar * title, const gchar * message,
GtkWidget * label;
GtkWidget * image;
GtkWidget * hbox, * vbox;
+ GtkWidget * dialog_vbox;
GdkPixbuf * pixbuf;
gchar * markup;
@@ -141,14 +144,15 @@ void e_webcal_display_error (const gchar * title, const gchar * message,
gtk_window_set_icon (GTK_WINDOW (dialog), pixbuf);
g_object_unref (pixbuf);
- gdk_window_set_decorations (GDK_WINDOW (dialog->window), GDK_DECOR_BORDER);
+ gdk_window_set_decorations (gtk_widget_get_window (dialog), GDK_DECOR_BORDER);
- gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area), 12);
- gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), 0);
+ dialog_vbox = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
+
+ gtk_container_set_border_width (GTK_CONTAINER (gtk_dialog_get_action_area (GTK_DIALOG (dialog))), 12);
+ gtk_container_set_border_width (GTK_CONTAINER (dialog_vbox), 0);
hbox = gtk_hbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 12);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox,
- TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (dialog_vbox), hbox, TRUE, TRUE, 0);
gtk_widget_show (hbox);
image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_ERROR,
@@ -220,6 +224,7 @@ void e_webcal_query_user (const gchar * name, const gchar * desc,
GtkWidget * rlabel, * clabel;
GtkWidget * cbutton;
GtkWidget * label, * button;
+ GtkWidget * dialog_actionarea, * dialog_vbox;
SoupURI * tmpuri;
gchar * tmpname;
gchar * mrkname, * ref_str;
@@ -334,9 +339,11 @@ void e_webcal_query_user (const gchar * name, const gchar * desc,
gtk_widget_realize (dialog->dialog);
/* More Sane than Stupid Pet Tricks */
- gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog->dialog)->action_area), 12);
- gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog->dialog)->vbox), 0);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog->dialog)->action_area), 6);
+ dialog_actionarea = gtk_dialog_get_action_area (GTK_DIALOG (dialog->dialog));
+ dialog_vbox = gtk_dialog_get_content_area (GTK_DIALOG (dialog->dialog));
+ gtk_container_set_border_width (GTK_CONTAINER (dialog_actionarea), 12);
+ gtk_container_set_border_width (GTK_CONTAINER (dialog_vbox), 0);
+ gtk_box_set_spacing (GTK_BOX (dialog_actionarea), 6);
/* Dialog Buttons */
/*
@@ -375,8 +382,7 @@ void e_webcal_query_user (const gchar * name, const gchar * desc,
/* Main Box */
hbox = gtk_hbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 12);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog->dialog)->vbox), hbox,
- TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (dialog_vbox), hbox, TRUE, TRUE, 0);
gtk_widget_show (hbox);
/* Lame Box for Pretty Icon so It is Top-aligned */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]