summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2004-06-15 09:51:02 (UTC)
committer llornkcor <llornkcor>2004-06-15 09:51:02 (UTC)
commit83b4b2d2670b63a2a540006cea2ea8808100d308 (patch) (unidiff)
tree577fc60d3b2f63374c7bceeea311f2dc28f99e8e
parent631bd9765ed1d4e53ee8b021da644e0cfdcd623c (diff)
downloadopie-83b4b2d2670b63a2a540006cea2ea8808100d308.zip
opie-83b4b2d2670b63a2a540006cea2ea8808100d308.tar.gz
opie-83b4b2d2670b63a2a540006cea2ea8808100d308.tar.bz2
load guten library, and fix some dialogs
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-gutenbrowser/LibraryDialog.cpp10
-rw-r--r--noncore/apps/opie-gutenbrowser/LibraryDialogData.cpp3
-rw-r--r--noncore/apps/opie-gutenbrowser/gutenbrowser.cpp82
3 files changed, 47 insertions, 48 deletions
diff --git a/noncore/apps/opie-gutenbrowser/LibraryDialog.cpp b/noncore/apps/opie-gutenbrowser/LibraryDialog.cpp
index 270a4cf..124b6f3 100644
--- a/noncore/apps/opie-gutenbrowser/LibraryDialog.cpp
+++ b/noncore/apps/opie-gutenbrowser/LibraryDialog.cpp
@@ -88,2 +88,4 @@ LibraryDialog::LibraryDialog( QWidget* parent, const char* name , bool modal, W
88 new QPEDialogListener(this); 88 new QPEDialogListener(this);
89 QTimer::singleShot( 1000, this, SLOT( FindLibrary()) );
90
89} 91}
@@ -257,3 +259,3 @@ void LibraryDialog::Library()
257 QString sMsg; 259 QString sMsg;
258 sMsg = ( tr("Error opening local library index:\n "))+local_index; 260 sMsg = ( tr("<p>Error opening local library index:</P> "))+local_index;
259 QMessageBox::message( "Error",sMsg); 261 QMessageBox::message( "Error",sMsg);
@@ -513,3 +515,3 @@ bool LibraryDialog::download_Etext()
513 } else 515 } else
514 QMessageBox::message("Note","There was an error\nwith the file"); 516 QMessageBox::message("Note","<p>There was an error with the file</p>");
515 } 517 }
@@ -941,3 +943,3 @@ void LibraryDialog::newList()
941 int result = QMessageBox::warning( this,"Download" 943 int result = QMessageBox::warning( this,"Download"
942 ,"Ok to use /'wget/' to download\na new library list?\n" 944 ,"<p>Ok to use /'wget/' to download a new library list?</P>"
943 ,"Yes","No",0,0,1); 945 ,"Yes","No",0,0,1);
@@ -1039,3 +1041,3 @@ bool LibraryDialog::moreInfo()
1039 } else 1041 } else
1040 QMessageBox::message( "Note","If you select a title, this will\nsearch google.com for that title."); 1042 QMessageBox::message( "Note","<p>If you select a title, this will search google.com for that title.</p>");
1041 return true; 1043 return true;
diff --git a/noncore/apps/opie-gutenbrowser/LibraryDialogData.cpp b/noncore/apps/opie-gutenbrowser/LibraryDialogData.cpp
index 72d605e..60c1c75 100644
--- a/noncore/apps/opie-gutenbrowser/LibraryDialogData.cpp
+++ b/noncore/apps/opie-gutenbrowser/LibraryDialogData.cpp
@@ -238,2 +238,3 @@ void LibraryDialog::initDialog(){
238 buttonSearch->setDisabled(TRUE); 238 buttonSearch->setDisabled(TRUE);
239 buttonSearch->setDefault(TRUE);
239 240
@@ -243,3 +244,3 @@ void LibraryDialog::initDialog(){
243 buttonLibrary->setText("Load"); 244 buttonLibrary->setText("Load");
244 buttonLibrary->setDefault(TRUE); 245// buttonLibrary->setDefault(TRUE);
245 buttonNewList->setText("New List"); 246 buttonNewList->setText("New List");
diff --git a/noncore/apps/opie-gutenbrowser/gutenbrowser.cpp b/noncore/apps/opie-gutenbrowser/gutenbrowser.cpp
index f14080f..be920dd 100644
--- a/noncore/apps/opie-gutenbrowser/gutenbrowser.cpp
+++ b/noncore/apps/opie-gutenbrowser/gutenbrowser.cpp
@@ -107,3 +107,3 @@ Gutenbrowser::Gutenbrowser(QWidget *,const char*, WFlags )
107 initSlots(); 107 initSlots();
108 108 qDebug("init finished");
109 QPEApplication::setStylusOperation( mainList->viewport(),QPEApplication::RightOnHold); 109 QPEApplication::setStylusOperation( mainList->viewport(),QPEApplication::RightOnHold);
@@ -138,3 +138,3 @@ Gutenbrowser::Gutenbrowser(QWidget *,const char*, WFlags )
138 if( index != -1) { 138 if( index != -1) {
139 // odebug << tempTitle << oendl; 139 odebug << tempTitle << oendl;
140 bookmarksMenu->insertItem( tempTitle); 140 bookmarksMenu->insertItem( tempTitle);
@@ -144,4 +144,4 @@ Gutenbrowser::Gutenbrowser(QWidget *,const char*, WFlags )
144 // QString gutenIndex= local_library + "GUTINDEX.ALL"; 144 // QString gutenIndex= local_library + "GUTINDEX.ALL";
145 QString gutenIndex= QPEApplication::qpeDir()+ "/etc/gutenbrowser/GUTINDEX.ALL"; 145 QString gutenIndex = QPEApplication::qpeDir()+ "/etc/gutenbrowser/GUTINDEX.ALL";
146 146 qDebug("gutenindex "+gutenIndex );
147 if( QFile( gutenIndex).exists() ) { 147 if( QFile( gutenIndex).exists() ) {
@@ -153,4 +153,5 @@ Gutenbrowser::Gutenbrowser(QWidget *,const char*, WFlags )
153 } 153 }
154 qDebug("attempting new library");
154 LibraryDlg = new LibraryDialog( this, "Library Index" /*, TRUE */); 155 LibraryDlg = new LibraryDialog( this, "Library Index" /*, TRUE */);
155 loadCheck=false; 156 loadCheck = false;
156 chdir(local_library); 157 chdir(local_library);
@@ -161,3 +162,3 @@ Gutenbrowser::Gutenbrowser(QWidget *,const char*, WFlags )
161 for (int i=1;i< qApp->argc();i++) { 162 for (int i=1;i< qApp->argc();i++) {
162 odebug << "Suppose we open somethin" << oendl; 163 qDebug("Suppose we open somethin");
163 load(qApp->argv()[i]); 164 load(qApp->argv()[i]);
@@ -230,3 +231,3 @@ void Gutenbrowser::goGetit( const QString &url, bool showMsg) {
230 fp = popen( (const char *) cmd, "r"); 231 fp = popen( (const char *) cmd, "r");
231 // odebug << "Issuing the command\n"+cmd << oendl; 232 odebug << "Issuing the command\n"+cmd << oendl;
232 // system(cmd); 233 // system(cmd);
@@ -234,3 +235,3 @@ void Gutenbrowser::goGetit( const QString &url, bool showMsg) {
234 outDlg->OutputEdit->append(line); 235 outDlg->OutputEdit->append(line);
235 outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE); 236// outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE);
236 } 237 }
@@ -411,3 +412,3 @@ void Gutenbrowser::ForwardBtn() {
411 Lview->insertLine( s, -1); 412 Lview->insertLine( s, -1);
412 // odebug << s << oendl; 413 odebug << s << oendl;
413 currentLine++; 414 currentLine++;
@@ -423,7 +424,7 @@ void Gutenbrowser::ForwardBtn() {
423 pageStopArray[i_pageNum ] = currentFilePos; 424 pageStopArray[i_pageNum ] = currentFilePos;
424 // odebug << currentFilePos << " current page is number " << i_pageNum 425 odebug << currentFilePos << " current page is number " << i_pageNum
425 // << ", pagesize " << pageSize << ", length " << Lview->length() 426 << ", pagesize " << pageSize << ", length " << Lview->length()
426 // << ", current " << pageStopArray[i_pageNum] << oendl; 427 << ", current " << pageStopArray[i_pageNum] << oendl;
427 setStatus(); 428 setStatus();
428 Lview->setCursorPosition( 0, 0, FALSE); 429// Lview->setCursorPosition( 0, 0, FALSE);
429 // } 430 // }
@@ -431,3 +432,3 @@ void Gutenbrowser::ForwardBtn() {
431 } else { 432 } else {
432 // odebug << "bal" << oendl; 433 odebug << "bal" << oendl;
433 // if( i_pageNum != pages) { 434 // if( i_pageNum != pages) {
@@ -446,3 +447,3 @@ void Gutenbrowser::ForwardBtn() {
446 447
447 // odebug << "page number " << i_pageNum << " line number " << currentLine << "" << oendl; 448 odebug << "page number " << i_pageNum << " line number " << currentLine << "" << oendl;
448} 449}
@@ -458,5 +459,5 @@ void Gutenbrowser::BackBtn() {
458 459
459 // odebug << currentFilePos << " move back to " << pageStopArray[i_pageNum - 1 ] 460 odebug << currentFilePos << " move back to " << pageStopArray[i_pageNum - 1 ]
460 // << ", current page number " << i_pageNum 461 << ", current page number " << i_pageNum
461 // << ", " << pageSize << ", length " << Lview->length() << oendl; 462 << ", " << pageSize << ", length " << Lview->length() << oendl;
462 463
@@ -503,3 +504,3 @@ void Gutenbrowser::BackBtn() {
503 setStatus(); 504 setStatus();
504 Lview->setCursorPosition( Lview->Top(), 0, FALSE); 505// Lview->setCursorPosition( Lview->Top(), 0, FALSE);
505 506
@@ -537,3 +538,3 @@ void Gutenbrowser::TopBtn() {
537 } 538 }
538 Lview->setCursorPosition( 0,0, FALSE); 539// Lview->setCursorPosition( 0,0, FALSE);
539 i_pageNum=1; 540 i_pageNum=1;
@@ -580,3 +581,3 @@ void Gutenbrowser::BeginBtn() {
580 pageStopArray[i_pageNum ] = currentFilePos; 581 pageStopArray[i_pageNum ] = currentFilePos;
581 // odebug << "new page number " << i_pageNum << ", found at " << currentFilePos << "" << oendl; 582 odebug << "new page number " << i_pageNum << ", found at " << currentFilePos << "" << oendl;
582 } 583 }
@@ -606,5 +607,5 @@ void Gutenbrowser::BeginBtn() {
606 if( pos > i_topRow ) { 607 if( pos > i_topRow ) {
607 Lview->setCursorPosition( pos+linesPerPage+2/* - i_topRow+3 */,0, FALSE); 608// Lview->setCursorPosition( pos+linesPerPage+2/* - i_topRow+3 */,0, FALSE);
608 } else { 609 } else {
609 Lview->setCursorPosition( pos+2 , 0, FALSE ); 610// Lview->setCursorPosition( pos+2 , 0, FALSE );
610 } 611 }
@@ -663,3 +664,3 @@ void Gutenbrowser::Bookmark( int itemId) {
663 664
664 // odebug << "<<<<<< " << Lview->PageSize() << ", " << Lview->lastRow() - Lview->topRow() << "" << oendl; 665 odebug << "<<<<<< " << Lview->PageSize() << ", " << Lview->lastRow() - Lview->topRow() << "" << oendl;
665 666
@@ -709,3 +710,3 @@ void Gutenbrowser::Bookmark( int itemId) {
709 pageStopArray[i_pageNum ] = currentFilePos; 710 pageStopArray[i_pageNum ] = currentFilePos;
710 // odebug << "new page number " << i_pageNum << ", found at " << currentFilePos << "" << oendl; 711 odebug << "new page number " << i_pageNum << ", found at " << currentFilePos << "" << oendl;
711 } 712 }
@@ -746,3 +747,3 @@ bool Gutenbrowser::load( const char *fileName) {
746 // QCopEnvelope ( "QPE/System", "busy()" ); 747 // QCopEnvelope ( "QPE/System", "busy()" );
747 // odebug << "Title is already set as "+title << oendl; 748 odebug << "Title is already set as "+title << oendl;
748 odebug << "sizeHint " << sizeHint().height() << " pageSize " << Lview->PageSize() << "" << oendl; 749 odebug << "sizeHint " << sizeHint().height() << " pageSize " << Lview->PageSize() << "" << oendl;
@@ -812,3 +813,3 @@ bool Gutenbrowser::load( const char *fileName) {
812 813
813 Lview->setCursorPosition(0,0,FALSE); 814// Lview->setCursorPosition(0,0,FALSE);
814 815
@@ -903,3 +904,3 @@ int Gutenbrowser::doSearch( const QString &s_pattern , bool case_sensitive, boo
903 if( i > Lview->lastRow() ) { 904 if( i > Lview->lastRow() ) {
904 Lview->setCursorPosition(i,pos,FALSE); 905// Lview->setCursorPosition(i,pos,FALSE);
905 for(int l = 0 ; l < length; l++) { 906 for(int l = 0 ; l < length; l++) {
@@ -907,3 +908,3 @@ int Gutenbrowser::doSearch( const QString &s_pattern , bool case_sensitive, boo
907 } 908 }
908 Lview->setCursorPosition( i , pos + length, TRUE ); 909// Lview->setCursorPosition( i , pos + length, TRUE );
909 int newTop = Lview->Top(); 910 int newTop = Lview->Top();
@@ -913,3 +914,3 @@ int Gutenbrowser::doSearch( const QString &s_pattern , bool case_sensitive, boo
913 } else { 914 } else {
914 Lview->setCursorPosition(i,pos,FALSE); 915// Lview->setCursorPosition(i,pos,FALSE);
915 for(int l = 0 ; l < length; l++) { 916 for(int l = 0 ; l < length; l++) {
@@ -917,3 +918,3 @@ int Gutenbrowser::doSearch( const QString &s_pattern , bool case_sensitive, boo
917 } 918 }
918 Lview->setCursorPosition( i , pos + length, TRUE ); 919// Lview->setCursorPosition( i , pos + length, TRUE );
919 // AdjustStatus(); 920 // AdjustStatus();
@@ -938,3 +939,3 @@ int Gutenbrowser::doSearch( const QString &s_pattern , bool case_sensitive, boo
938 if( ! (line == i && pos > col ) ) { 939 if( ! (line == i && pos > col ) ) {
939 Lview->setCursorPosition( i ,pos ,FALSE ); 940// Lview->setCursorPosition( i ,pos ,FALSE );
940 for(int l = 0 ; l < length; l++) { 941 for(int l = 0 ; l < length; l++) {
@@ -942,3 +943,3 @@ int Gutenbrowser::doSearch( const QString &s_pattern , bool case_sensitive, boo
942 } 943 }
943 Lview->setCursorPosition(i ,pos + length ,TRUE ); 944// Lview->setCursorPosition(i ,pos + length ,TRUE );
944 // int newTop = Lview->Top(); 945 // int newTop = Lview->Top();
@@ -948,3 +949,3 @@ int Gutenbrowser::doSearch( const QString &s_pattern , bool case_sensitive, boo
948 if( ! (line == i && pos > col ) ) { 949 if( ! (line == i && pos > col ) ) {
949 Lview->setCursorPosition( i, pos, FALSE ); 950// Lview->setCursorPosition( i, pos, FALSE );
950 for( int l = 0 ; l < length; l++) { 951 for( int l = 0 ; l < length; l++) {
@@ -952,3 +953,3 @@ int Gutenbrowser::doSearch( const QString &s_pattern , bool case_sensitive, boo
952 } 953 }
953 Lview->setCursorPosition( i, pos + length, TRUE ); 954// Lview->setCursorPosition( i, pos + length, TRUE );
954 } 955 }
@@ -982,8 +983,3 @@ void Gutenbrowser::LibraryBtn() {
982 config.setGroup("General"); 983 config.setGroup("General");
983 QString tmp=config.readEntry("RunBefore","FALSE"); 984
984 if(tmp=="FALSE") {
985 QMessageBox::message( "Note",
986 "<P>Your first time running gutenbrowser. You'll need to click the \"load library\" button to load the gutenberg index.</P>");
987 config.writeEntry("RunBefore","TRUE");
988 }
989 if(useSplitter) 985 if(useSplitter)
@@ -1792,3 +1788,3 @@ void Gutenbrowser::listClickedSlot( QListBoxItem * index) {
1792 if( Bmrkrow > Lview->topRow() ) { 1788 if( Bmrkrow > Lview->topRow() ) {
1793 Lview->setCursorPosition( Bmrkrow /* - Lview->topRow() */,0, FALSE ); 1789// Lview->setCursorPosition( Bmrkrow /* - Lview->topRow() */,0, FALSE );
1794 Lview->ScrollUp( Bmrkrow - Lview->topRow() ); 1790 Lview->ScrollUp( Bmrkrow - Lview->topRow() );
@@ -1797,3 +1793,3 @@ void Gutenbrowser::listClickedSlot( QListBoxItem * index) {
1797 else if( Bmrkrow < Lview->topRow() ) { 1793 else if( Bmrkrow < Lview->topRow() ) {
1798 Lview->setCursorPosition( Lview->topRow() - Bmrkrow ,0, FALSE ); 1794// Lview->setCursorPosition( Lview->topRow() - Bmrkrow ,0, FALSE );
1799 Lview->ScrollDown( Lview->topRow() - Bmrkrow ); 1795 Lview->ScrollDown( Lview->topRow() - Bmrkrow );