301
sub _run_params_panel {
302
my ( $self, $treebook ) = @_;
304
my $config = Padre->ide->config;
305
my $document = Padre::Current->document;
307
my $intrp_args_text = Wx::gettext(<<'END_TEXT');
309
include directory: -I<dir>
310
enable tainting checks: -T
311
enable many useful warnings: -w
312
enable all warnings: -W
313
disable all warnings: -X
316
# Default values stored in host configuration
317
my $defaults_table = [
318
[ [ 'Wx::StaticText', undef, Wx::gettext('Interpreter arguments:') ],
319
[ 'Wx::TextCtrl', 'run_interpreter_args_default', $config->run_interpreter_args_default ]
321
[ [ 'Wx::StaticText', undef, '' ],
322
[ 'Wx::StaticText', undef, $intrp_args_text ]
324
[ [ 'Wx::StaticText', undef, Wx::gettext('Script arguments:') ],
325
[ 'Wx::TextCtrl', 'run_script_args_default', $config->run_script_args_default ]
329
# Per document values (overwrite defaults) stored in history
330
my $doc_flag = 0; # value of 1 means that there is no document currently open
331
my $filename = Wx::gettext('Unsaved');
332
my $path = Wx::gettext('N/A');
338
# Trap exception if there is no document currently open
340
unless ( $document->is_new )
342
( $filename, $path ) = File::Basename::fileparse( Padre::Current->filename );
343
foreach my $arg ( keys %run_args ) {
344
my $type = "run_${arg}_args_${filename}";
345
$run_args{$arg} = Padre::DB::History->previous($type)
346
if Padre::DB::History->previous($type);
351
$filename = Wx::gettext('No Document');
355
my $currentdoc_table = [
356
[ [ 'Wx::StaticText', undef, Wx::gettext('Document name:') ],
357
[ 'Wx::TextCtrl', undef, $filename, Wx::wxTE_READONLY ]
359
[ [ 'Wx::StaticText', undef, Wx::gettext('Document location:') ],
360
[ 'Wx::TextCtrl', undef, $path, Wx::wxTE_READONLY ]
362
[ [ 'Wx::StaticText', undef, Wx::gettext('Interpreter arguments:') ],
363
[ 'Wx::TextCtrl', "run_interpreter_args_$filename", $run_args{interpreter} ]
365
[ [ 'Wx::StaticText', undef, '' ],
366
[ 'Wx::StaticText', undef, $intrp_args_text ]
368
[ [ 'Wx::StaticText', undef, Wx::gettext('Script arguments:') ],
369
[ 'Wx::TextCtrl', "run_script_args_$filename", $run_args{script} ]
373
my $panel = Wx::Panel->new(
376
Wx::wxDefaultPosition,
378
Wx::wxTAB_TRAVERSAL | Wx::wxVSCROLL | Wx::wxHSCROLL,
380
my $main_sizer = Wx::BoxSizer->new(Wx::wxVERTICAL);
382
my $notebook = Wx::Notebook->new($panel);
384
my $defaults_subpanel = $self->_new_panel($notebook);
385
$self->fill_panel_by_table( $defaults_subpanel, $defaults_table );
386
$notebook->AddPage( $defaults_subpanel, Wx::gettext('Default') );
388
my $currentdoc_subpanel = $self->_new_panel($notebook);
389
$self->fill_panel_by_table( $currentdoc_subpanel, $currentdoc_table ) unless $doc_flag;
391
$currentdoc_subpanel,
392
sprintf( Wx::gettext('Current Document: %s'), $filename )
395
$main_sizer->Add( $notebook, 1, Wx::wxGROW );
396
$panel->SetSizerAndFit($main_sizer);
297
402
my ( $self, $win, $main_startup, $editor_autoindent, $main_functions_order, $perldiag_locales ) = @_;
503
616
'main_output_ansi',
504
617
$data->{main_output_ansi} ? 1 : 0
620
'run_interpreter_args_default',
621
$data->{run_interpreter_args_default}
624
'run_script_args_default',
625
$data->{run_script_args_default}
628
# Quite like in _run_params_panel, trap exception if there
629
# is no document currently open
631
unless ( Padre::Current->document->is_new )
634
# These are a bit different as run_* variable name depends
635
# on current document's filename
636
foreach ( grep { /^run_/ && !/_default$/ } ( keys %$data ) ) {
637
next if Padre::DB::History->previous($_) eq $data->{$_};
638
Padre::DB::History->create(
507
646
# The slightly different one
508
647
my $editor_currentline_color = $data->{editor_currentline_color};