summaryrefslogtreecommitdiff
authordrw <drw>2005-08-09 22:24:10 (UTC)
committer drw <drw>2005-08-09 22:24:10 (UTC)
commit0c362cbc72dfbff246c0f11417d364b45b50ec94 (patch) (unidiff)
tree6e1fcdc99ff40752343d7b4c99822eba591a2f15
parent873a383cfc4f9184adfe9257500df8c03648b0fd (diff)
downloadopie-0c362cbc72dfbff246c0f11417d364b45b50ec94.zip
opie-0c362cbc72dfbff246c0f11417d364b45b50ec94.tar.gz
opie-0c362cbc72dfbff246c0f11417d364b45b50ec94.tar.bz2
Several updates to Dagger, see /noncore/apps/dagger/ChangeLog for more information
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/dagger/ChangeLog8
-rw-r--r--noncore/apps/dagger/README8
-rw-r--r--noncore/apps/dagger/TODO7
-rw-r--r--noncore/apps/dagger/mainwindow.cpp68
-rw-r--r--noncore/apps/dagger/opie-dagger.control2
-rw-r--r--noncore/apps/dagger/searchbar.cpp2
6 files changed, 51 insertions, 44 deletions
diff --git a/noncore/apps/dagger/ChangeLog b/noncore/apps/dagger/ChangeLog
index 108419e..22b20d4 100644
--- a/noncore/apps/dagger/ChangeLog
+++ b/noncore/apps/dagger/ChangeLog
@@ -1,11 +1,19 @@
12005-08-09 Dan Williams <drw@handhelds.org>
2
3 * Released version 0.9.2
4 * Added support for Sword v1.5.8
5 * Implemented morph tag cross-referencing
6 * Fix crash when last module is closed
7 * Fix display of key when module is opened
8
12004-04-22 Dan Williams <drw@handhelds.org> 92004-04-22 Dan Williams <drw@handhelds.org>
2 10
3 * Released version 0.9.1 11 * Released version 0.9.1
4 * Fixed the disabling of screen blanking 12 * Fixed the disabling of screen blanking
5 * Implement previous/next page scrolling 13 * Implement previous/next page scrolling
6 * Animate search OWait 14 * Animate search OWait
7 15
82004-04-06 Dan Williams <drw@handhelds.org> 162004-04-06 Dan Williams <drw@handhelds.org>
9 17
10 * Released version 0.9.0 18 * Released version 0.9.0
11 * Initial check-in of new application 19 * Initial check-in of new application
diff --git a/noncore/apps/dagger/README b/noncore/apps/dagger/README
index 00e9eed..47b8eee 100644
--- a/noncore/apps/dagger/README
+++ b/noncore/apps/dagger/README
@@ -1,61 +1,61 @@
1/************************************************************************ 1/************************************************************************
2/* 2/*
3/* Opie - Dagger 3/* Opie - Dagger
4/* =============== 4/* ===============
5/* Version 0.9.1 5/* Version 0.9.2
6/* 6/*
7/* A Bible study/reader application 7/* A Bible study/reader application
8/* 8/*
9/************************************************************************ 9/************************************************************************
10 10
11--------------------------------------------- 11---------------------------------------------
12 Release Notes for Opie-Dagger - April, 2004 12 Release Notes for Opie-Dagger - August, 2005
13--------------------------------------------- 13---------------------------------------------
14 14
15====================== 15======================
16= To-do = 16= To-do =
17====================== 17======================
18 18
19- See $OPIEDIR/noncore/apps/dagger/TODO for more info. 19- See $OPIEDIR/noncore/apps/dagger/TODO for more info.
20 20
21====================== 21======================
22= Build = 22= Build =
23====================== 23======================
24 24
25In order to build opie-dagger, libsword needs to be present on 25In order to build opie-dagger, libsword needs to be present on
26the build system along with the appropriate headers. 26the build system along with the appropriate headers.
27 27
28- libsword source (best to use version 1.5.x or greater): 28- libsword source (requires version 1.5.8 or greater):
29 - http://www.crosswire.org/sword/ 29 - http://www.crosswire.org/sword/
30 30
31- the Sword library headers need to be located in an appropriate 31- the Sword library headers need to be located in an appropriate
32 include directory 32 include directory
33 33
34====================== 34======================
35= Run = 35= Run =
36====================== 36======================
37 37
38- In order to use opie-dagger, libsword must be installed 38- In order to use opie-dagger, libsword must be installed
39 on the system. 39 on the system.
40- One or more Sword modules need to be installed, see 40- One or more Sword modules need to be installed, see
41 http://www.crosswire.org/sword/ to download modules 41 http://www.crosswire.org/sword/ to download modules
42- When run for the first time, the path needs to be set to the 42- When run for the first time, the path needs to be set to the
43 directory where the Sword modules are located. Select 'Edit->Configure' 43 directory where the Sword modules are located. Select 'Edit->Configure'
44 from the menu bar and enter the path on the 'General' tab. Restart 44 from the menu bar and enter the path on the 'General' tab. Restart
45 Dagger. 45 Dagger.
46 46
47====================== 47======================
48= Credits = 48= Credits =
49====================== 49======================
50 50
51- Opie-Dagger is (C) 2004 Dan Williams 51- Opie-Dagger is (C) 2004, 2005 Dan Williams
52 52
53====================== 53======================
54= Links = 54= Links =
55====================== 55======================
56 56
57- Opie Project: http://opie.handhelds.org 57- Opie Project: http://opie.handhelds.org
58- OpenZaurus Project: http://openzaurus.org 58- OpenZaurus Project: http://openzaurus.org
59- Familiar Project: http://familiar.handhelds.org 59- Familiar Project: http://familiar.handhelds.org
60- Crosswire Society http://www.crosswire.org/ 60- Crosswire Society http://www.crosswire.org/
61- The Sword Project http://www.crosswire.org/sword/ 61- The Sword Project http://www.crosswire.org/sword/
diff --git a/noncore/apps/dagger/TODO b/noncore/apps/dagger/TODO
index 1530bd6..21426aa 100644
--- a/noncore/apps/dagger/TODO
+++ b/noncore/apps/dagger/TODO
@@ -1,25 +1,28 @@
1/************************************************************************ 1/************************************************************************
2/* 2/*
3/* Opie - Dagger 3/* Opie - Dagger
4/* =============== 4/* ===============
5/* Version 0.9.1 5/* Version 0.9.2
6/* 6/*
7/* A Bible study/reader application 7/* A Bible study/reader application
8/* 8/*
9/************************************************************************ 9/************************************************************************
10 10
11------------------------------------ 11------------------------------------
12To-do for Opie-Dagger - April, 2004 12To-do for Opie-Dagger - August, 2005
13------------------------------------ 13------------------------------------
14 14
15====================== 15======================
16= Current release = 16= Current release =
17====================== 17======================
18 18
191. Implement module installation 191. Implement module installation
202. Fix support for other languages
213. Fix display sleep prevention
224. Implement footnote cross-referencing
20 23
21====================== 24======================
22= Future releases = 25= Future releases =
23====================== 26======================
24 27
251. Margin notes \ No newline at end of file 281. Margin notes \ No newline at end of file
diff --git a/noncore/apps/dagger/mainwindow.cpp b/noncore/apps/dagger/mainwindow.cpp
index 1f2d521..f61df68 100644
--- a/noncore/apps/dagger/mainwindow.cpp
+++ b/noncore/apps/dagger/mainwindow.cpp
@@ -280,96 +280,98 @@ void MainWindow::openModule( const QString &modulename, const QString &key )
280 if ( !m_alwaysOpenNew ) 280 if ( !m_alwaysOpenNew )
281 { 281 {
282 // Try to find if the module is already opened, if so will use that TextWidget 282 // Try to find if the module is already opened, if so will use that TextWidget
283 QObjectList *childlist = queryList( "TextWidget" ); 283 QObjectList *childlist = queryList( "TextWidget" );
284 QObjectListIt it( *childlist ); 284 QObjectListIt it( *childlist );
285 while ( ( tw = reinterpret_cast<TextWidget *>(it.current()) ) != 0 && 285 while ( ( tw = reinterpret_cast<TextWidget *>(it.current()) ) != 0 &&
286 tw->getModuleName() != modulename ) 286 tw->getModuleName() != modulename )
287 ++it; 287 ++it;
288 if ( tw && tw->getModuleName() == modulename ) 288 if ( tw && tw->getModuleName() == modulename )
289 { 289 {
290 // Set key if one is present 290 // Set key if one is present
291 if ( !key.isNull() ) 291 if ( !key.isNull() )
292 tw->setKey( key ); 292 tw->setKey( key );
293 293
294 // Raise tab 294 // Raise tab
295 m_tabs.setCurrentTab( tw ); 295 m_tabs.setCurrentTab( tw );
296 } 296 }
297 } 297 }
298 298
299 if ( m_alwaysOpenNew || !tw ) 299 if ( m_alwaysOpenNew || !tw )
300 { 300 {
301 // Open module in new tab 301 // Open module in new tab
302 QString icon; 302 QString icon;
303 QString type = module->Type(); 303 QString type = module->Type();
304 304
305 if ( type == "Biblical Texts" ) 305 if ( type == "Biblical Texts" )
306 icon = "dagger/bibletext"; 306 icon = "dagger/bibletext";
307 else if ( type == "Commentaries" ) 307 else if ( type == "Commentaries" )
308 icon = "dagger/commentary"; 308 icon = "dagger/commentary";
309 else if ( type == "Lexicons / Dictionaries" ) 309 else if ( type == "Lexicons / Dictionaries" )
310 icon = "dagger/lexicon"; 310 icon = "dagger/lexicon";
311 311
312 tw = new TextWidget( this, module, m_numVerses, &m_textFont ); 312 tw = new TextWidget( this, module, m_numVerses, &m_textFont );
313 connect( tw, SIGNAL(sigRefClicked(const QString &)), 313 connect( tw, SIGNAL(sigRefClicked(const QString &)),
314 this, SLOT(slotTextRefClicked(const QString &)) ); 314 this, SLOT(slotTextRefClicked(const QString &)) );
315 connect( this, SIGNAL(sigNumVersesChanged(int)), tw, SLOT(slotNumVersesChanged(int)) ); 315 connect( this, SIGNAL(sigNumVersesChanged(int)), tw, SLOT(slotNumVersesChanged(int)) );
316 connect( this, SIGNAL(sigFontChanged(const QFont *)), tw, SLOT(slotFontChanged(const QFont *)) ); 316 connect( this, SIGNAL(sigFontChanged(const QFont *)), tw, SLOT(slotFontChanged(const QFont *)) );
317 connect( this, SIGNAL(sigOptionChanged()), tw, SLOT(slotOptionChanged()) ); 317 connect( this, SIGNAL(sigOptionChanged()), tw, SLOT(slotOptionChanged()) );
318 318
319 m_tabs.addTab( tw, icon, modulename ); 319 m_tabs.addTab( tw, icon, modulename );
320 320
321 m_actionTextClose->setEnabled( true ); 321 m_actionTextClose->setEnabled( true );
322 m_actionEditCopy->setEnabled( true ); 322 m_actionEditCopy->setEnabled( true );
323 m_actionBookmarkAdd->setEnabled( true ); 323 m_actionBookmarkAdd->setEnabled( true );
324 324
325 // Set key if one is present 325 // Set key if one is present
326 if ( !key.isNull() ) 326 if ( !key.isNull() )
327 tw->setKey( key ); 327 tw->setKey( key );
328 setCaption( QString( "%1 - Dagger" ).arg( tw->getFullKey() ) );
329 m_navToolbar->setKey( tw->getAbbrevKey() );
328 } 330 }
329 } 331 }
330} 332}
331 333
332int MainWindow::findBookmark( const QString &bookmark ) 334int MainWindow::findBookmark( const QString &bookmark )
333{ 335{
334 int index = 3; 336 int index = 3;
335 int id = m_bookmarkMenu->idAt( index ); 337 int id = m_bookmarkMenu->idAt( index );
336 while ( ( id != -1 ) && ( m_bookmarkMenu->text( id ) != bookmark ) ) 338 while ( ( id != -1 ) && ( m_bookmarkMenu->text( id ) != bookmark ) )
337 { 339 {
338 ++index; 340 ++index;
339 id = m_bookmarkMenu->idAt( index ); 341 id = m_bookmarkMenu->idAt( index );
340 } 342 }
341 343
342 return id; 344 return id;
343} 345}
344 346
345void MainWindow::enableScreenBlanking( bool enable ) 347void MainWindow::enableScreenBlanking( bool enable )
346{ 348{
347 enable ? QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable 349 enable ? QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable
348 : QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::DisableSuspend; 350 : QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::DisableSuspend;
349} 351}
350 352
351void MainWindow::initConfig() 353void MainWindow::initConfig()
352{ 354{
353 bool show; 355 bool show;
354 356
355 m_config.setGroup( "Sword" ); 357 m_config.setGroup( "Sword" );
356 for ( QAction *a = m_actionSwordOpts.first(); a; a = m_actionSwordOpts.next() ) 358 for ( QAction *a = m_actionSwordOpts.first(); a; a = m_actionSwordOpts.next() )
357 { 359 {
358 show = m_config.readBoolEntry( a->text(), false ); 360 show = m_config.readBoolEntry( a->text(), false );
359 a->setOn( show ); 361 a->setOn( show );
360 m_swordMgr->setGlobalOption ( a->text(), show ? "On" : "Off" ); 362 m_swordMgr->setGlobalOption ( a->text(), show ? "On" : "Off" );
361 } 363 }
362 364
363 // Display/hide toolbars based on last run 365 // Display/hide toolbars based on last run
364 m_config.setGroup( "Config" ); 366 m_config.setGroup( "Config" );
365 367
366 m_alwaysOpenNew = m_config.readBoolEntry( "AlwaysOpenNew", false ); 368 m_alwaysOpenNew = m_config.readBoolEntry( "AlwaysOpenNew", false );
367 m_navToolbar->setAutoScrollRate( m_config.readNumEntry( "AutoScroll", 50 ) ); 369 m_navToolbar->setAutoScrollRate( m_config.readNumEntry( "AutoScroll", 50 ) );
368 m_disableScreenBlank = m_config.readBoolEntry( "DisableScreenBlanking", false ); 370 m_disableScreenBlank = m_config.readBoolEntry( "DisableScreenBlanking", false );
369 enableScreenBlanking( !m_disableScreenBlank ); 371 enableScreenBlanking( !m_disableScreenBlank );
370 m_copyFormat = m_config.readNumEntry( "CopyFormat", 0 ); 372 m_copyFormat = m_config.readNumEntry( "CopyFormat", 0 );
371 373
372 show = m_config.readBoolEntry( "NavBar", false ); 374 show = m_config.readBoolEntry( "NavBar", false );
373 m_actionViewNavToolbar->setOn( show ); 375 m_actionViewNavToolbar->setOn( show );
374 slotViewNavToolbar( show ); 376 slotViewNavToolbar( show );
375 377
@@ -589,165 +591,159 @@ void MainWindow::slotBookmarkSelected()
589 openModule( module, key ); 591 openModule( module, key );
590 } 592 }
591} 593}
592 594
593void MainWindow::slotViewSwordOption( bool enabled ) 595void MainWindow::slotViewSwordOption( bool enabled )
594{ 596{
595 const QAction *action = reinterpret_cast<const QAction*>(sender()); 597 const QAction *action = reinterpret_cast<const QAction*>(sender());
596 m_swordMgr->setGlobalOption ( action->text(), enabled ? "On" : "Off" ); 598 m_swordMgr->setGlobalOption ( action->text(), enabled ? "On" : "Off" );
597 599
598 emit sigOptionChanged(); 600 emit sigOptionChanged();
599} 601}
600 602
601void MainWindow::slotViewNavToolbar( bool enabled ) 603void MainWindow::slotViewNavToolbar( bool enabled )
602{ 604{
603 enabled ? m_navToolbar->show() 605 enabled ? m_navToolbar->show()
604 : m_navToolbar->hide(); 606 : m_navToolbar->hide();
605} 607}
606 608
607void MainWindow::slotViewSearchToolbar( bool enabled ) 609void MainWindow::slotViewSearchToolbar( bool enabled )
608{ 610{
609 enabled ? m_searchToolbar->show() 611 enabled ? m_searchToolbar->show()
610 : m_searchToolbar->hide(); 612 : m_searchToolbar->hide();
611} 613}
612 614
613void MainWindow::slotNavPrevPage() 615void MainWindow::slotNavPrevPage()
614{ 616{
615 TextWidget *text = reinterpret_cast<TextWidget *>(m_tabs.currentWidget()); 617 TextWidget *text = reinterpret_cast<TextWidget *>(m_tabs.currentWidget());
616 if ( text ) 618 if ( text )
617 { 619 {
618 text->prevPage(); 620 text->prevPage();
619 setCaption( QString( "%1 - Dagger" ).arg( text->getFullKey() ) ); 621 setCaption( QString( "%1 - Dagger" ).arg( text->getFullKey() ) );
620 m_navToolbar->setKey( text->getAbbrevKey() ); 622 m_navToolbar->setKey( text->getAbbrevKey() );
621 } 623 }
622} 624}
623 625
624void MainWindow::slotNavPrevVerse() 626void MainWindow::slotNavPrevVerse()
625{ 627{
626 TextWidget *text = reinterpret_cast<TextWidget *>(m_tabs.currentWidget()); 628 TextWidget *text = reinterpret_cast<TextWidget *>(m_tabs.currentWidget());
627 if ( text ) 629 if ( text )
628 { 630 {
629 text->prevVerse(); 631 text->prevVerse();
630 setCaption( QString( "%1 - Dagger" ).arg( text->getFullKey() ) ); 632 setCaption( QString( "%1 - Dagger" ).arg( text->getFullKey() ) );
631 m_navToolbar->setKey( text->getAbbrevKey() ); 633 m_navToolbar->setKey( text->getAbbrevKey() );
632 } 634 }
633} 635}
634 636
635void MainWindow::slotNavKeyChanged( const QString &newKey ) 637void MainWindow::slotNavKeyChanged( const QString &newKey )
636{ 638{
637 QString key = newKey;
638 key.replace( QRegExp( "[-=.]" ), ":" );
639
640 TextWidget *text = reinterpret_cast<TextWidget *>(m_tabs.currentWidget()); 639 TextWidget *text = reinterpret_cast<TextWidget *>(m_tabs.currentWidget());
641 if ( text ) 640 if ( text )
642 { 641 {
642 QString key = newKey;
643 if ( text->isBibleText() )
644 key.replace( QRegExp( "[-=.]" ), ":" );
645
643 text->setKey( key ); 646 text->setKey( key );
644 setCaption( QString( "%1 - Dagger" ).arg( text->getFullKey() ) ); 647 setCaption( QString( "%1 - Dagger" ).arg( text->getFullKey() ) );
645 } 648 }
646} 649}
647 650
648void MainWindow::slotNavNextVerse() 651void MainWindow::slotNavNextVerse()
649{ 652{
650 TextWidget *text = reinterpret_cast<TextWidget *>(m_tabs.currentWidget()); 653 TextWidget *text = reinterpret_cast<TextWidget *>(m_tabs.currentWidget());
651 if ( text ) 654 if ( text )
652 { 655 {
653 text->nextVerse(); 656 text->nextVerse();
654 setCaption( QString( "%1 - Dagger" ).arg( text->getFullKey() ) ); 657 setCaption( QString( "%1 - Dagger" ).arg( text->getFullKey() ) );
655 m_navToolbar->setKey( text->getAbbrevKey() ); 658 m_navToolbar->setKey( text->getAbbrevKey() );
656 } 659 }
657} 660}
658 661
659void MainWindow::slotNavNextPage() 662void MainWindow::slotNavNextPage()
660{ 663{
661 TextWidget *text = reinterpret_cast<TextWidget *>(m_tabs.currentWidget()); 664 TextWidget *text = reinterpret_cast<TextWidget *>(m_tabs.currentWidget());
662 if ( text ) 665 if ( text )
663 { 666 {
664 text->nextPage(); 667 text->nextPage();
665 setCaption( QString( "%1 - Dagger" ).arg( text->getFullKey() ) ); 668 setCaption( QString( "%1 - Dagger" ).arg( text->getFullKey() ) );
666 m_navToolbar->setKey( text->getAbbrevKey() ); 669 m_navToolbar->setKey( text->getAbbrevKey() );
667 } 670 }
668} 671}
669 672
670void MainWindow::slotNavAutoScroll( bool enabled ) 673void MainWindow::slotNavAutoScroll( bool enabled )
671{ 674{
672 m_autoScrollTimer.stop(); 675 m_autoScrollTimer.stop();
673 676
674 if ( enabled ) 677 if ( enabled )
675 m_autoScrollTimer.start( m_navToolbar->autoScrollRate() * 100 ); 678 m_autoScrollTimer.start( m_navToolbar->autoScrollRate() * 100 );
676} 679}
677 680
678void MainWindow::slotNavScrollRateChanged( int newRate ) 681void MainWindow::slotNavScrollRateChanged( int newRate )
679{ 682{
680 if ( m_autoScrollTimer.isActive() ) 683 if ( m_autoScrollTimer.isActive() )
681 { 684 {
682 m_autoScrollTimer.stop(); 685 m_autoScrollTimer.stop();
683 m_autoScrollTimer.start( newRate * 100 ); 686 m_autoScrollTimer.start( newRate * 100 );
684 } 687 }
685} 688}
686 689
687void MainWindow::slotSearchResultClicked( const QString &key ) 690void MainWindow::slotSearchResultClicked( const QString &key )
688{ 691{
689 TextWidget *text = reinterpret_cast<TextWidget *>(m_tabs.currentWidget()); 692 TextWidget *text = reinterpret_cast<TextWidget *>(m_tabs.currentWidget());
690 if ( text ) 693 if ( text )
691 { 694 {
692 text->setKey( key ); 695 text->setKey( key );
693 setCaption( QString( "%1 - Dagger" ).arg( text->getFullKey() ) ); 696 setCaption( QString( "%1 - Dagger" ).arg( text->getFullKey() ) );
694 m_navToolbar->setKey( text->getAbbrevKey() ); 697 m_navToolbar->setKey( text->getAbbrevKey() );
695 } 698 }
696} 699}
697 700
698void MainWindow::slotTextRefClicked( const QString &ref ) 701void MainWindow::slotTextRefClicked( const QString &ref )
699{ 702{
700//printf( "Ref clicked: '%s'\n", ref.latin1() ); 703//printf( "Ref clicked: '%s'\n", ref.latin1() );
701/* 704/*
702Ref clicked: 'type=Strongs value=G3482' 705Ref clicked: 'passagestudy.jsp?action=showStrongs&type=Hebrew&value=07225'
703Ref clicked: 'type=Strongs value=H07225' 706Ref clicked: 'passagestudy.jsp?action=showStrongs&type=Greek&value=602'
704Ref clicked: 'type=morph class=x-Robinson:N-PRI value=N-PRI' 707Ref clicked: 'passagestudy.jsp?action=showMorph&type=x-Robinson%3AN-NSF&value=N-NSF'
705Ref clicked: 'type=morph class=x-StrongsMorph:TH8804 value=TH8804' 708Ref clicked: 'passagestudy.jsp?action=showNote&type=n&value=1&module=KJV&passage=Genesis+1%3A5'
706*/ 709*/
707 //owarn << "Reference: " << ref << oendl; 710 //owarn << "Reference: " << ref << oendl;
708 if ( !ref.isNull() ) 711 if ( !ref.isNull() )
709 { 712 {
710 TextWidget *text = reinterpret_cast<TextWidget *>(m_tabs.currentWidget()); 713 TextWidget *text = reinterpret_cast<TextWidget *>(m_tabs.currentWidget());
711 if ( text ) 714 if ( text )
712 { 715 {
716 // Parse action
717 int pos = ref.find( '&', 28 );
718 QString actionStr = ref.mid( 28, pos - 28 );
719
713 // Parse type 720 // Parse type
714 int pos = ref.find( "type=", 0, false ) + 5; 721 pos = ref.find( "type=", pos, false ) + 5;
715 QString typeStr = ref.mid( pos, ref.find( ' ', pos ) - pos ); 722 QString typeStr = ref.mid( pos, ref.find( '&', pos ) - pos );
716 723
717 // Parse class (for morph. only)
718 QString classStr;
719 if ( typeStr == "morph" )
720 {
721 pos = ref.find( "class=", 0, false ) + 5;
722 QString classStr = ref.mid( pos, ref.find( ' ', pos ) - pos );
723
724 // TODO - need to strip 'x-' from beginning and ':key' at end?
725 }
726
727 // Parse value 724 // Parse value
728 pos = ref.find( "value=", 0, false ) + 6; 725 pos = ref.find( "value=", 0, false ) + 6;
729 QString valueStr = ref.mid( pos, ref.find( ' ', pos ) - pos ); 726 QString valueStr = ref.mid( pos, ref.find( ' ', pos ) - pos );
730 727
731 if ( typeStr == "Strongs" ) 728 if ( actionStr == "Strongs" )
729 {
730 QString module = actionStr;
731 module.append( typeStr );
732
733 // Open reference
734 openModule( module, valueStr );
735 }
736 else if ( actionStr == "Morph" )
732 { 737 {
733 //Determine if is a Hebrew or Greek reference 738 QString module = typeStr.mid( 2, typeStr.find( '%', 2 ) - 2 );
734 QString module; 739
735 if ( valueStr.at( 0 ) == 'H' )
736 module = "StrongsHebrew";
737 else
738 module = "StrongsGreek";
739
740 // Get key
741 QString key( valueStr );
742 key.remove( 0, 1 );
743 // Open reference 740 // Open reference
744 openModule( module, key ); 741 openModule( module, valueStr );
745 } 742 }
746 else if ( typeStr == "morph" ) 743 else if ( actionStr == "Note" )
747 { 744 {
748 QMessageBox::information( this, tr( "Morphological Tags" ), 745 // TODO
749 tr( "Morphological tag cross-referencing not implemented yet." ) );
750 } 746 }
751 } 747 }
752 } 748 }
753} 749}
diff --git a/noncore/apps/dagger/opie-dagger.control b/noncore/apps/dagger/opie-dagger.control
index 4ded1f2..e613ddb 100644
--- a/noncore/apps/dagger/opie-dagger.control
+++ b/noncore/apps/dagger/opie-dagger.control
@@ -1,9 +1,9 @@
1Package: opie-dagger 1Package: 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
6Architecture: arm 6Architecture: arm
7Maintainer: Dan Williams (drw@handhelds.org) 7Maintainer: Dan Williams (drw@handhelds.org)
8Description: A Bible study program utilizing the Sword library. 8Description: A Bible study program utilizing the Sword library.
9Version: 0.9.1$EXTRAVERSION 9Version: 0.9.2$EXTRAVERSION
diff --git a/noncore/apps/dagger/searchbar.cpp b/noncore/apps/dagger/searchbar.cpp
index b195f67..463a19f 100644
--- a/noncore/apps/dagger/searchbar.cpp
+++ b/noncore/apps/dagger/searchbar.cpp
@@ -46,97 +46,97 @@ SearchBar::SearchBar( QMainWindow *parent )
46 setStretchableWidget( m_searchText ); 46 setStretchableWidget( m_searchText );
47 QWhatsThis::add( m_searchText, tr( "Enter text to search for here." ) ); 47 QWhatsThis::add( m_searchText, tr( "Enter text to search for here." ) );
48 connect(m_searchText, SIGNAL(textChanged(const QString &)), 48 connect(m_searchText, SIGNAL(textChanged(const QString &)),
49 this, SLOT(slotTextChanged(const QString &)) ); 49 this, SLOT(slotTextChanged(const QString &)) );
50 50
51 m_actionFind = new QAction( tr( "Find" ), 51 m_actionFind = new QAction( tr( "Find" ),
52 Opie::Core::OResource::loadPixmap( "find", Opie::Core::OResource::SmallIcon ), 52 Opie::Core::OResource::loadPixmap( "find", Opie::Core::OResource::SmallIcon ),
53 QString::null, 0, this, 0 ); 53 QString::null, 0, this, 0 );
54 m_actionFind->setEnabled( false ); 54 m_actionFind->setEnabled( false );
55 m_actionFind->addTo( this ); 55 m_actionFind->addTo( this );
56 m_actionFind->setWhatsThis( tr( "Tap here search the current module for the text entered to the left." ) ); 56 m_actionFind->setWhatsThis( tr( "Tap here search the current module for the text entered to the left." ) );
57 connect( m_actionFind, SIGNAL(activated()), this, SLOT(slotFind()) ); 57 connect( m_actionFind, SIGNAL(activated()), this, SLOT(slotFind()) );
58 58
59 addSeparator(); 59 addSeparator();
60 60
61 m_actionPrev = new QAction( tr( "Previous result" ), 61 m_actionPrev = new QAction( tr( "Previous result" ),
62 Opie::Core::OResource::loadPixmap( "back", Opie::Core::OResource::SmallIcon ), 62 Opie::Core::OResource::loadPixmap( "back", Opie::Core::OResource::SmallIcon ),
63 QString::null, 0, this, 0 ); 63 QString::null, 0, this, 0 );
64 m_actionPrev->setEnabled( false ); 64 m_actionPrev->setEnabled( false );
65 m_actionPrev->addTo( this ); 65 m_actionPrev->addTo( this );
66 m_actionPrev->setWhatsThis( tr( "Tap here to view the previous search result." ) ); 66 m_actionPrev->setWhatsThis( tr( "Tap here to view the previous search result." ) );
67 connect( m_actionPrev, SIGNAL(activated()), this, SLOT(slotPrev()) ); 67 connect( m_actionPrev, SIGNAL(activated()), this, SLOT(slotPrev()) );
68 68
69 m_resultList = new QComboBox( this ); 69 m_resultList = new QComboBox( this );
70 m_resultList->setEnabled( false ); 70 m_resultList->setEnabled( false );
71 QWhatsThis::add( m_resultList, tr( "Select the desired search result here." ) ); 71 QWhatsThis::add( m_resultList, tr( "Select the desired search result here." ) );
72 connect( m_resultList, SIGNAL(activated(const QString &)), this, SIGNAL(sigResultClicked(const QString &)) ); 72 connect( m_resultList, SIGNAL(activated(const QString &)), this, SIGNAL(sigResultClicked(const QString &)) );
73 73
74 m_actionNext = new QAction( tr( "Next result" ), 74 m_actionNext = new QAction( tr( "Next result" ),
75 Opie::Core::OResource::loadPixmap( "forward", Opie::Core::OResource::SmallIcon ), 75 Opie::Core::OResource::loadPixmap( "forward", Opie::Core::OResource::SmallIcon ),
76 QString::null, 0, this, 0 ); 76 QString::null, 0, this, 0 );
77 m_actionNext->setEnabled( false ); 77 m_actionNext->setEnabled( false );
78 m_actionNext->addTo( this ); 78 m_actionNext->addTo( this );
79 m_actionNext->setWhatsThis( tr( "Tap here to view the next search result." ) ); 79 m_actionNext->setWhatsThis( tr( "Tap here to view the next search result." ) );
80 connect( m_actionNext, SIGNAL(activated()), this, SLOT(slotNext()) ); 80 connect( m_actionNext, SIGNAL(activated()), this, SLOT(slotNext()) );
81 81
82 if ( parent ) 82 if ( parent )
83 { 83 {
84 installEventFilter( parent ); 84 installEventFilter( parent );
85 // TODO - install for all controls 85 // TODO - install for all controls
86 m_searchText->installEventFilter( parent ); 86 m_searchText->installEventFilter( parent );
87 } 87 }
88} 88}
89 89
90void SearchBar::setCurrModule( TextWidget *currText ) 90void SearchBar::setCurrModule( TextWidget *currText )
91{ 91{
92 m_actionFind->setEnabled( ( m_searchText->text() != "" ) && currText ); 92 m_actionFind->setEnabled( ( m_searchText->text() != "" ) && currText );
93 93
94 if ( !m_currText || ( currText->getModuleName() != m_currText->getModuleName() ) ) 94 if ( !m_currText || !currText || ( currText->getModuleName() != m_currText->getModuleName() ) )
95 { 95 {
96 m_actionPrev->setEnabled( false ); 96 m_actionPrev->setEnabled( false );
97 m_resultList->clear(); 97 m_resultList->clear();
98 m_resultList->setEnabled( false ); 98 m_resultList->setEnabled( false );
99 m_actionNext->setEnabled( false ); 99 m_actionNext->setEnabled( false );
100 } 100 }
101 101
102 m_currText = currText; 102 m_currText = currText;
103} 103}
104 104
105void SearchBar::slotTextChanged( const QString &newText ) 105void SearchBar::slotTextChanged( const QString &newText )
106{ 106{
107 m_actionFind->setEnabled( ( newText != "" ) && m_currText ); 107 m_actionFind->setEnabled( ( newText != "" ) && m_currText );
108} 108}
109 109
110void SearchBar::slotFind() 110void SearchBar::slotFind()
111{ 111{
112 m_resultList->clear(); 112 m_resultList->clear();
113 113
114 // Change application title and display Opie wait dialog to indicate search is beginning 114 // Change application title and display Opie wait dialog to indicate search is beginning
115 QWidget *pWidget = reinterpret_cast<QWidget *>(parent()); 115 QWidget *pWidget = reinterpret_cast<QWidget *>(parent());
116 QString caption = pWidget->caption(); 116 QString caption = pWidget->caption();
117 pWidget->setCaption( "Searching..." ); 117 pWidget->setCaption( "Searching..." );
118 118
119 Opie::Ui::OWait wait( pWidget ); 119 Opie::Ui::OWait wait( pWidget );
120 wait.show(); 120 wait.show();
121 qApp->processEvents(); 121 qApp->processEvents();
122 122
123 // Perform search 123 // Perform search
124 // TODO - implement search callback function to animate wait cursor 124 // TODO - implement search callback function to animate wait cursor
125 sword::ListKey results = m_currText->getModule()->Search( m_searchText->text().latin1(), 0, REG_ICASE, 0, 0, 125 sword::ListKey results = m_currText->getModule()->Search( m_searchText->text().latin1(), 0, REG_ICASE, 0, 0,
126 &searchCallback ); 126 &searchCallback );
127 127
128 // Process results 128 // Process results
129 int count = results.Count(); 129 int count = results.Count();
130 bool found = count > 0; 130 bool found = count > 0;
131 if ( found ) 131 if ( found )
132 { 132 {
133 // Populate results combo box 133 // Populate results combo box
134 sword::VerseKey key; 134 sword::VerseKey key;
135 for ( int i = 0; i < count; i++ ) 135 for ( int i = 0; i < count; i++ )
136 { 136 {
137 key.setText( results.GetElement( i )->getText() ); 137 key.setText( results.GetElement( i )->getText() );
138 m_resultList->insertItem( key.getShortText() ); 138 m_resultList->insertItem( key.getShortText() );
139 } 139 }
140 140
141 // Goto first result in list 141 // Goto first result in list
142 m_resultList->setCurrentItem( 0 ); 142 m_resultList->setCurrentItem( 0 );