BibleTime
btaboutmoduledialog.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 <QDialog>
14 #include <QDialogButtonBox>
15 #include <QTextEdit>
16 #include <QVBoxLayout>
17 #include "../backend/drivers/cswordmoduleinfo.h"
18 #include "../util/btconnect.h"
19 #include "btaboutmoduledialog.h"
20 #include "messagedialog.h"
21 
22 
24  QWidget *parent,
25  Qt::WindowFlags flags)
26  : QDialog(parent, flags)
27  , m_moduleInfo(moduleInfo)
28 {
29  resize(650, 400);
30  QVBoxLayout* vboxLayout = new QVBoxLayout(this);
31 
32  m_textEdit = new QTextEdit(this);
33  m_textEdit->setReadOnly(true);
34  m_textEdit->setTextInteractionFlags(Qt::TextSelectableByMouse);
35  vboxLayout->addWidget(m_textEdit);
36 
37  m_buttons = new QDialogButtonBox(QDialogButtonBox::Close, Qt::Horizontal, this);
38  BT_CONNECT(m_buttons, &QDialogButtonBox::rejected,
39  this, &BTAboutModuleDialog::reject);
40  vboxLayout->addWidget(m_buttons);
41 
42  retranslateUi();
43 
44  BT_CONNECT(moduleInfo, &QObject::destroyed,
45  this, &BTAboutModuleDialog::close);
46 }
47 
49  setWindowTitle(tr("Information About %1").arg(m_moduleInfo->name()));
50  m_textEdit->setHtml(m_moduleInfo->aboutText());
52 }
#define BT_CONNECT(...)
Definition: btconnect.h:20
const CSwordModuleInfo * m_moduleInfo
BTAboutModuleDialog(const CSwordModuleInfo *moduleInfo, QWidget *parent=nullptr, Qt::WindowFlags flags=Qt::WindowFlags())
QDialogButtonBox * m_buttons
QString aboutText() const
QString const & name() const
void prepareDialogBox(QDialogButtonBox *box)