summaryrefslogtreecommitdiffstats
path: root/zarb-ml/mageia-dev/attachments/20121112/557570ea
diff options
context:
space:
mode:
Diffstat (limited to 'zarb-ml/mageia-dev/attachments/20121112/557570ea')
-rw-r--r--zarb-ml/mageia-dev/attachments/20121112/557570ea/attachment-0001.bin54
-rw-r--r--zarb-ml/mageia-dev/attachments/20121112/557570ea/attachment.bin54
2 files changed, 108 insertions, 0 deletions
diff --git a/zarb-ml/mageia-dev/attachments/20121112/557570ea/attachment-0001.bin b/zarb-ml/mageia-dev/attachments/20121112/557570ea/attachment-0001.bin
new file mode 100644
index 000000000..a10a9ae25
--- /dev/null
+++ b/zarb-ml/mageia-dev/attachments/20121112/557570ea/attachment-0001.bin
@@ -0,0 +1,54 @@
+Index: diskdrake/interactive.pm
+===================================================================
+--- diskdrake/interactive.pm (revision 6434)
++++ diskdrake/interactive.pm (working copy)
+@@ -323,7 +323,10 @@
+
+ sub hd_possible_actions_extra {
+ my ($_hd) = @_;
+- $::expert ? N_("Toggle to normal mode") : N_("Toggle to expert mode");
++ (
++ N_("Refresh"),
++ $::expert ? N_("Toggle to normal mode") : N_("Toggle to expert mode"),
++ );
+ }
+
+
+@@ -338,6 +341,29 @@
+ &hd_possible_actions, N_("Hard disk drive information");
+ }
+
++sub Refresh {
++ my ($in, $current_hd, $all_hds) = @_;
++
++ # redo the first2 steps in a diff variable
++ my $all_hds2 = fsedit::get_hds({}, $in);
++ # TODO: do i need to get_raw_hds too? are raw disks shown?
++ # fs::get_raw_hds('', $all_hds2);
++
++ # file based index of old hds
++ my %old_hds = map { $_->{file} => $_ } @{$all_hds->{hds}};
++
++ # same for new, but also push the new hd to all_hds if it has different size or not exist
++ my %new_hds = map { push @{$all_hds->{hds}} if (!defined $old_hds{$_->{file}} || $_->{total_sectors} != $old_hds{$_->{file}}->{total_sectors}); $_->{file} => $_ } @{$all_hds2->{hds}};
++
++ # find deleted ones
++ for my $hd (@{$all_hds->{hds}}) {
++ if (!defined $new_hds{$hd->{file}}) {
++ # TODO: mark the hd as unavailable
++ }
++ }
++ $all_hds;
++}
++
+ sub Clear_all {
+ my ($in, $hd, $all_hds) = @_;
+ return if detect_devices::is_xbox(); #- do not let them wipe the OS
+@@ -1134,6 +1160,7 @@
+ *{'Toggle to normal mode'} = sub() { $::expert = 0 };
+ *{'Toggle to expert mode'} = sub() { $::expert = 1 };
+ *{'Clear all'} = \&Clear_all;
++ *{'Refresh'} = \&Refresh;
+ *{'Auto allocate'} = \&Auto_allocate;
+ *{'Mount point'} = \&Mount_point;
+ *{'Modify RAID'} = \&ModifyRAID;
diff --git a/zarb-ml/mageia-dev/attachments/20121112/557570ea/attachment.bin b/zarb-ml/mageia-dev/attachments/20121112/557570ea/attachment.bin
new file mode 100644
index 000000000..a10a9ae25
--- /dev/null
+++ b/zarb-ml/mageia-dev/attachments/20121112/557570ea/attachment.bin
@@ -0,0 +1,54 @@
+Index: diskdrake/interactive.pm
+===================================================================
+--- diskdrake/interactive.pm (revision 6434)
++++ diskdrake/interactive.pm (working copy)
+@@ -323,7 +323,10 @@
+
+ sub hd_possible_actions_extra {
+ my ($_hd) = @_;
+- $::expert ? N_("Toggle to normal mode") : N_("Toggle to expert mode");
++ (
++ N_("Refresh"),
++ $::expert ? N_("Toggle to normal mode") : N_("Toggle to expert mode"),
++ );
+ }
+
+
+@@ -338,6 +341,29 @@
+ &hd_possible_actions, N_("Hard disk drive information");
+ }
+
++sub Refresh {
++ my ($in, $current_hd, $all_hds) = @_;
++
++ # redo the first2 steps in a diff variable
++ my $all_hds2 = fsedit::get_hds({}, $in);
++ # TODO: do i need to get_raw_hds too? are raw disks shown?
++ # fs::get_raw_hds('', $all_hds2);
++
++ # file based index of old hds
++ my %old_hds = map { $_->{file} => $_ } @{$all_hds->{hds}};
++
++ # same for new, but also push the new hd to all_hds if it has different size or not exist
++ my %new_hds = map { push @{$all_hds->{hds}} if (!defined $old_hds{$_->{file}} || $_->{total_sectors} != $old_hds{$_->{file}}->{total_sectors}); $_->{file} => $_ } @{$all_hds2->{hds}};
++
++ # find deleted ones
++ for my $hd (@{$all_hds->{hds}}) {
++ if (!defined $new_hds{$hd->{file}}) {
++ # TODO: mark the hd as unavailable
++ }
++ }
++ $all_hds;
++}
++
+ sub Clear_all {
+ my ($in, $hd, $all_hds) = @_;
+ return if detect_devices::is_xbox(); #- do not let them wipe the OS
+@@ -1134,6 +1160,7 @@
+ *{'Toggle to normal mode'} = sub() { $::expert = 0 };
+ *{'Toggle to expert mode'} = sub() { $::expert = 1 };
+ *{'Clear all'} = \&Clear_all;
++ *{'Refresh'} = \&Refresh;
+ *{'Auto allocate'} = \&Auto_allocate;
+ *{'Mount point'} = \&Mount_point;
+ *{'Modify RAID'} = \&ModifyRAID;