1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
|
/***************************************************************************
* $Id: update.h,v 1.13 2008/12/08 19:39:02 hoganrobert Exp $
* Copyright (C) 2006 - 2008 Robert Hogan *
* [email protected] *
* *
* 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. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef _UPDATE_H_
#define _UPDATE_H_
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <kapplication.h>
#include <kdirlister.h> //stack allocated
#include <kurl.h> //stack allocated
#include <kresolver.h> // namespace
#include <khtml_part.h>
namespace DOM {
class Node;
}
using namespace KNetwork;
class KURL;
class KProcess;
class KURLRequester;
class KProgressDialog;
class KProcIO;
class KHTMLPart;
/**
* This class serves as the main window for TorkUpdate. It handles the
* menus, toolbars, and status bars.
*
* @short Main window class
* @author $AUTHOR <$EMAIL>
* @version $APP_VERSION
*/
class TorkUpdate : public QWidget
{
Q_OBJECT
public:
TorkUpdate(QWidget *parent, const char *name=0);
/**
* Default Destructor
*/
virtual ~TorkUpdate();
public slots:
void checkForNewTorDirectly(bool alpha);
void checkForNewDanteDirectly();
void checkForNewPrivoxyDirectly();
void checkForNewTorkDirectly();
void downloadThttpd();
void downloadMixminion();
private slots:
void slotProg();
void torkInstallationExited(KProcess *arkollonproc);
void resolved(KResolverResults result);
void parseSFPage();
void parseSFPageHack();
void updateCanceled();
private:
void getLatestVersionFromSF(KURL url);
void getLatestVersionFromSFHack(KURL url);
void downloadComponent(QString component, QString version, QString extension);
void startProgressDialog( const QString & text );
void checkInternet();
void connectToHost();
void checkForNewTork();
void getVersionFromLink( const DOM::Node &n );
void completedSearchForUpdates(const QString &component, const QString &extension);
double numericizeVersion(QString &version);
QString getMirror();
KProcess *childproc;
KProcIO *versionproc;
QString tempFileName;
QString errorMessage;
QString pidFileName;
KProgressDialog *progressDialog;
QTimer *timer;
bool upgradeinprogress;
bool checkingDirectly;
double highestsofarnumeric;
QString highestsofarraw;
QString highestsofarfilename;
KResolver m_resolver;
QString currentTorVersion;
bool m_alpha;
KHTMLPart *filelist;
private:
KDirLister tor_lister;
KURL tor_url;
KDirLister tork_lister;
KURL tork_url;
KURL m_url;
};
#endif // _TorkUpdate_H_
|