BibleTime
btwelcomedialog.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-2021 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 "btwelcomedialog.h"
14 
15 #include <QDialogButtonBox>
16 #include <QFlags>
17 #include <QFont>
18 #include <QLabel>
19 #include <QPushButton>
20 #include <QVBoxLayout>
21 #include "../../util/btconnect.h"
22 #include "../../util/bticons.h"
23 #include "../../util/cresmgr.h"
24 
25 
26 BtWelcomeDialog::BtWelcomeDialog(QWidget *parent, Qt::WindowFlags wflags)
27  : QDialog(parent, wflags)
28 {
29  setWindowModality(Qt::ApplicationModal);
30  setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
31  setWindowIcon(CResMgr::mainMenu::help::tipOfTheDay::icon());
32  resize(560, 300);
33 
34  QVBoxLayout * mainLayout = new QVBoxLayout(this);
35 
36  m_iconLabel = new QLabel(this);
37  m_iconLabel->setPixmap(BtIcons::instance().icon_bibletime.pixmap(48));
38  mainLayout->addWidget(m_iconLabel, 0, Qt::AlignHCenter);
39 
40  m_label = new QLabel(this);
41  m_label->setWordWrap(true);
42  mainLayout->addWidget(m_label);
43 
44  mainLayout->addStretch();
45 
46  m_buttonBox = new QDialogButtonBox(Qt::Horizontal, this);
47 
48  m_installButton = m_buttonBox->addButton(QString(),
49  QDialogButtonBox::AcceptRole);
50 
51  m_laterButton = m_buttonBox->addButton(QString(),
52  QDialogButtonBox::RejectRole);
53 
54  mainLayout->addWidget(m_buttonBox);
55 
56  setLayout(mainLayout);
57 
58  retranslateUi();
59 
60  BT_CONNECT(m_buttonBox, &QDialogButtonBox::rejected,
61  this, &BtWelcomeDialog::reject);
62  BT_CONNECT(m_buttonBox, &QDialogButtonBox::accepted,
63  this, &BtWelcomeDialog::accept);
64 }
65 
67  setWindowTitle(tr("Welcome to BibleTime"));
68 
69  m_label->setText(
70  QStringLiteral("<p>%1</p><p>%2</p><p>%3</p>")
71  .arg(tr("BibleTime is an easy to use but powerful Bible "
72  "study tool."))
73  .arg(tr("Before you can use this application some works "
74  "must be installed. Various works such as Bibles, "
75  "books, commentaries, and lexicons are available "
76  "from remote libraries."))
77  .arg(tr("Choose the \"Install works\" button to download "
78  "works. The menu \"Settings > Bookshelf Manager\" "
79  "also installs works and can be used later.")));
80 
81  m_laterButton->setText(tr("Install later"));
82 
83  m_installButton->setText(
84  QStringLiteral(" %1 ").arg(tr("Install works...")));
85 
86  QFont font(m_installButton->font());
87  font.setBold(true);
88  m_installButton->setFont(font);
89 }
#define BT_CONNECT(...)
Definition: btconnect.h:20
static BtIcons & instance()
Definition: bticons.h:44
QLabel * m_iconLabel
QDialogButtonBox * m_buttonBox
BtWelcomeDialog(QWidget *parent=nullptr, Qt::WindowFlags wflags=Qt::Dialog)
QPushButton * m_laterButton
QPushButton * m_installButton