Commit 639bd4aa authored by prx's avatar prx

rewrite welcome

parent 1732f917
#!/usr/bin/python
# -*-coding:utf-8-*
import pygtk
pygtk.require("2.0")
import gtk
import os
class HandyUpdate():
def on_button1_clicked(self, widget):
gtk.main_quit()
def on_button2_clicked(self, widget):
os.system("handy-update-checker &")
gtk.main_quit()
def __init__(self):
window = gtk.Window()
window.set_title("HandyUpdate")
window.connect("destroy", self.on_button1_clicked)
window.set_default_size(300, 200)
vBox = gtk.VBox()
label = gtk.Label()
label.set_text("\n You have just installed HandyLinux ... merci :) \n" +
"\n Your system is ready to use, but \n" +
" depending on your ISO building date, \n" +
" some updates may be available. \n" +
"\n Do you want to check for available update(s) ? \n" +
"\n You need an active network. \n" +
" Your password will be asked. \n")
vBox.pack_start(label, False, False, 10)
hBox = gtk.HBox()
bouton1 = gtk.ToggleButton(label = "no thx")
bouton1.connect("clicked", self.on_button1_clicked)
bouton2 = gtk.ToggleButton(label = "yes, thx")
bouton2.connect("clicked", self.on_button2_clicked)
hBox.add(bouton1)
hBox.add(bouton2)
vBox.pack_end(hBox, False, False, 4)
window.add(vBox)
window.show_all()
gtk.main()
if __name__ == '__main__':
HandyUpdate()
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk+" version="2.24"/>
<!-- interface-naming-policy project-wide -->
<object class="GtkWindow" id="bienvenue">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="has_focus">True</property>
<property name="is_focus">True</property>
<property name="title" translatable="yes">Welcome to HandyLinux</property>
<property name="modal">True</property>
<property name="window_position">center</property>
<signal name="delete-event" handler="on_bienvenue_delete_event" swapped="no"/>
<child>
<object class="GtkVBox" id="vbox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixbuf">welcome.png</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="button1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="border_width">5</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<signal name="clicked" handler="on_button1_clicked" swapped="no"/>
<child>
<object class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixbuf">noob.png</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="padding">10</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
</interface>
#!/usr/bin/python
# -*-coding:utf-8-*
#######################
# handy linux welcome
# by arpinux
########################################################################
import pygtk
pygtk.require("2.0")
import gtk
import os
########################################################################
# main window
########################################################################
class HandyWelcome():
def __init__(self):
interface = gtk.Builder()
interface.add_from_file("welcome.glade")
interface.connect_signals(self)
def on_button1_clicked(self, widget):
os.system("x-www-browser file:///usr/share/handylinux/guide-en.html &")
def on_bienvenue_delete_event(self, widget, event):
gtk.main_quit()
########################################################################
if __name__ == "__main__":
HandyWelcome()
gtk.main()
......@@ -41,7 +41,7 @@ if [ "${TRAD}" == "fr" ]; then
#demande de mise à jour
networkcheck
if [ $? -eq 0 ]; then
sleep 5s && python ./handyupdate.py
sleep 5s && python3 ./handyupdate.py
fi
fi
else
......@@ -109,7 +109,7 @@ else
#demande de mise à jour
networkcheck
if [ $? -eq 0 ]; then
sleep 5s && python ./handyupdate.py
sleep 5s && python3 ./handyupdate.py
fi
fi
fi
......
#!/usr/bin/python
#!/usr/bin/env python3
# -*-coding:utf-8-*
import pygtk
pygtk.require("2.0")
import gtk
from gi.repository import Gtk
import os
import locale
LOCALE = locale.setlocale(locale.LC_ALL, "")[0:2]
class HandyUpdate():
def on_button1_clicked(self, widget):
gtk.main_quit()
def on_button2_clicked(self, widget):
os.system("handy-update-checker &")
gtk.main_quit()
def __init__(self):
window = gtk.Window()
window.set_title("HandyUpdate")
window.connect("destroy", self.on_button1_clicked)
window.set_default_size(300, 200)
vBox = gtk.VBox()
label = gtk.Label()
label.set_text("\n Vous venez d'installer HandyLinux ... merci :) \n" +
"\n Votre système est prêt à être utilisé, cependant \n" +
" selon la date de construction de votre image ISO, \n" +
" des mises à jour peuvent être disponibles. \n" +
"\n Désirez-vous vérifier les mises à jour disponibles ? \n" +
"\n Une connexion internet active est nécessaire. \n" +
" Votre mot de passe vous sera demandé. \n")
vBox.pack_start(label, False, False, 10)
hBox = gtk.HBox()
bouton1 = gtk.ToggleButton(label = "non merci")
bouton1.connect("clicked", self.on_button1_clicked)
bouton2 = gtk.ToggleButton(label = "oui, merci")
bouton2.connect("clicked", self.on_button2_clicked)
hBox.add(bouton1)
hBox.add(bouton2)
vBox.pack_end(hBox, False, False, 4)
window.add(vBox)
window.show_all()
gtk.main()
def on_button1_clicked(self, widget):
Gtk.main_quit()
def on_button2_clicked(self, widget):
os.system("handy-update-checker &")
gtk.main_quit()
def __init__(self):
window = Gtk.Window()
window.set_title("HandyUpdate")
window.connect("destroy", self.on_button1_clicked)
window.set_default_size(300, 200)
vBox = Gtk.VBox()
label = Gtk.Label()
if LOCALE == 'fr':
label.set_text("\n Vous venez d'installer HandyLinux ... merci :) \n" +
"\n Votre système est prêt à être utilisé, cependant \n" +
" selon la date de construction de votre image ISO, \n" +
" des mises à jour peuvent être disponibles. \n" +
"\n Désirez-vous vérifier les mises à jour disponibles ? \n" +
"\n Une connexion internet active est nécessaire. \n" +
" Votre mot de passe vous sera demandé. \n")
else:
label.set_text("\n You have just installed HandyLinux ... merci :) \n" +
"\n Your system is ready to use, but \n" +
" depending on your ISO building date, \n" +
" some updates may be available. \n" +
"\n Do you want to check for available update(s) ? \n" +
"\n You need an active network. \n" +
" Your password will be asked. \n")
vBox.pack_start(label, False, False, 10)
hBox = Gtk.HBox()
if LOCALE == 'fr':
bouton1 = Gtk.ToggleButton(label = "non merci")
else:
bouton1 = Gtk.ToggleButton(label = "no thanks")
bouton1.connect("clicked", self.on_button1_clicked)
if LOCALE == 'fr':
bouton2 = Gtk.ToggleButton(label = "oui, merci")
else:
bouton2 = Gtk.ToggleButton(label = "yes, thanks")
bouton2.connect("clicked", self.on_button2_clicked)
hBox.add(bouton1)
hBox.add(bouton2)
vBox.pack_end(hBox, False, False, 4)
window.add(vBox)
window.show_all()
Gtk.main()
if __name__ == '__main__':
HandyUpdate()
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk+" version="2.24"/>
<!-- interface-naming-policy project-wide -->
<object class="GtkWindow" id="bienvenue">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="has_focus">True</property>
<property name="is_focus">True</property>
<property name="title" translatable="yes">Bienvenue sur Handy Linux</property>
<property name="modal">True</property>
<property name="window_position">center</property>
<signal name="delete-event" handler="on_bienvenue_delete_event" swapped="no"/>
<child>
<object class="GtkVBox" id="vbox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixbuf">welcome.png</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="button1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="border_width">5</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<signal name="clicked" handler="on_button1_clicked" swapped="no"/>
<child>
<object class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixbuf">noob.png</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="padding">10</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
</interface>
#!/usr/bin/python
# -*-coding:utf-8-*
#######################
# handy linux welcome
# by arpinux
########################################################################
import pygtk
pygtk.require("2.0")
import gtk
#!/usr/bin/env python3
# -*- coding:Utf-8 -*-
"""
Auteur : thuban <thuban@yeuxdelibad.net>
licence : GNU General Public Licence v3
Description :
message d'accueil à handylinux
"""
from gi.repository import Gtk, Gdk, GObject, GdkPixbuf
import locale
import os
from textwrap import fill
# Trads
LOCALE = locale.setlocale(locale.LC_ALL, "")[0:2]
appname = "Welcome to HandyLinux"
msg1 = "For absolute beginners, left-click here"
msg2 = "To access the main applications avaiables on your computer, left-click on the blue handymenu icon on bottom left corner of your screen"
msg3 = "To access main online documentation or the specific accessibility page, left-click on the access menu"
msg4 = "To shutdown or reboot your computer, left-click on the red icon on bottom right corner of your screen."
endmsg = "Have fun with HandyLinux!"
if LOCALE == 'fr':
appname = "Bienvenue sur Handylinux"
msg1 = "Si vous débutez en informatique, clic-gauche ici "
msg2 = " Pour accéder aux principales applications disponibles sur votre machine, cliquez gauche sur l'icône handymenu en bas à gauche de votre écran."
msg3 = "Pour accéder à l'aide en ligne et aux outils d'accessibilité, clic-gauche sur le menu access en bas à droite"
msg4 = "Pour éteindre ou redémarrer votre ordinateur, clic-gauche sur l'icône appropriée en bas à droite de l'écran"
endmsg = "Amusez-vous bien avec HandyLinux!"
top = "<span size='30000'>{}</span>".format(appname)
########################################################################
# main window
########################################################################
class HandyWelcome():
class Welcome():
def __init__(self):
interface = gtk.Builder()
interface.add_from_file("welcome.glade")
interface.connect_signals(self)
# window
self.window = Gtk.Window(Gtk.WindowType.TOPLEVEL)
self.window.connect("delete_event", lambda x,y: Gtk.main_quit())
self.window.set_title(appname)
self.window.set_position(Gtk.WindowPosition.CENTER_ALWAYS)
# main box
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=10)
box.set_homogeneous(False)
box.set_border_width(20)
# text at top
label = Gtk.Label()
label.set_justify(Gtk.Justification.LEFT)
label.set_markup(top)
box.pack_start(label, True, True, 10)
# first message for beginners
btn1 = Gtk.Button(msg1)
btn1.set_relief(Gtk.ReliefStyle.NONE)
btn1.set_tooltip_text(msg1)
btn1.connect("button_release_event", lambda x,y: os.system("x-www-browser file:///usr/share/handylinux/guide.html &"))
hbox = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=10)
# image left-click
img = Gtk.Image.new_from_file("/usr/share/handylinux/pics/mouse-left.png")
ebox = Gtk.EventBox()
ebox.connect("button_release_event", lambda x,y: os.system("x-www-browser file:///usr/share/handylinux/guide.html &"))
ebox.add(img)
hbox.pack_start(btn1, True, True, 1)
hbox.pack_start(ebox, False, False, 1)
box.pack_start(hbox, True, True, 1)
# second message for handymenu
btn = Gtk.Button(fill(msg2, 60))
btn.set_relief(Gtk.ReliefStyle.NONE)
btn.set_tooltip_text(msg2)
hbox = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=10)
img = Gtk.Image.new_from_icon_name("handylinux", Gtk.IconSize.DIALOG)
hbox.pack_start(img, False, False, 1)
hbox.pack_start(btn, True, True, 1)
box.pack_start(hbox, True, True, 1)
# message access
btn = Gtk.Button(fill(msg3, 60))
btn.set_relief(Gtk.ReliefStyle.NONE)
btn.set_tooltip_text(msg3)
hbox = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=10)
img = Gtk.Image.new_from_icon_name("access", Gtk.IconSize.DIALOG)
hbox.pack_start(btn, True, True, 1)
hbox.pack_start(img, False, False, 1)
box.pack_start(hbox, True, True, 1)
# message shutdown
btn = Gtk.Button(fill(msg4, 60))
btn.set_relief(Gtk.ReliefStyle.NONE)
btn.set_tooltip_text(msg4)
hbox = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=10)
img = Gtk.Image.new_from_icon_name("system-shutdown", Gtk.IconSize.DIALOG)
hbox.pack_start(img, False, False, 1)
hbox.pack_start(btn, True, True, 1)
box.pack_start(hbox, True, True, 1)
# exit button
exitbtn = Gtk.Button.new_with_mnemonic(endmsg)
exitbtn.connect("button_release_event", lambda x,y: Gtk.main_quit())
exitbtn.set_alignment(1,0.5)
box.pack_start(exitbtn, False, False, 0)
self.window.add(box)
self.window.show_all()
def main():
w = Welcome()
Gtk.main()
return 0
if __name__ == '__main__':
main()
def on_button1_clicked(self, widget):
os.system("x-www-browser file:///usr/share/handylinux/guide.html &")
def on_bienvenue_delete_event(self, widget, event):
gtk.main_quit()
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
########################################################################
if __name__ == "__main__":
HandyWelcome()
gtk.main()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment