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

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Damyan Ivanov
  • Date: 2009-08-12 14:44:55 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20090812144455-yvk90oa92khfcnls
Tags: 0.42-1
* New Upstream Version
  + add explicit dependency on libtest-simple-perl (>= 0.88)
  + rules: use dh --with quilt (and bump quilt build-dependency to 0.46-7)
  + rules: no need to re-generate .mo files from .po. Upstream does it now
  + copyright: describe share/icons/padre/16x16/logo.png
    - describe share/icons/padre/16x16/toggle-comments.png
    - Padre license is the same as Perl (i.e. not Perl 5)
    - update list of copright holders
    - also list translators
  + drop libtest-most-perl from build-dependencies
  + add liblocale-msgfmt-perl to build-dependencies
  + add libcapture-tiny-perl to (build-)dependencies
  + add libfile-remove-perl (>= 1.42) to (build-)dependencies
  + drop libmodule-inspector-perl from (build-)dependencies
  + add libppix-editortools-perl to (build-)dependencies
  + add libparse-exuberantctags-perl to (build-)dependencies
  + patches:
    - drop lower-wx-requirement-to-2.8.7.patch and replace it with
      SKIP_WXWIDGETS_VERSION_CHECK=1 when configuring
      adjust README.debian accordingly
    - refresh disable-tcp-server.patch
    - drop don't-require-new-file-path.patch (applied upstream)
    - rework fix-pod2-errors.patch (new release, new errors :))
* add fix-perl-interpreter-path.patch fixing the path to the perl interpreter
  in three examples (thanks lintian)
* add more lintian overrides about script-not-executable for scripts that are
  treated as examples/templates
* add fix-whatis.patch fixing the whatis entry of Padre::Wx
* add menu and .desktop file

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
use Padre::Wx       ();
9
9
use Padre::Wx::Icon ();
10
10
 
11
 
our $VERSION = '0.36';
 
11
our $VERSION = '0.42';
12
12
our @ISA     = 'Wx::Dialog';
13
13
 
14
14
use Class::XSAccessor accessors => {
15
 
        _action       => '_action',          # action of default button
16
 
        _button       => '_button',          # general-purpose button
17
 
        _butprefs     => '_butprefs',        # preferences button
18
 
        _currow       => '_currow',          # current list row number
19
 
        _curplugin    => '_curplugin',       # current plugin selected
20
 
        _hbox         => '_hbox',            # the window hbox sizer
21
 
        _imagelist    => '_imagelist',       # image list for the listctrl
22
 
        _label        => '_label',           # label at top of right pane
23
 
        _list         => '_list',            # list on the left of the pane
24
 
        _manager      => '_manager',         # ref to plugin manager
25
 
        _plugin_names => '_plugin_names',    # mapping of short/full plugin names
26
 
        _sortcolumn   => '_sortcolumn',      # column used for list sorting
27
 
        _sortreverse  => '_sortreverse',     # list sorting is reversed
28
 
        _whtml        => '_whtml',           # html space for plugin doc
 
15
        _action       => '_action',       # action of default button
 
16
        _button       => '_button',       # general-purpose button
 
17
        _butprefs     => '_butprefs',     # preferences button
 
18
        _currow       => '_currow',       # current list row number
 
19
        _curplugin    => '_curplugin',    # current plugin selected
 
20
        _hbox         => '_hbox',         # the window hbox sizer
 
21
        _imagelist    => '_imagelist',    # image list for the listctrl
 
22
        _label        => '_label',        # label at top of right pane
 
23
        _list         => '_list',         # list on the left of the pane
 
24
        _manager      => '_manager',      # ref to plugin manager
 
25
        _plugin_names => '_plugin_names', # mapping of short/full plugin names
 
26
        _sortcolumn   => '_sortcolumn',   # column used for list sorting
 
27
        _sortreverse  => '_sortreverse',  # list sorting is reversed
 
28
        _whtml        => '_whtml',        # html space for plugin doc
29
29
};
30
30
 
31
31
# -- constructor
42
42
                Wx::wxDefaultSize,
43
43
                Wx::wxDEFAULT_FRAME_STYLE,
44
44
        );
45
 
        $self->SetIcon( Wx::GetWxPerlIcon() );
 
45
 
 
46
        $self->SetIcon(Padre::Wx::Icon::PADRE);
46
47
        $self->_sortcolumn(0);
47
48
        $self->_sortreverse(0);
48
49
 
157
158
        my $fullname = $event->GetLabel;
158
159
        my $name     = $self->_plugin_names->{$fullname};
159
160
        my $plugin   = $self->_manager->plugins->{$name};
160
 
        $self->_curplugin($plugin);            # storing selected plugin
161
 
        $self->_currow( $event->GetIndex );    # storing selected row
 
161
        $self->_curplugin($plugin);         # storing selected plugin
 
162
        $self->_currow( $event->GetIndex ); # storing selected row
162
163
 
163
164
        # updating plugin name in right pane
164
165
        $self->_label->SetLabel( $plugin->plugin_name );
169
170
        my $class   = $plugin->class;
170
171
        my $doc     = $browser->resolve($class);
171
172
        my $output  = eval { $browser->browse($doc) };
172
 
        my $html
173
 
                = $@
 
173
        my $html =
 
174
                $@
174
175
                ? sprintf( Wx::gettext("Error loading pod for class '%s': %s"), $class, $@ )
175
176
                : $output->body;
176
177
        $self->_whtml->SetPage($html);
389
390
        # plugin status
390
391
        my $i = 0;
391
392
        foreach my $name (qw{ enabled disabled error crashed incompatible }) {
392
 
                my $icon = Padre::Wx::Icon::find("status/padre-plugin-$name");
393
 
                $imglist->Add($icon);
 
393
                $imglist->Add( Padre::Wx::Icon::find("status/padre-plugin-$name") );
394
394
                $icon{$name} = ++$i;
395
395
        }
396
396
 
440
440
        $list->SetColumnWidth( $_, Wx::wxLIST_AUTOSIZE ) for 0 .. 2;
441
441
 
442
442
        # making sure the list can show all columns
443
 
        my $width = 15;    # taking vertical scrollbar into account
 
443
        my $width = 15; # taking vertical scrollbar into account
444
444
        $width += $list->GetColumnWidth($_) for 0 .. 2;
445
445
        $list->SetMinSize( [ $width, -1 ] );
446
446
}