Commit 2efbe8b1 authored by Daniel Brötzmann's avatar Daniel Brötzmann
Browse files

GroupchatControl: Add remove button if group chat not found

parent 34e5b683
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.1 -->
<!-- Generated with glade 3.22.2 -->
<interface>
<requires lib="gtk+" version="3.20"/>
<object class="GtkMenu" id="formattings_menu">
......@@ -932,11 +932,48 @@
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="row_spacing">12</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">dialog-error-symbolic</property>
<property name="icon_size">6</property>
<style>
<class name="error-color"/>
</style>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="homogeneous">True</property>
<property name="halign">center</property>
<property name="spacing">6</property>
<child>
<object class="GtkButton" id="remove_bookmark_button">
<property name="label" translatable="yes">_Leave Group Chat</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="tooltip_text" translatable="yes">Gajim will not try to join this group chat again</property>
<property name="halign">start</property>
<property name="valign">start</property>
<property name="use_underline">True</property>
<signal name="clicked" handler="_on_remove_bookmark_button_clicked" swapped="no"/>
<style>
<class name="destructive-action"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="close_button">
<property name="label" translatable="yes">_Close</property>
......@@ -944,7 +981,7 @@
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">True</property>
<property name="halign">center</property>
<property name="halign">end</property>
<property name="valign">start</property>
<property name="use_underline">True</property>
<signal name="clicked" handler="_on_page_close_clicked" swapped="no"/>
......@@ -952,34 +989,33 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
<property name="top_attach">3</property>
</packing>
</child>
<child>
<object class="GtkImage">
<object class="GtkLabel" id="error_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">dialog-error-symbolic</property>
<property name="icon_size">6</property>
<style>
<class name="error-color"/>
</style>
<property name="justify">center</property>
<property name="wrap">True</property>
<property name="max_width_chars">40</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="error_label">
<object class="GtkLabel" id="error_heading">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">An error occured</property>
<property name="justify">center</property>
<property name="wrap">True</property>
<property name="max_width_chars">40</property>
......
......@@ -1262,6 +1262,7 @@ def _on_configuration_finished(self, _event):
@event_filter(['account', 'room_jid'])
def _on_configuration_failed(self, event):
self.xml.error_heading.set_text(_('Failed to Configure Group Chat'))
self.xml.error_label.set_text(to_user_string(event.error))
self._show_page('error')
......@@ -1512,11 +1513,17 @@ def _on_password_required(self, _event):
@event_filter(['account', 'room_jid'])
def _on_muc_join_failed(self, event):
con = app.connections[self.account]
if con.get_module('Bookmarks').is_bookmark(self.room_jid):
self.xml.remove_bookmark_button.show()
self.xml.error_heading.set_text(_('Failed to Join Group Chat'))
self.xml.error_label.set_text(to_user_string(event.error))
self._show_page('error')
@event_filter(['account', 'room_jid'])
def _on_muc_creation_failed(self, event):
self.xml.error_heading.set_text(_('Failed to Create Group Chat'))
self.xml.error_label.set_text(to_user_string(event.error))
self._show_page('error')
......@@ -2134,6 +2141,11 @@ def _on_captcha_try_again_clicked(self, _button=None):
app.connections[self.account].get_module('MUC').join(self._muc_data)
self._show_page('progress')
def _on_remove_bookmark_button_clicked(self, _button=None):
con = app.connections[self.account]
con.get_module('Bookmarks').remove(self.room_jid)
self._close_control()
def _on_page_cancel_clicked(self, _button=None):
self._show_page('groupchat')
......
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