Commit b5906b28 authored by Dirk Wilden's avatar Dirk Wilden
Browse files

added options

-disableRedraw
-currentScriptDir

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@3016 383ad7c9-94d9-4d36-a494-682f7c89f535
parent c87c3364
...@@ -92,6 +92,8 @@ class RPCInterface { ...@@ -92,6 +92,8 @@ class RPCInterface {
*/ */
virtual void getValue( QString _expression , QVariant& _result ) {}; virtual void getValue( QString _expression , QVariant& _result ) {};
virtual void getPlugin( QString _name, QObject* & _plugin ) {};
}; };
Q_DECLARE_INTERFACE(RPCInterface,"OpenFlipper.RPCInterface/1.0") Q_DECLARE_INTERFACE(RPCInterface,"OpenFlipper.RPCInterface/1.0")
......
...@@ -550,7 +550,7 @@ void Core::updateView() { ...@@ -550,7 +550,7 @@ void Core::updateView() {
} }
if ( OpenFlipper::Options::gui() && !OpenFlipper::Options::openingIni() ) { if ( OpenFlipper::Options::gui() && !OpenFlipper::Options::openingIni() && !OpenFlipper::Options::redrawDisabled() ) {
coreWidget_->examiner_widget_->sceneGraph(root_node_scenegraph_); coreWidget_->examiner_widget_->sceneGraph(root_node_scenegraph_);
coreWidget_->examiner_widget_->updateGL(); coreWidget_->examiner_widget_->updateGL();
} }
...@@ -743,5 +743,17 @@ void Core::slotLogToFile(Logtype _type, QString _message){ ...@@ -743,5 +743,17 @@ void Core::slotLogToFile(Logtype _type, QString _message){
} }
// //-----------------------------------------------------------------------------
//
// void Core::slotGetPlugin(QString _name, QObject* & _plugin ){
// for (uint i=0; i < plugins.size(); i++)
// if (plugins[i].name == _name){
// _plugin = plugins[i].plugin;
// return;
// }
//
// _plugin = 0;
// return;
// }
//============================================================================= //=============================================================================
...@@ -253,6 +253,9 @@ signals: ...@@ -253,6 +253,9 @@ signals:
/// Called when a plugin requests a list of file-filters /// Called when a plugin requests a list of file-filters
void slotGetAllFilters ( QStringList& _list); void slotGetAllFilters ( QStringList& _list);
/// Get a Pointer to the Plugin with given _name (if it is loaded)
// void slotGetPlugin(QString _name, QObject* & _plugin );
/** @} */ /** @} */
//=========================================================================== //===========================================================================
......
...@@ -133,6 +133,13 @@ void Core::readApplicationOptions(INIFile& _ini) { ...@@ -133,6 +133,13 @@ void Core::readApplicationOptions(INIFile& _ini) {
if( _ini.get_entry(startup_dir, "Options", "StartupDir") ) if( _ini.get_entry(startup_dir, "Options", "StartupDir") )
OpenFlipper::Options::currentDir(startup_dir); OpenFlipper::Options::currentDir(startup_dir);
//============================================================================
// Load the default script directory
//============================================================================
QString script_dir;
if( _ini.get_entry(script_dir, "Options", "ScriptDir") )
OpenFlipper::Options::currentScriptDir(script_dir);
//============================================================================ //============================================================================
// Load the random base color setting // Load the random base color setting
//============================================================================ //============================================================================
...@@ -367,6 +374,10 @@ void Core::writeApplicationOptions(INIFile& _ini) { ...@@ -367,6 +374,10 @@ void Core::writeApplicationOptions(INIFile& _ini) {
QString dir = OpenFlipper::Options::currentDirStr().toUtf8(); QString dir = OpenFlipper::Options::currentDirStr().toUtf8();
_ini.add_entry("Options","StartupDir",dir); _ini.add_entry("Options","StartupDir",dir);
QString scriptDir = OpenFlipper::Options::currentScriptDirStr().toUtf8();
_ini.add_entry("Options","ScriptDir",scriptDir);
_ini.add_entry("Options","SetRandomBaseColor",set_random_base_color_); _ini.add_entry("Options","SetRandomBaseColor",set_random_base_color_);
if ( OpenFlipper::Options::gui() ) { if ( OpenFlipper::Options::gui() ) {
......
...@@ -795,6 +795,9 @@ void Core::loadPlugin(QString filename, bool silent){ ...@@ -795,6 +795,9 @@ void Core::loadPlugin(QString filename, bool silent){
if ( checkSignal(plugin,"getValue(QString,QVariant&)" ) ) if ( checkSignal(plugin,"getValue(QString,QVariant&)" ) )
connect(plugin , SIGNAL(getValue(QString,QVariant&)), connect(plugin , SIGNAL(getValue(QString,QVariant&)),
this , SLOT(slotGetValue(QString,QVariant&)) ,Qt::DirectConnection ); this , SLOT(slotGetValue(QString,QVariant&)) ,Qt::DirectConnection );
// if ( checkSignal(plugin,"getPlugin(QString,QObject*&)" ) )
// connect(plugin , SIGNAL(getPlugin(QString, QObject* &)),
// this , SLOT(slotGetPlugin(QString, QObject* &)) ,Qt::DirectConnection );
} }
//======================================================================================== //========================================================================================
......
...@@ -72,6 +72,9 @@ static QStringList optionFiles_; ...@@ -72,6 +72,9 @@ static QStringList optionFiles_;
/// Currentdirectory of the application /// Currentdirectory of the application
static QDir currentDir_; static QDir currentDir_;
/// Current script directory of the application
static QDir currentScriptDir_;
/// Experience level of the user /// Experience level of the user
static Experience experienceLevel_ = NOVICE; static Experience experienceLevel_ = NOVICE;
...@@ -102,6 +105,9 @@ static int maxFrameRate_ = 35; ...@@ -102,6 +105,9 @@ static int maxFrameRate_ = 35;
/// Store the standardDrawMode_ mode /// Store the standardDrawMode_ mode
static uint standardDrawMode_ = ACG::SceneGraph::DrawModes::SOLID_SMOOTH_SHADED; static uint standardDrawMode_ = ACG::SceneGraph::DrawModes::SOLID_SMOOTH_SHADED;
/// Store the disableRedraw_ mode
static bool redrawDisabled_ = false;
/// Store the toolbox gui Mode mode /// Store the toolbox gui Mode mode
static bool hideToolbox_ = false; static bool hideToolbox_ = false;
...@@ -199,31 +205,34 @@ QString dirSeparator() { ...@@ -199,31 +205,34 @@ QString dirSeparator() {
return QString("/"); return QString("/");
} }
QDir applicationDir() { return applicationDir_; } QDir applicationDir() { return applicationDir_; }
QDir configDir() { return configDir_; } QDir configDir() { return configDir_; }
QDir pluginDir() { return pluginDir_; } QDir pluginDir() { return pluginDir_; }
QDir shaderDir() { return shaderDir_; } QDir shaderDir() { return shaderDir_; }
QDir textureDir() { return textureDir_; } QDir textureDir() { return textureDir_; }
QDir iconDir() { return iconDir_; } QDir iconDir() { return iconDir_; }
QDir currentDir() { return currentDir_; } QDir currentDir() { return currentDir_; }
QDir currentScriptDir(){ return currentScriptDir_; }
QString applicationDirStr() { return applicationDir_.absolutePath() ; }
QString configDirStr() { return configDir_.absolutePath(); } QString applicationDirStr() { return applicationDir_.absolutePath() ; }
QString pluginDirStr() { return pluginDir_.absolutePath(); } QString configDirStr() { return configDir_.absolutePath(); }
QString shaderDirStr() { return shaderDir_.absolutePath(); } QString pluginDirStr() { return pluginDir_.absolutePath(); }
QString textureDirStr() { return textureDir_.absolutePath(); } QString shaderDirStr() { return shaderDir_.absolutePath(); }
QString iconDirStr() { return iconDir_.absolutePath(); } QString textureDirStr() { return textureDir_.absolutePath(); }
QString currentDirStr() { return currentDir_.absolutePath(); } QString iconDirStr() { return iconDir_.absolutePath(); }
QString currentDirStr() { return currentDir_.absolutePath(); }
QString currentScriptDirStr(){ return currentScriptDir_.absolutePath();}
QStringList optionFiles() { return optionFiles_; } QStringList optionFiles() { return optionFiles_; }
void applicationDir(QDir _dir) { applicationDir_ = _dir; } void applicationDir(QDir _dir) { applicationDir_ = _dir; }
void pluginDir(QDir _dir) { pluginDir_ = _dir; } void pluginDir(QDir _dir) { pluginDir_ = _dir; }
void shaderDir(QDir _dir) { shaderDir_ = _dir; } void shaderDir(QDir _dir) { shaderDir_ = _dir; }
void textureDir(QDir _dir) { textureDir_ = _dir; } void textureDir(QDir _dir) { textureDir_ = _dir; }
void iconDir(QDir _dir) { iconDir_ = _dir; } void iconDir(QDir _dir) { iconDir_ = _dir; }
void configDir(QDir _dir) { configDir_ = _dir; } void configDir(QDir _dir) { configDir_ = _dir; }
void currentDir(QDir _dir) { currentDir_ = _dir; } void currentDir(QDir _dir) { currentDir_ = _dir; }
void currentScriptDir(QDir _dir) { currentScriptDir_ = _dir; }
void optionFiles(QStringList _list) { optionFiles_ = _list; } void optionFiles(QStringList _list) { optionFiles_ = _list; }
...@@ -290,6 +299,15 @@ bool currentDir(QString _dir) { ...@@ -290,6 +299,15 @@ bool currentDir(QString _dir) {
return false; return false;
} }
bool currentScriptDir(QString _dir) {
QDir tmp(_dir);
if (tmp.exists()) {
currentScriptDir_ = tmp;
return true;
}
return false;
}
/// Get experience level /// Get experience level
Experience getExperience() { Experience getExperience() {
return experienceLevel_; return experienceLevel_;
...@@ -389,6 +407,14 @@ uint standardDrawMode(){ ...@@ -389,6 +407,14 @@ uint standardDrawMode(){
return standardDrawMode_; return standardDrawMode_;
} }
void redrawDisabled( bool disable ){
redrawDisabled_ = disable;
}
bool redrawDisabled( ){
return redrawDisabled_;
}
/// Set if we start the logging widget closed /// Set if we start the logging widget closed
void hideLogger( bool _hide) { void hideLogger( bool _hide) {
hideLogger_ = _hide; hideLogger_ = _hide;
......
...@@ -188,6 +188,22 @@ bool iconDir(QString _dir); ...@@ -188,6 +188,22 @@ bool iconDir(QString _dir);
DLLEXPORT DLLEXPORT
bool currentDir(QString _dir); bool currentDir(QString _dir);
/// return the current script-directory
DLLEXPORT
QString currentScriptDirStr();
/// return the current Script-directory
DLLEXPORT
QDir currentScriptDir();
/// Sets the Path to the current Script-directory
DLLEXPORT
void currentScriptDir(QDir _dir);
/// Sets the Path to the current Script-directory
DLLEXPORT
bool currentScriptDir(QString _dir);
/// return last used dataType /// return last used dataType
DLLEXPORT DLLEXPORT
QString lastDataType(); QString lastDataType();
...@@ -333,6 +349,14 @@ bool iconDir(QString _dir); ...@@ -333,6 +349,14 @@ bool iconDir(QString _dir);
DLLEXPORT DLLEXPORT
uint standardDrawMode( ); uint standardDrawMode( );
/// Store disableRedraw setting
DLLEXPORT
void redrawDisabled( bool disable );
/// get disableRedraw setting
DLLEXPORT
bool redrawDisabled( );
/** @} */ /** @} */
//=========================================================================== //===========================================================================
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment