[seahorse] Fixes all but one issue for compiling with -DGSEAL_ENABLE. See bug 612494.



commit ba122ff38ceaa0a2938c88f960c0f857fdd1a8be
Author: Andre Klapper <a9016009 gmx de>
Date:   Tue Apr 13 12:06:14 2010 +0200

    Fixes all but one issue for compiling with -DGSEAL_ENABLE. See bug 612494.

 gkr/seahorse-gkr-dialogs.c        |   18 +++++++++++++-----
 libcryptui/cryptui.c              |    6 +++---
 libegg/egg-datetime.c             |   18 ++++++++++--------
 libseahorse/seahorse-passphrase.c |   12 ++++++------
 libseahorse/seahorse-util.c       |    9 +++++----
 pgp/seahorse-pgp-key-properties.c |    2 +-
 src/seahorse-key-manager-store.c  |    2 +-
 7 files changed, 39 insertions(+), 28 deletions(-)
---
diff --git a/gkr/seahorse-gkr-dialogs.c b/gkr/seahorse-gkr-dialogs.c
index 076b283..1fe5a2b 100644
--- a/gkr/seahorse-gkr-dialogs.c
+++ b/gkr/seahorse-gkr-dialogs.c
@@ -29,11 +29,11 @@ update_wait_cursor (GtkWidget *dialog, gpointer unused)
 {
 	GdkCursor *cursor;
     
-	g_return_if_fail (dialog->window);
+	g_return_if_fail (gtk_widget_get_window (dialog));
     
 	/* No request active? */
 	if (!g_object_get_data (G_OBJECT (dialog), "gkr-request")) {
-		gdk_window_set_cursor (dialog->window, NULL);
+		gdk_window_set_cursor (gtk_widget_get_window (dialog), NULL);
 		return;
 	}
     
@@ -49,7 +49,7 @@ update_wait_cursor (GtkWidget *dialog, gpointer unused)
 	}
     
 	/* Indicate that we're loading stuff */
-	gdk_window_set_cursor (dialog->window, cursor);
+	gdk_window_set_cursor (gtk_widget_get_window (dialog), cursor);
 }
 
 void
@@ -71,8 +71,12 @@ seahorse_gkr_dialog_begin_request (SeahorseWidget *swidget, gpointer request)
 	 */ 
 	g_object_set_data_full (G_OBJECT (dialog), "gkr-request", request, 
 				gnome_keyring_cancel_request); 
-    
+
+#if GTK_CHECK_VERSION(2,20,0)
+	if (gtk_widget_get_realized (dialog))
+#else
 	if (GTK_WIDGET_REALIZED (dialog))
+#endif
 		update_wait_cursor (dialog, NULL);
 	else
 		g_signal_connect (dialog, "realize", G_CALLBACK (update_wait_cursor), dialog);
@@ -92,8 +96,12 @@ seahorse_gkr_dialog_complete_request (SeahorseWidget *swidget, gboolean cancel)
 	request = g_object_steal_data (G_OBJECT (dialog), "gkr-request");
 	if (request && cancel)
 		gnome_keyring_cancel_request (request);
-	        
+
+#if GTK_CHECK_VERSION(2,20,0)
+	if (gtk_widget_get_realized (dialog))
+#else
 	if (GTK_WIDGET_REALIZED (dialog))
+#endif
 		update_wait_cursor (dialog, NULL);
 	gtk_widget_set_sensitive (dialog, TRUE);
 }
diff --git a/libcryptui/cryptui.c b/libcryptui/cryptui.c
index 4978de9..eb12f16 100644
--- a/libcryptui/cryptui.c
+++ b/libcryptui/cryptui.c
@@ -191,7 +191,7 @@ cryptui_prompt_recipients (CryptUIKeyset *keyset, const gchar *title,
     
     chooser = cryptui_key_chooser_new (keyset, mode);
     gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
-    gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), GTK_WIDGET (chooser));
+    gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), GTK_WIDGET (chooser));
     gtk_window_set_default_size (GTK_WINDOW (dialog), 400, -1);
     
     g_signal_connect (chooser, "changed", G_CALLBACK (selection_changed), dialog);
@@ -242,8 +242,8 @@ cryptui_prompt_signer (CryptUIKeyset *keyset, const gchar *title)
     
     chooser = cryptui_key_chooser_new (keyset, CRYPTUI_KEY_CHOOSER_SIGNER |
                                                CRYPTUI_KEY_CHOOSER_MUSTSIGN);
-    gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), 5);
-    gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), GTK_WIDGET (chooser));
+    gtk_container_set_border_width (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), 5);
+    gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), GTK_WIDGET (chooser));
     gtk_window_set_default_size (GTK_WINDOW (dialog), 400, -1);
     
     gtk_widget_show_all (dialog);
