Philipp Hörist pushed to branch gajim_1.1 at gajim / gajim
Commits:
-
c2d69774
by Philipp Hörist at 2019-01-08T19:07:00Z
-
af4e06ca
by André Apitzsch at 2019-01-08T19:07:27Z
-
5329190d
by Sebastiaan Lokhorst at 2019-01-08T19:18:47Z
-
2ad179df
by Philipp Hörist at 2019-01-08T19:20:12Z
-
ad5a8fd3
by Philipp Hörist at 2019-01-08T19:21:47Z
-
f29bf456
by Philipp Hörist at 2019-01-08T21:32:40Z
10 changed files:
- README.md
- data/gajim-history-manager.1
- data/gajim-remote.1
- data/gajim.1
- gajim/common/app.py
- gajim/common/connection.py
- gajim/common/i18n.py
- gajim/gajim.py
- gajim/gtk/about.py
- setup.cfg
Changes:
| ... | ... | @@ -7,7 +7,7 @@ |
| 7 | 7 |
- python3-gi
|
| 8 | 8 |
- python3-gi-cairo
|
| 9 | 9 |
- gir1.2-gtk-3.0 (>=3.22)
|
| 10 |
-- python3-nbxmpp
|
|
| 10 |
+- python3-nbxmpp (>=0.6.9,<0.7.0)
|
|
| 11 | 11 |
- python3-openssl (>=0.14)
|
| 12 | 12 |
- python3-cssutils (>=1.0.2)
|
| 13 | 13 |
- python3-keyring
|
| ... | ... | @@ -17,7 +17,7 @@ |
| 17 | 17 |
|
| 18 | 18 |
- python3-pil (pillow) for support of webp avatars
|
| 19 | 19 |
- python3-gnupg to enable GPG encryption
|
| 20 |
-- For zeroconf (bonjour) you need python3-dbus
|
|
| 20 |
+- For zeroconf you need python3-dbus on Linux or [pybonjour](https://dev.gajim.org/lovetox/pybonjour-python3) on Windows/macOS
|
|
| 21 | 21 |
- gir1.2-gspell-1 and hunspell-LANG where lang is your locale eg. en, fr etc
|
| 22 | 22 |
- gir1.2-secret-1 for GNOME Keyring or KDE support as password storage
|
| 23 | 23 |
- D-Bus running to have gajim-remote working
|
| ... | ... | @@ -86,7 +86,7 @@ Execute gajim with --verbose |
| 86 | 86 |
|
| 87 | 87 |
That is all, **enjoy**!
|
| 88 | 88 |
|
| 89 |
-(C) 2003-2018
|
|
| 89 |
+(C) 2003-2019
|
|
| 90 | 90 |
The Gajim Team
|
| 91 | 91 |
[https://gajim.org](https://gajim.org)
|
| 92 | 92 |
|
| ... | ... | @@ -46,7 +46,7 @@ and |
| 46 | 46 |
.Pa THANKS ,
|
| 47 | 47 |
for a complete list.
|
| 48 | 48 |
.Sh COPYRIGHT
|
| 49 |
-Copyright (C) 2003-2018 Gajim Team
|
|
| 49 |
+Copyright (C) 2003-2019 Gajim Team
|
|
| 50 | 50 |
.Pp
|
| 51 | 51 |
.Nm
|
| 52 | 52 |
is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 3 only.
|
| ... | ... | @@ -89,7 +89,7 @@ and |
| 89 | 89 |
.Pa THANKS ,
|
| 90 | 90 |
for a complete list.
|
| 91 | 91 |
.Sh COPYRIGHT
|
| 92 |
-Copyright (C) 2003-2018 Gajim Team
|
|
| 92 |
+Copyright (C) 2003-2019 Gajim Team
|
|
| 93 | 93 |
.Pp
|
| 94 | 94 |
.Nm
|
| 95 | 95 |
is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 3 only.
|
| ... | ... | @@ -93,7 +93,7 @@ and |
| 93 | 93 |
with contributions and patches merged from many individuals around the world.
|
| 94 | 94 |
See the About Dialog for a complete list.
|
| 95 | 95 |
.Sh COPYRIGHT
|
| 96 |
-Copyright (C) 2003-2018 Gajim Team
|
|
| 96 |
+Copyright (C) 2003-2019 Gajim Team
|
|
| 97 | 97 |
.Pp
|
| 98 | 98 |
.Nm
|
| 99 | 99 |
is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 3 only.
|
| ... | ... | @@ -200,12 +200,14 @@ def detect_dependencies(): |
| 200 | 200 |
|
| 201 | 201 |
# ZEROCONF
|
| 202 | 202 |
try:
|
| 203 |
- if os.name == 'nt':
|
|
| 204 |
- import pybonjour # pylint: disable=unused-variable
|
|
| 205 |
- _dependencies['PYBONJOUR'] = True
|
|
| 206 |
- else:
|
|
| 207 |
- import dbus # pylint: disable=unused-variable
|
|
| 208 |
- _dependencies['PYTHON-DBUS'] = True
|
|
| 203 |
+ import pybonjour # pylint: disable=unused-variable
|
|
| 204 |
+ _dependencies['PYBONJOUR'] = True
|
|
| 205 |
+ except Exception:
|
|
| 206 |
+ pass
|
|
| 207 |
+ |
|
| 208 |
+ try:
|
|
| 209 |
+ import dbus # pylint: disable=unused-variable
|
|
| 210 |
+ _dependencies['PYTHON-DBUS'] = True
|
|
| 209 | 211 |
except Exception:
|
| 210 | 212 |
pass
|
| 211 | 213 |
|
| ... | ... | @@ -56,6 +56,7 @@ from gajim.common import app |
| 56 | 56 |
from gajim.common import gpg
|
| 57 | 57 |
from gajim.common import passwords
|
| 58 | 58 |
from gajim.common import idle
|
| 59 |
+from gajim.common import i18n
|
|
| 59 | 60 |
from gajim.common.i18n import _
|
| 60 | 61 |
from gajim.common.connection_handlers import *
|
| 61 | 62 |
from gajim.common.contacts import GC_Contact
|
| ... | ... | @@ -1037,7 +1038,8 @@ class Connection(CommonConnection, ConnectionHandlers): |
| 1037 | 1038 |
con = nbxmpp.NonBlockingClient(
|
| 1038 | 1039 |
domain=self._hostname,
|
| 1039 | 1040 |
caller=self,
|
| 1040 |
- idlequeue=app.idlequeue)
|
|
| 1041 |
+ idlequeue=app.idlequeue,
|
|
| 1042 |
+ lang=i18n.LANG)
|
|
| 1041 | 1043 |
|
| 1042 | 1044 |
# increase default timeout for server responses
|
| 1043 | 1045 |
nbxmpp.dispatcher_nb.DEFAULT_TIMEOUT_SECONDS = \
|
| ... | ... | @@ -69,6 +69,22 @@ def iter_locale_dirs(): |
| 69 | 69 |
if locale_dir.is_dir():
|
| 70 | 70 |
yield str(locale_dir)
|
| 71 | 71 |
|
| 72 |
+def get_default_lang():
|
|
| 73 |
+ if os.name == "nt":
|
|
| 74 |
+ import ctypes
|
|
| 75 |
+ windll = ctypes.windll.kernel32
|
|
| 76 |
+ lang = locale.windows_locale[windll.GetUserDefaultUILanguage()]
|
|
| 77 |
+ return lang[:2]
|
|
| 78 |
+ |
|
| 79 |
+ if sys.platform == "darwin":
|
|
| 80 |
+ from AppKit import NSLocale
|
|
| 81 |
+ return NSLocale.currentLocale().languageCode()
|
|
| 82 |
+ |
|
| 83 |
+ default = locale.getdefaultlocale()[0]
|
|
| 84 |
+ if default is not None:
|
|
| 85 |
+ return default[:2]
|
|
| 86 |
+ return 'en'
|
|
| 87 |
+ |
|
| 72 | 88 |
def initialize_direction_mark():
|
| 73 | 89 |
from gi.repository import Gtk
|
| 74 | 90 |
|
| ... | ... | @@ -137,15 +153,13 @@ try: |
| 137 | 153 |
except locale.Error as error:
|
| 138 | 154 |
print(error)
|
| 139 | 155 |
|
| 140 |
-if os.name == 'nt':
|
|
| 141 |
- try:
|
|
| 142 |
- # en_US, fr_FR, el_GR etc..
|
|
| 143 |
- default = locale.getdefaultlocale()[0]
|
|
| 144 |
- if default is not None:
|
|
| 145 |
- LANG = default[:2]
|
|
| 146 |
- except (ValueError, locale.Error):
|
|
| 147 |
- pass
|
|
| 148 |
- os.environ['LANG'] = LANG
|
|
| 156 |
+try:
|
|
| 157 |
+ LANG = get_default_lang()
|
|
| 158 |
+ print('Found default language: %s' % LANG)
|
|
| 159 |
+except Exception as error:
|
|
| 160 |
+ print('Failed to determine default language')
|
|
| 161 |
+ import traceback
|
|
| 162 |
+ traceback.print_exc()
|
|
| 149 | 163 |
|
| 150 | 164 |
# Search for the translation in all locale dirs
|
| 151 | 165 |
for dir_ in iter_locale_dirs():
|
| ... | ... | @@ -27,7 +27,7 @@ from distutils.version import LooseVersion as V |
| 27 | 27 |
# Install _() in namespace
|
| 28 | 28 |
from gajim.common import i18n
|
| 29 | 29 |
|
| 30 |
-_MIN_NBXMPP_VER = "0.6.8"
|
|
| 30 |
+_MIN_NBXMPP_VER = "0.6.9"
|
|
| 31 | 31 |
_MIN_GTK_VER = "3.22.0"
|
| 32 | 32 |
|
| 33 | 33 |
|
| ... | ... | @@ -14,10 +14,12 @@ |
| 14 | 14 |
|
| 15 | 15 |
import nbxmpp
|
| 16 | 16 |
|
| 17 |
+from gi.repository import Gdk
|
|
| 17 | 18 |
from gi.repository import Gtk
|
| 18 | 19 |
from gi.repository import GObject
|
| 19 | 20 |
|
| 20 | 21 |
from gajim.common import app
|
| 22 |
+from gajim.common.helpers import launch_browser_mailer
|
|
| 21 | 23 |
from gajim.common.i18n import _
|
| 22 | 24 |
from gajim.common.const import DEVS_CURRENT
|
| 23 | 25 |
from gajim.common.const import DEVS_PAST
|
| ... | ... | @@ -31,7 +33,7 @@ class AboutDialog(Gtk.AboutDialog): |
| 31 | 33 |
self.set_transient_for(app.interface.roster.window)
|
| 32 | 34 |
self.set_name('Gajim')
|
| 33 | 35 |
self.set_version(app.version)
|
| 34 |
- self.set_copyright('Copyright © 2003-2018 Gajim Team')
|
|
| 36 |
+ self.set_copyright('Copyright © 2003-2019 Gajim Team')
|
|
| 35 | 37 |
self.set_license_type(Gtk.License.GPL_3_0_ONLY)
|
| 36 | 38 |
self.set_website('https://gajim.org/')
|
| 37 | 39 |
|
| ... | ... | @@ -65,3 +67,25 @@ class AboutDialog(Gtk.AboutDialog): |
| 65 | 67 |
'response', lambda dialog, *args: Gtk.AboutDialog.do_close(dialog))
|
| 66 | 68 |
|
| 67 | 69 |
self.show()
|
| 70 |
+ self.connect('activate-link', self._on_activate_link)
|
|
| 71 |
+ # See https://gitlab.gnome.org/GNOME/gtk/issues/1561
|
|
| 72 |
+ self._connect_link_handler(self)
|
|
| 73 |
+ |
|
| 74 |
+ @staticmethod
|
|
| 75 |
+ def _on_activate_link(_label, uri):
|
|
| 76 |
+ # We have to use this, because the default GTK handler
|
|
| 77 |
+ # is not cross-platform compatible
|
|
| 78 |
+ launch_browser_mailer(None, uri)
|
|
| 79 |
+ return Gdk.EVENT_STOP
|
|
| 80 |
+ |
|
| 81 |
+ def _connect_link_handler(self, parent):
|
|
| 82 |
+ def _find_child(parent_):
|
|
| 83 |
+ if not hasattr(parent_, 'get_children'):
|
|
| 84 |
+ return
|
|
| 85 |
+ |
|
| 86 |
+ for child in parent_.get_children():
|
|
| 87 |
+ if isinstance(child, Gtk.Label):
|
|
| 88 |
+ if 'href' in child.get_label():
|
|
| 89 |
+ child.connect('activate-link', self._on_activate_link)
|
|
| 90 |
+ _find_child(child)
|
|
| 91 |
+ _find_child(parent)
|
| ... | ... | @@ -22,7 +22,7 @@ test_suite = test |
| 22 | 22 |
install_requires =
|
| 23 | 23 |
cssutils>=1.0.2
|
| 24 | 24 |
keyring
|
| 25 |
- nbxmpp>=0.6.8,<0.7.0
|
|
| 25 |
+ nbxmpp>=0.6.9,<0.7.0
|
|
| 26 | 26 |
precis-i18n>=1.0.0
|
| 27 | 27 |
pyOpenSSL>=0.12
|
| 28 | 28 |
|