kuuko pushed a commit to branch master.

http://git.enlightenment.org/misc/polkit-efl.git/commit/?id=642d3cbdd48bc5c3bb247691426de4a50cb70f71

commit 642d3cbdd48bc5c3bb247691426de4a50cb70f71
Author: Kai Huuhko <kai.huu...@gmail.com>
Date:   Wed Jun 4 10:29:59 2014 +0300

    Add back ok button and display the first auth id initially
---
 polkit-efl-authentication-agent-1 | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/polkit-efl-authentication-agent-1 
b/polkit-efl-authentication-agent-1
index 8fc423c..8c4f673 100755
--- a/polkit-efl-authentication-agent-1
+++ b/polkit-efl-authentication-agent-1
@@ -459,8 +459,8 @@ class AuthenticationDialog(Window):
                 "polkit.text.help",
                 _("Select Authentication ID")
                 )
-            name_sel.disabled = False
-            name_sel.text = _("Select Authentication ID")
+            for w in ok_bt, name_sel:
+                w.disabled = False
             try:
                 ic = self.layout.content_get("polkit.swallow.info")
                 ic.standard = icon_name
@@ -497,7 +497,7 @@ class AuthenticationDialog(Window):
         # === AUTH ID SELECTOR ===
         name_sel = TrackingHoversel(
             self, size_hint_align=FILL_HORIZ,
-            text=_("Select Authentication ID")
+            #text=_("Select Authentication ID")
             )
         for i in names:
             TrackingHoverselItem(i[0]).add_to(name_sel)
@@ -509,6 +509,7 @@ class AuthenticationDialog(Window):
             ok_cb(None)
 
         name_sel.callback_selected_add(selected_cb)
+        name_sel.display_item(name_sel.items[0])
 
         layout.content_set("polkit.swallow.users", name_sel)
 
@@ -522,7 +523,8 @@ class AuthenticationDialog(Window):
             name = name_sel.text
             if name == _("Select Authentication ID"):
                 return
-            name_sel.disabled = True
+            for w in ok_bt, name_sel:
+                w.disabled = True
             self.authenticating = True
             log.debug("Auth ID selected, authenticating...")
             agent.authenticate(name, cookie, return_cb, error_cb)
@@ -533,6 +535,8 @@ class AuthenticationDialog(Window):
             self.layout.signal_emit("polkit,hide", "polkit")
             agent.cancel_authentication(cookie, error_cb)
 
+        ok_bt = Button(bt_box, text=_("OK"), focus_allow=False)
+        ok_bt.callback_clicked_add(ok_cb)
         ca_bt = Button(bt_box, text=_("Cancel"), focus_allow=False)
         ca_bt.callback_clicked_add(cancel_cb)
         sep = Separator(bt_box, horizontal=False)
@@ -544,7 +548,7 @@ class AuthenticationDialog(Window):
         act_bt = Button(bt_box, text=_("Details"), focus_allow=False)
         act_bt.callback_clicked_add(det_cb)
 
-        for w in ca_bt, sep, act_bt:
+        for w in ok_bt, ca_bt, sep, act_bt:
             bt_box.pack_end(w)
             w.show()
 

-- 


Reply via email to