Add max file size (http_upload) to tooltip and server info
This commit is contained in:
parent
a8bd8abe11
commit
2f5f32257d
|
@ -495,6 +495,10 @@ class GroupchatControl(ChatControlBase):
|
||||||
|
|
||||||
if self.is_connected and httpupload.get_enabled():
|
if self.is_connected and httpupload.get_enabled():
|
||||||
tooltip_text = _('Send File…')
|
tooltip_text = _('Send File…')
|
||||||
|
max_file_size = con.get_module('HTTPUpload').max_file_size
|
||||||
|
if max_file_size is not None:
|
||||||
|
max_file_size = max_file_size / (1024 * 1024)
|
||||||
|
tooltip_text = _('Send File (max. %s MiB)…') % max_file_size
|
||||||
else:
|
else:
|
||||||
tooltip_text = _('No File Transfer available')
|
tooltip_text = _('No File Transfer available')
|
||||||
self.sendfile_button.set_tooltip_text(tooltip_text)
|
self.sendfile_button.set_tooltip_text(tooltip_text)
|
||||||
|
|
|
@ -166,6 +166,13 @@ class ServerInfoDialog(Gtk.Dialog):
|
||||||
Feature = namedtuple('Feature',
|
Feature = namedtuple('Feature',
|
||||||
['name', 'available', 'tooltip', 'enabled'])
|
['name', 'available', 'tooltip', 'enabled'])
|
||||||
|
|
||||||
|
# HTTP File Upload
|
||||||
|
max_file_size = con.get_module('HTTPUpload').max_file_size
|
||||||
|
tooltip_size = ''
|
||||||
|
if max_file_size is not None:
|
||||||
|
max_file_size = max_file_size / (1024 * 1024)
|
||||||
|
tooltip_size = ' (max. %s MiB)' % max_file_size
|
||||||
|
|
||||||
return [
|
return [
|
||||||
Feature('XEP-0016: Privacy Lists',
|
Feature('XEP-0016: Privacy Lists',
|
||||||
con.get_module('PrivacyLists').supported, '', None),
|
con.get_module('PrivacyLists').supported, '', None),
|
||||||
|
@ -192,7 +199,8 @@ class ServerInfoDialog(Gtk.Dialog):
|
||||||
con.get_module('MAM').archiving_namespace, None),
|
con.get_module('MAM').archiving_namespace, None),
|
||||||
Feature('XEP-0363: HTTP File Upload',
|
Feature('XEP-0363: HTTP File Upload',
|
||||||
con.get_module('HTTPUpload').available,
|
con.get_module('HTTPUpload').available,
|
||||||
con.get_module('HTTPUpload').httpupload_namespace, None),
|
con.get_module('HTTPUpload').httpupload_namespace + \
|
||||||
|
tooltip_size, None),
|
||||||
Feature('XEP-0398: Avatar Conversion',
|
Feature('XEP-0398: Avatar Conversion',
|
||||||
con.avatar_conversion, '', None),
|
con.avatar_conversion, '', None),
|
||||||
Feature('XEP-0411: Bookmarks Conversion',
|
Feature('XEP-0411: Bookmarks Conversion',
|
||||||
|
|
Loading…
Reference in New Issue