summaryrefslogtreecommitdiff
path: root/src/frontend/displaywindow/cbiblereadwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/frontend/displaywindow/cbiblereadwindow.cpp')
-rw-r--r--src/frontend/displaywindow/cbiblereadwindow.cpp91
1 files changed, 24 insertions, 67 deletions
diff --git a/src/frontend/displaywindow/cbiblereadwindow.cpp b/src/frontend/displaywindow/cbiblereadwindow.cpp
index aa6ae6b..4d88f13 100644
--- a/src/frontend/displaywindow/cbiblereadwindow.cpp
+++ b/src/frontend/displaywindow/cbiblereadwindow.cpp
@@ -2,7 +2,7 @@
*
* This file is part of BibleTime's source code, http://www.bibletime.info/.
*
-* Copyright 1999-2011 by the BibleTime developers.
+* Copyright 1999-2014 by the BibleTime developers.
* The BibleTime source code is licensed under the GNU General Public License version 2.0.
*
**********/
@@ -16,7 +16,6 @@
#include <QMenu>
#include <QTimer>
#include <QWidget>
-#include "backend/config/cbtconfig.h"
#include "backend/drivers/cswordbiblemoduleinfo.h"
#include "backend/keys/cswordversekey.h"
#include "frontend/cexportmanager.h"
@@ -26,44 +25,19 @@
#include "frontend/displaywindow/ccommentaryreadwindow.h"
#include "frontend/displaywindow/btdisplaysettingsbutton.h"
#include "frontend/keychooser/ckeychooser.h"
-#include "frontend/profile/cprofilewindow.h"
#include "util/directory.h"
#include "util/cresmgr.h"
#include "util/tool.h"
-using namespace Profile;
+void CBibleReadWindow::applyProfileSettings(const QString & windowGroup) {
+ CLexiconReadWindow::applyProfileSettings(windowGroup);
-CBibleReadWindow::CBibleReadWindow(QList<CSwordModuleInfo*> moduleList, CMDIArea* parent)
- : CLexiconReadWindow(moduleList, parent) {
-}
-
-CBibleReadWindow::~CBibleReadWindow() {
-}
-
-void CBibleReadWindow::applyProfileSettings(CProfileWindow* const settings) {
- /**
- \todo Make CProfileWindow properly handle these things so we wouldn't have
- to mess around with bits.
- */
- CLexiconReadWindow::applyProfileSettings(settings);
-
- int result = settings->windowSettings;
-
- filterOptions().footnotes = (result & 0x0001) != 0;
- filterOptions().strongNumbers = (result & 0x0002) != 0;
- filterOptions().headings = (result & 0x0004) != 0;
- filterOptions().morphTags = (result & 0x0008) != 0;
- filterOptions().lemmas = (result & 0x0010) != 0;
- filterOptions().hebrewPoints = (result & 0x0020) != 0;
- filterOptions().hebrewCantillation = (result & 0x0040) != 0;
- filterOptions().greekAccents = (result & 0x0080) != 0;
- filterOptions().textualVariants = (result & 0x0100) != 0;
- filterOptions().redLetterWords = (result & 0x0200) != 0;
- filterOptions().scriptureReferences = (result & 0x0400) != 0;
- filterOptions().morphSegmentation = (result & 0x0800) != 0;
- displayOptions().lineBreaks = (result & 0x1000) != 0;
- displayOptions().verseNumbers = (result & 0x2000) != 0;
+ BtConfig & conf = btConfig();
+ conf.beginGroup(windowGroup);
+ filterOptions() = conf.getFilterOptions();
+ displayOptions() = conf.getDisplayOptions();
+ conf.endGroup();
emit sigFilterOptionsChanged(filterOptions());
emit sigDisplayOptionsChanged(displayOptions());
@@ -72,31 +46,14 @@ void CBibleReadWindow::applyProfileSettings(CProfileWindow* const settings) {
lookup();
}
-void CBibleReadWindow::storeProfileSettings( CProfileWindow * const settings) {
- /**
- \todo Make CProfileWindow properly handle these things so we wouldn't have
- to mess around with bits.
- */
-
- int result = 0x0000;
- if (filterOptions().footnotes) result |= 0x0001;
- if (filterOptions().strongNumbers) result |= 0x0002;
- if (filterOptions().headings) result |= 0x0004;
- if (filterOptions().morphTags) result |= 0x0008;
- if (filterOptions().lemmas) result |= 0x0010;
- if (filterOptions().hebrewPoints) result |= 0x0020;
- if (filterOptions().hebrewCantillation) result |= 0x0040;
- if (filterOptions().greekAccents) result |= 0x0080;
- if (filterOptions().textualVariants) result |= 0x0100;
- if (filterOptions().redLetterWords) result |= 0x0200;
- if (filterOptions().scriptureReferences) result |= 0x0400;
- if (filterOptions().morphSegmentation) result |= 0x0800;
- if (displayOptions().lineBreaks) result |= 0x1000;
- if (displayOptions().verseNumbers) result |= 0x2000;
-
- settings->windowSettings = result;
-
- CLexiconReadWindow::storeProfileSettings(settings);
+void CBibleReadWindow::storeProfileSettings(const QString & windowGroup) {
+ BtConfig & conf = btConfig();
+ conf.beginGroup(windowGroup);
+ conf.setFilterOptions(filterOptions());
+ conf.setDisplayOptions(displayOptions());
+ conf.endGroup();
+
+ CLexiconReadWindow::storeProfileSettings(windowGroup);
}
@@ -274,7 +231,7 @@ void CBibleReadWindow::initActions() {
this, SLOT(printAll()));
addAction(m_actions.print.chapter);
- CBTConfig::setupAccelSettings(CBTConfig::bibleWindow, ac);
+ ac->readShortcuts("Bible shortcuts");
}
void CBibleReadWindow::initConnections() {
@@ -405,11 +362,11 @@ void CBibleReadWindow::copyDisplayedText() {
dummy.setVerse(1);
CSwordVerseKey vk(*verseKey());
- vk.LowerBound(dummy);
+ vk.setLowerBound(dummy);
const CSwordBibleModuleInfo* bible = dynamic_cast<const CSwordBibleModuleInfo*>(modules().first());
dummy.setVerse(bible->verseCount(dummy.book(), dummy.getChapter()));
- vk.UpperBound(dummy);
+ vk.setUpperBound(dummy);
CExportManager mgr(false, tr("Copying"), filterOptions(), displayOptions());
mgr.copyKey(&vk, CExportManager::Text, true);
@@ -425,10 +382,10 @@ void CBibleReadWindow::saveChapterHTML() {
dummy.setVerse(1);
CSwordVerseKey vk(*verseKey());
- vk.LowerBound(dummy);
+ vk.setLowerBound(dummy);
dummy.setVerse(bible->verseCount(dummy.book(), dummy.getChapter()));
- vk.UpperBound(dummy);
+ vk.setUpperBound(dummy);
CExportManager mgr(true, tr("Saving"), filterOptions(), displayOptions());
mgr.saveKey(&vk, CExportManager::HTML, true);
@@ -442,11 +399,11 @@ void CBibleReadWindow::saveChapterPlain() {
CSwordVerseKey dummy(*verseKey());
dummy.setVerse(1);
- vk.LowerBound(dummy);
+ vk.setLowerBound(dummy);
const CSwordBibleModuleInfo* bible = dynamic_cast<const CSwordBibleModuleInfo*>(modules().first());
dummy.setVerse(bible->verseCount(dummy.book(), dummy.getChapter()));
- vk.UpperBound(dummy);
+ vk.setUpperBound(dummy);
CExportManager mgr(true, tr("Saving"), filterOptions(), displayOptions());
mgr.saveKey(&vk, CExportManager::Text, true);
@@ -464,7 +421,7 @@ void CBibleReadWindow::reload(CSwordBackend::SetupChangedReason reason) {
verseKey()->setLocale( CSwordBackend::instance()->booknameLanguage().toLatin1() );
keyChooser()->refreshContent();
- CBTConfig::setupAccelSettings(CBTConfig::bibleWindow, actionCollection());
+ actionCollection()->readShortcuts("Bible shortcuts");
}
/** No descriptions */