summaryrefslogtreecommitdiff
authordrw <drw>2004-04-22 14:30:24 (UTC)
committer drw <drw>2004-04-22 14:30:24 (UTC)
commit00977d309bc991ffb4a84216881b53432c6d0b47 (patch) (side-by-side diff)
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,4 +1,11 @@
+2004-04-22 Dan Williams <drw@handhelds.org>
+
+ * Released version 0.9.1
+ * Fixed the disabling of screen blanking
+ * Implement previous/next page scrolling
+ * Animate search OWait
+
2004-04-06 Dan Williams <drw@handhelds.org>
* Released version 0.9.0
* 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,11 +1,11 @@
/************************************************************************
/*
/* Opie - Dagger
/* ===============
-/* Version 0.9.0
+/* Version 0.9.1
/*
/* A Bible study/reader application
/*
/************************************************************************
---------------------------------------------
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,11 +1,11 @@
/************************************************************************
/*
/* Opie - Dagger
/* ===============
-/* Version 0.9.0
+/* Version 0.9.1
/*
/* A Bible study/reader application
/*
/************************************************************************
------------------------------------
@@ -13,15 +13,13 @@ To-do for Opie-Dagger - April, 2004
------------------------------------
======================
= Current release =
======================
-1. Implement search function callback to animate OWait dialog
-2. Implement previous/next page scrolling
-3. Fix disablement of screen blanking
+1. Implement module installation
======================
= Future releases =
======================
1. Margin notes \ No newline at end of file
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*/ )
// Load initial configuration
QTimer::singleShot( 100, this, SLOT( initConfig() ) );
}
MainWindow::~MainWindow()
{
+ // Re-enable screen blanking if it was disabled
+ QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable;
+
// Save Sword options
m_config.setGroup( "Sword" );
m_config.writeEntry( "ModPath", m_modulePath );
for ( QAction *a = m_actionSwordOpts.first(); a; a = m_actionSwordOpts.next() )
m_config.writeEntry( a->text(), a->isOn() );
@@ -166,17 +169,17 @@ void MainWindow::initUI()
m_menuBar = new QMenuBar( m_barDock );
m_menuBar->setMargin( 0 );
// Allocate toolbars
m_navToolbar = new NavBar( this );
m_navToolbar->navBtnsEnable( false );
- connect( m_navToolbar, SIGNAL(prevChapter()), this, SLOT(slotNavPrevChapter()) );
+ connect( m_navToolbar, SIGNAL(prevPage()), this, SLOT(slotNavPrevPage()) );
connect( m_navToolbar, SIGNAL(prevVerse()), this, SLOT(slotNavPrevVerse()) );
connect( m_navToolbar, SIGNAL(keyChanged(const QString &)), this, SLOT(slotNavKeyChanged(const QString &)) );
connect( m_navToolbar, SIGNAL(nextVerse()), this, SLOT(slotNavNextVerse()) );
- connect( m_navToolbar, SIGNAL(nextChapter()), this, SLOT(slotNavNextChapter()) );
+ connect( m_navToolbar, SIGNAL(nextPage()), this, SLOT(slotNavNextPage()) );
connect( m_navToolbar, SIGNAL(autoScroll(bool)), this, SLOT(slotNavAutoScroll(bool)) );
connect( m_navToolbar, SIGNAL(scrollRateChanged(int)), this, SLOT(slotNavScrollRateChanged(int)) );
m_searchToolbar = new SearchBar( this );
connect( m_searchToolbar, SIGNAL(sigResultClicked(const QString &)), this, SLOT(slotSearchResultClicked(const QString &)) );
@@ -329,13 +332,13 @@ int MainWindow::findBookmark( const QString &bookmark )
return id;
}
void MainWindow::enableScreenBlanking( bool enable )
{
enable ? QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable
- : QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Disable;
+ : QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::DisableSuspend;
}
void MainWindow::initConfig()
{
bool show;
@@ -594,18 +597,18 @@ void MainWindow::slotViewNavToolbar( bool enabled )
void MainWindow::slotViewSearchToolbar( bool enabled )
{
enabled ? m_searchToolbar->show()
: m_searchToolbar->hide();
}
-void MainWindow::slotNavPrevChapter()
+void MainWindow::slotNavPrevPage()
{
TextWidget *text = reinterpret_cast<TextWidget *>(m_tabs.currentWidget());
if ( text )
{
- text->prevChapter();
+ text->prevPage();
setCaption( QString( "%1 - Dagger" ).arg( text->getFullKey() ) );
m_navToolbar->setKey( text->getAbbrevKey() );
}
}
void MainWindow::slotNavPrevVerse()
@@ -640,18 +643,18 @@ void MainWindow::slotNavNextVerse()
text->nextVerse();
setCaption( QString( "%1 - Dagger" ).arg( text->getFullKey() ) );
m_navToolbar->setKey( text->getAbbrevKey() );
}
}
-void MainWindow::slotNavNextChapter()
+void MainWindow::slotNavNextPage()
{
TextWidget *text = reinterpret_cast<TextWidget *>(m_tabs.currentWidget());
if ( text )
{
- text->nextChapter();
+ text->nextPage();
setCaption( QString( "%1 - Dagger" ).arg( text->getFullKey() ) );
m_navToolbar->setKey( text->getAbbrevKey() );
}
}
void MainWindow::slotNavAutoScroll( bool enabled )
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
@@ -108,17 +108,17 @@ private slots:
void slotBookmarkSelected();
void slotViewSwordOption( bool enabled );
void slotViewNavToolbar( bool enabled );
void slotViewSearchToolbar( bool enabled );
// Navigation toolbar slots
- void slotNavPrevChapter();
+ void slotNavPrevPage();
void slotNavPrevVerse();
void slotNavKeyChanged( const QString &newKey );
void slotNavNextVerse();
- void slotNavNextChapter();
+ void slotNavNextPage();
void slotNavAutoScroll( bool enabled );
void slotNavScrollRateChanged( int newRate );
// Search toolbar slots
void slotSearchResultClicked( const QString &key );
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
@@ -24,16 +24,16 @@ file; see the file COPYING. If not, write to the Free Software Foundation, Inc.,
#include <qlineedit.h>
NavBar::NavBar( QMainWindow *parent )
: QToolBar( QString::null, parent, QMainWindow::Top, true )
{
// Initialize UI
- m_actionPrevChapter = new QAction( tr( "Previous chapter" ), Resource::loadPixmap( "fastback" ),
+ m_actionPrevPage = new QAction( tr( "Previous page" ), Resource::loadPixmap( "fastback" ),
QString::null, 0, this, 0 );
- m_actionPrevChapter->addTo( this );
- connect( m_actionPrevChapter, SIGNAL(activated()), this, SIGNAL(prevChapter()) );
+ m_actionPrevPage->addTo( this );
+ connect( m_actionPrevPage, SIGNAL(activated()), this, SIGNAL(prevPage()) );
m_actionPrevVerse = new QAction( tr( "Previous verse" ), Resource::loadPixmap( "back" ),
QString::null, 0, this, 0 );
m_actionPrevVerse->addTo( this );
connect( m_actionPrevVerse, SIGNAL(activated()), this, SIGNAL(prevVerse()) );
@@ -43,16 +43,16 @@ NavBar::NavBar( QMainWindow *parent )
m_actionNextVerse = new QAction( tr( "Next verse" ), Resource::loadPixmap( "forward" ),
QString::null, 0, this, 0 );
m_actionNextVerse->addTo( this );
connect( m_actionNextVerse, SIGNAL(activated()), this, SIGNAL(nextVerse()) );
- m_actionNextChapter = new QAction( tr( "Next chapter" ), Resource::loadPixmap( "fastforward" ),
+ m_actionNextPage = new QAction( tr( "Next page" ), Resource::loadPixmap( "fastforward" ),
QString::null, 0, this, 0 );
- m_actionNextChapter->addTo( this );
- connect( m_actionNextChapter, SIGNAL(activated()), this, SIGNAL(nextChapter()) );
+ m_actionNextPage->addTo( this );
+ connect( m_actionNextPage, SIGNAL(activated()), this, SIGNAL(nextPage()) );
addSeparator();
m_scrollRate = new QSpinBox( 1, 100, 1, this );
m_scrollRate->setMinimumWidth( 35 );
connect( m_scrollRate, SIGNAL(valueChanged(int)), this, SIGNAL(scrollRateChanged(int)) );
@@ -69,16 +69,16 @@ NavBar::NavBar( QMainWindow *parent )
m_key->installEventFilter( parent );
}
}
void NavBar::navBtnsEnable( bool enabled )
{
- m_actionPrevChapter->setEnabled( enabled );
+ m_actionPrevPage->setEnabled( enabled );
m_actionPrevVerse->setEnabled( enabled );
m_actionNextVerse->setEnabled( enabled );
- m_actionNextChapter->setEnabled( enabled );
+ m_actionNextPage->setEnabled( enabled );
m_scrollRate->setEnabled( enabled );
m_actionScroll->setEnabled( enabled );
}
void NavBar::setKey( const QString &newKey )
{
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
@@ -34,25 +34,25 @@ public:
void navBtnsEnable( bool enabled );
void setKey( const QString &newKey );
void setAutoScrollRate( int scrollRate );
const int autoScrollRate() { return m_scrollRate->value(); }
private:
- QAction *m_actionPrevChapter; // Action for going back 1 chapter
+ QAction *m_actionPrevPage; // Action for going back 1 page
QAction *m_actionPrevVerse; // Action for going back 1 verse
QLineEdit *m_key; // Edit box to enter key to goto
QAction *m_actionNextVerse; // Action for going forward 1 verse
- QAction *m_actionNextChapter; // Action for going forward 1 chapter
+ QAction *m_actionNextPage; // Action for going forward 1 page
QSpinBox *m_scrollRate; // Spin box to adjust rate of auto-scrolling
QAction *m_actionScroll; // Action to start/stop auto-scrolling
signals:
- void prevChapter();
+ void prevPage();
void prevVerse();
void keyChanged( const QString &newKey );
void nextVerse();
- void nextChapter();
+ void nextPage();
void autoScroll( bool enabled );
void scrollRateChanged( int newRate );
};
#endif
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
@@ -1,11 +1,9 @@
Package: opie-dagger
Files: plugins/application/libdagger.so* bin/dagger pics/dagger apps/Applications/dagger.desktop
Priority: optional
Section: opie/applications
Depends: task-opie-minimal, libopiecore2, libopieui2
-Replaces: dagger
Architecture: arm
-Source: http://draknor.net/dagger/
Maintainer: Dan Williams (drw@handhelds.org)
Description: A Bible study program utilizing the Sword library.
-Version: 0.9.0
+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
@@ -28,12 +28,17 @@ file; see the file COPYING. If not, write to the Free Software Foundation, Inc.,
#include <qlineedit.h>
#include <listkey.h>
#include <regex.h>
#include <versekey.h>
+void searchCallback( char /*percent*/, void */*userData*/ )
+{
+ qApp->processEvents();
+}
+
SearchBar::SearchBar( QMainWindow *parent )
: QToolBar( QString::null, parent, QMainWindow::Top, true )
, m_currText( 0x0 )
{
// Initialize UI
m_searchText = new QLineEdit( this );
@@ -105,13 +110,14 @@ void SearchBar::slotFind()
Opie::Ui::OWait wait( pWidget );
wait.show();
qApp->processEvents();
// Perform search
// TODO - implement search callback function to animate wait cursor
- sword::ListKey results = m_currText->getModule()->Search( m_searchText->text().latin1(), REG_ICASE, 0 );
+ sword::ListKey results = m_currText->getModule()->Search( m_searchText->text().latin1(), 0, REG_ICASE, 0, 0,
+ &searchCallback );
// Process results
int count = results.Count();
bool found = count > 0;
if ( found )
{
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
@@ -75,14 +75,16 @@ TextWidget::~TextWidget()
QString TextWidget::getCurrVerse()
{
m_module->SetKey( m_key->getText() );
return ( QString ) m_module->StripText();
}
-void TextWidget::prevChapter()
+void TextWidget::prevPage()
{
+ (*m_key) -= m_numVerses;
+ setText();
}
void TextWidget::prevVerse()
{
(*m_key)--;
setText();
@@ -97,14 +99,16 @@ void TextWidget::setKey( const QString &newKey )
void TextWidget::nextVerse()
{
(*m_key)++;
setText();
}
-void TextWidget::nextChapter()
+void TextWidget::nextPage()
{
+ (*m_key) += m_numVerses;
+ setText();
}
void TextWidget::slotNumVersesChanged( int numVerses )
{
m_numVerses = numVerses;
setText();
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
@@ -39,17 +39,17 @@ public:
QString getModuleName() { return QString( m_module->Name() ); }
sword::SWModule *getModule() { return m_module; }
QString getCurrVerse();
bool isBibleText() const { return m_isBibleText; }
- void prevChapter();
+ void prevPage();
void prevVerse();
void setKey( const QString &newKey );
void nextVerse();
- void nextChapter();
+ void nextPage();
public slots:
void slotNumVersesChanged( int numVerses );
void slotFontChanged( const QFont *newFont );
void slotOptionChanged();