diff options
author | Ken Moore <moorekou@gmail.com> | 2016-06-30 22:19:27 -0400 |
---|---|---|
committer | Ken Moore <moorekou@gmail.com> | 2016-06-30 22:19:27 -0400 |
commit | fda22def5e685517433f686307ea00e90b6ec070 (patch) | |
tree | 481b0aa4a67cd8cfe39698ef9722fc4d1e038727 /src-qt5/core-utils/lumina-config/pages/page_main.cpp | |
parent | Setup lumina-fileinfo that that it can be used to create brand-new applicatio... (diff) | |
parent | Ensure that the quick command run routine will never hang the system for more... (diff) | |
download | lumina-fda22def5e685517433f686307ea00e90b6ec070.tar.gz lumina-fda22def5e685517433f686307ea00e90b6ec070.tar.bz2 lumina-fda22def5e685517433f686307ea00e90b6ec070.zip |
Merge branch 'master' of github.com:trueos/lumina
Diffstat (limited to 'src-qt5/core-utils/lumina-config/pages/page_main.cpp')
-rw-r--r-- | src-qt5/core-utils/lumina-config/pages/page_main.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src-qt5/core-utils/lumina-config/pages/page_main.cpp b/src-qt5/core-utils/lumina-config/pages/page_main.cpp index ec03f8a5..976e7c69 100644 --- a/src-qt5/core-utils/lumina-config/pages/page_main.cpp +++ b/src-qt5/core-utils/lumina-config/pages/page_main.cpp @@ -14,6 +14,7 @@ page_main::page_main(QWidget *parent) : PageWidget(parent), ui(new Ui::page_main()){ ui->setupUi(this); ui->treeWidget->setMouseTracking(true); + ui->treeWidget->setSortingEnabled(false); //the QTreeView sort flag always puts them in backwards (reverse-alphabetical) connect(ui->treeWidget, SIGNAL(itemActivated(QTreeWidgetItem*,int)), this, SLOT(itemTriggered(QTreeWidgetItem*)) ); connect(ui->treeWidget, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(itemTriggered(QTreeWidgetItem*)) ); connect(ui->lineEdit, SIGNAL(textChanged(QString)), this, SLOT(searchChanged(QString)) ); @@ -65,10 +66,11 @@ void page_main::UpdateItems(QString search){ else{ ui->treeWidget->addTopLevelItem(it); } } //Now add the categories to the tree widget if they are non-empty - if(interface->childCount()>0){ ui->treeWidget->addTopLevelItem(interface); interface->setExpanded(true); } - if(appearance->childCount()>0){ ui->treeWidget->addTopLevelItem(appearance); appearance->setExpanded(true); } - if(session->childCount()>0){ ui->treeWidget->addTopLevelItem(session); session->setExpanded(true); } - if(user->childCount()>0){ ui->treeWidget->addTopLevelItem(user); user->setExpanded(true); } + if(interface->childCount()>0){ ui->treeWidget->addTopLevelItem(interface); interface->setExpanded(!search.isEmpty()); } + if(appearance->childCount()>0){ ui->treeWidget->addTopLevelItem(appearance); appearance->setExpanded(!search.isEmpty()); } + if(session->childCount()>0){ ui->treeWidget->addTopLevelItem(session); session->setExpanded(!search.isEmpty()); } + if(user->childCount()>0){ ui->treeWidget->addTopLevelItem(user); user->setExpanded(!search.isEmpty()); } + ui->treeWidget->sortItems(0, Qt::AscendingOrder); } //================ |