summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@novell.com>2010-10-26 14:32:59 +0100
committerMichael Meeks <michael.meeks@novell.com>2010-10-26 14:32:59 +0100
commit7b48ec4c9d1d980d0a75aa69cb2a68bb6995327d (patch)
treec7724a24d8209b89f22ac417b1f44b7599f41fdf
parent2bf1bf5ce50468ab8e0b688bf1fa0ae5a16cbe91 (diff)
enable zenity only when DISPLAY is set
-rwxr-xr-xsolenv/bin/build.pl16
1 files changed, 11 insertions, 5 deletions
diff --git a/solenv/bin/build.pl b/solenv/bin/build.pl
index e8537dfeb..6af2bfda6 100755
--- a/solenv/bin/build.pl
+++ b/solenv/bin/build.pl
@@ -2153,36 +2153,42 @@ sub print_announce {
$module_announced{$Prj}++;
};
+sub zenity_enabled {
+ return 0 if (!defined $ENV{DISPLAY});
+ return 0 if ($ENV{ENABLE_ZENITY} ne "TRUE");
+ return 1;
+}
+
sub zenity_open {
- if ($ENV{ENABLE_ZENITY} eq "TRUE") {
+ if (zenity_enabled()) {
my $zenity_pid = open3($zenity_in, $zenity_out, $zenity_err,
"zenity --notification --listen");
};
};
sub zenity_close {
- if ($ENV{ENABLE_ZENITY} eq "TRUE") {
+ if (zenity_enabled()) {
sleep(1); # Give Zenity a chance to show the message.
kill 1, $zenity_pid;
};
};
sub zenity_icon {
- if ($ENV{ENABLE_ZENITY} eq "TRUE") {
+ if (zenity_enabled()) {
my $filename = shift;
print $zenity_in "icon: $filename\n";
};
};
sub zenity_tooltip {
- if ($ENV{ENABLE_ZENITY} eq "TRUE") {
+ if (zenity_enabled()) {
my $text = shift;
print $zenity_in "tooltip: LibreOffice Build: $text\n";
};
};
sub zenity_message {
- if ($ENV{ENABLE_ZENITY} eq "TRUE") {
+ if (zenity_enabled()) {
my $text = shift;
print $zenity_in "message: $text\n";
};