047a4a375c0d97a13d4fd835580e1a761797a669
[aspt.git] / configtab.h
1 /*******************************************************************
2 Jan Cermak | johniez | aspt.johniez.com
3 Creative Commons 2.5 Attribution-NonCommercial-NoDerivs 2.5 license
4 http://creativecommons.org/licenses/by-nc-nd/2.5/legalcode
5 *******************************************************************/
6
7 #ifndef CONFIGTAB__H__
8 #define CONFIGTAB__H__
9
10 #include <QWidget>
11 #include <QTabWidget>
12 #include <QVBoxLayout>
13 #include <QHBoxLayout>
14 #include <QGroupBox>
15 #include <QPushButton>
16 #include <QComboBox>
17 #include <QLabel>
18 #include <QLineEdit>
19 #include <QFile>
20 #include <QtNetwork>
21 #include <QMessageBox>
22 //#include <QTextStream>
23
24 #include "proxyset.h"
25
26 extern void parse(const QString &);
27
28 class ConfigTab: public QWidget {
29         Q_OBJECT
30         QVBoxLayout *mainLayout, *group1Layout, *group2Layout;
31         QHBoxLayout *row1, *row2;
32         QFile *file;
33         QHttp *http;
34         QString num;
35         int httpId;
36         QLineEdit *nick, *pass;
37         QPushButton *butDown, *butProxy;
38         int langToSave;
39         QLabel *msgbox;
40         int useProxy;
41         ProxySet *proxyWin;
42         QLabel *warnLabel, *nickLabel, *passLabel;
43         QGroupBox *group1, *group2;
44         QComboBox *lang;
45         QPushButton *setLang;
46         QLabel *langWarn;
47 public:
48         ConfigTab(QWidget *parent = 0);
49         ~ConfigTab();
50 private slots:
51         void httpRequestFinished(int requestId, bool error);
52         void readResponseHeader(const QHttpResponseHeader &responseHeader);
53         void downloadLatest();
54         
55         void changeLang(int langId);
56         void saveSettings();
57         
58         void showMsgBox(const QString &);
59         void openProxy();
60 signals:
61         void dataLoaded();
62         void errMsgBox(const QString &);
63 };
64
65 #endif