%
% anyremote configuration file for Gwenview/KDE3 management. (Server-mode)
%

% STATUS non-stable
% TODO
% XTEST no
% SOUND no
% ENV no
% FBROWSER v.3i

GuiAppName=Gwenview/KDE3
GuiAppBinary=gwenview
GuiAppVersion=echo 'V=`gwenview -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
GuiAppRun=echo 'A=`dcop 2> /dev/null|grep gwenview`; if [ "x$A" == "x" ]; then echo NOK; else echo OK; fi'|bash -f -s
GuiAppIcon=gwenview.png
GuiAppType=Application
GuiAppProtocols=Server
GuiAppDesc=Gwenview is a fast and easy to use image viewer for KDE. This configuration file is for Gwenview/KDE3.

[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)=Make(mode,gwenview);

[Mode]=gwenview

(EnterMode)=Set(layout,default);\
	Set(icons,Gwenview,1,folder,2,default,3,default,4,left,5,fullscreen,6,right,7,minus,8,fit,9,plus,0,default,*,question,#,no);\
	Set(title,);\
	Set(status,);\
	Macro(ALLIN1MENU);
	
Cancel=Macro(QUIT);

Back=Set(text,close);Macro(ALLIN1MENU)
Back($$)=Set(list,close);
UpdateMenu=Set(menu,replace,GoTo,Open,Go Home);

% FBROWSER v.3i 
FillList=Set(iconlist,replace,Files,folder:..);\
	Macro(FillDir);\
        Macro(FillFile);
FillDir =ExecAndSet(iconlist,add,SAME,cd "`cat $HOME/.anyRemote/ar_storedir.tmp`";ls -F --quoting-style=shell|sed 's/\*//;s/,/\r/g;s/@//;s/$/,/'|grep '/'| xargs -d '\n' -i echo "folder:" {});
FillFile=ExecAndSet(iconlist,add,SAME,cd "`cat $HOME/.anyRemote/ar_storedir.tmp`";ls -F --quoting-style=shell|sed 's/\*//;s/,/\r/g;s/@//;s/$/,/'|grep -v '/'| xargs -d '\n' -i echo "file:"{});
GoTo($$)=Make(var,goto,by_value,$(Param));\
	ExecAndSet(iconlist,replace,Files,cd "`cat $HOME/.anyRemote/ar_storedir.tmp`";echo "if [ -d $(goto) ]; then cd $(goto);fi;pwd>$HOME/.anyRemote/ar_storedir.tmp;"|bash -f -s;echo "folder:..");\
	Macro(FillDir);\
        Macro(FillFile);
Go Home($$)=ExecAndSet(iconlist,replace,Files,cd;pwd>$HOME/.anyRemote/ar_storedir.tmp;echo "folder:..");\
	Macro(FillDir);\
        Macro(FillFile);
% FBROWSER v.3i 

Open($$)=Set(list,close);\
	Set(menu,clear);\
	Macro(QUIT);\
	Exec(gwenview "`cat $HOME/.anyRemote/ar_storedir.tmp`");

QUIT=Exec(echo 'G=`dcop|grep gwenview`; if [ "x$G" == "x" ]; then true; else dcop $G MainApplication-Interface quit; fi'|bash -f -s)

1=Macro(QUIT);Macro(FillList);Macro(UpdateMenu);
2=Macro(NONE)
3=Macro(NONE)

4=Exec(echo 'GW=`dcop|grep gwenview`;dcop $GW gwenview-mainwindow#1 activateAction previous'|bash -f -s)
5=Exec(echo 'GW=`dcop|grep gwenview`;dcop $GW gwenview-mainwindow#1 activateAction fullscreen'|bash -f -s)
6=Exec(echo 'GW=`dcop|grep gwenview`;dcop $GW gwenview-mainwindow#1 activateAction next'|bash -f -s)

% Size - / fit to window size / Size +
7=Exec(echo 'GW=`dcop|grep gwenview`;dcop $GW gwenview-mainwindow#1 activateAction view_zoom_out'|bash -f -s)
8=Exec(echo 'GW=`dcop|grep gwenview`;dcop $GW gwenview-mainwindow#1 activateAction view_zoom_to_fit'|bash -f -s)
9=Exec(echo 'GW=`dcop|grep gwenview`;dcop $GW gwenview-mainwindow#1 activateAction view_zoom_in'|bash -f -s)

* *=Set(text,replace,Help,1 - File browser\n\n 4 - Previous\n 5 - Full Screen\n 6 - Next\n 7 - Size -\n 8 - Fit To Window\n 9 - Size +\n * * - Help\n # - Quit)
0=Macro(NONE)
#=Macro(QUIT)

[ModeEnd]

[End]
