diff options
author | Gerald Combs <gerald@wireshark.org> | 2016-01-13 14:11:00 -0800 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2016-01-14 05:22:08 +0000 |
commit | 8fe1cf77eb7d825bd8c4db5289db530f6dfde0c2 (patch) | |
tree | ef93b66c3bdeaaca29f6cfe4f0593b36972bcee8 /ui/qt/capture_interfaces_dialog.cpp | |
parent | cd5b93281287b7fb169e1bd9be0a3c60814c4dec (diff) |
Fix capture output options.
Remove the "permanent file" checkbox. We weren't properly checking its
value and it was extraneous. Add placeholder text about temporary files.
Move the filename above the other options. That's where it is in the
GTK+ UI and it's arguably the most important.
When capturing to multiple files the size and duration settings aren't
mutually exclusive.
Change-Id: I1da1d3524e3c2de2361050913281472a172faa3a
Reviewed-on: https://code.wireshark.org/review/13269
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'ui/qt/capture_interfaces_dialog.cpp')
-rw-r--r-- | ui/qt/capture_interfaces_dialog.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/ui/qt/capture_interfaces_dialog.cpp b/ui/qt/capture_interfaces_dialog.cpp index 4c154e9dea..031b89e7b1 100644 --- a/ui/qt/capture_interfaces_dialog.cpp +++ b/ui/qt/capture_interfaces_dialog.cpp @@ -147,6 +147,10 @@ CaptureInterfacesDialog::CaptureInterfacesDialog(QWidget *parent) : interface_item_delegate_.setTree(ui->interfaceTree); ui->interfaceTree->setColumnWidth(col_link_, 100); +#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0) + ui->filenameLineEdit->setPlaceholderText(tr("Leave blank to use a temporary file")); +#endif + connect(ui->interfaceTree,SIGNAL(itemClicked(QTreeWidgetItem*,int)),this,SLOT(interfaceClicked(QTreeWidgetItem*,int))); connect(ui->interfaceTree, SIGNAL(itemSelectionChanged()), this, SLOT(interfaceSelected())); connect(ui->allFilterComboBox, SIGNAL(captureFilterSyntaxChanged(bool)), this, SLOT(allFilterChanged())); @@ -277,7 +281,7 @@ void CaptureInterfacesDialog::browseButtonClicked() break; } QString file_name = QFileDialog::getSaveFileName(this, tr("Specify a Capture File"), open_dir); - ui->lineEdit->setText(file_name); + ui->filenameLineEdit->setText(file_name); } void CaptureInterfacesDialog::on_gbStopCaptureAuto_toggled(bool checked) @@ -357,12 +361,12 @@ void CaptureInterfacesDialog::updateInterfaces() ui->capturePromModeCheckBox->setChecked(prefs.capture_prom_mode); if (global_capture_opts.saving_to_file) { - ui->lineEdit->setText(QString(global_capture_opts.orig_save_file)); + ui->filenameLineEdit->setText(QString(global_capture_opts.orig_save_file)); } ui->gbNewFileAuto->setChecked(global_capture_opts.multi_files_on); - ui->MBRadioButton->setChecked(global_capture_opts.has_autostop_filesize); - ui->SecsRadioButton->setChecked(global_capture_opts.has_file_duration); + ui->MBCheckBox->setChecked(global_capture_opts.has_autostop_filesize); + ui->SecsCheckBox->setChecked(global_capture_opts.has_file_duration); if (global_capture_opts.has_autostop_filesize) { int value = global_capture_opts.autostop_filesize; if (value > 1000000) { @@ -637,7 +641,7 @@ bool CaptureInterfacesDialog::saveOptionsToPreferences() prefs.capture_pcap_ng = false; } - QString filename = ui->lineEdit->text(); + QString filename = ui->filenameLineEdit->text(); if (filename.length() > 0) { /* User specified a file to which the capture should be written. */ global_capture_opts.saving_to_file = true; @@ -663,7 +667,7 @@ bool CaptureInterfacesDialog::saveOptionsToPreferences() } global_capture_opts.multi_files_on = ui->gbNewFileAuto->isChecked(); if (global_capture_opts.multi_files_on) { - global_capture_opts.has_file_duration = ui->SecsRadioButton->isChecked(); + global_capture_opts.has_file_duration = ui->SecsCheckBox->isChecked(); if (global_capture_opts.has_file_duration) { global_capture_opts.file_duration = ui->SecsSpinBox->value(); int index = ui->SecsComboBox->currentIndex(); @@ -674,7 +678,7 @@ bool CaptureInterfacesDialog::saveOptionsToPreferences() break; } } - global_capture_opts.has_autostop_filesize = ui->MBRadioButton->isChecked(); + global_capture_opts.has_autostop_filesize = ui->MBCheckBox->isChecked(); if (global_capture_opts.has_autostop_filesize) { global_capture_opts.autostop_filesize = ui->MBSpinBox->value(); int index = ui->MBComboBox->currentIndex(); |