Commit c8333171 authored by Daniel Brötzmann's avatar Daniel Brötzmann Committed by Daniel Brötzmann

GroupChatInfo: Add address copy button

parent ce7f7088
......@@ -13,7 +13,6 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
<property name="valign">start</property>
<property name="label" translatable="yes">Address</property>
<style>
<class name="dim-label"/>
......@@ -72,19 +71,6 @@
<property name="top_attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="address">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="valign">start</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="description">
<property name="can_focus">False</property>
......@@ -291,5 +277,52 @@
<property name="width">2</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">12</property>
<child>
<object class="GtkLabel" id="address">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="tooltip_text" translatable="yes">Copy Address</property>
<property name="halign">start</property>
<property name="valign">start</property>
<signal name="clicked" handler="_on_copy_address" swapped="no"/>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">edit-copy-symbolic</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
</packing>
</child>
</object>
</interface>
......@@ -242,6 +242,10 @@ def _add_features(self, features):
row += 1
grid.show_all()
def _on_copy_address(self, _button):
clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD)
clipboard.set_text(f'xmpp:{str(self._info.jid)}?join', -1)
@staticmethod
def _on_activate_log_link(button):
open_uri(button.get_uri())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment