From cb76756ee1fdbc93679a0420f7beb39cd68ba81a Mon Sep 17 00:00:00 2001 From: Jules Date: Sat, 21 Mar 2026 17:26:41 +0100 Subject: [PATCH] =?UTF-8?q?V3.4.2=20=E2=80=94=20Fix=20menu=20contextuel=20?= =?UTF-8?q?Windows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Les sous-menus sont maintenant des entrees individuelles dans le menu contextuel (pas de SubCommands qui ne fonctionne pas) - Chaque action a sa propre entree : CopyDev: Livret A4, Livret A3, etc. - Le unregister nettoie toutes les entrees - Suppression de l'ancienne entree CopyDevImpose vide Co-Authored-By: Claude Opus 4.6 (1M context) --- app/main_window.py | 42 ++++++++++++++++++++++++++---------------- app/updater.py | 2 +- version.txt | 2 +- 3 files changed, 28 insertions(+), 18 deletions(-) diff --git a/app/main_window.py b/app/main_window.py index b08c6ae..0a47596 100644 --- a/app/main_window.py +++ b/app/main_window.py @@ -1291,26 +1291,30 @@ class MainWindow(QMainWindow): import subprocess exe = sys.executable if getattr(sys, 'frozen', False) else os.path.abspath("main.py") try: + base = "HKCU\\Software\\Classes\\SystemFileAssociations\\.pdf\\shell" cmds = [ - # Association PDF + # Association PDF (Ouvrir avec) f'reg add "HKCU\\Software\\Classes\\.pdf\\OpenWithProgids" /v "CopyDevImpose" /t REG_SZ /d "" /f', f'reg add "HKCU\\Software\\Classes\\CopyDevImpose" /ve /d "CopyDev Imposing Tool" /f', f'reg add "HKCU\\Software\\Classes\\CopyDevImpose\\shell\\open\\command" /ve /d "\\"{exe}\\" \\"%1\\"" /f', f'reg add "HKCU\\Software\\Classes\\CopyDevImpose\\DefaultIcon" /ve /d "{exe},0" /f', - # Menu contextuel - f'reg add "HKCU\\Software\\Classes\\SystemFileAssociations\\.pdf\\shell\\CopyDevImpose" /ve /d "CopyDev Impose" /f', - f'reg add "HKCU\\Software\\Classes\\SystemFileAssociations\\.pdf\\shell\\CopyDevImpose" /v "SubCommands" /t REG_SZ /d "" /f', - f'reg add "HKCU\\Software\\Classes\\SystemFileAssociations\\.pdf\\shell\\CopyDevImpose" /v "Icon" /t REG_SZ /d "{exe},0" /f', - f'reg add "HKCU\\Software\\Classes\\SystemFileAssociations\\.pdf\\shell\\CopyDevImpose\\shell\\open" /ve /d "Ouvrir avec CopyDev" /f', - f'reg add "HKCU\\Software\\Classes\\SystemFileAssociations\\.pdf\\shell\\CopyDevImpose\\shell\\open\\command" /ve /d "\\"{exe}\\" \\"%1\\"" /f', - f'reg add "HKCU\\Software\\Classes\\SystemFileAssociations\\.pdf\\shell\\CopyDevImpose\\shell\\bookletA4" /ve /d "Livret A4" /f', - f'reg add "HKCU\\Software\\Classes\\SystemFileAssociations\\.pdf\\shell\\CopyDevImpose\\shell\\bookletA4\\command" /ve /d "\\"{exe}\\" --action booklet_a4 \\"%1\\"" /f', - f'reg add "HKCU\\Software\\Classes\\SystemFileAssociations\\.pdf\\shell\\CopyDevImpose\\shell\\bookletA3" /ve /d "Livret A3" /f', - f'reg add "HKCU\\Software\\Classes\\SystemFileAssociations\\.pdf\\shell\\CopyDevImpose\\shell\\bookletA3\\command" /ve /d "\\"{exe}\\" --action booklet_a3 \\"%1\\"" /f', - f'reg add "HKCU\\Software\\Classes\\SystemFileAssociations\\.pdf\\shell\\CopyDevImpose\\shell\\nup2x2" /ve /d "2x2 par feuille" /f', - f'reg add "HKCU\\Software\\Classes\\SystemFileAssociations\\.pdf\\shell\\CopyDevImpose\\shell\\nup2x2\\command" /ve /d "\\"{exe}\\" --action nup_2x2 \\"%1\\"" /f', - f'reg add "HKCU\\Software\\Classes\\SystemFileAssociations\\.pdf\\shell\\CopyDevImpose\\shell\\unbooklet" /ve /d "Delivretiser" /f', - f'reg add "HKCU\\Software\\Classes\\SystemFileAssociations\\.pdf\\shell\\CopyDevImpose\\shell\\unbooklet\\command" /ve /d "\\"{exe}\\" --action unbooklet \\"%1\\"" /f', + # Entrees individuelles dans le menu contextuel + # Ouvrir avec CopyDev + f'reg add "{base}\\CopyDev_Ouvrir" /ve /d "Ouvrir avec CopyDev Impose" /f', + f'reg add "{base}\\CopyDev_Ouvrir" /v "Icon" /t REG_SZ /d "{exe},0" /f', + f'reg add "{base}\\CopyDev_Ouvrir\\command" /ve /d "\\"{exe}\\" \\"%1\\"" /f', + # Livret A4 + f'reg add "{base}\\CopyDev_LivretA4" /ve /d "CopyDev: Livret A4" /f', + f'reg add "{base}\\CopyDev_LivretA4\\command" /ve /d "\\"{exe}\\" --action booklet_a4 \\"%1\\"" /f', + # Livret A3 + f'reg add "{base}\\CopyDev_LivretA3" /ve /d "CopyDev: Livret A3" /f', + f'reg add "{base}\\CopyDev_LivretA3\\command" /ve /d "\\"{exe}\\" --action booklet_a3 \\"%1\\"" /f', + # 2x2 + f'reg add "{base}\\CopyDev_2x2" /ve /d "CopyDev: 2x2 par feuille" /f', + f'reg add "{base}\\CopyDev_2x2\\command" /ve /d "\\"{exe}\\" --action nup_2x2 \\"%1\\"" /f', + # Delivretiser + f'reg add "{base}\\CopyDev_Delivretiser" /ve /d "CopyDev: Delivretiser" /f', + f'reg add "{base}\\CopyDev_Delivretiser\\command" /ve /d "\\"{exe}\\" --action unbooklet \\"%1\\"" /f', ] for cmd in cmds: subprocess.run(cmd, shell=True, capture_output=True) @@ -1327,10 +1331,16 @@ class MainWindow(QMainWindow): return import subprocess try: + base = "HKCU\\Software\\Classes\\SystemFileAssociations\\.pdf\\shell" cmds = [ 'reg delete "HKCU\\Software\\Classes\\CopyDevImpose" /f', 'reg delete "HKCU\\Software\\Classes\\.pdf\\OpenWithProgids" /v "CopyDevImpose" /f', - 'reg delete "HKCU\\Software\\Classes\\SystemFileAssociations\\.pdf\\shell\\CopyDevImpose" /f', + f'reg delete "{base}\\CopyDevImpose" /f', + f'reg delete "{base}\\CopyDev_Ouvrir" /f', + f'reg delete "{base}\\CopyDev_LivretA4" /f', + f'reg delete "{base}\\CopyDev_LivretA3" /f', + f'reg delete "{base}\\CopyDev_2x2" /f', + f'reg delete "{base}\\CopyDev_Delivretiser" /f', ] for cmd in cmds: subprocess.run(cmd, shell=True, capture_output=True) diff --git a/app/updater.py b/app/updater.py index bc88bb8..f9f9ba1 100644 --- a/app/updater.py +++ b/app/updater.py @@ -14,7 +14,7 @@ REPO = "jules/copydev-imposing-tool" BRANCH = "master" # Version actuelle (incrementee a chaque release) -VERSION = "3.4.1" +VERSION = "3.4.2" def get_remote_version(): diff --git a/version.txt b/version.txt index 47b322c..4d9d11c 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -3.4.1 +3.4.2