Padre-Plugin-Moose

 view release on metacpan or  search on metacpan

lib/Padre/Plugin/Moose/Assistant.pm  view on Meta::CPAN

	}

	return;
}

sub on_preferences_button_clicked {
	my $self = shift;

	# Create a new preferences dialog
	require Padre::Plugin::Moose::Preferences;
	my $prefs = Padre::Plugin::Moose::Preferences->new($self);

	# Update plugin variables from plugin's configuration hash
	my $plugin = $self->{plugin};
	my $config = $plugin->{config};
	$prefs->{generated_code_combo}->SetValue( $config->{type} );
	$prefs->{comments_checkbox}->SetValue( $config->{comments} );
	$prefs->{sample_code_checkbox}->SetValue( $config->{sample_code} );
	$prefs->{namespace_autoclean_checkbox}->SetValue( $config->{namespace_autoclean} );

	# Preferences: go modal!
	if ( $prefs->ShowModal == Wx::wxID_OK ) {

		# Update configuration when the user hits the OK button
		my $type = $prefs->{generated_code_combo}->GetValue;
		$config->{type}                = $type;
		$config->{comments}            = $prefs->{comments_checkbox}->IsChecked;
		$config->{sample_code}         = $prefs->{sample_code_checkbox}->IsChecked;
		$config->{namespace_autoclean} = $prefs->{namespace_autoclean_checkbox}->IsChecked;
		$plugin->config_write($config);

		# Update tree and preview editor
		$self->show_code_in_preview(1);

		# Add moose et all keywords highlight to preview editor
		require Padre::Plugin::Moose::Util;
		Padre::Plugin::Moose::Util::add_moose_keywords_highlighting( $self->{preview}->{Document}, $type );

		# Add moose et all keywords highlight to current editor



( run in 1.289 second using v1.01-cache-2.11-cpan-8f98c5d2c55 )