mise à jour du HandyMenu en fr-only + fix icons + finish purging pk-update-indicator + fix launchers

pull/60/head
arpinux 3 years ago
parent fb78401164
commit 52ba407f6e

@ -1,6 +1,8 @@
2020 -- --
Debian-Facile 10.5
- Mises à jour Debian 10.5
- Mise à jour des Cahiers du Débutant en version 10.5.1
- Mise à jour du HandyMenu en version 4.2-1
- Correction bugs :
- Le Handy Menu ne s'ouvrait pas avec certaines configurations matérielles
- GDebi n'était pas par défaut pour les fichiers .deb et il se fermait lors de leur installation
@ -10,7 +12,6 @@ Debian-Facile 10.5
- Modification du menu Whisker (catégories à gauche et changement au survol)
- Simplification du manuel d'utilisation et création d'un manuel indépendant pour ce qui concerne l'installation
- Remplacement de galculator par gnome-calculator
- Mise à jour des Cahiers du Débutant en version 10.5.1
- Activation des mises à jour automatiques
2020 04 25

@ -6,7 +6,7 @@ Comment=Debian Reference Guide
Name[fr_FR]=Guide de référence pour Debian
Keywords=user;shell;command;documentation;manual;help;guide
Exec=debian-reference
Icon=debian-reference.png
Icon=debian-reference
Terminal=false
Categories=Utility;
X-XFCE-Source=file:///usr/share/applications/debian-reference-common.desktop

@ -3,7 +3,7 @@ Name=HandyMenu
Comment=Minimalist menu for Debian
Comment[fr]=Menu simplifié pour Debian
Exec=/usr/bin/handymenu
Icon=handymenu_icon
Icon=handymenu
StartupNotify=true
Terminal=false
Type=Application

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

@ -1,3 +1,10 @@
handymenu (4.2-1) buster; urgency=medium
* delete trads - keep fr
* rearrange icons for independant menu
-- arnault perret <contact@arpinux.org> Mon, 17 Aug 2020 23:24:25 +0200
handymenu (4.2) buster; urgency=medium
* fix max_workers

@ -3,7 +3,7 @@ Name=HandyMenu
Comment=Minimalist menu for Debian
Comment[fr]=Menu simplifié pour Debian
Exec=/usr/bin/handymenu
Icon=handymenu_icon
Icon=handymenu
StartupNotify=true
Terminal=false
Type=Application

@ -8,19 +8,24 @@ Version: 4.2
Copyright: copyright
Changelog: changelog
Postinst: postinst
Postrm: postrm
Maintainer: arnault perret <contact@arpinux.org>
Depends: python (>= 2.7), python3, python3-gi, python3-xdg, xdg-user-dirs, xdg-utils
Architecture: all
Files: handymenu /usr/bin/
handymenu.desktop /usr/share/applications/
handymenu_icon.png /usr/share/pixmaps/
handymenu.png /usr/share/pixmaps/
handymenu.1 /usr/share/man/man1/
hm-scripts/handymenu-configuration.py /usr/share/handymenu/
hm-scripts/handymenu.py /usr/share/handymenu/
hm-scripts/hm-start.py /usr/share/handymenu/
hm-scripts/hm_utils.py /usr/share/handymenu/
icons/add_section.png /usr/share/handymenu/icons/
icons/appfinder.png /usr/share/handymenu/icons/
icons/chatons.png /usr/share/handymenu/icons/
icons/epub.png /usr/share/handymenu/icons/
icons/debian.png /usr/share/handymenu/icons/
icons/df-manuel.png /usr/share/handymenu/icons/
icons/file_documents.png /usr/share/handymenu/icons/
icons/file_download.png /usr/share/handymenu/icons/
icons/file_home.png /usr/share/handymenu/icons/
@ -29,15 +34,12 @@ Files: handymenu /usr/bin/
icons/file_trash.png /usr/share/handymenu/icons/
icons/file_videos.png /usr/share/handymenu/icons/
icons/firefox.png /usr/share/handymenu/icons/
icons/handymenu_icon.png /usr/share/handymenu/icons/
icons/handymenu.png /usr/share/handymenu/icons/
icons/help.png /usr/share/handymenu/icons/
icons/internet_framasoft.png /usr/share/handymenu/icons/
icons/internet_framatalk.png /usr/share/handymenu/icons/
icons/libreoffice.png /usr/share/handymenu/icons/
icons/webbrowser.png /usr/share/handymenu/icons/
locale/de/LC_MESSAGES/handymenu.mo /usr/share/locale/de/LC_MESSAGES/
locale/en/LC_MESSAGES/handymenu.mo /usr/share/locale/en/LC_MESSAGES/
locale/es/LC_MESSAGES/handymenu.mo /usr/share/locale/es/LC_MESSAGES/
locale/fr/LC_MESSAGES/handymenu.mo /usr/share/locale/fr/LC_MESSAGES/
Description: Menu simplifié pour Xfce
Le HandyMenu présente les applications principales
installées dans une interface claire organisée

Before

Width:  |  Height:  |  Size: 8.7 KiB

After

Width:  |  Height:  |  Size: 8.7 KiB

