webperimental: killstack decides stack protects.
[freeciv.git] / tools / mpgui_qt.h
blob9dc5f47e80ce2ef1f6392d6bb1188ff8705b7df6
1 /**********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12 ***********************************************************************/
14 #ifndef FC__MPGUI_QT_H
15 #define FC__MPGUI_QT_H
17 #ifdef HAVE_CONFIG_H
18 #include <fc_config.h>
19 #endif
21 // Qt
22 #include <QMainWindow>
23 #include <QObject>
25 // tools
26 #include "modinst.h"
28 class QLabel;
29 class QLineEdit;
30 class QProgressBar;
31 class QTableWidget;
33 class mpgui_main : public QMainWindow
35 Q_OBJECT
37 public:
38 mpgui_main(QApplication *qapp_in, QWidget *central_in);
40 private:
41 void popup_quit_dialog();
42 QApplication *qapp;
43 QWidget *central;
45 protected:
46 void closeEvent(QCloseEvent *event);
49 class mpgui : public QObject
51 Q_OBJECT
53 public:
54 void setup(QWidget *central, struct fcmp_params *fcmp);
55 void display_msg_thr(const char *msg);
56 void progress_thr(int downloaded, int max);
57 void setup_list(const char *name, const char *URL,
58 const char *version, const char *license,
59 enum modpack_type type, const char *subtype,
60 const char *notes);
61 void refresh_list_versions_thr();
63 signals:
64 void display_msg_thr_signal(const char *msg);
65 void progress_thr_signal(int downloaded, int max);
66 void refresh_list_versions_thr_signal();
68 public slots:
69 void display_msg(const char *msg);
70 void progress(int downloaded, int max);
71 void refresh_list_versions();
73 private slots:
74 void URL_given();
75 void row_selected(int, int);
76 void row_download(const QModelIndex &);
78 private:
79 QLineEdit *URLedit;
80 QLabel *msg_dspl;
81 QProgressBar *bar;
82 QTableWidget *mplist_table;
85 #endif // FC__MPGUI_QT_H