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"
35 #include "../ipodpatcher/ipodpatcher.h"
36 #include "../sansapatcher/sansapatcher.h"
39 bool initIpodpatcher();
40 bool initSansapatcher();
42 class BootloaderInstaller
: public QObject
47 BootloaderInstaller(QObject
* parent
);
48 ~BootloaderInstaller() {}
50 void install(ProgressloggerInterface
* dp
);
51 void uninstall(ProgressloggerInterface
* dp
);
53 void setMountPoint(QString mountpoint
) {m_mountpoint
= mountpoint
;}
54 void setDevice(QString device
) {m_device
= device
;} //!< the current plattform
55 void setBootloaderMethod(QString method
) {m_bootloadermethod
= method
;}
56 void setBootloaderName(QString name
){m_bootloadername
= name
;}
57 void setBootloaderBaseUrl(QString baseUrl
){m_bootloaderUrlBase
= baseUrl
;}
58 void setOrigFirmwarePath(QString path
) {m_origfirmware
= path
;} //!< for iriver original firmware
59 void setBootloaderInfoUrl(QString url
) {m_bootloaderinfoUrl
=url
; } //!< the url for the info file
60 bool downloadInfo(); //!< should be called before install/uninstall, blocks until downloaded.
61 bool uptodate(); //!< returns wether the bootloader is uptodate
64 void done(bool error
); //installation finished.
66 signals
: // internal signals. Dont use this from out side.
71 void createInstallLog(); // adds the bootloader entry to the log
72 void removeInstallLog(); // removes the bootloader entry from the log
74 void updateDataReadProgress(int, int);
75 void downloadDone(bool);
76 void downloadRequestFinished(int, bool);
77 void infoDownloadDone(bool);
78 void infoRequestFinished(int, bool);
79 void installEnded(bool);
81 // gigabeat specific routines
82 void gigabeatPrepare();
83 void gigabeatFinish();
85 //iaudio specific routines
89 //h10 specific routines
93 //ipod specific routines
97 //sansa specific routines
101 //iriver specific routines
102 void iriverPrepare();
105 //mrobe100 specific routines
106 void mrobe100Prepare();
107 void mrobe100Finish();
111 HttpGet
*infodownloader
;
112 QTemporaryFile bootloaderInfo
;
113 volatile bool infoDownloaded
;
114 volatile bool infoError
;
116 QString m_mountpoint
, m_device
,m_bootloadermethod
,m_bootloadername
;
117 QString m_bootloaderUrlBase
,m_tempfilename
,m_origfirmware
;
118 QString m_bootloaderinfoUrl
;
121 int series
,table_entry
; // for fwpatcher
124 QTemporaryFile downloadFile
;
126 ProgressloggerInterface
* m_dp
;