Padre-Plugin-SVN

 view release on metacpan or  search on metacpan

lib/Padre/Plugin/SVN.pm  view on Meta::CPAN

		}
	}
}


sub svn_blame {
	my ($self) = @_;
	my $filename = _get_current_filename();
	if ($filename) {
		my $main = Padre::Current->main;
		$self->{_busyCursor} = Wx::BusyCursor->new();
		my $file = svn_file($filename);
		$file->blame();
		
		#my $blame = join( "\n", @{ $file->stdout } );
		my @blame = @{ $file->stdout };
		require Padre::Plugin::SVN::Wx::SVNDialog;
		my $dialog = Padre::Plugin::SVN::Wx::SVNDialog->new( $main, $filename, \@blame, 'Blame' );
		$self->{_busyCursor} = undef;
		$dialog->Show(1);
		return 1;
	}

	return;

}

sub svn_status {
	my ( $self, $path ) = @_;

lib/Padre/Plugin/SVN.pm  view on Meta::CPAN

	}
	return;
}


sub svn_log {
	my ( $self, $path ) = @_;
	my $main = Padre->ide->wx->main;

	my $file = svn_file($path);
	$self->{_busyCursor} = Wx::BusyCursor->new();
	my $out = join( "\n", @{ $file->log() } );
	$self->{_busyCursor} = undef;

	#$main->message( $out, "$path" );
	require Padre::Plugin::SVN::Wx::SVNDialog;
	my $log = Padre::Plugin::SVN::Wx::SVNDialog->new( $main, $path, $out, 'Log' );
	$log->Show(1);


}

sub svn_log_of_file {

lib/Padre/Plugin/SVN.pm  view on Meta::CPAN

	# check Cancel!!!!
	return if( $dialog->{cancelled});
	
	my $message = $dialog->get_data;

	
	

	# whoops!! This isn't going to work "Commit message" is always set in the text control.
	if ($message && $message ne 'Commit Message') { # "Commit Message" come from SVNDialog
		$self->{_busyCursor} = Wx::BusyCursor->new();

		my $revNo = $file->commit($message);

		$self->{_busyCursor} = undef;

		my @commit = @{ $file->stdout };
		my @err    = @{ $file->stderr };
		if (@err) {
			$main->error( join( "\n", @err ), Wx::gettext('Error - SVN Commit') );
		} else {
			$main->info( join( "\n", @commit ), "Committed Revision number $revNo." );
		}

	}
	else {
	    my $ret = Wx::MessageBox( Wx::gettext(
				  'You really should commit with a useful message'
				  .  "\n\nDo you really want to commit with out a message?"
			    ),
				    Wx::gettext("Commit warning"),
				    Wx::wxYES_NO | Wx::wxCENTRE,
				    $main,
			    );
	    if( $ret == Wx::wxYES ) {
		$self->{_busyCursor} = Wx::BusyCursor->new();

		my $revNo = $file->commit($message);

		$self->{_busyCursor} = undef;

		my @commit = @{ $file->stdout };
		my @err    = @{ $file->stderr };
		if (@err) {
			$main->error( join( "\n", @err ), 'Error - SVN Commit' );
		} else {
			$main->info( join( "\n", @commit ), "Committed Revision number $revNo." );
		}		    
	    }
	    else {

lib/Padre/Plugin/SVN/Wx/SVNDialog.pm  view on Meta::CPAN


	$self->SetSizer($vbox);

}


sub build_blame_dialog {
	
	my ( $self, $file, $log ) = @_;
	
	#$self->{_busyCursor} = Wx::BusyCursor->new();
	
	my $vbox = Wx::BoxSizer->new(Wx::wxVERTICAL);

	require Padre::Plugin::SVN::Wx::BlameTree;
	$self->{blame} = Padre::Plugin::SVN::Wx::BlameTree->new($self);
	$self->{blame}->populate($log);
	$vbox->Add( $self->{blame}, 0, Wx::wxEXPAND );

	#print "file: $file\n";
	#print "Log: $log\n";

lib/Padre/Plugin/SVN/Wx/SVNDialog.pm  view on Meta::CPAN

	$btnBox->Add( $btnOK, 1, Wx::wxALIGN_BOTTOM | Wx::wxALIGN_RIGHT );


	$pnlButtons->SetSizer($btnBox);

	#$btnBox->Add( $pnlButtons, 0, Wx::wxALIGN_BOTTOM | Wx::wxALIGN_RIGHT | Wx::wxEXPAND);
	$vbox->Add( $pnlButtons, 0, Wx::wxALIGN_BOTTOM | Wx::wxALIGN_RIGHT );


	$self->SetSizer($vbox);
	#$self->{_busyCursor} = undef;
}

sub collapse_clicked {
	my( $self ) = @_;
	$self->{_busyCursor} = Wx::BusyCursor->new();
	$self->{blame}->CollapseAll();
	$self->{_busyCursor} = undef;
}
sub expand_clicked {
	my ($self) = @_;
	$self->{_busyCursor} = Wx::BusyCursor->new();
	$self->{blame}->ExpandAll();
	$self->{_busyCursor} = undef;
}

sub ok_clicked {
	my ($self) = @_;

	#print "OK Clicked\n";
	my $txt;
	if ( $self->{txtctrl} ) {

		#print "have to return data: " . $self->{txtctrl}->GetValue;



( run in 0.240 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )