From 4693020ca3d289a5559d3cc217d1b287f8b681d0 Mon Sep 17 00:00:00 2001 From: Huluti Date: Sun, 4 Dec 2016 19:43:38 +0100 Subject: [PATCH] Unique method to handle welcome btn signal --- src/manjaro-hello.glade | 9 ++++++--- src/manjaro-hello.py | 22 +++++++++++----------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/manjaro-hello.glade b/src/manjaro-hello.glade index 7bcdc69..9933c8c 100644 --- a/src/manjaro-hello.glade +++ b/src/manjaro-hello.glade @@ -190,10 +190,11 @@ We, the Manjaro Developers, hope that you will enjoy using Manjaro as much as we Read me + readmebtn True True True - + 0 @@ -203,10 +204,11 @@ We, the Manjaro Developers, hope that you will enjoy using Manjaro as much as we Release info + releasebtn True True True - + 0 @@ -230,10 +232,11 @@ We, the Manjaro Developers, hope that you will enjoy using Manjaro as much as we Get involved + involvedbtn True True True - + 2 diff --git a/src/manjaro-hello.py b/src/manjaro-hello.py index 722590c..c1d0f6c 100644 --- a/src/manjaro-hello.py +++ b/src/manjaro-hello.py @@ -105,17 +105,17 @@ class ManjaroHello(Gtk.Window): dialog.run() dialog.hide() - def on_readme_clicked(self, btn): - self.builder.get_object("stack").set_visible_child(self.builder.get_object("documentation")) - self.builder.get_object("documentation").set_current_page(0) - - def on_release_clicked(self, btn): - self.builder.get_object("stack").set_visible_child(self.builder.get_object("documentation")) - self.builder.get_object("documentation").set_current_page(1) - - def on_involved_clicked(self, btn): - self.builder.get_object("stack").set_visible_child(self.builder.get_object("project")) - self.builder.get_object("project").set_current_page(0) + def on_welcome_btn_clicked(self, btn): + name = btn.get_name() + if name == "readmebtn": + self.builder.get_object("stack").set_visible_child(self.builder.get_object("documentation")) + self.builder.get_object("documentation").set_current_page(0) + elif name == "releasebtn": + self.builder.get_object("stack").set_visible_child(self.builder.get_object("documentation")) + self.builder.get_object("documentation").set_current_page(1) + elif name == "involvedbtn": + self.builder.get_object("stack").set_visible_child(self.builder.get_object("project")) + self.builder.get_object("project").set_current_page(0) def on_autostart_switched(self, switch, _): autostart = True if switch.get_active() else False