Diffstat (limited to 'noncore/apps/dagger/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/dagger/mainwindow.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/noncore/apps/dagger/mainwindow.cpp b/noncore/apps/dagger/mainwindow.cpp index ace8f36..b2e00e8 100644 --- a/noncore/apps/dagger/mainwindow.cpp +++ b/noncore/apps/dagger/mainwindow.cpp | |||
@@ -70,12 +70,15 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags /*fl*/ ) | |||
70 | // Load initial configuration | 70 | // Load initial configuration |
71 | QTimer::singleShot( 100, this, SLOT( initConfig() ) ); | 71 | QTimer::singleShot( 100, this, SLOT( initConfig() ) ); |
72 | } | 72 | } |
73 | 73 | ||
74 | MainWindow::~MainWindow() | 74 | MainWindow::~MainWindow() |
75 | { | 75 | { |
76 | // Re-enable screen blanking if it was disabled | ||
77 | QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; | ||
78 | |||
76 | // Save Sword options | 79 | // Save Sword options |
77 | m_config.setGroup( "Sword" ); | 80 | m_config.setGroup( "Sword" ); |
78 | m_config.writeEntry( "ModPath", m_modulePath ); | 81 | m_config.writeEntry( "ModPath", m_modulePath ); |
79 | 82 | ||
80 | for ( QAction *a = m_actionSwordOpts.first(); a; a = m_actionSwordOpts.next() ) | 83 | for ( QAction *a = m_actionSwordOpts.first(); a; a = m_actionSwordOpts.next() ) |
81 | m_config.writeEntry( a->text(), a->isOn() ); | 84 | m_config.writeEntry( a->text(), a->isOn() ); |
@@ -166,17 +169,17 @@ void MainWindow::initUI() | |||
166 | m_menuBar = new QMenuBar( m_barDock ); | 169 | m_menuBar = new QMenuBar( m_barDock ); |
167 | m_menuBar->setMargin( 0 ); | 170 | m_menuBar->setMargin( 0 ); |
168 | 171 | ||
169 | // Allocate toolbars | 172 | // Allocate toolbars |
170 | m_navToolbar = new NavBar( this ); | 173 | m_navToolbar = new NavBar( this ); |
171 | m_navToolbar->navBtnsEnable( false ); | 174 | m_navToolbar->navBtnsEnable( false ); |
172 | connect( m_navToolbar, SIGNAL(prevChapter()), this, SLOT(slotNavPrevChapter()) ); | 175 | connect( m_navToolbar, SIGNAL(prevPage()), this, SLOT(slotNavPrevPage()) ); |
173 | connect( m_navToolbar, SIGNAL(prevVerse()), this, SLOT(slotNavPrevVerse()) ); | 176 | connect( m_navToolbar, SIGNAL(prevVerse()), this, SLOT(slotNavPrevVerse()) ); |
174 | connect( m_navToolbar, SIGNAL(keyChanged(const QString &)), this, SLOT(slotNavKeyChanged(const QString &)) ); | 177 | connect( m_navToolbar, SIGNAL(keyChanged(const QString &)), this, SLOT(slotNavKeyChanged(const QString &)) ); |
175 | connect( m_navToolbar, SIGNAL(nextVerse()), this, SLOT(slotNavNextVerse()) ); | 178 | connect( m_navToolbar, SIGNAL(nextVerse()), this, SLOT(slotNavNextVerse()) ); |
176 | connect( m_navToolbar, SIGNAL(nextChapter()), this, SLOT(slotNavNextChapter()) ); | 179 | connect( m_navToolbar, SIGNAL(nextPage()), this, SLOT(slotNavNextPage()) ); |
177 | connect( m_navToolbar, SIGNAL(autoScroll(bool)), this, SLOT(slotNavAutoScroll(bool)) ); | 180 | connect( m_navToolbar, SIGNAL(autoScroll(bool)), this, SLOT(slotNavAutoScroll(bool)) ); |
178 | connect( m_navToolbar, SIGNAL(scrollRateChanged(int)), this, SLOT(slotNavScrollRateChanged(int)) ); | 181 | connect( m_navToolbar, SIGNAL(scrollRateChanged(int)), this, SLOT(slotNavScrollRateChanged(int)) ); |
179 | 182 | ||
180 | m_searchToolbar = new SearchBar( this ); | 183 | m_searchToolbar = new SearchBar( this ); |
181 | connect( m_searchToolbar, SIGNAL(sigResultClicked(const QString &)), this, SLOT(slotSearchResultClicked(const QString &)) ); | 184 | connect( m_searchToolbar, SIGNAL(sigResultClicked(const QString &)), this, SLOT(slotSearchResultClicked(const QString &)) ); |
182 | 185 | ||
@@ -329,13 +332,13 @@ int MainWindow::findBookmark( const QString &bookmark ) | |||
329 | return id; | 332 | return id; |
330 | } | 333 | } |
331 | 334 | ||
332 | void MainWindow::enableScreenBlanking( bool enable ) | 335 | void MainWindow::enableScreenBlanking( bool enable ) |
333 | { | 336 | { |
334 | enable ? QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable | 337 | enable ? QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable |
335 | : QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Disable; | 338 | : QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::DisableSuspend; |
336 | } | 339 | } |
337 | 340 | ||
338 | void MainWindow::initConfig() | 341 | void MainWindow::initConfig() |
339 | { | 342 | { |
340 | bool show; | 343 | bool show; |
341 | 344 | ||
@@ -594,18 +597,18 @@ void MainWindow::slotViewNavToolbar( bool enabled ) | |||
594 | void MainWindow::slotViewSearchToolbar( bool enabled ) | 597 | void MainWindow::slotViewSearchToolbar( bool enabled ) |
595 | { | 598 | { |
596 | enabled ? m_searchToolbar->show() | 599 | enabled ? m_searchToolbar->show() |
597 | : m_searchToolbar->hide(); | 600 | : m_searchToolbar->hide(); |
598 | } | 601 | } |
599 | 602 | ||
600 | void MainWindow::slotNavPrevChapter() | 603 | void MainWindow::slotNavPrevPage() |
601 | { | 604 | { |
602 | TextWidget *text = reinterpret_cast<TextWidget *>(m_tabs.currentWidget()); | 605 | TextWidget *text = reinterpret_cast<TextWidget *>(m_tabs.currentWidget()); |
603 | if ( text ) | 606 | if ( text ) |
604 | { | 607 | { |
605 | text->prevChapter(); | 608 | text->prevPage(); |
606 | setCaption( QString( "%1 - Dagger" ).arg( text->getFullKey() ) ); | 609 | setCaption( QString( "%1 - Dagger" ).arg( text->getFullKey() ) ); |
607 | m_navToolbar->setKey( text->getAbbrevKey() ); | 610 | m_navToolbar->setKey( text->getAbbrevKey() ); |
608 | } | 611 | } |
609 | } | 612 | } |
610 | 613 | ||
611 | void MainWindow::slotNavPrevVerse() | 614 | void MainWindow::slotNavPrevVerse() |
@@ -640,18 +643,18 @@ void MainWindow::slotNavNextVerse() | |||
640 | text->nextVerse(); | 643 | text->nextVerse(); |
641 | setCaption( QString( "%1 - Dagger" ).arg( text->getFullKey() ) ); | 644 | setCaption( QString( "%1 - Dagger" ).arg( text->getFullKey() ) ); |
642 | m_navToolbar->setKey( text->getAbbrevKey() ); | 645 | m_navToolbar->setKey( text->getAbbrevKey() ); |
643 | } | 646 | } |
644 | } | 647 | } |
645 | 648 | ||
646 | void MainWindow::slotNavNextChapter() | 649 | void MainWindow::slotNavNextPage() |
647 | { | 650 | { |
648 | TextWidget *text = reinterpret_cast<TextWidget *>(m_tabs.currentWidget()); | 651 | TextWidget *text = reinterpret_cast<TextWidget *>(m_tabs.currentWidget()); |
649 | if ( text ) | 652 | if ( text ) |
650 | { | 653 | { |
651 | text->nextChapter(); | 654 | text->nextPage(); |
652 | setCaption( QString( "%1 - Dagger" ).arg( text->getFullKey() ) ); | 655 | setCaption( QString( "%1 - Dagger" ).arg( text->getFullKey() ) ); |
653 | m_navToolbar->setKey( text->getAbbrevKey() ); | 656 | m_navToolbar->setKey( text->getAbbrevKey() ); |
654 | } | 657 | } |
655 | } | 658 | } |
656 | 659 | ||
657 | void MainWindow::slotNavAutoScroll( bool enabled ) | 660 | void MainWindow::slotNavAutoScroll( bool enabled ) |