[balsa/wip/gtk4] Remove application menu



commit 34b8464e87ef32919c7511a4b7f6cb4ded25917a
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Sun Jan 20 20:16:29 2019 -0500

    Remove application menu
    
    GNOME has decided that application menus, shown in the top bar
    of the GNOME desktop, are a bad idea. It was kind of a stretch
    for Balsa to implement one, so it shouldn't be too hard to drop
    it.
    
    * src/main-window.c (settings_activated),
      (bw_add_win_action_entries), (balsa_window_add_action_entries),
      (bw_set_menus): move the appmenu items that are not already
      duplicate in the File: menu back there;
    * ui/main-window.ui: ditto.

 ChangeLog         |  22 --------
 src/main-window.c |  39 +++++---------
 ui/main-window.ui | 158 +++++++++++++++++++++++-------------------------------
 3 files changed, 79 insertions(+), 140 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 2e4959564..e7c917dc0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -263,27 +263,6 @@
          webkit version 2.20;
          (libbalsa_html_new): do not auto-load images if any are
          external (that is, not cid: data)
-2019-01-22  Peter Bloomfield  <pbloomfield bellsouth net>
-
-       More menu shuffling
-
-       * ui/main-window.ui:
-         move "File → New → Message" to "Message → New…";
-         move  "Mailbox → Close" to the foot of the "Mailbox" menu, and
-         group "Remove Duplicates" and "Expunge Deleted Messages"
-         immediately above it;
-         move "Message → Next Message" and three friends to a new
-         "Go" top-level menu.
-
-2019-01-21  Peter Bloomfield  <pbloomfield bellsouth net>
-
-       * ui/main-window.ui: Shuffle some menu items;
-       see https://gitlab.gnome.org/GNOME/balsa/issues/14
-
-2019-01-21  Peter Bloomfield  <pbloomfield bellsouth net>
-
-       * ui/main-window.ui: Restore 'm' shortcut for "New message"
-
 2019-01-20  Peter Bloomfield  <pbloomfield bellsouth net>
 
        Remove application menu
@@ -689,7 +668,6 @@
        apply threading changes on 'Update' instead of instantly on
        checking the boxes.
 
->>>>>>> 05e7c7ea7... Deprecation cleanup: gtk_window_present()
 2018-08-27  Peter Bloomfield  <pbloomfield bellsouth net>
 
        Check for valid msgno
diff --git a/src/main-window.c b/src/main-window.c
index 8a538c855..379540c99 100644
--- a/src/main-window.c
+++ b/src/main-window.c
@@ -936,9 +936,9 @@ address_book_activated(GSimpleAction * action,
 }
 
 static void
-prefs_activated(GSimpleAction * action,
-                GVariant      * parameter,
-                gpointer        user_data)
+settings_activated(GSimpleAction * action,
+                   GVariant      * parameter,
+                   gpointer        user_data)
 {
     open_preferences_manager(NULL, user_data);
 }
