Skip to content

Commit

Permalink
Change to search for Wizards in $HOME, and in /usr/share/EMStudio
Browse files Browse the repository at this point in the history
  • Loading branch information
malcom2073 committed Nov 24, 2013
1 parent a3ed9ed commit 6163351
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 18 deletions.
44 changes: 26 additions & 18 deletions core/src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1530,25 +1530,9 @@ void MainWindow::emsOperatingSystem(QString os)
{
emsinfo.operatingSystem = os;
}

void MainWindow::emsCommsConnected()
void MainWindow::loadWizards(QString dir)
{
emsComms->startInterrogation();
m_interrogationFailureCount = 0;
ui.actionSave_Offline_Data->setEnabled(true);
ui.actionLoad_Offline_Data->setEnabled(true);
while (ui.menuWizards->actions().size() > 0)
{
QAction *action = ui.menuWizards->actions().takeFirst();
ui.menuWizards->removeAction(action);
delete action;
}
for (int i=0;i<m_wizardList.size();i++)
{
delete m_wizardList[i];
}
m_wizardList.clear();
QDir wizards("Wizards");
QDir wizards(dir);
foreach (QString file,wizards.entryList(QDir::Files | QDir::NoDotAndDotDot))
{
if (file.endsWith(".qml"))
Expand All @@ -1571,6 +1555,30 @@ void MainWindow::emsCommsConnected()
connect(view,SIGNAL(visibilityChanged(bool)),action,SLOT(setChecked(bool)));
}
}
}

void MainWindow::emsCommsConnected()
{
emsComms->startInterrogation();
m_interrogationFailureCount = 0;
ui.actionSave_Offline_Data->setEnabled(true);
ui.actionLoad_Offline_Data->setEnabled(true);
while (ui.menuWizards->actions().size() > 0)
{
QAction *action = ui.menuWizards->actions().takeFirst();
ui.menuWizards->removeAction(action);
delete action;
}
for (int i=0;i<m_wizardList.size();i++)
{
delete m_wizardList[i];
}
m_wizardList.clear();
//m_defaultsDir
QDir defaultsdir(m_defaultsDir);
loadWizards(defaultsdir.absolutePath() + "/wizards");
loadWizards("wizards");
loadWizards(m_localHomeDir + "/wizards");
//virtual QList<QString> getConfigList()=0;
for (int i=0;i<emsComms->getConfigList().size();i++)
{
Expand Down
1 change: 1 addition & 0 deletions core/src/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ class MainWindow : public QMainWindow
void setPlugin(QString plugin);
void connectToEms();
private:
void loadWizards(QString dir);
QList<unsigned short> m_locationIdList;
bool m_checkEmsDataInUse;
bool m_offlineMode;
Expand Down

0 comments on commit 6163351

Please sign in to comment.