[tepl] AmtkApplicationWindow: connect_menu_to_statusbar(): GtkMenuShell arg



commit f5a3e89cb43ad7828292e8c5061a547e2b610523
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Thu Aug 10 22:29:46 2017 +0200

    AmtkApplicationWindow: connect_menu_to_statusbar(): GtkMenuShell arg
    
    One less line of code in the application.

 amtk/amtk-application-window.c |   19 +++++++++++--------
 amtk/amtk-application-window.h |    2 +-
 docs/reference/api-breaks.xml  |    7 +++++++
 3 files changed, 19 insertions(+), 9 deletions(-)
---
diff --git a/amtk/amtk-application-window.c b/amtk/amtk-application-window.c
index 783c84f..afe251a 100644
--- a/amtk/amtk-application-window.c
+++ b/amtk/amtk-application-window.c
@@ -462,12 +462,11 @@ statusbar_notify_cb (AmtkApplicationWindow *amtk_window,
 /**
  * amtk_application_window_connect_menu_to_statusbar:
  * @amtk_window: an #AmtkApplicationWindow.
- * @amtk_menu_shell: an #AmtkMenuShell.
+ * @menu_shell: a #GtkMenuShell.
  *
- * Connect to the #AmtkMenuShell::menu-item-selected and
- * #AmtkMenuShell::menu-item-deselected signals of @amtk_menu_shell to push/pop
- * the long description of #GtkMenuItem's to the
- * #AmtkApplicationWindow:statusbar.
+ * Connects to the #AmtkMenuShell::menu-item-selected and
+ * #AmtkMenuShell::menu-item-deselected signals of @menu_shell to push/pop the
+ * long description of #GtkMenuItem's to the #AmtkApplicationWindow:statusbar.
  *
  * The long description is retrieved with amtk_menu_item_get_long_description().
  * So amtk_menu_item_set_long_description() must have been called, which is the
@@ -477,10 +476,14 @@ statusbar_notify_cb (AmtkApplicationWindow *amtk_window,
  */
 void
 amtk_application_window_connect_menu_to_statusbar (AmtkApplicationWindow *amtk_window,
-                                                  AmtkMenuShell         *amtk_menu_shell)
+                                                  GtkMenuShell          *menu_shell)
 {
+       AmtkMenuShell *amtk_menu_shell;
+
        g_return_if_fail (AMTK_IS_APPLICATION_WINDOW (amtk_window));
-       g_return_if_fail (AMTK_IS_MENU_SHELL (amtk_menu_shell));
+       g_return_if_fail (GTK_IS_MENU_SHELL (menu_shell));
+
+       amtk_menu_shell = amtk_menu_shell_get_from_gtk_menu_shell (menu_shell);
 
        g_signal_connect_object (amtk_menu_shell,
                                 "menu-item-selected",
@@ -530,7 +533,7 @@ amtk_application_window_connect_recent_chooser_menu_to_statusbar (AmtkApplicatio
                           MENU_SHELL_FOR_RECENT_CHOOSER_KEY,
                           GINT_TO_POINTER (TRUE));
 
-       amtk_application_window_connect_menu_to_statusbar (amtk_window, amtk_menu_shell);
+       amtk_application_window_connect_menu_to_statusbar (amtk_window, GTK_MENU_SHELL (menu));
 }
 
 static void
diff --git a/amtk/amtk-application-window.h b/amtk/amtk-application-window.h
index 52903c9..82df8dd 100644
--- a/amtk/amtk-application-window.h
+++ b/amtk/amtk-application-window.h
@@ -65,7 +65,7 @@ void                  amtk_application_window_set_statusbar                   
(AmtkApplicationWindow *amtk_wind
                                                                                 GtkStatusbar          
*statusbar);
 
 void                   amtk_application_window_connect_menu_to_statusbar       (AmtkApplicationWindow 
*amtk_window,
-                                                                                AmtkMenuShell         
*amtk_menu_shell);
+                                                                                GtkMenuShell          
*menu_shell);
 
 void                   amtk_application_window_connect_recent_chooser_menu_to_statusbar
                                                                                (AmtkApplicationWindow 
*amtk_window,
diff --git a/docs/reference/api-breaks.xml b/docs/reference/api-breaks.xml
index 3ff7937..6ce12cc 100644
--- a/docs/reference/api-breaks.xml
+++ b/docs/reference/api-breaks.xml
@@ -90,6 +90,13 @@
           <link 
linkend="amtk-action-info-central-store-get-singleton">amtk_action_info_central_store_get_singleton()</link>.
         </para>
       </listitem>
+      <listitem>
+        <para>
+          <link 
linkend="amtk-application-window-connect-menu-to-statusbar">amtk_application_window_connect_menu_to_statusbar()</link>
+          now takes a <link linkend="GtkMenuShell">GtkMenuShell</link> parameter
+          instead of <link linkend="AmtkMenuShell">AmtkMenuShell</link>.
+        </para>
+      </listitem>
     </itemizedlist>
   </chapter>
 </part>


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