Skip to content

Commit 4b8ca19

Browse files
committed
feat(gui): IDE par defaut et option classic
- IDE GUI devient la valeur par defaut (fallback sur classic).\n- Ajout du flag --classic-gui pour forcer l'ancien layout.\n- Propagation du choix via launchers et CLI.
1 parent 252a113 commit 4b8ca19

4 files changed

Lines changed: 29 additions & 22 deletions

File tree

Core/Gui.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ def __init__(self):
107107
# Charger les préférences et initialiser l'UI
108108
self.load_preferences()
109109
ui_variant = str(os.environ.get("PYCOMPILER_UI_VARIANT", "")).strip().lower()
110+
if not ui_variant:
111+
ui_variant = "ide2"
112+
if ui_variant in {"classic", "classic-gui", "legacy"}:
113+
ui_variant = "classic"
110114
if ui_variant in {"ide2", "design2", "ide-like", "idelike", "vscode"}:
111115
try:
112116
self.init_ide_like_ui()

cli/click_app.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
from EngineLoader import unload_all
1010

11-
from .completion import print_command_completion
1211
from .dedicated import run_dedicated_cli
1312
from .launchers import (
1413
launch_bcasl_standalone,
@@ -51,9 +50,10 @@ def build_cli(app_version: str):
5150
help="Launch the new IDE-like main GUI layout",
5251
)
5352
@click.option(
54-
"--completion",
55-
type=click.Choice(["bash", "zsh", "fish"]),
56-
help="Generate shell completion",
53+
"--classic-gui",
54+
"classic_gui",
55+
is_flag=True,
56+
help="Launch the classic main GUI layout",
5757
)
5858
@click.option(
5959
"--unload",
@@ -71,7 +71,7 @@ def cli(
7171
verbose,
7272
no_splash,
7373
ide_gui,
74-
completion,
74+
classic_gui,
7575
unload_engines_flag,
7676
):
7777
"""PyCompiler ARK — Cross-platform Python compiler with BCASL integration.
@@ -88,6 +88,7 @@ def cli(
8888
ctx.obj["no_splash"] = bool(no_splash)
8989
ctx.obj["verbose"] = bool(verbose)
9090
ctx.obj["ide_gui"] = bool(ide_gui)
91+
ctx.obj["classic_gui"] = bool(classic_gui)
9192

9293
if verbose:
9394
import os
@@ -103,9 +104,6 @@ def cli(
103104
print_system_info(app_version)
104105
ctx.exit(0)
105106

106-
if completion:
107-
print_command_completion(completion)
108-
ctx.exit(0)
109107

110108
if dedicated_cli and ctx.invoked_subcommand is None:
111109
ctx.exit(run_dedicated_cli(app_version))
@@ -142,6 +140,7 @@ def cli(
142140
launch_main_application(
143141
no_splash=ctx.obj.get("no_splash", False),
144142
ide_gui=ctx.obj.get("ide_gui", False),
143+
classic_gui=ctx.obj.get("classic_gui", False),
145144
)
146145
)
147146

cli/fallback.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
launch_engines_only_standalone,
1515
launch_main_application,
1616
)
17-
from .completion import print_command_completion
1817
from .dedicated import run_dedicated_cli
1918
from .output import error, info, plain, warn
2019
from .system_info import print_system_info
@@ -23,19 +22,19 @@
2322
PyCompiler ARK — Cross-platform hardened bootstrap with Intelligent CLI Entry Point
2423
2524
Usage:
26-
python -m pycompiler_ark # Launch main application
25+
python -m pycompiler_ark # Launch main application (IDE by default)
2726
python -m pycompiler_ark --help # Show help
2827
python -m pycompiler_ark --version # Show version
2928
python -m pycompiler_ark --cli # Open dedicated interactive CLI
3029
python -m pycompiler_ark --ide-gui # Launch IDE-like main GUI
30+
python -m pycompiler_ark --classic-gui # Launch classic main GUI
3131
python -m pycompiler_ark --verbose # Enable verbose logging
3232
python -m pycompiler_ark --no-splash # Disable splash screen
3333
python -m pycompiler_ark bcasl # Launch BCASL standalone
3434
python -m pycompiler_ark bcasl /path/to/ws # Launch BCASL with workspace
3535
python -m pycompiler_ark engines # Launch Engines standalone GUI
3636
python -m pycompiler_ark engines /path/to/ws # Launch Engines with workspace
3737
python -m pycompiler_ark engines --dry-run # List available engines
38-
python -m pycompiler_ark --completion bash # Generate bash completion
3938
python -m pycompiler_ark unload # Unload all engines
4039
"""
4140

@@ -51,6 +50,7 @@ def run(argv: Optional[list[str]], app_version: str) -> int:
5150
args = list(argv or sys.argv[1:])
5251
no_splash = False
5352
ide_gui = False
53+
classic_gui = False
5454

5555
if "--verbose" in args:
5656
import os
@@ -65,6 +65,9 @@ def run(argv: Optional[list[str]], app_version: str) -> int:
6565
if "--ide-gui" in args:
6666
ide_gui = True
6767
args = [a for a in args if a != "--ide-gui"]
68+
if "--classic-gui" in args:
69+
classic_gui = True
70+
args = [a for a in args if a != "--classic-gui"]
6871

6972
if "--cli" in args:
7073
args = [a for a in args if a != "--cli"]
@@ -78,9 +81,6 @@ def run(argv: Optional[list[str]], app_version: str) -> int:
7881
if args[0] in ("--version", "-v", "version"):
7982
info(f"PyCompiler ARK v{app_version}")
8083
return 0
81-
if args[0] == "--completion" and len(args) > 1:
82-
print_command_completion(args[1])
83-
return 0
8484
if args[0] == "--info":
8585
print_system_info(app_version)
8686
return 0
@@ -132,4 +132,6 @@ def run(argv: Optional[list[str]], app_version: str) -> int:
132132
plain(USAGE)
133133
return 1
134134

135-
return launch_main_application(no_splash=no_splash, ide_gui=ide_gui)
135+
return launch_main_application(
136+
no_splash=no_splash, ide_gui=ide_gui, classic_gui=classic_gui
137+
)

cli/launchers.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,9 @@ def launch_engines_only_standalone(workspace_dir: Optional[str] = None) -> int:
111111
return 1
112112

113113

114-
def launch_main_application(no_splash: bool = False, ide_gui: bool = False) -> int:
114+
def launch_main_application(
115+
no_splash: bool = False, ide_gui: bool = False, classic_gui: bool = False
116+
) -> int:
115117
try:
116118
from Core import PyCompilerArkGui
117119
from PySide6.QtCore import Qt, QTimer
@@ -224,10 +226,10 @@ def launch_main_application(no_splash: bool = False, ide_gui: bool = False) -> i
224226

225227
def _launch_main():
226228
try:
227-
if ide_gui:
229+
if classic_gui:
230+
os.environ["PYCOMPILER_UI_VARIANT"] = "classic"
231+
elif ide_gui:
228232
os.environ["PYCOMPILER_UI_VARIANT"] = "ide2"
229-
else:
230-
os.environ.pop("PYCOMPILER_UI_VARIANT", None)
231233
window = PyCompilerArkGui()
232234
set_window_icon(window)
233235
window.show()
@@ -242,10 +244,10 @@ def _launch_main():
242244

243245
QTimer.singleShot(max(0, delay_ms), _launch_main)
244246
else:
245-
if ide_gui:
247+
if classic_gui:
248+
os.environ["PYCOMPILER_UI_VARIANT"] = "classic"
249+
elif ide_gui:
246250
os.environ["PYCOMPILER_UI_VARIANT"] = "ide2"
247-
else:
248-
os.environ.pop("PYCOMPILER_UI_VARIANT", None)
249251
window = PyCompilerArkGui()
250252
set_window_icon(window)
251253
window.show()

0 commit comments

Comments
 (0)