[sword-svn] r212 - trunk/src/SwordReader_GUI
dtrotzjr at crosswire.org
dtrotzjr at crosswire.org
Sun Feb 1 23:04:10 MST 2009
Author: dtrotzjr
Date: 2009-02-01 23:04:10 -0700 (Sun, 01 Feb 2009)
New Revision: 212
Modified:
trunk/src/SwordReader_GUI/SRAboutView.cpp
trunk/src/SwordReader_GUI/SRLexiView.cpp
trunk/src/SwordReader_GUI/SRLexiView.h
trunk/src/SwordReader_GUI/SRMainFrame.cpp
trunk/src/SwordReader_GUI/SRModuleView.cpp
trunk/src/SwordReader_GUI/SRModuleWidget.cpp
trunk/src/SwordReader_GUI/SRModuleWidget.h
trunk/src/SwordReader_GUI/SRTabbedViews.cpp
trunk/src/SwordReader_GUI/SwordReaderResource.h
Log:
Rearranged the About window somewhat.
Added extra checks for null pointers when only a single (presumably KJV) bible is available.
Modified: trunk/src/SwordReader_GUI/SRAboutView.cpp
===================================================================
--- trunk/src/SwordReader_GUI/SRAboutView.cpp 2009-02-02 04:26:44 UTC (rev 211)
+++ trunk/src/SwordReader_GUI/SRAboutView.cpp 2009-02-02 06:04:10 UTC (rev 212)
@@ -4,18 +4,18 @@
SRAboutView::SRAboutView()
{
- m_wcsAbout = "<html><body><b><font size=\"+4\">SwordReader</font></b> v";
+ m_wcsAbout = "<html><body><b><font color=\"blue\" size=\"+6\">SwordReader</font></b> v";
m_wcsAbout += SR_VERSION_STRING;
m_wcsAbout += "<br>";
+ m_wcsAbout += " Bible software for Windows Mobile.<br><br>";
m_wcsAbout += "Built on: ";
m_wcsAbout += __DATE__;
m_wcsAbout += " at: ";
m_wcsAbout += __TIME__;
- m_wcsAbout += "<br>";
- m_wcsAbout += " Bible software for Windows Mobile.<br>";
- m_wcsAbout += " http://www.swordreader.org<br>";
+ m_wcsAbout += "<br><br>";
+ m_wcsAbout += "Website: http://www.swordreader.org<br><br>";
m_wcsAbout += "(c) 2006-2009 Copyright Crosswire Bible Society under terms of GNU GPL v2<br><br><br>";
- m_wcsAbout += "<b>Credits:</b><br><br>";
+ m_wcsAbout += "<b>Credits:</b><br>";
m_wcsAbout += "Original concept and code by:<br>";
m_wcsAbout += " Johan Gorter<br><br>";
m_wcsAbout += "Lead Developer:<br>";
Modified: trunk/src/SwordReader_GUI/SRLexiView.cpp
===================================================================
--- trunk/src/SwordReader_GUI/SRLexiView.cpp 2009-02-02 04:26:44 UTC (rev 211)
+++ trunk/src/SwordReader_GUI/SRLexiView.cpp 2009-02-02 06:04:10 UTC (rev 212)
@@ -17,7 +17,7 @@
{
wchar_t wverse[16] = {0};
wchar_t wchapt[16] = {0};
- if(!m_fSwordInit)
+ if(!m_fSwordInit || !m_pModule)
return "";
WCString title =
WCString(m_pModule->Name());
@@ -25,6 +25,13 @@
return title;
}
+const SWKey &SRLexiView::GetKey()
+{
+ if(!m_pModule)
+ return m_keyDummy;
+ return *m_pModule->getKey();
+}
+
VOID SRLexiView::SetEntry(const WCString &entry)
{
StrKey newKey(entry.c_str());
@@ -39,7 +46,11 @@
VOID SRLexiView::SetKey(const StrKey &key)
{
- SWKey *oldKey = m_pModule->getKey();
+ SWKey *oldKey = NULL;
+ if(!m_pModule)
+ return;
+
+ oldKey = m_pModule->getKey();
if(!oldKey || (*oldKey) == key)
return;
StrKey newKey(key);
Modified: trunk/src/SwordReader_GUI/SRLexiView.h
===================================================================
--- trunk/src/SwordReader_GUI/SRLexiView.h 2009-02-02 04:26:44 UTC (rev 211)
+++ trunk/src/SwordReader_GUI/SRLexiView.h 2009-02-02 06:04:10 UTC (rev 212)
@@ -20,7 +20,7 @@
VOID SetSwordReady() { m_fSwordInit = TRUE; }
VOID RefreshScreen(BOOL fReloadText);
SWModule *GetModule() { return m_pModule; }
- const SWKey &GetKey() { return *m_pModule->getKey(); }
+ const SWKey &GetKey();
BOOL OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
VOID Show();
@@ -31,4 +31,5 @@
BOOL m_fEntryChanged;
BOOL m_fSwordInit;
SWModule *m_pModule;
+ SWKey m_keyDummy;
};
\ No newline at end of file
Modified: trunk/src/SwordReader_GUI/SRMainFrame.cpp
===================================================================
--- trunk/src/SwordReader_GUI/SRMainFrame.cpp 2009-02-02 04:26:44 UTC (rev 211)
+++ trunk/src/SwordReader_GUI/SRMainFrame.cpp 2009-02-02 06:04:10 UTC (rev 212)
@@ -641,13 +641,13 @@
m_tabViews->SetBibleModule(bibleMod);
commMod = m_swmgr->getModule((*m_confOptions)["History"].getWithDefault("LastCommVersion", "Clarke"));
- if(!commMod && m_modComms){
+ if(!commMod && m_modComms && m_modComms->size()){
commMod = m_modComms->begin()->second;
}
m_tabViews->SetCommModule(commMod);
dictMod = m_swmgr->getModule((*m_confOptions)["History"].getWithDefault("LastDictVersion", "WebstersDict"));
- if(!dictMod && m_modDicts){
+ if(!dictMod && m_modDicts && m_modDicts->size()){
dictMod = m_modDicts->begin()->second;
}
m_tabViews->SetDictModule(dictMod);
@@ -672,7 +672,7 @@
m_tabViews->SetCommKey(*verse);
delete verse;
- entry = new StrKey((*m_confOptions)["History"].getWithDefault("LastDictEntry", "jeweler"));
+ entry = new StrKey((*m_confOptions)["History"].getWithDefault("LastDictEntry", ""));
m_tabViews->SetDictKey(*entry);
delete entry;
}
Modified: trunk/src/SwordReader_GUI/SRModuleView.cpp
===================================================================
--- trunk/src/SwordReader_GUI/SRModuleView.cpp 2009-02-02 04:26:44 UTC (rev 211)
+++ trunk/src/SwordReader_GUI/SRModuleView.cpp 2009-02-02 06:04:10 UTC (rev 212)
@@ -196,6 +196,11 @@
while (!done && (!fInThread || !m_fAbortThread)) {
if(fInThread)
i++;
+ if(!m_pModule){
+ buf = "<b>There are no modules of this type to be loaded.<br></b>Visit http://www.crosswire.org for information on available modules.";
+ AddText(buf.w_str(), buf.length());
+ break;
+ }
m_pModule->SetKey(keyCur);
int pvHeading = 0;
@@ -256,7 +261,7 @@
if(done){
ScrollToVerse(m_verse.Verse());
- }else if(!fInThread){ // Overkill but, I am a paranoid guy.
+ }else if(!fInThread && m_pModule){ // Overkill but, I am a paranoid guy.
m_nLoadedTill = keyCur.Verse();
CreateLoadTextThread();
}
@@ -423,7 +428,7 @@
{
wchar_t wverse[16] = {0};
wchar_t wchapt[16] = {0};
- if(!m_fSwordInit)
+ if(!m_fSwordInit || !m_pModule)
return "";
WCString title =
WCString(m_pModule->Name()) + " " +
Modified: trunk/src/SwordReader_GUI/SRModuleWidget.cpp
===================================================================
--- trunk/src/SwordReader_GUI/SRModuleWidget.cpp 2009-02-02 04:26:44 UTC (rev 211)
+++ trunk/src/SwordReader_GUI/SRModuleWidget.cpp 2009-02-02 06:04:10 UTC (rev 212)
@@ -243,4 +243,9 @@
INT SRModuleWidget::GetSplitPoint() {
RECT clientRect = GetBounds();
return (INT)(((float)(clientRect.bottom - clientRect.top))*0.65f);
+}
+
+VOID SRModuleWidget::RefreshScreen(BOOL fReloadText)
+{
+ m_viewModule->RefreshScreen(fReloadText);
}
\ No newline at end of file
Modified: trunk/src/SwordReader_GUI/SRModuleWidget.h
===================================================================
--- trunk/src/SwordReader_GUI/SRModuleWidget.h 2009-02-02 04:26:44 UTC (rev 211)
+++ trunk/src/SwordReader_GUI/SRModuleWidget.h 2009-02-02 06:04:10 UTC (rev 212)
@@ -39,6 +39,7 @@
virtual INT GetVerseMax();
virtual VOID SetSwordReady();
virtual VOID MoveWindow(LPCRECT lpRect,BOOL bRepaint = TRUE);
+ virtual VOID RefreshScreen(BOOL fReloadText = FALSE);
INT GetSplitPoint();
Modified: trunk/src/SwordReader_GUI/SRTabbedViews.cpp
===================================================================
--- trunk/src/SwordReader_GUI/SRTabbedViews.cpp 2009-02-02 04:26:44 UTC (rev 211)
+++ trunk/src/SwordReader_GUI/SRTabbedViews.cpp 2009-02-02 06:04:10 UTC (rev 212)
@@ -231,7 +231,7 @@
VOID SRTabbedViews::RefreshScreen(BOOL fReloadText)
{
- SRModuleView *mview = dynamic_cast<SRModuleView *>(GetCurrentView());
+ SRModuleWidget *mview = dynamic_cast<SRModuleWidget *>(GetCurrentView());
if(mview){
mview->RefreshScreen(fReloadText);
return;
Modified: trunk/src/SwordReader_GUI/SwordReaderResource.h
===================================================================
--- trunk/src/SwordReader_GUI/SwordReaderResource.h 2009-02-02 04:26:44 UTC (rev 211)
+++ trunk/src/SwordReader_GUI/SwordReaderResource.h 2009-02-02 06:04:10 UTC (rev 212)
@@ -20,7 +20,7 @@
*****************************************************************************/
#include "SRFramework/WCString.h"
-const SRFramework::WCString SR_VERSION_STRING = "1.9 alpha 3";
+const SRFramework::WCString SR_VERSION_STRING = "1.9 beta 1";
struct ltstr
{
More information about the sword-cvs
mailing list