-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathmainwindow.h
65 lines (55 loc) · 2.08 KB
/
mainwindow.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*****************************************************************************
* tunnelmanager - Simple GUI for SSH Tunnels
*
* Copyright (C) 2017-2024 Syping
* Copyright (C) 2017 Soner Sayakci
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*
*****************************************************************************/
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMap>
#include <QMainWindow>
#include <QTreeWidgetItem>
#include <QSystemTrayIcon>
#include <QProcess>
#include <QStringList>
#include "newentry.h"
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
void adaptSize();
private:
QVector<QString> buildPlinkOpenSSHOptions(const QString &exec, const QString &host, const QString &sshPort, const QString &user, const QString &locPort, const QString &extIP, const QString &extPort);
void deleteTreeWidgetItem(QTreeWidgetItem *item);
Ui::MainWindow *ui;
NewEntry *entry;
QMap<QTreeWidgetItem*, QProcess*> processMap;
QMap<QTreeWidgetItem*, QStringList> itemData;
QMap<QProcess*, QTreeWidgetItem*> processToWidgetItem;
QSystemTrayIcon trayIcon;
public slots:
void itemModified(QTreeWidgetItem *item, QString name, QString host, QString sshPort, QString user, QString locPort, QString extIP, QString extPort);
private slots:
void addNewEntry();
void entryDialogClosed(int id);
void on_actionQuit_triggered();
void newEntryAdded(QString name, QString host, QString sshPort, QString user, QString locPort, QString extIP, QString extPort, bool startup = true);
void on_buttonDelete_clicked();
void selectPlinkOpenSSH();
void toggleWindowState();
void on_treeWidget_customContextMenuRequested(const QPoint &pos);
void deleteFromContextMenu();
void onTunnelStart();
void onTunnelCrash(int exitCode, QProcess::ExitStatus exitStatus);
void on_treeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column);
};
#endif // MAINWINDOW_H