%
% anyremote configuration file for kuickshow management. (Server-mode)
%
% There were found no DCOP-oriented way to traverse the albums and photos, so XTest is used
%

% STATUS stable
% XTEST yes
% SOUND no
% ENV no
% FBROWSER v.3

GuiAppName=Kuickshow
GuiAppBinary=kuickshow
GuiAppRun=echo 'A=`dcop 2> /dev/null|grep kuickshow`; if [ "x$A" == "x" ]; then echo NOK; else echo OK; fi'|bash -f -s
GuiAppIcon=kuickshow.png
GuiAppType=Application
GuiAppProtocols=Server
GuiAppDesc=KuickShow is an image browser/viewer 
GuiAppVersion=echo 'V=`kuickshow -v|grep KDE|tr -d " "|cut -f 2 -d ":"|cut -f 1 -d "."`; if [ "x$V" == "x3" ]; then echo OK; else echo NOK; fi'|bash -f -s

[Protocol]=Server

(Init)=Include($(CfgDir)/Utils/aliases-server.cfg);\
	Exec(echo 'V=`amarok -v|grep KDE|tr -d " "|cut -f 2 -d ":"|cut -f 1 -d "."`; if [ "x$V" == "x4" ]; then $(CfgDir)/Utils/message.sh "ERROR: this configuration file is for KDE3"; fi'|bash -f -s);

(Connect)=Macro(KUICKSHOW_LAYOUT);\
	Set(title,);\
	Set(status,);

KUICKSHOW_LAYOUT=Set(icons,Kuickshow,1,folder,2,up,3,up,4,left,5,fullscreen,6,right,7,default,8,down,9,file,*,question,0,default,#,no);

Cancel=Exec(echo 'K=`dcop|grep kuickshow`;dcop $K MainApplication-Interface quit'|bash -f -s);

Back=Set(text,close);
Back($$)=Set(list,close);
UpdateMenu=Set(menu,replace,GoTo,Open Dir);

% FBROWSER v.3 
FillList=Set(list,replace,Files,..);\
	ExecAndSet(list,add,SAME,cd "`cat $HOME/.anyRemote/ar_storedir.tmp`";ls -F --quoting-style=shell|sed 's/\*//;s/@//;s/,/\r/g;s/$/,/');
GoTo($$)=Set(list,replace,SAME,..);\
	Make(var,goto,by_value,$(Param));\
	ExecAndSet(list,add,SAME,cd "`cat $HOME/.anyRemote/ar_storedir.tmp`";echo "if [ -d $(goto) ]; then cd $(goto);fi;pwd>$HOME/.anyRemote/ar_storedir.tmp;ls -F --quoting-style=shell|sed 's/\*//;s/@//;s/,/\r/g;s/$/,/'"|bash -f -s);
% FBROWSER v.3 

Open Dir($$)=Set(list,close);\
	Set(menu,clear);\
	Exec(echo 'K=`dcop|grep kuickshow`;if [ "x$K" == "x" ]; then true; else dcop $K MainApplication-Interface quit; fi;'| bash -f -s;kuickshow "`cat $HOME/.anyRemote/ar_storedir.tmp`/$(Param)");\
	Emulate(sleep,5000,key,Tab,sleep,500,key,Tab);

1=Macro(FillList);Macro(UpdateMenu);
2=Emulate(key,Page_Up)
3=Exec(echo 'K=`dcop|grep kuickshow`;dcop $K kuickshow activateAction up'|bash -f -s)

4=Emulate(key,Left)
5=Make(mode,Fullscreen);
6=Emulate(key,Right)

8=Emulate(key,Page_Down)
9=Emulate(key,Return)

* *=Set(text,replace,Help,1 - File browser\n2 - Up\n3 - Up Dir\n4 - Left\n5 - Full Screen\n6 - Right\n8 - Down\n9 - Into Dir\n* * - Help\n# - Quit\n)
#=Exec(echo 'K=`dcop|grep kuickshow`;dcop $K MainApplication-Interface quit'|bash -f -s)

[Mode]=Fullscreen

(EnterMode)=Set(icons,SAME,1,default,2,default,3,default,5,no,7,minus,8,default,9,plus);Exec(echo 'KS=`dcop|grep kuickshow`;dcop $KS kuickshow activateAction kuick_showFullscreen'|bash -f -s)

% empty values to override default ones
1=Make(none)
2=Make(none)
3=Make(none)

% Prev/Fullscreen off/Next
4=Emulate(key,Page_Up)
5=Make(mode,default);Macro(KUICKSHOW_LAYOUT);Emulate(key,Escape)
6=Emulate(key,Page_Down)

% Size -/ /Size +
7=Emulate(key,minus)
8=Make(none)
9=Emulate(keydown,Shift_L,key,plus,keyup,Shift_L)

* *=Set(text,replace,Help,4 - Previous\n5 - Full Screen Off\n6 - Next\n7 - Size -\nSize +\n* * - Help\n# - Quit)

[ModeEnd]

[End]
