Diffstat (limited to 'noncore/apps/opie-gutenbrowser/gutenbrowser.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-gutenbrowser/gutenbrowser.cpp | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/noncore/apps/opie-gutenbrowser/gutenbrowser.cpp b/noncore/apps/opie-gutenbrowser/gutenbrowser.cpp index 733db17..8b02f9f 100644 --- a/noncore/apps/opie-gutenbrowser/gutenbrowser.cpp +++ b/noncore/apps/opie-gutenbrowser/gutenbrowser.cpp | |||
@@ -824,64 +824,58 @@ bool Gutenbrowser::load( const char *fileName) { | |||
824 | << ", pageSize " << Lview->PageSize() << oendl; | 824 | << ", pageSize " << Lview->PageSize() << oendl; |
825 | 825 | ||
826 | Lview->setMaxLines(Lview->PageSize()*2); | 826 | Lview->setMaxLines(Lview->PageSize()*2); |
827 | // odebug << "Gulped " << currentLine << "" << oendl; | 827 | // odebug << "Gulped " << currentLine << "" << oendl; |
828 | setCaption(title); | 828 | setCaption(title); |
829 | Lview->setAutoUpdate( TRUE); | 829 | Lview->setAutoUpdate( TRUE); |
830 | 830 | ||
831 | // Lview->setCursorPosition(0,0,FALSE); | 831 | // Lview->setCursorPosition(0,0,FALSE); |
832 | 832 | ||
833 | // pages = (int)(( Lview->numLines() / Lview->editSize() ) / 2 ) +1; | 833 | // pages = (int)(( Lview->numLines() / Lview->editSize() ) / 2 ) +1; |
834 | //odebug << "number of pages " << pages << "" << oendl; | 834 | //odebug << "number of pages " << pages << "" << oendl; |
835 | 835 | ||
836 | loadCheck = true; | 836 | loadCheck = true; |
837 | enableButtons(true); | 837 | enableButtons(true); |
838 | if( donateMenu->count() == 3) { | 838 | if( donateMenu->count() == 3) { |
839 | donateMenu->insertItem("Current Title", this, SLOT( InfoBarClick() )); | 839 | donateMenu->insertItem("Current Title", this, SLOT( InfoBarClick() )); |
840 | } | 840 | } |
841 | Lview->setFocus(); | 841 | Lview->setFocus(); |
842 | 842 | ||
843 | // QCopEnvelope("QPE/System", "notBusy()" ); | 843 | // QCopEnvelope("QPE/System", "notBusy()" ); |
844 | return true; | 844 | return true; |
845 | } // end load | 845 | } // end load |
846 | 846 | ||
847 | void Gutenbrowser::Search() { | 847 | void Gutenbrowser::Search() { |
848 | |||
849 | // if( searchDlg->isHidden()) | ||
850 | { | ||
851 | odebug << "Starting search dialog" << oendl; | 848 | odebug << "Starting search dialog" << oendl; |
852 | searchDlg = new SearchDialog( this, "Etext Search", true); | 849 | searchDlg = new SearchDialog( this, "Etext Search", true); |
853 | searchDlg->setCaption( tr( "Etext Search" )); | 850 | searchDlg->setCaption( tr( "Etext Search" )); |
854 | // searchDlg->setLabel( "- searches etext"); | ||
855 | connect( searchDlg,SIGNAL( search_signal()),this,SLOT( search_slot())); | 851 | connect( searchDlg,SIGNAL( search_signal()),this,SLOT( search_slot())); |
856 | connect( searchDlg,SIGNAL( search_done_signal()),this,SLOT( searchdone_slot())); | 852 | connect( searchDlg,SIGNAL( search_done_signal()),this,SLOT( searchdone_slot())); |
857 | 853 | ||
858 | QString resultString; | 854 | QString resultString; |
859 | QString string = searchDlg->searchString; | 855 | QString string = searchDlg->searchString; |
860 | Lview->deselect(); | 856 | Lview->deselect(); |
861 | searchDlg->show(); | 857 | searchDlg->show(); |
862 | searchDlg->result(); | ||
863 | } | ||
864 | } | 858 | } |
865 | 859 | ||
866 | void Gutenbrowser::search_slot( ) { | 860 | void Gutenbrowser::search_slot( ) { |
867 | int line, col; | 861 | int line, col; |
868 | if (!searchDlg /*&& !loadCheck */) | 862 | if (!searchDlg /*&& !loadCheck */) |
869 | return; | 863 | return; |
870 | 864 | ||
871 | Lview->getCursorPosition(&line,&col); | 865 | Lview->getCursorPosition(&line,&col); |
872 | QString to_find_string=searchDlg->get_text(); | 866 | QString to_find_string=searchDlg->get_text(); |
873 | 867 | ||
874 | // searchDlg->get_direction();// is true if searching backward | 868 | // searchDlg->get_direction();// is true if searching backward |
875 | if ( last_search != 0 && searchDlg->get_direction() ){ | 869 | if ( last_search != 0 && searchDlg->get_direction() ){ |
876 | col = col - pattern.length() - 1 ; | 870 | col = col - pattern.length() - 1 ; |
877 | } | 871 | } |
878 | again: | 872 | again: |
879 | int result = doSearch( to_find_string , /* searchDlg->case_sensitive()*/ TRUE, searchDlg->forward_search(), line, col); | 873 | int result = doSearch( to_find_string , /* searchDlg->case_sensitive()*/ TRUE, searchDlg->forward_search(), line, col); |
880 | if(result == 0){ | 874 | if(result == 0){ |
881 | if(!searchDlg->get_direction()){ // forward search | 875 | if(!searchDlg->get_direction()){ // forward search |
882 | int query = QMessageBox::information( searchDlg, "Find", | 876 | int query = QMessageBox::information( searchDlg, "Find", |
883 | "End of document reached.\nContinue from the beginning?", | 877 | "End of document reached.\nContinue from the beginning?", |
884 | "Yes", "No", "", 0,1); | 878 | "Yes", "No", "", 0,1); |
885 | if (query == 0){ | 879 | if (query == 0){ |
886 | line = 0; | 880 | line = 0; |
887 | col = 0; | 881 | col = 0; |