added loadSettings

This commit is contained in:
Guido Ranzuglia granzuglia 2009-09-23 04:34:15 +00:00
parent 6ab7bb3024
commit e0a6bb56cc
2 changed files with 34 additions and 0 deletions

View File

@ -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<QAction *> editActionList;
QList<QAction *> 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

View File

@ -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<QAction *> actionList, QMenu *menu, const char *slot)
{
foreach (QAction *a, actionList)