summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2012-05-01 10:46:10 +0200
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2012-05-01 10:49:48 +0200
commit9b363c6cedc31f135e831a1b57dcf08578d34ee7 (patch)
treeb44848b9a47d8a46d9b587866e292f97d67e6e97
parent92ef7bd3289a5c4d15bd0de6fb8950af4036891b (diff)
downloadrockbox-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
-rw-r--r--rbutil/rbutilqt/base/systeminfo.cpp1
-rw-r--r--rbutil/rbutilqt/base/systeminfo.h1
-rw-r--r--rbutil/rbutilqt/rbutil.ini19
-rw-r--r--rbutil/rbutilqt/rbutilqt.cpp8
4 files changed, 28 insertions, 1 deletions
diff --git a/rbutil/rbutilqt/base/systeminfo.cpp b/rbutil/rbutilqt/base/systeminfo.cpp
index aaddb3b36f..1f7be72b1e 100644
--- a/rbutil/rbutilqt/base/systeminfo.cpp
+++ b/rbutil/rbutilqt/base/systeminfo.cpp
@@ -54,6 +54,7 @@ const static struct {
54 { SystemInfo::CurBootloaderMethod, ":platform:/bootloadermethod", "none" }, 54 { SystemInfo::CurBootloaderMethod, ":platform:/bootloadermethod", "none" },
55 { SystemInfo::CurBootloaderName, ":platform:/bootloadername", "" }, 55 { SystemInfo::CurBootloaderName, ":platform:/bootloadername", "" },
56 { SystemInfo::CurBootloaderFile, ":platform:/bootloaderfile", "" }, 56 { SystemInfo::CurBootloaderFile, ":platform:/bootloaderfile", "" },
57 { SystemInfo::CurBootloaderFilter, ":platform:/bootloaderfilter", "" },
57 { SystemInfo::CurEncoder, ":platform:/encoder", "" }, 58 { SystemInfo::CurEncoder, ":platform:/encoder", "" },
58 { SystemInfo::CurBrand, ":platform:/brand", "" }, 59 { SystemInfo::CurBrand, ":platform:/brand", "" },
59 { SystemInfo::CurName, ":platform:/name", "" }, 60 { SystemInfo::CurName, ":platform:/name", "" },
diff --git a/rbutil/rbutilqt/base/systeminfo.h b/rbutil/rbutilqt/base/systeminfo.h
index 77388fcd16..f8c31a9de3 100644
--- a/rbutil/rbutilqt/base/systeminfo.h
+++ b/rbutil/rbutilqt/base/systeminfo.h
@@ -58,6 +58,7 @@ class SystemInfo : public QObject
58 CurBootloaderMethod, 58 CurBootloaderMethod,
59 CurBootloaderName, 59 CurBootloaderName,
60 CurBootloaderFile, 60 CurBootloaderFile,
61 CurBootloaderFilter,
61 CurEncoder, 62 CurEncoder,
62 CurBrand, 63 CurBrand,
63 CurName, 64 CurName,
diff --git a/rbutil/rbutilqt/rbutil.ini b/rbutil/rbutilqt/rbutil.ini
index e23783a413..c740d35411 100644
--- a/rbutil/rbutilqt/rbutil.ini
+++ b/rbutil/rbutilqt/rbutil.ini
@@ -196,6 +196,7 @@ buildserver_modelname=iriverh100
196bootloadermethod=hex 196bootloadermethod=hex
197bootloadername=/iriver/bootloader-h100.bin 197bootloadername=/iriver/bootloader-h100.bin
198bootloaderfile=/ihp_100.hex 198bootloaderfile=/ihp_100.hex
199bootloaderfilter=*.hex *.zip
199manualname=iriverh100 200manualname=iriverh100
200brand=Iriver 201brand=Iriver
201usbid=0x10063001 202usbid=0x10063001
@@ -208,6 +209,7 @@ buildserver_modelname=iriverh120
208bootloadermethod=hex 209bootloadermethod=hex
209bootloadername=/iriver/bootloader-h120.bin 210bootloadername=/iriver/bootloader-h120.bin
210bootloaderfile=/ihp_120.hex 211bootloaderfile=/ihp_120.hex
212bootloaderfilter=*.hex *.zip
211manualname=iriverh100 213manualname=iriverh100
212brand=Iriver 214brand=Iriver
213usbid=0x10063002 215usbid=0x10063002
@@ -220,6 +222,7 @@ buildserver_modelname=iriverh300
220bootloadermethod=hex 222bootloadermethod=hex
221bootloadername=/iriver/bootloader-h300.bin 223bootloadername=/iriver/bootloader-h300.bin
222bootloaderfile=/H300.hex 224bootloaderfile=/H300.hex
225bootloaderfilter=*.hex *.zip
223manualname=iriverh300 226manualname=iriverh300
224brand=Iriver 227brand=Iriver
225usbid=0x10063003 228usbid=0x10063003
@@ -452,6 +455,7 @@ buildserver_modelname=sansae200v2
452bootloadermethod=ams 455bootloadermethod=ams
453bootloadername=/sandisk-sansa/e200v2/bootloader-e200v2.sansa 456bootloadername=/sandisk-sansa/e200v2/bootloader-e200v2.sansa
454bootloaderfile=/e200pa.bin,/e200pe.bin,/e200pf.bin 457bootloaderfile=/e200pa.bin,/e200pe.bin,/e200pf.bin
458bootloaderfilter=*.bin *.zip
455manualname= 459manualname=
456brand=Sandisk 460brand=Sandisk
457usbid=0x07817423 461usbid=0x07817423
@@ -465,6 +469,7 @@ buildserver_modelname=sansac200v2
465bootloadermethod=ams 469bootloadermethod=ams
466bootloadername=/sandisk-sansa/c200v2/bootloader-c200v2.sansa 470bootloadername=/sandisk-sansa/c200v2/bootloader-c200v2.sansa
467bootloaderfile=/c200pa.bin 471bootloaderfile=/c200pa.bin
472bootloaderfilter=*.bin *.zip
468manualname= 473manualname=
469brand=Sandisk 474brand=Sandisk
470usbid=0x07817452 475usbid=0x07817452
@@ -478,6 +483,7 @@ buildserver_modelname=sansafuze
478bootloadermethod=ams 483bootloadermethod=ams
479bootloadername=/sandisk-sansa/fuze/bootloader-fuze.sansa 484bootloadername=/sandisk-sansa/fuze/bootloader-fuze.sansa
480bootloaderfile=/fuzea.bin 485bootloaderfile=/fuzea.bin
486bootloaderfilter=*.bin *.zip
481manualname= 487manualname=
482brand=Sandisk 488brand=Sandisk
483usbid=0x078174c1 489usbid=0x078174c1
@@ -491,6 +497,7 @@ buildserver_modelname=sansafuzev2
491bootloadermethod=ams 497bootloadermethod=ams
492bootloadername=/sandisk-sansa/fuzev2/bootloader-fuzev2.sansa 498bootloadername=/sandisk-sansa/fuzev2/bootloader-fuzev2.sansa
493bootloaderfile=/fuzpa.bin 499bootloaderfile=/fuzpa.bin
500bootloaderfilter=*.bin *.zip
494manualname= 501manualname=
495brand=Sandisk 502brand=Sandisk
496usbid=0x078174c3 503usbid=0x078174c3
@@ -504,6 +511,7 @@ buildserver_modelname=sansafuzeplus
504bootloadermethod=imx 511bootloadermethod=imx
505bootloadername=/sandisk-sansa/fuzeplus/bootloader-fuzeplus.sansa 512bootloadername=/sandisk-sansa/fuzeplus/bootloader-fuzeplus.sansa
506bootloaderfile=/firmware.sb 513bootloaderfile=/firmware.sb
514bootloaderfilter=*.sb *.zip
507manualname= 515manualname=
508brand=Sandisk 516brand=Sandisk
509usbid=0x078174e1 517usbid=0x078174e1
@@ -517,6 +525,7 @@ buildserver_modelname=sansam200v4
517bootloadermethod=ams 525bootloadermethod=ams
518bootloadername=/sandisk-sansa/m200v4/bootloader-m200v4.sansa 526bootloadername=/sandisk-sansa/m200v4/bootloader-m200v4.sansa
519bootloaderfile=/m200a.bin 527bootloaderfile=/m200a.bin
528bootloaderfilter=*.bin *.zip
520manualname= 529manualname=
521brand=Sandisk 530brand=Sandisk
522usbid= 531usbid=
@@ -531,6 +540,7 @@ buildserver_modelname=sansaclip
531bootloadermethod=ams 540bootloadermethod=ams
532bootloadername=/sandisk-sansa/clip/bootloader-clip.sansa 541bootloadername=/sandisk-sansa/clip/bootloader-clip.sansa
533bootloaderfile=/m300a.bin 542bootloaderfile=/m300a.bin
543bootloaderfilter=*.bin *.zip
534manualname= 544manualname=
535brand=Sandisk 545brand=Sandisk
536usbid=0x07817433 546usbid=0x07817433
@@ -544,6 +554,7 @@ buildserver_modelname=sansaclipv2
544bootloadermethod=ams 554bootloadermethod=ams
545bootloadername=/sandisk-sansa/clipv2/bootloader-clipv2.sansa 555bootloadername=/sandisk-sansa/clipv2/bootloader-clipv2.sansa
546bootloaderfile=/m30pa.bin 556bootloaderfile=/m30pa.bin
557bootloaderfilter=*.bin *.zip
547manualname= 558manualname=
548brand=Sandisk 559brand=Sandisk
549usbid=0x07817435 560usbid=0x07817435
@@ -557,6 +568,7 @@ buildserver_modelname=sansaclipplus
557bootloadermethod=ams 568bootloadermethod=ams
558bootloadername=/sandisk-sansa/clipplus/bootloader-clipplus.sansa 569bootloadername=/sandisk-sansa/clipplus/bootloader-clipplus.sansa
559bootloaderfile=/clppa.bin 570bootloaderfile=/clppa.bin
571bootloaderfilter=*.bin *.zip
560manualname= 572manualname=
561brand=Sandisk 573brand=Sandisk
562usbid=0x078174d1 574usbid=0x078174d1
@@ -570,6 +582,7 @@ buildserver_modelname=sansaclipzip
570bootloadermethod=ams 582bootloadermethod=ams
571bootloadername=/sandisk-sansa/clipzip/bootloader-clipzip.sansa 583bootloadername=/sandisk-sansa/clipzip/bootloader-clipzip.sansa
572bootloaderfile=/clpza.bin 584bootloaderfile=/clpza.bin
585bootloaderfilter=*.bin *.zip
573manualname= 586manualname=
574brand=Sandisk 587brand=Sandisk
575usbid=0x078174e5 588usbid=0x078174e5
@@ -595,6 +608,7 @@ buildserver_modelname=ondavx747
595bootloadermethod=chinachip 608bootloadermethod=chinachip
596bootloadername=/onda/vx747/ccpmp.bin 609bootloadername=/onda/vx747/ccpmp.bin
597bootloaderfile=/SG301.HXF 610bootloaderfile=/SG301.HXF
611bootloaderfilter=*.hxf *.zip
598manualname= 612manualname=
599brand=Onda 613brand=Onda
600usbid=0x07c4a4a5 614usbid=0x07c4a4a5
@@ -608,6 +622,7 @@ buildserver_modelname=ondavx747p
608bootloadermethod=chinachip 622bootloadermethod=chinachip
609bootloadername=/onda/vx747p/ccpmp.bin 623bootloadername=/onda/vx747p/ccpmp.bin
610bootloaderfile=/SG301.HXF 624bootloaderfile=/SG301.HXF
625bootloaderfilter=*.hxf *.zip
611manualname= 626manualname=
612brand=Onda 627brand=Onda
613usbid=0x07c4a4a5 628usbid=0x07c4a4a5
@@ -621,6 +636,7 @@ buildserver_modelname=ondavx777
621bootloadermethod=chinachip 636bootloadermethod=chinachip
622bootloadername=/onda/vx777/ccpmp.bin 637bootloadername=/onda/vx777/ccpmp.bin
623bootloaderfile=/VX777.HXF 638bootloaderfile=/VX777.HXF
639bootloaderfilter=*.hxf *.zip
624manualname= 640manualname=
625brand=Onda 641brand=Onda
626usbid=0x07c4a4a5 642usbid=0x07c4a4a5
@@ -670,6 +686,7 @@ buildserver_modelname=cowond2
670bootloadermethod=tcc 686bootloadermethod=tcc
671bootloadername=/cowon/d2/bootloader-cowond2.bin 687bootloadername=/cowon/d2/bootloader-cowond2.bin
672bootloaderfile=/ 688bootloaderfile=/
689bootloaderfilter=*.bin *.zip
673manualname= 690manualname=
674brand=Cowon 691brand=Cowon
675usbid=0x0e210800, 0x0e210860, 0x0e210870, 0x0e210880, 0x0e210890 692usbid=0x0e210800, 0x0e210860, 0x0e210870, 0x0e210880, 0x0e210890
@@ -697,6 +714,7 @@ buildserver_modelname=mpiohd200
697bootloadermethod=mpio 714bootloadermethod=mpio
698bootloadername=/mpiohd200/bootloader.mpio 715bootloadername=/mpiohd200/bootloader.mpio
699bootloaderfile=/SYSTEM/HD200_UPG.SYS 716bootloaderfile=/SYSTEM/HD200_UPG.SYS
717bootloaderfilter=*.bin *.zip
700manualname= 718manualname=
701brand=MPIO 719brand=MPIO
702usbid=0x27351004 720usbid=0x27351004
@@ -709,6 +727,7 @@ buildserver_modelname=mpiohd300
709bootloadermethod=mpio 727bootloadermethod=mpio
710bootloadername=/mpiohd300/bootloader.mpio 728bootloadername=/mpiohd300/bootloader.mpio
711bootloaderfile=/SYSTEM/HD300_UPG.SYS 729bootloaderfile=/SYSTEM/HD300_UPG.SYS
730bootloaderfilter=*.bin *.zip
712manualname= 731manualname=
713brand=MPIO 732brand=MPIO
714usbid=0x27351005 733usbid=0x27351005
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();