[jhbuild] disable status icon on win32



commit bb60bd49f50cdbe83ef1db67adcc4d3bc5bb8262
Author: Frédéric Péters <fpeters 0d be>
Date:   Thu May 21 19:44:32 2009 +0200

    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 650229f..1b64d26 100644
--- a/doc/C/jhbuild.xml
+++ b/doc/C/jhbuild.xml
@@ -1587,7 +1587,8 @@ libgnomecanvas is missing branch definition for gnome-2-20
 	    <simpara>A boolean value specifying whether to emit
 	    notifications using the notification daemon.  If set to
 	    <constant>True</constant>, notifications are not emitted.
-	    Defaults to <constant>False</constant>.</simpara>
+	    Defaults to <constant>False</constant>, except on Win32
+		where it defaults to <constant>True</constant>.</simpara>
 	  </listitem>
 	</varlistentry>
 	<varlistentry>
@@ -1602,6 +1603,16 @@ libgnomecanvas is missing branch definition for gnome-2-20
 	  </listitem>
 	</varlistentry>
 	<varlistentry>
+	  <term id="cfg-notrayicon"><varname>notrayicon</varname></term>
+	  <listitem>
+	    <simpara>A boolean value specifying whether to show an icon
+	    in the system tray using Zenity. If set to
+	    <constant>True</constant>, notifications are not emitted.
+	    Defaults to <constant>False</constant> except from on Win32,
+		where it defaults to <constant>True</constant>.</simpara>
+	  </listitem>
+	</varlistentry>
+	<varlistentry>
 	  <term id="cfg-noxvfb"><varname>noxvfb</varname></term>
 	  <listitem>
 	    <simpara>A boolean value which, if set to
diff --git a/jhbuild/config.py b/jhbuild/config.py
index e63188f..8363346 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 35bfe27..46a407f 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 968a26f..42386c3 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 af07e71..c6e62e4 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 349a263..9afbba6 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:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]