]> Pileus Git - ~andy/gtk/commitdiff
Rename ::tab-added and ::tab-removed signals to ::page-added and
authorCarlos Garnacho <carlosg@gnome.org>
Wed, 8 Mar 2006 17:22:14 +0000 (17:22 +0000)
committerCarlos Garnacho <carlosg@src.gnome.org>
Wed, 8 Mar 2006 17:22:14 +0000 (17:22 +0000)
2006-03-08  Carlos Garnacho  <carlosg@gnome.org>

        Rename ::tab-added and ::tab-removed signals to ::page-added and
        ::page-removed for not conflicting with other tab reordering
        implementations. Fixes bug #333743.

        Also rename ::tab-reordered to ::page-reordered, and emit it in
        gtk_notebook_reorder_child () to make it behave consistently with the
        other two signals.

        * gtk/gtknotebook.c (gtk_notebook_class_init): rename signals.
        (gtk_notebook_reorder_tab)
        (gtk_notebook_button_release)
        (gtk_notebook_remove)
        (gtk_notebook_real_insert_page): emit respectively renamed signals
        (gtk_notebook_reorder_child): also emit ::page-reordered here

        * tests/testnotebookdnd.c: use renamed signals

ChangeLog
ChangeLog.pre-2-10
gtk/gtknotebook.c
tests/testnotebookdnd.c

index d80e3be0fb7d7911b92d3901003aeb0f19329c64..8ae21c005c1594be45388806b7439651e170fc37 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2006-03-08  Carlos Garnacho  <carlosg@gnome.org>
+
+       Rename ::tab-added and ::tab-removed signals to ::page-added and
+       ::page-removed for not conflicting with other tab reordering
+       implementations. Fixes bug #333743.
+
+       Also rename ::tab-reordered to ::page-reordered, and emit it in
+       gtk_notebook_reorder_child () to make it behave consistently with the
+       other two signals.
+
+       * gtk/gtknotebook.c (gtk_notebook_class_init): rename signals.
+       (gtk_notebook_reorder_tab)
+       (gtk_notebook_button_release)
+       (gtk_notebook_remove)
+       (gtk_notebook_real_insert_page): emit respectively renamed signals
+       (gtk_notebook_reorder_child): also emit ::page-reordered here
+
+       * tests/testnotebookdnd.c: use renamed signals
+
 2006-03-08  Michael Natterer  <mitch@imendio.com>
 
        * gdk/gdkscreen.h
index d80e3be0fb7d7911b92d3901003aeb0f19329c64..8ae21c005c1594be45388806b7439651e170fc37 100644 (file)
@@ -1,3 +1,22 @@
+2006-03-08  Carlos Garnacho  <carlosg@gnome.org>
+
+       Rename ::tab-added and ::tab-removed signals to ::page-added and
+       ::page-removed for not conflicting with other tab reordering
+       implementations. Fixes bug #333743.
+
+       Also rename ::tab-reordered to ::page-reordered, and emit it in
+       gtk_notebook_reorder_child () to make it behave consistently with the
+       other two signals.
+
+       * gtk/gtknotebook.c (gtk_notebook_class_init): rename signals.
+       (gtk_notebook_reorder_tab)
+       (gtk_notebook_button_release)
+       (gtk_notebook_remove)
+       (gtk_notebook_real_insert_page): emit respectively renamed signals
+       (gtk_notebook_reorder_child): also emit ::page-reordered here
+
+       * tests/testnotebookdnd.c: use renamed signals
+
 2006-03-08  Michael Natterer  <mitch@imendio.com>
 
        * gdk/gdkscreen.h
index b7173bfd47547a1ce52cc9860d7c8076fbda865b..2b970b99a750e0acf3cc07e1d3b269bb56780157 100644 (file)
@@ -54,9 +54,9 @@ enum {
   CHANGE_CURRENT_PAGE,
   MOVE_FOCUS_OUT,
   REORDER_TAB,
-  TAB_REORDERED,
-  TAB_REMOVED,
-  TAB_ADDED,
+  PAGE_REORDERED,
+  PAGE_REMOVED,
+  PAGE_ADDED,
   LAST_SIGNAL
 };
 
@@ -822,64 +822,64 @@ gtk_notebook_class_init (GtkNotebookClass *class)
                   GTK_TYPE_DIRECTION_TYPE,
                  G_TYPE_BOOLEAN);
   /**
-   * GtkNotebook::tab-reordered:
+   * GtkNotebook::page-reordered:
    * @notebook: the #GtkNotebook
    * @child: the child #GtkWidget affected
    * @page_num: the new page number for @child
    *
-   * the ::tab-reordered signal is emitted in the notebook
-   * right after a tab has been reordered by the user.
+   * the ::page-reordered signal is emitted in the notebook
+   * right after a page has been reordered.
    *
    * Since: 2.10
    **/
