* added an entry in the roster menu to display archiving preferences window
* now we check service discovery features for message archiving
This commit is contained in:
parent
66e7ea153e
commit
ee59f1754b
5 changed files with 45 additions and 6 deletions
|
@ -9,6 +9,13 @@
|
|||
<property name="use_underline">True</property>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkMenuItem" id="archiving_preferences_menuitem">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Edit Archi_ving Preferences...</property>
|
||||
<property name="use_underline">True</property>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkMenuItem" id="privacy_lists_menuitem">
|
||||
<property name="label" translatable="yes">Edit _Privacy Lists...</property>
|
||||
|
|
|
@ -894,6 +894,14 @@ class ConnectionDisco:
|
|||
break
|
||||
if features.__contains__(common.xmpp.NS_PUBSUB):
|
||||
self.pubsub_supported = True
|
||||
if features.__contains__(common.xmpp.NS_ARCHIVE_AUTO):
|
||||
self.archive_auto_supported = True
|
||||
if features.__contains__(common.xmpp.NS_ARCHIVE_MANAGE):
|
||||
self.archive_manage_supported = True
|
||||
if features.__contains__(common.xmpp.NS_ARCHIVE_MANUAL):
|
||||
self.archive_manual_supported = True
|
||||
if features.__contains__(common.xmpp.NS_ARCHIVE_PREF):
|
||||
self.archive_pref_supported = True
|
||||
if features.__contains__(common.xmpp.NS_BYTESTREAM):
|
||||
our_jid = helpers.parse_jid(gajim.get_jid_from_account(self.name) +\
|
||||
'/' + self.server_resource)
|
||||
|
|
|
@ -21,6 +21,10 @@
|
|||
|
||||
class ConnectionArchive:
|
||||
def __init__(self):
|
||||
self.archive_auto_supported = False
|
||||
self.archive_manage_supported = False
|
||||
self.archive_manual_supported = False
|
||||
self.archive_pref_supported = False
|
||||
self.auto_save = None
|
||||
self.method_auto = None
|
||||
self.method_local = None
|
||||
|
|
|
@ -2848,6 +2848,11 @@ class RosterItemExchangeWindow:
|
|||
self.window.destroy()
|
||||
|
||||
|
||||
class ArchivingPreferencesWindow:
|
||||
def __init__(self, account):
|
||||
self.account = account
|
||||
|
||||
|
||||
class PrivacyListWindow:
|
||||
'''Window that is used for creating NEW or EDITING already there privacy
|
||||
lists'''
|
||||
|
|
|
@ -2336,6 +2336,14 @@ class RosterWindow:
|
|||
gajim.interface.instances[account]['xml_console'] = \
|
||||
dialogs.XMLConsoleWindow(account)
|
||||
|
||||
def on_archiving_preferences_menuitem_activate(self, widget, account):
|
||||
if 'archiving_preferences' in gajim.interface.instances[account]:
|
||||
gajim.interface.instances[account]['archiving_preferences'].window.\
|
||||
present()
|
||||
else:
|
||||
gajim.interface.instances[account]['archiving_preferences'] = \
|
||||
dialogs.ArchivingPreferencesWindow(account)
|
||||
|
||||
def on_privacy_lists_menuitem_activate(self, widget, account):
|
||||
if 'privacy_lists' in gajim.interface.instances[account]:
|
||||
gajim.interface.instances[account]['privacy_lists'].window.present()
|
||||
|
@ -6022,6 +6030,8 @@ class RosterWindow:
|
|||
advanced_menuitem_menu = xml.get_widget('advanced_menuitem_menu')
|
||||
|
||||
xml_console_menuitem = xml.get_widget('xml_console_menuitem')
|
||||
archiving_preferences_menuitem = \
|
||||
xml.get_widget('archiving_preferences_menuitem')
|
||||
privacy_lists_menuitem = xml.get_widget('privacy_lists_menuitem')
|
||||
administrator_menuitem = xml.get_widget('administrator_menuitem')
|
||||
send_server_message_menuitem = xml.get_widget(
|
||||
|
@ -6033,12 +6043,17 @@ class RosterWindow:
|
|||
xml_console_menuitem.connect('activate',
|
||||
self.on_xml_console_menuitem_activate, account)
|
||||
|
||||
if gajim.connections[account] and gajim.connections[account].\
|
||||
privacy_rules_supported:
|
||||
privacy_lists_menuitem.connect('activate',
|
||||
self.on_privacy_lists_menuitem_activate, account)
|
||||
else:
|
||||
privacy_lists_menuitem.set_sensitive(False)
|
||||
if gajim.connections[account]:
|
||||
if gajim.connections[account].privacy_rules_supported:
|
||||
privacy_lists_menuitem.connect('activate',
|
||||
self.on_privacy_lists_menuitem_activate, account)
|
||||
else:
|
||||
privacy_lists_menuitem.set_sensitive(False)
|
||||
if gajim.connections[account].archive_pref_supported:
|
||||
archiving_preferences_menuitem.connect('activate',
|
||||
self.on_archiving_preferences_menuitem_activate, account)
|
||||
else:
|
||||
archiving_preferences_menuitem.set_sensitive(False)
|
||||
|
||||
if gajim.connections[account].is_zeroconf:
|
||||
administrator_menuitem.set_sensitive(False)
|
||||
|
|
Loading…
Add table
Reference in a new issue