%
% anyremote configuration file (Server-mode)
%

% STATUS stable
% XTEST no
% SOUND no
% ENV no

GuiAppName=All-in-1_v2
GuiAppType=Application
GuiAppBinary=true
GuiAppProtocols=Server
GuiAppDesc=Manage a set of applications at once (version 2)

[Protocol]=Server

%
% Need to include all possible stuff
%
(Init)=\
	Include($(CfgDir)/Utils/aliases-server.cfg);\
	Macro(SETUP_DEFAULT_POWER_MANAGEMENT);

(Connect)=\
	Set(parameter,debug,on);\
	Make(mode,_ALL_IN_ONE_);

ALLIN1MENU=\
	Set(menu,add,All-in-1);

All-in-1=\
    Macro(ALLIN1_CALLBACK);

All-in-1($$)=\
    Macro(ALLIN1_CALLBACK);
    
ALLIN1_CALLBACK=\
    Set(popup,show,Loading...);\
    Macro(APP_QUIT);\
    Make(flush);\
    Include($(CfgDir)/Server-mode/all-in-one2.cfg);\
    Macro((Init));\
    Macro((Connect));\
    Set(popup,hide);\
    Make(mode,_ALL_IN_ONE_);

[Mode]=_ALL_IN_ONE_

(EnterMode)=\
	Macro(ALL_IN_ONE_SETUP);\
	Macro(SHOWSW);

ALL_IN_ONE_SETUP=\
	Set(layout,default);\
	Set(icons,All-in-one,1,plus,2,default,3,default,4,default,5,default,6,default,7,default,8,default,9,default,*,question,0,no,#,default);\
	Set(title,press 1 to select application);\
	Set(status,);\
	Set(menu,replace,PowerMgmt);
	
SHOWSW=Macro(GEN_FILE_IF);

GEN_FILE_IF=\
	Set(popup,show,Please wait ...);\
	Make(var,init_op,if [ -f $(TmpDir)/AllInOneTmp.cfg ]; then echo LOAD_FILE; else echo GEN_FILE; fi);\
	Macro($(init_op));

GEN_FILE=\
	Make(var,wait_exec,$(CfgDir)/Utils/all-in-1.py $(CfgDir);echo "ready");\
	Include($(TmpDir)/AllInOneTmp.cfg);\
	Macro(UPLOAD0);

LOAD_FILE=\
	Include($(TmpDir)/AllInOneTmp.cfg);\
	Set(list,replace,Applications,);\
	Macro(FILL_LIST);\
	Set(popup,hide);

Regenerate($$)=\
	Macro(REGEN_FILE);

Regenerate=\
	Macro(REGEN_FILE);

REGEN_FILE=\
	Set(popup,show,Please wait ...);\
	Macro(GEN_FILE);
	
REGEN_MENU=\
	Set(menu,replace,Select,Regenerate,PowerMgmt);

Cancel=\
    Make(exit);

Back=\
	Set(text,close);\
	Macro(ALL_IN_ONE_SETUP);

Back($$)=\
	Set(list,close);\
	Macro(ALL_IN_ONE_SETUP);

Push($$)  =Macro(SELECT);
Select($$)=Macro(SELECT);
Shutdown  =Exec(poweroff)

SELECT=\
	Set(popup,show,Loading...);\
	Make(flush);\
	Include($(CfgDir)/Server-mode/$(Param).cfg);\
	Macro((Init));\
	Macro((Connect));\
	Include($(CfgDir)/Server-mode/all-in-one2.cfg);\
	Macro(ALLIN1MENU);\
	Set(popup,hide);

0=Macro(Cancel);
1=Macro(SHOWSW)

* *=Set(text,replace,Help,Press 1, then\n choose application to manage)

[ModeEnd]

[End]
