Add install options on live sessions

merge-requests/64/head
Huluti 2016-12-08 17:39:52 +01:00
parent 03d993a28f
commit b5a8688579
5 changed files with 155 additions and 87 deletions

View File

@ -7,8 +7,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-12-04 21:02+0100\n" "POT-Creation-Date: 2016-12-08 17:07+0100\n"
"PO-Revision-Date: 2016-12-04 21:02+0100\n" "PO-Revision-Date: 2016-12-08 17:09+0100\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
"Language: fr\n" "Language: fr\n"
@ -22,19 +22,19 @@ msgstr ""
msgid "About" msgid "About"
msgstr "À propos" msgstr "À propos"
#: manjaro-hello.glade:14 #: manjaro-hello.glade:13
msgid "Welcome screen for Manjaro" msgid "Welcome screen for Manjaro"
msgstr "Écran de bienvenue pour Manjaro" msgstr "Écran de bienvenue pour Manjaro"
#: manjaro-hello.glade:16 #: manjaro-hello.glade:15
msgid "Github" msgid "Github"
msgstr "Github" msgstr "Github"
#: manjaro-hello.glade:105 #: manjaro-hello.glade:104
msgid "Welcome to Manjaro!" msgid "Welcome to Manjaro!"
msgstr "Bienvenue sur Manjaro !" msgstr "Bienvenue sur Manjaro !"
#: manjaro-hello.glade:122 #: manjaro-hello.glade:121
msgid "" msgid ""
"Thank you for joining our community!\n" "Thank you for joining our community!\n"
"\n" "\n"
@ -51,90 +51,97 @@ msgstr ""
"Alors profitez de l'expérience, et n'hésitez pas à nous faire part de vos " "Alors profitez de l'expérience, et n'hésitez pas à nous faire part de vos "
"commentaires." "commentaires."
#: manjaro-hello.glade:139 #: manjaro-hello.glade:138
msgid "DOCUMENTATION" msgid "DOCUMENTATION"
msgstr "DOCUMENTATION" msgstr "DOCUMENTATION"
#: manjaro-hello.glade:153 #: manjaro-hello.glade:152
msgid "SUPPORT" msgid "SUPPORT"
msgstr "SUPPORT" msgstr "SUPPORT"
#: manjaro-hello.glade:167 #: manjaro-hello.glade:166
msgid "PROJECT" msgid "PROJECT"
msgstr "PROJET" msgstr "PROJET"
#: manjaro-hello.glade:181 #: manjaro-hello.glade:178 manjaro-hello.glade:545
msgid "SOCIAL"
msgstr "SOCIAL"
#: manjaro-hello.glade:193 manjaro-hello.glade:450
msgid "Read me" msgid "Read me"
msgstr "Lisez moi" msgstr "Lisez moi"
#: manjaro-hello.glade:207 manjaro-hello.glade:483 #: manjaro-hello.glade:192 manjaro-hello.glade:585
msgid "Release info" msgid "Release info"
msgstr "Informations de version" msgstr "Informations de version"
#: manjaro-hello.glade:221 #: manjaro-hello.glade:206
msgid "Wiki" msgid "Wiki"
msgstr "Wiki" msgstr "Wiki"
#: manjaro-hello.glade:235 manjaro-hello.glade:535 #: manjaro-hello.glade:220 manjaro-hello.glade:646
msgid "Get involved" msgid "Get involved"
msgstr "S'investir" msgstr "S'investir"
#: manjaro-hello.glade:249 #: manjaro-hello.glade:234
msgid "Forums" msgid "Forums"
msgstr "Forums" msgstr "Forums"
#: manjaro-hello.glade:263 #: manjaro-hello.glade:248
msgid "Chat room" msgid "Chat room"
msgstr "Salon de chat" msgstr "Salon de chat"
#: manjaro-hello.glade:277 #: manjaro-hello.glade:262
msgid "Mailling lists" msgid "Mailling lists"
msgstr "Listes de diffusion" msgstr "Listes de diffusion"
#: manjaro-hello.glade:291 #: manjaro-hello.glade:276
msgid "Build Manjaro" msgid "Build Manjaro"
msgstr "Construire Manjaro" msgstr "Construire Manjaro"
#: manjaro-hello.glade:305 #: manjaro-hello.glade:290
msgid "Donate" msgid "Donate"
msgstr "Faire un don" msgstr "Faire un don"
#: manjaro-hello.glade:319 #: manjaro-hello.glade:406
msgid "Google+"
msgstr "Google+"
#: manjaro-hello.glade:333
msgid "Facebook"
msgstr "Facebook"
#: manjaro-hello.glade:347
msgid "Twitter"
msgstr "Twitter"
#: manjaro-hello.glade:361
msgid "Reddit"
msgstr "Reddit"
#: manjaro-hello.glade:378
msgid "Launch at start" msgid "Launch at start"
msgstr "Lancer au démarrage" msgstr "Lancer au démarrage"
#: manjaro-hello.glade:415 #: manjaro-hello.glade:443
msgid "Use Calamares (Graphic method)"
msgstr "Utiliser Calamares (Méthode graphique)"
#: manjaro-hello.glade:458
msgid "Use CLI-Installer (Command line)"
msgstr "Utiliser CLI-Installer (Ligne de commande)"
#: manjaro-hello.glade:482
msgid "INSTALLATION"
msgstr "INSTALLATION"
#: manjaro-hello.glade:501
msgid "Welcome" msgid "Welcome"
msgstr "Bienvenue" msgstr "Bienvenue"
#: manjaro-hello.glade:499 #: manjaro-hello.glade:601
msgid "Documentation" msgid "Documentation"
msgstr "Documentation" msgstr "Documentation"
#: manjaro-hello.glade:556 #: manjaro-hello.glade:667
msgid "Project" msgid "Project"
msgstr "Projet" msgstr "Projet"
#~ msgid "SOCIAL"
#~ msgstr "SOCIAL"
#~ msgid "Google+"
#~ msgstr "Google+"
#~ msgid "Facebook"
#~ msgstr "Facebook"
#~ msgid "Twitter"
#~ msgstr "Twitter"
#~ msgid "Reddit"
#~ msgstr "Reddit"
#~ msgid "Support" #~ msgid "Support"
#~ msgstr "Support" #~ msgstr "Support"

