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
|
|
|
*
|
2008-06-28 18:10:04 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2007-07-27 22:46:49 +00:00
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
2007-09-15 22:57:07 +00:00
|
|
|
|
2007-07-27 22:46:49 +00:00
|
|
|
#ifndef INSTALLBOOTLOADER_H
|
|
|
|
#define INSTALLBOOTLOADER_H
|
|
|
|
|
2008-02-10 18:25:49 +00:00
|
|
|
#ifndef CONSOLE
|
2007-07-27 22:46:49 +00:00
|
|
|
#include <QtGui>
|
2008-02-10 18:25:49 +00:00
|
|
|
#else
|
|
|
|
#include <QtCore>
|
|
|
|
#endif
|
2007-07-27 22:46:49 +00:00
|
|
|
|
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
|
|
|
|
2008-05-22 17:51:35 +00:00
|
|
|
#include "../ipodpatcher/ipodpatcher.h"
|
|
|
|
#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
|
2007-09-15 22:57:07 +00:00
|
|
|
|
2007-07-27 22:46:49 +00:00
|
|
|
public:
|
|
|
|
BootloaderInstaller(QObject* parent);
|
|
|
|
~BootloaderInstaller() {}
|
|
|
|
|
2007-07-29 18:07:31 +00:00
|
|
|
void install(ProgressloggerInterface* dp);
|
|
|
|
void uninstall(ProgressloggerInterface* dp);
|
2007-09-15 22:57:07 +00:00
|
|
|
|
2007-07-27 22:46:49 +00:00
|
|
|
void setMountPoint(QString mountpoint) {m_mountpoint = mountpoint;}
|
2007-08-26 16:44:23 +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-08-26 16:44:23 +00:00
|
|
|
void setOrigFirmwarePath(QString path) {m_origfirmware = path;} //!< for iriver original firmware
|
|
|
|
void setBootloaderInfoUrl(QString url) {m_bootloaderinfoUrl =url; } //!< the url for the info file
|
|
|
|
bool downloadInfo(); //!< should be called before install/uninstall, blocks until downloaded.
|
|
|
|
bool uptodate(); //!< returns wether the bootloader is uptodate
|
2007-09-15 22:57:07 +00:00
|
|
|
|
2007-07-27 22:46:49 +00:00
|
|
|
signals:
|
|
|
|
void done(bool error); //installation finished.
|
2007-09-15 22:57:07 +00:00
|
|
|
|
2007-08-26 16:44:23 +00:00
|
|
|
signals: // internal signals. Dont use this from out side.
|
2007-07-27 22:46:49 +00:00
|
|
|
void prepare();
|
2007-09-15 22:57:07 +00:00
|
|
|
void finish();
|
|
|
|
|
2007-07-27 22:46:49 +00:00
|
|
|
private slots:
|
2007-08-26 16:44:23 +00:00
|
|
|
void createInstallLog(); // adds the bootloader entry to the log
|
|
|
|
void removeInstallLog(); // removes the bootloader entry from the log
|
|
|
|
|
2007-07-27 22:46:49 +00:00
|
|
|
void downloadDone(bool);
|
|
|
|
void downloadRequestFinished(int, bool);
|
2007-08-26 16:44:23 +00:00
|
|
|
void infoDownloadDone(bool);
|
|
|
|
void infoRequestFinished(int, bool);
|
2007-08-01 22:21:57 +00:00
|
|
|
void installEnded(bool);
|
2007-09-15 22:57:07 +00:00
|
|
|
|
2007-07-27 22:46:49 +00:00
|
|
|
// gigabeat specific routines
|
|
|
|
void gigabeatPrepare();
|
|
|
|
void gigabeatFinish();
|
2007-09-15 22:57:07 +00:00
|
|
|
|
2007-07-27 22:46:49 +00:00
|
|
|
//iaudio specific routines
|
|
|
|
void iaudioPrepare();
|
|
|
|
void iaudioFinish();
|
2007-09-15 22:57:07 +00:00
|
|
|
|
2007-07-27 22:46:49 +00:00
|
|
|
//h10 specific routines
|
|
|
|
void h10Prepare();
|
|
|
|
void h10Finish();
|
2007-09-15 22:57:07 +00:00
|
|
|
|
2007-07-27 22:46:49 +00:00
|
|
|
//ipod specific routines
|
|
|
|
void ipodPrepare();
|
|
|
|
void ipodFinish();
|
2007-09-15 22:57:07 +00:00
|
|
|
|
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();
|
2008-03-02 12:24:01 +00:00
|
|
|
|
|
|
|
//mrobe100 specific routines
|
|
|
|
void mrobe100Prepare();
|
|
|
|
void mrobe100Finish();
|
2007-09-15 22:57:07 +00:00
|
|
|
|
2007-07-27 22:46:49 +00:00
|
|
|
private:
|
2007-09-15 22:57:07 +00:00
|
|
|
|
2007-08-26 16:44:23 +00:00
|
|
|
HttpGet *infodownloader;
|
|
|
|
QTemporaryFile bootloaderInfo;
|
|
|
|
volatile bool infoDownloaded;
|
|
|
|
volatile bool infoError;
|
2007-09-15 22:57:07 +00:00
|
|
|
|
2007-07-27 22:46:49 +00:00
|
|
|
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-08-26 16:44:23 +00:00
|
|
|
QString m_bootloaderinfoUrl;
|
2007-07-27 22:46:49 +00:00
|
|
|
bool m_install;
|
2007-09-15 22:57:07 +00:00
|
|
|
|
2007-07-28 14:38:25 +00:00
|
|
|
int series,table_entry; // for fwpatcher
|
2007-09-15 22:57:07 +00:00
|
|
|
|
2007-07-27 22:46:49 +00:00
|
|
|
HttpGet *getter;
|
|
|
|
QTemporaryFile downloadFile;
|
2007-09-15 22:57:07 +00:00
|
|
|
|
2007-07-29 18:07:31 +00:00
|
|
|
ProgressloggerInterface* m_dp;
|
2007-07-27 22:46:49 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
#endif
|