From e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 10 Apr 2024 22:34:10 +0200 Subject: Adding upstream version 4.2.2. Signed-off-by: Daniel Baumann --- ui/qt/profile_dialog.h | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 ui/qt/profile_dialog.h (limited to 'ui/qt/profile_dialog.h') diff --git a/ui/qt/profile_dialog.h b/ui/qt/profile_dialog.h new file mode 100644 index 00000000..d42594f0 --- /dev/null +++ b/ui/qt/profile_dialog.h @@ -0,0 +1,94 @@ +/** @file + * + * Wireshark - Network traffic analyzer + * By Gerald Combs + * Copyright 1998 Gerald Combs + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef PROFILE_DIALOG_H +#define PROFILE_DIALOG_H + +#include "config.h" + +#include +#include +#include + +#include +#include + +namespace Ui { +class ProfileDialog; +} + +class ProfileDialog : public GeometryStateDialog +{ + Q_OBJECT + +public: + enum ProfileAction { + ShowProfiles, NewProfile, ImportZipProfile, ImportDirProfile, + ExportSingleProfile, ExportAllProfiles, EditCurrentProfile, DeleteCurrentProfile + }; + + explicit ProfileDialog(QWidget *parent = Q_NULLPTR); + ~ProfileDialog(); + int execAction(ProfileAction profile_action); + + /** + * @brief Select the profile with the given name. + * + * If the profile name is empty, the currently selected profile will be choosen instead. + * If the choosen profile is invalid, the first row will be choosen. + * + * @param profile the name of the profile to be selected + */ + void selectProfile(QString profile = QString()); + +protected: + virtual void keyPressEvent(QKeyEvent *event); + +private: + Ui::ProfileDialog *pd_ui_; + QPushButton *ok_button_; + QPushButton *import_button_; +#ifdef HAVE_MINIZIP + QPushButton *export_button_; + QAction *export_selected_entry_; +#endif + ProfileModel *model_; + ProfileSortModel *sort_model_; + + void updateWidgets(); + void resetTreeView(); + + void finishImport(QFileInfo fi, int count, int skipped, QStringList import); + +private slots: + void currentItemChanged(const QModelIndex & c = QModelIndex(), const QModelIndex & p = QModelIndex()); +#ifdef HAVE_MINIZIP + void exportProfiles(bool exportAllPersonalProfiles = false); + void importFromZip(); +#endif + void importFromDirectory(); + + void on_newToolButton_clicked(); + void on_deleteToolButton_clicked(); + void on_copyToolButton_clicked(); + void on_buttonBox_accepted(); + void on_buttonBox_rejected(); + void on_buttonBox_helpRequested(); + void dataChanged(const QModelIndex &); + + void filterChanged(const QString &); + + void selectionChanged(); + QModelIndexList selectedProfiles(); + + // QWidget interface + +}; + +#endif // PROFILE_DIALOG_H -- cgit v1.2.3