summaryrefslogtreecommitdiff
authordrw <drw>2005-08-31 19:21:49 (UTC)
committer drw <drw>2005-08-31 19:21:49 (UTC)
commit8a74037f6174f187ea3f5583d6c253752792128a (patch) (unidiff)
treeebe25ecf0a341c01b696904a5245e3f3e9778db7
parent465eb3107bb32ad7ab2d726d8a510538fca56764 (diff)
downloadopie-8a74037f6174f187ea3f5583d6c253752792128a.zip
opie-8a74037f6174f187ea3f5583d6c253752792128a.tar.gz
opie-8a74037f6174f187ea3f5583d6c253752792128a.tar.bz2
Fix support for non-English language texts
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/dagger/ChangeLog5
-rw-r--r--noncore/apps/dagger/README2
-rw-r--r--noncore/apps/dagger/TODO7
-rw-r--r--noncore/apps/dagger/opie-dagger.control2
-rw-r--r--noncore/apps/dagger/textwidget.cpp2
5 files changed, 11 insertions, 7 deletions
diff --git a/noncore/apps/dagger/ChangeLog b/noncore/apps/dagger/ChangeLog
index 22b20d4..804a899 100644
--- a/noncore/apps/dagger/ChangeLog
+++ b/noncore/apps/dagger/ChangeLog
@@ -1,19 +1,24 @@
12005-08-31 Dan Williams <drw@handhelds.org>
2
3 * Released version 0.9.3
4 * Fix support for non-English languages
5
12005-08-09 Dan Williams <drw@handhelds.org> 62005-08-09 Dan Williams <drw@handhelds.org>
2 7
3 * Released version 0.9.2 8 * Released version 0.9.2
4 * Added support for Sword v1.5.8 9 * Added support for Sword v1.5.8
5 * Implemented morph tag cross-referencing 10 * Implemented morph tag cross-referencing
6 * Fix crash when last module is closed 11 * Fix crash when last module is closed
7 * Fix display of key when module is opened 12 * Fix display of key when module is opened
8 13
92004-04-22 Dan Williams <drw@handhelds.org> 142004-04-22 Dan Williams <drw@handhelds.org>
10 15
11 * Released version 0.9.1 16 * Released version 0.9.1
12 * Fixed the disabling of screen blanking 17 * Fixed the disabling of screen blanking
13 * Implement previous/next page scrolling 18 * Implement previous/next page scrolling
14 * Animate search OWait 19 * Animate search OWait
15 20
162004-04-06 Dan Williams <drw@handhelds.org> 212004-04-06 Dan Williams <drw@handhelds.org>
17 22
18 * Released version 0.9.0 23 * Released version 0.9.0
19 * Initial check-in of new application 24 * Initial check-in of new application
diff --git a/noncore/apps/dagger/README b/noncore/apps/dagger/README
index 47b8eee..9ca0d8c 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.2 5/* Version 0.9.3
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 - August, 2005 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 (requires version 1.5.8 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, 2005 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 21426aa..28bda6f 100644
--- a/noncore/apps/dagger/TODO
+++ b/noncore/apps/dagger/TODO
@@ -1,28 +1,27 @@
1/************************************************************************ 1/************************************************************************
2/* 2/*
3/* Opie - Dagger 3/* Opie - Dagger
4/* =============== 4/* ===============
5/* Version 0.9.2 5/* Version 0.9.3
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 - August, 2005 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 202. Fix display sleep prevention
213. Fix display sleep prevention 213. Implement footnote cross-referencing
224. Implement footnote cross-referencing
23 22
24====================== 23======================
25= Future releases = 24= Future releases =
26====================== 25======================
27 26
281. Margin notes \ No newline at end of file 271. Margin notes \ No newline at end of file
diff --git a/noncore/apps/dagger/opie-dagger.control b/noncore/apps/dagger/opie-dagger.control
index e613ddb..dde696a 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.2$EXTRAVERSION 9Version: 0.9.3$EXTRAVERSION
diff --git a/noncore/apps/dagger/textwidget.cpp b/noncore/apps/dagger/textwidget.cpp
index 9f7de66..2df6455 100644
--- a/noncore/apps/dagger/textwidget.cpp
+++ b/noncore/apps/dagger/textwidget.cpp
@@ -1,187 +1,187 @@
1/* 1/*
2Dagger - A Bible study program utilizing the Sword library. 2Dagger - A Bible study program utilizing the Sword library.
3Copyright (c) 2004 Dan Williams <drw@handhelds.org> 3Copyright (c) 2004 Dan Williams <drw@handhelds.org>
4 4
5This file is free software; you can redistribute it and/or modify it under 5This file is free software; you can redistribute it and/or modify it under
6the terms of the GNU General Public License as published by the Free Software 6the terms of the GNU General Public License as published by the Free Software
7Foundation; either version 2 of the License, or (at your option) any later version. 7Foundation; either version 2 of the License, or (at your option) any later version.
8 8
9This file is distributed in the hope that it will be useful, but WITHOUT ANY 9This file is distributed in the hope that it will be useful, but WITHOUT ANY
10WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 10WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11PARTICULAR PURPOSE. See the GNU General Public License for more details. 11PARTICULAR PURPOSE. See the GNU General Public License for more details.
12 12
13You should have received a copy of the GNU General Public License along with this 13You should have received a copy of the GNU General Public License along with this
14file; see the file COPYING. If not, write to the Free Software Foundation, Inc., 14file; see the file COPYING. If not, write to the Free Software Foundation, Inc.,
1559 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 1559 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16*/ 16*/
17 17
18#include "textwidget.h" 18#include "textwidget.h"
19 19
20#include <qlayout.h> 20#include <qlayout.h>
21#include <qtextbrowser.h> 21#include <qtextbrowser.h>
22 22
23#include <versekey.h> 23#include <versekey.h>
24 24
25TextWidget::TextWidget( QWidget *parent, sword::SWModule *module, int numVerses, const QFont *font ) 25TextWidget::TextWidget( QWidget *parent, sword::SWModule *module, int numVerses, const QFont *font )
26 : QWidget( parent, 0x0, 0x0 ) 26 : QWidget( parent, 0x0, 0x0 )
27 , m_module( module ) 27 , m_module( module )
28 , m_numVerses( numVerses ) 28 , m_numVerses( numVerses )
29{ 29{
30 if ( parent ) 30 if ( parent )
31 installEventFilter( parent ); 31 installEventFilter( parent );
32 32
33 QVBoxLayout *layout = new QVBoxLayout( this, 2, 2 ); 33 QVBoxLayout *layout = new QVBoxLayout( this, 2, 2 );
34 34
35 m_textView = new QTextBrowser( this ); 35 m_textView = new QTextBrowser( this );
36 m_textView->installEventFilter( parent ); 36 m_textView->installEventFilter( parent );
37 m_textView->setMinimumHeight( 20 ); 37 m_textView->setMinimumHeight( 20 );
38 m_textView->setHScrollBarMode( QTextView::AlwaysOff ); 38 m_textView->setHScrollBarMode( QTextView::AlwaysOff );
39 m_textView->setTextFormat( QTextView::RichText ); 39 m_textView->setTextFormat( QTextView::RichText );
40 connect( m_textView, SIGNAL(highlighted(const QString &)), 40 connect( m_textView, SIGNAL(highlighted(const QString &)),
41 this, SIGNAL(sigRefClicked(const QString &)) ); 41 this, SIGNAL(sigRefClicked(const QString &)) );
42 layout->addWidget( m_textView ); 42 layout->addWidget( m_textView );
43 43
44 // Set font 44 // Set font
45 if ( font ) 45 if ( font )
46 setFont( *font ); 46 setFont( *font );
47 47
48 // Set initial text 48 // Set initial text
49 if ( m_module ) 49 if ( m_module )
50 { 50 {
51 m_isBibleText = !strcmp( module->Type(), "Biblical Texts" ); 51 m_isBibleText = !strcmp( module->Type(), "Biblical Texts" );
52 if ( m_isBibleText ) 52 if ( m_isBibleText )
53 { 53 {
54 m_key = new sword::VerseKey( "g" ); 54 m_key = new sword::VerseKey( "g" );
55 55
56 //connect( m_textView, SIGNAL(highlighted(const QString&)), 56 //connect( m_textView, SIGNAL(highlighted(const QString&)),
57 // this, SLOT(slotReferenceClicked(const QString&)) ); 57 // this, SLOT(slotReferenceClicked(const QString&)) );
58 //connect( parent, SIGNAL( strongsNumbers( bool ) ), this, SLOT( slotStrongsNumbers( bool ) ) ); 58 //connect( parent, SIGNAL( strongsNumbers( bool ) ), this, SLOT( slotStrongsNumbers( bool ) ) );
59 } 59 }
60 else 60 else
61 { 61 {
62 m_key = new sword::SWKey( "" ); 62 m_key = new sword::SWKey( "" );
63 } 63 }
64 m_module->SetKey( m_key ); 64 m_module->SetKey( m_key );
65 setText(); 65 setText();
66 } 66 }
67} 67}
68 68
69TextWidget::~TextWidget() 69TextWidget::~TextWidget()
70{ 70{
71 // TODO - why does this cause a SIGSEV??? 71 // TODO - why does this cause a SIGSEV???
72 //delete m_key; 72 //delete m_key;
73} 73}
74 74
75QString TextWidget::getCurrVerse() 75QString TextWidget::getCurrVerse()
76{ 76{
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::prevPage() 81void TextWidget::prevPage()
82{ 82{
83 (*m_key) -= m_numVerses; 83 (*m_key) -= m_numVerses;
84 setText(); 84 setText();
85} 85}
86 86
87void TextWidget::prevVerse() 87void TextWidget::prevVerse()
88{ 88{
89 (*m_key)--; 89 (*m_key)--;
90 setText(); 90 setText();
91} 91}
92 92
93void TextWidget::setKey( const QString &newKey ) 93void TextWidget::setKey( const QString &newKey )
94{ 94{
95 m_key->setText( newKey.latin1() ); 95 m_key->setText( newKey.latin1() );
96 setText(); 96 setText();
97} 97}
98 98
99void TextWidget::nextVerse() 99void TextWidget::nextVerse()
100{ 100{
101 (*m_key)++; 101 (*m_key)++;
102 setText(); 102 setText();
103} 103}
104 104
105void TextWidget::nextPage() 105void TextWidget::nextPage()
106{ 106{
107 (*m_key) += m_numVerses; 107 (*m_key) += m_numVerses;
108 setText(); 108 setText();
109} 109}
110 110
111void TextWidget::slotNumVersesChanged( int numVerses ) 111void TextWidget::slotNumVersesChanged( int numVerses )
112{ 112{
113 m_numVerses = numVerses; 113 m_numVerses = numVerses;
114 setText(); 114 setText();
115} 115}
116 116
117void TextWidget::slotFontChanged( const QFont *newFont ) 117void TextWidget::slotFontChanged( const QFont *newFont )
118{ 118{
119 setFont( *newFont ); 119 setFont( *newFont );
120 // TODO - shouldn't have to reset text, but couldn't get repaint() to work 120 // TODO - shouldn't have to reset text, but couldn't get repaint() to work
121 setText(); 121 setText();
122} 122}
123 123
124void TextWidget::slotOptionChanged() 124void TextWidget::slotOptionChanged()
125{ 125{
126 setText(); 126 setText();
127} 127}
128 128
129void TextWidget::setText() 129void TextWidget::setText()
130{ 130{
131 if ( m_key->Error() ) 131 if ( m_key->Error() )
132 return; 132 return;
133 133
134 m_module->SetKey( m_key->getText() ); 134 m_module->SetKey( m_key->getText() );
135 m_fullKey = QString( "%1 (%2)" ).arg( m_key->getShortText() ).arg( m_module->Name() ); 135 m_fullKey = QString( "%1 (%2)" ).arg( m_key->getShortText() ).arg( m_module->Name() );
136 136
137 if ( m_isBibleText ) 137 if ( m_isBibleText )
138 { 138 {
139 m_textView->setVScrollBarMode( QTextView::AlwaysOff ); 139 m_textView->setVScrollBarMode( QTextView::AlwaysOff );
140 140
141 m_abbrevKey = m_key->getShortText(); 141 m_abbrevKey = m_key->getShortText();
142 142
143 QString fullText; 143 QString fullText;
144 144
145 for ( int i = 0; i < m_numVerses; i++ ) 145 for ( int i = 0; i < m_numVerses; i++ )
146 { 146 {
147 QString key = ( QString ) m_module->KeyText(); 147 QString key = ( QString ) m_module->KeyText();
148 QString verseStr = ( QString ) *m_module; 148 QString verseStr = QString::fromUtf8( *m_module );
149 149
150 // Format current verse (adding chapter and/or book headings if necessary) 150 // Format current verse (adding chapter and/or book headings if necessary)
151 int verse = static_cast<sword::VerseKey>(m_module->Key()).Verse(); 151 int verse = static_cast<sword::VerseKey>(m_module->Key()).Verse();
152 if ( verse == 1 ) 152 if ( verse == 1 )
153 { 153 {
154 int chapter = static_cast<sword::VerseKey>(m_module->Key()).Chapter(); 154 int chapter = static_cast<sword::VerseKey>(m_module->Key()).Chapter();
155 if ( chapter == 1 ) 155 if ( chapter == 1 )
156 { 156 {
157 QString book = static_cast<sword::VerseKey>(m_module->Key()).getBookName(); 157 QString book = static_cast<sword::VerseKey>(m_module->Key()).getBookName();
158 verseStr = QString( "<p><center><big><b>%1</b></big></center><br><center><b>Chapter %1</b></center><p><b>%2</b>&nbsp;%3<p>" ) 158 verseStr = QString( "<p><center><big><b>%1</b></big></center><br><center><b>Chapter %1</b></center><p><b>%2</b>&nbsp;%3<p>" )
159 .arg( book ).arg( chapter ).arg( verse ).arg( verseStr ); 159 .arg( book ).arg( chapter ).arg( verse ).arg( verseStr );
160 } 160 }
161 else 161 else
162 { 162 {
163 verseStr = QString( "<center><b>Chapter %1</b></center><p><b>%2</b>&nbsp;%3<p>" ) 163 verseStr = QString( "<center><b>Chapter %1</b></center><p><b>%2</b>&nbsp;%3<p>" )
164 .arg( chapter ).arg( verse ).arg( verseStr ); 164 .arg( chapter ).arg( verse ).arg( verseStr );
165 } 165 }
166 } 166 }
167 else 167 else
168 { 168 {
169 verseStr = QString( "<b>%1</b>&nbsp;%2<p>" ).arg( verse ).arg( verseStr ); 169 verseStr = QString( "<b>%1</b>&nbsp;%2<p>" ).arg( verse ).arg( verseStr );
170 } 170 }
171 171
172 fullText.append( verseStr ); 172 fullText.append( verseStr );
173 173
174 m_module->Key()++; 174 m_module->Key()++;
175 175
176 if ( m_module->Key().Error() ) 176 if ( m_module->Key().Error() )
177 break; 177 break;
178 } 178 }
179 179
180 m_textView->setText( fullText ); 180 m_textView->setText( fullText );
181 } 181 }
182 else // !isBibleText 182 else // !isBibleText
183 { 183 {
184 m_abbrevKey = m_key->getText(); 184 m_abbrevKey = m_key->getText();
185 m_textView->setText( ( QString ) *m_module ); 185 m_textView->setText( ( QString ) *m_module );
186 } 186 }
187} 187}