Change structure to prepare build

merge-requests/64/head
Huluti 2016-12-11 18:12:01 +01:00
parent 6a67be6e15
commit c5c8b7b7b3
13 changed files with 16 additions and 11 deletions

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: 399 B

After

Width:  |  Height:  |  Size: 399 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

@ -1,2 +0,0 @@
Generate main translation file:
xgettext -k_ -kN_ -L Glade -o manjaro-hello.pot *.glade

View File

@ -9,7 +9,7 @@ import subprocess
import sys import sys
import webbrowser import webbrowser
gi.require_version("Gtk", "3.0") gi.require_version("Gtk", "3.0")
from gi.repository import Gtk from gi.repository import Gtk, GdkPixbuf
class ManjaroHello(): class ManjaroHello():
def __init__(self): def __init__(self):
@ -35,13 +35,18 @@ class ManjaroHello():
if self.current_folder == "/usr/bin/": if self.current_folder == "/usr/bin/":
self.data_path = "/usr/share/" + self.app + "/data/" self.data_path = "/usr/share/" + self.app + "/data/"
self.locale_path = "/usr/share/locale/" self.locale_path = "/usr/share/locale/"
self.ui_path = "/usr/share/" + self.app + "/ui/"
self.desktop_path = "/usr/share/applications/" + self.app + ".desktop"
else: else:
self.data_path = self.current_folder + "data/" self.data_path = "../data/"
self.locale_path = "locale/" self.locale_path = "locale/"
self.ui_path = "../ui/"
self.desktop_path = self.current_folder[:-4] + self.app + ".desktop"
self.config_path = os.path.expanduser("~") + "/.config/" self.config_path = os.path.expanduser("~") + "/.config/"
self.preferences_path = self.config_path + self.app + ".json" 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" self.autostart_path = self.config_path + "autostart/" + self.app + ".desktop"
self.logo_path = self.data_path + "img/manjaro-hello.png"
# Load preferences # Load preferences
self.preferences = self.get_preferences() self.preferences = self.get_preferences()
@ -51,10 +56,15 @@ class ManjaroHello():
# Init window # Init window
self.builder = Gtk.Builder() self.builder = Gtk.Builder()
self.builder.add_from_file("manjaro-hello.glade") self.builder.add_from_file(self.ui_path + "manjaro-hello.glade")
self.builder.connect_signals(self) self.builder.connect_signals(self)
self.window = self.builder.get_object("window") self.window = self.builder.get_object("window")
# Load logos
self.window.set_icon_from_file(self.logo_path)
self.builder.get_object("manjaroicon").set_from_file(self.logo_path)
self.builder.get_object("aboutdialog").set_logo(GdkPixbuf.Pixbuf.new_from_file(self.logo_path))
# Init translation # Init translation
self.default_locale = "en_US" self.default_locale = "en_US"
self.sys_locale = locale.getdefaultlocale()[0] self.sys_locale = locale.getdefaultlocale()[0]

View File

@ -6,7 +6,6 @@
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="title" translatable="yes">About</property> <property name="title" translatable="yes">About</property>
<property name="modal">True</property> <property name="modal">True</property>
<property name="icon">manjaro-hello.png</property>
<property name="type_hint">dialog</property> <property name="type_hint">dialog</property>
<property name="program_name">Manjaro Hello</property> <property name="program_name">Manjaro Hello</property>
<property name="version">git</property> <property name="version">git</property>
@ -14,7 +13,7 @@
<property name="website">https://github.com/Huluti/manjaro-hello</property> <property name="website">https://github.com/Huluti/manjaro-hello</property>
<property name="website_label" translatable="yes">Github</property> <property name="website_label" translatable="yes">Github</property>
<property name="authors">Hugo Posnic</property> <property name="authors">Hugo Posnic</property>
<property name="logo">manjaro-hello.png</property> <property name="logo_icon_name"/>
<property name="license_type">gpl-3-0</property> <property name="license_type">gpl-3-0</property>
<child internal-child="vbox"> <child internal-child="vbox">
<object class="GtkBox"> <object class="GtkBox">
@ -55,7 +54,6 @@
<property name="width_request">800</property> <property name="width_request">800</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="window_position">center</property> <property name="window_position">center</property>
<property name="icon">manjaro-hello.png</property>
<property name="has_resize_grip">True</property> <property name="has_resize_grip">True</property>
<signal name="delete-event" handler="on_delete_window" swapped="no"/> <signal name="delete-event" handler="on_delete_window" swapped="no"/>
<child> <child>
@ -89,10 +87,9 @@
<property name="row_spacing">20</property> <property name="row_spacing">20</property>
<property name="column_spacing">10</property> <property name="column_spacing">10</property>
<child> <child>
<object class="GtkImage"> <object class="GtkImage" id="manjaroicon">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="pixbuf">manjaro-hello.png</property>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>