BibleTime
src
frontend
edittextwizard
btplainorhtmlpage.cpp
Go to the documentation of this file.
1
/*********
2
*
3
* In the name of the Father, and of the Son, and of the Holy Spirit.
4
*
5
* This file is part of BibleTime's source code, https://bibletime.info/
6
*
7
* Copyright 1999-2025 by the BibleTime developers.
8
* The BibleTime source code is licensed under the GNU General Public License
9
* version 2.0.
10
*
11
**********/
12
13
#include "
btplainorhtmlpage.h
"
14
15
#include <QGroupBox>
16
#include <QRadioButton>
17
#include <QSizePolicy>
18
#include <QSpacerItem>
19
#include <QVBoxLayout>
20
21
22
BtPlainOrHtmlPage::BtPlainOrHtmlPage
(
QWidget
* parent)
23
:
QWizardPage
(parent)
24
{
25
m_verticalLayout
=
new
QVBoxLayout(
this
);
26
m_verticalLayout
->addItem(
27
new
QSpacerItem(20, 40, QSizePolicy::Minimum,
28
QSizePolicy::Expanding));
29
30
m_groupBox
=
new
QGroupBox(
this
);
31
32
// Setup radio buttons:
33
QVBoxLayout *
const
vLayout =
new
QVBoxLayout(
m_groupBox
);
34
m_plainTextRadioButton
=
new
QRadioButton(
m_groupBox
);
35
vLayout->addWidget(
m_plainTextRadioButton
);
36
m_htmlRadioButton
=
new
QRadioButton(
m_groupBox
);
37
m_htmlRadioButton
->setChecked(
true
);
38
vLayout->addWidget(
m_htmlRadioButton
);
39
40
m_verticalLayout
->addWidget(
m_groupBox
);
41
m_verticalLayout
->addItem(
42
new
QSpacerItem(20, 40, QSizePolicy::Minimum,
43
QSizePolicy::Expanding));
44
retranslateUi
();
45
}
46
47
bool
BtPlainOrHtmlPage::htmlMode
()
const
{
48
return
m_htmlRadioButton
->isChecked();
49
}
50
51
void
BtPlainOrHtmlPage::setHtmlMode
(
bool
html) {
52
m_plainTextRadioButton
->setChecked(!html);
53
m_htmlRadioButton
->setChecked(html);
54
}
55
56
void
BtPlainOrHtmlPage::retranslateUi
() {
57
m_plainTextRadioButton
->setText(
58
tr(
"Edit Plain text"
,
"Personal Commentary Editor"
));
59
m_htmlRadioButton
->setText(
60
tr(
"Edit HTML text"
,
"Personal Commentary Editor"
));
61
}
btplainorhtmlpage.h
BtPlainOrHtmlPage::m_htmlRadioButton
QRadioButton * m_htmlRadioButton
Definition
btplainorhtmlpage.h:41
BtPlainOrHtmlPage::BtPlainOrHtmlPage
BtPlainOrHtmlPage(QWidget *parent=nullptr)
Definition
btplainorhtmlpage.cpp:22
BtPlainOrHtmlPage::retranslateUi
void retranslateUi()
Definition
btplainorhtmlpage.cpp:56
BtPlainOrHtmlPage::m_verticalLayout
QVBoxLayout * m_verticalLayout
Definition
btplainorhtmlpage.h:43
BtPlainOrHtmlPage::setHtmlMode
void setHtmlMode(bool html)
Definition
btplainorhtmlpage.cpp:51
BtPlainOrHtmlPage::htmlMode
bool htmlMode() const
Definition
btplainorhtmlpage.cpp:47
BtPlainOrHtmlPage::m_plainTextRadioButton
QRadioButton * m_plainTextRadioButton
Definition
btplainorhtmlpage.h:40
BtPlainOrHtmlPage::m_groupBox
QGroupBox * m_groupBox
Definition
btplainorhtmlpage.h:42
QWidget
QWizardPage
Generated by
1.9.8