From 079b5346fe9c84649bcf3722a1a832fa32224de8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Fri, 30 Dec 2016 22:44:15 +0100 Subject: [PATCH] Set application name in init Remove unnecessary error catching - on missing gi libs we fail earlier - 'could not open display' is good enough --- src/application.py | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/application.py b/src/application.py index cad9b93ad..9b3cb17c7 100644 --- a/src/application.py +++ b/src/application.py @@ -70,6 +70,9 @@ class GajimApplication(Gtk.Application): self.profile_separation = False self.interface = None + GLib.set_prgname('gajim') + GLib.set_application_name('Gajim') + def do_startup(self): Gtk.Application.do_startup(self) @@ -123,19 +126,6 @@ class GajimApplication(Gtk.Application): # libintl.bindtextdomain('gajim_plugins', plugins_locale_dir) # libintl.bind_textdomain_codeset('gajim_plugins', 'UTF-8') - # PyGTK2.10+ only throws a warning - warnings.filterwarnings('error', module='Gtk') - try: - from gi.repository import GObject - GObject.set_prgname('gajim') - except Warning as msg2: - if str(msg2) == 'could not open display': - print(_('Gajim needs X server to run. Quiting...'), file=sys.stderr) - else: - print(_('importing PyGTK failed: %s') % str(msg2), file=sys.stderr) - sys.exit() - warnings.resetwarnings() - if os.name == 'nt': warnings.filterwarnings(action='ignore')