summaryrefslogtreecommitdiff
authordrw <drw>2004-04-22 14:30:24 (UTC)
committer drw <drw>2004-04-22 14:30:24 (UTC)
commit00977d309bc991ffb4a84216881b53432c6d0b47 (patch) (unidiff)
tree7888656814ad09fb8930c198caadc56561687918
parent162c71d6528515ea4b28520e9708c8ce9ca7fba2 (diff)
downloadopie-00977d309bc991ffb4a84216881b53432c6d0b47.zip
opie-00977d309bc991ffb4a84216881b53432c6d0b47.tar.gz
opie-00977d309bc991ffb4a84216881b53432c6d0b47.tar.bz2
Fixed disabling of screen blanking, implemented prev/next page scrolling and fixed search OWait useage
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/dagger/ChangeLog7
-rw-r--r--noncore/apps/dagger/README2
-rw-r--r--noncore/apps/dagger/TODO6
-rw-r--r--noncore/apps/dagger/mainwindow.cpp17
-rw-r--r--noncore/apps/dagger/mainwindow.h4
-rw-r--r--noncore/apps/dagger/navbar.cpp16
-rw-r--r--noncore/apps/dagger/navbar.h8
-rw-r--r--noncore/apps/dagger/opie-dagger.control4
-rw-r--r--noncore/apps/dagger/searchbar.cpp8
-rw-r--r--noncore/apps/dagger/textwidget.cpp8
-rw-r--r--noncore/apps/dagger/textwidget.h4
11 files changed, 50 insertions, 34 deletions
diff --git a/noncore/apps/dagger/ChangeLog b/noncore/apps/dagger/ChangeLog
index feb9a19..108419e 100644
--- a/noncore/apps/dagger/ChangeLog
+++ b/noncore/apps/dagger/ChangeLog
@@ -1,3 +1,10 @@
12004-04-22 Dan Williams <drw@handhelds.org>
2
3 * Released version 0.9.1
4 * Fixed the disabling of screen blanking
5 * Implement previous/next page scrolling
6 * Animate search OWait
7
12004-04-06 Dan Williams <drw@handhelds.org> 82004-04-06 Dan Williams <drw@handhelds.org>
2 9
3 * Released version 0.9.0 10 * Released version 0.9.0
diff --git a/noncore/apps/dagger/README b/noncore/apps/dagger/README
index 4a4bb61..00e9eed 100644
--- a/noncore/apps/dagger/README
+++ b/noncore/apps/dagger/README
@@ -2,7 +2,7 @@
2/* 2/*
3/* Opie - Dagger 3/* Opie - Dagger
4/* =============== 4/* ===============
5/* Version 0.9.0 5/* Version 0.9.1
6/* 6/*
7/* A Bible study/reader application 7/* A Bible study/reader application
8/* 8/*
diff --git a/noncore/apps/dagger/TODO b/noncore/apps/dagger/TODO
index 2548dd3..1530bd6 100644
--- a/noncore/apps/dagger/TODO
+++ b/noncore/apps/dagger/TODO
@@ -2,7 +2,7 @@
2/* 2/*
3/* Opie - Dagger 3/* Opie - Dagger
4/* =============== 4/* ===============
5/* Version 0.9.0 5/* Version 0.9.1
6/* 6/*
7/* A Bible study/reader application 7/* A Bible study/reader application
8/* 8/*
@@ -16,9 +16,7 @@ To-do for Opie-Dagger - April, 2004
16= Current release = 16= Current release =
17====================== 17======================
18 18
191. Implement search function callback to animate OWait dialog 191. Implement module installation
202. Implement previous/next page scrolling
213. Fix disablement of screen blanking
22 20
23====================== 21======================
24= Future releases = 22= Future releases =
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
@@ -73,6 +73,9 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags /*fl*/ )
73 73
74MainWindow::~MainWindow() 74MainWindow::~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 );
@@ -169,11 +172,11 @@ void MainWindow::initUI()
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
@@ -332,7 +335,7 @@ int MainWindow::findBookmark( const QString &bookmark )
332void MainWindow::enableScreenBlanking( bool enable ) 335void 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
338void MainWindow::initConfig() 341void MainWindow::initConfig()
@@ -597,12 +600,12 @@ void MainWindow::slotViewSearchToolbar( bool enabled )
597 : m_searchToolbar->hide(); 600 : m_searchToolbar->hide();
598} 601}
599 602
600void MainWindow::slotNavPrevChapter() 603void 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 }
@@ -643,12 +646,12 @@ void MainWindow::slotNavNextVerse()
643 } 646 }
644} 647}
645 648
646void MainWindow::slotNavNextChapter() 649void 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 }
diff --git a/noncore/apps/dagger/mainwindow.h b/noncore/apps/dagger/mainwindow.h
index 0c7f3c8..b114e33 100644
--- a/noncore/apps/dagger/mainwindow.h
+++ b/noncore/apps/dagger/mainwindow.h
@@ -111,11 +111,11 @@ private slots:
111 void slotViewSearchToolbar( bool enabled ); 111 void slotViewSearchToolbar( bool enabled );
112 112
113 // Navigation toolbar slots 113 // Navigation toolbar slots
114 void slotNavPrevChapter(); 114 void slotNavPrevPage();
115 void slotNavPrevVerse(); 115 void slotNavPrevVerse();
116 void slotNavKeyChanged( const QString &newKey ); 116 void slotNavKeyChanged( const QString &newKey );
117 void slotNavNextVerse(); 117 void slotNavNextVerse();
118 void slotNavNextChapter(); 118 void slotNavNextPage();
119 void slotNavAutoScroll( bool enabled ); 119 void slotNavAutoScroll( bool enabled );
120 void slotNavScrollRateChanged( int newRate ); 120 void slotNavScrollRateChanged( int newRate );
121 121
diff --git a/noncore/apps/dagger/navbar.cpp b/noncore/apps/dagger/navbar.cpp
index 4781af0..212dc36 100644
--- a/noncore/apps/dagger/navbar.cpp
+++ b/noncore/apps/dagger/navbar.cpp
@@ -27,10 +27,10 @@ NavBar::NavBar( QMainWindow *parent )
27 : QToolBar( QString::null, parent, QMainWindow::Top, true ) 27 : QToolBar( QString::null, parent, QMainWindow::Top, true )
28{ 28{
29 // Initialize UI 29 // Initialize UI
30 m_actionPrevChapter = new QAction( tr( "Previous chapter" ), Resource::loadPixmap( "fastback" ), 30 m_actionPrevPage = new QAction( tr( "Previous page" ), Resource::loadPixmap( "fastback" ),
31 QString::null, 0, this, 0 ); 31 QString::null, 0, this, 0 );
32 m_actionPrevChapter->addTo( this ); 32 m_actionPrevPage->addTo( this );
33 connect( m_actionPrevChapter, SIGNAL(activated()), this, SIGNAL(prevChapter()) ); 33 connect( m_actionPrevPage, SIGNAL(activated()), this, SIGNAL(prevPage()) );
34 34
35 m_actionPrevVerse = new QAction( tr( "Previous verse" ), Resource::loadPixmap( "back" ), 35 m_actionPrevVerse = new QAction( tr( "Previous verse" ), Resource::loadPixmap( "back" ),
36 QString::null, 0, this, 0 ); 36 QString::null, 0, this, 0 );
@@ -46,10 +46,10 @@ NavBar::NavBar( QMainWindow *parent )
46 m_actionNextVerse->addTo( this ); 46 m_actionNextVerse->addTo( this );
47 connect( m_actionNextVerse, SIGNAL(activated()), this, SIGNAL(nextVerse()) ); 47 connect( m_actionNextVerse, SIGNAL(activated()), this, SIGNAL(nextVerse()) );
48 48
49 m_actionNextChapter = new QAction( tr( "Next chapter" ), Resource::loadPixmap( "fastforward" ), 49 m_actionNextPage = new QAction( tr( "Next page" ), Resource::loadPixmap( "fastforward" ),
50 QString::null, 0, this, 0 ); 50 QString::null, 0, this, 0 );
51 m_actionNextChapter->addTo( this ); 51 m_actionNextPage->addTo( this );
52 connect( m_actionNextChapter, SIGNAL(activated()), this, SIGNAL(nextChapter()) ); 52 connect( m_actionNextPage, SIGNAL(activated()), this, SIGNAL(nextPage()) );
53 53
54 addSeparator(); 54 addSeparator();
55 55
@@ -72,10 +72,10 @@ NavBar::NavBar( QMainWindow *parent )
72 72
73void NavBar::navBtnsEnable( bool enabled ) 73void NavBar::navBtnsEnable( bool enabled )
74{ 74{
75 m_actionPrevChapter->setEnabled( enabled ); 75 m_actionPrevPage->setEnabled( enabled );
76 m_actionPrevVerse->setEnabled( enabled ); 76 m_actionPrevVerse->setEnabled( enabled );
77 m_actionNextVerse->setEnabled( enabled ); 77 m_actionNextVerse->setEnabled( enabled );
78 m_actionNextChapter->setEnabled( enabled ); 78 m_actionNextPage->setEnabled( enabled );
79 m_scrollRate->setEnabled( enabled ); 79 m_scrollRate->setEnabled( enabled );
80 m_actionScroll->setEnabled( enabled ); 80 m_actionScroll->setEnabled( enabled );
81} 81}
diff --git a/noncore/apps/dagger/navbar.h b/noncore/apps/dagger/navbar.h
index a37d6ff..0df2bf0 100644
--- a/noncore/apps/dagger/navbar.h
+++ b/noncore/apps/dagger/navbar.h
@@ -37,20 +37,20 @@ public:
37 const int autoScrollRate() { return m_scrollRate->value(); } 37 const int autoScrollRate() { return m_scrollRate->value(); }
38 38
39private: 39private:
40 QAction *m_actionPrevChapter; // Action for going back 1 chapter 40 QAction *m_actionPrevPage; // Action for going back 1 page
41 QAction *m_actionPrevVerse; // Action for going back 1 verse 41 QAction *m_actionPrevVerse; // Action for going back 1 verse
42 QLineEdit *m_key; // Edit box to enter key to goto 42 QLineEdit *m_key; // Edit box to enter key to goto
43 QAction *m_actionNextVerse; // Action for going forward 1 verse 43 QAction *m_actionNextVerse; // Action for going forward 1 verse
44 QAction *m_actionNextChapter; // Action for going forward 1 chapter 44 QAction *m_actionNextPage; // Action for going forward 1 page
45 QSpinBox *m_scrollRate; // Spin box to adjust rate of auto-scrolling 45 QSpinBox *m_scrollRate; // Spin box to adjust rate of auto-scrolling
46 QAction *m_actionScroll; // Action to start/stop auto-scrolling 46 QAction *m_actionScroll; // Action to start/stop auto-scrolling
47 47
48signals: 48signals:
49 void prevChapter(); 49 void prevPage();
50 void prevVerse(); 50 void prevVerse();
51 void keyChanged( const QString &newKey ); 51 void keyChanged( const QString &newKey );
52 void nextVerse(); 52 void nextVerse();
53 void nextChapter(); 53 void nextPage();
54 void autoScroll( bool enabled ); 54 void autoScroll( bool enabled );
55 void scrollRateChanged( int newRate ); 55 void scrollRateChanged( int newRate );
56}; 56};
diff --git a/noncore/apps/dagger/opie-dagger.control b/noncore/apps/dagger/opie-dagger.control
index c401f03..4ded1f2 100644
--- a/noncore/apps/dagger/opie-dagger.control
+++ b/noncore/apps/dagger/opie-dagger.control
@@ -3,9 +3,7 @@ Files: plugins/application/libdagger.so* bin/dagger pics/dagger apps/Application
3Priority: optional 3Priority: optional
4Section: opie/applications 4Section: opie/applications
5Depends: task-opie-minimal, libopiecore2, libopieui2 5Depends: task-opie-minimal, libopiecore2, libopieui2
6Replaces: dagger
7Architecture: arm 6Architecture: arm
8Source: http://draknor.net/dagger/
9Maintainer: Dan Williams (drw@handhelds.org) 7Maintainer: Dan Williams (drw@handhelds.org)
10Description: A Bible study program utilizing the Sword library. 8Description: A Bible study program utilizing the Sword library.
11Version: 0.9.0 9Version: 0.9.1$EXTRAVERSION
diff --git a/noncore/apps/dagger/searchbar.cpp b/noncore/apps/dagger/searchbar.cpp
index 747d696..ff434dd 100644
--- a/noncore/apps/dagger/searchbar.cpp
+++ b/noncore/apps/dagger/searchbar.cpp
@@ -31,6 +31,11 @@ file; see the file COPYING. If not, write to the Free Software Foundation, Inc.,
31#include <regex.h> 31#include <regex.h>
32#include <versekey.h> 32#include <versekey.h>
33 33
34void searchCallback( char /*percent*/, void */*userData*/ )
35{
36 qApp->processEvents();
37}
38
34SearchBar::SearchBar( QMainWindow *parent ) 39SearchBar::SearchBar( QMainWindow *parent )
35 : QToolBar( QString::null, parent, QMainWindow::Top, true ) 40 : QToolBar( QString::null, parent, QMainWindow::Top, true )
36 , m_currText( 0x0 ) 41 , m_currText( 0x0 )
@@ -108,7 +113,8 @@ void SearchBar::slotFind()
108 113
109 // Perform search 114 // Perform search
110 // TODO - implement search callback function to animate wait cursor 115 // TODO - implement search callback function to animate wait cursor
111 sword::ListKey results = m_currText->getModule()->Search( m_searchText->text().latin1(), REG_ICASE, 0 ); 116 sword::ListKey results = m_currText->getModule()->Search( m_searchText->text().latin1(), 0, REG_ICASE, 0, 0,
117 &searchCallback );
112 118
113 // Process results 119 // Process results
114 int count = results.Count(); 120 int count = results.Count();
diff --git a/noncore/apps/dagger/textwidget.cpp b/noncore/apps/dagger/textwidget.cpp
index 8ff620d..9f7de66 100644
--- a/noncore/apps/dagger/textwidget.cpp
+++ b/noncore/apps/dagger/textwidget.cpp
@@ -78,8 +78,10 @@ QString TextWidget::getCurrVerse()
78 return ( QString ) m_module->StripText(); 78 return ( QString ) m_module->StripText();
79} 79}
80 80
81void TextWidget::prevChapter() 81void TextWidget::prevPage()
82{ 82{
83 (*m_key) -= m_numVerses;
84 setText();
83} 85}
84 86
85void TextWidget::prevVerse() 87void TextWidget::prevVerse()
@@ -100,8 +102,10 @@ void TextWidget::nextVerse()
100 setText(); 102 setText();
101} 103}
102 104
103void TextWidget::nextChapter() 105void TextWidget::nextPage()
104{ 106{
107 (*m_key) += m_numVerses;
108 setText();
105} 109}
106 110
107void TextWidget::slotNumVersesChanged( int numVerses ) 111void TextWidget::slotNumVersesChanged( int numVerses )
diff --git a/noncore/apps/dagger/textwidget.h b/noncore/apps/dagger/textwidget.h
index 647eae9..f78ef69 100644
--- a/noncore/apps/dagger/textwidget.h
+++ b/noncore/apps/dagger/textwidget.h
@@ -42,11 +42,11 @@ public:
42 42
43 bool isBibleText() const { return m_isBibleText; } 43 bool isBibleText() const { return m_isBibleText; }
44 44
45 void prevChapter(); 45 void prevPage();
46 void prevVerse(); 46 void prevVerse();
47 void setKey( const QString &newKey ); 47 void setKey( const QString &newKey );
48 void nextVerse(); 48 void nextVerse();
49 void nextChapter(); 49 void nextPage();
50 50
51public slots: 51public slots:
52 void slotNumVersesChanged( int numVerses ); 52 void slotNumVersesChanged( int numVerses );