View File

@ -425,6 +425,48 @@ We, the Manjaro Developers, hope that you will enjoy using Manjaro as much as we
</packing> </packing>
</child> </child>
</object> </object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">9</property>
<property name="width">3</property>
</packing>
</child>
<child>
<object class="GtkButtonBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">10</property>
<property name="homogeneous">True</property>
<property name="layout_style">center</property>
<child>
<object class="GtkButton" id="installgui">
<property name="label" translatable="yes">Use Calamares (Graphic method)</property>
<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"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="installcli">
<property name="label" translatable="yes">Use CLI-Installer (Command line)</property>
<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"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
<property name="top_attach">8</property> <property name="top_attach">8</property>
@ -432,7 +474,17 @@ We, the Manjaro Developers, hope that you will enjoy using Manjaro as much as we
</packing> </packing>
</child> </child>
<child> <child>
<placeholder/> <object class="GtkLabel" id="installlabel">
<property name="can_focus">False</property>
<property name="label" translatable="yes">INSTALLATION</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">7</property>
</packing>
</child> </child>
<child> <child>
<placeholder/> <placeholder/>

View File

@ -7,6 +7,7 @@ import sys
import json import json
import webbrowser import webbrowser
import gi import gi
from subprocess import call
gi.require_version("Gtk", "3.0") gi.require_version("Gtk", "3.0")
from gi.repository import Gtk from gi.repository import Gtk
@ -22,7 +23,7 @@ class ManjaroHello():
self.preferences_path = config_path + self.app +".json" self.preferences_path = config_path + self.app +".json"
self.desktop_path = os.getcwd() + "/" + self.app + ".desktop" # later use share_path self.desktop_path = os.getcwd() + "/" + self.app + ".desktop" # later use share_path
self.autostart_path = config_path + "autostart/" + self.app + ".desktop" self.autostart_path = config_path + "autostart/" + self.app + ".desktop"
self.icon_path = self.app + ".png" self.icon_path = self.app + ".png" # later use share_path
# Languages vars # Languages vars
self.language = locale.getlocale()[0][:2] self.language = locale.getlocale()[0][:2]
@ -70,7 +71,19 @@ class ManjaroHello():
# Set autostart switcher state # Set autostart switcher state
self.builder.get_object("autostart").set_active(self.preferences["autostart"]) self.builder.get_object("autostart").set_active(self.preferences["autostart"])
self.window.show_all() # Live systems
if self.infos["live"]:
can_install = False
if os.path.isfile("/usr/bin/calamares"):
self.builder.get_object("installgui").set_visible(True)
can_install = True
if os.path.isfile("/usr/bin/cli-installer"):
self.builder.get_object("installcli").set_visible(True)
can_install = True
if can_install:
self.builder.get_object("installlabel").set_visible(True)
self.window.show();
def change_autostart(self, state): def change_autostart(self, state):
if state and not os.path.isfile(self.autostart_path): if state and not os.path.isfile(self.autostart_path):
@ -129,6 +142,10 @@ class ManjaroHello():
elif name == "involvedbtn": elif name == "involvedbtn":
self.builder.get_object("stack").set_visible_child(self.builder.get_object("project")) self.builder.get_object("stack").set_visible_child(self.builder.get_object("project"))
self.builder.get_object("project").set_current_page(0) self.builder.get_object("project").set_current_page(0)
elif name == "installgui":
call(["sudo", "-E", "calamares"])
elif name == "installcli":
call(["sudo cli-installer"])
def on_social_pressed(self, eventbox, _): def on_social_pressed(self, eventbox, _):
webbrowser.open_new_tab(self.social_urls[eventbox.get_name()]) webbrowser.open_new_tab(self.social_urls[eventbox.get_name()])
@ -146,7 +163,7 @@ def get_infos():
infos["codename"] = lsb.get("CODENAME", None) infos["codename"] = lsb.get("CODENAME", None)
infos["release"] = lsb.get("RELEASE", None) infos["release"] = lsb.get("RELEASE", None)
infos["arch"] = "64-bits" if sys.maxsize > 2**32 else "32-bits" infos["arch"] = "64-bits" if sys.maxsize > 2**32 else "32-bits"
infos["live"] = os.path.isfile("/bootmnt/manjaro") or os.path.isfile("/run/miso/bootmnt/manjaro") infos["live"] = os.path.exists("/bootmnt/manjaro") or os.path.exists("/run/miso/bootmnt/manjaro")
return infos return infos

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-12-04 21:02+0100\n" "POT-Creation-Date: 2016-12-08 17:26+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -21,19 +21,19 @@ msgstr ""
msgid "About" msgid "About"
msgstr "" msgstr ""
#: manjaro-hello.glade:14 #: manjaro-hello.glade:13
msgid "Welcome screen for Manjaro" msgid "Welcome screen for Manjaro"
msgstr "" msgstr ""
#: manjaro-hello.glade:16 #: manjaro-hello.glade:15
msgid "Github" msgid "Github"
msgstr "" msgstr ""
#: manjaro-hello.glade:105 #: manjaro-hello.glade:104
msgid "Welcome to Manjaro!" msgid "Welcome to Manjaro!"
msgstr "" msgstr ""
#: manjaro-hello.glade:122 #: manjaro-hello.glade:121
msgid "" msgid ""
"Thank you for joining our community!\n" "Thank you for joining our community!\n"
"\n" "\n"
@ -43,86 +43,78 @@ msgid ""
"your feedback." "your feedback."
msgstr "" msgstr ""
#: manjaro-hello.glade:139 #: manjaro-hello.glade:138
msgid "DOCUMENTATION" msgid "DOCUMENTATION"
msgstr "" msgstr ""
#: manjaro-hello.glade:153 #: manjaro-hello.glade:152
msgid "SUPPORT" msgid "SUPPORT"
msgstr "" msgstr ""
#: manjaro-hello.glade:167 #: manjaro-hello.glade:166
msgid "PROJECT" msgid "PROJECT"
msgstr "" msgstr ""
#: manjaro-hello.glade:181 #: manjaro-hello.glade:178 manjaro-hello.glade:542
msgid "SOCIAL"
msgstr ""
#: manjaro-hello.glade:193 manjaro-hello.glade:450
msgid "Read me" msgid "Read me"
msgstr "" msgstr ""
#: manjaro-hello.glade:207 manjaro-hello.glade:483 #: manjaro-hello.glade:192 manjaro-hello.glade:582
msgid "Release info" msgid "Release info"
msgstr "" msgstr ""
#: manjaro-hello.glade:221 #: manjaro-hello.glade:206
msgid "Wiki" msgid "Wiki"
msgstr "" msgstr ""
#: manjaro-hello.glade:235 manjaro-hello.glade:535 #: manjaro-hello.glade:220 manjaro-hello.glade:643
msgid "Get involved" msgid "Get involved"
msgstr "" msgstr ""
#: manjaro-hello.glade:249 #: manjaro-hello.glade:234
msgid "Forums" msgid "Forums"
msgstr "" msgstr ""
#: manjaro-hello.glade:263 #: manjaro-hello.glade:248
msgid "Chat room" msgid "Chat room"
msgstr "" msgstr ""
#: manjaro-hello.glade:277 #: manjaro-hello.glade:262
msgid "Mailling lists" msgid "Mailling lists"
msgstr "" msgstr ""
#: manjaro-hello.glade:291 #: manjaro-hello.glade:276
msgid "Build Manjaro" msgid "Build Manjaro"
msgstr "" msgstr ""
#: manjaro-hello.glade:305 #: manjaro-hello.glade:290
msgid "Donate" msgid "Donate"
msgstr "" msgstr ""
#: manjaro-hello.glade:319 #: manjaro-hello.glade:406
msgid "Google+"
msgstr ""
#: manjaro-hello.glade:333
msgid "Facebook"
msgstr ""
#: manjaro-hello.glade:347
msgid "Twitter"
msgstr ""
#: manjaro-hello.glade:361
msgid "Reddit"
msgstr ""
#: manjaro-hello.glade:378
msgid "Launch at start" msgid "Launch at start"
msgstr "" msgstr ""
#: manjaro-hello.glade:415 #: manjaro-hello.glade:443
msgid "Use Calamares (Graphic method)"
msgstr ""
#: manjaro-hello.glade:457
msgid "Use CLI-Installer (Command line)"
msgstr ""
#: manjaro-hello.glade:479
msgid "INSTALLATION"
msgstr ""
#: manjaro-hello.glade:498
msgid "Welcome" msgid "Welcome"
msgstr "" msgstr ""
#: manjaro-hello.glade:499 #: manjaro-hello.glade:598
msgid "Documentation" msgid "Documentation"
msgstr "" msgstr ""
#: manjaro-hello.glade:556 #: manjaro-hello.glade:664
msgid "Project" msgid "Project"
msgstr "" msgstr ""