Skip to content

Commit 574bf35

Browse files
authored
Enable expand all button for Libraries (#14604)
1 parent 8742c5f commit 574bf35

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

OMEdit/OMEditLIB/Modeling/LibraryTreeWidget.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2979,7 +2979,6 @@ void LibraryTreeView::showContextMenu(QPoint point)
29792979
QFileInfo fileInfo(pLibraryTreeItem->getFileName());
29802980
switch (pLibraryTreeItem->getLibraryType()) {
29812981
case LibraryTreeItem::Modelica:
2982-
default:
29832982
menu.addAction(mpOpenClassAction);
29842983
menu.addAction(mpInformationAction);
29852984
if (!pLibraryTreeItem->isSystemLibrary()) {
@@ -3118,6 +3117,9 @@ void LibraryTreeView::showContextMenu(QPoint point)
31183117
menu.addSeparator();
31193118
menu.addAction(mpCopyPathAction);
31203119
break;
3120+
default:
3121+
qDebug() << "Unhanled library type" << pLibraryTreeItem->getLibraryType();
3122+
break;
31213123
}
31223124
}
31233125
} else {
@@ -3815,8 +3817,7 @@ LibraryWidget::LibraryWidget(QWidget *pParent)
38153817
mpLibraryTreeProxyModel->setSourceModel(mpLibraryTreeModel);
38163818
mpLibraryTreeView = new LibraryTreeView(this);
38173819
mpLibraryTreeView->setModel(mpLibraryTreeProxyModel);
3818-
mpTreeSearchFilters->getExpandAllButton()->setEnabled(false);
3819-
mpTreeSearchFilters->getExpandAllButton()->setToolTip(tr("Expanding the Library Browser is a time consuming and non-responsive operation so this button is disabled intentionally."));
3820+
connect(mpTreeSearchFilters->getExpandAllButton(), SIGNAL(clicked()), mpLibraryTreeView, SLOT(expandAll()));
38203821
connect(mpTreeSearchFilters->getCollapseAllButton(), SIGNAL(clicked()), mpLibraryTreeView, SLOT(collapseAll()));
38213822
// create the layout
38223823
QGridLayout *pMainLayout = new QGridLayout;

OMEdit/OMEditLIB/Search/SearchWidget.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,11 @@ SearchWidget::SearchWidget(QWidget *pParent)
8686
mpClearAction->setDisabled(false);
8787
connect(mpClearAction, SIGNAL(triggered()), SLOT(clearAll()));
8888
// expand action
89-
mpExpandAction = new QAction(QIcon(":/Resources/icons/down.svg"), tr("Expand All"), this);
90-
mpExpandAction->setStatusTip(tr("expand"));
89+
mpExpandAction = new QAction(QIcon(":/Resources/icons/down.svg"), Helper::expandAll, this);
9190
mpExpandAction->setDisabled(true);
9291
connect(mpExpandAction, SIGNAL(triggered()), SLOT(expandAll()));
9392
// Collapse action
94-
mpCollapseAction = new QAction(QIcon(":/Resources/icons/up.svg"), tr("Collapse All"), this);
95-
mpCollapseAction->setStatusTip(tr("collapse"));
93+
mpCollapseAction = new QAction(QIcon(":/Resources/icons/up.svg"), Helper::collapseAll, this);
9694
mpCollapseAction->setDisabled(true);
9795
connect(mpCollapseAction, SIGNAL(triggered()), SLOT(collapseAll()));
9896
// search history widget

0 commit comments

Comments
 (0)