Re-create on_btn_clicked() to simplify future changes
parent
925f44e44f
commit
076d81303b
|
@ -218,9 +218,7 @@ class ManjaroHello():
|
||||||
def on_action_clicked(self, action, _=None):
|
def on_action_clicked(self, action, _=None):
|
||||||
"""Event for differents actions."""
|
"""Event for differents actions."""
|
||||||
name = action.get_name()
|
name = action.get_name()
|
||||||
if name in ("welcome", "readme", "release", "involved"):
|
if name == "installgui":
|
||||||
self.builder.get_object("stack").set_visible_child(self.builder.get_object(name + "page"))
|
|
||||||
elif name == "installgui":
|
|
||||||
subprocess.call(["sudo", "-E", "calamares"])
|
subprocess.call(["sudo", "-E", "calamares"])
|
||||||
elif name == "installcli":
|
elif name == "installcli":
|
||||||
subprocess.call(["sudo cli-installer"])
|
subprocess.call(["sudo cli-installer"])
|
||||||
|
@ -233,6 +231,10 @@ class ManjaroHello():
|
||||||
dialog.run()
|
dialog.run()
|
||||||
dialog.hide()
|
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):
|
def on_link_clicked(self, link, _=None):
|
||||||
"""Event for clicked link."""
|
"""Event for clicked link."""
|
||||||
webbrowser.open_new_tab(self.urls[link.get_name()])
|
webbrowser.open_new_tab(self.urls[link.get_name()])
|
||||||
|
|
|
@ -171,7 +171,7 @@ We, the Manjaro Developers, hope that you will enjoy using Manjaro as much as we
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="receives_default">True</property>
|
<property name="receives_default">True</property>
|
||||||
<signal name="clicked" handler="on_action_clicked" swapped="no"/>
|
<signal name="clicked" handler="on_btn_clicked" swapped="no"/>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">0</property>
|
<property name="left_attach">0</property>
|
||||||
|
@ -185,7 +185,7 @@ We, the Manjaro Developers, hope that you will enjoy using Manjaro as much as we
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="receives_default">True</property>
|
<property name="receives_default">True</property>
|
||||||
<signal name="clicked" handler="on_action_clicked" swapped="no"/>
|
<signal name="clicked" handler="on_btn_clicked" swapped="no"/>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">0</property>
|
<property name="left_attach">0</property>
|
||||||
|
@ -213,7 +213,7 @@ We, the Manjaro Developers, hope that you will enjoy using Manjaro as much as we
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="receives_default">True</property>
|
<property name="receives_default">True</property>
|
||||||
<signal name="clicked" handler="on_action_clicked" swapped="no"/>
|
<signal name="clicked" handler="on_btn_clicked" swapped="no"/>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">2</property>
|
<property name="left_attach">2</property>
|
||||||
|
@ -577,7 +577,7 @@ We, the Manjaro Developers, hope that you will enjoy using Manjaro as much as we
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="receives_default">True</property>
|
<property name="receives_default">True</property>
|
||||||
<property name="image">homeicon</property>
|
<property name="image">homeicon</property>
|
||||||
<signal name="clicked" handler="on_action_clicked" swapped="no"/>
|
<signal name="clicked" handler="on_btn_clicked" swapped="no"/>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
|
|
Loading…
Reference in New Issue