summaryrefslogtreecommitdiff
path: root/src/frontend/displaywindow/cbookreadwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/frontend/displaywindow/cbookreadwindow.cpp')
-rw-r--r--src/frontend/displaywindow/cbookreadwindow.cpp67
1 files changed, 22 insertions, 45 deletions
diff --git a/src/frontend/displaywindow/cbookreadwindow.cpp b/src/frontend/displaywindow/cbookreadwindow.cpp
index 657238f..40f737d 100644
--- a/src/frontend/displaywindow/cbookreadwindow.cpp
+++ b/src/frontend/displaywindow/cbookreadwindow.cpp
@@ -2,27 +2,21 @@
*
* This file is part of BibleTime's source code, http://www.bibletime.info/.
*
-* Copyright 1999-2008 by the BibleTime developers.
+* Copyright 1999-2009 by the BibleTime developers.
* The BibleTime source code is licensed under the GNU General Public License version 2.0.
*
**********/
-
-
#include "cbookreadwindow.h"
#include "bttoolbarpopupaction.h"
#include "btactioncollection.h"
-
#include "cmodulechooserbar.h"
#include "cbuttons.h"
-
#include "backend/keys/cswordtreekey.h"
-
#include "frontend/display/cdisplay.h"
#include "frontend/keychooser/cbooktreechooser.h"
#include "frontend/profile/cprofilewindow.h"
#include "backend/config/cbtconfig.h"
-
#include "util/ctoolclass.h"
#include "util/cresmgr.h"
@@ -33,9 +27,14 @@
using namespace Profile;
-CBookReadWindow::CBookReadWindow(QList<CSwordModuleInfo*> modules, CMDIArea* parent) : CLexiconReadWindow(modules, parent) {}
+CBookReadWindow::CBookReadWindow(QList<CSwordModuleInfo*> modules, CMDIArea* parent)
+ : CLexiconReadWindow(modules, parent), m_treeAction(0), m_treeChooser(0)
+{
+}
-CBookReadWindow::~CBookReadWindow() {}
+CBookReadWindow::~CBookReadWindow()
+{
+}
void CBookReadWindow::applyProfileSettings( CProfileWindow* profileWindow )
{
@@ -59,50 +58,30 @@ void CBookReadWindow::initActions()
{
CLexiconReadWindow::initActions();
BtActionCollection* ac = actionCollection();
+ insertKeyboardActions(ac);
+
//cleanup, not a clean oo-solution
Q_ASSERT(ac->action("nextEntry"));
Q_ASSERT(ac->action("previousEntry"));
ac->action("nextEntry")->setEnabled(false);
ac->action("previousEntry")->setEnabled(false);
- m_treeAction = new QAction(
- QIcon(CResMgr::displaywindows::bookWindow::toggleTree::icon),
- tr("Toggle tree view"),
- ac
- );
- m_treeAction->setCheckable(true);
- m_treeAction->setShortcut(CResMgr::displaywindows::bookWindow::toggleTree::accel);
+ m_treeAction = ac->action("toggleTree");
QObject::connect(m_treeAction, SIGNAL(triggered()), this, SLOT(treeToggled()) );
- ac->addAction("toggleTree", m_treeAction);
+ addAction(m_treeAction);
-// CBTConfig::setupAccelSettings(CBTConfig::bookWindow, ac);
+ CBTConfig::setupAccelSettings(CBTConfig::bookWindow, ac);
}
void CBookReadWindow::insertKeyboardActions( BtActionCollection* const a )
{
QAction* qaction;
- qaction = new QAction(
- QIcon(CResMgr::displaywindows::bookWindow::toggleTree::icon),
- tr("Toggle tree view"),
- a
- );
+ qaction = new QAction( /* QIcon(CResMgr::displaywindows::bookWindow::toggleTree::icon), */
+ tr("Toggle tree view"), a);
qaction->setCheckable(true);
qaction->setShortcut(CResMgr::displaywindows::bookWindow::toggleTree::accel);
a->addAction("toggleTree", qaction);
-
- // new QAction(tr("Copy reference only"), KShortcut(0), a, "copyReferenceOnly");
- qaction = new QAction(tr("Copy entry with text"), a);
- a->addAction("copyEntryWithText", qaction);
- // new QAction(tr("Copy selected text"), KShortcut(0), a, "copySelectedText");
- qaction = new QAction(tr("Save entry as plain text"), a);
- a->addAction("saveEntryAsPlainText", qaction);
- qaction = new QAction(tr("Save entry as HTML"),a);
- a->addAction("saveEntryAsHTML", qaction);
- // new QAction(tr("Print reference only"), KShortcut(0), a, "printReferenceOnly");
- qaction = new QAction(tr("Print entry with text"), a);
- a->addAction("printEntryWithText", qaction);
-
}
/** No descriptions */
@@ -122,7 +101,6 @@ void CBookReadWindow::initView()
setMainToolBar( new QToolBar(this) );
addToolBar(mainToolBar());
- //addDockWindow(mainToolBar());
m_treeChooser = new CBookTreeChooser(modules(), key(), splitter);
setDisplayWidget( CDisplay::createReadInstance(this, splitter) );
@@ -132,15 +110,12 @@ void CBookReadWindow::initView()
setModuleChooserBar( new CModuleChooserBar(modules(), modules().first()->type(), this) );
moduleChooserBar()->setButtonLimit(1);
addToolBar(moduleChooserBar());
- //addDockWindow( moduleChooserBar() );
setButtonsToolBar( new QToolBar(this) );
- //addDockWindow( buttonsToolBar() );
setDisplaySettingsButton( new CDisplaySettingsButton( &displayOptions(), &filterOptions(), modules(), buttonsToolBar()) );
addToolBar(buttonsToolBar());
m_treeChooser->hide();
- //splitter->setResizeMode(m_treeChooser, QSplitter::Stretch);
setCentralWidget( splitter );
setWindowIcon(CToolClass::getIconForModule(modules().first()));
}
@@ -165,16 +140,13 @@ void CBookReadWindow::initToolbars()
if (action) {
buttonsToolBar()->addAction(action);
}
-
- //#if KDE_VERSION_MINOR < 1
- //action->plugAccel( accel() );
- //#endif
}
/** Is called when the action was executed to toggle the tree view. */
void CBookReadWindow::treeToggled()
{
- if (m_treeAction->isChecked()) {
+ if (m_treeAction->isChecked())
+ {
m_treeChooser->show();
}
else {
@@ -193,3 +165,8 @@ void CBookReadWindow::setupPopupMenu()
{
CLexiconReadWindow::setupPopupMenu();
}
+
+void CBookReadWindow::reload(CSwordBackend::SetupChangedReason reason)
+{
+ CLexiconReadWindow::reload(reason);
+}