@ -16,10 +16,6 @@ import locale
from hm_utils import *
gettext.bindtextdomain('handymenu', '/usr/share/locale')
gettext.textdomain('handymenu')
_ = gettext.gettext
def get_info_desktop(desktopfile):
"""return infos from a .desktop file"""
name, cmd, icon, generic= "", "", "", ""
@ -39,10 +35,10 @@ def get_info_desktop(desktopfile):
class ViewHMConfig(Gtk.Dialog):
def __init__(self, parent, config):
Gtk.Dialog.__init__(self, _("Handymenu Configuration"), parent, 0)
Gtk.Dialog.__init__(self, ("Configuration du HandyMenu"), parent, 0)
self.set_border_width(10)
self.set_default_size(450, 300)
scrolledwindow = Gtk.ScrolledWindow()
scrolledwindow.set_hexpand(True)
scrolledwindow.set_vexpand(True)
@ -55,10 +51,10 @@ class ViewHMConfig(Gtk.Dialog):
configuration += str(s['name']) + "\n"
for app in s['apps']:
configuration += " {}\n".format(str(app))
self.textbuffer.set_text(configuration)
scrolledwindow.add(self.textview)
# on récupère la zone de stockage du dialogue
box = self.get_content_area()
box.add(scrolledwindow)
@ -70,9 +66,9 @@ class HandymenuConfig():
# fenêtre à propos.
m = Gtk.MessageDialog(parent=self.window)
m.add_buttons(Gtk.STOCK_CLOSE, Gtk.ResponseType.CLOSE)
m.set_markup(_('<b>Handymenu</b>\n\n\
m.set_markup(('<b>Handymenu</b>\n\n\
version : {0}\n\
author : {1}\n\
auteur : {1}\n\
licence : {2}\n\
homepage : <a href="{3}" title="HandyMenu homepage">{3}</a>').format(version, auteur, licence, homepage))
@ -88,22 +84,22 @@ homepage : <a href="{3}" title="HandyMenu homepage">{3}</a>').format(version, au
btnbox = m.get_action_area()
for btn in btnbox: # il n'y en a qu'un
btn.set_label(_("HandyLinux join Debian-Facile"))
btn.set_label(("HandyLinux rejoint Debian-Facile"))
btn.set_image(image)
btn.set_image_position(Gtk.PositionType.TOP)
ret = m.run()
if ret == Gtk.ResponseType.CLOSE:
open_cmd("x-www-browser https://debian-facile.org/viewtopic.php?id=14632")
open_cmd("x-www-browser https://debian-facile.org")
os.remove(imgpath)
m.destroy()
def view_config(self):
m = ViewHMConfig(self.window, self.config)
ret = m.run()
GObject.idle_add(m.hide)
GObject.idle_add(m.destroy)
def close_application(self, widget, event, data=None):
open_cmd("handymenu --force &")
Gtk.main_quit()
@ -135,10 +131,10 @@ homepage : <a href="{3}" title="HandyMenu homepage">{3}</a>').format(version, au
self.config.remove(section)
save_config(self.config)
self.restart()
def move_sec(self, section, index):
reload = move_section(self.config, section, index)
self.section_list.set_current_page(self.config.index(section))
self.section_list.set_current_page(self.config.index(section))
if reload:
self.restart()
@ -159,12 +155,12 @@ homepage : <a href="{3}" title="HandyMenu homepage">{3}</a>').format(version, au
dialog.destroy()
def mod_app_icon_dialog(self, widget, event, dialog, section, app):
chooser = Gtk.FileChooserDialog(title=_("Choose an icon"))
chooser = Gtk.FileChooserDialog(title=("Choisir une icône"))
chooser.add_buttons(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL)
chooser.add_buttons(Gtk.STOCK_OK, Gtk.ResponseType.OK)
chooser.set_current_folder(os.getcwd())
filter = Gtk.FileFilter()
filter.set_name(_("Images"))
filter.set_name(("Images"))
filter.add_mime_type("image/png")
filter.add_mime_type("image/jpeg")
chooser.add_filter(filter)
@ -172,7 +168,7 @@ homepage : <a href="{3}" title="HandyMenu homepage">{3}</a>').format(version, au
response = chooser.run()
if response == Gtk.ResponseType.CANCEL:
print(_('Closed, no files selected'))
print(("Fermeture : pas de fichiers sélectionnés"))
chooser.destroy()
elif response == Gtk.ResponseType.OK:
i = chooser.get_filename()
@ -189,10 +185,9 @@ homepage : <a href="{3}" title="HandyMenu homepage">{3}</a>').format(version, au
def move_app_down(self, widget, dialog, section, app):
move_app(self.config, section, app, 1)
dialog.destroy()
dialog.destroy()
self.restart()
def handle_drop(self, data, section):
'''handle drag n drop to add to configuration'''
if data.startswith('file://'):
@ -210,14 +205,13 @@ homepage : <a href="{3}" title="HandyMenu homepage">{3}</a>').format(version, au
name = os.path.basename(f) # un fichier
cmd = 'exo-open "{}"'.format(f)
#raccourci pour fichier sans icone
self.add_item_to_section(name, cmd, "empty", None, section)
self.add_item_to_section(name, cmd, "empty", None, section)
elif data.startswith("http://") or \
data.startswith("https://") or \
data.startswith("ftp://"): # cas d'une url
name = data.split('/')[2]
cmd = "exo-open --launch WebBrowser {}".format(data)
self.add_item_to_section(name, cmd, "text-html", "Lien vers une url", section)
self.add_item_to_section(name, cmd, "text-html", "Lien vers une url", section)
def on_drag_data_received(self, widget, drag_context, x, y, data, info, time, section):
if data.get_data_type().name() == "text/uri-list":
@ -234,19 +228,19 @@ homepage : <a href="{3}" title="HandyMenu homepage">{3}</a>').format(version, au
def on_drag_drop(self, widget, context, x, y, time):
widget.drag_get_data(context, context.list_targets()[-1], time)
return(True)
def del_appli(self, widget, dialog, section, app):
self.del_item_from_section(section, app)
dialog.destroy() # delete parent
def edit_appli(self, widget, event, section, app):
d = Gtk.Dialog(title=_("Edit the launcher"))
d = Gtk.Dialog(title=("Éditer le lanceur"))
# Edition du nom de l'appli
entry = Gtk.Entry()
entry.connect("activate", self.mod_app_name, entry, d, section, app) # entrée valide
entry.show()
namebtn = Gtk.Button(label = _("Change"))
namebtn = Gtk.Button(label = ("Changer"))
namebtn.connect_object("clicked", self.mod_app_name, entry, None, d, section, app )
namebtn.show()
@ -255,27 +249,26 @@ homepage : <a href="{3}" title="HandyMenu homepage">{3}</a>').format(version, au
box.pack_start(entry, True, True, 3)
box.pack_start(namebtn, False, False, 0)
box.show()
# et le tout dans un étiquette
nameframe = Gtk.Frame(label = _("Change the label"))
nameframe = Gtk.Frame(label = ("Changer le nom"))
nameframe.add(box)
nameframe.show()
# Changement de l'icône
iconbtn = Gtk.Button(label = _("Change icon"))
iconbtn = Gtk.Button(label = ("Changer l'icône"))
iconbtn.connect_object("clicked", self.mod_app_icon_dialog, entry, None, d, section, app )
iconbtn.show()
# on met ça dans une boîte
# et le tout dans un étiquette
iconframe = Gtk.Frame(label = _("Change the application icon"))
iconframe = Gtk.Frame(label = ("Changer l'icône de l'application"))
iconframe.add(iconbtn)
iconframe.show()
# déplacement de l'application
upbtn = Gtk.Button(label=_("Move up"))
downbtn = Gtk.Button(label=_("Move down"))
upbtn = Gtk.Button(label=("Monter"))
downbtn = Gtk.Button(label=("Descendre"))
upi = Gtk.Image()
upi.set_from_stock(Gtk.STOCK_GO_UP, Gtk.IconSize.MENU)
@ -289,23 +282,23 @@ homepage : <a href="{3}" title="HandyMenu homepage">{3}</a>').format(version, au
upbtn.show()
downbtn.show()
# on met ça dans une boîte
box = Gtk.HBox(False,2)
box.pack_start(upbtn, True, True, 3)
box.pack_start(downbtn, False, False, 0)
box.show()
# et le tout dans un étiquette
moveframe = Gtk.Frame(label = _("Move this app"))
moveframe = Gtk.Frame(label = ("Déplacer ce lanceur"))
moveframe.add(box)
moveframe.show()
# Nécessaire pour la suppression
delbtn = Gtk.Button(label = _("Delete"), stock=Gtk.STOCK_DELETE)
delbtn = Gtk.Button(label = ("Supprimer"), stock=Gtk.STOCK_DELETE)
delbtn.connect("clicked", self.del_appli, d, section, app)
delbtn.show()
delframe = Gtk.Frame(label = _("Delete this launcher"))
delframe = Gtk.Frame(label = ("Supprimer ce lanceur"))
delframe.add(delbtn)
delframe.show()
@ -316,10 +309,9 @@ homepage : <a href="{3}" title="HandyMenu homepage">{3}</a>').format(version, au
d.vbox.pack_start(delframe, True, True, 0)
d.run()
def make_entrylist(self):
self.section_list = Gtk.Notebook()
self.section_list.set_tab_pos(Gtk.PositionType.LEFT)
self.section_list.set_tab_pos(Gtk.PositionType.LEFT)
self.section_list.set_scrollable(True)
for s in self.config:
@ -342,27 +334,27 @@ homepage : <a href="{3}" title="HandyMenu homepage">{3}</a>').format(version, au
# boutons de config
hb = Gtk.HBox(False, 10)
delbtn = Gtk.Button(label = _("Delete this section"))
delbtn = Gtk.Button(label = ("Supprimer cette section"))
delbtn.connect_object("clicked", self.del_section, s)
addbtn = Gtk.Button(label=_("Search for applications"))
addbtn = Gtk.Button(label= ("Rechercher une application"))
addbtn.connect("button_press_event", self.appfinder)
hb.pack_start(addbtn, True, True, 0)
hb.pack_start(delbtn, True, True, 0)
if self.config.index(s) > 0:
upbtn = Gtk.Button(label = _("Move section up"))
upbtn = Gtk.Button(label = ("Monter la section"))
upbtn.connect_object("clicked", self.move_sec, s, -1)
hb.pack_start(upbtn, True, True, 0)
if self.config.index(s) < len(self.config)-1:
downbtn = Gtk.Button(label = _("Move section down"))
downbtn = Gtk.Button(label = ("Descendre la section"))
downbtn.connect_object("clicked", self.move_sec, s, +1)
hb.pack_start(downbtn, True, True, 0)
applist.pack_start(hb, False,False, 10)
dragdrophelp = Gtk.Label(_("To add an application, Drag and drop it below"))
dragdrophelp = Gtk.Label(("Pour ajouter une application, glissez-là dans la liste"))
applist.pack_start(dragdrophelp, False,False, 2)
for a in s['apps']:
@ -384,18 +376,17 @@ homepage : <a href="{3}" title="HandyMenu homepage">{3}</a>').format(version, au
bapp.connect("button_release_event", self.edit_appli, s, a)
applist.pack_start(bapp, True, True, 0)
scrolled_window.add_with_viewport(applist)
# ajout de la possibilité d'ajouter des sections
addbox = Gtk.VBox()
instruction = Gtk.Label(_("Name of the new section: "))
instruction = Gtk.Label(("Nom de la nouvelle section : "))
entry = Gtk.Entry()
entry.connect("activate", self.add_new_section) # entrée valide
addbox.pack_start(instruction, False, True, 3)
addbox.pack_start(entry, False, False, 20)
addbtn = Gtk.Button(label = _("More"), stock=Gtk.STOCK_ADD)
addbtn = Gtk.Button(label = ("Plus"), stock=Gtk.STOCK_ADD)
addbtn.connect_object("clicked", self.add_new_section, entry )
addbox.pack_start(addbtn, False, False, 10)
@ -403,7 +394,7 @@ homepage : <a href="{3}" title="HandyMenu homepage">{3}</a>').format(version, au
pixbuf = GdkPixbuf.Pixbuf.new_from_file(os.path.join(handy_icons,"add_section.png"))
scaled_buf = pixbuf.scale_simple(24,24,GdkPixbuf.InterpType.BILINEAR)
addlabel.set_from_pixbuf(scaled_buf)
addlabel.set_tooltip_text(_("Add a section"))
addlabel.set_tooltip_text(("Ajouter une section"))
self.section_list.append_page(addbox, addlabel)
self.mainbox.pack_start(self.section_list, True, True, 0)
@ -413,7 +404,7 @@ homepage : <a href="{3}" title="HandyMenu homepage">{3}</a>').format(version, au
add_module(module)
else:
del_module(module)
def make_menu(self, initialize = True):
"""build the menu"""
if initialize :
@ -432,19 +423,18 @@ homepage : <a href="{3}" title="HandyMenu homepage">{3}</a>').format(version, au
# configuration principale
self.make_entrylist()
# extra options
extrabox = Gtk.HBox(False, 5)
self.mainbox.pack_start(extrabox, False, False, 0)
# coches pour modules
modulesbox = Gtk.HBox(False, 5)
modulesframe = Gtk.Frame(label = _("Modules"))
modulesframe = Gtk.Frame(label = ("Modules"))
modulesframe.add(modulesbox)
extrabox.pack_start(modulesframe, False, False, 0)
recents_files_check = Gtk.CheckButton(_("Show recent files"))
recents_files_check.set_tooltip_text(_("Show recent files"))
recents_files_check = Gtk.CheckButton(("Afficher les fichiers récents"))
recents_files_check.set_tooltip_text(("Afficher les fichiers récents"))
if "_recent_files_" in load_modules()[1]:
recents_files_check.set_active(True)
recents_files_check.connect("toggled", self.module_toggle, "_recent_files_")
@ -465,7 +455,7 @@ homepage : <a href="{3}" title="HandyMenu homepage">{3}</a>').format(version, au
self.modules_position.set_adjustment(adjustment)
self.modules_position.set_numeric(True)
self.modules_position.set_value(load_modules()[0])
self.modules_position.set_tooltip_text(_("Position of modules in menu"))
self.modules_position.set_tooltip_text(("Position des modules dans le menu"))
self.modules_position.connect("value-changed", \
lambda x: set_modules_position(self.modules_position.get_value_as_int()))
modulesbox.pack_start(self.modules_position, False, False,1)
@ -478,18 +468,18 @@ homepage : <a href="{3}" title="HandyMenu homepage">{3}</a>').format(version, au
aboutbtn.connect("clicked", lambda x: self.about())
btnbox.pack_start(aboutbtn, False, False, 0)
defaultbtn = Gtk.Button(label = _("Reset"))
defaultbtn = Gtk.Button(label = ("Réinitialiser"))
resetimg = Gtk.Image()
resetimg.set_from_stock(Gtk.STOCK_REDO, Gtk.IconSize.BUTTON)
defaultbtn.set_image(resetimg)
defaultbtn.connect_object("clicked", self.back_to_default, self.window )
btnbox.pack_start(defaultbtn, True, True,0)
viewbtn = Gtk.Button(label = _("View config"))
viewbtn = Gtk.Button(label = ("Afficher la configuration"))
viewbtn.connect("clicked", lambda x: self.view_config())
btnbox.pack_start(viewbtn, True, True, 0)
savebtn = Gtk.Button(label = _("Quit"), stock=Gtk.STOCK_CLOSE)
savebtn = Gtk.Button(label = ("Quitter"), stock=Gtk.STOCK_CLOSE)
savebtn.connect_object("clicked", self.close_application, self.window, None )
btnbox.pack_start(savebtn, True, True, 0)
@ -504,7 +494,7 @@ homepage : <a href="{3}" title="HandyMenu homepage">{3}</a>').format(version, au
def main():
menu = HandymenuConfig()
Gtk.main()
return 0
return 0
if __name__ == "__main__":
main()

@ -3,8 +3,7 @@
"""
HandyMenu : menu principal de la distribution
HandyLinux <https://handylinux.org>
HandyMenu : menu par catégories présentées en onglets
Auteurs : Xavier Cartron <thuban@yeuxdelibad.net>
licence : GNU General Public Licence v3
@ -24,10 +23,6 @@ from concurrent.futures import ThreadPoolExecutor
import gettext
from hm_utils import *
gettext.bindtextdomain('handymenu', '/usr/share/locale')
gettext.textdomain('handymenu')
_ = gettext.gettext
os.chdir(os.getenv('HOME'))
class Handymenu():
@ -63,7 +58,7 @@ class Handymenu():
if event.type == Gdk.EventType.BUTTON_RELEASE and \
event.state & Gdk.ModifierType.BUTTON1_MASK:
exe = True
elif event.type == Gdk.EventType.KEY_PRESS:
elif event.type == Gdk.EventType.KEY_PRESS:
if event.keyval == Gdk.KEY_Return:
exe = True
@ -76,22 +71,22 @@ class Handymenu():
GObject.idle_add(self.window.hide)
Gtk.main_quit()
else:
if os.path.isfile("/usr/bin/handysoft"):
if os.path.isfile("/usr/bin/synaptic-pkexec"):
m = Gtk.MessageDialog(self.window, 0, Gtk.MessageType.QUESTION, \
Gtk.ButtonsType.YES_NO, \
_('Error at launching {}\n\nDo you want to install it?').format(cmd))
("Erreur au lancement de {}\n\nVoulez-vous l'intaller ?").format(cmd))
ret = m.run()
m.destroy()
if ret == Gtk.ResponseType.YES:
open_cmd("handysoft {}".format(cmd.strip()))
open_cmd("synaptic-pkexec".format(cmd.strip()))
self.window.show_all()
def change_bg_on_focus(self,widget,b):
widget.modify_bg(Gtk.StateFlags.NORMAL, self.selected_bg_color)
widget.modify_bg(Gtk.StateFlags.PRELIGHT, self.selected_bg_color)
def change_bg_on_focus_leave(self,widget,b):
widget.modify_bg(Gtk.StateFlags.NORMAL, None)
widget.modify_bg(Gtk.StateFlags.PRELIGHT, None)
@ -104,7 +99,7 @@ class Handymenu():
if m == "_recent_files_":
recentfiles = get_recently_used(max)
self.config.insert(index,recentfiles)
with ThreadPoolExecutor(max_workers=1) as executor:
for page, label in executor.map(self.add_button, self.config):
self.onglets.append_page(page, label)
@ -137,7 +132,7 @@ class Handymenu():
for a in s['apps']:
appname, icon, cmd, generic = a['name'], a['icon'], a['cmd'], a['generic']
# image utilisée dans le bouton
image = Gtk.Image()
filename, ext = os.path.splitext(icon)
@ -159,16 +154,16 @@ class Handymenu():
image.set_from_pixbuf(scaled_buf)
else:
image.set_from_icon_name("applications-internet", Gtk.IconSize.DIALOG)
elif len(icon.split('/')) == 2: # mimetype?
icon = content_type_get_icon(icon)
image.set_from_gicon(icon, Gtk.IconSize.DIALOG)
else:
image.set_from_icon_name(icon, Gtk.IconSize.DIALOG)
image.set_pixel_size(iconsize)
# nom de l'appli
appname = fill(appname, button_width)
bapp = Gtk.Button.new_with_mnemonic('_{}'.format(appname))
@ -194,7 +189,7 @@ class Handymenu():
y += 1
else:
page = Gtk.Label(_("This menu is still empty"))
page = Gtk.Label(("Ce menu est vide"))
return(page, label)
@ -206,12 +201,12 @@ class Handymenu():
else:
if os.path.isfile(noclose): #on ferme la prochiane fois
os.remove(noclose)
def make_menu(self):
"""build the menu"""
# Conteneur principal
mainbox = Gtk.EventBox()
# pour utiliser la couleur de fond du thème GTK
mainbox.modify_bg(Gtk.StateFlags.NORMAL, self.bg_color)
self.window.add(mainbox)
@ -240,11 +235,11 @@ class Handymenu():
croix = Gtk.Image()
croix.set_from_stock(Gtk.STOCK_CLOSE, Gtk.IconSize.MENU)
closebtn.set_image(croix)
closebtn.set_relief(Gtk.ReliefStyle.NONE)
closebtn.connect("button_release_event", self.close_application)
closebtn.connect("key_press_event", self.close_application)
closebtn.set_tooltip_text(_("Close"))
closebtn.set_tooltip_text(("Fermer"))
# configuration
qbtn = Gtk.Button()
@ -253,13 +248,13 @@ class Handymenu():
qbtn.set_image(image)
qbtn.set_relief(Gtk.ReliefStyle.NONE)
qbtn.connect_object("clicked", self.configure, None)
qbtn.set_tooltip_text(_("Configure"))
qbtn.set_tooltip_text(("Configurer"))
# fermer ou pas
closeafterbtn = Gtk.CheckButton()
closeafterbtn.connect("toggled", self.close_after)
closeafterbtn.set_active(self.closeafterrun)
closeafterbtn.set_tooltip_text(_("Close after execution"))
closeafterbtn.set_tooltip_text(("Fermer après lancement"))
closeafterbtn.set_halign(Gtk.Align.CENTER)
# boite à boutons
@ -285,9 +280,9 @@ class Handymenu():
self.onglets.connect('scroll-event', self.scroll_tab)
vbox.pack_start(self.onglets, True, True, 0)
# Catégories
self.create_tabs()
self.create_tabs()
self.window.show_all()
def scroll_tab(self, widget, event):
@ -295,7 +290,6 @@ class Handymenu():
self.onglets.prev_page()
else:
self.onglets.next_page()
def move_win(self, widget, event):
"""move window with a simple click"""
@ -308,7 +302,7 @@ class Handymenu():
selected_bg_color = style_context.lookup_color('selected_bg_color')
self.bg_color = Gdk.color_parse("#ffffff")
self.selected_bg_color = Gdk.color_parse("#41B1FF")
try: # no error even if old gtk3
if bg_color[0]:
self.bg_color = bg_color[1].to_color()
@ -318,7 +312,6 @@ class Handymenu():
bg_color = Gdk.color_parse("#eeeeee")
self.selected_bg_color = Gdk.color_parse("#41B1FF")
def change_focus_colors(self,i): # change colors of the widget i
i.connect("focus_in_event", self.change_bg_on_focus)
i.connect("enter_notify_event", self.change_bg_on_focus)
@ -327,7 +320,7 @@ class Handymenu():
def do_access(self, widget):
for i in widget:
if type(i) == Gtk.Button:
if type(i) == Gtk.Button:
self.change_focus_colors(i)
elif type(i) == Gtk.HBox:
self.do_access(i)
@ -350,7 +343,6 @@ class Handymenu():
self.change_focus_colors(i)
except:
pass
def start(self):
Gtk.main()
@ -360,7 +352,7 @@ class Handymenu():
self.closeafterrun = False
else:
self.closeafterrun = True
try:
self.config = load_config()
except Exception as err:
@ -368,7 +360,6 @@ class Handymenu():
set_default_config()
self.config = load_config()
self.window = Gtk.Window(Gtk.WindowType.TOPLEVEL)
self.window.connect("delete_event", lambda x,y: Gtk.main_quit())
@ -382,7 +373,7 @@ class Handymenu():
self.window.modify_bg(Gtk.StateFlags.NORMAL, Gdk.color_parse("black"))
self.get_theme_colors()
self.make_menu()
self.onglets.grab_focus() # pour la gestion au clavier facilitée

@ -23,7 +23,7 @@ modulesfile=os.path.join(configdir,'handymenu-modules.conf')
hmdir="/usr/share/handymenu"
configcmd="python3 {} {} &".format(os.path.join(hmdir,"handymenu-configuration.py"), configdir)
handy_icons=os.path.join(hmdir,"icons")
handymenuicon=os.path.join(handy_icons,"handymenu_icon.png")
handymenuicon=os.path.join(handy_icons,"handymenu.png")
onglet_width = 11
maxonglets = 7
@ -34,11 +34,7 @@ win_max_width = 750
version = "4.2"
auteur = "thuban"
licence = "GPLv3"
homepage = "https://dflinux.frama.io/home/"
gettext.bindtextdomain('handymenu', '/usr/share/locale')
gettext.textdomain('handymenu')
_ = gettext.gettext
homepage = "https://debian-facile.org"
def set_default_config():
print("reset configuration")
@ -69,7 +65,7 @@ def save_config(conf):
def add_section(config, section):
config.append(section)
save_config(config)
def move_section(config, section, index):
"""move section of +1 or -1
index = +1 or -1
@ -138,7 +134,7 @@ def move_app(config, section, app, index):
def open_cmd(cmd):
try:
if cmd.startswith("xdg-open"):
if cmd.startswith("xdg-open"):
# cas du module récents et des raccourcis fichiers
c = [ "xdg-open", "".join(cmd.split(' ', 1)[1:]) ]
else:
@ -186,7 +182,7 @@ def get_recently_used(max):
recents = {}
recents['id'] = "_recent_files_"
recents['name'] = _("Recent files")
recents['name'] = ("Fichiers récents")
recents['apps'] = []
if not os.path.isfile(f):
@ -205,18 +201,17 @@ def get_recently_used(max):
path = unquote_plus(path).replace('file://','',1)
if os.path.isfile(path):
name = os.path.basename(path)
generic = name
generic = name
cmd = 'xdg-open {}'.format(path)
#mimetype = mimetypes.guess_type(path)[0]
#if mimetype:
# icon = mimetype.replace('/','-')
#else:
# icon = "document-open-recent"
elif line.startswith("<mime:mime-type"):
#icon = line.split('"')[1].replace('/','-')
icon = line.split('"')[1]
if len(recents['apps']) < max and name and generic and icon and cmd:
if path.lower().endswith(".jpeg") or path.lower().endswith(".jpg") \
@ -253,7 +248,7 @@ def get_most_ffox_viewed(max):
most_view = {}
most_view['id'] = "_most_ffox_view_"
most_view['name'] = _("Most visited")
most_view['name'] = ("Pages les plus visitées")
most_view['apps'] = []
n = 0
for u in c2.fetchall():
@ -381,247 +376,247 @@ DYsAAAAASUVORK5CYII="""]
#sections = [section1, section2,...]
hm_default_sections = \
[\
{'name' : _("Latest"),\
{'name' : ("Récents"),\
'id': "recent",\
'apps': [\
{'name' : _("Surf the Web"),\
'generic': _("Browse the internet"),\
{'name' : ("Naviguez sur internet"),\
'generic': ("Parcourir le web"),\
'icon' : "/usr/share/handymenu/icons/firefox.png",\
'cmd' : "firefox"\
},\
{'name' : _("Personal folder"),\
'generic': _("Browse my personal directory"),\
{'name' : ("Dossier personnel"),\
'generic': ("Parcourir mon dossier personnel"),\
'icon' : "/usr/share/handymenu/icons/file_home.png",\
'cmd' : "exo-open --launch FileManager {}".format(os.path.expanduser("~"))\
},\
{'name' : _("Les Services CHATONS"),\
'generic': _("Accéder à des services web décentralisés, à échelle humaine, soldaire, respectueux de votre vie privé"),\
'icon' : "chatons",\
{'name' : ("Les Services CHATONS"),\
'generic': ("Accéder à des services web décentralisés, à échelle humaine, soldaire, respectueux de votre vie privé"),\
'icon' : "/usr/share/handymenu/icons/chatons.png",\
'cmd' : "x-www-browser https://entraide.chatons.org"\
},\
{'name' : _("Manuel de l'utilisateur"),\
'generic': _("Tout ce qu'il faut savoir pour maîtriser ce système"),\
'icon' : "df-manuel",\
{'name' : ("Manuel de l'utilisateur"),\
'generic': ("Tout ce qu'il faut savoir pour maîtriser votre système"),\
'icon' : "/usr/share/handymenu/icons/df-manuel.png",\
'cmd' : "df-manuel"\
},\
{'name' : _("Applications list"),\
'generic': _("Access to all installed applications"),\
'icon' : "edit-find",\
{'name' : ("Liste des applications"),\
'generic': ("Accédez à la liste complète des applications installées"),\
'icon' : "/usr/share/handymenu/icons/appfinder.png",\
'cmd' : "xfce4-appfinder"\
},\
{'name' : _("Office suite"),\
'generic': _("Full LibreOffice suite"),\
'icon' : "libreoffice-main",\
{'name' : ("Suite bureautique"),\
'generic': ("Suite complète LibreOffice"),\
'icon' : "/usr/share/handymenu/icons/libreoffice.png",\
'cmd' : "libreoffice"\
},\
]\
},\
{'name' : _("Internet"),\
{'name' : ("Internet"),\
'id': 0,\
'apps': [\
{'name' : _("Surf the Web"),\
'generic': _("Browse the internet"),\
{'name' : ("Naviguez sur internet"),\
'generic': ("Parcourir le web"),\
'icon' : "/usr/share/handymenu/icons/firefox.png",\
'cmd' : "firefox"\
},\
{'name' : _("Read or write emails"),\
'generic': _("Consult or edit emails"),\
{'name' : ("Écrire ou lire des courriels"),\
'generic': ("Consultez ou rédigez des courriers électroniques"),\
'icon' : "thunderbird",\
'cmd' : "thunderbird"\
},\
{'name' : _("P2P torrent client"),\
'generic': _("Share datas with P2P"),\
{'name' : ("Client torrent P2P"),\
'generic': ("Partagez des données en P2P"),\
'icon' : "transmission",\
'cmd' : "transmission-gtk"\
},\
{'name' : _("Les Services CHATONS"),\
'generic': _("Accéder à des services web décentralisés, à échelle humaine, soldaire, respectueux de votre vie privé"),\
'icon' : "chatons",\
{'name' : ("Les Services CHATONS"),\
'generic': ("Accéder à des services web décentralisés, à échelle humaine, soldaire, respectueux de votre vie privé"),\
'icon' : "/usr/share/handymenu/icons/chatons.png",\
'cmd' : "x-www-browser https://entraide.chatons.org"\
},\
{'name' : _("Le site de Debian"),\
'generic': _("The universal operating system"),\
'icon' : "debian-circle",\
{'name' : ("Le site de Debian"),\
'generic': ("Le système d'exploitation universel"),\
'icon' : "/usr/share/handymenu/icons/debian.png",\
'cmd' : "x-www-browser https://www.debian.org/index.fr.html"\
},\
]\
},\
{'name' : _("Files"),\
{'name' : ("Fichiers"),\
'id': 1,\
'apps': [\
{'name' : _("My Pictures"),\
'generic': _("Browse my images folder"),\
{'name' : ("Mes Images"),\
'generic': ("Parcourir mon dossier d'images"),\
'icon' : "/usr/share/handymenu/icons/file_pictures.png",\
'cmd' : "exo-open --launch FileManager {}".format(\
subprocess.check_output(["xdg-user-dir", "PICTURES"]).decode('utf-8').strip())\
},\
{'name' : _("My Documents"),\
'generic': _("Browse my documents"),\
{'name' : ("Mes Documents"),\
'generic': ("Parcourir mes documents"),\
'icon' : "/usr/share/handymenu/icons/file_documents.png",\
'cmd' : "exo-open --launch FileManager {}".format(\
subprocess.check_output(["xdg-user-dir", "DOCUMENTS"]).decode('utf-8').strip())\
},\
{'name' : _("My Music"),\
'generic': _("Browse my music folder"),\
{'name' : ("Ma Musique"),\
'generic': ("Parcourir ma musique"),\
'icon' : "/usr/share/handymenu/icons/file_music.png",\
'cmd' : "exo-open --launch FileManager {}".format(\
subprocess.check_output(["xdg-user-dir", "MUSIC"]).decode('utf-8').strip())\
},\
{'name' : _("My Videos"),\
'generic': _("Browse my videos"),\
{'name' : ("Mes Vidéos"),\
'generic': ("Parcourir mes vidéos"),\
'icon' : "/usr/share/handymenu/icons/file_videos.png",\
'cmd' : "exo-open --launch FileManager {}".format(\
subprocess.check_output(["xdg-user-dir", "VIDEOS"]).decode('utf-8').strip())\
},\
{'name' : _("Downloads"),\
'generic': _("Check my downloaded files"),\
{'name' : ("Téléchargements"),\
'generic': ("Vérifier mes fichiers téléchargés"),\
'icon' : "/usr/share/handymenu/icons/file_download.png",\
'cmd' : "exo-open --launch FileManager {}".format(\
subprocess.check_output(["xdg-user-dir", "DOWNLOAD"]).decode('utf-8').strip())\
},\
{'name' : _("Personal folder"),\
'generic': _("Browse my personal directory"),\
{'name' : ("Dossier personnel"),\
'generic': ("Parcourir mon dossier personnel"),\
'icon' : "/usr/share/handymenu/icons/file_home.png",\
'cmd' : "exo-open --launch FileManager {}".format(os.path.expanduser("~"))\
},\
{'name' : _("Check the trash"),\
'generic': _("Check and empty trash"),\
{'name' : ("Corbeille"),\
'generic': ("Vérifier et vider la corbeille"),\
'icon' : "/usr/share/handymenu/icons/file_trash.png",\
'cmd' : "exo-open --launch FileManager trash:///"\
},\
]\
},\
{'name' : _("Office"),\
{'name' : ("Bureautique"),\
'id': 4,\
'apps': [\
{'name' : _("Text editor"),\
'generic': _("Consult or edit text files"),\
{'name' : ("Éditeur de texte"),\
'generic': ("Consulter ou rédiger des fichiers texte"),\
'icon' : "accessories-text-editor",\
'cmd' : "mousepad"\
},\
{'name' : _("Take notes"),\
'generic': _("Minimalist reminder"),\
{'name' : ("Prendre des notes"),\
'generic': ("Post-it minimaliste"),\
'icon' : "xfce4-notes-plugin",\
'cmd' : "xfce4-notes"\
},\
{'name' : _("eBooks reader"),\
'generic': _("eBooks reader"),\
{'name' : ("Visionneuse d'eBooks"),\
'generic': ("Consulter vos livres eBooks"),\
'icon' : "/usr/share/handymenu/icons/epub.png",\
'cmd' : "fbreader"\
},\
{'name' : _("Office suite"),\
'generic': _("Full LibreOffice suite"),\
'icon' : "libreoffice-main",\
{'name' : ("Suite bureautique"),\
'generic': ("Suite complète LibreOffice"),\
'icon' : "/usr/share/handymenu/icons/libreoffice.png",\
'cmd' : "libreoffice"\
},\
{'name' : _("Scan documents"),\
'generic': _("Simply scan a document"),\
{'name' : ("Scanner un document"),\
'generic': ("Numériser simplement un document"),\
'icon' : "scanner",\
'cmd' : "simple-scan"\
},\
]\
},\
{'name' : _("Multimedia"),\
{'name' : ("Multimédia"),\
'id': 3,\
'apps': [\
{'name' : _("Multimedia player"),\
'generic': _("Watch video, DVD ou play music"),\
{'name' : ("Lecteur multimédia"),\
'generic': ("Visionner une vidéo, un DVD ou écouter un fichier audio"),\
'icon' : "vlc",\
'cmd' : "vlc"\
},\
{'name' : _("Images viewer"),\
'generic': _("Watch your favorite pictures and photos"),\
{'name' : ("Visionneuse d'images"),\
'generic': ("Consulter vos images et photos"),\
'icon' : "ristretto",\
'cmd' : "ristretto"\
},\
{'name' : _("Music player"),\
'generic': _("Play music, playlist or radio"),\
{'name' : ("Lecteur de Musique"),\
'generic': ("Profiter de votre musique, de la radio ou créer vos listes de lecture"),\
'icon' : "quodlibet",\
'cmd' : "quodlibet"\
},\
{'name' : _("CD/DVD burner"),\
'generic': _("Backup datas on CD ou DVD"),\
{'name' : ("Graveur de CD/DVD"),\
'generic': ("Sauvegarder vos données sur CD ou DVD"),\
'icon' : "media-cdrom",\
'cmd' : "xfburn"\
},\
{'name' : _("Volume control"),\
'generic': _("Adjust computer sound level"),\
{'name' : ("Réglage du volume"),\
'generic': ("Ajuster le son de votre ordinateur"),\
'icon' : "stock_volume",\
'cmd' : "pavucontrol"\
},\
]\
},\
{'name' : _("Adventurers"),\
{'name' : ("Aventuriers"),\
'id': 6,\
'apps': [\
{'name' : _("Open a terminal"),\
'generic': _("Get access to the command line"),\
{'name' : ("Ouvrir un terminal"),\
'generic': ("Accéder à la ligne de commande"),\
'icon' : "utilities-terminal",\
'cmd' : "exo-open --launch TerminalEmulator"\
},\
{'name' : _("Software Library"),\
'generic': _("Software management"),\
{'name' : ("Logithèque Debian"),\
'generic': ("Gestionnaire de logiciels"),\
'icon' : "org.gnome.Software",\
'cmd' : "gnome-software"\
},\
{'name' : _("Applications list"),\
'generic': _("Access to all installed applications"),\
'icon' : "edit-find",\
{'name' : ("Liste des applications"),\
'generic': ("Accéder à la liste des applications installées"),\
'icon' : "/usr/share/handymenu/icons/appfinder.png",\
'cmd' : "xfce4-appfinder"\
},\
{'name' : _("Network configuration"),\
'generic': _("Configure your network connection"),\
{'name' : ("Configuration réseau"),\
'generic': ("Configurer votre connexion au réseau"),\
'icon' : "gnome-nettool",\
'cmd' : "nm-connection-editor"\
},\
{'name' : _("Printer configuration"),\
'generic': _("Add and configure a printer"),\
{'name' : ("Configurer une imprimante"),\
'generic': ("Ajouter et configurer une imprimante"),\
'icon' : "printer",\
'cmd' : "system-config-printer"\
},\
{'name' : _("Detailed configuration"),\
'generic': _("Configure each part of XFCE"),\
{'name' : ("Configurer XFCE"),\
'generic': ("Accéder à la configuration détaillée de XFCE"),\
'icon' : "preferences-system",\
'cmd' : "xfce4-settings-manager"\
},\
]\
},\
{'name' : _("Aide"),\
{'name' : ("Aide"),\
'id': 6,\
'apps': [\
{'name' : _("Manuel de l'utilisateur"),\
'generic': _("Tout ce qu'il faut savoir pour maîtriser ce système"),\
'icon' : "df-manuel",\
{'name' : ("Manuel de l'utilisateur"),\
'generic': ("Tout ce qu'il faut savoir pour maîtriser votre système"),\
'icon' : "/usr/share/handymenu/icons/df-manuel.png",\
'cmd' : "df-manuel"\
},\
{'name' : _("Les cahiers du débutant"),\
'generic': _("Vous voulez allez plus loin ? Par ici !"),\
{'name' : ("Les cahiers du débutant"),\
'generic': ("Vous voulez allez plus loin ? Par ici !"),\
'icon' : "lcdd",\
'cmd' : "lcdd"\
},\
{'name' : _("Le Wiki Debian-Facile"),\
'generic': _("Wikipedia d'entraide informatique"),\
{'name' : ("Le Wiki Debian-Facile"),\
'generic': ("Wikipedia d'entraide informatique"),\
'icon' : "dfl-icons-debianfacile",\
'cmd' : "x-www-browser https://debian-facile.org/wiki"\
},\
{'name' : _("Le forum Debian-Facile"),\
'generic': _("Forum d'entraide informatique francophone"),\
{'name' : ("Le forum Debian-Facile"),\
'generic': ("Forum d'entraide informatique francophone"),\
'icon' : "dfl-icons-forumfacile",\
'cmd' : "x-www-browser https://debian-facile.org/forum.php"\
},\
{'name' : _("Salon IRC d'entraide"),\
'generic': _("Échanger en temps réel avec la communauté"),\
{'name' : ("Salon IRC d'entraide"),\
'generic': ("Échanger en temps réel avec la communauté"),\
'icon' : "hexchat",\
'cmd' : "hexchat"\
},\
{'name' : _("Git de Debian-Facile"),\
'generic': _("Sources du projet"),\
{'name' : ("Git de Debian-Facile"),\
'generic': ("Sources du projet"),\
'icon' : "qgit",\
'cmd' : "x-www-browser https://debian-facile.org/git/ProjetsDF/dfiso-buster"\
},\

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB