Padre::Plugin::HG::StatusTree - Padre::Plugin::HG::StatusTree documentation


Padre-Plugin-HG documentation  | view source Contained in the Padre-Plugin-HG distribution.

Index


NAME

Top

Padre::Plugin::HG::StatusTree Displays the status of the current hg project in a tree format

SYNOPSIS

Top

 my $object = Padre::Plugin::HG::StatusTree->new($self,$project_root);

DESCRIPTION

Top

This module diplays a tree in the left panel of the ide that shows the mecurial status of each file. Right clicking on a file will give you options to perform actions. Right clicking the project root will give you project wide options.

METHODS

Top

new

 Creates and displays the status tree
 $tree = Padre::Plugin::HG::StatusTree->new($self, $project_root);

gettext_label

        Works out what to name the tab for the project.

getWxNode

        Add the nodes to the tree. 
        getWxNode($treectrl,[name,parent,type],path);
=cut

sub getWxNode { my ($treectrl,$node,$path) = @_;

    my $name = $node->[0];
    my $parent = $node->[1];
    my $type = $node->[2];
    chomp $path;
    chomp $name;
    if (exists($WxTree{$path}))
    {
      return $WxTree{$path};
      # $WxTree{$path} = $treectrl->AppendItem( $WxTree{$parent}, $name);

    }else
    {
        $WxTree{$path} = $treectrl->AppendItem( 
                  getWxNode($treectrl, $dirTree{$parent}, $parent), 
                            $name, 
                            $file_types->{$type},
                             -1,
                             Wx::TreeItemData->new(
                                            {   name => $name,
                                                path  => $path,
	                                        type => $type,
	                                }));
    }

  


}

parseHgStatus

 $self->parseHgstatus(@hgstatus);
 parses the output of HGstatus and calls create branch for each item.

createBranch

 $self->parseHgstatus(@hgstatus);
 parses the output of HGstatus and calls create branch for each item.

drawTree

 $self->drawTree($treectrl);
 creates the Tree from the output of the vcs status

_on_tree_item_activated

        Performs actions when the users double clicks on a tree node
        at the moment opens a file when it is double clicked. 

 


_on_tree_item_menu

        Called when a user right clicks a node in the tree
        Shows different options depending if a file/dir or root
        is selected. 

 


open_file

        open_file($path)
        opens the file in the editor. 

 


refresh

        $self->refresh();
        refreshes the tree control by deleteing all items and 
        readding them. 


Padre-Plugin-HG documentation  | view source Contained in the Padre-Plugin-HG distribution.