diff options
author | Masaru Tsuchiyama <m.tmatma@gmail.com> | 2020-08-09 12:12:24 +0900 |
---|---|---|
committer | Ronnie Sahlberg <ronniesahlberg@gmail.com> | 2020-10-30 00:25:22 +0000 |
commit | c14ea41233fa92a1cb97ef29d1f9ded6587e45a5 (patch) | |
tree | b5e1c5169190bddbff0af9c9bce120d0e14e442f /ui | |
parent | 9d6ebdc8a5bf56bf3438489474674b8541a22876 (diff) |
add support for compression of capture file
Diffstat (limited to 'ui')
-rw-r--r-- | ui/qt/capture_options_dialog.cpp | 13 | ||||
-rw-r--r-- | ui/qt/capture_options_dialog.ui | 69 |
2 files changed, 64 insertions, 18 deletions
diff --git a/ui/qt/capture_options_dialog.cpp b/ui/qt/capture_options_dialog.cpp index e9f46f0417..5edd21b724 100644 --- a/ui/qt/capture_options_dialog.cpp +++ b/ui/qt/capture_options_dialog.cpp @@ -206,6 +206,8 @@ CaptureOptionsDialog::CaptureOptionsDialog(QWidget *parent) : ui->filenameLineEdit->setPlaceholderText(tr("Leave blank to use a temporary file")); + ui->rbCompressionNone->setChecked(true); + // Changes in interface selections or capture filters should be propagated // to the main welcome screen where they will be applied to the global // capture options. @@ -1089,6 +1091,17 @@ bool CaptureOptionsDialog::saveOptionsToPreferences() #endif } } + + g_free(global_capture_opts.compress_type); + + if (ui->rbCompressionNone->isChecked() ) { + global_capture_opts.compress_type = NULL; + } else if (ui->rbCompressionGzip->isChecked() ) { + global_capture_opts.compress_type = qstring_strdup("gzip"); + } else { + global_capture_opts.compress_type = NULL; + } + prefs_main_write(); return true; } diff --git a/ui/qt/capture_options_dialog.ui b/ui/qt/capture_options_dialog.ui index 3cca46ed1d..57a88b8405 100644 --- a/ui/qt/capture_options_dialog.ui +++ b/ui/qt/capture_options_dialog.ui @@ -6,15 +6,15 @@ <rect> <x>0</x> <y>0</y> - <width>950</width> - <height>440</height> + <width>1198</width> + <height>988</height> </rect> </property> <layout class="QVBoxLayout" name="verticalLayout_12"> <item> <widget class="QTabWidget" name="tabWidget"> <property name="currentIndex"> - <number>0</number> + <number>1</number> </property> <widget class="QWidget" name="inputTab"> <attribute name="title"> @@ -277,12 +277,12 @@ </item> <item row="1" column="0"> <widget class="QCheckBox" name="PktCheckBox"> - <property name="text"> - <string>after</string> - </property> <property name="toolTip"> <string>Switch to the next file after the specified number of packets have been captured.</string> </property> + <property name="text"> + <string>after</string> + </property> </widget> </item> <item row="1" column="1"> @@ -310,12 +310,12 @@ </item> <item row="2" column="0"> <widget class="QCheckBox" name="MBCheckBox"> - <property name="text"> - <string>after</string> - </property> <property name="toolTip"> <string>Switch to the next file after the file size exceeds the specified file size.</string> </property> + <property name="text"> + <string>after</string> + </property> </widget> </item> <item row="2" column="1"> @@ -364,12 +364,12 @@ </item> <item row="3" column="0"> <widget class="QCheckBox" name="SecsCheckBox"> - <property name="text"> - <string>after</string> - </property> <property name="toolTip"> <string>Switch to the next file when the time capturing to the current file exceeds the specified time.</string> </property> + <property name="text"> + <string>after</string> + </property> </widget> </item> <item row="3" column="1"> @@ -418,13 +418,13 @@ </item> <item row="4" column="0"> <widget class="QCheckBox" name="IntervalSecsCheckBox"> - <property name="text"> - <string>when time is a multiple of</string> - </property> <property name="toolTip"> <string>Switch to the next file when the (wall clock) time is an even multiple of the specified interval. For example, use 1 hour to have a new file created every hour on the hour.</string> </property> + <property name="text"> + <string>when time is a multiple of</string> + </property> </widget> </item> <item row="4" column="1"> @@ -456,6 +456,9 @@ For example, use 1 hour to have a new file created every hour on the hour.</stri <string>Switch to the next file when the (wall clock) time is an even multiple of the specified interval. For example, use 1 hour to have a new file created every hour on the hour.</string> </property> + <property name="currentIndex"> + <number>2</number> + </property> <item> <property name="text"> <string>seconds</string> @@ -471,9 +474,6 @@ For example, use 1 hour to have a new file created every hour on the hour.</stri <string>hours</string> </property> </item> - <property name="currentIndex"> - <number>2</number> - </property> </widget> </item> </layout> @@ -530,6 +530,35 @@ For example, use 1 hour to have a new file created every hour on the hour.</stri </layout> </item> <item> + <widget class="QGroupBox" name="gbCompression"> + <property name="title"> + <string>compression</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_5"> + <item> + <widget class="QRadioButton" name="rbCompressionNone"> + <property name="text"> + <string>None</string> + </property> + <attribute name="buttonGroup"> + <string notr="true">buttonGroup</string> + </attribute> + </widget> + </item> + <item> + <widget class="QRadioButton" name="rbCompressionGzip"> + <property name="text"> + <string>gzip</string> + </property> + <attribute name="buttonGroup"> + <string notr="true">buttonGroup</string> + </attribute> + </widget> + </item> + </layout> + </widget> + </item> + <item> <spacer name="verticalSpacer_2"> <property name="orientation"> <enum>Qt::Vertical</enum> @@ -545,6 +574,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</stri </layout> <zorder>gbNewFileAuto</zorder> <zorder>gbCaptureToFile</zorder> + <zorder>gbCompression</zorder> </widget> <widget class="QWidget" name="optionsTab"> <attribute name="title"> @@ -902,4 +932,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</stri </customwidgets> <resources/> <connections/> + <buttongroups> + <buttongroup name="buttonGroup"/> + </buttongroups> </ui> |