1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
9 * Copyright (C) 2007 by Dominik Wenger
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
20 #ifndef INSTALLBOOTLOADER_H
21 #define INSTALLBOOTLOADER_H
29 #include "progressloggerinterface.h"
31 #include "irivertools/irivertools.h"
33 #include "../ipodpatcher/ipodpatcher.h"
34 #include "../sansapatcher/sansapatcher.h"
36 bool initIpodpatcher();
37 bool initSansapatcher();
39 class BootloaderInstaller
: public QObject
44 BootloaderInstaller(QObject
* parent
);
45 ~BootloaderInstaller() {}
47 void install(ProgressloggerInterface
* dp
);
48 void uninstall(ProgressloggerInterface
* dp
);
50 void setMountPoint(QString mountpoint
) {m_mountpoint
= mountpoint
;}
51 void setDevice(QString device
) {m_device
= device
;} //!< the current plattform
52 void setBootloaderMethod(QString method
) {m_bootloadermethod
= method
;}
53 void setBootloaderName(QString name
){m_bootloadername
= name
;}
54 void setBootloaderBaseUrl(QString baseUrl
){m_bootloaderUrlBase
= baseUrl
;}
55 void setOrigFirmwarePath(QString path
) {m_origfirmware
= path
;} //!< for iriver original firmware
56 void setBootloaderInfoUrl(QString url
) {m_bootloaderinfoUrl
=url
; } //!< the url for the info file
57 bool downloadInfo(); //!< should be called before install/uninstall, blocks until downloaded.
58 bool uptodate(); //!< returns wether the bootloader is uptodate
61 void done(bool error
); //installation finished.
63 signals
: // internal signals. Dont use this from out side.
68 void createInstallLog(); // adds the bootloader entry to the log
69 void removeInstallLog(); // removes the bootloader entry from the log
71 void updateDataReadProgress(int, int);
72 void downloadDone(bool);
73 void downloadRequestFinished(int, bool);
74 void infoDownloadDone(bool);
75 void infoRequestFinished(int, bool);
76 void installEnded(bool);
78 // gigabeat specific routines
79 void gigabeatPrepare();
80 void gigabeatFinish();
82 //iaudio specific routines
86 //h10 specific routines
90 //ipod specific routines
94 //sansa specific routines
98 //iriver specific routines
102 //mrobe100 specific routines
103 void mrobe100Prepare();
104 void mrobe100Finish();
108 HttpGet
*infodownloader
;
109 QTemporaryFile bootloaderInfo
;
110 volatile bool infoDownloaded
;
111 volatile bool infoError
;
113 QString m_mountpoint
, m_device
,m_bootloadermethod
,m_bootloadername
;
114 QString m_bootloaderUrlBase
,m_tempfilename
,m_origfirmware
;
115 QString m_bootloaderinfoUrl
;
118 int series
,table_entry
; // for fwpatcher
121 QTemporaryFile downloadFile
;
123 ProgressloggerInterface
* m_dp
;