forked from len0rd/rockbox
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
This commit is contained in:
parent
92ef7bd328
commit
9b363c6ced
4 changed files with 28 additions and 1 deletions
|
|
@ -54,6 +54,7 @@ const static struct {
|
|||
{ SystemInfo::CurBootloaderMethod, ":platform:/bootloadermethod", "none" },
|
||||
{ SystemInfo::CurBootloaderName, ":platform:/bootloadername", "" },
|
||||
{ SystemInfo::CurBootloaderFile, ":platform:/bootloaderfile", "" },
|
||||
{ SystemInfo::CurBootloaderFilter, ":platform:/bootloaderfilter", "" },
|
||||
{ SystemInfo::CurEncoder, ":platform:/encoder", "" },
|
||||
{ SystemInfo::CurBrand, ":platform:/brand", "" },
|
||||
{ SystemInfo::CurName, ":platform:/name", "" },
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@ class SystemInfo : public QObject
|
|||
CurBootloaderMethod,
|
||||
CurBootloaderName,
|
||||
CurBootloaderFile,
|
||||
CurBootloaderFilter,
|
||||
CurEncoder,
|
||||
CurBrand,
|
||||
CurName,
|
||||
|
|
|
|||
|
|
@ -196,6 +196,7 @@ buildserver_modelname=iriverh100
|
|||
bootloadermethod=hex
|
||||
bootloadername=/iriver/bootloader-h100.bin
|
||||
bootloaderfile=/ihp_100.hex
|
||||
bootloaderfilter=*.hex *.zip
|
||||
manualname=iriverh100
|
||||
brand=Iriver
|
||||
usbid=0x10063001
|
||||
|
|
@ -208,6 +209,7 @@ buildserver_modelname=iriverh120
|
|||
bootloadermethod=hex
|
||||
bootloadername=/iriver/bootloader-h120.bin
|
||||
bootloaderfile=/ihp_120.hex
|
||||
bootloaderfilter=*.hex *.zip
|
||||
manualname=iriverh100
|
||||
brand=Iriver
|
||||
usbid=0x10063002
|
||||
|
|
@ -220,6 +222,7 @@ buildserver_modelname=iriverh300
|
|||
bootloadermethod=hex
|
||||
bootloadername=/iriver/bootloader-h300.bin
|
||||
bootloaderfile=/H300.hex
|
||||
bootloaderfilter=*.hex *.zip
|
||||
manualname=iriverh300
|
||||
brand=Iriver
|
||||
usbid=0x10063003
|
||||
|
|
@ -452,6 +455,7 @@ buildserver_modelname=sansae200v2
|
|||
bootloadermethod=ams
|
||||
bootloadername=/sandisk-sansa/e200v2/bootloader-e200v2.sansa
|
||||
bootloaderfile=/e200pa.bin,/e200pe.bin,/e200pf.bin
|
||||
bootloaderfilter=*.bin *.zip
|
||||
manualname=
|
||||
brand=Sandisk
|
||||
usbid=0x07817423
|
||||
|
|
@ -465,6 +469,7 @@ buildserver_modelname=sansac200v2
|
|||
bootloadermethod=ams
|
||||
bootloadername=/sandisk-sansa/c200v2/bootloader-c200v2.sansa
|
||||
bootloaderfile=/c200pa.bin
|
||||
bootloaderfilter=*.bin *.zip
|
||||
manualname=
|
||||
brand=Sandisk
|
||||
usbid=0x07817452
|
||||
|
|
@ -478,6 +483,7 @@ buildserver_modelname=sansafuze
|
|||
bootloadermethod=ams
|
||||
bootloadername=/sandisk-sansa/fuze/bootloader-fuze.sansa
|
||||
bootloaderfile=/fuzea.bin
|
||||
bootloaderfilter=*.bin *.zip
|
||||
manualname=
|
||||
brand=Sandisk
|
||||
usbid=0x078174c1
|
||||
|
|
@ -491,6 +497,7 @@ buildserver_modelname=sansafuzev2
|
|||
bootloadermethod=ams
|
||||
bootloadername=/sandisk-sansa/fuzev2/bootloader-fuzev2.sansa
|
||||
bootloaderfile=/fuzpa.bin
|
||||
bootloaderfilter=*.bin *.zip
|
||||
manualname=
|
||||
brand=Sandisk
|
||||
usbid=0x078174c3
|
||||
|
|
@ -504,6 +511,7 @@ buildserver_modelname=sansafuzeplus
|
|||
bootloadermethod=imx
|
||||
bootloadername=/sandisk-sansa/fuzeplus/bootloader-fuzeplus.sansa
|
||||
bootloaderfile=/firmware.sb
|
||||
bootloaderfilter=*.sb *.zip
|
||||
manualname=
|
||||
brand=Sandisk
|
||||
usbid=0x078174e1
|
||||
|
|
@ -517,6 +525,7 @@ buildserver_modelname=sansam200v4
|
|||
bootloadermethod=ams
|
||||
bootloadername=/sandisk-sansa/m200v4/bootloader-m200v4.sansa
|
||||
bootloaderfile=/m200a.bin
|
||||
bootloaderfilter=*.bin *.zip
|
||||
manualname=
|
||||
brand=Sandisk
|
||||
usbid=
|
||||
|
|
@ -531,6 +540,7 @@ buildserver_modelname=sansaclip
|
|||
bootloadermethod=ams
|
||||
bootloadername=/sandisk-sansa/clip/bootloader-clip.sansa
|
||||
bootloaderfile=/m300a.bin
|
||||
bootloaderfilter=*.bin *.zip
|
||||
manualname=
|
||||
brand=Sandisk
|
||||
usbid=0x07817433
|
||||
|
|
@ -544,6 +554,7 @@ buildserver_modelname=sansaclipv2
|
|||
bootloadermethod=ams
|
||||
bootloadername=/sandisk-sansa/clipv2/bootloader-clipv2.sansa
|
||||
bootloaderfile=/m30pa.bin
|
||||
bootloaderfilter=*.bin *.zip
|
||||
manualname=
|
||||
brand=Sandisk
|
||||
usbid=0x07817435
|
||||
|
|
@ -557,6 +568,7 @@ buildserver_modelname=sansaclipplus
|
|||
bootloadermethod=ams
|
||||
bootloadername=/sandisk-sansa/clipplus/bootloader-clipplus.sansa
|
||||
bootloaderfile=/clppa.bin
|
||||
bootloaderfilter=*.bin *.zip
|
||||
manualname=
|
||||
brand=Sandisk
|
||||
usbid=0x078174d1
|
||||
|
|
@ -570,6 +582,7 @@ buildserver_modelname=sansaclipzip
|
|||
bootloadermethod=ams
|
||||
bootloadername=/sandisk-sansa/clipzip/bootloader-clipzip.sansa
|
||||
bootloaderfile=/clpza.bin
|
||||
bootloaderfilter=*.bin *.zip
|
||||
manualname=
|
||||
brand=Sandisk
|
||||
usbid=0x078174e5
|
||||
|
|
@ -595,6 +608,7 @@ buildserver_modelname=ondavx747
|
|||
bootloadermethod=chinachip
|
||||
bootloadername=/onda/vx747/ccpmp.bin
|
||||
bootloaderfile=/SG301.HXF
|
||||
bootloaderfilter=*.hxf *.zip
|
||||
manualname=
|
||||
brand=Onda
|
||||
usbid=0x07c4a4a5
|
||||
|
|
@ -608,6 +622,7 @@ buildserver_modelname=ondavx747p
|
|||
bootloadermethod=chinachip
|
||||
bootloadername=/onda/vx747p/ccpmp.bin
|
||||
bootloaderfile=/SG301.HXF
|
||||
bootloaderfilter=*.hxf *.zip
|
||||
manualname=
|
||||
brand=Onda
|
||||
usbid=0x07c4a4a5
|
||||
|
|
@ -621,6 +636,7 @@ buildserver_modelname=ondavx777
|
|||
bootloadermethod=chinachip
|
||||
bootloadername=/onda/vx777/ccpmp.bin
|
||||
bootloaderfile=/VX777.HXF
|
||||
bootloaderfilter=*.hxf *.zip
|
||||
manualname=
|
||||
brand=Onda
|
||||
usbid=0x07c4a4a5
|
||||
|
|
@ -670,6 +686,7 @@ buildserver_modelname=cowond2
|
|||
bootloadermethod=tcc
|
||||
bootloadername=/cowon/d2/bootloader-cowond2.bin
|
||||
bootloaderfile=/
|
||||
bootloaderfilter=*.bin *.zip
|
||||
manualname=
|
||||
brand=Cowon
|
||||
usbid=0x0e210800, 0x0e210860, 0x0e210870, 0x0e210880, 0x0e210890
|
||||
|
|
@ -697,6 +714,7 @@ buildserver_modelname=mpiohd200
|
|||
bootloadermethod=mpio
|
||||
bootloadername=/mpiohd200/bootloader.mpio
|
||||
bootloaderfile=/SYSTEM/HD200_UPG.SYS
|
||||
bootloaderfilter=*.bin *.zip
|
||||
manualname=
|
||||
brand=MPIO
|
||||
usbid=0x27351004
|
||||
|
|
@ -709,6 +727,7 @@ buildserver_modelname=mpiohd300
|
|||
bootloadermethod=mpio
|
||||
bootloadername=/mpiohd300/bootloader.mpio
|
||||
bootloaderfile=/SYSTEM/HD300_UPG.SYS
|
||||
bootloaderfilter=*.bin *.zip
|
||||
manualname=
|
||||
brand=MPIO
|
||||
usbid=0x27351005
|
||||
|
|
|
|||
|
|
@ -760,8 +760,14 @@ void RbUtilQt::installBootloader()
|
|||
}
|
||||
// open dialog to browse to of file
|
||||
QString offile;
|
||||
QString filter
|
||||
= SystemInfo::value(SystemInfo::CurBootloaderFilter).toString();
|
||||
if(!filter.isEmpty()) {
|
||||
filter = tr("Bootloader files (%1)").arg(filter) + ";;";
|
||||
}
|
||||
filter += tr("All files (*)");
|
||||
offile = QFileDialog::getOpenFileName(this,
|
||||
tr("Select firmware file"), QDir::homePath());
|
||||
tr("Select firmware file"), QDir::homePath(), filter);
|
||||
if(!QFileInfo(offile).isReadable()) {
|
||||
logger->addItem(tr("Error opening firmware file"), LOGERROR);
|
||||
logger->setFinished();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue