[OpenWalnut-Dev] [OWci] r6854: [ADD #320] Now there is the possibility to store the additional library paths of module toolboxes within the .OpenWalnut/config.script file. The file format is as follows and compatible with the config.qt4gui file format: The file should ...

Mathias Goldau math at informatik.uni-leipzig.de
Wed Jan 22 14:37:21 CET 2014


Hi Alex,

thank you! I even further suggest to rename the WGUI to WUI and further 
derive to WGUI or WScriptUI.

I made a ticket to discuss this http://www.openwalnut.org/issues/327

Mathias

On 22/01/14 12:06, Alexander Wiebel wrote:
> Hi fellow OW-developers
>
> I just realized (after years) that calling this ScriptGUI (where GUI
> stands for _graphical_ user interface) does make much sense. I would
> recommend to change the name to ScriptUI.
>
> Any comments on this suggestion?
>
> Cheers
> Alex
>
>
>
> On 01/16/2014 11:03 AM, math wrote:
>> *Branch default*
>> [ADD #320] Now there is the possibility to store the additional library paths of module toolboxes within the .OpenWalnut/config.script file. The file format is as follows and compatible with the config.qt4gui file format: The file should contain a line starting with "additionalModulePaths=" followed by a comma separated list of absolute paths. If the lines does not occur or the file is not present nothing will be done.
>>
>> changeset 6854:73ae843c578c in /srv/hg/ow (Thu Jan 16 10:49:33 2014 +0100):
>>
>> http://www.openwalnut.org/projects/openwalnut/repository/revisions/6854
>>
>> diffstat:
>>
>>   src/scriptgui/gui/WScriptGui.cpp |  34 +++++++++++++++++++++++++++++++++-
>>   src/scriptgui/gui/WScriptGui.h   |   9 +++++++++
>>   2 files changed, 42 insertions(+), 1 deletions(-)
>>
>> diffs (77 lines):
>>
>> diff -r 8450165961a4 -r 73ae843c578c src/scriptgui/gui/WScriptGui.cpp
>> --- a/src/scriptgui/gui/WScriptGui.cpp	Thu Jan 16 10:41:20 2014 +0100
>> +++ b/src/scriptgui/gui/WScriptGui.cpp	Thu Jan 16 10:49:33 2014 +0100
>> @@ -22,9 +22,14 @@
>>   //
>>   //---------------------------------------------------------------------------
>>
>> +#include <fstream>
>> +#include <sstream>
>>   #include <string>
>>   #include <vector>
>>
>> +#include <boost/algorithm/string/predicate.hpp>
>> +#include <boost/algorithm/string.hpp>
>> +
>>   #include "core/common/WLogger.h"
>>   #include "core/common/WIOTools.h"
>>   #include "core/common/WLogStream.h"
>> @@ -76,6 +81,8 @@
>>       WPathHelper::getPathHelper()->setBasePaths( walnutBin, homePath / ".OpenWalnut" );
>>   #endif
>>
>> +    loadToolboxes( WPathHelper::getHomePath() / "config.script" );
>> +
>>       //----------------------------
>>       // startup
>>       //----------------------------
>> @@ -201,4 +208,29 @@
>>   {
>>   }
>>
>> -
>> +void WScriptGui::loadToolboxes( boost::filesystem::path configPath )
>> +{
>> +    // add additional module paths to the PathHelper, the rest will be done by module loader
>> +    if( boost::filesystem::exists( configPath ) )
>> +    {
>> +        wlog::info( "Walnut" ) << "Reading config file from: " << configPath;
>> +        std::ifstream is( configPath.string().c_str() );
>> +        std::string line;
>> +        std::string pattern = "additionalModulePaths="; // same pattern in config.qt4gui file, so you may use symlinks
>> +        while( std::getline( is, line ) )
>> +        {
>> +            if( boost::starts_with( line, pattern ) )
>> +            {
>> +                std::istringstream ss( line.substr( pattern.size(), line.size() - pattern.size() ) );
>> +                std::string path;
>> +                while( std::getline( ss, path, ',' ) )
>> +                {
>> +                    boost::algorithm::trim( path );
>> +                    WPathHelper::getPathHelper()->addAdditionalModulePath( path );
>> +                    // wlog::debug( "Walnut" ) << "Added: " << path << " to PathHelper";
>> +                }
>> +                break;
>> +            }
>> +        }
>> +    }
>> +}
>> diff -r 8450165961a4 -r 73ae843c578c src/scriptgui/gui/WScriptGui.h
>> --- a/src/scriptgui/gui/WScriptGui.h	Thu Jan 16 10:41:20 2014 +0100
>> +++ b/src/scriptgui/gui/WScriptGui.h	Thu Jan 16 10:49:33 2014 +0100
>> @@ -79,6 +79,15 @@
>>       virtual void closeCustomWidget( WCustomWidget::SPtr );
>>
>>   protected:
>> +    /**
>> +     * If you need to load additional modules from your toolboxes, you might want specify these paths in a config file.
>> +     * In that file we need a line starting with: "additionalModulePaths=" followed by a comma separated list of paths.
>> +     * Please note this is the same format as in the config.qt4gui file, so you may symlink it.
>> +     *
>> +     * \param configPath This is the path to the config file. If not existent, nothing will be thrown or done.
>> +     */
>> +    virtual void loadToolboxes( boost::filesystem::path configPath );
>> +
>>       //! The programm options.
>>       boost::program_options::variables_map const& m_programOptions;
>>   };
>> _______________________________________________
>> All-openwalnut-commits mailing list
>> All-openwalnut-commits at lists.informatik.uni-leipzig.de
>> http://lists.informatik.uni-leipzig.de/mailman/listinfo/all-openwalnut-commits
>>
>
>
>
>
> _______________________________________________
> OpenWalnut-Dev mailing list
> OpenWalnut-Dev at lists.informatik.uni-leipzig.de
> http://lists.informatik.uni-leipzig.de/mailman/listinfo/openwalnut-dev
>
> Archive: http://lists.informatik.uni-leipzig.de/pipermail/openwalnut-dev/
>

-- 
Universität Leipzig
Fakultät für Mathematik und Informatik
Institut für Informatik
Augustusplatz 10, 04109 Leipzig
Phone: +493419732283


More information about the OpenWalnut-Dev mailing list