From 076d81303b361df98769d480b2adff9e10f29e8b Mon Sep 17 00:00:00 2001 From: Hugo Posnic Date: Sat, 17 Dec 2016 23:55:19 +0100 Subject: [PATCH] Re-create on_btn_clicked() to simplify future changes --- src/manjaro-hello.py | 8 +++++--- ui/manjaro-hello.glade | 8 ++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/manjaro-hello.py b/src/manjaro-hello.py index 220da99..bf68cf6 100644 --- a/src/manjaro-hello.py +++ b/src/manjaro-hello.py @@ -218,9 +218,7 @@ class ManjaroHello(): def on_action_clicked(self, action, _=None): """Event for differents actions.""" name = action.get_name() - if name in ("welcome", "readme", "release", "involved"): - self.builder.get_object("stack").set_visible_child(self.builder.get_object(name + "page")) - elif name == "installgui": + if name == "installgui": subprocess.call(["sudo", "-E", "calamares"]) elif name == "installcli": subprocess.call(["sudo cli-installer"]) @@ -233,6 +231,10 @@ class ManjaroHello(): dialog.run() dialog.hide() + def on_btn_clicked(self, btn): + """Event for clicked button.""" + self.builder.get_object("stack").set_visible_child(self.builder.get_object(btn.get_name() + "page")) + def on_link_clicked(self, link, _=None): """Event for clicked link.""" webbrowser.open_new_tab(self.urls[link.get_name()]) diff --git a/ui/manjaro-hello.glade b/ui/manjaro-hello.glade index e5af604..578a7d9 100644 --- a/ui/manjaro-hello.glade +++ b/ui/manjaro-hello.glade @@ -171,7 +171,7 @@ We, the Manjaro Developers, hope that you will enjoy using Manjaro as much as we True True True - + 0 @@ -185,7 +185,7 @@ We, the Manjaro Developers, hope that you will enjoy using Manjaro as much as we True True True - + 0 @@ -213,7 +213,7 @@ We, the Manjaro Developers, hope that you will enjoy using Manjaro as much as we True True True - + 2 @@ -577,7 +577,7 @@ We, the Manjaro Developers, hope that you will enjoy using Manjaro as much as we True True homeicon - +