diff options
Diffstat (limited to 'client/mainwindow.h')
-rw-r--r-- | client/mainwindow.h | 47 |
1 files changed, 28 insertions, 19 deletions
diff --git a/client/mainwindow.h b/client/mainwindow.h index 22f3222..98725a6 100644 --- a/client/mainwindow.h +++ b/client/mainwindow.h @@ -23,17 +23,33 @@ #include <QSslSocket> #include <QFile> #include <QSslKey> +#include <QGroupBox> +#include <QPushButton> +#include <api_protocol.h> -#ifdef MINIMAL -const QString host = "192.168.0.1"; -#else -const QString host = "gluzskaya.ru"; -#endif + +using namespace proto; + +const QString host = "127.0.0.1"; namespace Ui { class MainWindow; } +struct service_ui +{ + QGroupBox *group; + std::list<QPushButton*> commands; + ~service_ui() + { + delete group; + for(std::list<QPushButton*>::iterator i = commands.begin(), end = commands.end(); i != end; ++i) + delete *i; + } + + +}; + class MainWindow : public QMainWindow { Q_OBJECT @@ -46,27 +62,20 @@ protected slots: void ssl_verify_error_handler(const QSslError); private slots: - void on_restart_vbox_btn_clicked(); - void restart_vbox_sock_connected(); - void reboot(); - void halt(); - void restart_cups(); - void restart_ppp(); void disconnected(); + void connected(); + void handle_data(); + void handle_button_click(); - void on_reboot_clicked(); - - void on_halt_clicked(); - - void on_restart_cups_clicked(); - - void on_restart_ppp_clicked(); private: void enable_buttons(bool); - QSslSocket *get_socket(); + void get_socket(); + void _connect(); Ui::MainWindow *ui; QSslSocket *sock; + std::list<service_s> *services; + std::list<service_ui*> svc_ui_list; }; #endif // MAINWINDOW_H |