Ticket #277: login.diff
| File login.diff, 1.8 kB (added by swordfish, 9 months ago) |
|---|
-
emesene/Login.py
48 48 49 49 lUser = gtk.Label(_('_User:')) 50 50 lPass = gtk.Label(_('_Password:')) 51 self.lCaps = gtk.Label('') 51 52 lStatus = gtk.Label(_('_Status:')) 52 53 53 54 lUser.set_use_underline(True) … … 90 91 self.tPass = gtk.Entry(128) 91 92 self.tPass.set_visibility(False) 92 93 self.tPass.connect('activate' , self.bLogin_clicked) 94 self.tPass.connect('key-press-event', self.on_password_keypressed) 93 95 94 96 lUser.set_mnemonic_widget(self.tUser) 95 97 lPass.set_mnemonic_widget(self.tPass) … … 124 126 self.fieldsBox.pack_start(userBox, False, False) 125 127 126 128 passBox = gtk.VBox(spacing=6) 129 passLBox = gtk.HBox(spacing=6) 127 130 lPass.set_alignment(0.0, 0.5) 128 passBox.pack_start(lPass , False , False) 131 passLBox.pack_start(lPass , False , False) 132 passLBox.pack_start(self.lCaps , False , False) 133 passBox.pack_start(passLBox , False , False) 129 134 passBox.pack_start(self.tPass , False , False) 130 135 131 136 self.fieldsBox.pack_start(passBox, False, False) … … 379 384 380 385 if event.keyval == gtk.keysyms.Return: 381 386 self.login() 382 387 388 def on_password_keypressed(self, widget, event): 389 if (event.state & 0x00000002) == 2: # Verify caps lock state 390 self.lCaps.set_markup('<span foreground="#FF0000">CAPS LOCK enabled</span>') 391 elif self.lCaps.get_text(): 392 self.lCaps.set_text('') 393 383 394 class UserManager(object): 384 395 '''This class manages the file that hold the user:password data 385 396 the format of users.dat is:
