3 * Wireshark - Network traffic analyzer
4 * By Gerald Combs <gerald@wireshark.org>
5 * Copyright 1998 Gerald Combs
7 * SPDX-License-Identifier: GPL-2.0-or-later
10 #ifndef PROFILE_DIALOG_H
11 #define PROFILE_DIALOG_H
15 #include <ui/qt/geometry_state_dialog.h>
16 #include <ui/qt/models/profile_model.h>
17 #include <ui/qt/widgets/profile_tree_view.h>
19 #include <QPushButton>
20 #include <QTreeWidgetItem>
26 class ProfileDialog
: public GeometryStateDialog
32 ShowProfiles
, NewProfile
, ImportZipProfile
, ImportDirProfile
,
33 ExportSingleProfile
, ExportAllProfiles
, EditCurrentProfile
, DeleteCurrentProfile
36 explicit ProfileDialog(QWidget
*parent
= Q_NULLPTR
);
38 int execAction(ProfileAction profile_action
);
41 * @brief Select the profile with the given name.
43 * If the profile name is empty, the currently selected profile will be chosen instead.
44 * If the chosen profile is invalid, the first row will be chosen.
46 * @param profile the name of the profile to be selected
48 void selectProfile(QString profile
= QString());
51 virtual void keyPressEvent(QKeyEvent
*event
);
54 Ui::ProfileDialog
*pd_ui_
;
55 QPushButton
*ok_button_
;
56 QPushButton
*import_button_
;
57 #if defined(HAVE_MINIZIP) || defined(HAVE_MINIZIPNG)
58 QPushButton
*export_button_
;
59 QAction
*export_selected_entry_
;
62 ProfileSortModel
*sort_model_
;
67 void finishImport(QFileInfo fi
, int count
, int skipped
, QStringList import
);
70 void currentItemChanged(const QModelIndex
& c
= QModelIndex(), const QModelIndex
& p
= QModelIndex());
71 #if defined(HAVE_MINIZIP) || defined(HAVE_MINIZIPNG)
72 void exportProfiles(bool exportAllPersonalProfiles
= false);
75 void importFromDirectory();
77 void newToolButtonClicked();
78 void deleteToolButtonClicked();
79 void copyToolButtonClicked();
80 void buttonBoxAccepted();
81 void buttonBoxRejected();
82 void buttonBoxHelpRequested();
83 void dataChanged(const QModelIndex
&);
85 void filterChanged(const QString
&);
87 void selectionChanged();
88 QModelIndexList
selectedProfiles();
94 #endif // PROFILE_DIALOG_H