From: Jonas B. <jb...@us...> - 2005-09-30 12:54:25
|
Update of /cvsroot/krusader/krusader_kde3/krusader/UserAction In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7776/krusader/UserAction Modified Files: expander.cpp expander.h Log Message: added: Template for new placeholder %_View(...)% to access the internal viewer Index: expander.h =================================================================== RCS file: /cvsroot/krusader/krusader_kde3/krusader/UserAction/expander.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** expander.h 24 Feb 2005 22:59:14 -0000 1.15 --- expander.h 30 Sep 2005 12:54:16 -0000 1.16 *************** *** 254,257 **** --- 254,267 ---- /** + * This loads a file in the internal viewer + */ + class exp_View : public exp_placeholder { + public: + exp_View(); + EXP_FUNC; + }; + + + /** * The Expander expands the command of an UserAction by replacing all placeholders by thier current values.@n * Each placeholder begins with a '%'-sign, followed by one char indicating the panel, followed by a command which may have some paramenter enclosed in brackets and also ends with a '%'-sign. Index: expander.cpp =================================================================== RCS file: /cvsroot/krusader/krusader_kde3/krusader/UserAction/expander.cpp,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** expander.cpp 30 Sep 2005 12:01:51 -0000 1.42 --- expander.cpp 30 Sep 2005 12:54:16 -0000 1.43 *************** *** 770,773 **** --- 770,808 ---- #endif + exp_View::exp_View() { + _expression = "View"; + _description = i18n("View a file with Krusader's internal viewer"); + _needPanel = false; + + addParameter( new exp_parameter( i18n("Which file to view (normaly '%aCurrent%')"), "__placeholder", true ) ); + addParameter( new exp_parameter( i18n("Choose a view-mode"), "__choose:generic;text;hex", false ) ); + //addParameter( new exp_parameter( i18n("Choose a window-mode"), "__choose:tab;window;panel", false ) ); + //TODO: window-mode 'panel' should open the file in the third-hand viewer + addParameter( new exp_parameter( i18n("Choose a window-mode"), "__choose:tab;window", false ) ); + } + QString exp_View::expFunc( const ListPanel*, const QStringList& parameter, const bool& ) { + if ( parameter[0].isEmpty() ) { + krOut << "Expander: no file to view in %_View(filename)%; abort..." << endl; + return UA_CANCEL; + } + + QString viewMode, windowMode; + if ( parameter.count() <= 1 || parameter[1].isEmpty() ) + viewMode = "generic"; + else + viewMode = parameter[1]; + + if ( parameter.count() <= 2 || parameter[2].isEmpty() ) + windowMode = "tab"; + else + windowMode = parameter[2]; + + + //TODO: Call the viewer with viewMode and windowMode. Filename is in parameter[0]. + // It would be nice if parameter[0] could also be a space-separated filename-list (provided if the first parameter is %aList(selected)%) + + return QString::null; // this doesn't return everything, that's normal! + } + ///////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////// end of expander classes //////////////////////////////// *************** *** 800,803 **** --- 835,839 ---- addPlaceholder( new exp_Script() ); #endif + //addPlaceholder( new exp_View() ); // addPlaceholder( new exp_Run() ); } |