From bb60bd49f50cdbe83ef1db67adcc4d3bc5bb8262 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Thu, 21 May 2009 19:44:32 +0200 Subject: [PATCH] disable status icon on win32 --- doc/C/jhbuild.xml | 13 ++++++++++++- jhbuild/config.py | 2 +- jhbuild/defaults.jhbuildrc | 12 +++++++++--- jhbuild/frontends/autobuild.py | 2 +- jhbuild/frontends/terminal.py | 2 +- jhbuild/utils/trayicon.py | 2 ++ 6 files changed, 26 insertions(+), 7 deletions(-) diff --git a/doc/C/jhbuild.xml b/doc/C/jhbuild.xml index 650229f8..1b64d264 100644 --- a/doc/C/jhbuild.xml +++ b/doc/C/jhbuild.xml @@ -1587,7 +1587,8 @@ libgnomecanvas is missing branch definition for gnome-2-20 A boolean value specifying whether to emit notifications using the notification daemon. If set to True, notifications are not emitted. - Defaults to False. + Defaults to False, except on Win32 + where it defaults to True. @@ -1602,6 +1603,16 @@ libgnomecanvas is missing branch definition for gnome-2-20 + notrayicon + + A boolean value specifying whether to show an icon + in the system tray using Zenity. If set to + True, notifications are not emitted. + Defaults to False except from on Win32, + where it defaults to True. + + + noxvfb A boolean value which, if set to diff --git a/jhbuild/config.py b/jhbuild/config.py index e63188ff..8363346a 100644 --- a/jhbuild/config.py +++ b/jhbuild/config.py @@ -40,7 +40,7 @@ _known_keys = [ 'moduleset', 'modules', 'skip', 'tags', 'prefix', 'alwaysautogen', 'nobuild', 'makeclean', 'makecheck', 'module_makecheck', 'use_lib64', 'tinderbox_outputdir', 'sticky_date', 'tarballdir', 'pretty_print', 'svn_program', 'makedist', - 'makedistcheck', 'nonotify', 'cvs_program', + 'makedistcheck', 'nonotify', 'notrayicon', 'cvs_program', 'checkout_mode', 'copy_dir', 'module_checkout_mode', 'build_policy', 'trycheckout', 'min_time', 'nopoison', 'forcecheck', 'makecheck_advisory', diff --git a/jhbuild/defaults.jhbuildrc b/jhbuild/defaults.jhbuildrc index 35bfe270..46a407f8 100644 --- a/jhbuild/defaults.jhbuildrc +++ b/jhbuild/defaults.jhbuildrc @@ -2,7 +2,7 @@ # This file holds the default values for the ~/.jhbuildrc file. # Do not copy this to ~/.jhbuildrc -import os +import os, sys if 'GTK_PATH' in os.environ.keys(): del os.environ['GTK_PATH'] @@ -131,8 +131,14 @@ cvs_program = 'cvs' mirror_policy = "" module_mirror_policy = {} -# whether not to emit notifications through the notification daemon -nonotify = False +if sys.platform.startswith('win'): + notrayicon = True + nonotify = True +else: + # Show a tray icon using zenity + notrayicon = False + # whether not to emit notifications through the notification daemon + nonotify = False # whether to run tests in real X and not in Xvfb noxvfb = False diff --git a/jhbuild/frontends/autobuild.py b/jhbuild/frontends/autobuild.py index 968a26f2..42386c3d 100644 --- a/jhbuild/frontends/autobuild.py +++ b/jhbuild/frontends/autobuild.py @@ -98,7 +98,7 @@ class AutobuildBuildScript(buildscript.BuildScript, TerminalBuildScript): os.environ[k] = 'C' if self.verbose: - self.trayicon = trayicon.TrayIcon() + self.trayicon = trayicon.TrayIcon(config) def message(self, msg, module_num=-1, skipfp = False): '''Display a message to the user''' diff --git a/jhbuild/frontends/terminal.py b/jhbuild/frontends/terminal.py index af07e718..c6e62e42 100644 --- a/jhbuild/frontends/terminal.py +++ b/jhbuild/frontends/terminal.py @@ -82,7 +82,7 @@ class TerminalBuildScript(buildscript.BuildScript): def __init__(self, config, module_list): buildscript.BuildScript.__init__(self, config, module_list) - self.trayicon = trayicon.TrayIcon() + self.trayicon = trayicon.TrayIcon(config) self.notify = notify.Notify(config) def message(self, msg, module_num=-1): diff --git a/jhbuild/utils/trayicon.py b/jhbuild/utils/trayicon.py index 349a2632..9afbba6d 100644 --- a/jhbuild/utils/trayicon.py +++ b/jhbuild/utils/trayicon.py @@ -26,6 +26,8 @@ class TrayIcon: proc = None def __init__(self): + if config and config.notrayicon: + return if not os.environ.get('DISPLAY'): return try: -- 2.11.4.GIT