HACK: 1. try to match RowsetProperties
[wireshark-wip.git] / ui / qt / uat_dialog.h
bloba777230bf932f0f142277f1530019fbc20648c13
1 /* uat_dialog.h
3 * $Id$
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 #ifndef UAT_DIALOG_H
25 #define UAT_DIALOG_H
27 #include "config.h"
29 #include <glib.h>
31 #include "epan/uat-int.h"
33 #include "syntax_line_edit.h"
35 #include <QComboBox>
36 #include <QDialog>
37 #include <QLineEdit>
38 #include <QPushButton>
39 #include <QTreeWidgetItem>
41 namespace Ui {
42 class UatDialog;
45 class UatDialog : public QDialog
47 Q_OBJECT
49 public:
50 explicit UatDialog(QWidget *parent = 0, uat_t *uat = NULL);
51 ~UatDialog();
53 void setUat(uat_t *uat = NULL);
55 protected:
56 void keyPressEvent(QKeyEvent *evt);
58 private slots:
59 void on_uatTreeWidget_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous);
60 void on_uatTreeWidget_itemActivated(QTreeWidgetItem *item, int column);
61 void on_uatTreeWidget_itemSelectionChanged();
62 void lineEditPrefDestroyed();
63 void enumPrefDestroyed();
64 void enumPrefCurrentIndexChanged(int index);
65 void stringPrefTextChanged(const QString & text);
66 void stringPrefEditingFinished();
67 void on_newToolButton_clicked();
68 void on_deleteToolButton_clicked();
69 void on_copyToolButton_clicked();
70 void on_buttonBox_accepted();
71 void on_buttonBox_rejected();
72 void on_buttonBox_helpRequested();
74 private:
75 Ui::UatDialog *ui;
76 QPushButton *ok_button_;
77 QPushButton *help_button_;
78 uat_t *uat_;
79 int cur_column_;
80 SyntaxLineEdit *cur_line_edit_;
81 QString saved_string_pref_;
82 QComboBox *cur_combo_box_;
83 int saved_combo_idx_;
85 QString fieldString(guint row, guint column);
86 void updateItem(QTreeWidgetItem &item);
87 void updateItems();
88 void activateLastItem();
89 void applyChanges();
90 void addRecord(bool copy_from_current = false);
93 #endif // UAT_DIALOG_H