diff options
Diffstat (limited to 'src/frontend/displaywindow/cbiblereadwindow.cpp')
-rw-r--r-- | src/frontend/displaywindow/cbiblereadwindow.cpp | 47 |
1 files changed, 26 insertions, 21 deletions
diff --git a/src/frontend/displaywindow/cbiblereadwindow.cpp b/src/frontend/displaywindow/cbiblereadwindow.cpp index 70dbd35..868dd8d 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-2009 by the BibleTime developers. +* Copyright 1999-2011 by the BibleTime developers. * The BibleTime source code is licensed under the GNU General Public License version 2.0. * **********/ @@ -46,8 +46,8 @@ CBibleReadWindow::~CBibleReadWindow() { void CBibleReadWindow::applyProfileSettings(CProfileWindow* const settings) { /** - \todo Make \ref CProfileWindow properly handle these things so we wouldn't have to mess - around with bits. + \todo Make CProfileWindow properly handle these things so we wouldn't have + to mess around with bits. */ CLexiconReadWindow::applyProfileSettings(settings); @@ -68,14 +68,17 @@ void CBibleReadWindow::applyProfileSettings(CProfileWindow* const settings) { displayOptions().lineBreaks = (result & 0x1000) != 0; displayOptions().verseNumbers = (result & 0x2000) != 0; - displaySettingsButton()->setFilterOptions(filterOptions(), false); - displaySettingsButton()->setDisplayOptions(displayOptions()); + emit sigFilterOptionsChanged(filterOptions()); + emit sigDisplayOptionsChanged(displayOptions()); + + // Apply settings to display: + lookup(); } void CBibleReadWindow::storeProfileSettings( CProfileWindow * const settings) { /** - \todo Make \ref CProfileWindow properly handle these things so we wouldn't have to mess - around with bits. + \todo Make CProfileWindow properly handle these things so we wouldn't have + to mess around with bits. */ int result = 0x0000; @@ -142,13 +145,13 @@ void CBibleReadWindow::insertKeyboardActions( BtActionCollection* const a ) { qaction->setShortcut(QKeySequence::Print); a->addAction("printChapter", qaction); -// qaction = new QAction( /* QIcon(CResMgr::displaywindows::general::findStrongs::icon), */ tr("Strong's search"), a); -// qaction->setShortcut(CResMgr::displaywindows::general::findStrongs::accel); -// qaction->setToolTip(tr("Find all occurences of the Strong number currently under the mouse cursor")); -// a->addAction(CResMgr::displaywindows::general::findStrongs::actionName, qaction); +// qaction = new QAction( /* QIcon(CResMgr::displaywindows::general::findStrongs::icon), */ tr("Strong's search"), a); +// qaction->setShortcut(CResMgr::displaywindows::general::findStrongs::accel); +// qaction->setToolTip(tr("Find all occurences of the Strong number currently under the mouse cursor")); +// a->addAction(CResMgr::displaywindows::general::findStrongs::actionName, qaction); -// qaction = new QAction(tr("Reference only"), a ); -// a->addAction("copyReferenceOnly", qaction); +// qaction = new QAction(tr("Reference only"), a ); +// a->addAction("copyReferenceOnly", qaction); qaction = new QAction(tr("Text of reference"), a); a->addAction("copyTextOfReference", qaction); @@ -364,7 +367,7 @@ void CBibleReadWindow::previousVerse() { } } -/** rapper around key() to return the right type of key. */ +/** wrapper around key() to return the right type of key. */ CSwordVerseKey* CBibleReadWindow::verseKey() { CSwordVerseKey* k = dynamic_cast<CSwordVerseKey*>(CDisplayWindow::key()); Q_ASSERT(k); @@ -380,7 +383,7 @@ void CBibleReadWindow::copyDisplayedText() { CSwordVerseKey vk(*verseKey()); vk.LowerBound(dummy); - CSwordBibleModuleInfo* bible = dynamic_cast<CSwordBibleModuleInfo*>(modules().first()); + const CSwordBibleModuleInfo* bible = dynamic_cast<const CSwordBibleModuleInfo*>(modules().first()); dummy.Verse(bible->verseCount(dummy.book(), dummy.Chapter())); vk.UpperBound(dummy); @@ -391,10 +394,8 @@ void CBibleReadWindow::copyDisplayedText() { /** Saves the chapter as valid HTML page. */ void CBibleReadWindow::saveChapterHTML() { //saves the complete chapter to disk - CSwordBibleModuleInfo* bible = dynamic_cast<CSwordBibleModuleInfo*>(modules().first()); - Q_ASSERT(bible); - if (!bible) //shouldn't happen - return; + Q_ASSERT(dynamic_cast<const CSwordBibleModuleInfo*>(modules().first()) != 0); + const CSwordBibleModuleInfo *bible = static_cast<const CSwordBibleModuleInfo*>(modules().first()); CSwordVerseKey dummy(*verseKey()); dummy.Verse(1); @@ -419,7 +420,7 @@ void CBibleReadWindow::saveChapterPlain() { dummy.Verse(1); vk.LowerBound(dummy); - CSwordBibleModuleInfo* bible = dynamic_cast<CSwordBibleModuleInfo*>(modules().first()); + const CSwordBibleModuleInfo* bible = dynamic_cast<const CSwordBibleModuleInfo*>(modules().first()); dummy.Verse(bible->verseCount(dummy.book(), dummy.Chapter())); vk.UpperBound(dummy); @@ -436,7 +437,7 @@ void CBibleReadWindow::reload(CSwordBackend::SetupChangedReason reason) { } //refresh the book lists - verseKey()->setLocale( backend()->booknameLanguage().toLatin1() ); + verseKey()->setLocale( CSwordBackend::instance()->booknameLanguage().toLatin1() ); keyChooser()->refreshContent(); CBTConfig::setupAccelSettings(CBTConfig::bibleWindow, actionCollection()); @@ -477,3 +478,7 @@ void CBibleReadWindow::syncWindows() { } } } + +void CBibleReadWindow::setupMainWindowToolBars() { + CLexiconReadWindow::setupMainWindowToolBars(); +} |