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
25 #include "progressloggerinterface.h"
27 #include "irivertools/irivertools.h"
31 #include "../ipodpatcher/ipodpatcher.h"
32 #include "../sansapatcher/sansapatcher.h"
35 bool initIpodpatcher();
36 bool initSansapatcher();
38 class BootloaderInstaller
: public QObject
43 BootloaderInstaller(QObject
* parent
);
44 ~BootloaderInstaller() {}
46 void install(ProgressloggerInterface
* dp
);
47 void uninstall(ProgressloggerInterface
* dp
);
49 void setMountPoint(QString mountpoint
) {m_mountpoint
= mountpoint
;}
50 void setProxy(QUrl proxy
) {m_proxy
= proxy
;}
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
104 HttpGet
*infodownloader
;
105 QTemporaryFile bootloaderInfo
;
106 volatile bool infoDownloaded
;
107 volatile bool infoError
;
109 QString m_mountpoint
, m_device
,m_bootloadermethod
,m_bootloadername
;
110 QString m_bootloaderUrlBase
,m_tempfilename
,m_origfirmware
;
112 QString m_bootloaderinfoUrl
;
115 int series
,table_entry
; // for fwpatcher
118 QTemporaryFile downloadFile
;
120 ProgressloggerInterface
* m_dp
;