%
% 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=Make(mode,_ALL_IN_ONE_)
All-in-1($$)=Make(mode,_ALL_IN_ONE_)

[Mode]=_ALL_IN_ONE_

(EnterMode)=\
	Make(var,home,echo $HOME);\
	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,Power Off,Suspend);

Power Off=\
	Macro(DEFAULT_PC_SWITCHOFF);

Suspend=\
	Macro(DEFAULT_PC_SUSPEND);

Power Off($$)=\
	Macro(DEFAULT_PC_SWITCHOFF);

Suspend($$)=\
	Macro(DEFAULT_PC_SUSPEND);
	
SHOWSW=Macro(GEN_FILE_IF);

GEN_FILE_IF=\
	Set(popup,show,Please wait ...);\
	Make(var,init_op,if [ -f $HOME/.anyRemote/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($(home)/.anyRemote/AllInOneTmp.cfg);\
	Macro(UPLOAD0);

LOAD_FILE=\
	Include($(home)/.anyRemote/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,Power Off,Suspend);

Cancel=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=Exit
1=Macro(SHOWSW)

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

[ModeEnd]

[End]
