detect when gpg is not installed and print a warning. fixes #2760
This commit is contained in:
parent
fd13baefc4
commit
0fb837f74f
|
@ -23,6 +23,7 @@
|
||||||
## GNU General Public License for more details.
|
## GNU General Public License for more details.
|
||||||
##
|
##
|
||||||
|
|
||||||
|
import os
|
||||||
from os import tmpfile
|
from os import tmpfile
|
||||||
from common import helpers
|
from common import helpers
|
||||||
|
|
||||||
|
@ -37,6 +38,10 @@ except ImportError:
|
||||||
USE_GPG = False # user can't do OpenGPG only if he or she removed the file!
|
USE_GPG = False # user can't do OpenGPG only if he or she removed the file!
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
status = os.system('gpg -h >/dev/null 2>&1')
|
||||||
|
if status != 0:
|
||||||
|
USE_GPG = False
|
||||||
|
|
||||||
class GnuPG(GnuPGInterface.GnuPG):
|
class GnuPG(GnuPGInterface.GnuPG):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
GnuPGInterface.GnuPG.__init__(self)
|
GnuPGInterface.GnuPG.__init__(self)
|
||||||
|
|
|
@ -2687,6 +2687,9 @@ class RosterWindow:
|
||||||
save_gpg_pass = gajim.config.get_per('accounts', account,
|
save_gpg_pass = gajim.config.get_per('accounts', account,
|
||||||
'savegpgpass')
|
'savegpgpass')
|
||||||
keyid = gajim.config.get_per('accounts', account, 'keyid')
|
keyid = gajim.config.get_per('accounts', account, 'keyid')
|
||||||
|
if keyid and not gajim.config.get('usegpg'):
|
||||||
|
#TODO: make this string translatable
|
||||||
|
dialog = dialogs.WarningDialog('GPG is not usable', _('You will be connected to %s without OpenPGP.') % account)
|
||||||
if keyid and gajim.connections[account].connected < 2 and \
|
if keyid and gajim.connections[account].connected < 2 and \
|
||||||
gajim.config.get('usegpg'):
|
gajim.config.get('usegpg'):
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue