Daniel Brötzmann pushed to branch master at gajim / gajim
Commits:
-
085331f9
by wurstsalat at 2021-12-17T22:16:58+01:00
-
d345f92f
by wurstsalat at 2021-12-17T22:17:19+01:00
3 changed files:
Changes:
| ... | ... | @@ -137,6 +137,11 @@ def __init__(self, widget_name: str, account: str, jid: JID) -> None: |
| 137 | 137 |
self.control_id: str = str(uuid.uuid4())
|
| 138 | 138 |
self.session = None
|
| 139 | 139 |
|
| 140 |
+ if app.settings.get('use_kib_mib'):
|
|
| 141 |
+ self._units = GLib.FormatSizeFlags.IEC_UNITS
|
|
| 142 |
+ else:
|
|
| 143 |
+ self._units = GLib.FormatSizeFlags.DEFAULT
|
|
| 144 |
+ |
|
| 140 | 145 |
self.xml = get_builder(f'{widget_name}.ui')
|
| 141 | 146 |
self.xml.connect_signals(self)
|
| 142 | 147 |
self.widget = self.xml.get_object(f'{widget_name}_hbox')
|
| ... | ... | @@ -341,8 +341,8 @@ def update_actions(self, *args): |
| 341 | 341 |
tooltip_text = _('Send File…')
|
| 342 | 342 |
max_file_size = self._client.get_module('HTTPUpload').max_file_size
|
| 343 | 343 |
if max_file_size is not None:
|
| 344 |
- max_file_size = max_file_size / (1024 * 1024)
|
|
| 345 |
- tooltip_text = _('Send File (max. %s MiB)…') % max_file_size
|
|
| 344 |
+ max_file_size = GLib.format_size_full(max_file_size, self._units)
|
|
| 345 |
+ tooltip_text = _('Send File (max. %s)…') % max_file_size
|
|
| 346 | 346 |
else:
|
| 347 | 347 |
tooltip_text = _('No File Transfer available')
|
| 348 | 348 |
self.xml.sendfile_button.set_tooltip_text(tooltip_text)
|
| ... | ... | @@ -117,6 +117,10 @@ def on_proxy_ready(_source: GObject.Object, |
| 117 | 117 |
on_proxy_ready)
|
| 118 | 118 |
|
| 119 | 119 |
def _on_notification(self, event):
|
| 120 |
+ if hasattr(event, 'jid'):
|
|
| 121 |
+ jid = str(event.jid)
|
|
| 122 |
+ else:
|
|
| 123 |
+ jid = None
|
|
| 120 | 124 |
if hasattr(event, 'command'):
|
| 121 | 125 |
# Used by Triggers plugin
|
| 122 | 126 |
try:
|
| ... | ... | @@ -152,7 +156,7 @@ def _on_notification(self, event): |
| 152 | 156 |
self._issue_notification(
|
| 153 | 157 |
event.notif_type,
|
| 154 | 158 |
event.account,
|
| 155 |
- str(event.jid),
|
|
| 159 |
+ jid,
|
|
| 156 | 160 |
notif_detail=notif_detail,
|
| 157 | 161 |
title=event.title,
|
| 158 | 162 |
text=event.text,
|