Replace GtkLinkButton by GtkButton

merge-requests/64/head
Huluti 2016-12-10 01:00:05 +01:00
parent b99c0aabf1
commit b5e3704d05
2 changed files with 41 additions and 25 deletions

View File

@ -179,7 +179,7 @@ We, the Manjaro Developers, hope that you will enjoy using Manjaro as much as we
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<signal name="clicked" handler="on_welcome_btn_clicked" swapped="no"/>
<signal name="clicked" handler="on_action_btn_clicked" swapped="no"/>
</object>
<packing>
<property name="left_attach">0</property>
@ -193,7 +193,7 @@ We, the Manjaro Developers, hope that you will enjoy using Manjaro as much as we
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<signal name="clicked" handler="on_welcome_btn_clicked" swapped="no"/>
<signal name="clicked" handler="on_action_btn_clicked" swapped="no"/>
</object>
<packing>
<property name="left_attach">0</property>
@ -201,13 +201,13 @@ We, the Manjaro Developers, hope that you will enjoy using Manjaro as much as we
</packing>
</child>
<child>
<object class="GtkLinkButton">
<object class="GtkButton">
<property name="label" translatable="yes">Wiki</property>
<property name="name">wikibtn</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="relief">none</property>
<property name="uri">https://wiki.manjaro.org</property>
<property name="receives_default">False</property>
<signal name="clicked" handler="on_link_btn_clicked" swapped="no"/>
</object>
<packing>
<property name="left_attach">0</property>
@ -221,7 +221,7 @@ We, the Manjaro Developers, hope that you will enjoy using Manjaro as much as we
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<signal name="clicked" handler="on_welcome_btn_clicked" swapped="no"/>
<signal name="clicked" handler="on_action_btn_clicked" swapped="no"/>
</object>
<packing>
<property name="left_attach">2</property>
@ -229,13 +229,13 @@ We, the Manjaro Developers, hope that you will enjoy using Manjaro as much as we
</packing>
</child>
<child>
<object class="GtkLinkButton">
<object class="GtkButton">
<property name="label" translatable="yes">Forums</property>
<property name="name">forumsbtn</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="relief">none</property>
<property name="uri">https://forum.manjaro.org</property>
<signal name="clicked" handler="on_link_btn_clicked" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
@ -243,13 +243,13 @@ We, the Manjaro Developers, hope that you will enjoy using Manjaro as much as we
</packing>
</child>
<child>
<object class="GtkLinkButton">
<object class="GtkButton">
<property name="label" translatable="yes">Chat room</property>
<property name="name">chatbtn</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="relief">none</property>
<property name="uri">https://kiwiirc.com/client/irc.freenode.net/?nick=manjaro-web|?#manjaro</property>
<signal name="clicked" handler="on_link_btn_clicked" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
@ -257,13 +257,13 @@ We, the Manjaro Developers, hope that you will enjoy using Manjaro as much as we
</packing>
</child>
<child>
<object class="GtkLinkButton">
<object class="GtkButton">
<property name="label" translatable="yes">Mailling lists</property>
<property name="name">maillingbtn</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="relief">none</property>
<property name="uri">https://lists.manjaro.org/cgi-bin/mailman/listinfo</property>
<signal name="clicked" handler="on_link_btn_clicked" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
@ -271,13 +271,13 @@ We, the Manjaro Developers, hope that you will enjoy using Manjaro as much as we
</packing>
</child>
<child>
<object class="GtkLinkButton">
<object class="GtkButton">
<property name="label" translatable="yes">Build Manjaro</property>
<property name="name">buildbtn</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="relief">none</property>
<property name="uri">https://github.com/manjaro</property>
<signal name="clicked" handler="on_link_btn_clicked" swapped="no"/>
</object>
<packing>
<property name="left_attach">2</property>
@ -285,13 +285,13 @@ We, the Manjaro Developers, hope that you will enjoy using Manjaro as much as we
</packing>
</child>
<child>
<object class="GtkLinkButton">
<object class="GtkButton">
<property name="label" translatable="yes">Donate</property>
<property name="name">donatebtn</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="relief">none</property>
<property name="uri">https://manjaro.org/donate</property>
<signal name="clicked" handler="on_link_btn_clicked" swapped="no"/>
</object>
<packing>
<property name="left_attach">2</property>
@ -443,7 +443,7 @@ We, the Manjaro Developers, hope that you will enjoy using Manjaro as much as we
<property name="name">installgui</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<signal name="clicked" handler="on_welcome_btn_clicked" swapped="no"/>
<signal name="clicked" handler="on_action_btn_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
@ -457,7 +457,7 @@ We, the Manjaro Developers, hope that you will enjoy using Manjaro as much as we
<property name="name">installcli</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<signal name="clicked" handler="on_welcome_btn_clicked" swapped="no"/>
<signal name="clicked" handler="on_action_btn_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
@ -707,4 +707,9 @@ We, the Manjaro Developers, hope that you will enjoy using Manjaro as much as we
</object>
</child>
</object>
<object class="GtkImage" id="inapp">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">document-new</property>
</object>
</interface>

View File

@ -17,6 +17,14 @@ class ManjaroHello():
self.app = "manjaro-hello"
self.default_locale = "en_US"
self.sys_locale = locale.getdefaultlocale()[0]
self.welcome_urls = {
"wiki": "https://wiki.manjaro.org",
"forums": "https://forum.manjaro.org",
"chat": "https://kiwiirc.com/client/irc.freenode.net/?nick=manjaro-web|?#manjaro",
"mailling": "https://lists.manjaro.org/cgi-bin/mailman/listinfo",
"build": "https://github.com/manjaro",
"donate": "https://manjaro.org/donate"
}
self.social_urls = {
"google+": "https://plus.google.com/118244873957924966264",
"facebook": "https://www.facebook.com/ManjaroLinux",
@ -147,7 +155,7 @@ class ManjaroHello():
dialog.run()
dialog.hide()
def on_welcome_btn_clicked(self, btn):
def on_action_btn_clicked(self, btn):
name = btn.get_name()
if name == "readmebtn":
self.builder.get_object("stack").set_visible_child(self.builder.get_object("documentation"))
@ -163,6 +171,9 @@ class ManjaroHello():
elif name == "installcli":
subprocess.call(["sudo cli-installer"])
def on_link_btn_clicked(self, btn):
webbrowser.open_new_tab(self.welcome_urls[btn.get_name()[:-3]])
def on_social_pressed(self, eventbox, _):
webbrowser.open_new_tab(self.social_urls[eventbox.get_name()])