~ubuntu-branches/ubuntu/wily/padre/wily

« back to all changes in this revision

Viewing changes to lib/Padre/Wx/Dialog/DebugOptions.pm

  • Committer: Package Import Robot
  • Author(s): Dominique Dumont, gregor herrmann, Salvatore Bonaccorso, Dominique Dumont
  • Date: 2013-05-06 13:12:27 UTC
  • mfrom: (1.3.6)
  • Revision ID: package-import@ubuntu.com-20130506131227-qykksq7ddz3lgp0v
Tags: 0.98+dfsg-1
[ gregor herrmann ]
* debian/control: update {versioned,alternative} (build) dependencies.
* debian/watch: update to ignore development releases.

[ Salvatore Bonaccorso ]
* Fix dependency on libwx-perl.
  Add versioned Build-Depends-Indep on libwx-perl (>= 1:0.9901) and add
  correct epoch to libwx-perl (>= 1:0.9901) Depends.
* Fix typo in longtitle in Debian menu entry.
  Thanks to Chris Leick and Bill Allombert for reporting (Closes: #684472)
* Change Vcs-Git to canonical URI (git://anonscm.debian.org)
* Change search.cpan.org based URIs to metacpan.org based URIs

[ Dominique Dumont ]
* Imported Upstream version 0.98+dfsg
* Removed skip test patch: problem's gone. The segfault happening in this
  test has been fixed in libdbi-perl 1.621.
* refreshed fix-spelling patch
* removed patch fix-double-line-in-outline (applied upstream)
* copyright:
  * updated years
  - removed unused licenses
* compat: bumped to 9
* control:
  - remove ryan from uploaders
  * refreshed dependencies
  * bumped standard-version
* debian/not-real-manual.list: refreshed file size for dummy manual page
* refreshed disable-tcp-server.patch
* added patch to fix mime_test

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package Padre::Wx::Dialog::DebugOptions;
 
2
 
 
3
use 5.008;
 
4
use strict;
 
5
use warnings;
 
6
use Padre::Search                ();
 
7
use Padre::Wx::FBP::DebugOptions ();
 
8
 
 
9
our $VERSION = '0.98';
 
10
our @ISA     = qw{
 
11
        Padre::Wx::FBP::DebugOptions
 
12
};
 
13
 
 
14
 
 
15
 
 
16
 
 
17
 
 
18
######################################################################
 
19
# Constructor
 
20
 
 
21
sub new {
 
22
        my $class = shift;
 
23
        my $self  = $class->SUPER::new(@_);
 
24
        $self->CenterOnParent;
 
25
        return $self;
 
26
}
 
27
 
 
28
 
 
29
 
 
30
 
 
31
 
 
32
######################################################################
 
33
# Event Handlers
 
34
 
 
35
######################################################################
 
36
# Event Handlers
 
37
 
 
38
sub browse_scripts {
 
39
        my $self    = shift;
 
40
        my $default = $self->find_script->GetValue;
 
41
        unless ($default) {
 
42
                $default = $self->config->default_projects_directory;
 
43
        }
 
44
 
 
45
        use File::Spec;
 
46
 
 
47
        my ( $volume, $directory, $file ) = File::Spec->splitpath( $default, -d $default );
 
48
 
 
49
        my $dialog = Wx::FileDialog->new(
 
50
                $self,
 
51
                Wx::gettext("Select Script to debug into"),
 
52
                File::Spec->catpath( $volume, $directory, '' )
 
53
        );
 
54
        my $result = $dialog->ShowModal;
 
55
        $dialog->Destroy;
 
56
 
 
57
        # Update the dialog
 
58
        unless ( $result == Wx::ID_CANCEL ) {
 
59
                $self->find_script->SetValue( $dialog->GetPath );
 
60
        }
 
61
 
 
62
        return;
 
63
}
 
64
 
 
65
sub browse_run_directory {
 
66
        my $self    = shift;
 
67
        my $default = $self->run_directory->GetValue;
 
68
        unless ($default) {
 
69
                $default = $self->config->default_run_directory;
 
70
        }
 
71
 
 
72
        use File::Spec;
 
73
 
 
74
        my ( $volume, $directory, $file ) = File::Spec->splitpath( $default, -d $default );
 
75
 
 
76
        my $dialog = Wx::DirDialog->new(
 
77
                $self,
 
78
                Wx::gettext("Select Directory to run script in"),
 
79
                File::Spec->catpath( $volume, $directory, '' )
 
80
        );
 
81
        my $result = $dialog->ShowModal;
 
82
        $dialog->Destroy;
 
83
 
 
84
        # Update the dialog
 
85
        unless ( $result == Wx::ID_CANCEL ) {
 
86
                $self->run_directory->SetValue( $dialog->GetPath );
 
87
        }
 
88
 
 
89
        return;
 
90
}
 
91
 
 
92
 
 
93
sub on_close {
 
94
        my $self  = shift;
 
95
        my $event = shift;
 
96
        $self->Hide;
 
97
        $self->main->editor_focus;
 
98
        $event->Skip(1);
 
99
}
 
100
 
 
101
1;
 
102
 
 
103
# Copyright 2008-2013 The Padre development team as listed in Padre.pm.
 
104
# LICENSE
 
105
# This program is free software; you can redistribute it and/or
 
106
# modify it under the same terms as Perl 5 itself.