aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core-utils/lumina-config/AppDialog.h
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-02-06 15:45:37 -0500
committerGitHub <noreply@github.com>2017-02-06 15:45:37 -0500
commitd3c4377813f7ccecc7014b4006503fd559be3a1a (patch)
tree458b78871b8eefc4c74657d978da884060b8a055 /src-qt5/core-utils/lumina-config/AppDialog.h
parentMerge pull request #374 from NorwegianRockCat/master (diff)
parentFix memory leak. (diff)
downloadlumina-d3c4377813f7ccecc7014b4006503fd559be3a1a.tar.gz
lumina-d3c4377813f7ccecc7014b4006503fd559be3a1a.tar.bz2
lumina-d3c4377813f7ccecc7014b4006503fd559be3a1a.zip
Merge pull request #375 from antab/app-selection-default
Select current application when changing defaults
Diffstat (limited to 'src-qt5/core-utils/lumina-config/AppDialog.h')
-rw-r--r--src-qt5/core-utils/lumina-config/AppDialog.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src-qt5/core-utils/lumina-config/AppDialog.h b/src-qt5/core-utils/lumina-config/AppDialog.h
index 4eb6471c..2b03fc76 100644
--- a/src-qt5/core-utils/lumina-config/AppDialog.h
+++ b/src-qt5/core-utils/lumina-config/AppDialog.h
@@ -23,18 +23,22 @@ private:
Ui::AppDialog *ui;
public:
- AppDialog(QWidget *parent = 0) : QDialog(parent), ui(new Ui::AppDialog){
+ AppDialog(QWidget *parent = 0, QString defaultPath = "") : QDialog(parent), ui(new Ui::AppDialog){
ui->setupUi(this); //load the designer file
appreset = false;
ui->listApps->clear();
+ QListWidgetItem *defaultItem = nullptr;
QList<XDGDesktop*> APPS = LXDG::sortDesktopNames(APPSLIST->apps(false,false)); //Don't show all/hidden
for(int i=0; i<APPS.length(); i++){
QListWidgetItem *app = new QListWidgetItem(LXDG::findIcon(APPS[i]->icon,"application-x-executable"), APPS[i]->name);
app->setData(Qt::UserRole, APPS[i]->filePath);
ui->listApps->addItem(app);
+ if(APPS[i]->filePath == defaultPath){
+ defaultItem = app;
+ }
}
if(ui->listApps->count()){
- ui->listApps->setCurrentItem(ui->listApps->item(0));
+ ui->listApps->setCurrentItem(defaultItem != nullptr ? defaultItem : ui->listApps->item(0));
}
this->setWindowIcon( LXDG::findIcon("system-search","") );
if(parent!=0){
bgstack15