When applying the system proxy values really use the values.
[Rockbox.git] / rbutil / rbutilqt / installbootloader.h
blob69757c5fc8d1e8480a541dfefc4ed4a30f65eaa3
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
9 * Copyright (C) 2007 by Dominik Wenger
10 * $Id$
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
23 #ifndef CONSOLE
24 #include <QtGui>
25 #else
26 #include <QtCore>
27 #endif
29 #include "progressloggerinterface.h"
30 #include "httpget.h"
31 #include "irivertools/irivertools.h"
33 extern "C" {
34 // Ipodpatcher
35 #include "../ipodpatcher/ipodpatcher.h"
36 #include "../sansapatcher/sansapatcher.h"
39 bool initIpodpatcher();
40 bool initSansapatcher();
42 class BootloaderInstaller : public QObject
44 Q_OBJECT
46 public:
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
64 signals:
65 void done(bool error); //installation finished.
67 signals: // internal signals. Dont use this from out side.
68 void prepare();
69 void finish();
71 private slots:
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
87 void iaudioPrepare();
88 void iaudioFinish();
90 //h10 specific routines
91 void h10Prepare();
92 void h10Finish();
94 //ipod specific routines
95 void ipodPrepare();
96 void ipodFinish();
98 //sansa specific routines
99 void sansaPrepare();
100 void sansaFinish();
102 //iriver specific routines
103 void iriverPrepare();
104 void iriverFinish();
106 private:
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;
115 QUrl m_proxy;
116 QString m_bootloaderinfoUrl;
117 bool m_install;
119 int series,table_entry; // for fwpatcher
121 HttpGet *getter;
122 QTemporaryFile downloadFile;
124 ProgressloggerInterface* m_dp;
127 #endif