diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2012-05-01 10:46:10 +0200 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2012-05-01 10:49:48 +0200 |
commit | 9b363c6cedc31f135e831a1b57dcf08578d34ee7 (patch) | |
tree | b44848b9a47d8a46d9b587866e292f97d67e6e97 /rbutil/rbutilqt/rbutilqt.cpp | |
parent | 92ef7bd3289a5c4d15bd0de6fb8950af4036891b (diff) | |
download | rockbox-9b363c6cedc31f135e831a1b57dcf08578d34ee7.tar.gz rockbox-9b363c6cedc31f135e831a1b57dcf08578d34ee7.zip |
Bootloader installation: set file filter.
When requesting an original firmware file from the user set the filter for the
file chooser dialog to only show files with matching file extension to simplify
selection. Allow the user to select "all files" in case the file for whatever
reason has the wrong extension.
Change-Id: Ic3643c3601f6d849e6563f8753ae80a168ec0a45
Diffstat (limited to 'rbutil/rbutilqt/rbutilqt.cpp')
-rw-r--r-- | rbutil/rbutilqt/rbutilqt.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/rbutil/rbutilqt/rbutilqt.cpp b/rbutil/rbutilqt/rbutilqt.cpp index 683f17c0af..5c496585ec 100644 --- a/rbutil/rbutilqt/rbutilqt.cpp +++ b/rbutil/rbutilqt/rbutilqt.cpp | |||
@@ -760,8 +760,14 @@ void RbUtilQt::installBootloader() | |||
760 | } | 760 | } |
761 | // open dialog to browse to of file | 761 | // open dialog to browse to of file |
762 | QString offile; | 762 | QString offile; |
763 | QString filter | ||
764 | = SystemInfo::value(SystemInfo::CurBootloaderFilter).toString(); | ||
765 | if(!filter.isEmpty()) { | ||
766 | filter = tr("Bootloader files (%1)").arg(filter) + ";;"; | ||
767 | } | ||
768 | filter += tr("All files (*)"); | ||
763 | offile = QFileDialog::getOpenFileName(this, | 769 | offile = QFileDialog::getOpenFileName(this, |
764 | tr("Select firmware file"), QDir::homePath()); | 770 | tr("Select firmware file"), QDir::homePath(), filter); |
765 | if(!QFileInfo(offile).isReadable()) { | 771 | if(!QFileInfo(offile).isReadable()) { |
766 | logger->addItem(tr("Error opening firmware file"), LOGERROR); | 772 | logger->addItem(tr("Error opening firmware file"), LOGERROR); |
767 | logger->setFinished(); | 773 | logger->setFinished(); |