Added ability to diconnect muc from tab context menu
This commit is contained in:
parent
fffa50979c
commit
baff629433
3 changed files with 22 additions and 0 deletions
|
@ -107,5 +107,12 @@
|
|||
<property name="use_underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="disconnect_menuitem">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">_Disconnect</property>
|
||||
<property name="use_underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
|
|
|
@ -1494,6 +1494,8 @@ class ConversationTextview(GObject.GObject):
|
|||
text, text_tags, graphics, iter_, additional_data)
|
||||
if self.plugin_modified:
|
||||
return self.tv.get_buffer().get_end_iter()
|
||||
#needed, if buffer is manipulated by plugins without setting plugin_modified to True
|
||||
iter_ = self.tv.get_buffer().get_end_iter()
|
||||
|
||||
# detect urls formatting and if the user has it on emoticons
|
||||
return self.detect_and_print_special_text(text, text_tags, graphics=graphics,
|
||||
|
|
|
@ -301,6 +301,7 @@ class GroupchatControl(ChatControlBase):
|
|||
ChatControlBase.__init__(self, self.TYPE_ID, parent_win,
|
||||
'groupchat_control', contact, acct)
|
||||
|
||||
self.force_non_minimizable = False
|
||||
self.is_continued = is_continued
|
||||
self.is_anonymous = True
|
||||
|
||||
|
@ -829,6 +830,7 @@ class GroupchatControl(ChatControlBase):
|
|||
destroy_room_menuitem = xml.get_object('destroy_room_menuitem')
|
||||
change_subject_menuitem = xml.get_object('change_subject_menuitem')
|
||||
history_menuitem = xml.get_object('history_menuitem')
|
||||
disconnect_menuitem = xml.get_object('disconnect_menuitem')
|
||||
minimize_menuitem = xml.get_object('minimize_menuitem')
|
||||
request_voice_menuitem = xml.get_object('request_voice_menuitem')
|
||||
bookmark_separator = xml.get_object('bookmark_separator')
|
||||
|
@ -921,6 +923,10 @@ class GroupchatControl(ChatControlBase):
|
|||
id_ = history_menuitem.connect('activate',
|
||||
self._on_history_menuitem_activate)
|
||||
self.handlers[id_] = history_menuitem
|
||||
|
||||
id_ = disconnect_menuitem.connect('activate',
|
||||
self._on_disconnect_menuitem_activate)
|
||||
self.handlers[id_] = disconnect_menuitem
|
||||
|
||||
id_ = request_voice_menuitem.connect('activate',
|
||||
self._on_request_voice_menuitem_activate)
|
||||
|
@ -2038,6 +2044,8 @@ class GroupchatControl(ChatControlBase):
|
|||
return 'visitor'
|
||||
|
||||
def minimizable(self):
|
||||
if self.force_non_minimizable:
|
||||
return False
|
||||
if self.contact.jid not in gajim.config.get_per('accounts', self.account,
|
||||
'non_minimized_gc').split(' '):
|
||||
return True
|
||||
|
@ -2219,6 +2227,11 @@ class GroupchatControl(ChatControlBase):
|
|||
_('Please specify the new subject:'), input_str=self.subject,
|
||||
ok_handler=on_ok)
|
||||
|
||||
def _on_disconnect_menuitem_activate(self, widget):
|
||||
self.force_non_minimizable = True
|
||||
self.parent_win.remove_tab(self, self.parent_win.CLOSE_COMMAND)
|
||||
self.force_non_minimizable = False
|
||||
|
||||
def _on_change_nick_menuitem_activate(self, widget):
|
||||
if 'change_nick_dialog' in gajim.interface.instances:
|
||||
gajim.interface.instances['change_nick_dialog'].dialog.present()
|
||||
|
|
Loading…
Add table
Reference in a new issue