Re: [Tails-dev] Fix to #5917 tails-greeter password field : Warn when caps-lock in ON

2013-11-10 Thread Andres Gomez Ramirez
> Apparently it's done with a secondary icon, and our Glade reads:
>
>  False

> Perhaps it's related?

I thought that, I tried with a working test case outside of greeter, a simple 
password field in Glade. Then i copied the exact same parameters to greeter's 
glade (Removing   False), but still it didn't work. 
Also changed the GTK version but the behavior was the same.

Cheers,

Andres
___
tails-dev mailing list
tails-dev@boum.org
https://mailman.boum.org/listinfo/tails-dev


Re: [Tails-dev] Fix to #5917 tails-greeter password field : Warn when caps-lock in ON

2013-11-10 Thread intrigeri
Andres Gomez Ramirez wrote (03 Nov 2013 23:02:24 GMT) :
> I tried with a minimal test case, and caps locks key was detected in all 
> cases.
> Maybe it has to be with the way greeter uses gtk+ library.
> On the other hand, according to this:

> https://developer.gnome.org/gtk2/2.24/GtkEntry.html#GtkEntry--caps-lock-warning

> caps lock warning should be activated by default in Gtk entries, which is not
> happening in greeter for some reason.

Apparently it's done with a secondary icon, and our Glade reads:

  False

Perhaps it's related?

> Is there another component in tails using the same library, where caps lock 
> warning
> is already working?

I don't think we have anything Tails specific that does so.
But e.g GNOME Disks or other GNOME apps are using some version of GTK,
and at least the former likely has a caps lock warning.

Cheers!
___
tails-dev mailing list
tails-dev@boum.org
https://mailman.boum.org/listinfo/tails-dev


Re: [Tails-dev] Fix to #5917 tails-greeter password field : Warn when caps-lock in ON

2013-11-03 Thread Andres Gomez Ramirez
Sorry for the delay, 

I tried with a minimal test case, and caps locks key was detected in all cases. 
Maybe it has to be with the way greeter uses gtk+ library.
On the other hand, according to this:

https://developer.gnome.org/gtk2/2.24/GtkEntry.html#GtkEntry--caps-lock-warning

caps lock warning should be activated by default in Gtk entries, which is not 
happening in greeter for some reason. 
Is there another component in tails using the same library, where caps lock 
warning is already working?

Cheers.

From: tails-dev-boun...@boum.org [tails-dev-boun...@boum.org] on behalf of 
intrigeri [intrig...@boum.org]
Sent: 03 November 2013 15:27
To: The Tails public development discussion list
Subject: Re: [Tails-dev] Fix to #5917 tails-greeter password field :Warn
when caps-lock in ON

intrigeri wrote (13 Oct 2013 09:37:46 GMT) :
> Andres Gomez Ramirez wrote (10 Oct 2013 09:57:43 GMT) :
>> It's just that the key event for caps lock (when it is on) is
>> not detected or activated at all. If you try with any other key it works.

> How about trying to reproduce this in a minimal test case,
> independently from the greeter code?

Ping? I'm curious if this is a bug in one of the underlying libraries,
in how we're using them, or in some other part of the greeter.

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@boum.org
https://mailman.boum.org/listinfo/tails-dev
___
tails-dev mailing list
tails-dev@boum.org
https://mailman.boum.org/listinfo/tails-dev


Re: [Tails-dev] Fix to #5917 tails-greeter password field : Warn when caps-lock in ON

2013-11-03 Thread intrigeri
intrigeri wrote (13 Oct 2013 09:37:46 GMT) :
> Andres Gomez Ramirez wrote (10 Oct 2013 09:57:43 GMT) :
>> It's just that the key event for caps lock (when it is on) is
>> not detected or activated at all. If you try with any other key it works.

> How about trying to reproduce this in a minimal test case,
> independently from the greeter code?

Ping? I'm curious if this is a bug in one of the underlying libraries,
in how we're using them, or in some other part of the greeter.

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@boum.org
https://mailman.boum.org/listinfo/tails-dev


Re: [Tails-dev] Fix to #5917 tails-greeter password field : Warn when caps-lock in ON

2013-10-13 Thread intrigeri
Hi,

Andres Gomez Ramirez wrote (10 Oct 2013 09:57:43 GMT) :
> It's just that the key event for caps lock (when it is on) is
> not detected or activated at all. If you try with any other key it works.

How about trying to reproduce this in a minimal test case,
independently from the greeter code?

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@boum.org
https://mailman.boum.org/listinfo/tails-dev


Re: [Tails-dev] Fix to #5917 tails-greeter password field : Warn when caps-lock in ON

2013-10-10 Thread Andres Gomez Ramirez
Hi intrigeri,

> If that were the case, then indeed the piece of code that hides the
> caps lock warning would never be run.

> Also, please make sure your commits don't add space errors.
> Git commit warns you about this.

yes I was adding tabs and spaces in indentation, but i doesn't affect the 
expected behavior of the code. It's just that the key event for caps lock (when 
it is on) is not detected or activated at all. If you try with any other key it 
works.

Cheers,
Andres
___
tails-dev mailing list
tails-dev@boum.org
https://mailman.boum.org/listinfo/tails-dev


Re: [Tails-dev] Fix to #5917 tails-greeter password field : Warn when caps-lock in ON

2013-10-07 Thread intrigeri
Hi Andres,

Andres Gomez Ramirez wrote (06 Oct 2013 16:23:23 GMT) :
> Hi, I created a patch for feature #5917 (tails-greeter password
> field : Warn when caps-lock in ON).

Thanks!

> I had a problem when caps lock key was on. I press the key again and it 
> doesn't
> generate a key event, so the warning message does not hide until i press 
> another key;
> don't know if this is GTK normal behavior or specific to my keyboard or 
> virtualbox.
> Could please somebody check that?

