2007-07-27 22:46:49 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* __________ __ ___.
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
* \/ \/ \/ \/ \/
|
|
|
|
*
|
|
|
|
* Copyright (C) 2007 by Dominik Wenger
|
2007-08-23 22:11:50 +00:00
|
|
|
* $Id$
|
2007-07-27 22:46:49 +00:00
|
|
|
*
|
|
|
|
* All files in this archive are subject to the GNU General Public License.
|
|
|
|
* See the file COPYING in the source tree root for full license agreement.
|
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef INSTALLBOOTLOADER_H
|
|
|
|
#define INSTALLBOOTLOADER_H
|
|
|
|
|
|
|
|
#include <QtGui>
|
|
|
|
|
2007-07-29 18:07:31 +00:00
|
|
|
#include "progressloggerinterface.h"
|
2007-07-27 22:46:49 +00:00
|
|
|
#include "httpget.h"
|
2007-07-28 14:38:25 +00:00
|
|
|
#include "irivertools/irivertools.h"
|
2007-07-27 22:46:49 +00:00
|
|
|
|
|
|
|
extern "C" {
|
|
|
|
// Ipodpatcher
|
|
|
|
#include "../ipodpatcher/ipodpatcher.h"
|
2007-07-28 11:32:32 +00:00
|
|
|
#include "../sansapatcher/sansapatcher.h"
|
2007-07-27 22:46:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
bool initIpodpatcher();
|
2007-07-28 11:32:32 +00:00
|
|
|
bool initSansapatcher();
|
2007-07-27 22:46:49 +00:00
|
|
|
|
|
|
|
class BootloaderInstaller : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
BootloaderInstaller(QObject* parent);
|
|
|
|
~BootloaderInstaller() {}
|
|
|
|
|
2007-07-29 18:07:31 +00:00
|
|
|
void install(ProgressloggerInterface* dp);
|
|
|
|
void uninstall(ProgressloggerInterface* dp);
|
2007-07-27 22:46:49 +00:00
|
|
|
|
|
|
|
void setMountPoint(QString mountpoint) {m_mountpoint = mountpoint;}
|
|
|
|
void setProxy(QUrl proxy) {m_proxy= proxy;}
|
2007-07-28 14:38:25 +00:00
|
|
|
void setDevice(QString device) {m_device= device;} // the current plattform
|
2007-07-27 22:46:49 +00:00
|
|
|
void setBootloaderMethod(QString method) {m_bootloadermethod= method;}
|
|
|
|
void setBootloaderName(QString name){m_bootloadername= name;}
|
|
|
|
void setBootloaderBaseUrl(QString baseUrl){m_bootloaderUrlBase = baseUrl;}
|
2007-07-28 14:38:25 +00:00
|
|
|
void setOrigFirmwarePath(QString path) {m_origfirmware = path;} //for iriver original firmware
|
2007-07-27 22:46:49 +00:00
|
|
|
|
|
|
|
signals:
|
|
|
|
void done(bool error); //installation finished.
|
|
|
|
|
|
|
|
// internal signals. Dont use this from out side.
|
|
|
|
void prepare();
|
|
|
|
void finish();
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void updateDataReadProgress(int, int);
|
|
|
|
void downloadDone(bool);
|
|
|
|
void downloadRequestFinished(int, bool);
|
2007-08-01 22:21:57 +00:00
|
|
|
void installEnded(bool);
|
2007-07-27 22:46:49 +00:00
|
|
|
|
|
|
|
// gigabeat specific routines
|
|
|
|
void gigabeatPrepare();
|
|
|
|
void gigabeatFinish();
|
|
|
|
|
|
|
|
//iaudio specific routines
|
|
|
|
void iaudioPrepare();
|
|
|
|
void iaudioFinish();
|
|
|
|
|
|
|
|
//h10 specific routines
|
|
|
|
void h10Prepare();
|
|
|
|
void h10Finish();
|
|
|
|
|
|
|
|
//ipod specific routines
|
|
|
|
void ipodPrepare();
|
|
|
|
void ipodFinish();
|
|
|
|
|
2007-07-28 11:32:32 +00:00
|
|
|
//sansa specific routines
|
|
|
|
void sansaPrepare();
|
|
|
|
void sansaFinish();
|
2007-07-28 14:38:25 +00:00
|
|
|
|
|
|
|
//iriver specific routines
|
|
|
|
void iriverPrepare();
|
|
|
|
void iriverFinish();
|
2007-07-28 11:32:32 +00:00
|
|
|
|
2007-07-27 22:46:49 +00:00
|
|
|
private:
|
|
|
|
QString m_mountpoint, m_device,m_bootloadermethod,m_bootloadername;
|
2007-07-28 14:38:25 +00:00
|
|
|
QString m_bootloaderUrlBase,m_tempfilename,m_origfirmware;
|
2007-07-27 22:46:49 +00:00
|
|
|
QUrl m_proxy;
|
|
|
|
bool m_install;
|
|
|
|
|
2007-07-28 14:38:25 +00:00
|
|
|
int series,table_entry; // for fwpatcher
|
2007-07-27 22:46:49 +00:00
|
|
|
|
|
|
|
HttpGet *getter;
|
|
|
|
QTemporaryFile downloadFile;
|
|
|
|
|
2007-07-29 18:07:31 +00:00
|
|
|
ProgressloggerInterface* m_dp;
|
2007-07-27 22:46:49 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
#endif
|