|
|
|
@ -99,19 +99,19 @@ BookReader::BookReader()
|
|
|
|
|
// automatically save settings if changed: window size, toolbar
|
|
|
|
|
// position, icon size, etc. Also to add actions for the statusbar
|
|
|
|
|
// toolbar, and keybindings if necessary.
|
|
|
|
|
KStdAction::keyBindings(guiFactory(), TQT_SLOT(configureShortcuts()), actionCollection());
|
|
|
|
|
KStdAction::keyBindings(guiFactory(), TQ_SLOT(configureShortcuts()), actionCollection());
|
|
|
|
|
createStandardStatusBarAction();
|
|
|
|
|
setStandardToolBarMenuEnabled( true );
|
|
|
|
|
KStdAction::configureToolbars(this, TQT_SLOT(configureToolbars() ), actionCollection());
|
|
|
|
|
KStdAction::configureToolbars(this, TQ_SLOT(configureToolbars() ), actionCollection());
|
|
|
|
|
createGUI(TQString(), false);
|
|
|
|
|
initialGeometrySet();
|
|
|
|
|
setAutoSaveSettings();
|
|
|
|
|
|
|
|
|
|
// allow the view to change the statusbar and caption
|
|
|
|
|
connect(m_view, TQT_SIGNAL(signalChangeStatusbar(const TQString&)),
|
|
|
|
|
this, TQT_SLOT(changeStatusbar(const TQString&)));
|
|
|
|
|
connect(m_view, TQT_SIGNAL(signalChangeCaption(const TQString&)),
|
|
|
|
|
this, TQT_SLOT(changeCaption(const TQString&)));
|
|
|
|
|
connect(m_view, TQ_SIGNAL(signalChangeStatusbar(const TQString&)),
|
|
|
|
|
this, TQ_SLOT(changeStatusbar(const TQString&)));
|
|
|
|
|
connect(m_view, TQ_SIGNAL(signalChangeCaption(const TQString&)),
|
|
|
|
|
this, TQ_SLOT(changeCaption(const TQString&)));
|
|
|
|
|
|
|
|
|
|
readSettings();
|
|
|
|
|
m_splash->finish(m_view);
|
|
|
|
@ -141,29 +141,29 @@ void BookReader::load(const KURL& url)
|
|
|
|
|
|
|
|
|
|
void BookReader::setupActions()
|
|
|
|
|
{
|
|
|
|
|
// KStdAction::openNew(this, TQT_SLOT(fileNew()), actionCollection());
|
|
|
|
|
KStdAction::open(this, TQT_SLOT(fileOpen()), actionCollection());
|
|
|
|
|
recentFilesAction = KStdAction::openRecent(this, TQT_SLOT(slotURLSelected(const KURL &)),
|
|
|
|
|
// KStdAction::openNew(this, TQ_SLOT(fileNew()), actionCollection());
|
|
|
|
|
KStdAction::open(this, TQ_SLOT(fileOpen()), actionCollection());
|
|
|
|
|
recentFilesAction = KStdAction::openRecent(this, TQ_SLOT(slotURLSelected(const KURL &)),
|
|
|
|
|
actionCollection());
|
|
|
|
|
KStdAction::save(this, TQT_SLOT(fileSave()), actionCollection());
|
|
|
|
|
KStdAction::saveAs(this, TQT_SLOT(fileSaveAs()), actionCollection());
|
|
|
|
|
KStdAction::print(this, TQT_SLOT(filePrint()), actionCollection());
|
|
|
|
|
KStdAction::quit(kapp, TQT_SLOT(quit()), actionCollection());
|
|
|
|
|
KStdAction::save(this, TQ_SLOT(fileSave()), actionCollection());
|
|
|
|
|
KStdAction::saveAs(this, TQ_SLOT(fileSaveAs()), actionCollection());
|
|
|
|
|
KStdAction::print(this, TQ_SLOT(filePrint()), actionCollection());
|
|
|
|
|
KStdAction::quit(kapp, TQ_SLOT(quit()), actionCollection());
|
|
|
|
|
|
|
|
|
|
KStdAction::firstPage(this, TQT_SLOT(gotoFirstPage()), actionCollection());
|
|
|
|
|
KStdAction::prior(this, TQT_SLOT(prevPage()), actionCollection());
|
|
|
|
|
KStdAction::next(this, TQT_SLOT(nextPage()), actionCollection());
|
|
|
|
|
KStdAction::lastPage(this, TQT_SLOT(gotoLastPage()), actionCollection());
|
|
|
|
|
KStdAction::firstPage(this, TQ_SLOT(gotoFirstPage()), actionCollection());
|
|
|
|
|
KStdAction::prior(this, TQ_SLOT(prevPage()), actionCollection());
|
|
|
|
|
KStdAction::next(this, TQ_SLOT(nextPage()), actionCollection());
|
|
|
|
|
KStdAction::lastPage(this, TQ_SLOT(gotoLastPage()), actionCollection());
|
|
|
|
|
|
|
|
|
|
KStdAction::addBookmark(this, TQT_SLOT(addBookmark()), actionCollection());
|
|
|
|
|
KStdAction::editBookmarks(this, TQT_SLOT(editBookmarks()), actionCollection());
|
|
|
|
|
KStdAction::addBookmark(this, TQ_SLOT(addBookmark()), actionCollection());
|
|
|
|
|
KStdAction::editBookmarks(this, TQ_SLOT(editBookmarks()), actionCollection());
|
|
|
|
|
|
|
|
|
|
KStdAction::gotoPage(this, TQT_SLOT(gotoPage()), actionCollection());
|
|
|
|
|
KStdAction::gotoPage(this, TQ_SLOT(gotoPage()), actionCollection());
|
|
|
|
|
|
|
|
|
|
m_fullScreenAction = KStdAction::fullScreen(this, TQT_SLOT(fullScreen()),
|
|
|
|
|
m_fullScreenAction = KStdAction::fullScreen(this, TQ_SLOT(fullScreen()),
|
|
|
|
|
actionCollection(), this);
|
|
|
|
|
|
|
|
|
|
KStdAction::preferences(this, TQT_SLOT(optionsPreferences()), actionCollection());
|
|
|
|
|
KStdAction::preferences(this, TQ_SLOT(optionsPreferences()), actionCollection());
|
|
|
|
|
|
|
|
|
|
TDEConfig *config = kapp->config();
|
|
|
|
|
recentFilesAction->loadEntries(config);
|
|
|
|
@ -172,7 +172,7 @@ void BookReader::setupActions()
|
|
|
|
|
// how to insert a custom menu and menu item
|
|
|
|
|
/*
|
|
|
|
|
TDEAction *custom = new TDEAction( i18n( "Cus&tom Menuitem" ), 0,
|
|
|
|
|
this, TQT_SLOT( optionsPreferences() ),
|
|
|
|
|
this, TQ_SLOT( optionsPreferences() ),
|
|
|
|
|
actionCollection(), "custom_action" );*/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -313,7 +313,7 @@ void BookReader::optionsPreferences()
|
|
|
|
|
general->kcfg_DefaultEncoding->setCurrentItem(i);
|
|
|
|
|
|
|
|
|
|
dialog->addPage(general, i18n("General"), "settings");
|
|
|
|
|
connect(dialog, TQT_SIGNAL(settingsChanged()), this, TQT_SLOT(loadSettings()));
|
|
|
|
|
connect(dialog, TQ_SIGNAL(settingsChanged()), this, TQ_SLOT(loadSettings()));
|
|
|
|
|
dialog->show();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -390,7 +390,7 @@ void BookReader::loadLastUrl()
|
|
|
|
|
TDEConfig * config = kapp->config();
|
|
|
|
|
TQSize size = config->readSizeEntry("size");
|
|
|
|
|
lastURL = config->readEntry("lastURL");
|
|
|
|
|
connect(m_view, TQT_SIGNAL(loadingFinished()), this, TQT_SLOT(loadLastURLSetPage()));
|
|
|
|
|
connect(m_view, TQ_SIGNAL(loadingFinished()), this, TQ_SLOT(loadLastURLSetPage()));
|
|
|
|
|
if (!lastURL.isEmpty())
|
|
|
|
|
{
|
|
|
|
|
// kdDebug() << "loadLastUrl: initial size = " << m_view->size() << endl;
|
|
|
|
@ -466,12 +466,12 @@ void BookReader::updateBookmarks()
|
|
|
|
|
const Bookmarks & bms = m_view->bookmarks();
|
|
|
|
|
|
|
|
|
|
TQSignalMapper *bookmarkMapper = new TQSignalMapper(this);
|
|
|
|
|
connect(bookmarkMapper, TQT_SIGNAL(mapped(int)), this, TQT_SLOT(gotoBookmark(int)));
|
|
|
|
|
connect(bookmarkMapper, TQ_SIGNAL(mapped(int)), this, TQ_SLOT(gotoBookmark(int)));
|
|
|
|
|
for (Bookmarks::size_type i = 0; i < 9 && i < bms.size(); ++i)
|
|
|
|
|
{
|
|
|
|
|
const Bookmark & bm = bms[i];
|
|
|
|
|
TDEAction * action = new TDEAction(bm.name(), ALT+Key_1 + i);
|
|
|
|
|
connect(action, TQT_SIGNAL(activated()), bookmarkMapper, TQT_SLOT(map()));
|
|
|
|
|
connect(action, TQ_SIGNAL(activated()), bookmarkMapper, TQ_SLOT(map()));
|
|
|
|
|
m_bookmarkActions.append(action);
|
|
|
|
|
bookmarkMapper->setMapping(action, i);
|
|
|
|
|
}
|
|
|
|
|