diff options
author | william <william.os4y@gmail.com> | 2015-03-06 21:50:53 +0100 |
---|---|---|
committer | william <william.os4y@gmail.com> | 2015-03-13 20:51:55 +0100 |
commit | 31555d3c36846f14506586ea38ab48b84bc4f5d4 (patch) | |
tree | f0ef62fd4dd8ecad1be4ec0db8e4d57d630742f1 | |
parent | automatically display the correct folder when clicking on Icon button (diff) | |
download | lumina-31555d3c36846f14506586ea38ab48b84bc4f5d4.tar.gz lumina-31555d3c36846f14506586ea38ab48b84bc4f5d4.tar.bz2 lumina-31555d3c36846f14506586ea38ab48b84bc4f5d4.zip |
automatically display correct folder when clicking command button
-rw-r--r-- | desktop-editor/dialog.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/desktop-editor/dialog.cpp b/desktop-editor/dialog.cpp index e3aad0d3..a8d9861d 100644 --- a/desktop-editor/dialog.cpp +++ b/desktop-editor/dialog.cpp @@ -94,10 +94,13 @@ void Dialog::LoadDesktopFile(QString input) void Dialog::on_pbCommand_clicked() { - //TODO: detect Command directory - + QString commandFolder="~"; + if (!ui->lCommand->text().isEmpty()) { + commandFolder = ui->lCommand->text().section('/', 0, -2); + } + QString fileName = QFileDialog::getOpenFileName(this, - tr("Open command"), "~", tr("All Files (*)")); + tr("Open command"), commandFolder, tr("All Files (*)")); ui->lCommand->setText(fileName); } |