summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Huuhko <kai.huuhko@gmail.com>2014-05-13 20:19:51 +0300
committerKai Huuhko <kai.huuhko@gmail.com>2014-05-13 20:19:51 +0300
commitb0f72ced51c853a79ce887c0ad9bd5860a776d20 (patch)
treeab79261567b8e3607c54bd338349e135d8d615d7
parent017b4a58dd1f4fe20dec89d4b121515d775de7f2 (diff)
Theme reload safety, maybe
-rwxr-xr-xpolkit-efl-authentication-agent-119
1 files changed, 19 insertions, 0 deletions
diff --git a/polkit-efl-authentication-agent-1 b/polkit-efl-authentication-agent-1
index 7049194..1675c9c 100755
--- a/polkit-efl-authentication-agent-1
+++ b/polkit-efl-authentication-agent-1
@@ -361,6 +361,8 @@ class AuthenticationDialog(Window):
361 cancelled = False 361 cancelled = False
362 authenticating = False 362 authenticating = False
363 logger_entry = None 363 logger_entry = None
364 hiding = False
365 pw_visible = False
364 366
365 def __init__( 367 def __init__(
366 self, agent, 368 self, agent,
@@ -398,6 +400,7 @@ class AuthenticationDialog(Window):
398 400
399 def hide_done_cb(*args): 401 def hide_done_cb(*args):
400 log.debug("Dialog now hidden, deleting") 402 log.debug("Dialog now hidden, deleting")
403 self.hiding = False
401 dlg = agent.dialogs.pop(cookie) 404 dlg = agent.dialogs.pop(cookie)
402 dlg.delete() 405 dlg.delete()
403 406
@@ -421,6 +424,9 @@ class AuthenticationDialog(Window):
421 layout.signal_callback_add( 424 layout.signal_callback_add(
422 "polkit,password,hidden,done", "polkit", password_hide_done_cb 425 "polkit,password,hidden,done", "polkit", password_hide_done_cb
423 ) 426 )
427 layout.signal_callback_add(
428 "edje,change,file", "edje", self.resend_signals
429 )
424 430
425 pw_entry = self.pw_entry = PasswordEntry(layout) 431 pw_entry = self.pw_entry = PasswordEntry(layout)
426 layout.content_set("polkit.swallow.password", pw_entry) 432 layout.content_set("polkit.swallow.password", pw_entry)
@@ -455,6 +461,7 @@ class AuthenticationDialog(Window):
455 461
456 def cancel_cb(obj): 462 def cancel_cb(obj):
457 log.debug("Auth cancel selected") 463 log.debug("Auth cancel selected")
464 self.hiding = True
458 self.layout.signal_emit("polkit,hide", "polkit") 465 self.layout.signal_emit("polkit,hide", "polkit")
459 agent.cancel_authentication(cookie, error_cb) 466 agent.cancel_authentication(cookie, error_cb)
460 467
@@ -524,6 +531,7 @@ class AuthenticationDialog(Window):
524 log.debug("Displaying password entry") 531 log.debug("Displaying password entry")
525 self.pw_entry.send_func = func 532 self.pw_entry.send_func = func
526 self.pw_entry.exe_obj = exe_obj 533 self.pw_entry.exe_obj = exe_obj
534 self.pw_visible = True
527 self.layout.signal_emit("polkit,password,visible", "polkit") 535 self.layout.signal_emit("polkit,password,visible", "polkit")
528 536
529 def show_info(self, msg): 537 def show_info(self, msg):
@@ -554,6 +562,16 @@ class AuthenticationDialog(Window):
554 self.layout.signal_emit("polkit,hide", "polkit") 562 self.layout.signal_emit("polkit,hide", "polkit")
555 # TODO: Display a desktop notification here? 563 # TODO: Display a desktop notification here?
556 564
565 def resend_signals(self):
566 if self.hiding:
567 self.layout.signal_emit("polkit,hide")
568 else:
569 self.layout.signal_emit("polkit,visible")
570 if self.pw_visible:
571 self.layout.signal_emit("polkit,password,hidden")
572 else:
573 self.layout.signal_emit("polkit,password,visible")
574
557 575
558class PasswordEntry(Entry): 576class PasswordEntry(Entry):
559 577
@@ -573,6 +591,7 @@ class PasswordEntry(Entry):
573 def cancel_cb(obj): 591 def cancel_cb(obj):
574 parent.top_widget.authenticating = False 592 parent.top_widget.authenticating = False
575 parent.focus = False 593 parent.focus = False
594 parent.top_widget.pw_visible = False
576 parent.signal_emit("polkit,password,hidden", "polkit") 595 parent.signal_emit("polkit,password,hidden", "polkit")
577 self.exe_obj.terminate() 596 self.exe_obj.terminate()
578 597