Skip to content

Commit

Permalink
- Made the code for LibraryWidget a little more extensible
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@7910 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Feb 14, 2011
1 parent 8f4c796 commit 57316de
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions OMEdit/OMEditGUI/LibraryWidget.cpp
Expand Up @@ -438,16 +438,21 @@ void LibraryTree::addModelicaStandardLibrary()
mpParentLibraryWidget->mpParentMainWindow->mpOMCProxy->loadStandardLibrary();
if (mpParentLibraryWidget->mpParentMainWindow->mpOMCProxy->isStandardLibraryLoaded())
{
LibraryTreeNode *newTreePost = new LibraryTreeNode(QString("Modelica"), QString(""), QString("Modelica"),
(QTreeWidget*)0);
newTreePost->setChildIndicatorPolicy(QTreeWidgetItem::ShowIndicator);
insertTopLevelItem(0, newTreePost);

// get the Icon for Modelica tree node
LibraryLoader *libraryLoader = new LibraryLoader(newTreePost, tr("Modelica"), this);
libraryLoader->start(QThread::HighestPriority);
while (libraryLoader->isRunning())
qApp->processEvents();
// It should be possible to load multiple libraries in OMEdit...
const int numLib=1;
const char *libs[numLib] = {"Modelica"};
for (int i=0; i<numLib; i++) {
LibraryTreeNode *newTreePost = new LibraryTreeNode(QString(libs[i]), QString(""), QString(libs[i]),
(QTreeWidget*)0);
newTreePost->setChildIndicatorPolicy(QTreeWidgetItem::ShowIndicator);
insertTopLevelItem(0, newTreePost);

// get the Icon for Modelica tree node
LibraryLoader *libraryLoader = new LibraryLoader(newTreePost, tr(libs[i]), this);
libraryLoader->start(QThread::HighestPriority);
while (libraryLoader->isRunning())
qApp->processEvents();
}

// addClass("Ground", "", "Modelica.Electrical.Analog.Basic.", true);
// addClass("Resistor", "", "Modelica.Electrical.Analog.Basic.", true);
Expand Down

0 comments on commit 57316de

Please sign in to comment.