~ubuntu-branches/ubuntu/wily/libui-dialog-perl/wily

« back to all changes in this revision

Viewing changes to lib/UI/Dialog/Backend/Zenity.pm

  • Committer: Package Import Robot
  • Author(s): Alejandro Garrido Mota
  • Date: 2013-08-10 17:03:03 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20130810170303-z23sxbboezqbjcas
Tags: 1.09-1
* New upstream release. 
* Add watch file.
* d/control:
  - Update Standards-Version to 3.9.4
  - Add Vcs-Git and Vcs-Browser.  
* Add source-format 3.0.
* d/copyright:
  - Update to copyright-format 1.0.
  - Push copyright years.
* Update d/rules to dh.
* Remove docs file.
* Add d/libui-dialog-perl.examples file
* Add FixPod2manErrors.diff and FixSpellingAndManDescription.diff patches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
package UI::Dialog::Backend::Zenity;
2
2
###############################################################################
3
 
#  Copyright (C) 2004  Kevin C. Krinke <kckrinke@opendoorsoftware.com>
 
3
#  Copyright (C) 2013  Kevin C. Krinke <kevin@krinke.ca>
4
4
#
5
5
#  This library is free software; you can redistribute it and/or
6
6
#  modify it under the terms of the GNU Lesser General Public
26
26
BEGIN {
27
27
    use vars qw( $VERSION @ISA );
28
28
    @ISA = qw( UI::Dialog::Backend );
29
 
    $VERSION = '1.08';
 
29
    $VERSION = '1.09';
30
30
}
31
31
 
32
32
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
364
364
 
365
365
    my $command = $self->_mk_cmnd(" --list",$args);
366
366
    $command .= ($args->{'checklist'}) ? ' --checklist' : ($args->{'radiolist'}) ? ' --radiolist' : "";
367
 
    $command .= ' --separator "\n"';
 
367
    $command .= ' --separator $\'\n\'';
368
368
    #: not quite sure how to implement the editability...
369
369
    #    $command .= ' --editable' unless not $args->{'editable'};
370
370
    #: --text is not implemented for list widgets, yet...
466
466
}
467
467
 
468
468
#:+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
469
#: directory select
 
470
sub dselect {
 
471
    my $self = shift();
 
472
    my $caller = (caller(1))[3] || 'main';
 
473
    $caller = ($caller =~ /^UI\:\:Dialog\:\:Backend\:\:/) ? ((caller(2))[3]||'main') : $caller;
 
474
    if ($_[0] && $_[0] eq 'caller') { shift(); $caller = shift(); }
 
475
    my $args = $self->_pre($caller,@_);
 
476
 
 
477
    $args->{'path'} = (-d $args->{'path'}) ? $args->{'path'}."/" : $args->{'path'};
 
478
    $args->{'path'} =~ s!/+!/!g;
 
479
 
 
480
    my $command = $self->_mk_cmnd(" --file-selection --directory",$args);
 
481
    $command .= ' --filename "' . ($args->{'path'}||abs_path()) . '"';
 
482
 
 
483
    $self->_debug("fselect: ".$args->{'path'});
 
484
    my ($rv,$file) = $self->command_string($command);
 
485
    $self->rv($rv||'null');
 
486
    $self->ra('null');
 
487
    $self->rs('null');
 
488
    my $this_rv;
 
489
    if ($rv && $rv >= 1) {
 
490
                $this_rv = 0;
 
491
    } else {
 
492
                $self->ra($file);
 
493
                $self->rs($file);
 
494
                $this_rv = $file;
 
495
    }
 
496
    $self->_post($args);
 
497
    return($this_rv);
 
498
}
 
499
 
 
500
#:+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
469
501
#: calendar
470
502
sub calendar {
471
503
    my $self = shift();