@@ -1958,9 +1958,9 @@ threading_change_state(GSimpleAction * action,
  */
 
 static void
-bw_add_app_action_entries(GActionMap * action_map, gpointer user_data)
+bw_add_win_action_entries(GActionMap * action_map)
 {
-    static GActionEntry app_entries[] = {
+    static GActionEntry win_entries[] = {
         {"new-message",           new_message_activated},
         {"new-mbox",              new_mbox_activated},
         {"new-maildir",           new_maildir_activated},
@@ -1968,21 +1968,6 @@ bw_add_app_action_entries(GActionMap * action_map, gpointer user_data)
         {"new-imap-box",          new_imap_box_activated},
         {"new-imap-folder",       new_imap_folder_activated},
         {"new-imap-subfolder",    new_imap_subfolder_activated},
-        {"toolbars",              toolbars_activated},
-        {"identities",            identities_activated},
-        {"address-book",          address_book_activated},
-        {"prefs",                 prefs_activated},
-        {"help",                  help_activated},
-        {"about",                 about_activated},
-        {"quit",                  quit_activated}
-    };
-
-    g_action_map_add_action_entries(action_map, app_entries,
-                                    G_N_ELEMENTS(app_entries), user_data);
-}
-
-    static GActionEntry win_entries[] = {
-        {"new-message",           new_message_activated},
         {"continue",              continue_activated},
         {"get-new-mail",          get_new_mail_activated},
         {"send-queued-mail",      send_queued_mail_activated},
@@ -1990,6 +1975,14 @@ bw_add_app_action_entries(GActionMap * action_map, gpointer user_data)
         {"page-setup",            page_setup_activated},
         {"print",                 print_activated},
         {"address-book",          address_book_activated},
+#ifdef ENABLE_AUTOCRYPT
+        {"autocrypt-db",          autocrypt_db_activated},
+#endif
+        {"settings",              settings_activated},
+        {"toolbars",              toolbars_activated},
+        {"identities",            identities_activated},
+        {"help",                  help_activated},
+        {"about",                 about_activated},
         {"quit",                  quit_activated},
         {"copy",                  copy_activated},
         {"select-all",            select_all_activated},
@@ -2086,7 +2079,6 @@ bw_add_win_action_entries(GActionMap * action_map)
 void
 balsa_window_add_action_entries(GActionMap * action_map)
 {
-    bw_add_app_action_entries(action_map, NULL);
     bw_add_win_action_entries(action_map);
 }
 
@@ -2100,16 +2092,11 @@ bw_set_menus(BalsaWindow * window)
         "/org/desktop/Balsa/main-window.ui";
     GError *err = NULL;
 
-    bw_add_app_action_entries(G_ACTION_MAP(application), window);
     bw_add_win_action_entries(G_ACTION_MAP(window));
 
     builder = gtk_builder_new();
     if (gtk_builder_add_from_resource(builder, resource_path, &err)) {
         GtkWidget *menubar;
-
-        gtk_application_set_app_menu(application,
-                                     G_MENU_MODEL(gtk_builder_get_object
-                                                  (builder, "app-menu")));
 #ifdef SET_MENUBAR_SETS_A_VISIBLE_MENUBAR
         gtk_application_set_menubar(application,
                                     G_MENU_MODEL(gtk_builder_get_object
diff --git a/ui/main-window.ui b/ui/main-window.ui
index 487aede6f..ed5a1459f 100644
--- a/ui/main-window.ui
+++ b/ui/main-window.ui
@@ -1,100 +1,46 @@
 <interface>
-  <menu id='app-menu'>
-    <submenu>
-      <attribute name='label' translatable='yes' context='appmenu' comments='Translators: app menu item - 
New message or mailbox'>_New</attribute>
-      <section>
-        <item>
-          <attribute name='label' translatable='yes'>_Message</attribute>
-          <attribute name='action'>app.new-message</attribute>
-        </item>
-      </section>
-      <section>
-        <item>
-          <attribute name='label'
-            translatable='yes'>Local mbox mailbox…</attribute>
-          <attribute name='action'>app.new-mbox</attribute>
-        </item>
-        <item>
-          <attribute name='label'
-            translatable='yes'>Local Maildir mailbox…</attribute>
-          <attribute name='action'>app.new-maildir</attribute>
-        </item>
-        <item>
-          <attribute name='label'
-            translatable='yes'>Local MH mailbox…</attribute>
-          <attribute name='action'>app.new-mh</attribute>
-        </item>
-        <item>
-          <attribute name='label'
-            translatable='yes'>Remote IMAP mailbox…</attribute>
-          <attribute name='action'>app.new-imap-box</attribute>
-        </item>
-      </section>
-      <section>
-        <item>
-          <attribute name='label'
-            translatable='yes'>Remote IMAP folder…</attribute>
-          <attribute name='action'>app.new-imap-folder</attribute>
-        </item>
-        <item>
-          <attribute name='label'
-            translatable='yes'>Remote IMAP subfolder…</attribute>
-          <attribute name='action'>app.new-imap-subfolder</attribute>
-        </item>
-      </section>
-    </submenu>
-    <submenu>
-      <attribute name='label' translatable='yes'>_Settings</attribute>
-      <section>
-        <item>
-          <attribute name='label'
-            translatable='yes'>_Toolbars…</attribute>
-          <attribute name='action'>app.toolbars</attribute>
-        </item>
-        <item>
-          <attribute name='label'
-            translatable='yes'>_Identities…</attribute>
-          <attribute name='action'>app.identities</attribute>
-        </item>
-      </section>
-    </submenu>
-    <section>
-      <item>
-        <attribute name='label'
-          translatable='yes'>_Address Book</attribute>
-        <attribute name='action'>app.address-book</attribute>
-      </item>
-    </section>
-    <section>
-      <item>
-        <attribute name='label' translatable='yes'>_Preferences</attribute>
-        <attribute name='action'>app.prefs</attribute>
-      </item>
-    </section>
-    <section>
-      <item>
-        <attribute name='label' translatable='yes'>_Help</attribute>
-        <attribute name='action'>app.help</attribute>
-      </item>
-      <item>
-        <attribute name='label' translatable='yes'>_About</attribute>
-        <attribute name='action'>app.about</attribute>
-      </item>
-      <item>
-        <attribute name='label' translatable='yes'>_Quit</attribute>
-        <attribute name='action'>app.quit</attribute>
-      </item>
-    </section>
-  </menu>
   <menu id='menubar'>
     <submenu>
       <attribute name='label' translatable='yes'>_File</attribute>
       <section>
-        <item>
-          <attribute name='label' translatable='yes'>New _Message</attribute>
-          <attribute name='action'>win.new-message</attribute>
-          <attribute name='accel'>m</attribute>
-        </item>
+        <submenu>
+          <attribute name='label' translatable='yes' context='window menu' comments='Translators: window 
menu item - New message or mailbox'>_New</attribute>
+          <section>
+            <item>
+              <attribute name='label' translatable='yes'>_Message</attribute>
+              <attribute name='action'>win.new-message</attribute>
+            </item>
+          </section>
+          <section>
+            <item>
+              <attribute name='label'
+                translatable='yes'>Local mbox mailbox…</attribute>
+              <attribute name='action'>win.new-mbox</attribute>
+            </item>
+            <item>
+              <attribute name='label'
+                translatable='yes'>Local Maildir mailbox…</attribute>
+              <attribute name='action'>win.new-maildir</attribute>
+            </item>
+            <item>
+              <attribute name='label'
+                translatable='yes'>Local MH mailbox…</attribute>
+              <attribute name='action'>win.new-mh</attribute>
+            </item>
+          </section>
+          <section>
+            <item>
+              <attribute name='label'
+                translatable='yes'>Remote IMAP folder…</attribute>
+              <attribute name='action'>win.new-imap-folder</attribute>
+            </item>
+            <item>
+              <attribute name='label'
+                translatable='yes'>Remote IMAP subfolder…</attribute>
+              <attribute name='action'>win.new-imap-subfolder</attribute>
+            </item>
+          </section>
+        </submenu>
       </section>
       <section>
         <item>
@@ -146,6 +92,34 @@
         </item>
       </section>
       <section>
+        <submenu>
+          <attribute name='label' translatable='yes'>_Preferences</attribute>
+          <item>
+            <attribute name='label'
+              translatable='yes'>_Settings…</attribute>
+            <attribute name='action'>win.settings</attribute>
+          </item>
+          <item>
+            <attribute name='label'
+              translatable='yes'>_Toolbars…</attribute>
+            <attribute name='action'>win.toolbars</attribute>
+          </item>
+          <item>
+            <attribute name='label'
+              translatable='yes'>_Identities…</attribute>
+            <attribute name='action'>win.identities</attribute>
+          </item>
+        </submenu>
+      </section>
+      <section>
+        <item>
+          <attribute name='label' translatable='yes'>_Help</attribute>
+          <attribute name='action'>win.help</attribute>
+        </item>
+        <item>
+          <attribute name='label' translatable='yes'>_About Balsa</attribute>
+          <attribute name='action'>win.about</attribute>
+        </item>
         <item>
           <attribute name='label' translatable='yes'>_Quit</attribute>
           <attribute name='action'>win.quit</attribute>


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