BibleTime
bibletime_slots.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-2026 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 "bibletime.h"
14
15#include <QAction>
16#include <QClipboard>
17#include <QCursor>
18#include <QDesktopServices>
19#include <QInputDialog>
20#include <QMdiSubWindow>
21#include <QMenu>
22#include <QMetaObject>
23#include <QProcess>
24#include <QtGlobal>
25#include <QTimerEvent>
26#include <QToolBar>
27#include <QUrl>
28#include "../backend/config/btconfig.h"
29#include "../backend/managers/cswordbackend.h"
30#include "../util/btassert.h"
31#include "../util/btconnect.h"
32#include "../util/directory.h"
33#include "btaboutdialog.h"
34#include "cinfodisplay.h"
35#include "cmdiarea.h"
37#include "debugwindow.h"
42#include "messagedialog.h"
44#include "tips/bttipdialog.h"
45
46
47/** Opens the optionsdialog of BibleTime. */
51 [this]{
53 btConfig().booknameLanguage());
54
55 /** \todo update the bookmarks after Bible bookname language
56 has been changed. */
57 /* for (QTreeWidgetItemIterator it = m_mainIndex; *it; ++it)
58 if (auto * citem = dynamic_cast<CIndexItemBase*>(*it))
59 citem->update(); */
60
62 QStringLiteral("Application shortcuts"));
66 });
67
68 dlg->show();
69}
70
71/** Save the settings, used when no settings have been saved before **/
74
75/** Opens the bookshelf wizard. */
78
79/** Is called just before the window menu is shown. */
82
83 const int numSubWindows = m_mdi->subWindowList().count();
84 m_actions->windows.closeWindow->setEnabled(numSubWindows);
85 m_actions->windows.closeAllWindows->setEnabled(numSubWindows);
86 m_openWindowsMenu->setEnabled(numSubWindows);
87
88 const bool enableManualArrangeActions = numSubWindows > 1;
89 m_actions->windows.tileVertically->setEnabled(enableManualArrangeActions);
90 m_actions->windows.tileHorizontally->setEnabled(enableManualArrangeActions);
91 m_actions->windows.tile->setEnabled(enableManualArrangeActions);
92 m_actions->windows.cascade->setEnabled(enableManualArrangeActions);
93}
94
95/** Is called just before the open windows menu is shown. */
98
99 m_openWindowsMenu->clear();
100 for (auto * const window : m_mdi->usableWindowList()) {
101 QAction *openWindowAction = m_openWindowsMenu->addAction(window->windowTitle());
102 openWindowAction->setCheckable(true);
103 openWindowAction->setChecked(window == m_mdi->activeSubWindow());
104 BT_CONNECT(openWindowAction, &QAction::triggered,
105 [this, window]{ slotSetActiveSubWindow(window); });
106 }
107}
108
109/** This slot is connected with the windowAutoTileAction object */
111 BT_ASSERT(trigerredAction);
112
113 auto guiConfig = btConfig().session().group(QStringLiteral("GUI"));
114 if (trigerredAction == m_actions->windows.arrangementMode.autoTileVertically) {
116 guiConfig.setValue(QStringLiteral("alignmentMode"), autoTileVertical);
117 }
118 else if (trigerredAction == m_actions->windows.arrangementMode.autoTileHorizontally) {
120 guiConfig.setValue(QStringLiteral("alignmentMode"), autoTileHorizontal);
121 }
122 else if (trigerredAction == m_actions->windows.arrangementMode.autoTile) {
124 guiConfig.setValue(QStringLiteral("alignmentMode"), autoTile);
125 }
126 else if (trigerredAction == m_actions->windows.arrangementMode.tabbed) {
128 guiConfig.setValue(QStringLiteral("alignmentMode"), autoTabbed);
129 }
130 else if (trigerredAction == m_actions->windows.arrangementMode.autoCascade) {
132 guiConfig.setValue(QStringLiteral("alignmentMode"), autoCascade);
133 }
134 else {
136 || trigerredAction == m_actions->windows.tile
137 || trigerredAction == m_actions->windows.cascade
138 || trigerredAction == m_actions->windows.tileVertically
139 || trigerredAction == m_actions->windows.tileHorizontally);
140
141 if (trigerredAction != m_actions->windows.arrangementMode.manual)
142 m_actions->windows.arrangementMode.manual->setChecked(true);
143
146 guiConfig.setValue(QStringLiteral("alignmentMode"), manual);
147
148 if (trigerredAction == m_actions->windows.tile)
149 m_mdi->myTile();
150 else if (trigerredAction == m_actions->windows.cascade)
151 m_mdi->myCascade();
152 else if (trigerredAction == m_actions->windows.tileVertically)
154 else if (trigerredAction == m_actions->windows.tileHorizontally)
156
157 return;
158 }
159
161}
162
165
168
171
174
175/** Shows/hides the toolbar */
178 auto guiConf = btConfig().session().group(QStringLiteral("GUI"));
179 bool const currentState =
180 guiConf.value<bool>(QStringLiteral("showMainToolbar"), true);
181 guiConf.setValue(QStringLiteral("showMainToolbar"), !currentState);
182 if (m_actions->view.toolbars.showMainToolbar->isChecked()) {
183 m_mainToolBar->show();
184 }
185 else {
186 m_mainToolBar->hide();
187 }
188}
189
191 auto guiConfig = btConfig().session().group(QStringLiteral("GUI"));
192 bool const currentState =
193 guiConfig.value<bool>(QStringLiteral("showTextWindowHeaders"),
194 true);
195 guiConfig.setValue(QStringLiteral("showTextWindowHeaders"), !currentState);
196 Q_EMIT toggledTextWindowHeader(!currentState);
197}
198
200 auto guiConfig = btConfig().session().group(QStringLiteral("GUI"));
201 bool const currentState =
202 guiConfig.value<bool>(QStringLiteral("showTextWindowNavigator"),
203 true);
204 guiConfig.setValue(QStringLiteral("showTextWindowNavigator"),
205 !currentState);
206 if (guiConfig.value<bool>(QStringLiteral("showToolbarsInEachWindow"), true))
207 {
208 Q_EMIT toggledTextWindowNavigator(!currentState);
209 } else {
210 m_navToolBar->setVisible(
211 guiConfig.value<bool>(
212 QStringLiteral("showTextWindowNavigator"),
213 true));
214 }
215}
216
218 auto guiConfig = btConfig().session().group(QStringLiteral("GUI"));
219 bool const currentState =
220 guiConfig.value<bool>(QStringLiteral("showTextWindowToolButtons"),
221 true);
222 guiConfig.setValue(QStringLiteral("showTextWindowToolButtons"),
223 !currentState);
224 if (guiConfig.value<bool>(QStringLiteral("showToolbarsInEachWindow"), true))
225 {
226 Q_EMIT toggledTextWindowToolButtons(!currentState);
227 } else {
228 m_toolsToolBar->setVisible(
229 guiConfig.value<bool>(
230 QStringLiteral("showTextWindowToolButtons"),
231 true));
232 }
233}
234
236 auto guiConfig = btConfig().session().group(QStringLiteral("GUI"));
237 bool const currentState =
238 guiConfig.value<bool>(
239 QStringLiteral("showTextWindowModuleSelectorButtons"),
240 true);
241 guiConfig.setValue(QStringLiteral("showTextWindowModuleSelectorButtons"),
242 !currentState);
243 if (guiConfig.value<bool>(QStringLiteral("showToolbarsInEachWindow"), true))
244 {
245 Q_EMIT toggledTextWindowModuleChooser(!currentState);
246 } else {
247 m_worksToolBar->setVisible(
248 guiConfig.value<bool>(
249 QStringLiteral("showTextWindowModuleSelectorButtons"),
250 true));
251 }
252}
253
255 auto guiConfig = btConfig().session().group(QStringLiteral("GUI"));
256 bool const currentState =
257 guiConfig.value<bool>(QStringLiteral("showToolbarsInEachWindow"),
258 true);
259 guiConfig.setValue(QStringLiteral("showToolbarsInEachWindow"),
260 !currentState);
262}
263
265 auto const guiConfig = btConfig().session().group(QStringLiteral("GUI"));
266 if (guiConfig.value<bool>(QStringLiteral("showToolbarsInEachWindow"), true))
267 {
268 // set main window widgets invisible
269 m_navToolBar->setVisible(false);
270 m_worksToolBar->setVisible(false);
271 m_toolsToolBar->setVisible(false);
272 // set state of sub window widets
274 guiConfig.value<bool>(
275 QStringLiteral("showTextWindowNavigator"),
276 true));
278 guiConfig.value<bool>(
279 QStringLiteral("showTextWindowModuleSelectorButtons"),
280 true));
282 guiConfig.value<bool>(
283 QStringLiteral("showTextWindowToolButtons"),
284 true));
285 } else {
286 // set state of main window widgets
287 m_navToolBar->setVisible(
288 guiConfig.value<bool>(
289 QStringLiteral("showTextWindowNavigator"),
290 true));
291 m_worksToolBar->setVisible(
292 guiConfig.value<bool>(
293 QStringLiteral("showTextWindowModuleSelectorButtons"),
294 true));
295 m_toolsToolBar->setVisible(
296 guiConfig.value<bool>(
297 QStringLiteral("showTextWindowToolButtons"),
298 true));
299 //set sub window widgets invisible
300 Q_EMIT toggledTextWindowNavigator(false);
301 Q_EMIT toggledTextWindowToolButtons(false);
302 Q_EMIT toggledTextWindowModuleChooser(false);
303 }
304}
305
306/** Sets the active window. */
308 if (!window)
309 return;
310 m_mdi->setActiveSubWindow(dynamic_cast<QMdiSubWindow*>(window));
311}
312
314 if (auto const * const window = m_mdi->activeSubWindow()) {
315 BT_ASSERT(dynamic_cast<CDisplayWindow *>(window->widget()));
316 auto & widget = *static_cast<CDisplayWindow const *>(window->widget());
317 openSearchDialog(widget.constModules());
318 } else {
320 }
321}
322
324 //get the modules of the open windows
325 BtConstModuleList modules;
326
327 for (auto const * const subWindow : m_mdi->subWindowList()) {
328 const CDisplayWindow * const w = dynamic_cast<CDisplayWindow*>(subWindow->widget());
329 if (w != nullptr) {
330 modules << w->constModules();
331 }
332 }
333 openSearchDialog(std::move(modules));
334}
335
336void BibleTime::slotActiveWindowChanged(QMdiSubWindow* window)
337{
338 if (window == nullptr)
339 m_findWidget->setVisible(false);
341}
342
343/* Search default Bible slot
344 * Call CSearchDialog::openDialog with only the default bible module
345 */
347 BtConstModuleList module;
348 if (auto const * const bible =
349 btConfig().getDefaultSwordModuleByType(
350 QStringLiteral("standardBible")))
351 module.append(bible);
352 openSearchDialog(std::move(module));
353}
354
357 if (url.isEmpty()) {
359 this,
360 tr("Error locating handbook!"),
361 tr("A suitable installed handbook could not be found!"));
362 return;
363 }
364 if (!QDesktopServices::openUrl(QUrl::fromLocalFile(url)))
366 this,
367 tr("Error opening handbook!"),
368 tr("The installed handbook could not be opened!"));
369}
370
372 auto url(util::directory::getHowto());
373 if (url.isEmpty()) {
375 this,
376 tr("Error locating howto!"),
377 tr("A suitable installed howto could not be found!"));
378 return;
379 }
380 if (!QDesktopServices::openUrl(QUrl::fromLocalFile(url)))
382 this,
383 tr("Error opening howto!"),
384 tr("The installed howto could not be opened!"));
385}
386
388 BtAboutDialog* dlg = new BtAboutDialog(this);
389 dlg->show();
390}
391
393 BtTipDialog* dlg = new BtTipDialog(this);
394 dlg->show();
395}
396
398 // Save main window settings:
399 auto conf = btConfig().session();
400 conf.setValue(QStringLiteral("MainWindow/geometry"), saveGeometry());
401 conf.setValue(QStringLiteral("MainWindow/state"), saveState());
402 conf.setValue(QStringLiteral("MainWindow/MDIArrangementMode"),
403 static_cast<int>(m_mdi->getMDIArrangementMode()));
404
405 conf.setValue(QStringLiteral("FindIsVisible"),
406 m_findWidget->isVisible());
407
408 QStringList windowsList;
409 for (auto const * const w : m_mdi->subWindowList(QMdiArea::StackingOrder)) {
410 CDisplayWindow * const displayWindow = dynamic_cast<CDisplayWindow*>(w->widget());
411 if (!displayWindow)
412 continue;
413
414 const QString windowKey = QString::number(windowsList.size());
415 windowsList.append(windowKey);
416 auto windowConf = conf.group(QStringLiteral("window/") + windowKey);
417 displayWindow->storeProfileSettings(windowConf);
418 }
419 conf.setValue(QStringLiteral("windowsList"), windowsList);
420}
421
423 BT_ASSERT(action);
424 QVariant keyProperty = action->property("ProfileKey");
425 BT_ASSERT(keyProperty.typeId() == QMetaType::QString);
426 BT_ASSERT(btConfig().sessionNames().contains(keyProperty.toString()));
427 loadProfile(keyProperty.toString());
428}
429
430void BibleTime::loadProfile(const QString & profileKey) {
431 auto & conf = btConfig();
432 BT_ASSERT(conf.sessionNames().contains(profileKey));
433
434 // do nothing if requested session is the current session
435 if (profileKey == conf.currentSessionKey())
436 return;
437
438 // Save old profile:
439 saveProfile();
440
441 // Close all open windows BEFORE switching profile:
442 m_mdi->closeAllSubWindows();
443
444 // Switch profile Activate profile:
445 conf.setCurrentSession(profileKey);
448}
449
452
453 // Disable updates while doing big changes:
454 setUpdatesEnabled(false);
455
456 // Close all open windows:
457 m_mdi->closeAllSubWindows();
458
459 // Reload main window settings:
460 auto const sessionConf = btConfig().session();
461 auto const mwConf = sessionConf.group(QStringLiteral("MainWindow"));
462 restoreGeometry(mwConf.value<QByteArray>(QStringLiteral("geometry")));
463 restoreState(mwConf.value<QByteArray>(QStringLiteral("state")));
464
465 /*
466 * restoreState includes visibility of child widgets, the manually added
467 * qactions (so not including bookmark, bookshelf and mag) are not restored
468 * though, so we restore their state here.
469 */
470 auto const guiConf = sessionConf.group(QStringLiteral("GUI"));
471 setQActionCheckedNoTrigger(m_actions->view.fullscreen, isFullScreen());
472 setQActionCheckedNoTrigger(
474 guiConf.value<bool>(QStringLiteral("showTextWindowHeaders"),
475 true));
476 setQActionCheckedNoTrigger(
478 guiConf.value<bool>(QStringLiteral("showMainToolbar"), true));
479 setQActionCheckedNoTrigger(
481 guiConf.value<bool>(QStringLiteral("showTextWindowNavigator"),
482 true));
483 setQActionCheckedNoTrigger(
485 guiConf.value<bool>(
486 QStringLiteral("showTextWindowModuleSelectorButtons"),
487 true));
488 setQActionCheckedNoTrigger(
490 guiConf.value<bool>(QStringLiteral("showTextWindowToolButtons"),
491 true));
492 setQActionCheckedNoTrigger(
494 guiConf.value<bool>(QStringLiteral("showToolbarsInEachWindow"),
495 true));
496
498 static_cast<CMDIArea::MDIArrangementMode>(
499 mwConf.value<int>(QStringLiteral("MDIArrangementMode"),
501
502 m_findWidget->setVisible(
503 sessionConf.value<bool>(QStringLiteral("FindIsVisible"),
504 false));
505
506 QWidget * focusWindow = nullptr;
507 struct WindowLoadStatus {
508 QStringList failedModules;
509 QList<CSwordModuleInfo *> okModules;
510 };
511 QMap<QString, WindowLoadStatus> failedWindows;
512 for (auto const & w
513 : sessionConf.value<QStringList>(QStringLiteral("windowsList")))
514 {
515 BT_ASSERT(!w.endsWith('/'));
516 auto const windowConf =
517 sessionConf.group(QStringLiteral("window/") + w);
518
519 // Try to determine window modules:
520 WindowLoadStatus wls;
521 for (auto const & moduleName
522 : windowConf.value<QStringList>(QStringLiteral("modules")))
523 {
524 if (auto * const m =
526 {
527 wls.okModules.append(m);
528 } else {
529 wls.failedModules.append(moduleName);
530 }
531 }
532
533 // Check whether the window totally failed (no modules can be loaded):
534 if (wls.okModules.isEmpty()) {
535 failedWindows.insert(w, wls);
536 continue;
537 }
538
539 // Check whether the window partially failed:
540 if (!wls.failedModules.isEmpty())
541 failedWindows.insert(w, wls);
542
543 // Try to respawn the window:
544 auto const key = windowConf.value<QString>(QStringLiteral("key"));
545 if (auto * const window = createReadDisplayWindow(wls.okModules, key)) {
546 window->applyProfileSettings(windowConf);
547 if (windowConf.value<bool>(QStringLiteral("hasFocus"), false))
548 focusWindow = window;
549 } else {
550 failedWindows.insert(w, wls);
551 }
552 }
553
554 /* This call is necessary to restore the visibility of the toolbars in the child
555 * windows, since their state is not saved automatically.
556 */
558
559 // Re-arrange MDI:
561
562 // Activate focused window:
563 if (focusWindow)
564 focusWindow->setFocus();
565
566 // Re-enable updates and repaint:
567 setUpdatesEnabled(true);
568 repaint(); /// \bug The main window (except decors) is all black without this (not even hover over toolbar buttons work)
569 raise(); /// \bug The main window would not refresh at all. A call to this function or adjustSize() seems to fix this
570
571 /// \todo For windows in failedWindows ask whether to keep the settings / close windows etc
572}
573
575 BT_ASSERT(action);
576 QVariant keyProperty = action->property("ProfileKey");
577 BT_ASSERT(keyProperty.typeId() == QMetaType::QString);
578 BT_ASSERT(btConfig().sessionNames().contains(keyProperty.toString()));
579
580 /// \todo Ask for confirmation
581 btConfig().deleteSession(keyProperty.toString());
583}
584
586 setWindowState(windowState() ^ Qt::WindowFullScreen);
588}
589
590template <bool goingUp>
593
594 static constexpr int const intervals[21] = {
595 1, 2, 3, 5, 9, 15, 25, 43, 72, 120, 200,
596 120, 72, 43, 25, 15, 9, 5, 3, 2, 1
597 };
598
599 static constexpr int const nudgeSpeed = goingUp ? 1 : -1;
600 if (m_autoScrollSpeed == 0
601 || ((m_autoScrollSpeed > 0) != goingUp // going in the opposite when
602 && !m_autoScrollTimer.isActive())) // resuming from pause
603 {
604 m_autoScrollSpeed = nudgeSpeed; // start safe at slow speed
605 m_autoScrollTimer.setInterval(intervals[m_autoScrollSpeed + 10]);
606 } else if (m_autoScrollSpeed != nudgeSpeed * 10) { // Stay in [-10, 10]
607 m_autoScrollSpeed += nudgeSpeed;
608 if (m_autoScrollSpeed == 0) {
609 m_autoScrollTimer.stop();
610 m_actions->view.scroll.pauseAutoScroll->setEnabled(false);
611 return;
612 }
613 m_autoScrollTimer.setInterval(intervals[m_autoScrollSpeed + 10]);
614 }
615
616 m_autoScrollTimer.start();
617 m_actions->view.scroll.pauseAutoScroll->setEnabled(true);
618}
619
620template void BibleTime::autoScroll<true>();
621template void BibleTime::autoScroll<false>();
622
625 return;
627 if (m_autoScrollTimer.isActive()) {
628 m_autoScrollTimer.stop();
629 } else {
630 m_autoScrollTimer.start();
631 }
632}
633
636 return false;
638 return true;
639}
640
642 m_autoScrollTimer.stop();
644 m_actions->view.scroll.pauseAutoScroll->setEnabled(false);
645}
646
648 auto * display = getCurrentDisplay();
649 if (display) {
650 display->scroll(m_autoScrollSpeed > 0 ? -1 : 1);
651 display->updateReferenceText();
652 }
653}
654
655/** Saves current settings into a new profile. */
657 BtConfig & conf = btConfig();
658
659 // Get new unique name:
660 QString name;
661 for (;;) {
662 bool ok;
663 name = QInputDialog::getText(
664 this, tr("New Session"),
665 tr("Please enter a name for the new session."),
666 QLineEdit::Normal, name, &ok);
667 if (!ok)
668 return;
669
670 if (!name.isEmpty()) {
671 // Check whether name already exists:
672 if (conf.sessionNames().values().contains(name)) {
673 message::showInformation(this, tr("Session already exists"),
674 tr("Session with the name \"%1\" "
675 "already exists. Please provide a "
676 "different name.").arg(name));
677 } else {
678 break;
679 }
680 }
681 }
682
683 // Also save old profile:
684 saveProfile();
685
686 // Save new profile:
687 conf.setCurrentSession(conf.addSession(name));
688 saveProfile();
689
690 // Refresh profile menus:
692}
693
694/** Slot to refresh the saved profile and load profile menus. */
698
699 BtConfig & conf = btConfig();
700 auto const & sessions = conf.sessionNames();
701
702 const bool enableActions = sessions.size() > 1;
703 m_windowLoadProfileMenu->setEnabled(enableActions);
704 m_windowDeleteProfileMenu->setEnabled(enableActions);
705
706
707 if (enableActions) {
708 for (auto it = sessions.constBegin(); it != sessions.constEnd(); ++it) {
709 QAction * a;
710
711 a = m_windowLoadProfileMenu->addAction(it.value());
712 a->setProperty("ProfileKey", it.key());
713 a->setActionGroup(m_windowLoadProfileActionGroup);
714 a->setCheckable(true);
715 if (it.key() == conf.currentSessionKey())
716 a->setChecked(true);
717
718 a = m_windowDeleteProfileMenu->addAction(it.value());
719 a->setProperty("ProfileKey", it.key());
720 if (it.key() == conf.currentSessionKey())
721 a->setDisabled(true);
722 }
723 }
724}
725
727 if (show) {
730 BT_CONNECT(m_debugWindow, &QObject::destroyed, m_debugWidgetAction,
731 [action=m_debugWidgetAction] { action->setChecked(false); },
732 Qt::DirectConnection);
733 } else {
734 delete m_debugWindow;
735 }
736}
#define BT_ASSERT(...)
Definition btassert.h:17
BtConfig & btConfig()
This is a shortchand for BtConfig::getInstance().
Definition btconfig.h:305
#define BT_CONNECT(...)
Definition btconnect.h:20
@ autoTabbed
Definition btglobal.h:74
@ autoTileHorizontal
Definition btglobal.h:72
@ autoCascade
Definition btglobal.h:75
@ autoTile
Definition btglobal.h:73
@ autoTileVertical
Definition btglobal.h:71
@ manual
Definition btglobal.h:76
QList< CSwordModuleInfo const * > BtConstModuleList
struct BibleTime::ActionCollection::@4 windows
struct BibleTime::ActionCollection::@2 view
struct BibleTime::ActionCollection::@2::@7 scroll
struct BibleTime::ActionCollection::@2::@6 toolbars
struct BibleTime::ActionCollection::@4::@8 arrangementMode
QAction * showToolbarsInTextWindows
Definition bibletime.h:158
void loadProfile(QAction *action)
QPointer< QWidget > m_debugWindow
Definition bibletime.h:481
BtModuleChooserBar * m_worksToolBar
Definition bibletime.h:453
void slotBookshelfWizard()
void slotOpenTipDialog()
void slotSearchModules()
void slotShowDebugWindow(bool)
int m_autoScrollSpeed
Definition bibletime.h:476
QToolBar * m_mainToolBar
Definition bibletime.h:451
QAction * m_debugWidgetAction
Definition bibletime.h:480
void slotActiveWindowChanged(QMdiSubWindow *window)
ActionCollection * m_actions
Definition bibletime.h:471
void slotSearchActiveWindow()
void deleteProfile(QAction *action)
void slotTileHorizontal()
CMDIArea * m_mdi
Definition bibletime.h:473
InfoDisplay::CInfoDisplay * m_infoDisplay
Definition bibletime.h:449
void slotUpdateWindowArrangementActions(QAction *trigerredAction)
void toggledTextWindowToolButtons(bool newState)
void slotToggleWorksToolbar()
void slotOpenAboutDialog()
void toggledTextWindowHeader(bool newState)
void openSearchDialog(BtConstModuleList modules, QString const &searchText={})
void slotSearchDefaultBible()
void slotSettingsOptions()
void slotToggleMainToolbar()
void autoScrollPause()
void slotToggleTextWindowHeader()
void showOrHideToolBars()
void setDisplayFocus()
void slotAutoScroll()
void toggledTextWindowNavigator(bool newState)
void slotOpenWindowsMenuAboutToShow()
void openOnlineHelp_Handbook()
QMenu * m_windowDeleteProfileMenu
Definition bibletime.h:467
void refreshProfileMenus()
void slotToggleToolsToolbar()
QToolBar * m_toolsToolBar
Definition bibletime.h:454
void slotToggleToolBarsInEachWindow()
void toggledTextWindowModuleChooser(bool newState)
QToolBar * m_navToolBar
Definition bibletime.h:452
BtFindWidget * m_findWidget
Definition bibletime.h:474
void saveToNewProfile()
void slotTileVertical()
BtModelViewReadDisplay * getCurrentDisplay()
void openOnlineHelp_Howto()
void slotWindowMenuAboutToShow()
QMenu * m_windowsMenu
Definition bibletime.h:461
void autoScrollStop()
void saveConfigSettings()
QMenu * m_windowLoadProfileMenu
Definition bibletime.h:465
QActionGroup * m_windowLoadProfileActionGroup
Definition bibletime.h:466
CDisplayWindow * createReadDisplayWindow(QList< CSwordModuleInfo * > modules, QString const &key)
Creates a new presenter in the MDI area according to the type of the module.
void refreshDisplayWindows() const
void slotToggleNavigatorToolbar()
QTimer m_autoScrollTimer
Definition bibletime.h:477
QMenu * m_openWindowsMenu
Definition bibletime.h:462
void slotSetActiveSubWindow(QWidget *window)
void toggleFullscreen()
bool autoScrollAnyKey()
void readShortcuts(QString const &group)
Read shortcuts from config.
The Bookshelf Manager wizard.
BtConfigCore group(Prefix &&prefix) const &
T value(QString const &key, T const &defaultValue=T()) const
Returns the settings value for the given global key.
void setValue(QString const &key, T const &value)
Sets a value for a key.
void signalSettingsChanged()
BtConfigCore session() const
Definition btconfig.cpp:212
QString addSession(const QString &name)
Creates a new session with the given name.
Definition btconfig.cpp:176
QString const & currentSessionKey() const
Definition btconfig.h:66
void setCurrentSession(const QString &key)
Notifies the configuration system that the session settings should be read from and saved to the give...
Definition btconfig.cpp:168
QHash< QString, QString > sessionNames() const
Definition btconfig.h:78
void deleteSession(const QString &key)
Deletes the session with the given key.
Definition btconfig.cpp:204
The base class for all display windows of BibleTime.
virtual void storeProfileSettings(BtConfigCore &windowConf) const
Stores the settings of this window to configuration.
BtConstModuleList constModules() const
MDIArrangementMode
Definition cmdiarea.h:41
@ ArrangementModeTileVertical
Definition cmdiarea.h:42
@ ArrangementModeCascade
Definition cmdiarea.h:44
@ ArrangementModeManual
Definition cmdiarea.h:45
@ ArrangementModeTabbed
Definition cmdiarea.h:47
@ ArrangementModeTileHorizontal
Definition cmdiarea.h:43
@ ArrangementModeTile
Definition cmdiarea.h:46
void myCascade()
Definition cmdiarea.cpp:277
void myTileVertical()
Definition cmdiarea.cpp:154
void setMDIArrangementMode(const MDIArrangementMode mode)
Definition cmdiarea.cpp:134
void enableWindowMinMaxFlags(bool enable)
Definition cmdiarea.cpp:438
void triggerWindowUpdate()
Definition cmdiarea.cpp:417
void myTile()
Definition cmdiarea.cpp:222
QList< QMdiSubWindow * > usableWindowList() const
Definition cmdiarea.cpp:332
void myTileHorizontal()
Definition cmdiarea.cpp:188
MDIArrangementMode getMDIArrangementMode() const
Definition cmdiarea.h:75
CSwordModuleInfo * findModuleByName(const QString &name) const
Searches for a module with the given name.
static CSwordBackend & instance() noexcept
void setBooknameLanguage(QString const &langName)
Sets the language for the international booknames of Sword.
void setQActionCheckedNoTrigger(QAction *const action, const bool checked)
QMessageBox::StandardButton showInformation(QWidget *parent, const QString &title, const QString &text, QMessageBox::StandardButtons buttons, QMessageBox::StandardButton defaultButton)
QMessageBox::StandardButton showCritical(QWidget *parent, const QString &title, const QString &text, QMessageBox::StandardButtons buttons, QMessageBox::StandardButton defaultButton)
QString getHandbook()
QString getHowto()