Create a new menu bar for PidginConversationWindow. This is just the menu itself and no behavior.

Tue, 24 Nov 2020 03:52:09 -0600

author
Gary Kramlich <grim@reaperworld.com>
date
Tue, 24 Nov 2020 03:52:09 -0600
changeset 40627
3d6797191bf5
parent 40626
bbb0be094c2b
child 40628
4266008a7791

Create a new menu bar for PidginConversationWindow. This is just the menu itself and no behavior.

Testing Done:
Compiled and ran locally.

Reviewed at https://reviews.imfreedom.org/r/251/

pidgin/pidginconversationwindow.c file | annotate | diff | comparison | revisions
pidgin/resources/Conversations/menu.ui file | annotate | diff | comparison | revisions
pidgin/resources/pidgin.gresource.xml file | annotate | diff | comparison | revisions
--- a/pidgin/pidginconversationwindow.c	Tue Nov 24 03:33:04 2020 -0600
+++ b/pidgin/pidginconversationwindow.c	Tue Nov 24 03:52:09 2020 -0600
@@ -25,6 +25,8 @@
 struct _PidginConversationWindow {
 	GtkApplicationWindow parent;
 
+	GMenu *send_to_menu;
+
 	GtkWidget *vbox;
 };
 
@@ -36,10 +38,26 @@
  *****************************************************************************/
 static void
 pidgin_conversation_window_init(PidginConversationWindow *window) {
+	GtkBuilder *builder = NULL;
+	GtkWidget *menubar = NULL;
+	GMenuModel *model = NULL;
+
 	gtk_widget_init_template(GTK_WIDGET(window));
 
 	gtk_window_set_application(GTK_WINDOW(window),
 	                           GTK_APPLICATION(g_application_get_default()));
+
+	/* setup our menu */
+	builder = gtk_builder_new_from_resource("/im/pidgin/Pidgin/Conversations/menu.ui");
+
+	model = (GMenuModel *)gtk_builder_get_object(builder, "conversation");
+	menubar = gtk_menu_bar_new_from_model(model);
+	gtk_box_pack_start(GTK_BOX(window->vbox), menubar, FALSE, FALSE, 0);
+	gtk_widget_show(menubar);
+
+	window->send_to_menu = (GMenu *)gtk_builder_get_object(builder, "send-to");
+
+	g_object_unref(G_OBJECT(builder));
 }
 
 static void
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pidgin/resources/Conversations/menu.ui	Tue Nov 24 03:52:09 2020 -0600
@@ -0,0 +1,143 @@
+<?xml version="1.0"?>
+<interface>
+  <menu id="conversation">
+    <submenu>
+      <attribute name="label" translatable="yes">_Conversation</attribute>
+      <section>
+        <item>
+          <attribute name="label" translatable="yes">New Instant _Message...</attribute>
+          <attribute name="action">app.new-message</attribute>
+          <attribute name="accel">&lt;Primary&gt;M</attribute>
+        </item>
+        <item>
+          <attribute name="label" translatable="yes">Join a _Chat...</attribute>
+          <attribute name="action">app.join-chat</attribute>
+        </item>
+      </section>
+      <section>
+        <item>
+          <attribute name="label" translatable="yes">_Find...</attribute>
+          <attribute name="action">win.find</attribute>
+          <attribute name="accel">&lt;Primary&gt;F</attribute>
+        </item>
+        <item>
+          <attribute name="label" translatable="yes">View _Log</attribute>
+          <attribute name="action">win.view-log</attribute>
+        </item>
+        <item>
+          <attribute name="label" translatable="yes">_Save As...</attribute>
+          <attribute name="action">win.save-as</attribute>
+        </item>
+        <item>
+          <attribute name="label" translatable="yes">Clea_r Scrollback</attribute>
+          <attribute name="action">win.clear-history</attribute>
+          <attribute name="accel">&lt;Primary&gt;L</attribute>
+        </item>
+      </section>
+      <section>
+        <submenu>
+          <attribute name="label" translatable="yes">M_edia</attribute>
+          <section>
+            <item>
+              <attribute name="label" translatable="yes">_Audio Call</attribute>
+              <attribute name="action">win.audio-call</attribute>
+            </item>
+            <item>
+              <attribute name="label" translatable="yes">_Video Call</attribute>
+              <attribute name="action">win.video-call</attribute>
+            </item>
+            <item>
+              <attribute name="label" translatable="yes">Audio/Video _Call</attribute>
+              <attribute name="action">win.audio-video-call</attribute>
+            </item>
+          </section>
+        </submenu>
+      </section>
+      <section>
+        <item>
+          <attribute name="label" translatable="yes">Se_nd File...</attribute>
+          <attribute name="action">win.send-file</attribute>
+        </item>
+        <item>
+          <attribute name="label" translatable="yes">Get _Attention</attribute>
+          <attribute name="action">win.get-attention</attribute>
+        </item>
+        <item>
+          <attribute name="label" translatable="yes">Add Buddy _Pounce...</attribute>
+          <attribute name="action">win.add-buddy-pounce</attribute>
+        </item>
+        <item>
+          <attribute name="label" translatable="yes">_Get Info</attribute>
+          <attribute name="action">win.clear-history</attribute>
+          <attribute name="accel">&lt;Primary&gt;O</attribute>
+        </item>
+        <item>
+          <attribute name="label" translatable="yes">In_vite...</attribute>
+          <attribute name="action">win.invite</attribute>
+        </item>
+        <submenu>
+          <attribute name="label" translatable="yes">M_ore</attribute>
+          <section id="more"></section>
+        </submenu>
+      </section>
+      <section>
+        <item>
+          <attribute name="label" translatable="yes">Al_ias...</attribute>
+          <attribute name="action">win.alias</attribute>
+        </item>
+        <item>
+          <attribute name="label" translatable="yes">_Block...</attribute>
+          <attribute name="action">win.block</attribute>
+        </item>
+        <item>
+          <attribute name="label" translatable="yes">_Unblock...</attribute>
+          <attribute name="action">win.unblock</attribute>
+        </item>
+        <item>
+          <attribute name="label" translatable="yes">_Add...</attribute>
+          <attribute name="action">win.add</attribute>
+        </item>
+        <item>
+          <attribute name="label" translatable="yes">_Remove...</attribute>
+          <attribute name="action">win.remove</attribute>
+        </item>
+      </section>
+      <section>
+        <item>
+          <attribute name="label" translatable="yes">Insert Lin_k...</attribute>
+          <attribute name="action">win.insert-link</attribute>
+        </item>
+        <item>
+          <attribute name="label" translatable="yes">Insert Imag_e...</attribute>
+          <attribute name="action">win.insert-image</attribute>
+        </item>
+      </section>
+      <section>
+        <item>
+          <attribute name="label" translatable="yes">_Close</attribute>
+          <attribute name="action">win.close</attribute>
+          <attribute name="accel">&lt;Primary&gt;W</attribute>
+        </item>
+      </section>
+    </submenu>
+    <submenu>
+      <attribute name="label" translatable="yes">_Options</attribute>
+      <section>
+        <item>
+          <attribute name="label" translatable="yes">Enable _Logging</attribute>
+          <attribute name="action">win.toggle-logging</attribute>
+        </item>
+      </section>
+      <section>
+        <item>
+          <attribute name="label" translatable="yes">Show Formatting _Toolbars</attribute>
+          <attribute name="action">win.toggle-formatting-toolbars</attribute>
+        </item>
+      </section>
+    </submenu>
+    <submenu>
+      <attribute name="label" translatable="yes">S_end To</attribute>
+      <section id="send-to"></section>
+    </submenu>
+  </menu>
+</interface>
--- a/pidgin/resources/pidgin.gresource.xml	Tue Nov 24 03:33:04 2020 -0600
+++ b/pidgin/resources/pidgin.gresource.xml	Tue Nov 24 03:52:09 2020 -0600
@@ -12,6 +12,7 @@
     <file compressed="true">BuddyList/menu.ui</file>
     <file compressed="true">BuddyList/window.ui</file>
     <file compressed="true">Conversations/invite_dialog.ui</file>
+    <file compressed="true">Conversations/menu.ui</file>
     <file compressed="true">Conversations/tab-label.css</file>
     <file compressed="true">Conversations/window.ui</file>
     <file compressed="true">Debug/debug.ui</file>

mercurial