16 #include <QDialogButtonBox>
17 #include <QFormLayout>
20 #include <QPushButton>
21 #include <QRadioButton>
22 #include <QHBoxLayout>
23 #include <QVBoxLayout>
24 #include "../backend/keys/cswordkey.h"
25 #include "../backend/models/btmoduletextmodel.h"
26 #include "../backend/drivers/cswordmoduleinfo.h"
27 #include "../frontend/displaywindow/cdisplaywindow.h"
28 #include "../util/btassert.h"
29 #include "../util/btconnect.h"
36 std::optional<BtQmlInterface::Selection>
const & selection,
39 , m_workLabel(new QLabel(this))
41 , m_firstKeyLabel(new QLabel(this))
42 , m_lastKeyLabel(new QLabel(this))
43 , m_sizeTooLargeLabel(new QLabel(this))
44 , m_buttonBox(new QDialogButtonBox(QDialogButtonBox::Ok
45 | QDialogButtonBox::Cancel, this))
49 auto *
const vLayout =
new QVBoxLayout(
this);
51 auto *
const formLayout =
new QFormLayout();
52 formLayout->setHorizontalSpacing(15);
53 formLayout->setVerticalSpacing(15);
54 formLayout->setContentsMargins(11, 11, 11, 16);
55 vLayout->addLayout(formLayout);
59 for (
auto const *
const m : modules)
63 static_cast<void const *
>(m))));
69 auto const parentKey = parent->
key();
76 auto *
const hLayout =
new QHBoxLayout;
77 vLayout->addLayout(hLayout);
91 if (selection.has_value()) {
92 BT_ASSERT(selection->column < modules.size());
99 auto const handleKeyChanged = [
this, model]{
120 userData.value<
void *>());
124 this, &BtCopyByReferencesDialog::reject);
131 setWindowTitle(tr(
"Copy by References"));
146 bool const tooLarge =
149 m_buttonBox->button(QDialogButtonBox::Ok)->setEnabled(!tooLarge);
CKeyChooser * m_firstKeyChooser
QLabel *const m_lastKeyLabel
BtCopyByReferencesDialog(BtModuleTextModel const *model, std::optional< BtQmlInterface::Selection > const &selection, CDisplayWindow *parent)
QLabel *const m_workLabel
QComboBox *const m_workCombo
CKeyChooser * m_lastKeyChooser
QLabel *const m_firstKeyLabel
QLabel *const m_sizeTooLargeLabel
QDialogButtonBox *const m_buttonBox
Model that represents the entire text of a given module.
CSwordKey * indexToKey(int index, int moduleNum) const
int keyToIndex(CSwordKey const &key) const
The base class for all display windows of BibleTime.
BtConstModuleList constModules() const
void keyChanged(CSwordKey *newKey)
static CKeyChooser * createInstance(const BtConstModuleList &modules, CSwordKey *key, QWidget *parent)
virtual void setKey(CSwordKey *key)=0
virtual CSwordKey * key()=0
void prepareDialogBox(QDialogButtonBox *box)
CSwordModuleInfo const * module