forked from osmocom/wireshark
Add a "Include column headings" checkbox in export dissections and print.
Bug: 14945 Change-Id: I1c5ed0bc7e738a5c8d65c09f25686549e1e6dd67 Reviewed-on: https://code.wireshark.org/review/28615 Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
parent
2ba45c2556
commit
d7ce2bece8
|
@ -174,6 +174,7 @@ int ExportDissectionDialog::exec()
|
||||||
print_args_.to_file = TRUE;
|
print_args_.to_file = TRUE;
|
||||||
print_args_.cmd = NULL;
|
print_args_.cmd = NULL;
|
||||||
print_args_.print_summary = TRUE;
|
print_args_.print_summary = TRUE;
|
||||||
|
print_args_.print_col_headings = TRUE;
|
||||||
print_args_.print_dissections = print_dissections_as_displayed;
|
print_args_.print_dissections = print_dissections_as_displayed;
|
||||||
print_args_.print_hex = FALSE;
|
print_args_.print_hex = FALSE;
|
||||||
print_args_.print_formfeed = FALSE;
|
print_args_.print_formfeed = FALSE;
|
||||||
|
@ -181,6 +182,7 @@ int ExportDissectionDialog::exec()
|
||||||
switch (export_type_) {
|
switch (export_type_) {
|
||||||
case export_type_text: /* Text */
|
case export_type_text: /* Text */
|
||||||
print_args_.print_summary = packet_format_group_box_.summaryEnabled();
|
print_args_.print_summary = packet_format_group_box_.summaryEnabled();
|
||||||
|
print_args_.print_col_headings = packet_format_group_box_.includeColumnHeadingsEnabled();
|
||||||
print_args_.print_dissections = print_dissections_none;
|
print_args_.print_dissections = print_dissections_none;
|
||||||
if (packet_format_group_box_.detailsEnabled()) {
|
if (packet_format_group_box_.detailsEnabled()) {
|
||||||
if (packet_format_group_box_.allCollapsedEnabled())
|
if (packet_format_group_box_.allCollapsedEnabled())
|
||||||
|
|
|
@ -22,7 +22,26 @@ PacketFormatGroupBox::PacketFormatGroupBox(QWidget *parent) :
|
||||||
|
|
||||||
QStyleOption style_opt;
|
QStyleOption style_opt;
|
||||||
int cb_label_offset = pf_ui_->detailsCheckBox->style()->subElementRect(QStyle::SE_CheckBoxContents, &style_opt).left();
|
int cb_label_offset = pf_ui_->detailsCheckBox->style()->subElementRect(QStyle::SE_CheckBoxContents, &style_opt).left();
|
||||||
setStyleSheet(QString(
|
|
||||||
|
// Indent the checkbox under the "Packet summary" checkbox
|
||||||
|
pf_ui_->includeColumnHeadingsCheckBox->setStyleSheet(QString(
|
||||||
|
"QCheckBox {"
|
||||||
|
" padding-left: %1px;"
|
||||||
|
"}"
|
||||||
|
).arg(cb_label_offset));
|
||||||
|
|
||||||
|
// Indent the radio buttons under the "Packet details" checkbox
|
||||||
|
pf_ui_->allCollapsedButton->setStyleSheet(QString(
|
||||||
|
"QRadioButton {"
|
||||||
|
" padding-left: %1px;"
|
||||||
|
"}"
|
||||||
|
).arg(cb_label_offset));
|
||||||
|
pf_ui_->asDisplayedButton->setStyleSheet(QString(
|
||||||
|
"QRadioButton {"
|
||||||
|
" padding-left: %1px;"
|
||||||
|
"}"
|
||||||
|
).arg(cb_label_offset));
|
||||||
|
pf_ui_->allExpandedButton->setStyleSheet(QString(
|
||||||
"QRadioButton {"
|
"QRadioButton {"
|
||||||
" padding-left: %1px;"
|
" padding-left: %1px;"
|
||||||
"}"
|
"}"
|
||||||
|
@ -39,6 +58,11 @@ bool PacketFormatGroupBox::summaryEnabled()
|
||||||
return pf_ui_->summaryCheckBox->isChecked();
|
return pf_ui_->summaryCheckBox->isChecked();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool PacketFormatGroupBox::includeColumnHeadingsEnabled()
|
||||||
|
{
|
||||||
|
return pf_ui_->includeColumnHeadingsCheckBox->isChecked();
|
||||||
|
}
|
||||||
|
|
||||||
bool PacketFormatGroupBox::detailsEnabled()
|
bool PacketFormatGroupBox::detailsEnabled()
|
||||||
{
|
{
|
||||||
return pf_ui_->detailsCheckBox->isChecked();
|
return pf_ui_->detailsCheckBox->isChecked();
|
||||||
|
@ -64,8 +88,9 @@ bool PacketFormatGroupBox::allExpandedEnabled()
|
||||||
return pf_ui_->allExpandedButton->isChecked();
|
return pf_ui_->allExpandedButton->isChecked();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PacketFormatGroupBox::on_summaryCheckBox_toggled(bool)
|
void PacketFormatGroupBox::on_summaryCheckBox_toggled(bool checked)
|
||||||
{
|
{
|
||||||
|
pf_ui_->includeColumnHeadingsCheckBox->setEnabled(checked);
|
||||||
emit formatChanged();
|
emit formatChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,8 @@ public:
|
||||||
bool detailsEnabled();
|
bool detailsEnabled();
|
||||||
bool bytesEnabled();
|
bool bytesEnabled();
|
||||||
|
|
||||||
|
bool includeColumnHeadingsEnabled();
|
||||||
|
|
||||||
bool allCollapsedEnabled();
|
bool allCollapsedEnabled();
|
||||||
bool asDisplayedEnabled();
|
bool asDisplayedEnabled();
|
||||||
bool allExpandedEnabled();
|
bool allExpandedEnabled();
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>400</width>
|
<width>400</width>
|
||||||
<height>178</height>
|
<height>199</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
@ -30,6 +30,16 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="includeColumnHeadingsCheckBox">
|
||||||
|
<property name="text">
|
||||||
|
<string>Include column headings</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="detailsCheckBox">
|
<widget class="QCheckBox" name="detailsCheckBox">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
|
|
|
@ -235,6 +235,7 @@ void PrintDialog::printPackets(QPrinter *printer, bool in_preview)
|
||||||
|
|
||||||
print_args_.format = PR_FMT_TEXT;
|
print_args_.format = PR_FMT_TEXT;
|
||||||
print_args_.print_summary = pd_ui_->formatGroupBox->summaryEnabled();
|
print_args_.print_summary = pd_ui_->formatGroupBox->summaryEnabled();
|
||||||
|
print_args_.print_col_headings = pd_ui_->formatGroupBox->includeColumnHeadingsEnabled();
|
||||||
print_args_.print_hex = pd_ui_->formatGroupBox->bytesEnabled();
|
print_args_.print_hex = pd_ui_->formatGroupBox->bytesEnabled();
|
||||||
print_args_.print_formfeed = pd_ui_->formFeedCheckBox->isChecked();
|
print_args_.print_formfeed = pd_ui_->formFeedCheckBox->isChecked();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue