author | drw <drw> | 2004-04-22 14:30:24 (UTC) |
---|---|---|
committer | drw <drw> | 2004-04-22 14:30:24 (UTC) |
commit | 00977d309bc991ffb4a84216881b53432c6d0b47 (patch) (unidiff) | |
tree | 7888656814ad09fb8930c198caadc56561687918 | |
parent | 162c71d6528515ea4b28520e9708c8ce9ca7fba2 (diff) | |
download | opie-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
-rw-r--r-- | noncore/apps/dagger/ChangeLog | 7 | ||||
-rw-r--r-- | noncore/apps/dagger/README | 2 | ||||
-rw-r--r-- | noncore/apps/dagger/TODO | 6 | ||||
-rw-r--r-- | noncore/apps/dagger/mainwindow.cpp | 17 | ||||
-rw-r--r-- | noncore/apps/dagger/mainwindow.h | 4 | ||||
-rw-r--r-- | noncore/apps/dagger/navbar.cpp | 16 | ||||
-rw-r--r-- | noncore/apps/dagger/navbar.h | 8 | ||||
-rw-r--r-- | noncore/apps/dagger/opie-dagger.control | 4 | ||||
-rw-r--r-- | noncore/apps/dagger/searchbar.cpp | 8 | ||||
-rw-r--r-- | noncore/apps/dagger/textwidget.cpp | 8 | ||||
-rw-r--r-- | noncore/apps/dagger/textwidget.h | 4 |
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 @@ | |||
1 | 2004-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 | |||
1 | 2004-04-06 Dan Williams <drw@handhelds.org> | 8 | 2004-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 | ||
19 | 1. Implement search function callback to animate OWait dialog | 19 | 1. Implement module installation |
20 | 2. Implement previous/next page scrolling | ||
21 | 3. 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 | ||
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 ); |
@@ -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 ) | |||
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() |
@@ -597,12 +600,12 @@ void MainWindow::slotViewSearchToolbar( bool enabled ) | |||
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 | } |
@@ -643,12 +646,12 @@ void MainWindow::slotNavNextVerse() | |||
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 | } |
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 | ||
73 | void NavBar::navBtnsEnable( bool enabled ) | 73 | void 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 | ||
39 | private: | 39 | private: |
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 | ||
48 | signals: | 48 | signals: |
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 | |||
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/applications | 4 | Section: opie/applications |
5 | Depends: task-opie-minimal, libopiecore2, libopieui2 | 5 | Depends: task-opie-minimal, libopiecore2, libopieui2 |
6 | Replaces: dagger | ||
7 | Architecture: arm | 6 | Architecture: arm |
8 | Source: http://draknor.net/dagger/ | ||
9 | Maintainer: Dan Williams (drw@handhelds.org) | 7 | Maintainer: Dan Williams (drw@handhelds.org) |
10 | Description: A Bible study program utilizing the Sword library. | 8 | Description: A Bible study program utilizing the Sword library. |
11 | Version: 0.9.0 | 9 | Version: 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 | ||
34 | void searchCallback( char /*percent*/, void */*userData*/ ) | ||
35 | { | ||
36 | qApp->processEvents(); | ||
37 | } | ||
38 | |||
34 | SearchBar::SearchBar( QMainWindow *parent ) | 39 | SearchBar::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 | ||
81 | void TextWidget::prevChapter() | 81 | void TextWidget::prevPage() |
82 | { | 82 | { |
83 | (*m_key) -= m_numVerses; | ||
84 | setText(); | ||
83 | } | 85 | } |
84 | 86 | ||
85 | void TextWidget::prevVerse() | 87 | void TextWidget::prevVerse() |
@@ -100,8 +102,10 @@ void TextWidget::nextVerse() | |||
100 | setText(); | 102 | setText(); |
101 | } | 103 | } |
102 | 104 | ||
103 | void TextWidget::nextChapter() | 105 | void TextWidget::nextPage() |
104 | { | 106 | { |
107 | (*m_key) += m_numVerses; | ||
108 | setText(); | ||
105 | } | 109 | } |
106 | 110 | ||
107 | void TextWidget::slotNumVersesChanged( int numVerses ) | 111 | void 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 | ||
51 | public slots: | 51 | public slots: |
52 | void slotNumVersesChanged( int numVerses ); | 52 | void slotNumVersesChanged( int numVerses ); |