Philipp Hörist pushed to branch master at gajim / gajim


Commits:
2f5f3225 by Daniel Brötzmann at 2019-04-26T18:15:31Z
Add max file size (http_upload) to tooltip and server info

- - - - -


2 changed files:

- gajim/groupchat_control.py
- gajim/gtk/server_info.py


Changes:

=====================================
gajim/groupchat_control.py
=====================================
@@ -495,6 +495,10 @@ class GroupchatControl(ChatControlBase):
 
         if self.is_connected and httpupload.get_enabled():
             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:
             tooltip_text = _('No File Transfer available')
         self.sendfile_button.set_tooltip_text(tooltip_text)


=====================================
gajim/gtk/server_info.py
=====================================
@@ -166,6 +166,13 @@ class ServerInfoDialog(Gtk.Dialog):
         Feature = namedtuple('Feature',
                              ['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 [
             Feature('XEP-0016: Privacy Lists',
                     con.get_module('PrivacyLists').supported, '', None),
@@ -192,7 +199,8 @@ class ServerInfoDialog(Gtk.Dialog):
                     con.get_module('MAM').archiving_namespace, None),
             Feature('XEP-0363: HTTP File Upload',
                     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',
                     con.avatar_conversion, '', None),
             Feature('XEP-0411: Bookmarks Conversion',



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/2f5f32257d8746aa8e25a1e6bd2ded67a49cbd64

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/2f5f32257d8746aa8e25a1e6bd2ded67a49cbd64
You're receiving this email because of your account on dev.gajim.org.

_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to