Replace social section by icons in bottom

This commit is contained in:
Huluti
2016-12-05 18:41:28 +01:00
parent 42abef2e45
commit a1a1daa2dc
6 changed files with 140 additions and 96 deletions
+13 -1
View File
@@ -4,8 +4,9 @@ import locale
import gettext
import os
import json
import gi
import shutil
import webbrowser
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
@@ -31,6 +32,14 @@ class ManjaroHello(Gtk.Window):
self.infos = get_infos()
# Social urls
self.social_urls = {
"google+": "https://plus.google.com/118244873957924966264",
"facebook": "https://www.facebook.com/ManjaroLinux",
"twitter": "https://twitter.com/ManjaroLinux",
"reddit": "https://www.reddit.com/r/ManjaroLinux"
}
# Init language
locale.setlocale(locale.LC_ALL, "")
locale.bindtextdomain(self.app, self.locale_dir)
@@ -115,6 +124,9 @@ class ManjaroHello(Gtk.Window):
self.builder.get_object("stack").set_visible_child(self.builder.get_object("project"))
self.builder.get_object("project").set_current_page(0)
def on_social_pressed(self, eventbox, _):
webbrowser.open_new_tab(self.social_urls[eventbox.get_name()])
def on_autostart_switched(self, switch, _):
autostart = True if switch.get_active() else False
self.change_autostart(autostart)