Re: [Tails-dev] Fix: persistence: clearer warning at delete …

Delete this message

Reply to this message
Autore: Andres Gomez Ramirez
Data:  
To: The Tails public development discussion list
Oggetto: Re: [Tails-dev] Fix: persistence: clearer warning at delete step
>Much better! However, I think the icon should be left-aligned with the
>title and the rest of the text, instead of protruding in the
>left-margin. Do you think you can fix this?
>
>Long term wise, best would even be to fully follow the HIG regarding
>alert windows [1], but IMHO this can be kept for a later iteration,
>once the addition of the icon is merged. Besides, the way t-p-s is
>implemented doesn't make it very easy: among all steps (create,
>>configure, delete), only deletion should be an alert window, but in
>practice they share the same basic window. So well, just adding the
>relevant icon in the right place will be good enough for now, and
>a very useful improvement :)
>
>I also see a regression in the last version of the patch: the icon
>stays displayed even in the "Finished" screen. I doubt it was
>intended, and it doesn't look too good. Likely it should be hidden in
>some callback, perhaps in the operation_finished one.


Ok! Here it goes the next iteration :)

cheers,

Andres
From f3c9ac691b212ba19567cebfff51bdc4bf39c76c Mon Sep 17 00:00:00 2001
From: kurono <andres.gomez@???>
Date: Tue, 12 Nov 2013 23:25:14 +0100
Subject: [PATCH] persistence: clearer warning at delete step

---
lib/Tails/Persistence/Step/Delete.pm | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/lib/Tails/Persistence/Step/Delete.pm b/lib/Tails/Persistence/Step/Delete.pm
index 1a7cfd5..b23fe65 100644
--- a/lib/Tails/Persistence/Step/Delete.pm
+++ b/lib/Tails/Persistence/Step/Delete.pm
@@ -27,7 +27,7 @@ textdomain("tails-persistence-setup");

 has 'persistence_partition'      => required ro Str;
 has 'persistence_partition_size' => required ro Int;
-
+has 'image_alert'                => lazy_build rw 'Gtk2::Image';


=head1 CONSTRUCTORS

@@ -54,13 +54,25 @@ sub BUILD {
     $self->go_button->set_sensitive(TRUE);
 }


+sub _build_image_alert {
+    my $self = shift;
+
+    my $image = Gtk2::Image->new_from_stock("gtk-dialog-warning", "GTK_ICON_SIZE_DIALOG");
+
+    return $image;
+}
+
 sub _build_main_box {
     my $self = shift;


     my $box = Gtk2::VBox->new();
+    my $hbox = Gtk2::HBox->new();
     $box->set_spacing(6);
+  
     $box->pack_start($self->title, FALSE, FALSE, 0);
-    $box->pack_start($self->subtitle, FALSE, FALSE, 0);
+    $hbox->pack_start($self->image_alert, FALSE, FALSE, 10);
+    $hbox->pack_start($self->subtitle, FALSE, FALSE, 0);
+    $box->pack_start($hbox, FALSE, FALSE, 0);
     $box->pack_start($self->description, FALSE, FALSE, 0);


     $box->pack_start($self->status_area, FALSE, FALSE, 0);
@@ -76,6 +88,7 @@ sub _build_main_box {
 sub operation_finished {
     my $self = shift;


+    $self->image_alert->hide();
     # FIXME: handle errors


     say STDERR "done.";
-- 
1.7.9.5