summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Newman <MikeGTN@src.gnome.org>2003-05-23 16:57:16 +0000
committerMike Newman <MikeGTN@src.gnome.org>2003-05-23 16:57:16 +0000
commit1930a4a763d2136ea41fbdb6daa4249853b950d2 (patch)
tree62d6fbfaa0fbc16683b48bf32d0503f0b08d799f /src
parentMore work on wrapper - fix --textbox to actually load the file (diff)
downloadzenity-1930a4a763d2136ea41fbdb6daa4249853b950d2.tar.gz
zenity-1930a4a763d2136ea41fbdb6daa4249853b950d2.tar.bz2
zenity-1930a4a763d2136ea41fbdb6daa4249853b950d2.zip
Hmm, forgot some other bits - support --separate-output, ensure list rows
are returned.
Diffstat (limited to 'src')
-rw-r--r--src/gdialog29
1 files changed, 25 insertions, 4 deletions
diff --git a/src/gdialog b/src/gdialog
index 63e0e1d4..649d3f3c 100644
--- a/src/gdialog
+++ b/src/gdialog
@@ -18,6 +18,7 @@ my $command = "zenity "; # the command line we build up to execute
my $element = ""; # current bit of command line
my $argn = 0; # counter for walking args
my $args = $#ARGV + 1; # total number of command line arguments
+my $separator = 0; # set if --separate-output is in use
# this just loads the current arg into $element
@@ -31,6 +32,10 @@ ARG: while ($argn < $args) {
get_arg;
+
+ # Section 1 : Args which gdialog expects BEFORE box options
+ # --clear, --backtitle have no obvious effect - ignored
+
if ($element eq "--title") {
# --title argument is almost analogous in gdialog and
@@ -39,12 +44,23 @@ ARG: while ($argn < $args) {
$argn++;
get_arg;
$command .= "--title=\"$element\" ";
- $argn++;
# keep processing args
-
+ $argn++;
+ next ARG;
+ }
+
+ if ($element eq "--separate-output") {
+
+ # set the flag to pring list output line by line
+ $separator = 1;
+
+ # keep processing args
+ $argn++;
next ARG;
}
+
+ # Section 2 : Box Options and subsequent args
if ($element eq "--msgbox" || $element eq "--infobox") {
@@ -113,7 +129,12 @@ ARG: while ($argn < $args) {
# and the 'text' arg as a second column header
$command .= "--list $list --column='' --column $element ";
-
+
+ # should output be line by line?
+ if ($separator) {
+ $command .= " --separator='\n' ";
+ }
+
# Skip to the first 'item' arg of the list content
# bypassing height, width and list-height
# from here args run [tag] [item] [status] ...
@@ -184,5 +205,5 @@ ARG: while ($argn < $args) {
}
# execute the constructed zenity command line
-
+$command .= " 2>&1";
system($command);
bgstack15