diff options
Diffstat (limited to 'src/frontend/displaywindow/ccommentaryreadwindow.cpp')
-rw-r--r-- | src/frontend/displaywindow/ccommentaryreadwindow.cpp | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/src/frontend/displaywindow/ccommentaryreadwindow.cpp b/src/frontend/displaywindow/ccommentaryreadwindow.cpp index f2c2c3d..1beb5c5 100644 --- a/src/frontend/displaywindow/ccommentaryreadwindow.cpp +++ b/src/frontend/displaywindow/ccommentaryreadwindow.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. * **********/ @@ -13,25 +13,19 @@ #include <QIcon> #include <QMenu> #include <QToolBar> -#include "backend/config/cbtconfig.h" #include "backend/keys/cswordversekey.h" #include "bibletime.h" +#include "bibletimeapp.h" #include "frontend/display/cdisplay.h" #include "frontend/display/creaddisplay.h" #include "frontend/displaywindow/btactioncollection.h" #include "frontend/displaywindow/btmodulechooserbar.h" #include "frontend/keychooser/ckeychooser.h" -#include "frontend/profile/cprofilewindow.h" -#include "util/directory.h" #include "util/cresmgr.h" +#include "util/geticon.h" -using namespace Profile; - -CCommentaryReadWindow::CCommentaryReadWindow(QList<CSwordModuleInfo*> modules, CMDIArea* parent) : CLexiconReadWindow(modules, parent) { -} void CCommentaryReadWindow::insertKeyboardActions(BtActionCollection* const a) { - namespace DU = util::directory; QAction* qaction; qaction = new QAction(tr("Next book"), a); @@ -58,7 +52,7 @@ void CCommentaryReadWindow::insertKeyboardActions(BtActionCollection* const a) { qaction->setShortcut(CResMgr::displaywindows::bibleWindow::previousVerse::accel); a->addAction("previousVerse", qaction); - qaction = new QAction(QIcon(DU::getIcon(CResMgr::displaywindows::commentaryWindow::syncWindow::icon)), + qaction = new QAction(QIcon(util::getIcon(CResMgr::displaywindows::commentaryWindow::syncWindow::icon)), tr("Synchronize"), a); qaction->setCheckable(true); qaction->setShortcut(CResMgr::displaywindows::commentaryWindow::syncWindow::accel); @@ -120,19 +114,23 @@ void CCommentaryReadWindow::initActions() { m_syncButton = qaction; addAction(qaction); - CBTConfig::setupAccelSettings(CBTConfig::commentaryWindow, actionCollection()); + actionCollection()->readShortcuts("Commentary shortcuts"); } -void CCommentaryReadWindow::applyProfileSettings( CProfileWindow* profileWindow ) { - CLexiconReadWindow::applyProfileSettings(profileWindow); - if (profileWindow->windowSettings) { - m_syncButton->setChecked(true); - } +void CCommentaryReadWindow::applyProfileSettings(const QString & windowGroup) { + CLexiconReadWindow::applyProfileSettings(windowGroup); + + Q_ASSERT(windowGroup.endsWith('/')); + Q_ASSERT(m_syncButton); + m_syncButton->setChecked(btConfig().sessionValue<bool>(windowGroup + "syncEnabled", false)); } -void CCommentaryReadWindow::storeProfileSettings( CProfileWindow* profileWindow ) { - CLexiconReadWindow::storeProfileSettings(profileWindow); - profileWindow->windowSettings = m_syncButton->isChecked(); +void CCommentaryReadWindow::storeProfileSettings(const QString & windowGroup) { + CLexiconReadWindow::storeProfileSettings(windowGroup); + + Q_ASSERT(windowGroup.endsWith('/')); + Q_ASSERT(m_syncButton); + btConfig().setSessionValue(windowGroup + "syncEnabled", m_syncButton->isChecked()); } void CCommentaryReadWindow::initToolbars() { @@ -153,7 +151,7 @@ void CCommentaryReadWindow::reload(CSwordBackend::SetupChangedReason reason) { verseKey()->setLocale( CSwordBackend::instance()->booknameLanguage().toLatin1() ); keyChooser()->refreshContent(); - CBTConfig::setupAccelSettings(CBTConfig::commentaryWindow, actionCollection()); + actionCollection()->readShortcuts("Commentary shortcuts"); } /** rapper around key() to return the right type of key. */ |