17 #include <QMdiSubWindow>
21 #include "../../backend/drivers/cswordbiblemoduleinfo.h"
22 #include "../../backend/keys/cswordversekey.h"
23 #include "../../backend/managers/cswordbackend.h"
24 #include "../../util/btassert.h"
25 #include "../../util/btconnect.h"
26 #include "../../util/cresmgr.h"
27 #include "../cexportmanager.h"
28 #include "../cmdiarea.h"
29 #include "../display/btmodelviewreaddisplay.h"
30 #include "../keychooser/ckeychooser.h"
59 qaction =
new QAction(tr(
"Next book"), a);
61 a->
addAction(QStringLiteral(
"nextBook"), qaction);
63 qaction =
new QAction(tr(
"Previous book"), a);
65 a->
addAction(QStringLiteral(
"previousBook"), qaction);
67 qaction =
new QAction(tr(
"Next chapter"), a);
69 a->
addAction(QStringLiteral(
"nextChapter"), qaction);
71 qaction =
new QAction(tr(
"Previous chapter"), a);
73 a->
addAction(QStringLiteral(
"previousChapter"), qaction);
75 qaction =
new QAction(tr(
"Next verse"), a);
77 a->
addAction(QStringLiteral(
"nextVerse"), qaction);
79 qaction =
new QAction(tr(
"Previous verse"), a);
81 a->
addAction(QStringLiteral(
"previousVerse"), qaction);
84 qaction =
new QAction(tr(
"Copy chapter"), a);
85 a->
addAction(QStringLiteral(
"copyChapter"), qaction);
87 qaction =
new QAction(tr(
"Save chapter as plain text"), a);
88 a->
addAction(QStringLiteral(
"saveChapterAsPlainText"), qaction);
90 qaction =
new QAction(tr(
"Save chapter as HTML"), a);
91 a->
addAction(QStringLiteral(
"saveChapterAsHTML"), qaction);
93 qaction =
new QAction(tr(
"Print chapter"), a);
94 qaction->setShortcut(QKeySequence::Print);
95 a->
addAction(QStringLiteral(
"printChapter"), qaction);
105 qaction =
new QAction(tr(
"Text of reference"), a);
106 a->
addAction(QStringLiteral(
"copyTextOfReference"), qaction);
108 qaction =
new QAction(tr(
"Reference with text"), a);
109 a->
addAction(QStringLiteral(
"copyReferenceWithText"), qaction);
111 qaction =
new QAction(tr(
"Reference with text"), a);
112 a->
addAction(QStringLiteral(
"printReferenceWithText"), qaction);
114 qaction =
new QAction(tr(
"Reference with text"), a);
115 a->
addAction(QStringLiteral(
"saveReferenceWithText"), qaction);
147 &ac->
action(QStringLiteral(
"copyReferenceOnly"));
165 &ac->
action(QStringLiteral(
"copySelectedText"));
168 &ac->
action(QStringLiteral(
"copyByReferences"));
199 auto *
const popupMenu =
new QMenu(
this);
204 !display.getCurrentNodeInfo().isNull());
206 bool const hasActiveAnchor = display.hasActiveAnchor();
207 m_actions.copy.referenceOnly->setEnabled(hasActiveAnchor);
208 m_actions.copy.referenceTextOnly->setEnabled(
210 m_actions.copy.referenceAndText->setEnabled(
213 m_actions.save.referenceAndText->setEnabled(
216 m_actions.print.reference->setEnabled(hasActiveAnchor);
220 popupMenu->setTitle(tr(
"Bible window"));
222 popupMenu->addAction(
m_actions.findText);
223 QKeySequence ks =
m_actions.findText->shortcut();
224 QString keys = ks.toString();
225 popupMenu->addAction(
m_actions.findStrongs);
227 popupMenu->addSeparator();
355 mgr.
saveKey(&vk, format,
true, constMods);
380 for (
auto *
const subWindow :
mdi()->subWindowList()) {
void readShortcuts(QString const &group)
Read shortcuts from config.
void addAction(QString const &name, QAction *const action)
QAction & action(QString const &name) const
static void storeFilterOptionsToGroup(FilterOptions const &options, BtConfigCore &group)
Saves the current filter options.
static FilterOptions loadFilterOptionsFromGroup(BtConfigCore const &group)
static DisplayOptions loadDisplayOptionsFromGroup(BtConfigCore const &group)
static void storeDisplayOptionsToGroup(DisplayOptions const &options, BtConfigCore &group)
Saves the current display options.
void saveAnchorWithText()
void copyAnchorTextOnly()
void copyAnchorWithText()
void saveChapter(CExportManager::Format const format)
void applyProfileSettings(BtConfigCore const &windowConf) override
Loads the settings of this window from configuration.
void lookupSwordKey(CSwordKey *newKey) override
static void insertKeyboardActions(BtActionCollection *const a)
void initActions() override
void copyDisplayedText() override
void storeProfileSettings(BtConfigCore &windowConf) const override
Stores the settings of this window to configuration.
CSwordVerseKey * verseKey()
struct CBibleReadWindow::@1 m_actions
QMenu * newDisplayWidgetPopupMenu() override
The base class for all display windows of BibleTime.
DisplayOptions const & displayOptions() const
void sigDisplayOptionsChanged(const DisplayOptions &displayOptions)
void printAnchorWithText()
QAction & initAddAction(Args &&... args)
CKeyChooser * keyChooser() const
virtual void storeProfileSettings(BtConfigCore &windowConf) const
Stores the settings of this window to configuration.
BtActionCollection * actionCollection() const
void setDisplayOptions(DisplayOptions const &v)
void sigFilterOptionsChanged(const FilterOptions &filterOptions)
virtual void initActions()
FilterOptions const & filterOptions() const
virtual void lookupSwordKey(CSwordKey *)
void lookupKey(QString const &key)
void setFilterOptions(FilterOptions const &v)
BtConstModuleList constModules() const
virtual bool syncAllowed() const
BtModelViewReadDisplay * displayWidget() const
virtual void applyProfileSettings(BtConfigCore const &windowConf)
Loads the settings of this window from configuration.
CSwordModuleInfo const * firstModule() const noexcept
CSwordKey * getMouseClickedKey() const
bool saveKey(CSwordKey const *const key, Format const format, bool const addText, const BtConstModuleList &modules)
bool copyKey(CSwordKey const *const key, Format const format, bool const addText)
virtual void setKey(CSwordKey *key)=0
virtual void refreshContent()=0
static CSwordBackend & instance() noexcept
Implementation for Sword Bibles.
virtual QString key() const =0
CSwordKey implementation for Sword's VerseKey.
void setLowerBound(CSwordVerseKey const &bound)
void setLocale(char const *const locale)
void setUpperBound(CSwordVerseKey const &bound)