diff --git a/howdy-gtk/src/onboarding.glade b/howdy-gtk/src/onboarding.glade index e3b4b95..cd4dbe2 100644 --- a/howdy-gtk/src/onboarding.glade +++ b/howdy-gtk/src/onboarding.glade @@ -42,7 +42,7 @@ immediate vertical - + False True vertical @@ -72,7 +72,7 @@ 20 We're done! Howdy is now active on this computer. Try doing anything you would normally have to type your password for to authenticate, like running a command with sudo. -You can open the Howdy Configurator later on to change more advanced settings or add additional models. Press Finish below to close this window. +You can open the Howdy Configurator later on to change more advanced settings or add additional models. Press Finish below to close this window and open the Howdy Configurator. center True @@ -89,6 +89,233 @@ You can open the Howdy Configurator later on to change more advanced settings or 0 + + + False + True + vertical + + + True + False + 20 + Setting a certainty policy + + + + + + False + True + 0 + + + + + True + False + 10 + 10 + 10 + 40 + Because of changes in angles, distance, and other factors a face match is never exactly the same as the stored face model. On this page you can set how strict Howdy should be. + center + True + + + False + True + 1 + + + + + True + False + 60 + 60 + vertical + + + True + True + False + 10 + 0 + 0.50999999046325684 + True + True + radiobalanced + + + True + False + 5 + vertical + + + True + False + start + Fast + + + + + + False + True + 0 + + + + + True + False + start + Allows more fuzzy matches, +but speeds up the scanning process greatly. + True + + + False + True + 1 + + + + + + + False + True + 0 + + + + + True + True + False + 10 + 0 + True + True + + + True + False + 5 + vertical + + + True + False + start + Balanced + + + + + + False + True + 0 + + + + + True + False + start + Still relatively quick detection, +but might not log you in when further away. + True + + + False + True + 1 + + + + + + + False + True + 1 + + + + + True + True + False + 0 + True + True + radiobalanced + + + True + False + 5 + vertical + + + True + False + start + Secure + + + + + + False + False + 0 + + + + + True + False + start + The slightly safer option, +but will take much longer to authenticate you + True + + + False + False + 1 + + + + + + + False + True + 2 + + + + + False + True + 2 + + + + + False + True + 1 + + False @@ -171,7 +398,7 @@ You can open the Howdy Configurator later on to change more advanced settings or False True - 1 + 2 @@ -387,7 +614,7 @@ You can open the Howdy Configurator later on to change more advanced settings or False True - 6 + 5 @@ -461,7 +688,7 @@ You can open the Howdy Configurator later on to change more advanced settings or False True end - 7 + 8 diff --git a/howdy-gtk/src/onboarding.py b/howdy-gtk/src/onboarding.py index 01340f5..affa4fa 100644 --- a/howdy-gtk/src/onboarding.py +++ b/howdy-gtk/src/onboarding.py @@ -15,7 +15,6 @@ from gi.repository import Pango as pango class OnboardingWindow(gtk.Window): def __init__(self): """Initialize the sticky window""" - print("create") # Make the class a GTK window gtk.Window.__init__(self) @@ -34,7 +33,8 @@ class OnboardingWindow(gtk.Window): self.builder.get_object("slide1"), self.builder.get_object("slide2"), self.builder.get_object("slide3"), - self.builder.get_object("slide4") + self.builder.get_object("slide4"), + self.builder.get_object("slide5") ] self.window.show_all() @@ -49,7 +49,6 @@ class OnboardingWindow(gtk.Window): self.nextbutton.set_sensitive(False) self.slides[self.window.current_slide].hide() - # self.window.current_slide += 1 self.slides[self.window.current_slide + 1].show() self.window.current_slide += 1 @@ -61,6 +60,8 @@ class OnboardingWindow(gtk.Window): self.execute_slide3() elif self.window.current_slide == 4: self.execute_slide4() + elif self.window.current_slide == 5: + self.execute_slide5() def execute_slide1(self): self.downloadoutputlabel = self.builder.get_object("downloadoutputlabel") @@ -79,9 +80,11 @@ class OnboardingWindow(gtk.Window): def read_download_line(self): line = self.proc.stdout.readline() - print(line) self.download_lines.append(line.decode("utf-8")) + print("install.sh output:") + print(line.decode("utf-8")) + if len(self.download_lines) > 10: self.download_lines.pop(0) @@ -205,8 +208,8 @@ class OnboardingWindow(gtk.Window): def on_scanbutton_click(self, button): status = self.proc.wait(2) - if status != 0: - self.show_error(_("Error setting camera path"), _("Please set the camera path manually")) + # if status != 0: + # self.show_error(_("Error setting camera path"), _("Please set the camera path manually")) self.dialog = gtk.MessageDialog(parent=self, flags=gtk.DialogFlags.MODAL) self.dialog.set_title(_("Creating Model")) @@ -218,6 +221,8 @@ class OnboardingWindow(gtk.Window): def run_add(self): status, output = subprocess.getstatusoutput(["howdy add -y"]) + + print("howdy add output:") print(output) self.dialog.destroy() @@ -228,6 +233,28 @@ class OnboardingWindow(gtk.Window): gobject.timeout_add(10, self.go_next_slide) def execute_slide4(self): + self.enable_next() + + def execute_slide5(self): + radio_buttons = self.builder.get_object("radiobalanced").get_group() + radio_selected = False + radio_certanty = 5.0 + + for button in radio_buttons: + if button.get_active(): + radio_selected = gtk.Buildable.get_name(button) + + if not radio_selected: + self.show_error(_("Error reading radio buttons")) + elif radio_selected == "radiofast": + radio_certanty = 4.2 + elif radio_selected == "radiobalanced": + radio_certanty = 3.5 + elif radio_selected == "radiosecure": + radio_certanty = 2.2 + + self.proc = subprocess.Popen("howdy set certainty " + str(radio_certanty), stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True) + self.nextbutton.hide() self.builder.get_object("cancelbutton").hide() @@ -235,6 +262,11 @@ class OnboardingWindow(gtk.Window): finishbutton.show() self.window.set_focus(finishbutton) + status = self.proc.wait(2) + + if status != 0: + self.show_error(_("Error setting certainty"), _("Certainty is set to the default value, Howdy setup is complete")) + def enable_next(self): self.nextbutton.set_sensitive(True) self.window.set_focus(self.nextbutton) diff --git a/howdy-gtk/src/window.py b/howdy-gtk/src/window.py index b92904a..063adb1 100644 --- a/howdy-gtk/src/window.py +++ b/howdy-gtk/src/window.py @@ -112,8 +112,8 @@ signal.signal(signal.SIGINT, signal.SIG_DFL) # Make sure we run as sudo elevate.elevate() -# If no models have been created yet, start the onboarding -if os.path.exists("/lib/security/howdy/models"): +# If no models have been created yet or when it is forced, start the onboarding +if "--force-onboarding" in sys.argv or not os.path.exists("/lib/security/howdy/models"): import onboarding onboarding.OnboardingWindow()