1 /* packet_format_group_box.cpp
3 * Wireshark - Network traffic analyzer
4 * By Gerald Combs <gerald@wireshark.org>
5 * Copyright 1998 Gerald Combs
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 #include "packet_format_group_box.h"
23 #include <ui_packet_format_group_box.h>
27 PacketFormatGroupBox::PacketFormatGroupBox(QWidget *parent) :
29 pf_ui_(new Ui::PacketFormatGroupBox)
31 pf_ui_->setupUi(this);
34 QStyleOption style_opt;
35 int cb_label_offset = pf_ui_->detailsCheckBox->style()->subElementRect(QStyle::SE_CheckBoxContents, &style_opt).left();
36 setStyleSheet(QString(
38 " padding-left: %1px;"
40 ).arg(cb_label_offset));
43 PacketFormatGroupBox::~PacketFormatGroupBox()
48 bool PacketFormatGroupBox::summaryEnabled()
50 return pf_ui_->summaryCheckBox->isChecked();
53 bool PacketFormatGroupBox::detailsEnabled()
55 return pf_ui_->detailsCheckBox->isChecked();
58 bool PacketFormatGroupBox::bytesEnabled()
60 return pf_ui_->bytesCheckBox->isChecked();
63 bool PacketFormatGroupBox::allCollapsedEnabled()
65 return pf_ui_->allCollapsedButton->isChecked();
68 bool PacketFormatGroupBox::asDisplayedEnabled()
70 return pf_ui_->asDisplayedButton->isChecked();
73 bool PacketFormatGroupBox::allExpandedEnabled()
75 return pf_ui_->allExpandedButton->isChecked();
78 void PacketFormatGroupBox::on_summaryCheckBox_toggled(bool)
83 void PacketFormatGroupBox::on_detailsCheckBox_toggled(bool checked)
85 pf_ui_->allCollapsedButton->setEnabled(checked);
86 pf_ui_->asDisplayedButton->setEnabled(checked);
87 pf_ui_->allExpandedButton->setEnabled(checked);
91 void PacketFormatGroupBox::on_bytesCheckBox_toggled(bool)
96 void PacketFormatGroupBox::on_allCollapsedButton_toggled(bool checked)
98 if (checked) emit formatChanged();
101 void PacketFormatGroupBox::on_asDisplayedButton_toggled(bool checked)
103 if (checked) emit formatChanged();
106 void PacketFormatGroupBox::on_allExpandedButton_toggled(bool checked)
108 if (checked) emit formatChanged();