summaryrefslogtreecommitdiff
Unidiff
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,4 +1,11 @@
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
4 * Initial check-in of new application 11 * Initial check-in of new application
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
@@ -1,9 +1,9 @@
1/************************************************************************ 1/************************************************************************
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/*
9/************************************************************************ 9/************************************************************************
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
@@ -1,9 +1,9 @@
1/************************************************************************ 1/************************************************************************
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/*
9/************************************************************************ 9/************************************************************************
@@ -15,11 +15,9 @@ To-do for Opie-Dagger - April, 2004
15====================== 15======================
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 =
25====================== 23======================
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
@@ -72,8 +72,11 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags /*fl*/ )
72} 72}
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 );
79 82
@@ -168,13 +171,13 @@ void MainWindow::initUI()
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 );
@@ -331,9 +334,9 @@ int MainWindow::findBookmark( const QString &bookmark )
331 334
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()
339{ 342{
@@ -596,14 +599,14 @@ void MainWindow::slotViewSearchToolbar( bool enabled )
596 enabled ? m_searchToolbar->show() 599 enabled ? m_searchToolbar->show()
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 }
609} 612}
@@ -642,14 +645,14 @@ void MainWindow::slotNavNextVerse()
642 m_navToolbar->setKey( text->getAbbrevKey() ); 645 m_navToolbar->setKey( text->getAbbrevKey() );
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 }
655} 658}
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
@@ -110,13 +110,13 @@ private slots:
110 void slotViewNavToolbar( bool enabled ); 110 void slotViewNavToolbar( bool enabled );
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
122 // Search toolbar slots 122 // Search toolbar slots
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
@@ -26,12 +26,12 @@ file; see the file COPYING. If not, write to the Free Software Foundation, Inc.,
26NavBar::NavBar( QMainWindow *parent ) 26NavBar::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 );
37 m_actionPrevVerse->addTo( this ); 37 m_actionPrevVerse->addTo( this );
@@ -45,12 +45,12 @@ NavBar::NavBar( QMainWindow *parent )
45 QString::null, 0, this, 0 ); 45 QString::null, 0, this, 0 );
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
56 m_scrollRate = new QSpinBox( 1, 100, 1, this ); 56 m_scrollRate = new QSpinBox( 1, 100, 1, this );
@@ -71,12 +71,12 @@ NavBar::NavBar( QMainWindow *parent )
71} 71}
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}
82 82
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
@@ -36,22 +36,22 @@ public:
36 void setAutoScrollRate( int scrollRate ); 36 void setAutoScrollRate( int scrollRate );
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};
57 57
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
@@ -2,10 +2,8 @@ Package: opie-dagger
2Files: plugins/application/libdagger.so* bin/dagger pics/dagger apps/Applications/dagger.desktop 2Files: plugins/application/libdagger.so* bin/dagger pics/dagger apps/Applications/dagger.desktop
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
@@ -30,8 +30,13 @@ file; see the file COPYING. If not, write to the Free Software Foundation, Inc.,
30#include <listkey.h> 30#include <listkey.h>
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 )
37{ 42{
@@ -107,9 +112,10 @@ void SearchBar::slotFind()
107 qApp->processEvents(); 112 qApp->processEvents();
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();
115 bool found = count > 0; 121 bool found = count > 0;
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
@@ -77,10 +77,12 @@ QString TextWidget::getCurrVerse()
77 m_module->SetKey( m_key->getText() ); 77 m_module->SetKey( m_key->getText() );
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()
86{ 88{
@@ -99,10 +101,12 @@ void TextWidget::nextVerse()
99 (*m_key)++; 101 (*m_key)++;
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 )
108{ 112{
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
@@ -41,13 +41,13 @@ public:
41 QString getCurrVerse(); 41 QString getCurrVerse();
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 );
53 void slotFontChanged( const QFont *newFont ); 53 void slotFontChanged( const QFont *newFont );