I notice there's some indentation discrepancy in there (tabs vs.
spaces):

elif event.keyval == gtk.keysyms.Caps_Lock: 
if event.state & gtk.gdk.LOCK_MASK:
self.caps_lock_warning_area.show()
elif not (event.state & gtk.gdk.LOCK_MASK):
self.caps_lock_warning_area.hide()  

Perhaps that could make Python see the second elif as being part of
the main `if event.keyval [...] elif event.keyval ==
gtk.keysyms.Caps_Lock [...]' control structure, instead of (as it
should be) part of `if event.state & gtk.gdk.LOCK_MASK: [...]'?
If that were the case, then indeed the piece of code that hides the
caps lock warning would never be run.

Also, please make sure your commits don't add space errors.
Git commit warns you about this.

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@boum.org
https://mailman.boum.org/listinfo/tails-dev


[Tails-dev] Fix to #5917 tails-greeter password field : Warn when caps-lock in ON

2013-10-06 Thread Andres Gomez Ramirez
Hi, I created a patch for feature #5917 (tails-greeter password field : Warn 
when caps-lock in ON). 

I had a problem when caps lock key was on. I press the key again and it doesn't 
generate a key event, so the warning message does not hide until i press 
another key; don't know if this is GTK normal behavior or specific to my 
keyboard or virtualbox. Could please somebody check that?

kind regards,

kurono.




From 3f5fd5c90e1ef2cfe0873bd2e6f282487cc36242 Mon Sep 17 00:00:00 2001
From: kurono 
Date: Sat, 5 Oct 2013 23:32:21 +0200
Subject: [PATCH 3/3] tails-greeter password field : Warn when caps-lock in ON

---
 GdmGreeter/optionswindow.py |8 
 GdmGreeter/persistencewindow.py |7 +++
 glade/optionswindow.glade   |   41 +
 glade/persistencewindow.glade   |   43 ++-
 4 files changed, 98 insertions(+), 1 deletion(-)

diff --git a/GdmGreeter/optionswindow.py b/GdmGreeter/optionswindow.py
index 9042cb9..cd8fa40 100644
--- a/GdmGreeter/optionswindow.py
+++ b/GdmGreeter/optionswindow.py
@@ -38,12 +38,14 @@ class OptionsWindow(TranslatableWindow):
 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.caps_lock_warning_area = builder.get_object("caps_lock_warning_area")
 self.camouflage_checkbox = builder.get_object("camouflage_checkbox")
 
 TranslatableWindow.__init__(self, builder.get_object("options_dialog"))
 self.window.set_visible(False)
 
 self.warning_area.hide()
+	self.caps_lock_warning_area.hide()
 self.entry_password.set_visibility(False)
 self.entry_password2.set_visibility(False)
 
@@ -86,6 +88,12 @@ class OptionsWindow(TranslatableWindow):
 self.entry_password2.grab_focus()
 else:
 self.set_options_and_login()
+elif event.keyval == gtk.keysyms.Caps_Lock:			
+		if event.state & gtk.gdk.LOCK_MASK:
+		self.caps_lock_warning_area.show()
+	elif not (event.state & gtk.gdk.LOCK_MASK):
+		self.caps_lock_warning_area.hide()	
+
 
 def delete_event_cb(self, widget, event=None):
 """Ignore delete event (Esc)"""
diff --git a/GdmGreeter/persistencewindow.py b/GdmGreeter/persistencewindow.py
index 657544f..7df7a2a 100644
--- a/GdmGreeter/persistencewindow.py
+++ b/GdmGreeter/persistencewindow.py
@@ -53,6 +53,7 @@ class PersistenceWindow(TranslatableWindow):
 self.readonly_checkbutton = builder.get_object("readonly_checkbutton")
 self.warning_label = builder.get_object("warning_label")
 self.warning_area = builder.get_object("warning_area")
+self.caps_lock_warning_area = builder.get_object("caps_lock_warning_area")
 self.warning_image = builder.get_object("warning_area")
 # self.spinner = builder.get_object("spinner")
 self.checked_img_moreoptions_yes = builder.get_object("moreoptions_yes_checked_img")
@@ -61,6 +62,7 @@ class PersistenceWindow(TranslatableWindow):
 self.checked_img_persistence_no  = builder.get_object("persistence_no_checked_img")
 
 self.warning_area.hide()
+self.caps_lock_warning_area.hide()
 
 # FIXME: list_containers may raise exceptions. Deal with that.
 self.containers = [
@@ -189,6 +191,11 @@ class PersistenceWindow(TranslatableWindow):
 if event:
 if event.keyval in [ gtk.keysyms.Return, gtk.keysyms.KP_Enter ]:
 self.go()
+elif event.keyval == gtk.keysyms.Caps_Lock:			
+		if event.state & gtk.gdk.LOCK_MASK:
+		self.caps_lock_warning_area.show()
+	elif not (event.state & gtk.gdk.LOCK_MASK):
+		self.caps_lock_warning_area.hide()
 
 def delete_event_cb(self, widget, event=None):
 """Ignore delete event (Esc)"""
diff --git a/glade/optionswindow.glade b/glade/optionswindow.glade
index e0bedaa..30054a6 100644
--- a/glade/optionswindow.glade
+++ b/glade/optionswindow.glade
@@ -184,6 +184,47 @@ Otherwise it will be disabled for better security.
 2
   
 
+		
+  
+True
+False
+6
+
+  
+True
+False
+gtk-info
+1
+  
+  
+False
+False
+0
+  
+
+
+  
+True
+False
+0
+10
+10
+Caps lock is on
+True
+  
+