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 setProxy(QUrl proxy
) {m_proxy
= proxy
;}
55 void setDevice(QString device
) {m_device
= device
;} //!< the current plattform
56 void setBootloaderMethod(QString method
) {m_bootloadermethod
= method
;}
57 void setBootloaderName(QString name
){m_bootloadername
= name
;}
58 void setBootloaderBaseUrl(QString baseUrl
){m_bootloaderUrlBase
= baseUrl
;}
59 void setOrigFirmwarePath(QString path
) {m_origfirmware
= path
;} //!< for iriver original firmware
60 void setBootloaderInfoUrl(QString url
) {m_bootloaderinfoUrl
=url
; } //!< the url for the info file
61 bool downloadInfo(); //!< should be called before install/uninstall, blocks until downloaded.
62 bool uptodate(); //!< returns wether the bootloader is uptodate
65 void done(bool error
); //installation finished.
67 signals
: // internal signals. Dont use this from out side.
72 void createInstallLog(); // adds the bootloader entry to the log
73 void removeInstallLog(); // removes the bootloader entry from the log
75 void updateDataReadProgress(int, int);
76 void downloadDone(bool);
77 void downloadRequestFinished(int, bool);
78 void infoDownloadDone(bool);
79 void infoRequestFinished(int, bool);
80 void installEnded(bool);
82 // gigabeat specific routines
83 void gigabeatPrepare();
84 void gigabeatFinish();
86 //iaudio specific routines
90 //h10 specific routines
94 //ipod specific routines
98 //sansa specific routines
102 //iriver specific routines
103 void iriverPrepare();
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
;
116 QString m_bootloaderinfoUrl
;
119 int series
,table_entry
; // for fwpatcher
122 QTemporaryFile downloadFile
;
124 ProgressloggerInterface
* m_dp
;