BibleTime
btmodulechooserdialog.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 "btmodulechooserdialog.h"
14 
15 #include <QDialogButtonBox>
16 #include <QLabel>
17 #include <QVBoxLayout>
18 #include "../backend/drivers/cswordmoduleinfo.h" // IWYU pragma: keep for Qt con
19 #include "../util/btconnect.h"
20 #include "btaboutmoduledialog.h"
21 #include "btbookshelfview.h"
22 #include "btbookshelfwidget.h"
23 #include "messagedialog.h"
24 
25 
27  : QDialog(parent, flags)
28 {
29  QVBoxLayout *mainLayout = new QVBoxLayout;
30 
31  m_captionLabel = new QLabel(this);
32  mainLayout->addWidget(m_captionLabel);
33 
36  [this](CSwordModuleInfo * const module) {
37  auto * const dialog = new BTAboutModuleDialog(module, this);
38  dialog->setAttribute(Qt::WA_DeleteOnClose);
39  dialog->show();
40  dialog->raise();
41  });
42  mainLayout->addWidget(m_bookshelfWidget);
43 
44  m_buttonBox = new QDialogButtonBox(QDialogButtonBox::Cancel | QDialogButtonBox::Ok,
45  Qt::Horizontal, this);
46  BT_CONNECT(m_buttonBox, &QDialogButtonBox::accepted,
47  this, &BtModuleChooserDialog::accept);
48  BT_CONNECT(m_buttonBox, &QDialogButtonBox::rejected,
49  this, &BtModuleChooserDialog::reject);
50  mainLayout->addWidget(m_buttonBox);
51 
52  setLayout(mainLayout);
53 
54  retranslateUi();
55 }
56 
59 }
#define BT_CONNECT(...)
Definition: btconnect.h:20
void moduleActivated(CSwordModuleInfo *item)
BtBookshelfView * treeView() const
BtModuleChooserDialog(QWidget *parent=nullptr, Qt::WindowFlags flags=Qt::WindowFlags())
QDialogButtonBox * m_buttonBox
BtBookshelfWidget * m_bookshelfWidget
void prepareDialogBox(QDialogButtonBox *box)