Changeset 10841

Show
Ignore:
Timestamp:
02/19/10 20:10:02 (6 months ago)
Author:
waxhead
Message:

Changes for blame

Location:
trunk/Padre-Plugin-SVN/lib/Padre/Plugin
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/Padre-Plugin-SVN/lib/Padre/Plugin/SVN.pm

    r10676 r10841  
    245245                $file->blame(); 
    246246                $self->{_busyCursor} = undef; 
    247                 my $blame = join( "\n", @{ $file->stdout } ); 
     247                #my $blame = join( "\n", @{ $file->stdout } ); 
     248                my @blame = @{ $file->stdout }; 
    248249                require Padre::Plugin::SVN::Wx::SVNDialog; 
    249                 my $dialog = Padre::Plugin::SVN::Wx::SVNDialog->new( $main, $filename, $blame, 'Blame' ); 
     250                my $dialog = Padre::Plugin::SVN::Wx::SVNDialog->new( $main, $filename, \@blame, 'Blame' ); 
    250251                $dialog->Show(1); 
    251252                return 1; 
  • trunk/Padre-Plugin-SVN/lib/Padre/Plugin/SVN/Wx/SVNDialog.pm

    r10014 r10841  
    2929        ); 
    3030        $self->SetIcon(Padre::Wx::Icon::PADRE); 
    31         $self->build_dialog( $filePath, $log, $getData ); 
     31         
     32        if( lc($type) eq 'blame' ) { 
     33                $self->build_blame_dialog($filePath, $log); 
     34        } 
     35        else { 
     36                $self->build_dialog( $filePath, $log, $getData ); 
     37        } 
    3238 
    3339        return $self; 
     
    123129} 
    124130 
     131 
     132sub build_blame_dialog { 
     133        print "In Blame Dialog\n"; 
     134        my ( $self, $file, $log ) = @_; 
     135        my $vbox = Wx::BoxSizer->new(Wx::wxVERTICAL); 
     136 
     137        require Padre::Plugin::SVN::Wx::BlameTree; 
     138        my $blame = Padre::Plugin::SVN::Wx::BlameTree->new($self); 
     139        $blame->populate($log); 
     140        $vbox->Add( $blame, 0, Wx::wxEXPAND ); 
     141 
     142        #print "file: $file\n"; 
     143        #print "Log: $log\n"; 
     144 
     145        my $btnBox     = Wx::BoxSizer->new(Wx::wxHORIZONTAL); 
     146        my $pnlButtons = Wx::Panel->new( 
     147                $self, 
     148                -1, # id 
     149                [ -1, -1 ], # position 
     150                [ -1, -1 ], # size 
     151                0           # border style 
     152        ); 
     153 
     154        # button height is set to 40 simply to get them to look the same 
     155        # in GTK. 
     156        # not sure what this is going to look like in other window managers. 
     157        my $btnOK = Wx::Button->new( $pnlButtons, Wx::wxID_OK, "OK", [ -1, -1 ], [ -1, 40 ] ); 
     158        Wx::Event::EVT_BUTTON( $self, $btnOK, \&ok_clicked ); 
     159 
     160        $btnBox->Add( $btnOK, 1, Wx::wxALIGN_BOTTOM | Wx::wxALIGN_RIGHT ); 
     161 
     162 
     163        $pnlButtons->SetSizer($btnBox); 
     164 
     165        #$btnBox->Add( $pnlButtons, 0, Wx::wxALIGN_BOTTOM | Wx::wxALIGN_RIGHT | Wx::wxEXPAND); 
     166        $vbox->Add( $pnlButtons, 0, Wx::wxALIGN_BOTTOM | Wx::wxALIGN_RIGHT ); 
     167 
     168 
     169        $self->SetSizer($vbox); 
     170 
     171} 
     172 
     173 
     174 
    125175sub ok_clicked { 
    126176        my ($self) = @_; 
     
    164214} 
    165215 
     216 
     217 
    1662181; 
    167219