Hi, I attached a new patch for Feature #5594 tails-greeter: better administration password UI.
Sorry for the huge delay, i had some days off.
Cheers.
________________________________________
From: tails-dev [tails-dev-bounces@???] on behalf of intrigeri [intrigeri@???]
Sent: 04 March 2014 12:05
To: The Tails public development discussion list
Subject: Re: [Tails-dev] #5594: tails-greeter: better administration password UI
Andres Gomez Ramirez wrote (22 Feb 2014 18:10:41 GMT) :
>> In the patch you use at least one untranslated string in
>>
>> + self.warning_label.set_markup("<i>Password must not be empty.</i>")
>>
>> but possibly also in
>>
>> + self.warning_label.set_markup("<i>Passwords do not match.</i>")
>>
>> In the latter case you actually set it to the default text for
>>`warning_label` as defined in the glade file, so maybe it works.
>>
>> I'm no glade expert, but I think the way you'll have to go is to create
>> two `warning_label`, one for each warning, and `show()`/`hide()` them
>> appropriately. I'd be glad if someone more familiar with glade could
>> chime in if there's a better approach.
> so the idea is to add translatable string to the labels, ok.
Any news on this? The feature freeze for Tails 0.23 is coming real
soon now.
> btw I'm having problems to access labs.riseup.net with firefox
> 27.0.1, there is an error with the certificate (?):
labs.riseup.net uses a commercial certificate again, so this should
be fixed.
Cheers,
--
intrigeri
| GnuPG key @ https://gaffer.ptitcanardnoir.org/intrigeri/intrigeri.asc
| OTR fingerprint @ https://gaffer.ptitcanardnoir.org/intrigeri/otr.asc
_______________________________________________
tails-dev mailing list
tails-dev@???
https://mailman.boum.org/listinfo/tails-dev
To unsubscribe from this list, send an empty email to tails-dev-unsubscribe@???.
From 8d6d0a20f37f463172b10f039aa60f7450ab91e2 Mon Sep 17 00:00:00 2001
From: kurono <andres.gomez@???>
Date: Sun, 30 Mar 2014 14:57:55 +0200
Subject: [PATCH] Fix for 5594: tails-greeter: better administration password
UI
---
GdmGreeter/optionswindow.py | 21 +++++++++++--------
glade/optionswindow.glade | 47 ++++++++++++++++++++++++++++++++++++++++---
2 files changed, 57 insertions(+), 11 deletions(-)
diff --git a/GdmGreeter/optionswindow.py b/GdmGreeter/optionswindow.py
index 5a2459b..15eec80 100644
--- a/GdmGreeter/optionswindow.py
+++ b/GdmGreeter/optionswindow.py
@@ -20,7 +20,8 @@
"""
-import logging, gtk, os
+import logging, gtk, gettext, os
+_ = gettext.gettext
import GdmGreeter
from GdmGreeter.language import TranslatableWindow
from helpwindow import HelpWindow
@@ -37,8 +38,8 @@ class OptionsWindow(TranslatableWindow):
builder.connect_signals(self)
self.entry_password = builder.get_object("password_entry")
self.entry_password2 = builder.get_object("password_entry2")
- self.warning_label = builder.get_object("warning_label")
- self.warning_area = builder.get_object("warning_area")
+ self.warning_area_empty = builder.get_object("warning_area_empty")
+ self.warning_area_match = builder.get_object("warning_area_match")
self.camouflage_checkbox = builder.get_object("camouflage_checkbox")
self.macspoof_checkbox = builder.get_object("macspoof_checkbox")
self.macspoof_checkbox.set_active(True)
@@ -53,7 +54,8 @@ class OptionsWindow(TranslatableWindow):
self.entry_password2.set_visibility(False)
def cb_pw_changed(*args):
- self.warning_area.hide()
+ self.warning_area_empty.hide()
+ self.warning_area_match.hide()
# compact the window
self.window.resize(1, 1)
@@ -114,10 +116,13 @@ class OptionsWindow(TranslatableWindow):
"""Validate the selected options"""
auth_password = self.entry_password.get_text()
test_password = self.entry_password2.get_text()
- passwords_match = test_password == auth_password
- if not passwords_match:
- self.warning_area.show()
- return passwords_match
+ if len(auth_password) == 0 or len(test_password) == 0:
+ self.warning_area_empty.show()
+ return False
+ elif not auth_password == test_password:
+ self.warning_area_match.show()
+ return False
+ return True
def set_options_and_login(self):
"""Activate the selected options if they are valid"""
diff --git a/glade/optionswindow.glade b/glade/optionswindow.glade
index 1632b62..a3ad0ea 100644
--- a/glade/optionswindow.glade
+++ b/glade/optionswindow.glade
@@ -227,12 +227,12 @@ Otherwise it will be disabled for better security.</property>
</packing>
</child>
<child>
- <object class="GtkHBox" id="warning_area">
+ <object class="GtkHBox" id="warning_area_empty">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
- <object class="GtkImage" id="warning_image">
+ <object class="GtkImage" id="warning_image_empty">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-dialog-warning</property>
@@ -245,7 +245,48 @@ Otherwise it will be disabled for better security.</property>
</packing>
</child>
<child>
- <object class="GtkLabel" id="warning_label">
+ <object class="GtkLabel" id="warning_label_empty">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="xpad">10</property>
+ <property name="ypad">10</property>
+ <property name="label" translatable="yes"><i>Password must not be empty</i></property>
+ <property name="use_markup">True</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="warning_area_match">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkImage" id="warning_image_match">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="stock">gtk-dialog-warning</property>
+ <property name="icon-size">1</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="warning_label_match">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
--
1.7.9.5