i2pd/qt/i2pd_qt/mainwindow.h

88 lines
2.1 KiB
C
Raw Normal View History

2016-06-14 03:52:17 +03:00
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QPushButton>
#include <QtCore/QVariant>
#include <QtWidgets/QAction>
#include <QtWidgets/QApplication>
#include <QtWidgets/QButtonGroup>
#include <QtWidgets/QHeaderView>
#include <QtWidgets/QMainWindow>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QVBoxLayout>
#include <QtWidgets/QWidget>
2017-02-02 18:13:44 +03:00
#include <QtWidgets/QCheckBox>
#include <QtWidgets/QComboBox>
#ifndef ANDROID
#include <QSystemTrayIcon>
#include <QCloseEvent>
#include <QMenu>
#endif
2016-06-14 03:52:17 +03:00
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
//#ifndef ANDROID
// void setVisible(bool visible);
//#endif
private slots:
void handleQuitButton();
2016-06-24 22:37:59 +03:00
void handleGracefulQuitButton();
void handleGracefulQuitTimerEvent();
#ifndef ANDROID
void setIcon();
void iconActivated(QSystemTrayIcon::ActivationReason reason);
void toggleVisibilitySlot();
#endif
2017-01-28 11:01:34 +03:00
void showStatusPage();
void showSettingsPage();
void showTunnelsPage();
void showRestartPage();
void showQuitPage();
2016-06-14 03:52:17 +03:00
private:
#ifndef ANDROID
void createActions();
void createTrayIcon();
bool quitting;
QAction *toggleWindowVisibleAction;
QSystemTrayIcon *trayIcon;
QMenu *trayIconMenu;
#endif
2017-02-01 22:09:57 +03:00
Ui::MainWindow* ui;
protected:
#ifndef ANDROID
void closeEvent(QCloseEvent *event);
#endif
2017-01-28 11:01:34 +03:00
void resizeEvent(QResizeEvent* event);
void onResize();
2017-02-02 18:13:44 +03:00
void initFileChooser(QLineEdit* fileNameLineEdit, QPushButton* fileBrowsePushButton);
void initFolderChooser(QLineEdit* folderLineEdit, QPushButton* folderBrowsePushButton);
void initCombobox(QComboBox* comboBox);
void initIPAddressBox(QLineEdit* addressLineEdit, QString fieldNameTranslated);
void initTCPPortBox(QLineEdit* portLineEdit, QString fieldNameTranslated);
void initCheckBox(QCheckBox* checkBox);
void initIntegerBox(QLineEdit* numberLineEdit);
void initStringBox(QLineEdit* lineEdit);
void loadAllConfigs();
void saveAllConfigs();
2016-06-14 03:52:17 +03:00
};
#endif // MAINWINDOW_H