aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2015-06-25 14:39:43 -0700
committerPascal Quantin <pascal.quantin@gmail.com>2015-06-26 18:37:35 +0000
commit0953c36ec94622e3b901ff840c361d79bdbd327f (patch)
tree5e4dac0cb5a08d3455de3b3b1b561d1357694e66 /ui
parent66c738817c8d2f857bd5fed2e3cfa325e712d791 (diff)
Qt: tweaks to Capture Interfaces dialog
- Add option to stop capture after X files are created - Increase the max value for number of packets / files / bytes / seconds from 1000 to INT_MAX - Fix capture name file selection Change-Id: I9fb8eeaa925e5bd5380bb654686575f41126546a Reviewed-on: https://code.wireshark.org/review/9162 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'ui')
-rw-r--r--ui/qt/capture_interfaces_dialog.cpp16
-rw-r--r--ui/qt/capture_interfaces_dialog.h2
-rw-r--r--ui/qt/capture_interfaces_dialog.ui67
3 files changed, 67 insertions, 18 deletions
diff --git a/ui/qt/capture_interfaces_dialog.cpp b/ui/qt/capture_interfaces_dialog.cpp
index d144aac65b..13c035b799 100644
--- a/ui/qt/capture_interfaces_dialog.cpp
+++ b/ui/qt/capture_interfaces_dialog.cpp
@@ -152,7 +152,7 @@ CaptureInterfacesDialog::CaptureInterfacesDialog(QWidget *parent) :
connect(this, SIGNAL(interfacesChanged()), ui->allFilterComboBox, SIGNAL(interfacesChanged()));
connect(this, SIGNAL(ifsChanged()), this, SLOT(refreshInterfaceList()));
connect(wsApp, SIGNAL(localInterfaceListChanged()), this, SLOT(updateLocalInterfaces()));
- connect(ui->browseButton, SIGNAL(clicked()), this, SLOT(on_browseButton_clicked()));
+ connect(ui->browseButton, SIGNAL(clicked()), this, SLOT(browseButtonClicked()));
}
void CaptureInterfacesDialog::allFilterChanged()
@@ -262,7 +262,7 @@ void CaptureInterfacesDialog::on_capturePromModeCheckBox_toggled(bool checked)
}
}
-void CaptureInterfacesDialog::on_browseButton_clicked()
+void CaptureInterfacesDialog::browseButtonClicked()
{
char *open_dir = NULL;
@@ -277,7 +277,7 @@ void CaptureInterfacesDialog::on_browseButton_clicked()
open_dir = prefs.gui_fileopen_dir;
break;
}
- QString file_name = QFileDialog::getOpenFileName(this, tr("Specify a Capture File"), open_dir);
+ QString file_name = QFileDialog::getSaveFileName(this, tr("Specify a Capture File"), open_dir);
ui->lineEdit->setText(file_name);
}
@@ -434,6 +434,11 @@ void CaptureInterfacesDialog::updateInterfaces()
ui->stopPktSpinBox->setValue(global_capture_opts.autostop_packets);
}
+ if (global_capture_opts.has_autostop_files) {
+ ui->stopFilesCheckBox->setChecked(true);
+ ui->stopFilesSpinBox->setValue(global_capture_opts.autostop_files);
+ }
+
ui->cbUpdatePacketsRT->setChecked(global_capture_opts.real_time_mode);
ui->cbAutoScroll->setChecked(true);
ui->cbExtraCaptureInfo->setChecked(global_capture_opts.show_info);
@@ -736,6 +741,11 @@ bool CaptureInterfacesDialog::saveOptionsToPreferences()
global_capture_opts.autostop_packets = ui->stopPktSpinBox->value();
}
+ global_capture_opts.has_autostop_files = ui->stopFilesCheckBox->isChecked();
+ if (global_capture_opts.has_autostop_files) {
+ global_capture_opts.autostop_files = ui->stopFilesSpinBox->value();
+ }
+
for (int col = col_link_; col <= col_filter_; col++){
if (ui->interfaceTree->isColumnHidden(col)) {
continue;
diff --git a/ui/qt/capture_interfaces_dialog.h b/ui/qt/capture_interfaces_dialog.h
index 89639cdfcf..b1139f76d3 100644
--- a/ui/qt/capture_interfaces_dialog.h
+++ b/ui/qt/capture_interfaces_dialog.h
@@ -98,7 +98,7 @@ private slots:
void allFilterChanged();
void refreshInterfaceList();
void updateLocalInterfaces();
- void on_browseButton_clicked();
+ void browseButtonClicked();
void changeEvent(QEvent* event);
signals:
diff --git a/ui/qt/capture_interfaces_dialog.ui b/ui/qt/capture_interfaces_dialog.ui
index 94212ed2a9..dd70768a79 100644
--- a/ui/qt/capture_interfaces_dialog.ui
+++ b/ui/qt/capture_interfaces_dialog.ui
@@ -500,8 +500,8 @@ PLEASE NOTE: One option MUST be selected.</string>
<attribute name="title">
<string>Options</string>
</attribute>
- <layout class="QVBoxLayout" name="verticalLayout_11">
- <item>
+ <layout class="QFormLayout" name="formLayout">
+ <item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
<widget class="QGroupBox" name="groupBox">
@@ -615,7 +615,7 @@ PLEASE NOTE: One option MUST be selected.</string>
</item>
</layout>
</item>
- <item>
+ <item row="1" column="0">
<widget class="QGroupBox" name="gbStopCaptureAuto">
<property name="enabled">
<bool>true</bool>
@@ -642,14 +642,14 @@ PLEASE NOTE: One option MUST be selected.</string>
<enum>QAbstractSpinBox::PlusMinus</enum>
</property>
<property name="maximum">
- <number>1000</number>
+ <number>2147483647</number>
</property>
<property name="value">
<number>1</number>
</property>
</widget>
</item>
- <item row="1" column="1">
+ <item row="2" column="1">
<widget class="QSpinBox" name="stopMBSpinBox">
<property name="toolTip">
<string>Stop capturing after the specified amount of data has been captured.</string>
@@ -658,14 +658,14 @@ PLEASE NOTE: One option MUST be selected.</string>
<enum>QAbstractSpinBox::PlusMinus</enum>
</property>
<property name="maximum">
- <number>1000</number>
+ <number>2147483647</number>
</property>
<property name="value">
<number>1</number>
</property>
</widget>
</item>
- <item row="1" column="0">
+ <item row="2" column="0">
<widget class="QCheckBox" name="stopMBCheckBox">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Stop capturing after the specified amount of data has been captured.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
@@ -682,7 +682,7 @@ PLEASE NOTE: One option MUST be selected.</string>
</property>
</widget>
</item>
- <item row="2" column="0">
+ <item row="3" column="0">
<widget class="QCheckBox" name="stopSecsCheckBox">
<property name="toolTip">
<string>Stop capturing after the specified amount of time has passed.</string>
@@ -692,7 +692,7 @@ PLEASE NOTE: One option MUST be selected.</string>
</property>
</widget>
</item>
- <item row="2" column="2">
+ <item row="3" column="2">
<widget class="QComboBox" name="stopSecsComboBox">
<property name="toolTip">
<string>Stop capturing after the specified amount of time has passed.</string>
@@ -724,7 +724,7 @@ PLEASE NOTE: One option MUST be selected.</string>
</property>
</widget>
</item>
- <item row="1" column="2">
+ <item row="2" column="2">
<widget class="QComboBox" name="stopMBComboBox">
<property name="toolTip">
<string>Stop capturing after the specified amount of data has been captured.</string>
@@ -746,7 +746,7 @@ PLEASE NOTE: One option MUST be selected.</string>
</item>
</widget>
</item>
- <item row="2" column="1">
+ <item row="3" column="1">
<widget class="QSpinBox" name="stopSecsSpinBox">
<property name="toolTip">
<string>Stop capturing after the specified amount of time has passed.</string>
@@ -755,14 +755,14 @@ PLEASE NOTE: One option MUST be selected.</string>
<enum>QAbstractSpinBox::PlusMinus</enum>
</property>
<property name="maximum">
- <number>1000</number>
+ <number>2147483647</number>
</property>
<property name="value">
<number>1</number>
</property>
</widget>
</item>
- <item row="0" column="3" rowspan="3">
+ <item row="0" column="3" rowspan="4">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@@ -775,10 +775,49 @@ PLEASE NOTE: One option MUST be selected.</string>
</property>
</spacer>
</item>
+ <item row="1" column="1">
+ <widget class="QSpinBox" name="stopFilesSpinBox">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="toolTip">
+ <string>Stop capturing after the specified number of packets have been captured.</string>
+ </property>
+ <property name="buttonSymbols">
+ <enum>QAbstractSpinBox::PlusMinus</enum>
+ </property>
+ <property name="maximum">
+ <number>2147483647</number>
+ </property>
+ <property name="value">
+ <number>1</number>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2">
+ <widget class="QLabel" name="label_8">
+ <property name="text">
+ <string>files</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QCheckBox" name="stopFilesCheckBox">
+ <property name="toolTip">
+ <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Stop capturing after the specified number of files have been created.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
</item>
- <item>
+ <item row="2" column="0">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>