diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-03-10 20:44:18 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-03-10 20:44:18 +0000 |
commit | a39b92f278f6d1530cb151875b445185951634df (patch) | |
tree | 3adaf003614915d78c38782a51353690f9136852 /src/options.cpp | |
download | potracegui-a39b92f278f6d1530cb151875b445185951634df.tar.gz potracegui-a39b92f278f6d1530cb151875b445185951634df.zip |
Added KDE3 version of POTraceGUI
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/potracegui@1101754 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/options.cpp')
-rw-r--r-- | src/options.cpp | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/src/options.cpp b/src/options.cpp new file mode 100644 index 0000000..e3aaa71 --- /dev/null +++ b/src/options.cpp @@ -0,0 +1,87 @@ +/*************************************************************************** + * Copyright (C) 2003 by Antonio Fasolato * + * Antonio.Fasolato@poste.it * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ***************************************************************************/ +#include "options.h" + +#include <iostream> +#include <map> +using namespace std; + +#include <qstring.h> + +Options::Options(): options() +{ +} + +void Options::setValue(QString key, QString value) { + if(options.find(key)!=options.end()) + options.erase(options.find(key)); + map<QString,QString>::value_type v(key,value); + options.insert(v); +} + +bool Options::isEmpty() { + return options.empty(); +} + +void Options::clear() { + options.clear(); +} + +QString Options::operator[](QString key) { + if(options.find(key)!=options.end()) + return options[key]; + else + return ""; +} + +void Options::defaultOptions(){ + clear(); + + //input-output + setValue("blackLevel","0.5"); + setValue("invertInput","n"); + setValue("outputFileName",""); + setValue("outputFormat","eps"); + setValue("pageSize","letter"); + setValue("optimizedNumericalCode","y"); + setValue("compressionLevel","2"); + + //Color + setValue("foregroundBtn","#000000"); + setValue("backgroundBtn","#F8F9FB"); + + //Algorithm + setValue("policy","4"); + setValue("despeckle","0"); + setValue("cornerThreshold","1.00"); + setValue("optimizationTolerance","0.2"); + setValue("outputQuantization","10"); + setValue("curveOptimization","y"); + + //Transformation + setValue("width","0.0"); + setValue("height","0.0"); + setValue("stretch","1.0"); + setValue("rotation","0.0"); + + //Resolution + setValue("resolution","0.0"); + + //Margins + setValue("syncronizeMargins","y"); + setValue("margins","0.0"); +} + +void Options::debug() { + for(map<QString,QString>::iterator i=options.begin(); i!=options.end(); i++) + cout << (*i).first << "=" << (*i).second << endl; +} + + |