diff --git a/src/meshlab/mainwindow.h b/src/meshlab/mainwindow.h index bf7b5a73e..1e39b53e4 100644 --- a/src/meshlab/mainwindow.h +++ b/src/meshlab/mainwindow.h @@ -296,6 +296,7 @@ private: void createActions(); void createMenus(); void createToolBars(); + void loadMeshLabSettings(); void loadPlugins(); void keyPressEvent(QKeyEvent *); void updateRecentFileActions(); @@ -321,6 +322,10 @@ private: QList editActionList; QList decoratorActionList; + //*********WARNING******* + //it should be moved away from here! MeshLabServer needs it too + RichParameterSet globalParams; + QByteArray toolbarState; //stato delle toolbar e dockwidgets QDir lastUsedDirectory; //This will hold the last directory that was used to load/save a file/project in diff --git a/src/meshlab/mainwindow_Init.cpp b/src/meshlab/mainwindow_Init.cpp index 83c807583..8ee75a9f6 100644 --- a/src/meshlab/mainwindow_Init.cpp +++ b/src/meshlab/mainwindow_Init.cpp @@ -724,6 +724,35 @@ void MainWindow::loadPlugins() } +void MainWindow::loadMeshLabSettings() +{ + QDomDocument doc("MeshLabSettings"); + QFile file("meshlabsettings.xml"); + if (!file.open(QIODevice::ReadOnly)) + return; + if (!doc.setContent(&file)) + { + file.close(); + return; + } + file.close(); + + QDomElement docElem = doc.documentElement(); + + QDomNode n = docElem.firstChild(); + while(!n.isNull()) + { + QDomElement e = n.toElement(); + RichParameter* rpar = NULL; + if(!e.isNull()) + { + RichParameterFactory::create(e,&par); + globalParams.addParam(par); + } + n = n.nextSibling(); + } +} + void MainWindow::addToMenu(QList actionList, QMenu *menu, const char *slot) { foreach (QAction *a, actionList)