diff --git a/libegg/egg-datetime.c b/libegg/egg-datetime.c
index 28a339b..59b255f 100644
--- a/libegg/egg-datetime.c
+++ b/libegg/egg-datetime.c
@@ -821,16 +821,18 @@ get_time_string (guint8 hour, guint8 minute, guint8 second)
 static void
 popup_position (GtkWidget *widget, GtkWindow *popup)
 {
+   GtkAllocation allocation;
    GtkRequisition requisition;
    gint x, y, width, height;
 
    gtk_widget_size_request (GTK_WIDGET (popup), &requisition);
-   gdk_window_get_origin (widget->window, &x, &y);
+   gdk_window_get_origin (gtk_widget_get_window (widget), &x, &y);
 
-   x += widget->allocation.x;
-   y += widget->allocation.y;
-   width  = widget->allocation.width;
-   height = widget->allocation.height;
+   gtk_widget_get_allocation (widget, &allocation);
+   x += allocation.x;
+   y += allocation.y;
+   width  = allocation.width;
+   height = allocation.height;
 
    x += width - requisition.width;
    y += height;
@@ -853,7 +855,7 @@ popup_show (GtkWindow *popup)
    gtk_grab_add (GTK_WIDGET (popup));
 
    cursor = gdk_cursor_new (GDK_ARROW);
-   gdk_pointer_grab (GTK_WIDGET (popup)->window, TRUE,
+   gdk_pointer_grab (gtk_widget_get_window (GTK_WIDGET (popup)), TRUE,
            (GDK_BUTTON_PRESS_MASK
             | GDK_BUTTON_RELEASE_MASK
             | GDK_POINTER_MOTION_MASK),
@@ -952,7 +954,7 @@ cal_popup_button_pressed (EggDateTime *edt, GdkEventButton *event, GtkWidget *wi
       while (child) {
          if (child == widget)
             return FALSE;
-         child = child->parent;
+         child = gtk_widget_get_parent (child);
       }
    }
 
@@ -1057,7 +1059,7 @@ time_popup_button_pressed (EggDateTime *edt, GdkEventButton *event, GtkWidget *w
       while (child) {
          if (child == widget)
             return FALSE;
-         child = child->parent;
+         child = gtk_widget_get_parent (child);
       }
    }
 
diff --git a/libseahorse/seahorse-passphrase.c b/libseahorse/seahorse-passphrase.c
index fd17283..79d919e 100644
--- a/libseahorse/seahorse-passphrase.c
+++ b/libseahorse/seahorse-passphrase.c
@@ -94,7 +94,7 @@ grab_keyboard (GtkWidget *win, GdkEvent *event, gpointer data)
 {
 #ifndef _DEBUG
 	if (!g_object_get_data (G_OBJECT (win), "keyboard-grabbed"))
-		if (gdk_keyboard_grab (win->window, FALSE, gdk_event_get_time (event)))
+		if (gdk_keyboard_grab (gtk_widget_get_window (win), FALSE, gdk_event_get_time (event)))
 			g_message ("could not grab keyboard");
 	g_object_set_data (G_OBJECT (win), "keyboard-grabbed", GINT_TO_POINTER (TRUE));
 #endif
@@ -145,7 +145,7 @@ entry_changed (GtkEditable *editable, GtkDialog *dialog)
 static gboolean
 window_state_changed (GtkWidget *win, GdkEventWindowState *event, gpointer data)
 {
-	GdkWindowState state = gdk_window_get_state (win->window);
+	GdkWindowState state = gdk_window_get_state (gtk_widget_get_window (win));
 	
 	if (state & GDK_WINDOW_STATE_WITHDRAWN ||
 	    state & GDK_WINDOW_STATE_ICONIFIED ||
@@ -209,7 +209,7 @@ seahorse_passphrase_prompt_show (const gchar *title, const gchar *description,
     g_signal_connect (G_OBJECT (dialog), "window-state-event", G_CALLBACK (window_state_changed), NULL); 
 
     wvbox = gtk_vbox_new (FALSE, HIG_LARGE * 2);
-    gtk_container_add (GTK_CONTAINER (dialog->vbox), wvbox);
+    gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (dialog)), wvbox);
     gtk_container_set_border_width (GTK_CONTAINER (wvbox), HIG_LARGE);
 
     chbox = gtk_hbox_new (FALSE, HIG_LARGE);
@@ -291,11 +291,11 @@ seahorse_passphrase_prompt_show (const gchar *title, const gchar *description,
     
     w = gtk_button_new_from_stock (GTK_STOCK_CANCEL);
     gtk_dialog_add_action_widget (dialog, w, GTK_RESPONSE_REJECT);
-    GTK_WIDGET_SET_FLAGS (w, GTK_CAN_DEFAULT);
+    gtk_widget_set_can_default (w, TRUE);
 
     w = gtk_button_new_from_stock (GTK_STOCK_OK);
     gtk_dialog_add_action_widget (dialog, w, GTK_RESPONSE_ACCEPT);
-    GTK_WIDGET_SET_FLAGS (w, GTK_CAN_DEFAULT);
+    gtk_widget_set_can_default (w, TRUE);
     g_signal_connect_object (G_OBJECT (entry), "focus_in_event",
                              G_CALLBACK (gtk_widget_grab_default), G_OBJECT (w), 0);
     gtk_widget_grab_default (w);
@@ -307,7 +307,7 @@ seahorse_passphrase_prompt_show (const gchar *title, const gchar *description,
     gtk_window_set_type_hint (GTK_WINDOW (dialog), GDK_WINDOW_TYPE_HINT_NORMAL);
     gtk_window_set_keep_above (GTK_WINDOW (dialog), TRUE);
     gtk_widget_show_all (GTK_WIDGET (dialog));
-    gdk_window_focus (GTK_WIDGET (dialog)->window, GDK_CURRENT_TIME);
+    gdk_window_focus (gtk_widget_get_window (GTK_WIDGET (dialog)), GDK_CURRENT_TIME);
 
     if (confirm)
         entry_changed (NULL, dialog);
diff --git a/libseahorse/seahorse-util.c b/libseahorse/seahorse-util.c
index 96bbde1..382766d 100644
--- a/libseahorse/seahorse-util.c
+++ b/libseahorse/seahorse-util.c
@@ -1577,6 +1577,7 @@ seahorse_util_determine_popup_menu_position (GtkMenu *menu, int *x, int *y,
 {
         GtkWidget      *widget;
         GtkRequisition  requisition;
+        GtkAllocation   allocation;
         gint            menu_xpos;
         gint            menu_ypos;
 
@@ -1584,16 +1585,16 @@ seahorse_util_determine_popup_menu_position (GtkMenu *menu, int *x, int *y,
 
         gtk_widget_size_request (GTK_WIDGET (menu), &requisition);
 
-        gdk_window_get_origin (widget->window, &menu_xpos, &menu_ypos);
+        gdk_window_get_origin (gtk_widget_get_window (widget), &menu_xpos, &menu_ypos);
 
-        menu_xpos += widget->allocation.x;
-        menu_ypos += widget->allocation.y;
+        gtk_widget_get_allocation (widget, &allocation);
+        menu_xpos += allocation.x;
+        menu_ypos += allocation.y;
 
 
         if (menu_ypos > gdk_screen_get_height (gtk_widget_get_screen (widget)) / 2)
                 menu_ypos -= requisition.height;
         else
-                menu_ypos += widget->allocation.height;
            
         *x = menu_xpos;
         *y = menu_ypos;
diff --git a/pgp/seahorse-pgp-key-properties.c b/pgp/seahorse-pgp-key-properties.c
index 3ef90ba..7ea3be4 100644
--- a/pgp/seahorse-pgp-key-properties.c
+++ b/pgp/seahorse-pgp-key-properties.c
@@ -490,7 +490,7 @@ on_pgp_owner_photo_drag_received (GtkWidget *widget, GdkDragContext *context, gi
      * and there has to be a better way to get rid of the trailing \r\n appended
      * to the end of the path after the call to g_filename_from_uri
      */
-    if((sel_data != NULL) && (sel_data->length >= 0)) {
+    if((sel_data != NULL) && (gtk_selection_data_get_length (sel_data) >= 0)) {
         g_return_if_fail (target_type == TARGET_URI);
         
         uri_list = gtk_selection_data_get_uris (sel_data);
diff --git a/src/seahorse-key-manager-store.c b/src/seahorse-key-manager-store.c
index ea4c929..de966b8 100644
--- a/src/seahorse-key-manager-store.c
+++ b/src/seahorse-key-manager-store.c
@@ -612,7 +612,7 @@ drag_data_get (GtkWidget *widget, GdkDragContext *context, GtkSelectionData *sel
 			skstore->priv->drag_destination = g_path_get_dirname (destination);
 			g_free (destination);
 		
-			gtk_selection_data_set (selection_data, selection_data->target, 8, (guchar*)"S", 1);
+			gtk_selection_data_set (selection_data, gtk_selection_data_get_target (selection_data), 8, (guchar*)"S", 1);
 			ret = TRUE;
 		}
 		



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