Fix the menu hack for Gajim ≥1.6
This commit is contained in:
parent
d6b7575c4c
commit
b538fa106e
|
@ -14,8 +14,8 @@
|
||||||
"win32"
|
"win32"
|
||||||
],
|
],
|
||||||
"requirements": [
|
"requirements": [
|
||||||
"gajim>=1.5,<1.9"
|
"gajim>=1.6,<1.9"
|
||||||
],
|
],
|
||||||
"short_name": "otrplugin",
|
"short_name": "otrplugin",
|
||||||
"version": "0.5"
|
"version": "0.5.1"
|
||||||
}
|
}
|
||||||
|
|
16
plugin.py
16
plugin.py
|
@ -56,7 +56,7 @@ class OTRPlugin(GajimPlugin):
|
||||||
self.modules = [module]
|
self.modules = [module]
|
||||||
self.gui_extension_points = {
|
self.gui_extension_points = {
|
||||||
'encrypt' + self.encryption_name: (self._encrypt_message, None),
|
'encrypt' + self.encryption_name: (self._encrypt_message, None),
|
||||||
# 'message_actions_box': (self._message_actions_box_activate, self._message_actions_box_deactivate),
|
'message_actions_box': (self._message_actions_box_activate, self._message_actions_box_deactivate),
|
||||||
}
|
}
|
||||||
self._menuitem = None
|
self._menuitem = None
|
||||||
|
|
||||||
|
@ -69,15 +69,13 @@ class OTRPlugin(GajimPlugin):
|
||||||
return grid._ui.encryption_menu_button.get_menu_model()
|
return grid._ui.encryption_menu_button.get_menu_model()
|
||||||
|
|
||||||
def activate(self):
|
def activate(self):
|
||||||
pass
|
if app.window is not None and self._menuitem is None:
|
||||||
# if app.window is not None:
|
grid = self._get_grid()
|
||||||
# grid = self._get_grid()
|
self._actions_hack_activate(grid)
|
||||||
# self._actions_hack_activate(grid)
|
|
||||||
|
|
||||||
def deactivate(self):
|
def deactivate(self):
|
||||||
pass
|
grid = self._get_grid()
|
||||||
# grid = self._get_grid()
|
self._actions_hack_deactivate(grid)
|
||||||
# self._actions_hack_deactivate(grid)
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_otr(account):
|
def get_otr(account):
|
||||||
|
@ -109,7 +107,7 @@ class OTRPlugin(GajimPlugin):
|
||||||
|
|
||||||
def _actions_hack_activate(self, grid):
|
def _actions_hack_activate(self, grid):
|
||||||
model = grid._ui.encryption_menu_button.get_menu_model()
|
model = grid._ui.encryption_menu_button.get_menu_model()
|
||||||
menuitem = make_menu_item('OTR', 'win.set-encryption', '"OTR"')
|
menuitem = make_menu_item('OTR', 'win.set-encryption', 'OTR')
|
||||||
self._menuitem = menuitem.get_attribute_value(Gio.MENU_ATTRIBUTE_LABEL)
|
self._menuitem = menuitem.get_attribute_value(Gio.MENU_ATTRIBUTE_LABEL)
|
||||||
model.append_item(menuitem)
|
model.append_item(menuitem)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue