From b5a8688579933855e455fb4351dd87ae4b7263f3 Mon Sep 17 00:00:00 2001 From: Huluti Date: Thu, 8 Dec 2016 17:39:52 +0100 Subject: [PATCH] Add install options on live sessions --- src/locale/fr/LC_MESSAGES/manjaro-hello.mo | Bin 2167 -> 2230 bytes src/locale/fr/LC_MESSAGES/manjaro-hello.po | 91 +++++++++++---------- src/manjaro-hello.glade | 54 +++++++++++- src/manjaro-hello.py | 23 +++++- src/messages.pot | 74 ++++++++--------- 5 files changed, 155 insertions(+), 87 deletions(-) diff --git a/src/locale/fr/LC_MESSAGES/manjaro-hello.mo b/src/locale/fr/LC_MESSAGES/manjaro-hello.mo index efc09e39fb2d78966526787b259e048090e344ef..ee53c6923b96497c64dd0b4a91b8a93ecda50780 100644 GIT binary patch delta 849 zcmZ9Jy=xRf7>DQX)=P|u-o=l6C}u>&Tu@1{hz9&PgND^Jkt7FN$&wo{3%h$}_Y@&T zARrR3TNEt(1JpEfkiyo=!oot(Mo_Hn)JpJq&xsOW_BYSGvorht-r1jpjpE9uUgwb_ z2G9ZY6&*qA83y8fR;g{U413@d+zzWYziAo5JnPGrtFW7V&E}77{uJ(F{W;vJ)QWn= zq=SVwmhUV-LixaFn}34?nEC-V>jg)tgK!MW`D<_xUWdD30(sN}hAW(V2*vmZy6J^q zU=Q`x_x41o9QLKdB9y{IP&zus&;?K0{4A9B7vUZ_3#DM)zF)Rng;H=0_Q4d2(HF3e zp%xsWzS`fZ)KPc|%7F-Kcn`|KCr~e8uHBGy zzZqxbze`8~3F%BiZbG_}4yF4d5;J>|gcw!njqK%gJv-R#PS4GkE0yxRJ2RcW%}#U$ z#!HO$qg##EQ0{Q%T$OCH;vRRSr0E5LiS_VgBMiN$rUO4RCDq>G1zzaICeg!Fv3GmX zU(lgxE;eeV)OGH6oYG_C6Qkqld*_gypKkqfMl$JWzJIHOnf!%5m)ddYHT_1E=$g@Y zO`I@qZRD3Sv(=^__z5ol^HlNck&)dCf6R%ozgz#gyZZW>*fP4_wz+i2l+qKO?r(%& Be=q<5 delta 784 zcmYL{!Al!K6o)5kl8ue6Mr$?J!ZL40j2X_?q9Ph<% z@jm<_z<_=LHQa(>)_=kX+%@_DwxExUK7%&;9JVS|Rlk@#Vd2Vb zTpQjQ-a`o-YI+FN0!7E61ae@U%f2!?8GKlufj#V}VFxTi9#vy_%lQr1On!AqdF^cc zfl}d(;k{v$Y*IlSN@e{}E-=jS2#y&&0p&u|@F{!;C9yX9tA=Y(I=CsC{A!y?7yMxk z96||n3Ul1_%;*8K%ZtO%fe9$@eS}h333A-G7-JjWjY}73wW2`{qc%U*CkaqDI_+21 z38f=q@?S_bl0dp39TJmI_ROCt6@^l1+-QMxCgLTm89Vb;e{tP!Ud`&Yr(8Ez&_mvy zHQt@g<|`_#3p!KQPJVI0Rqy8}Qxmht*VfB`{b40vspyh77hJdBIHRw}M@GHh!58)U yaZ_k8&Rvej diff --git a/src/locale/fr/LC_MESSAGES/manjaro-hello.po b/src/locale/fr/LC_MESSAGES/manjaro-hello.po index 19621ec..b67be6d 100644 --- a/src/locale/fr/LC_MESSAGES/manjaro-hello.po +++ b/src/locale/fr/LC_MESSAGES/manjaro-hello.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-12-04 21:02+0100\n" -"PO-Revision-Date: 2016-12-04 21:02+0100\n" +"POT-Creation-Date: 2016-12-08 17:07+0100\n" +"PO-Revision-Date: 2016-12-08 17:09+0100\n" "Last-Translator: \n" "Language-Team: \n" "Language: fr\n" @@ -22,19 +22,19 @@ msgstr "" msgid "About" msgstr "À propos" -#: manjaro-hello.glade:14 +#: manjaro-hello.glade:13 msgid "Welcome screen for Manjaro" msgstr "Écran de bienvenue pour Manjaro" -#: manjaro-hello.glade:16 +#: manjaro-hello.glade:15 msgid "Github" msgstr "Github" -#: manjaro-hello.glade:105 +#: manjaro-hello.glade:104 msgid "Welcome to Manjaro!" msgstr "Bienvenue sur Manjaro !" -#: manjaro-hello.glade:122 +#: manjaro-hello.glade:121 msgid "" "Thank you for joining our community!\n" "\n" @@ -51,90 +51,97 @@ msgstr "" "Alors profitez de l'expérience, et n'hésitez pas à nous faire part de vos " "commentaires." -#: manjaro-hello.glade:139 +#: manjaro-hello.glade:138 msgid "DOCUMENTATION" msgstr "DOCUMENTATION" -#: manjaro-hello.glade:153 +#: manjaro-hello.glade:152 msgid "SUPPORT" msgstr "SUPPORT" -#: manjaro-hello.glade:167 +#: manjaro-hello.glade:166 msgid "PROJECT" msgstr "PROJET" -#: manjaro-hello.glade:181 -msgid "SOCIAL" -msgstr "SOCIAL" - -#: manjaro-hello.glade:193 manjaro-hello.glade:450 +#: manjaro-hello.glade:178 manjaro-hello.glade:545 msgid "Read me" msgstr "Lisez moi" -#: manjaro-hello.glade:207 manjaro-hello.glade:483 +#: manjaro-hello.glade:192 manjaro-hello.glade:585 msgid "Release info" msgstr "Informations de version" -#: manjaro-hello.glade:221 +#: manjaro-hello.glade:206 msgid "Wiki" msgstr "Wiki" -#: manjaro-hello.glade:235 manjaro-hello.glade:535 +#: manjaro-hello.glade:220 manjaro-hello.glade:646 msgid "Get involved" msgstr "S'investir" -#: manjaro-hello.glade:249 +#: manjaro-hello.glade:234 msgid "Forums" msgstr "Forums" -#: manjaro-hello.glade:263 +#: manjaro-hello.glade:248 msgid "Chat room" msgstr "Salon de chat" -#: manjaro-hello.glade:277 +#: manjaro-hello.glade:262 msgid "Mailling lists" msgstr "Listes de diffusion" -#: manjaro-hello.glade:291 +#: manjaro-hello.glade:276 msgid "Build Manjaro" msgstr "Construire Manjaro" -#: manjaro-hello.glade:305 +#: manjaro-hello.glade:290 msgid "Donate" msgstr "Faire un don" -#: manjaro-hello.glade:319 -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 +#: manjaro-hello.glade:406 msgid "Launch at start" 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" msgstr "Bienvenue" -#: manjaro-hello.glade:499 +#: manjaro-hello.glade:601 msgid "Documentation" msgstr "Documentation" -#: manjaro-hello.glade:556 +#: manjaro-hello.glade:667 msgid "Project" msgstr "Projet" +#~ msgid "SOCIAL" +#~ msgstr "SOCIAL" + +#~ msgid "Google+" +#~ msgstr "Google+" + +#~ msgid "Facebook" +#~ msgstr "Facebook" + +#~ msgid "Twitter" +#~ msgstr "Twitter" + +#~ msgid "Reddit" +#~ msgstr "Reddit" + #~ msgid "Support" #~ msgstr "Support" diff --git a/src/manjaro-hello.glade b/src/manjaro-hello.glade index 0193b9a..27ce423 100644 --- a/src/manjaro-hello.glade +++ b/src/manjaro-hello.glade @@ -425,6 +425,48 @@ We, the Manjaro Developers, hope that you will enjoy using Manjaro as much as we + + 0 + 9 + 3 + + + + + True + False + 10 + True + center + + + Use Calamares (Graphic method) + installgui + True + True + + + + True + True + 0 + + + + + Use CLI-Installer (Command line) + installcli + True + True + + + + True + True + 1 + + + 0 8 @@ -432,7 +474,17 @@ We, the Manjaro Developers, hope that you will enjoy using Manjaro as much as we - + + False + INSTALLATION + + + + + + 1 + 7 + diff --git a/src/manjaro-hello.py b/src/manjaro-hello.py index d9273e5..3fb51bd 100644 --- a/src/manjaro-hello.py +++ b/src/manjaro-hello.py @@ -7,6 +7,7 @@ import sys import json import webbrowser import gi +from subprocess import call gi.require_version("Gtk", "3.0") from gi.repository import Gtk @@ -22,7 +23,7 @@ class ManjaroHello(): 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" + self.icon_path = self.app + ".png" # later use share_path # Languages vars self.language = locale.getlocale()[0][:2] @@ -70,7 +71,19 @@ class ManjaroHello(): # Set autostart switcher state 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): if state and not os.path.isfile(self.autostart_path): @@ -129,6 +142,10 @@ class ManjaroHello(): elif name == "involvedbtn": self.builder.get_object("stack").set_visible_child(self.builder.get_object("project")) 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, _): webbrowser.open_new_tab(self.social_urls[eventbox.get_name()]) @@ -146,7 +163,7 @@ def get_infos(): infos["codename"] = lsb.get("CODENAME", None) infos["release"] = lsb.get("RELEASE", None) 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 diff --git a/src/messages.pot b/src/messages.pot index 94b3aab..304a911 100644 --- a/src/messages.pot +++ b/src/messages.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\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" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -21,19 +21,19 @@ msgstr "" msgid "About" msgstr "" -#: manjaro-hello.glade:14 +#: manjaro-hello.glade:13 msgid "Welcome screen for Manjaro" msgstr "" -#: manjaro-hello.glade:16 +#: manjaro-hello.glade:15 msgid "Github" msgstr "" -#: manjaro-hello.glade:105 +#: manjaro-hello.glade:104 msgid "Welcome to Manjaro!" msgstr "" -#: manjaro-hello.glade:122 +#: manjaro-hello.glade:121 msgid "" "Thank you for joining our community!\n" "\n" @@ -43,86 +43,78 @@ msgid "" "your feedback." msgstr "" -#: manjaro-hello.glade:139 +#: manjaro-hello.glade:138 msgid "DOCUMENTATION" msgstr "" -#: manjaro-hello.glade:153 +#: manjaro-hello.glade:152 msgid "SUPPORT" msgstr "" -#: manjaro-hello.glade:167 +#: manjaro-hello.glade:166 msgid "PROJECT" msgstr "" -#: manjaro-hello.glade:181 -msgid "SOCIAL" -msgstr "" - -#: manjaro-hello.glade:193 manjaro-hello.glade:450 +#: manjaro-hello.glade:178 manjaro-hello.glade:542 msgid "Read me" msgstr "" -#: manjaro-hello.glade:207 manjaro-hello.glade:483 +#: manjaro-hello.glade:192 manjaro-hello.glade:582 msgid "Release info" msgstr "" -#: manjaro-hello.glade:221 +#: manjaro-hello.glade:206 msgid "Wiki" msgstr "" -#: manjaro-hello.glade:235 manjaro-hello.glade:535 +#: manjaro-hello.glade:220 manjaro-hello.glade:643 msgid "Get involved" msgstr "" -#: manjaro-hello.glade:249 +#: manjaro-hello.glade:234 msgid "Forums" msgstr "" -#: manjaro-hello.glade:263 +#: manjaro-hello.glade:248 msgid "Chat room" msgstr "" -#: manjaro-hello.glade:277 +#: manjaro-hello.glade:262 msgid "Mailling lists" msgstr "" -#: manjaro-hello.glade:291 +#: manjaro-hello.glade:276 msgid "Build Manjaro" msgstr "" -#: manjaro-hello.glade:305 +#: manjaro-hello.glade:290 msgid "Donate" msgstr "" -#: manjaro-hello.glade:319 -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 +#: manjaro-hello.glade:406 msgid "Launch at start" 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" msgstr "" -#: manjaro-hello.glade:499 +#: manjaro-hello.glade:598 msgid "Documentation" msgstr "" -#: manjaro-hello.glade:556 +#: manjaro-hello.glade:664 msgid "Project" msgstr ""