]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkassistant.c
Include "config.h" instead of <config.h> Command used: find -name
[~andy/gtk] / gtk / gtkassistant.c
index 49a519dba77da4d9e9746c90df212b9f47c09f0c..289718df43d9735bc481a7f0531bf8136f43afb2 100644 (file)
@@ -23,7 +23,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include <config.h>
+#include "config.h"
 
 #include <atk/atk.h>
 
@@ -457,6 +457,9 @@ set_assistant_buttons_state (GtkAssistant *assistant)
 {
   GtkAssistantPrivate *priv = assistant->priv;
 
+  if (!priv->current_page)
+    return;
+  
   switch (priv->current_page->type)
     {
     case GTK_ASSISTANT_PAGE_INTRO:
@@ -725,10 +728,10 @@ gtk_assistant_init (GtkAssistant *assistant)
     {
       gtk_box_pack_end (GTK_BOX (priv->action_area), assistant->close, FALSE, FALSE, 0);
       gtk_box_pack_end (GTK_BOX (priv->action_area), assistant->cancel, FALSE, FALSE, 0);
-      gtk_box_pack_end (GTK_BOX (priv->action_area), assistant->last, FALSE, FALSE, 0);
-      gtk_box_pack_end (GTK_BOX (priv->action_area), assistant->back, FALSE, FALSE, 0);
-      gtk_box_pack_end (GTK_BOX (priv->action_area), assistant->forward, FALSE, FALSE, 0);
       gtk_box_pack_end (GTK_BOX (priv->action_area), assistant->apply, FALSE, FALSE, 0);
+      gtk_box_pack_end (GTK_BOX (priv->action_area), assistant->forward, FALSE, FALSE, 0);
+      gtk_box_pack_end (GTK_BOX (priv->action_area), assistant->back, FALSE, FALSE, 0);
+      gtk_box_pack_end (GTK_BOX (priv->action_area), assistant->last, FALSE, FALSE, 0);
     }
 
   gtk_widget_set_parent (priv->action_area, GTK_WIDGET (assistant));
@@ -866,6 +869,9 @@ remove_page (GtkAssistant *assistant,
          while (page_node && !GTK_WIDGET_VISIBLE (((GtkAssistantPage *) page_node->data)->page))
            page_node = page_node->next;
 
+          if (page_node == element)
+            page_node = page_node->next;
+
          if (page_node)
            priv->current_page = page_node->data;
          else
@@ -1107,16 +1113,16 @@ gtk_assistant_size_allocate (GtkWidget      *widget,
   /* Header */
   gtk_widget_get_child_requisition (priv->header_image, &header_requisition);
 
-  header_allocation.x = allocation->x + GTK_CONTAINER (widget)->border_width + header_padding;
-  header_allocation.y = allocation->y + GTK_CONTAINER (widget)->border_width + header_padding;
+  header_allocation.x = GTK_CONTAINER (widget)->border_width + header_padding;
+  header_allocation.y = GTK_CONTAINER (widget)->border_width + header_padding;
   header_allocation.width  = allocation->width - 2 * GTK_CONTAINER (widget)->border_width - 2 * header_padding;
   header_allocation.height = header_requisition.height;
 
   gtk_widget_size_allocate (priv->header_image, &header_allocation);
 
   /* Action area */
-  child_allocation.x = allocation->x + GTK_CONTAINER (widget)->border_width;
-  child_allocation.y = allocation->y + allocation->height -
+  child_allocation.x = GTK_CONTAINER (widget)->border_width;
+  child_allocation.y = allocation->height -
     GTK_CONTAINER (widget)->border_width - priv->action_area->requisition.height;
   child_allocation.width  = allocation->width - 2 * GTK_CONTAINER (widget)->border_width;
   child_allocation.height = priv->action_area->requisition.height;
@@ -1125,12 +1131,12 @@ gtk_assistant_size_allocate (GtkWidget      *widget,
 
   /* Sidebar */
   if (rtl)
-    child_allocation.x = allocation->x + allocation->width -
+    child_allocation.x = allocation->width -
       GTK_CONTAINER (widget)->border_width - priv->sidebar_image->requisition.width;
   else
-    child_allocation.x = allocation->x + GTK_CONTAINER (widget)->border_width;
+    child_allocation.x = GTK_CONTAINER (widget)->border_width;
 
-  child_allocation.y = allocation->y + GTK_CONTAINER (widget)->border_width +
+  child_allocation.y = GTK_CONTAINER (widget)->border_width +
     priv->header_image->allocation.height + 2 * header_padding;
   child_allocation.width = priv->sidebar_image->requisition.width;
   child_allocation.height = allocation->height - 2 * GTK_CONTAINER (widget)->border_width -
@@ -1139,8 +1145,8 @@ gtk_assistant_size_allocate (GtkWidget      *widget,
   gtk_widget_size_allocate (priv->sidebar_image, &child_allocation);
 
   /* Pages */
-  child_allocation.x = allocation->x + GTK_CONTAINER (widget)->border_width + content_padding;
-  child_allocation.y = allocation->y + GTK_CONTAINER (widget)->border_width +
+  child_allocation.x = GTK_CONTAINER (widget)->border_width + content_padding;
+  child_allocation.y = GTK_CONTAINER (widget)->border_width +
     priv->header_image->allocation.height + 2 * header_padding + content_padding;
   child_allocation.width  = allocation->width - 2 * GTK_CONTAINER (widget)->border_width - 2 * content_padding;
   child_allocation.height = allocation->height - 2 * GTK_CONTAINER (widget)->border_width -
@@ -1374,8 +1380,6 @@ static void
 gtk_assistant_add (GtkContainer *container,
                   GtkWidget    *page)
 {
-  g_return_if_fail (GTK_IS_WIDGET (page));
-
   gtk_assistant_append_page (GTK_ASSISTANT (container), page);
 }
 
@@ -1383,11 +1387,9 @@ static void
 gtk_assistant_remove (GtkContainer *container,
                      GtkWidget    *page)
 {
-  GtkAssistant *assistant;
+  GtkAssistant *assistant = (GtkAssistant*) container;
   GList *element;
 
-  assistant = (GtkAssistant*) container;
-
   element = find_page (assistant, page);
 
   if (element)
@@ -1516,7 +1518,8 @@ gtk_assistant_set_current_page (GtkAssistant *assistant,
    * initial page is != to 0
    */
   if (GTK_WIDGET_MAPPED (assistant))
-    priv->visited_pages = g_slist_prepend (priv->visited_pages, page);
+    priv->visited_pages = g_slist_prepend (priv->visited_pages,
+                                          priv->current_page);
 
   set_current_page (assistant, page);
 }
@@ -1727,8 +1730,7 @@ gtk_assistant_set_forward_page_func (GtkAssistant         *assistant,
 
   /* Page flow has possibly changed, so the
      buttons state might need to change too */
-  if (priv->current_page)
-    set_assistant_buttons_state (assistant);
+  set_assistant_buttons_state (assistant);
 }
 
 /**
@@ -1882,8 +1884,7 @@ gtk_assistant_set_page_type (GtkAssistant         *assistant,
 
       /* Always set buttons state, a change in a future page
         might change current page buttons */
-      if (priv->current_page)
-       set_assistant_buttons_state (assistant);
+      set_assistant_buttons_state (assistant);
 
       gtk_widget_child_notify (page, "page-type");
     }
@@ -2115,8 +2116,7 @@ gtk_assistant_set_page_complete (GtkAssistant *assistant,
 
       /* Always set buttons state, a change in a future page
         might change current page buttons */
-      if (priv->current_page)
-       set_assistant_buttons_state (assistant);
+      set_assistant_buttons_state (assistant);
 
       gtk_widget_child_notify (page, "complete");
     }
@@ -2265,7 +2265,7 @@ gtk_assistant_accessible_get_type (void)
       g_type_query (derived_atk_type, &query);
       
       type = g_type_register_static_simple (derived_atk_type, 
-                                           "GtkAssistantAccessible"
+                                           I_("GtkAssistantAccessible")
                                            query.class_size,
                                            (GClassInitFunc) gtk_assistant_accessible_class_init,
                                            query.instance_size,
@@ -2315,7 +2315,7 @@ gtk_assistant_accessible_factory_get_type (void)
   if (!type) 
     {
       type = g_type_register_static_simple (ATK_TYPE_OBJECT_FACTORY, 
-                                           "GtkAssistantAccessibleFactory",
+                                           I_("GtkAssistantAccessibleFactory"),
                                            sizeof (AtkObjectFactoryClass),
                                            (GClassInitFunc) gtk_assistant_accessible_factory_class_init,
                                            sizeof (AtkObjectFactory),