Set parent for supported hosts dialog.
[abby.git] / src / mainwnd.h
blobc4606230cdb029f7b2aa21e064d9420ee1525583
1 /*
2 * abby Copyright (C) 2009 Toni Gundogdu.
3 * This file is part of abby.
5 * abby is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * abby is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 #ifndef mainwnd_h
19 #define mainwnd_h
21 #include <QProcess>
23 #include "ui_mainwnd.h"
25 class QMainWindow;
26 class PreferencesDialog;
27 class RSSDialog;
28 class ScanDialog;
29 class FormatDialog;
31 class MainWindow : public QMainWindow, private Ui::MainWindow {
32 Q_OBJECT
33 public:
34 MainWindow();
35 private slots:
36 void onPreferences();
37 void onStart();
38 void onCancel();
39 void onAbout();
40 void onStreamStateChanged(int state);
41 void onRSS();
42 void onScan();
43 void onPasteURL();
44 void onAdd();
45 void onRemove();
46 void onClear();
47 void onFormats();
48 void onSupportedHosts();
49 void onProcStarted();
50 void onProcError(QProcess::ProcessError);
51 void onProcStdoutReady();
52 void onProcFinished(int exitCode, QProcess::ExitStatus exitStatus);
53 void onItemDoubleClicked(QListWidgetItem *item);
54 private:
55 QStringList hostsOutput;
56 PreferencesDialog *prefs;
57 RSSDialog *rss;
58 ScanDialog *scan;
59 FormatDialog *format;
60 QProcess process;
61 bool cancelled;
62 bool errorOccurred;
63 QString ccliveVersion;
64 QString curlVersion;
65 private:
66 void addPageLink(QString lnk);
67 void writeSettings();
68 void readSettings();
69 void updateLog(const QString& text);
70 void updateWidgets(const bool updateCcliveDepends);
71 void setProxy();
72 bool isCclive(QString& output);
73 bool ccliveSupportsFeature(const QString& buildOption);
74 bool ccliveSupportsHost(const QString &lnk);
75 void parseCcliveHostsOutput();
76 bool checkCclivePath();
77 protected:
78 void closeEvent(QCloseEvent *event);
80 #endif