From 0482ae872252e963564381c3aa46727e523e39b8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20Br=C3=B6tzmann?= <mailtrash@posteo.de>
Date: Mon, 23 Mar 2020 11:20:44 +0100
Subject: [PATCH] GroupchatControl: Add invite button

---
 gajim/data/gui/groupchat_control.ui | 37 ++++++++++++++++++++++++-----
 gajim/groupchat_control.py          |  3 +++
 2 files changed, 34 insertions(+), 6 deletions(-)

diff --git a/gajim/data/gui/groupchat_control.ui b/gajim/data/gui/groupchat_control.ui
index 8e2cd7fd06..ad189bc3a3 100644
--- a/gajim/data/gui/groupchat_control.ui
+++ b/gajim/data/gui/groupchat_control.ui
@@ -272,6 +272,31 @@
                         <property name="position">0</property>
                       </packing>
                     </child>
+                    <child>
+                      <object class="GtkButton" id="quick_invite_button">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">True</property>
+                        <property name="tooltip_text" translatable="yes">Invite Contacts…</property>
+                        <child>
+                          <object class="GtkImage">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="icon_name">list-add-symbolic</property>
+                          </object>
+                        </child>
+                        <style>
+                          <class name="chatcontrol-actionbar-button"/>
+                          <class name="flat"/>
+                        </style>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="pack_type">end</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
                     <child>
                       <object class="GtkButton" id="authentication_button">
                         <property name="can_focus">True</property>
@@ -297,7 +322,7 @@
                         <property name="expand">False</property>
                         <property name="fill">False</property>
                         <property name="pack_type">end</property>
-                        <property name="position">1</property>
+                        <property name="position">2</property>
                       </packing>
                     </child>
                     <child>
@@ -318,7 +343,7 @@
                         <property name="expand">False</property>
                         <property name="fill">True</property>
                         <property name="pack_type">end</property>
-                        <property name="position">2</property>
+                        <property name="position">3</property>
                       </packing>
                     </child>
                     <child>
@@ -343,7 +368,7 @@
                         <property name="expand">False</property>
                         <property name="fill">False</property>
                         <property name="pack_type">end</property>
-                        <property name="position">3</property>
+                        <property name="position">4</property>
                       </packing>
                     </child>
                     <child>
@@ -367,7 +392,7 @@
                       <packing>
                         <property name="expand">False</property>
                         <property name="fill">True</property>
-                        <property name="position">4</property>
+                        <property name="position">5</property>
                       </packing>
                     </child>
                     <child>
@@ -396,7 +421,7 @@
                       <packing>
                         <property name="expand">False</property>
                         <property name="fill">True</property>
-                        <property name="position">5</property>
+                        <property name="position">6</property>
                       </packing>
                     </child>
                     <child>
@@ -411,7 +436,7 @@
                       <packing>
                         <property name="expand">False</property>
                         <property name="fill">True</property>
-                        <property name="position">7</property>
+                        <property name="position">8</property>
                       </packing>
                     </child>
                   </object>
diff --git a/gajim/groupchat_control.py b/gajim/groupchat_control.py
index 54bae0b39c..3eeeb840a4 100644
--- a/gajim/groupchat_control.py
+++ b/gajim/groupchat_control.py
@@ -176,6 +176,9 @@ def __init__(self, parent_win, contact, muc_data, acct):
         self.xml.info_grid.attach(self._muc_info_box, 0, 0, 1, 1)
 
         # Groupchat invite
+        self.xml.quick_invite_button.set_action_name(
+            'win.invite-%s' % self.control_id)
+
         self._invite_box = GroupChatInvite(self.room_jid)
         self.xml.invite_grid.attach(self._invite_box, 0, 0, 1, 1)
         self._invite_box.connect('listbox-changed', self._on_invite_ready)
-- 
GitLab