summaryrefslogtreecommitdiffstats
path: root/ui/qt/capture_file_dialog.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:14:26 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:14:26 +0000
commitc4e8a3222648fcf22ca207f1815ebbf7cd144eeb (patch)
tree93d5c6aa93d9987680dd1adad5685e2ad698f223 /ui/qt/capture_file_dialog.h
parentAdding upstream version 4.2.6. (diff)
downloadwireshark-upstream.tar.xz
wireshark-upstream.zip
Adding upstream version 4.4.0.upstream/4.4.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--ui/qt/capture_file_dialog.h42
1 files changed, 20 insertions, 22 deletions
diff --git a/ui/qt/capture_file_dialog.h b/ui/qt/capture_file_dialog.h
index 1e22ad8b..2c48100a 100644
--- a/ui/qt/capture_file_dialog.h
+++ b/ui/qt/capture_file_dialog.h
@@ -12,11 +12,10 @@
#include <ui/qt/widgets/wireshark_file_dialog.h>
-#ifndef Q_OS_WIN
#include <ui/qt/widgets/display_filter_edit.h>
+#include <ui/qt/widgets/compression_group_box.h>
#include "packet_range_group_box.h"
#include "ui/help_url.h"
-#endif // Q_OS_WIN
#include <ui/packet_range.h>
@@ -43,14 +42,27 @@ class CaptureFileDialog : public WiresharkFileDialog
//
// You can subclass QFileDialog (which we've done here) and add widgets as
// described at
- // https://web.archive.org/web/20100528190736/http://developer.qt.nokia.com/faq/answer/how_can_i_add_widgets_to_my_qfiledialog_instance
+ //
+ // https://web.archive.org/web/20100528190736/http://developer.qt.nokia.com/faq/answer/how_can_i_add_widgets_to_my_qfiledialog_instance
+ //
// However, Qt's idea of what a file dialog looks like isn't what Microsoft
// and Apple think a file dialog looks like.
//
- // On Windows Vista and later we should probably use IFileOpenDialog. On earlier
- // versions of Windows (including XP) we should use GetOpenFileName, which is
- // what we do in ui/win32/file_dlg_win32.c. macOS we should use NSOpenPanel. On
- // other platforms we should fall back to QFileDialog.
+ // On Windows, we should probably use the Common Item Dialog:
+ //
+ // https://learn.microsoft.com/en-us/windows/win32/shell/common-file-dialog
+ //
+ // We currently use GetOpenFileNam in ui/win32/file_dlg_win32.c.
+ //
+ // On macOS we should use NSOpenPanel and NSSavePanel:
+ //
+ // https://developer.apple.com/documentation/appkit/nsopenpanel?language=objc
+ // https://developer.apple.com/documentation/appkit/nssavepanel?language=objc
+ //
+ // On other platforms we should fall back to QFileDialog (or maybe
+ // KDE's or GTK+/GNOME's file dialog, as appropriate for the desktop
+ // environment being used, if QFileDialog doesn't do so with various
+ // platform plugins).
//
// Yes, that's four implementations of the same window.
//
@@ -62,9 +74,6 @@ class CaptureFileDialog : public WiresharkFileDialog
public:
explicit CaptureFileDialog(QWidget *parent = NULL, capture_file *cf = NULL);
static check_savability_t checkSaveAsWithComments(QWidget *
-#if defined(Q_OS_WIN)
- parent
-#endif // Q_OS_WIN
, capture_file *cf, int file_type);
int mergeType();
@@ -74,7 +83,6 @@ public:
private:
capture_file *cap_file_;
-#if !defined(Q_OS_WIN)
void addMergeControls(QVBoxLayout &v_box);
void addFormatTypeSelector(QVBoxLayout &v_box);
void addDisplayFilterEdit(QString &display_filter);
@@ -110,25 +118,17 @@ private:
int default_ft_;
- QCheckBox compress_;
+ CompressionGroupBox compress_group_box_;
PacketRangeGroupBox packet_range_group_box_;
QPushButton *save_bt_;
topic_action_e help_topic_;
-#else // Q_OS_WIN
- int file_type_;
- int merge_type_;
- wtap_compression_type compression_type_;
-#endif // Q_OS_WIN
-
signals:
public slots:
-#ifndef Q_OS_WIN
void accept() Q_DECL_OVERRIDE;
-#endif
int exec() Q_DECL_OVERRIDE;
int open(QString &file_name, unsigned int &type, QString &display_filter);
check_savability_t saveAs(QString &file_name, bool must_support_comments);
@@ -136,11 +136,9 @@ public slots:
int merge(QString &file_name, QString &display_filter);
private slots:
-#if !defined(Q_OS_WIN)
void fixFilenameExtension();
void preview(const QString & path);
void on_buttonBox_helpRequested();
-#endif // Q_OS_WIN
};
#endif // CAPTURE_FILE_DIALOG_H