Kerberos: add kerberos_inject_longterm_key() helper function
[wireshark-sm.git] / ui / qt / profile_dialog.h
blob5ffc69f70431db8c03531533a63259f39cfe5bba
1 /** @file
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
8 */
10 #ifndef PROFILE_DIALOG_H
11 #define PROFILE_DIALOG_H
13 #include "config.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>
22 namespace Ui {
23 class ProfileDialog;
26 class ProfileDialog : public GeometryStateDialog
28 Q_OBJECT
30 public:
31 enum ProfileAction {
32 ShowProfiles, NewProfile, ImportZipProfile, ImportDirProfile,
33 ExportSingleProfile, ExportAllProfiles, EditCurrentProfile, DeleteCurrentProfile
36 explicit ProfileDialog(QWidget *parent = Q_NULLPTR);
37 ~ProfileDialog();
38 int execAction(ProfileAction profile_action);
40 /**
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());
50 protected:
51 virtual void keyPressEvent(QKeyEvent *event);
53 private:
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_;
60 #endif
61 ProfileModel *model_;
62 ProfileSortModel *sort_model_;
64 void updateWidgets();
65 void resetTreeView();
67 void finishImport(QFileInfo fi, int count, int skipped, QStringList import);
69 private slots:
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);
73 void importFromZip();
74 #endif
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();
90 // QWidget interface
94 #endif // PROFILE_DIALOG_H