Handle PKGBUILD

merge-requests/64/head
Huluti 2016-12-10 17:34:29 +01:00
parent f531d48e61
commit 9e9c5279ac
10 changed files with 23 additions and 17 deletions

0
BUILD/PKGBUILD 100644
View File

View File

Before

Width:  |  Height:  |  Size: 469 B

After

Width:  |  Height:  |  Size: 469 B

View File

Before

Width:  |  Height:  |  Size: 671 B

After

Width:  |  Height:  |  Size: 671 B

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 687 B

After

Width:  |  Height:  |  Size: 687 B

View File

@ -317,10 +317,9 @@ We, the Manjaro Developers, hope that you will enjoy using Manjaro as much as we
<property name="can_focus">False</property>
<signal name="button-press-event" handler="on_social_pressed" swapped="no"/>
<child>
<object class="GtkImage">
<object class="GtkImage" id="google+">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixbuf">img/google+.png</property>
</object>
</child>
</object>
@ -337,10 +336,9 @@ We, the Manjaro Developers, hope that you will enjoy using Manjaro as much as we
<property name="can_focus">False</property>
<signal name="button-press-event" handler="on_social_pressed" swapped="no"/>
<child>
<object class="GtkImage">
<object class="GtkImage" id="facebook">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixbuf">img/facebook.png</property>
</object>
</child>
</object>
@ -357,10 +355,9 @@ We, the Manjaro Developers, hope that you will enjoy using Manjaro as much as we
<property name="can_focus">False</property>
<signal name="button-press-event" handler="on_social_pressed" swapped="no"/>
<child>
<object class="GtkImage">
<object class="GtkImage" id="twitter">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixbuf">img/twitter.png</property>
</object>
</child>
</object>
@ -377,10 +374,9 @@ We, the Manjaro Developers, hope that you will enjoy using Manjaro as much as we
<property name="can_focus">False</property>
<signal name="button-press-event" handler="on_social_pressed" swapped="no"/>
<child>
<object class="GtkImage">
<object class="GtkImage" id="reddit">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixbuf">img/reddit.png</property>
</object>
</child>
</object>

View File

@ -33,13 +33,17 @@ class ManjaroHello():
}
# Path vars
config_path = os.path.expanduser("~") + "/.config/"
#share_path = "/usr/share/"
self.preferences_path = config_path + self.app + ".json"
self.desktop_path = os.getcwd() + "/" + self.app + ".desktop" # later use share_path
self.autostart_path = config_path + "autostart/" + self.app + ".desktop"
self.icon_path = self.app + ".png" # later use share_path
self.locale_path = "locale" # later use share_path
self.current_folder = os.getcwd() + "/"
if os.path.exists("/usr/share/" + self.app + "/data/"):
self.data_path = "/usr/share/" + self.app + "/data/"
self.locale_path = "/usr/share/locale/"
else:
self.data_path = self.current_folder + "data/"
self.locale_path = "locale/"
self.config_path = os.path.expanduser("~") + "/.config/"
self.preferences_path = self.config_path + self.app + ".json"
self.desktop_path = self.current_folder + self.app + ".desktop"
self.autostart_path = self.config_path + "autostart/" + self.app + ".desktop"
# Load preferences
self.preferences = self.get_preferences()
@ -84,6 +88,12 @@ class ManjaroHello():
self.builder.get_object("headerbar").props.subtitle = self.infos["codename"] + " " + self.infos["release"] + " "
self.builder.get_object("headerbar").props.subtitle += self.infos["arch"]
# Load images
self.builder.get_object("google+").set_from_file(self.data_path + "img/google+.png")
self.builder.get_object("facebook").set_from_file(self.data_path + "img/facebook.png")
self.builder.get_object("twitter").set_from_file(self.data_path + "img/twitter.png")
self.builder.get_object("reddit").set_from_file(self.data_path + "img/reddit.png")
# Set autostart switcher state
self.builder.get_object("autostart").set_active(self.preferences["autostart"])
@ -134,9 +144,9 @@ class ManjaroHello():
return None
def read_page(self, name):
filename = "pages/{}/{}".format(self.preferences["locale"], name)
filename = self.data_path + "pages/{}/{}".format(self.preferences["locale"], name)
if not os.path.isfile(filename):
filename = "pages/{}/{}".format(self.default_locale, name)
filename = self.data_path + "pages/{}/{}".format(self.default_locale, name)
try:
with open(filename, "r") as f:
return f.read()