ManageInterfacesDialog: New handling of pipes
[metze/wireshark/wip.git] / ui / qt / manage_interfaces_dialog.h
index 195cad6569d117439c4ea5424c8cbf9954bcd85d..63b07c77c398c570001101b987c7ae16a5d6ff95 100644 (file)
 #ifndef MANAGE_INTERFACES_DIALOG_H
 #define MANAGE_INTERFACES_DIALOG_H
 
-#include <QDialog>
-#include <QLineEdit>
-#include <QTableWidget>
-#include <QStyledItemDelegate>
-#include <QTreeWidgetItem>
-#include <QStandardItemModel>
+#include <config.h>
 
 #include <glib.h>
 #include "capture_opts.h"
 
-enum
-{
-    HIDE = 0,
-    FRIENDLY,
-    LOCAL_NAME,
-    COMMENT,
-    NUM_LOCAL_COLUMNS
-};
-
-enum
-{
-    HOST = 0,
-    HIDDEN,
-    REMOTE_NAME,
-    NUM_REMOTE_COLUMNS
-};
-
+#include "ui/qt/interface_tree_cache_model.h"
+#include "ui/qt/interface_sort_filter_model.h"
 
-class NewFileDelegate : public QStyledItemDelegate
-{
-    Q_OBJECT
-
-private:
-    QTableWidget* table;
-
-public:
-    NewFileDelegate(QObject *parent = 0);
-    ~NewFileDelegate();
+#include "geometry_state_dialog.h"
+#include <QStyledItemDelegate>
 
-    QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const;
-    void setTable(QTableWidget* tb) { table = tb; }
+class QTreeWidget;
+class QTreeWidgetItem;
+class QStandardItemModel;
 
-private slots:
-    void browse_button_clicked();
-    void setTextField(const QString &text);
-    void stopEditor();
-};
+class QLineEdit;
 
 
 namespace Ui {
 class ManageInterfacesDialog;
 }
 
-class ManageInterfacesDialog : public QDialog
+class ManageInterfacesDialog : public GeometryStateDialog
 {
     Q_OBJECT
 
@@ -85,15 +54,12 @@ public:
 
 private:
     Ui::ManageInterfacesDialog *ui;
-    NewFileDelegate new_pipe_item_delegate_;
-    QStandardItemModel *remoteModel;
 
-    void showPipes();
-    void showLocalInterfaces();
+    InterfaceTreeCacheModel * sourceModel;
+    InterfaceSortFilterModel * proxyModel;
+    InterfaceSortFilterModel * pipeProxyModel;
+
     void showRemoteInterfaces();
-    void saveLocalHideChanges(QTableWidgetItem *item);
-    void saveLocalCommentChanges(QTableWidgetItem *item);
-    void checkBoxChanged(QTableWidgetItem *item);    
 
 signals:
     void ifsChanged();
@@ -103,32 +69,40 @@ signals:
 #endif
 
 private slots:
-    void on_addButton_clicked();
+    void updateWidgets();
+
     void on_buttonBox_accepted();
-    void on_delButton_clicked();
-    void on_localButtonBox_accepted();
+
+    void on_addPipe_clicked();
+    void on_delPipe_clicked();
+
+    void onSelectionChanged(const QItemSelection &sel, const QItemSelection &desel);
+
 #ifdef HAVE_PCAP_REMOTE
     void on_addRemote_clicked();
-    void on_remoteButtonBox_accepted();
+    void on_delRemote_clicked();
+    void remoteAccepted();
+    void on_remoteList_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous);
+    void on_remoteList_itemClicked(QTreeWidgetItem *item, int column);
     void addRemoteInterfaces(GList *rlist, remote_options *roptions);
     void setRemoteSettings(interface_t *iface);
-    void on_delRemote_clicked();
     void remoteSelectionChanged(QTreeWidgetItem* item, int col);
     void on_remoteSettings_clicked();
 #endif
+    void on_buttonBox_helpRequested();
 };
 
 #endif // MANAGE_INTERFACES_DIALOG_H
 
-//
-// Editor modelines  -  http://www.wireshark.org/tools/modelines.html
-//
-// Local variables:
-// c-basic-offset: 4
-// tab-width: 4
-// indent-tabs-mode: nil
-// End:
-//
-// vi: set shiftwidth=4 tabstop=4 expandtab:
-// :indentSize=4:tabSize=4:noTabs=true:
-//
+/*
+ * Editor modelines
+ *
+ * Local Variables:
+ * c-basic-offset: 4
+ * tab-width: 8
+ * indent-tabs-mode: nil
+ * End:
+ *
+ * ex: set shiftwidth=4 tabstop=8 expandtab:
+ * :indentSize=4:tabSize=8:noTabs=true:
+ */