~ubuntu-branches/debian/sid/padre/sid

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Damyan Ivanov, gregor herrmann, Damyan Ivanov
  • Date: 2009-11-18 17:48:27 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20091118174827-srz62scl23gdl88v
Tags: 0.50.ds1-1
[ gregor herrmann ]
* debian/control: change dependency on "libclass-xsaccessor-array-perl
  (>= 1.02)" to "libclass-xsaccessor-perl (>= 1.05-2) |
  libclass-xsaccessor-array-perl (>= 1.02)".

[ Damyan Ivanov ]
* New upstream release
  + copyright: add a new translator
    - describe share/doc/perlopref copyright and licensing
  + update patches:
    - refresh disable-tcp-server.patch
    - drop fix-man-whatis.patch and fix-pod.patch (merged upstream)
    - drop fix-helpprovider-with-no-perlopref.patch: no longer necessary
* repack.sh: in 0.49 padre.exe moved from script/ to bin/
  + perlopref is now properly licensed
* add perl (>= 5.10.1) as a preferred alternative to versioned (build)
  dependencies on libtest-simple-perl and libpod-simple-perl
* update debian/not-real-manual.list for 0.50 (one file added, two files
  changed in size)
* rules: remove cruft from padre.deb
  + license etc from perlopref directory (already present in d/copyright)
  + remove .po files from the .deb (there are .mo files installed)

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
use Padre::Wx::Dialog::Preferences::Editor ();
11
11
use Padre::MimeTypes                       ();
12
12
 
13
 
our $VERSION = '0.48';
 
13
our $VERSION = '0.50';
14
14
our @ISA     = 'Padre::Wx::Dialog';
15
15
 
 
16
our %PANELS = ( 'Padre::Wx::Dialog::Preferences::File' => 'Local/Remote file access' );
 
17
 
16
18
=pod
17
19
 
18
20
=head1 NAME
219
221
                        ],
220
222
                        []
221
223
                ],
 
224
                [   [   'Wx::CheckBox',
 
225
                                'save_autoclean',
 
226
                                ( $config->save_autoclean ? 1 : 0 ),
 
227
                                Wx::gettext("Clean up file content on saving (for supported document types)")
 
228
                        ],
 
229
                        []
 
230
                ],
222
231
                [   [   'Wx::CheckBox', 'editor_fold_pod', ( $config->editor_fold_pod ? 1 : 0 ),
223
232
                                Wx::gettext('Auto-fold POD markup when code folding enabled')
224
233
                        ],
285
294
                        ],
286
295
                        []
287
296
                ],
 
297
                [   [   'Wx::CheckBox',
 
298
                                'window_list_shorten_path',
 
299
                                ( $config->window_list_shorten_path ? 1 : 0 ),
 
300
                                Wx::gettext("Shorten the common path in window list?")
 
301
                        ],
 
302
                        []
 
303
                ],
288
304
        ];
289
305
 
290
306
        my $panel = $self->_new_panel($treebook);
355
371
                        ],
356
372
                        []
357
373
                ],
 
374
                [   [   'Wx::CheckBox', 'info_on_statusbar', ( $config->info_on_statusbar ? 1 : 0 ),
 
375
                                Wx::gettext('Show low-priority info messages on statusbar (not in a popup)')
 
376
                        ],
 
377
                        []
 
378
                ],
358
379
                [   [   'Wx::CheckBox', 'editor_right_margin_enable', ( $config->editor_right_margin_enable ? 1 : 0 ),
359
380
                                Wx::gettext('Show right margin at column:')
360
381
                        ],
481
502
    return 0;
482
503
  }
483
504
}
484
 
__END__
485
505
END_TEXT
486
506
 
 
507
        # Including this in the << block would kill the function parsing
 
508
        $dummy_text .= "__END__\n";
 
509
 
487
510
        $editor->SetText($dummy_text);
488
511
        $editor->SetWrapMode(Wx::wxSTC_WRAP_WORD);
489
512
        $editor->padre_setup;
750
773
        #$tb->AddPage( $plugin_manager, Wx::gettext('Plugin Manager') );
751
774
        #$self->_add_plugins($tb);
752
775
 
 
776
        # Add panels
 
777
        # The panels are ahown in alphabetical order based on the Wx::gettext results
 
778
 
 
779
        # TODO: Convert the internal panels to use this
 
780
 
 
781
        for my $module ( sort { Wx::gettext( $PANELS{$a} ) cmp Wx::gettext( $PANELS{$b} ); } ( keys(%PANELS) ) ) {
 
782
 
 
783
                # A plugin or panel should not crash Padre on error
 
784
                eval {
 
785
                        eval 'require ' . $module . ';';
 
786
                        warn $@ if $@;
 
787
                        my $preferences_page = $module->new();
 
788
                        my $panel = $preferences_page->panel( $tb, $self );
 
789
                        $tb->AddPage( $panel, Wx::gettext( $PANELS{$module} ) );
 
790
                };
 
791
                next unless $@;
 
792
                warn 'Error while adding preference panel ' . $module . ': ' . $@;
 
793
        }
 
794
 
753
795
        $dialog_sizer->Add( $tb, 10, Wx::wxGROW | Wx::wxALL, 5 );
754
796
 
755
797
        $dialog_sizer->Add(
874
916
                \@perldiag_locales,
875
917
                \@default_line_ending_localized,
876
918
        );
 
919
        $self->{dialog}->Centre;
877
920
        my $ret = $self->{dialog}->ShowModal;
878
921
 
879
922
        if ( $ret eq Wx::wxID_CANCEL ) {
921
964
                $data->{editor_wordwrap} ? 1 : 0
922
965
        );
923
966
        $config->set(
 
967
                'save_autoclean',
 
968
                $data->{save_autoclean} ? 1 : 0
 
969
        );
 
970
        $config->set(
924
971
                'editor_fold_pod',
925
972
                $data->{editor_fold_pod} ? 1 : 0
926
973
        );
953
1000
                $data->{main_output_ansi} ? 1 : 0
954
1001
        );
955
1002
        $config->set(
 
1003
                'info_on_statusbar',
 
1004
                $data->{info_on_statusbar} ? 1 : 0
 
1005
        );
 
1006
        $config->set(
956
1007
                'window_title',
957
1008
                $data->{window_title}
958
1009
        );
1031
1082
                'autocomplete_method',
1032
1083
                $data->{autocomplete_method} ? 1 : 0
1033
1084
        );
 
1085
        $config->set(
 
1086
                'window_list_shorten_path',
 
1087
                $data->{window_list_shorten_path} ? 1 : 0
 
1088
        );
1034
1089
 
1035
1090
 
1036
1091
        # Don't save options which are not shown as this may result in
1037
1092
        # clearing them:
1038
1093
        if ( $config->func_config ) {
1039
1094
 
1040
 
                for (@Func_List) {
 
1095
                for my $func (@Func_List) {
1041
1096
                        $config->set(
1042
 
                                'func_' . $_->[0],
1043
 
                                $data->{ 'func_' . $_->[0] } ? 1 : 0
 
1097
                                'func_' . $func->[0],
 
1098
                                $data->{ 'func_' . $func->[0] } ? 1 : 0
1044
1099
                        );
1045
1100
                }
1046
1101
 
1075
1130
                $editor_currentline_color
1076
1131
        );
1077
1132
 
 
1133
        for my $module ( keys(%PANELS) ) {
 
1134
                my $preferences_page = $module->new();
 
1135
                $preferences_page->save($data);
 
1136
        }
 
1137
 
1078
1138
        $config->write;
1079
1139
        return 1;
1080
1140
}