1 /* manage_interfaces_dialog.h
2  *
3  * Wireshark - Network traffic analyzer
4  * By Gerald Combs <gerald@wireshark.org>
5  * Copyright 1998 Gerald Combs
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  */
9 
10 #ifndef MANAGE_INTERFACES_DIALOG_H
11 #define MANAGE_INTERFACES_DIALOG_H
12 
13 #include <config.h>
14 
15 #include <glib.h>
16 #include "capture_opts.h"
17 
18 #include <ui/qt/models/interface_tree_cache_model.h>
19 #include <ui/qt/models/interface_sort_filter_model.h>
20 
21 #include "geometry_state_dialog.h"
22 #include <QStyledItemDelegate>
23 
24 class QTreeWidget;
25 class QTreeWidgetItem;
26 class QStandardItemModel;
27 
28 class QLineEdit;
29 
30 
31 namespace Ui {
32 class ManageInterfacesDialog;
33 }
34 
35 class ManageInterfacesDialog : public GeometryStateDialog
36 {
37     Q_OBJECT
38 
39 public:
40     explicit ManageInterfacesDialog(QWidget *parent = 0);
41     ~ManageInterfacesDialog();
42 
43 private:
44     Ui::ManageInterfacesDialog *ui;
45 
46     InterfaceTreeCacheModel * sourceModel;
47     InterfaceSortFilterModel * proxyModel;
48     InterfaceSortFilterModel * pipeProxyModel;
49 
50     void showRemoteInterfaces();
51 
52 signals:
53     void ifsChanged();
54 #ifdef HAVE_PCAP_REMOTE
55     void remoteAdded(GList *rlist, remote_options *roptions);
56     void remoteSettingsChanged(interface_t *iface);
57 #endif
58 
59 private slots:
60     void updateWidgets();
61 
62     void on_buttonBox_accepted();
63 
64 #ifdef HAVE_LIBPCAP
65     void on_addPipe_clicked();
66     void on_delPipe_clicked();
67 #endif
68 
69     void onSelectionChanged(const QItemSelection &sel, const QItemSelection &desel);
70 
71 #ifdef HAVE_PCAP_REMOTE
72     void on_addRemote_clicked();
73     void on_delRemote_clicked();
74     void remoteAccepted();
75     void on_remoteList_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous);
76     void on_remoteList_itemClicked(QTreeWidgetItem *item, int column);
77     int  remoteInterfacesExists(char* device_name);
78     QTreeWidgetItem* getRemoteHostItem( char* name );
79     void addRemoteInterfaces(GList *rlist, remote_options *roptions);
80     void updateRemoteInterfaceList(GList *rlist, remote_options *roptions);
81     void setRemoteSettings(interface_t *iface);
82     void remoteSelectionChanged(QTreeWidgetItem* item, int col);
83     void on_remoteSettings_clicked();
84 #endif
85     void on_buttonBox_helpRequested();
86 };
87 
88 #endif // MANAGE_INTERFACES_DIALOG_H
89