summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/LDFM/MainController.pm81
1 files changed, 78 insertions, 3 deletions
diff --git a/lib/LDFM/MainController.pm b/lib/LDFM/MainController.pm
index f365115..2f573cc 100644
--- a/lib/LDFM/MainController.pm
+++ b/lib/LDFM/MainController.pm
@@ -127,9 +127,9 @@ sub get_selected_side {
: 'right';
}
-sub get_selected_files {
- my ($self)=@_;
- my $side=$self->get_selected_side();
+sub get_files_from_list {
+ my ($self,$side)=@_;
+
my $path=$self->{"cur_${side}_path"};
my @files=map {
@@ -139,6 +139,13 @@ sub get_selected_files {
return @files;
}
+sub get_selected_files {
+ my ($self)=@_;
+ my $side=$self->get_selected_side();
+
+ return get_files_from_list($side);
+}
+
sub mkdir {
my ($self)=@_;
@@ -182,6 +189,74 @@ sub rename {
return;
}
+sub copy_lr {
+ my ($self)=@_;
+
+ my @files=$self->get_files_from_list('left');
+ my $destpath=$self->{cur_right_path};
+
+ $self->copy_files(@files,$destpath);
+
+ return;
+}
+
+sub copy_rl {
+ my ($self)=@_;
+
+ my @files=$self->get_files_from_list('right');
+ my $destpath=$self->{cur_left_path};
+
+ $self->copy_files(@files,$destpath);
+
+ return;
+}
+
+sub copy_files {
+ my $self=shift;
+ my $destdir=pop;
+ my @files=@_;
+
+ for my $file (@files) {
+ warn "Copierei $file in $destdir\n";
+ }
+
+ return;
+}
+
+sub move_lr {
+ my ($self)=@_;
+
+ my @files=$self->get_files_from_list('left');
+ my $destpath=$self->{cur_right_path};
+
+ $self->move_files(@files,$destpath);
+
+ return;
+}
+
+sub move_rl {
+ my ($self)=@_;
+
+ my @files=$self->get_files_from_list('right');
+ my $destpath=$self->{cur_left_path};
+
+ $self->move_files(@files,$destpath);
+
+ return;
+}
+
+sub move_files {
+ my $self=shift;
+ my $destdir=pop;
+ my @files=@_;
+
+ for my $file (@files) {
+ warn "Sposterei $file in $destdir\n";
+ }
+
+ return;
+}
+
sub quit {
Gtk2->main_quit;
}