2013-04-10 21:20:33 +00:00
|
|
|
/* packet_format_group_box.cpp
|
|
|
|
*
|
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
2018-02-07 11:26:45 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later*/
|
2013-04-10 21:20:33 +00:00
|
|
|
|
2012-10-12 23:40:29 +00:00
|
|
|
#include "packet_format_group_box.h"
|
2015-06-25 16:17:03 +00:00
|
|
|
#include <ui_packet_format_group_box.h>
|
2012-10-12 23:40:29 +00:00
|
|
|
|
|
|
|
#include <QStyle>
|
|
|
|
|
|
|
|
PacketFormatGroupBox::PacketFormatGroupBox(QWidget *parent) :
|
|
|
|
QGroupBox(parent),
|
|
|
|
pf_ui_(new Ui::PacketFormatGroupBox)
|
|
|
|
{
|
|
|
|
pf_ui_->setupUi(this);
|
2014-11-11 17:56:58 +00:00
|
|
|
setFlat(true);
|
2012-10-12 23:40:29 +00:00
|
|
|
|
2012-12-21 17:37:57 +00:00
|
|
|
QStyleOption style_opt;
|
|
|
|
int cb_label_offset = pf_ui_->detailsCheckBox->style()->subElementRect(QStyle::SE_CheckBoxContents, &style_opt).left();
|
2012-10-12 23:40:29 +00:00
|
|
|
setStyleSheet(QString(
|
|
|
|
"QRadioButton {"
|
|
|
|
" padding-left: %1px;"
|
|
|
|
"}"
|
2012-12-21 17:37:57 +00:00
|
|
|
).arg(cb_label_offset));
|
2012-10-12 23:40:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
PacketFormatGroupBox::~PacketFormatGroupBox()
|
|
|
|
{
|
|
|
|
delete pf_ui_;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool PacketFormatGroupBox::summaryEnabled()
|
|
|
|
{
|
|
|
|
return pf_ui_->summaryCheckBox->isChecked();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool PacketFormatGroupBox::detailsEnabled()
|
|
|
|
{
|
|
|
|
return pf_ui_->detailsCheckBox->isChecked();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool PacketFormatGroupBox::bytesEnabled()
|
|
|
|
{
|
|
|
|
return pf_ui_->bytesCheckBox->isChecked();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool PacketFormatGroupBox::allCollapsedEnabled()
|
|
|
|
{
|
|
|
|
return pf_ui_->allCollapsedButton->isChecked();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool PacketFormatGroupBox::asDisplayedEnabled()
|
|
|
|
{
|
|
|
|
return pf_ui_->asDisplayedButton->isChecked();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool PacketFormatGroupBox::allExpandedEnabled()
|
|
|
|
{
|
|
|
|
return pf_ui_->allExpandedButton->isChecked();
|
|
|
|
}
|
|
|
|
|
2015-07-07 06:24:50 +00:00
|
|
|
void PacketFormatGroupBox::on_summaryCheckBox_toggled(bool)
|
2012-10-12 23:40:29 +00:00
|
|
|
{
|
|
|
|
emit formatChanged();
|
|
|
|
}
|
|
|
|
|
|
|
|
void PacketFormatGroupBox::on_detailsCheckBox_toggled(bool checked)
|
|
|
|
{
|
|
|
|
pf_ui_->allCollapsedButton->setEnabled(checked);
|
|
|
|
pf_ui_->asDisplayedButton->setEnabled(checked);
|
|
|
|
pf_ui_->allExpandedButton->setEnabled(checked);
|
|
|
|
emit formatChanged();
|
|
|
|
}
|
|
|
|
|
2015-07-07 06:24:50 +00:00
|
|
|
void PacketFormatGroupBox::on_bytesCheckBox_toggled(bool)
|
2012-10-12 23:40:29 +00:00
|
|
|
{
|
|
|
|
emit formatChanged();
|
|
|
|
}
|
|
|
|
|
|
|
|
void PacketFormatGroupBox::on_allCollapsedButton_toggled(bool checked)
|
|
|
|
{
|
|
|
|
if (checked) emit formatChanged();
|
|
|
|
}
|
|
|
|
|
|
|
|
void PacketFormatGroupBox::on_asDisplayedButton_toggled(bool checked)
|
|
|
|
{
|
|
|
|
if (checked) emit formatChanged();
|
|
|
|
}
|
|
|
|
|
|
|
|
void PacketFormatGroupBox::on_allExpandedButton_toggled(bool checked)
|
|
|
|
{
|
|
|
|
if (checked) emit formatChanged();
|
|
|
|
}
|