QT Print Dialog: Make header optional
Add a checkbox to make the file information header/banner optional. Fixes: wireshark/wireshark#17322
This commit is contained in:
parent
52030fdca7
commit
587198a4cc
@ -31,6 +31,7 @@ extern "C" {
|
||||
|
||||
// Page element callbacks
|
||||
|
||||
|
||||
static gboolean
|
||||
print_preamble_pd(print_stream_t *self, gchar *, const char *)
|
||||
{
|
||||
@ -123,6 +124,8 @@ PrintDialog::PrintDialog(QWidget *parent, capture_file *cf, QString selRange) :
|
||||
this, SLOT(checkValidity()));
|
||||
connect(pd_ui_->formFeedCheckBox, SIGNAL(toggled(bool)),
|
||||
preview_, SLOT(updatePreview()));
|
||||
connect(pd_ui_->bannerCheckBox, SIGNAL(toggled(bool)),
|
||||
preview_, SLOT(updatePreview()));
|
||||
|
||||
checkValidity();
|
||||
}
|
||||
@ -153,12 +156,14 @@ gboolean PrintDialog::printHeader()
|
||||
page_pos_ = page_top;
|
||||
}
|
||||
|
||||
QString banner = QString(tr("%1 %2 total packets, %3 shown"))
|
||||
.arg(cap_file_->filename)
|
||||
.arg(cap_file_->count)
|
||||
.arg(cap_file_->displayed_count);
|
||||
cur_painter_->setFont(header_font_);
|
||||
cur_painter_->drawText(0, page_top, banner);
|
||||
if (pd_ui_->bannerCheckBox->isChecked()) {
|
||||
QString banner = QString(tr("%1 %2 total packets, %3 shown"))
|
||||
.arg(cap_file_->filename)
|
||||
.arg(cap_file_->count)
|
||||
.arg(cap_file_->displayed_count);
|
||||
cur_painter_->setFont(header_font_);
|
||||
cur_painter_->drawText(0, page_top, banner);
|
||||
}
|
||||
page_pos_ += cur_painter_->fontMetrics().height();
|
||||
cur_painter_->setFont(packet_font_);
|
||||
return TRUE;
|
||||
|
@ -35,6 +35,19 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="bannerCheckBox">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Print capture file information on each page</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Capture information header</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
|
Loading…
x
Reference in New Issue
Block a user