-  notebook_signals[TAB_REORDERED] =
-    g_signal_new (I_("tab_reordered"),
+  notebook_signals[PAGE_REORDERED] =
+    g_signal_new (I_("page_reordered"),
                   G_TYPE_FROM_CLASS (gobject_class),
-                  G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
+                  G_SIGNAL_RUN_LAST,
                   0, NULL, NULL,
-                 _gtk_marshal_VOID__POINTER_UINT,
+                 _gtk_marshal_VOID__OBJECT_UINT,
                   G_TYPE_NONE, 2,
-                 G_TYPE_POINTER,
+                 GTK_TYPE_WIDGET,
                  G_TYPE_UINT);
   /**
-   * GtkNotebook::tab-removed:
+   * GtkNotebook::page-removed:
    * @notebook: the #GtkNotebook
    * @child: the child #GtkWidget affected
    * @page_num: the @child page number
    *
-   * the ::tab-removed signal is emitted in the notebook
-   * right before a tab is removed from the notebook.
+   * the ::page-removed signal is emitted in the notebook
+   * right before a page is removed from the notebook.
    *
    * Since: 2.10
    **/
-  notebook_signals[TAB_REMOVED] =
-    g_signal_new (I_("tab_removed"),
+  notebook_signals[PAGE_REMOVED] =
+    g_signal_new (I_("page_removed"),
                   G_TYPE_FROM_CLASS (gobject_class),
-                  G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
+                  G_SIGNAL_RUN_LAST,
                   0, NULL, NULL,
-                 _gtk_marshal_VOID__POINTER_UINT,
+                 _gtk_marshal_VOID__OBJECT_UINT,
                   G_TYPE_NONE, 2,
-                 G_TYPE_POINTER,
+                 GTK_TYPE_WIDGET,
                  G_TYPE_UINT);
   /**
-   * GtkNotebook::tab-attached:
+   * GtkNotebook::page-attached:
    * @notebook: the #GtkNotebook
    * @child: the child #GtkWidget affected
    * @page_num: the new page number for @child
    *
-   * the ::tab-added signal is emitted in the notebook
-   * right after a tab is added to the notebook.
+   * the ::page-added signal is emitted in the notebook
+   * right after a page is added to the notebook.
    *
    * Since: 2.10
    **/
-  notebook_signals[TAB_ADDED] =
-    g_signal_new (I_("tab_added"),
+  notebook_signals[PAGE_ADDED] =
+    g_signal_new (I_("page_added"),
                   G_TYPE_FROM_CLASS (gobject_class),
-                  G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
+                  G_SIGNAL_RUN_LAST,
                   0, NULL, NULL,
-                 _gtk_marshal_VOID__POINTER_UINT,
+                 _gtk_marshal_VOID__OBJECT_UINT,
                   G_TYPE_NONE, 2,
-                 G_TYPE_POINTER,
+                 GTK_TYPE_WIDGET,
                  G_TYPE_UINT);
 
   binding_set = gtk_binding_set_by_class (class);
@@ -1228,7 +1228,7 @@ gtk_notebook_reorder_tab (GtkNotebook      *notebook,
       gtk_notebook_pages_allocate (notebook, DRAG_OPERATION_NONE);
 
       g_signal_emit (notebook,
-                    notebook_signals[TAB_REORDERED],
+                    notebook_signals[PAGE_REORDERED],
                     0,
                     ((GtkNotebookPage *) notebook->focus_tab->data)->child,
                     page_num);
@@ -2440,7 +2440,7 @@ gtk_notebook_button_release (GtkWidget      *widget,
          if (priv->has_scrolled ||
              old_page_num != page_num)
            g_signal_emit (notebook,
-                          notebook_signals[TAB_REORDERED], 0,
+                          notebook_signals[PAGE_REORDERED], 0,
                           ((GtkNotebookPage *) notebook->focus_tab->data)->child,
                           page_num);
 
@@ -3178,7 +3178,7 @@ gtk_notebook_remove (GtkContainer *container,
     }
 
   g_signal_emit (notebook,
-                notebook_signals[TAB_REMOVED],
+                notebook_signals[PAGE_REMOVED],
                 0,
                 widget,
                 page_num);
@@ -3563,7 +3563,7 @@ gtk_notebook_real_insert_page (GtkNotebook *notebook,
   gtk_widget_thaw_child_notify (child);
 
   g_signal_emit (notebook,
-                notebook_signals[TAB_ADDED],
+                notebook_signals[PAGE_ADDED],
                 0,
                 child,
                 position);
@@ -6761,6 +6761,12 @@ gtk_notebook_reorder_child (GtkNotebook *notebook,
     gtk_notebook_pages_allocate (notebook, DRAG_OPERATION_NONE);
 
   gtk_widget_thaw_child_notify (child);
+
+  g_signal_emit (notebook,
+                notebook_signals[PAGE_REORDERED],
+                0,
+                child,
+                position);
 }
 
 /**
index 23b63543784701c8e888ec46b6da5c6033cf9f53..4c48af5649e7d84cf38600c5a0494311426515b0 100644 (file)
@@ -89,9 +89,9 @@ window_creation_function (GtkNotebook *source_notebook,
 }
 
 static void
-on_tab_reordered (GtkNotebook *notebook, GtkWidget *child, guint page_num, gpointer data)
+on_page_reordered (GtkNotebook *notebook, GtkWidget *child, guint page_num, gpointer data)
 {
-  g_print ("tab %d reordered\n", page_num);
+  g_print ("page %d reordered\n", page_num);
 }
 
 static GtkWidget*
@@ -129,8 +129,8 @@ create_notebook (gchar           **labels,
       labels++;
     }
 
-  g_signal_connect (GTK_NOTEBOOK (notebook), "tab-reordered",
-                   G_CALLBACK (on_tab_reordered), NULL);
+  g_signal_connect (GTK_NOTEBOOK (notebook), "page-reordered",
+                   G_CALLBACK (on_page_reordered), NULL);
 
   return notebook;
 }