author | llornkcor <llornkcor> | 2005-08-24 20:22:10 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2005-08-24 20:22:10 (UTC) |
commit | 65edeafe2dc8689dce7c2ce94e954933b393dcf0 (patch) (unidiff) | |
tree | 17d0986ef0bce73f44a4b9900466fcc533954814 | |
parent | f0bb6c410f19d502cf563254d95158617a32b94e (diff) | |
download | opie-65edeafe2dc8689dce7c2ce94e954933b393dcf0.zip opie-65edeafe2dc8689dce7c2ce94e954933b393dcf0.tar.gz opie-65edeafe2dc8689dce7c2ce94e954933b393dcf0.tar.bz2 |
optimize search. fix other things
-rw-r--r-- | noncore/apps/opie-gutenbrowser/LibraryDialog.cpp | 265 | ||||
-rw-r--r-- | noncore/apps/opie-gutenbrowser/LibraryDialog.h | 15 | ||||
-rw-r--r-- | noncore/apps/opie-gutenbrowser/LibraryDialogData.cpp | 90 |
3 files changed, 170 insertions, 200 deletions
diff --git a/noncore/apps/opie-gutenbrowser/LibraryDialog.cpp b/noncore/apps/opie-gutenbrowser/LibraryDialog.cpp index 58babe9..9858188 100644 --- a/noncore/apps/opie-gutenbrowser/LibraryDialog.cpp +++ b/noncore/apps/opie-gutenbrowser/LibraryDialog.cpp | |||
@@ -123,88 +123,109 @@ void LibraryDialog::Newlibrary() | |||
123 | }// end if | 123 | }// end if |
124 | }// end while | 124 | }// end while |
125 | newindexLib.close(); | 125 | newindexLib.close(); |
126 | } | 126 | } |
127 | #ifndef Q_WS_QWS | 127 | #ifndef Q_WS_QWS |
128 | setCursor( arrowCursor); | 128 | setCursor( arrowCursor); |
129 | #endif | 129 | #endif |
130 | #endif | 130 | #endif |
131 | } // end Newlibrary() | 131 | } // end Newlibrary() |
132 | 132 | ||
133 | 133 | ||
134 | void LibraryDialog::Library() { | 134 | void LibraryDialog::Library() { |
135 | clearItems(); | 135 | clearItems(); |
136 | 136 | ||
137 | // qDebug( "opening GUTINDEX.ALL file"); | 137 | // qDebug( "opening GUTINDEX.ALL file"); |
138 | IDontKnowWhy = ""; | 138 | IDontKnowWhy = ""; |
139 | if ( indexLib.open( IO_ReadOnly) ) { // file opened successfully | 139 | system("date"); |
140 | if ( indexLib.open( IO_ReadOnly) ) { | ||
141 | // file opened successfully | ||
140 | QTextStream indexStream( &indexLib ); | 142 | QTextStream indexStream( &indexLib ); |
141 | QString indexLine; | 143 | QString indexLine; |
142 | qApp->processEvents(); | 144 | qApp->processEvents(); |
143 | 145 | ||
146 | bool okToRead = false; | ||
144 | while ( !indexStream.eof() ) { | 147 | while ( !indexStream.eof() ) { |
145 | |||
146 | indexLine = indexStream.readLine(); | 148 | indexLine = indexStream.readLine(); |
147 | if ( indexLine != "") { | 149 | if(indexLine == "<==Start GUTINDEX.ALL listings==>") |
148 | 150 | okToRead = true; | |
149 | if( (indexLine.mid(4,4)).toInt() ) { | 151 | if(indexLine == "<==End of GUTINDEX.ALL==>") { |
150 | 152 | okToRead = false; | |
151 | year = indexLine.mid(4,4); | 153 | indexLib.at(indexLib.size()); |
152 | file = indexLine.mid(60,12); | ||
153 | if(file.left(1).find("[",0,TRUE) != -1) | ||
154 | file.remove(1,1); | ||
155 | if( file.find("]",0,TRUE) != -1) | ||
156 | file = file.left( file.find("]",0,TRUE)); | ||
157 | |||
158 | if(file.find("?", 0, false) != -1 ) { | ||
159 | QString tmpfile = file.replace(QRegExp("[?]"), "8"); | ||
160 | file = tmpfile; | ||
161 | } | ||
162 | |||
163 | number = indexLine.mid(55,5); | ||
164 | title = indexLine.mid( 9, 50 ); | ||
165 | |||
166 | addItems(); | ||
167 | |||
168 | } | ||
169 | else if ( indexLine.mid(73,5).toInt() && indexLine.mid(73,5).toInt() > 10000 ) { | ||
170 | // newer files with numbers > 100000 have new dir structure and need to be parsed differently.. | ||
171 | number = indexLine.mid(73,5); | ||
172 | int num = number.toInt(); | ||
173 | if(num < 10626) | ||
174 | year = "2003"; | ||
175 | else if(num >= 10626 && num < 14600) | ||
176 | year = "2004"; | ||
177 | else if(num >= 14600) | ||
178 | year = "2005"; | ||
179 | |||
180 | file = number;// + ".txt"; | ||
181 | title = indexLine.mid(0,72); | ||
182 | |||
183 | addItems(); | ||
184 | //qDebug("file number is " + number + " title is " + title ); | ||
185 | } | ||
186 | } | 154 | } |
155 | |||
156 | if(okToRead) { | ||
157 | QStringList token = QStringList::split(' ', indexLine); | ||
158 | int textNumber; | ||
159 | if(( textNumber = token.last().toInt() )) | ||
160 | if(textNumber > 10001) { | ||
161 | // qWarning("Last "+token.last()); | ||
162 | // newer files with numbers > 100000 have new dir structure and need to be parsed differently.. | ||
163 | if(textNumber < 10626) | ||
164 | year = "2003"; | ||
165 | else if(textNumber >= 10626 && textNumber < 14600) | ||
166 | year = "2004"; | ||
167 | else if(textNumber >= 14600) | ||
168 | year = "2005"; | ||
169 | |||
170 | file = token.last(); | ||
171 | title = indexLine.mid(0,72); | ||
172 | |||
173 | addItems(); //author and qlistview | ||
174 | //qDebug("file number is " + number + " title is " + title ); | ||
175 | |||
176 | } else { //end new etexts | ||
177 | |||
178 | if(token[1].toInt() && token[1].toInt() > 1969) { | ||
179 | year = token[1]; | ||
180 | file = indexLine.mid(60,12); | ||
181 | |||
182 | if(file.left(1).find("[",0,TRUE) != -1) { | ||
183 | file.remove(1,1); | ||
184 | if( file.find("]",0,TRUE) != -1) | ||
185 | file = file.left( file.find("]",0,TRUE)); | ||
186 | |||
187 | if(file.find("?", 0, false) != -1 ) { | ||
188 | QString tmpfile = file.replace(QRegExp("[?]"), "8"); | ||
189 | file = tmpfile; | ||
190 | } | ||
191 | title = indexLine.mid( 9, 50); | ||
192 | |||
193 | addItems(); | ||
194 | } | ||
195 | } else { // then try new format texts | ||
196 | file = token.last(); | ||
197 | title = indexLine.mid(0,72); | ||
198 | year = "1980"; | ||
199 | |||
200 | addItems(); //author and qlistview | ||
201 | } | ||
202 | } //end old etexts | ||
203 | |||
204 | } //end okToTRead | ||
187 | } | 205 | } |
188 | indexLib.close(); | 206 | indexLib.close(); |
189 | } else { | 207 | } else { |
190 | QString sMsg; | 208 | QString sMsg; |
191 | 209 | ||
192 | sMsg = ( tr("<p>Error opening library index file. Please download a new one.</P> ")); | 210 | sMsg = ( tr("<p>Error opening library index file. Please download a new one.</P> ")); |
193 | QMessageBox::message( "Error",sMsg); | 211 | QMessageBox::message( "Error",sMsg); |
194 | } | 212 | } |
213 | system("date"); | ||
214 | sortLists(0); | ||
215 | |||
195 | } //end Library() | 216 | } //end Library() |
196 | 217 | ||
197 | 218 | ||
198 | /* | 219 | /* |
199 | Groks the author out of the title */ | 220 | Groks the author out of the title */ |
200 | bool LibraryDialog::getAuthor() | 221 | bool LibraryDialog::getAuthor() |
201 | { | 222 | { |
202 | if( title.contains( ", by", true)) { | 223 | if( title.contains( ", by", true)) { |
203 | int auth; | 224 | int auth; |
204 | auth = title.find(", by", 0, true); | 225 | auth = title.find(", by", 0, true); |
205 | author = title.right(title.length() - (auth + 4) ); | 226 | author = title.right(title.length() - (auth + 4) ); |
206 | if( int finder = author.find("[", 0, true)) { | 227 | if( int finder = author.find("[", 0, true)) { |
207 | author = author.left(finder); | 228 | author = author.left(finder); |
208 | } | 229 | } |
209 | } | 230 | } |
210 | else if ( title.contains( "by, ", true) ) { | 231 | else if ( title.contains( "by, ", true) ) { |
@@ -290,59 +311,66 @@ bool LibraryDialog::getAuthor() | |||
290 | 311 | ||
291 | author = author.stripWhiteSpace(); | 312 | author = author.stripWhiteSpace(); |
292 | if (authBox->isChecked() == TRUE) { // this reverses the first name and last name of the author | 313 | if (authBox->isChecked() == TRUE) { // this reverses the first name and last name of the author |
293 | QString lastName, firstName=""; | 314 | QString lastName, firstName=""; |
294 | int finder = author.findRev( ' ', -1, TRUE); | 315 | int finder = author.findRev( ' ', -1, TRUE); |
295 | lastName = author.right( author.length()-finder); | 316 | lastName = author.right( author.length()-finder); |
296 | firstName = author.left(finder); | 317 | firstName = author.left(finder); |
297 | lastName = lastName.stripWhiteSpace(); | 318 | lastName = lastName.stripWhiteSpace(); |
298 | firstName = firstName.stripWhiteSpace(); | 319 | firstName = firstName.stripWhiteSpace(); |
299 | 320 | ||
300 | if( lastName.find( firstName, 0, true) == -1) // this avoids dup names | 321 | if( lastName.find( firstName, 0, true) == -1) // this avoids dup names |
301 | author = lastName+", "+firstName; | 322 | author = lastName+", "+firstName; |
302 | } | 323 | } |
303 | return true; | 324 | return true; |
304 | }////// end getAuthor() | 325 | }////// end getAuthor() |
305 | 326 | ||
306 | void LibraryDialog::addItems() { | 327 | void LibraryDialog::addItems() |
328 | { | ||
307 | cleanStrings(); | 329 | cleanStrings(); |
308 | getAuthor(); // grok author | 330 | getAuthor(); // grok author |
309 | if( !number.isEmpty() | 331 | |
310 | && (title.find( "reserved",0, FALSE) == -1) | 332 | etext etextStruct; |
333 | if( /*!number.isEmpty() | ||
334 | && */ | ||
335 | (title.find( "reserved",0, FALSE) == -1) | ||
311 | && (file.find( "]",0, true) == -1) | 336 | && (file.find( "]",0, true) == -1) |
312 | &&(title.find( "Audio",0, FALSE) == -1)) { | 337 | &&(title.find( "Audio",0, FALSE) == -1)) { |
313 | // qDebug("new item "+title); | 338 | // qDebug("new item "+title); |
314 | // fill string list or something to be able to sort by Author | 339 | // fill string list or something to be able to sort by Author |
340 | etextStruct.title = title; | ||
341 | etextStruct.author = author; | ||
342 | etextStruct.year = year; | ||
343 | etextStruct.file = file; | ||
344 | |||
345 | etextLibrary.append( etextStruct); | ||
346 | |||
315 | if( author.isEmpty() ) | 347 | if( author.isEmpty() ) |
316 | QList_Item5 = new QListViewItem( ListView5, /*number, */title, author, year, file ); | 348 | QList_Item5 = new QListViewItem( ListView5, /*number, */author, title, year, file ); |
317 | else { | 349 | else { |
318 | if( (author.left(1) >= QString("A") && author.left(1) <= QString("F")) || | 350 | if( author.find(QRegExp("[^a-fA-F]")) ) |
319 | (author.left(1) >= QString("a") && author.left(1) <= QString("f")) ) | 351 | QList_Item1 = new QListViewItem( ListView1, /* number,*/author, title, year, file ); |
320 | QList_Item1 = new QListViewItem( ListView1, /* number,*/ title, author, year, file ); | ||
321 | 352 | ||
322 | else if( (author.left(1) >= QString("G") && author.left(1) <= QString("M")) || | 353 | else if(author.find(QRegExp("[^g-mG-M]")) ) |
323 | (author.left(1) >= QString("g") && author.left(1) <= QString("m")) ) | 354 | QList_Item2 = new QListViewItem( ListView2, /* number,*/ author, title,year, file ); |
324 | QList_Item2 = new QListViewItem( ListView2, /* number,*/ title, author, year, file ); | ||
325 | 355 | ||
326 | else if( (author.left(1) >= QString("N") && author.left(1) <= QString("R")) || | 356 | else if(author.find(QRegExp("[^n-rN-R]")) ) |
327 | (author.left(1) >= QString("n") && author.left(1) <= QString("r")) ) | 357 | QList_Item3 = new QListViewItem( ListView3, /* number,*/ author, title, year, file ); |
328 | QList_Item3 = new QListViewItem( ListView3, /* number,*/ title, author, year, file ); | ||
329 | 358 | ||
330 | else if( (author.left(1) >= QString("S") && author.left(1) <= QString("Z")) || | 359 | else if(author.find(QRegExp("[^s-zS-Z]")) ) |
331 | (author.left(1) >= QString("s") && author.left(1) <= QString("z")) ) | 360 | QList_Item4 = new QListViewItem( ListView4, /* number,*/ author, title, year, file ); |
332 | QList_Item4 = new QListViewItem( ListView4, /* number,*/ title, author, year, file ); | ||
333 | } | 361 | } |
334 | } | 362 | } |
335 | } | 363 | } |
336 | 364 | ||
337 | /* | 365 | /* |
338 | selected one etext*/ | 366 | selected one etext*/ |
339 | void LibraryDialog::select_title( QListViewItem * item) | 367 | void LibraryDialog::select_title( QListViewItem * item) |
340 | { | 368 | { |
341 | if(item != NULL) { | 369 | if(item != NULL) { |
342 | i++; | 370 | i++; |
343 | int index = tabWidget->currentPageIndex(); | 371 | int index = tabWidget->currentPageIndex(); |
344 | DlglistItemTitle = item->text(0); | 372 | DlglistItemTitle = item->text(0); |
345 | DlglistItemYear = item->text(2); | 373 | DlglistItemYear = item->text(2); |
346 | DlglistItemFile = item->text(3); | 374 | DlglistItemFile = item->text(3); |
347 | 375 | ||
348 | switch (index) { | 376 | switch (index) { |
@@ -662,132 +690,71 @@ void LibraryDialog::onButtonSearch() | |||
662 | 690 | ||
663 | int curTab = tabWidget->currentPageIndex(); | 691 | int curTab = tabWidget->currentPageIndex(); |
664 | SearchDialog* searchDlg; | 692 | SearchDialog* searchDlg; |
665 | 693 | ||
666 | // if( resultsList) | 694 | // if( resultsList) |
667 | searchDlg = new SearchDialog( this, "Library Search", true); | 695 | searchDlg = new SearchDialog( this, "Library Search", true); |
668 | searchDlg->setCaption( tr( "Library Search" ) ); | 696 | searchDlg->setCaption( tr( "Library Search" ) ); |
669 | searchDlg->setLabel( "- author or title"); | 697 | searchDlg->setLabel( "- author or title"); |
670 | 698 | ||
671 | QString resultString; | 699 | QString resultString; |
672 | 700 | ||
673 | int i_berger = 0; | 701 | int i_berger = 0; |
674 | if( searchDlg->exec() != 0 ) { | 702 | if( searchDlg->exec() != 0 ) { |
675 | QString searcherStr = searchDlg->get_text(); | 703 | QString searcherStr = searchDlg->get_text(); |
676 | int fluff = 0; | 704 | int fluff = 0; |
677 | 705 | ||
678 | // int tabPage = tabWidget->currentPageIndex(); | ||
679 | // TODO ititerate here... struct<listViews>?? | ||
680 | |||
681 | QListViewItemIterator it1( ListView1 ); | ||
682 | QListViewItemIterator it2( ListView2 ); | ||
683 | QListViewItemIterator it3( ListView3 ); | ||
684 | QListViewItemIterator it4( ListView4 ); | ||
685 | QListViewItemIterator it5( ListView5 ); | ||
686 | |||
687 | //// this is really pitiful work, | ||
688 | /////// | ||
689 | bool cS; | 706 | bool cS; |
690 | if( searchDlg->caseSensitiveCheckBox->isChecked()) | 707 | if( searchDlg->caseSensitiveCheckBox->isChecked()) |
691 | cS=true; //case sensitive | 708 | cS = true; //case sensitive |
692 | else | 709 | else |
693 | cS=false; | 710 | cS = false; |
694 | 711 | ||
695 | if(fluff==0) { | 712 | etext etextStruct; |
696 | for ( ; it1.current(); ++it1 ) { | 713 | QValueList<etext>::Iterator it; |
697 | resultString = ( it1.current() )->text(0); | 714 | |
698 | resultString += (" : "); | 715 | for( it = etextLibrary.begin(); it != etextLibrary.end(); ++it ) { |
699 | resultString += ( it1.current() )->text(2); | 716 | QString tempTitle = (*it).title; |
700 | resultString += (" : "); | 717 | QString tempAuthor = (*it).author; |
701 | resultString += ( it1.current() )->text(3); | 718 | QString tempFile = (*it).file; |
702 | if( resultString.find( searcherStr, 0, cS) != -1) | 719 | QString tempYear = (*it).year; |
703 | { | 720 | if(tempTitle.find( searcherStr, 0, cS) != -1 |
704 | Searchlist.append( resultString); | 721 | || tempAuthor.find( searcherStr, 0, cS) != -1) { |
705 | } | 722 | qWarning(tempTitle); |
706 | } | 723 | Searchlist.append( tempTitle + " : " + tempYear + " : " + tempFile); |
707 | } | 724 | } |
708 | if(fluff==0) {// search routine here | 725 | } |
709 | for ( ; it2.current(); ++it2 ) { | 726 | |
710 | resultString = ( it2.current() )->text(0); | ||
711 | resultString += (" : "); | ||
712 | resultString += ( it2.current() )->text(2); | ||
713 | resultString += (" : "); | ||
714 | resultString += ( it2.current() )->text(3); | ||
715 | if( resultString.find( searcherStr, 0, cS) != -1) { | ||
716 | Searchlist.append( resultString); | ||
717 | } | ||
718 | } | ||
719 | } | ||
720 | if(fluff==0) {// search routine here | ||
721 | for ( ; it3.current(); ++it3 ) { | ||
722 | resultString = ( it3.current() )->text(0); | ||
723 | resultString += (" : "); | ||
724 | resultString += ( it3.current() )->text(2); | ||
725 | resultString += (" : "); | ||
726 | resultString += ( it3.current() )->text(3); | ||
727 | |||
728 | if( resultString.find( searcherStr, 0, cS) != -1) { | ||
729 | Searchlist.append( resultString); | ||
730 | } | ||
731 | } | ||
732 | } | ||
733 | if(fluff==0) { | ||
734 | // search routine here | ||
735 | for ( ; it4.current(); ++it4 ) { | ||
736 | resultString = ( it4.current() )->text(0); | ||
737 | resultString += (" : "); | ||
738 | resultString += ( it4.current() )->text(2); | ||
739 | resultString += (" : "); | ||
740 | resultString += ( it4.current() )->text(3); | ||
741 | if( resultString.find( searcherStr, 0, cS) != -1) { | ||
742 | Searchlist.append( resultString); | ||
743 | } | ||
744 | } | ||
745 | } | ||
746 | if(fluff==0) { // search routine here | ||
747 | for ( ; it5.current(); ++it5 ) { | ||
748 | resultString = ( it5.current() )->text(0); | ||
749 | resultString += (" : "); | ||
750 | resultString += ( it5.current() )->text(2); | ||
751 | resultString += (" : "); | ||
752 | resultString += ( it5.current() )->text(3); | ||
753 | if( resultString.find( searcherStr, 0, cS) != -1) { | ||
754 | Searchlist.append( resultString); | ||
755 | } | ||
756 | } | ||
757 | } | ||
758 | 727 | ||
759 | tabWidget->setCurrentPage( curTab); | 728 | tabWidget->setCurrentPage( curTab); |
760 | 729 | ||
761 | Searchlist.sort(); | 730 | Searchlist.sort(); |
762 | SearchResultsDlg* SearchResultsDialog; | 731 | SearchResultsDlg* SearchResultsDialog; |
763 | SearchResultsDialog = new SearchResultsDlg( searchDlg, "Results Dialog", true, 0 , Searchlist); | 732 | SearchResultsDialog = new SearchResultsDlg( searchDlg, "Results Dialog", true, 0 , Searchlist); |
764 | 733 | ||
765 | SearchResultsDialog->showMaximized(); | 734 | SearchResultsDialog->showMaximized(); |
766 | if( SearchResultsDialog->exec() != 0) { | 735 | if( SearchResultsDialog->exec() != 0) { |
767 | texter = SearchResultsDialog->selText; | 736 | texter = SearchResultsDialog->selText; |
768 | // //odebug << texter << oendl; | 737 | // //odebug << texter << oendl; |
769 | resultLs = SearchResultsDialog->resultsList; | 738 | resultLs = SearchResultsDialog->resultsList; |
770 | i_berger = 1; | 739 | i_berger = 1; |
771 | } else { | 740 | } else { |
772 | resultLs.clear(); | 741 | resultLs.clear(); |
773 | } | 742 | } |
774 | Searchlist.clear(); | 743 | Searchlist.clear(); |
775 | 744 | ||
776 | // if(SearchResultsDialog) | ||
777 | // delete SearchResultsDialog; | ||
778 | QString tester; | 745 | QString tester; |
779 | for ( QStringList::Iterator it = resultLs.begin(); it != resultLs.end(); ++it ) { | 746 | for ( QStringList::Iterator it = resultLs.begin(); it != resultLs.end(); ++it ) { |
780 | texter.sprintf("%s \n",(*it).latin1()); | 747 | texter.sprintf("%s \n",(*it).latin1()); |
781 | // //odebug << texter << oendl; | 748 | // //odebug << texter << oendl; |
782 | if( tester!=texter) | 749 | if( tester!=texter) |
783 | parseSearchResults( texter); | 750 | parseSearchResults( texter); |
784 | tester = texter; | 751 | tester = texter; |
785 | } | 752 | } |
786 | if(searchDlg) | 753 | if(searchDlg) |
787 | delete searchDlg; | 754 | delete searchDlg; |
788 | } | 755 | } |
789 | if(checkBox->isChecked() ) { | 756 | if(checkBox->isChecked() ) { |
790 | accept(); | 757 | accept(); |
791 | } else { | 758 | } else { |
792 | setActiveWindow(); | 759 | setActiveWindow(); |
793 | } | 760 | } |
@@ -807,44 +774,54 @@ void LibraryDialog::parseSearchResults( QString resultStr) | |||
807 | int titleInt = resultStr.find( " : ", 0, true); | 774 | int titleInt = resultStr.find( " : ", 0, true); |
808 | DlglistItemTitle = resultStr.left( titleInt); | 775 | DlglistItemTitle = resultStr.left( titleInt); |
809 | 776 | ||
810 | int yearInt = resultStr.find( " : ", titleInt+3, true); | 777 | int yearInt = resultStr.find( " : ", titleInt+3, true); |
811 | 778 | ||
812 | DlglistItemYear = resultStr.mid( titleInt+3, (yearInt - titleInt)-3); | 779 | DlglistItemYear = resultStr.mid( titleInt+3, (yearInt - titleInt)-3); |
813 | 780 | ||
814 | DlglistItemFile = resultStr.right( resultStr.length() - (yearInt + 3)); | 781 | DlglistItemFile = resultStr.right( resultStr.length() - (yearInt + 3)); |
815 | DlglistItemFile = DlglistItemFile.left( DlglistItemFile.length() - 2); | 782 | DlglistItemFile = DlglistItemFile.left( DlglistItemFile.length() - 2); |
816 | 783 | ||
817 | cleanStrings(); | 784 | cleanStrings(); |
818 | 785 | ||
819 | if(DlglistItemFile.left(1) == "/") | 786 | if(DlglistItemFile.left(1) == "/") |
820 | DlglistItemFile = DlglistItemFile.right( DlglistItemFile.length() - 1); | 787 | DlglistItemFile = DlglistItemFile.right( DlglistItemFile.length() - 1); |
821 | 788 | ||
822 | 789 | ||
823 | if(DlglistItemFile.toInt() > 10000 ) { | 790 | if(DlglistItemFile.toInt() > 10000 || yearInt == 1980 ) { |
824 | // new directory sturcture | 791 | // new directory sturcture |
825 | download_newEtext(); //) | 792 | download_newEtext(); //) |
826 | } else { | 793 | } else { |
827 | download_Etext(); //) | 794 | download_Etext(); //) |
828 | } | 795 | } |
829 | } | 796 | } |
830 | } | 797 | } |
831 | 798 | ||
832 | void LibraryDialog::sort() | 799 | void LibraryDialog::sortLists(int index) |
833 | { | 800 | { |
834 | 801 | ||
802 | ListView1->setSorting(index); | ||
803 | ListView2->setSorting(index); | ||
804 | ListView3->setSorting(index); | ||
805 | ListView4->setSorting(index); | ||
806 | ListView5->setSorting(index); | ||
807 | ListView1->sort(); | ||
808 | ListView2->sort(); | ||
809 | ListView3->sort(); | ||
810 | ListView4->sort(); | ||
811 | ListView5->sort(); | ||
835 | } | 812 | } |
836 | 813 | ||
837 | /* | 814 | /* |
838 | Downloads the current selected listitem*/ | 815 | Downloads the current selected listitem*/ |
839 | bool LibraryDialog::getItem(QListViewItem *it) | 816 | bool LibraryDialog::getItem(QListViewItem *it) |
840 | { | 817 | { |
841 | // //odebug << "selected getItem" << oendl; | 818 | // //odebug << "selected getItem" << oendl; |
842 | 819 | ||
843 | // DlglistItemNumber = it->text(0); | 820 | // DlglistItemNumber = it->text(0); |
844 | DlglistItemTitle = it->text(0); | 821 | DlglistItemTitle = it->text(0); |
845 | DlglistItemYear = it->text(2); | 822 | DlglistItemYear = it->text(2); |
846 | DlglistItemFile = it->text(3); | 823 | DlglistItemFile = it->text(3); |
847 | 824 | ||
848 | if(download_Etext()) { | 825 | if(download_Etext()) { |
849 | if(i_binary == 1) { | 826 | if(i_binary == 1) { |
850 | } | 827 | } |
@@ -1037,33 +1014,39 @@ bool LibraryDialog::moreInfo() | |||
1037 | void LibraryDialog::FindLibrary() | 1014 | void LibraryDialog::FindLibrary() |
1038 | { | 1015 | { |
1039 | buttonLibrary->setDown(true); | 1016 | buttonLibrary->setDown(true); |
1040 | 1017 | ||
1041 | qApp->processEvents(); | 1018 | qApp->processEvents(); |
1042 | if( QFile( new_index).exists() /* && this->isHidden() */) { | 1019 | if( QFile( new_index).exists() /* && this->isHidden() */) { |
1043 | newindexLib.setName( new_index); | 1020 | newindexLib.setName( new_index); |
1044 | indexLib.setName( new_index); | 1021 | indexLib.setName( new_index); |
1045 | //odebug << "index file is "+ new_index << oendl; | 1022 | //odebug << "index file is "+ new_index << oendl; |
1046 | Newlibrary(); | 1023 | Newlibrary(); |
1047 | } else { | 1024 | } else { |
1048 | newindexLib.setName( old_index); | 1025 | newindexLib.setName( old_index); |
1049 | indexLib.setName( old_index); | 1026 | indexLib.setName( old_index); |
1050 | //odebug << "new index nameis "+ old_index << oendl; | 1027 | //odebug << "new index nameis "+ old_index << oendl; |
1051 | Library(); | 1028 | Library(); |
1052 | } | 1029 | } |
1053 | indexLoaded=true; | 1030 | indexLoaded =true; |
1054 | buttonSearch->setEnabled(true); | 1031 | buttonSearch->setEnabled(true); |
1055 | moreInfoButton->setEnabled(true); | 1032 | moreInfoButton->setEnabled(true); |
1056 | 1033 | ||
1057 | buttonLibrary->setDown(false); | 1034 | buttonLibrary->setDown(false); |
1058 | buttonNewList->setText("Download"); | 1035 | buttonNewList->setText("Download"); |
1059 | qApp->processEvents(); | 1036 | qApp->processEvents(); |
1060 | 1037 | ||
1061 | } | 1038 | } |
1062 | 1039 | ||
1063 | void LibraryDialog::cleanStrings() { | 1040 | void LibraryDialog::cleanStrings() { |
1064 | year = year.stripWhiteSpace(); | 1041 | year = year.stripWhiteSpace(); |
1065 | file = file.stripWhiteSpace(); | 1042 | file = file.stripWhiteSpace(); |
1066 | title = title.stripWhiteSpace(); | 1043 | title = title.stripWhiteSpace(); |
1067 | number = number.stripWhiteSpace(); | 1044 | number = number.stripWhiteSpace(); |
1068 | 1045 | ||
1069 | } | 1046 | } |
1047 | |||
1048 | void LibraryDialog::authBoxClicked() | ||
1049 | { | ||
1050 | qApp->processEvents(); | ||
1051 | FindLibrary(); | ||
1052 | } | ||
diff --git a/noncore/apps/opie-gutenbrowser/LibraryDialog.h b/noncore/apps/opie-gutenbrowser/LibraryDialog.h index 8d6352f..95226b2 100644 --- a/noncore/apps/opie-gutenbrowser/LibraryDialog.h +++ b/noncore/apps/opie-gutenbrowser/LibraryDialog.h | |||
@@ -17,43 +17,52 @@ | |||
17 | #include "SearchDialog.h" | 17 | #include "SearchDialog.h" |
18 | #include "NetworkDialog.h" | 18 | #include "NetworkDialog.h" |
19 | #include <qstringlist.h> | 19 | #include <qstringlist.h> |
20 | #include <qdialog.h> | 20 | #include <qdialog.h> |
21 | #include <qcheckbox.h> | 21 | #include <qcheckbox.h> |
22 | #include <qdatetime.h> | 22 | #include <qdatetime.h> |
23 | #include <qfile.h> | 23 | #include <qfile.h> |
24 | #include <qheader.h> | 24 | #include <qheader.h> |
25 | #include <qlistview.h> | 25 | #include <qlistview.h> |
26 | #include <qmessagebox.h> | 26 | #include <qmessagebox.h> |
27 | #include <qregexp.h> | 27 | #include <qregexp.h> |
28 | #include <qstring.h> | 28 | #include <qstring.h> |
29 | #include <qtextstream.h> | 29 | #include <qtextstream.h> |
30 | #include <qlabel.h> | 30 | #include <qlabel.h> |
31 | #include <stdlib.h> | 31 | #include <stdlib.h> |
32 | #include <qtabwidget.h> | 32 | #include <qtabwidget.h> |
33 | #include <qvaluelist.h> | ||
33 | 34 | ||
34 | class QVBoxLayout; | 35 | class QVBoxLayout; |
35 | class QHBoxLayout; | 36 | class QHBoxLayout; |
36 | class QGridLayout; | 37 | class QGridLayout; |
37 | class QListView; | 38 | class QListView; |
38 | class QListViewItem; | 39 | class QListViewItem; |
39 | class QPushButton; | 40 | class QPushButton; |
40 | //class QTabWidget; | 41 | //class QTabWidget; |
41 | class QWidget; | 42 | class QWidget; |
42 | //class Gutenbrowser; | 43 | //class Gutenbrowser; |
43 | 44 | ||
45 | typedef struct { | ||
46 | QString title; | ||
47 | QString author; | ||
48 | QString year; | ||
49 | QString file; | ||
50 | } etext; | ||
51 | |||
52 | |||
44 | class LibraryDialog : public QDialog { | 53 | class LibraryDialog : public QDialog { |
45 | Q_OBJECT | 54 | Q_OBJECT |
46 | 55 | ||
47 | public: | 56 | public: |
48 | LibraryDialog( QWidget* parent = 0, const char* name = 0 , bool modal = TRUE, WFlags fl = 0 ); | 57 | LibraryDialog( QWidget* parent = 0, const char* name = 0 , bool modal = TRUE, WFlags fl = 0 ); |
49 | ~LibraryDialog(); | 58 | ~LibraryDialog(); |
50 | 59 | ||
51 | QTabWidget *tabWidget; | 60 | QTabWidget *tabWidget; |
52 | QListView *ListView1,*ListView2,*ListView3,*ListView4,*ListView5; | 61 | QListView *ListView1,*ListView2,*ListView3,*ListView4,*ListView5; |
53 | QWidget *widget_1,*widget_2,*widget_3,*widget_4,*widget_5,*widget_6; | 62 | QWidget *widget_1,*widget_2,*widget_3,*widget_4,*widget_5,*widget_6; |
54 | QString ftp_host,ftp_base_dir; | 63 | QString ftp_host,ftp_base_dir; |
55 | QLabel *statusLabel; | 64 | QLabel *statusLabel; |
56 | QListViewItem *QList_Item1,*QList_Item2,*QList_Item3,*QList_Item4,*QList_Item5; | 65 | QListViewItem *QList_Item1,*QList_Item2,*QList_Item3,*QList_Item4,*QList_Item5; |
57 | QStringList list,ItemStrlist,Searchlist,resultLs; | 66 | QStringList list,ItemStrlist,Searchlist,resultLs; |
58 | // QStringList list1,list2,list3,list4; | 67 | // QStringList list1,list2,list3,list4; |
59 | 68 | ||
@@ -86,48 +95,52 @@ bool indexLoaded; | |||
86 | QString proxy_http; | 95 | QString proxy_http; |
87 | int doitAll; | 96 | int doitAll; |
88 | QString texter; | 97 | QString texter; |
89 | // CConfigFile *config; | 98 | // CConfigFile *config; |
90 | void parseSearchResults( QString resultStr); | 99 | void parseSearchResults( QString resultStr); |
91 | 100 | ||
92 | public slots: | 101 | public slots: |
93 | bool getItem(QListViewItem* ); | 102 | bool getItem(QListViewItem* ); |
94 | void doListView(); | 103 | void doListView(); |
95 | void FindLibrary(); | 104 | void FindLibrary(); |
96 | void newList(); | 105 | void newList(); |
97 | void Newlibrary(); | 106 | void Newlibrary(); |
98 | void Library(); | 107 | void Library(); |
99 | bool getAuthor(); | 108 | bool getAuthor(); |
100 | void select_title(QListViewItem*); | 109 | void select_title(QListViewItem*); |
101 | void cancelIt(); | 110 | void cancelIt(); |
102 | void sort(); | 111 | void sortLists(int); |
103 | bool moreInfo(); | 112 | bool moreInfo(); |
104 | // void DownloadEmAll(); | 113 | // void DownloadEmAll(); |
105 | bool httpDownload(); | 114 | bool httpDownload(); |
106 | bool setTitle(); | 115 | bool setTitle(); |
107 | void saveConfig(); | 116 | void saveConfig(); |
108 | bool download_Etext(); | 117 | bool download_Etext(); |
109 | bool download_newEtext(); | 118 | bool download_newEtext(); |
110 | 119 | ||
111 | void onButtonSearch(); | 120 | void onButtonSearch(); |
112 | bool onButtonDownload(); | 121 | bool onButtonDownload(); |
113 | 122 | ||
114 | // bool UnzipIt( QString fileName); | 123 | // bool UnzipIt( QString fileName); |
115 | void comboSelect(int index); | 124 | void comboSelect(int index); |
116 | protected slots: | 125 | protected slots: |
117 | 126 | ||
118 | 127 | ||
119 | protected: | 128 | protected: |
120 | 129 | ||
130 | QValueList<etext> etextLibrary; | ||
131 | |||
121 | void initDialog(); | 132 | void initDialog(); |
122 | QHBoxLayout *hbox,*hbox1,*hbox2; | 133 | QHBoxLayout *hbox,*hbox1,*hbox2; |
123 | QVBoxLayout *vbox; | 134 | QVBoxLayout *vbox; |
124 | // void search_slot(); | 135 | // void search_slot(); |
125 | private: | 136 | private: |
126 | void addItems(); | 137 | void addItems(); |
127 | void clearItems(); | 138 | void clearItems(); |
128 | void cleanStrings(); | 139 | void cleanStrings(); |
129 | bool getEtext(const QStringList &); | 140 | bool getEtext(const QStringList &); |
141 | private slots: | ||
142 | void authBoxClicked(); | ||
130 | 143 | ||
131 | }; | 144 | }; |
132 | 145 | ||
133 | #endif // LIBRARYDIALOG_H | 146 | #endif // LIBRARYDIALOG_H |
diff --git a/noncore/apps/opie-gutenbrowser/LibraryDialogData.cpp b/noncore/apps/opie-gutenbrowser/LibraryDialogData.cpp index 60c1c75..bfbf84d 100644 --- a/noncore/apps/opie-gutenbrowser/LibraryDialogData.cpp +++ b/noncore/apps/opie-gutenbrowser/LibraryDialogData.cpp | |||
@@ -59,131 +59,104 @@ void LibraryDialog::initDialog(){ | |||
59 | ListView2 = new QListView( widget_2, "ListView2" ); | 59 | ListView2 = new QListView( widget_2, "ListView2" ); |
60 | QGridLayout *layout2 = new QGridLayout(widget_2 ); | 60 | QGridLayout *layout2 = new QGridLayout(widget_2 ); |
61 | 61 | ||
62 | widget_3 = new QWidget( tabWidget, "widget_3" ); | 62 | widget_3 = new QWidget( tabWidget, "widget_3" ); |
63 | ListView3 = new QListView( widget_3, "ListView3" ); | 63 | ListView3 = new QListView( widget_3, "ListView3" ); |
64 | QGridLayout *layout3 = new QGridLayout(widget_3 ); | 64 | QGridLayout *layout3 = new QGridLayout(widget_3 ); |
65 | 65 | ||
66 | widget_4 = new QWidget( tabWidget, "widget_4" ); | 66 | widget_4 = new QWidget( tabWidget, "widget_4" ); |
67 | ListView4 = new QListView( widget_4, "ListView4" ); | 67 | ListView4 = new QListView( widget_4, "ListView4" ); |
68 | QGridLayout *layout4 = new QGridLayout(widget_4 ); | 68 | QGridLayout *layout4 = new QGridLayout(widget_4 ); |
69 | 69 | ||
70 | widget_5 = new QWidget( tabWidget, "widget_5" ); | 70 | widget_5 = new QWidget( tabWidget, "widget_5" ); |
71 | ListView5 = new QListView( widget_5, "ListView5" ); | 71 | ListView5 = new QListView( widget_5, "ListView5" ); |
72 | QGridLayout *layout5 = new QGridLayout(widget_5 ); | 72 | QGridLayout *layout5 = new QGridLayout(widget_5 ); |
73 | 73 | ||
74 | 74 | ||
75 | ListView1->addColumn( tr( "Title" ) ); | 75 | ListView1->addColumn( tr( "Author" ), -1 ); |
76 | ListView1->setColumnWidthMode( 0, QListView::Manual ); | 76 | ListView1->setColumnAlignment( 1, 1 ); |
77 | ListView1->setColumnWidth(0, 330); | 77 | |
78 | ListView1->addColumn( tr( "Title" ), -1 ); | ||
78 | ListView1->setColumnAlignment( 0, 1 ); | 79 | ListView1->setColumnAlignment( 0, 1 ); |
79 | 80 | ||
80 | ListView1->addColumn( tr( "Author" ) ); | ||
81 | ListView1->setColumnWidthMode( 1, QListView::Manual ); | ||
82 | ListView1->setColumnWidth(1, 170); | ||
83 | ListView1->setColumnAlignment( 1, 1 ); | ||
84 | 81 | ||
85 | ListView1->addColumn( tr( "Year" ) ); | 82 | ListView1->addColumn( tr( "Year" ) ); |
86 | ListView1->setColumnWidthMode( 2, QListView::Manual ); | 83 | ListView1->setColumnWidthMode( 2, QListView::Manual ); |
87 | ListView1->setColumnWidth(2, 50); | ||
88 | ListView1->setColumnAlignment( 2, 1 ); | 84 | ListView1->setColumnAlignment( 2, 1 ); |
89 | 85 | ||
90 | ListView1->addColumn( tr( "File" ) ); | 86 | ListView1->addColumn( tr( "File" ), -1 ); |
91 | ListView1->setColumnWidthMode( 2, QListView::Manual ); | 87 | ListView1->setColumnWidthMode( 2, QListView::Manual ); |
92 | ListView1->setColumnWidth(2, 100); | ||
93 | ListView1->setColumnAlignment( 2, 1 ); | ||
94 | 88 | ||
95 | ListView2->addColumn( tr( "Title" ) ); | 89 | ListView1->setColumnAlignment( 2, 1 ); |
96 | ListView2->setColumnWidthMode( 0, QListView::Manual ); | ||
97 | ListView2->setColumnWidth(0, 330); | ||
98 | ListView2->setColumnAlignment( 0, 1 ); | ||
99 | 90 | ||
100 | ListView2->addColumn( tr( "Author" ) ); | 91 | ListView2->addColumn( tr( "Author" ), -1 ); |
101 | ListView2->setColumnWidthMode( 1, QListView::Manual ); | ||
102 | ListView2->setColumnWidth(1, 170); | ||
103 | ListView2->setColumnAlignment( 1, 1 ); | 92 | ListView2->setColumnAlignment( 1, 1 ); |
104 | 93 | ||
105 | ListView2->addColumn( tr( "Year" ) ); | 94 | ListView2->addColumn( tr( "Title" ), -1); |
95 | ListView2->setColumnAlignment( 0, 1 ); | ||
96 | |||
97 | ListView2->addColumn( tr( "Year" ), -1 ); | ||
106 | ListView2->setColumnWidthMode( 2, QListView::Manual ); | 98 | ListView2->setColumnWidthMode( 2, QListView::Manual ); |
107 | ListView2->setColumnWidth(2, 50); | ||
108 | ListView2->setColumnAlignment( 2, 1 ); | 99 | ListView2->setColumnAlignment( 2, 1 ); |
109 | 100 | ||
110 | ListView2->addColumn( tr( "File" ) ); | 101 | ListView2->addColumn( tr( "File" ), -1 ); |
111 | ListView2->setColumnWidthMode( 3, QListView::Manual ); | 102 | ListView2->setColumnWidthMode( 3, QListView::Manual ); |
112 | ListView2->setColumnWidth(3, 100); | ||
113 | ListView2->setColumnAlignment( 3, 1 ); | 103 | ListView2->setColumnAlignment( 3, 1 ); |
114 | 104 | ||
115 | ListView3->addColumn( tr( "Title" ) ); | 105 | ListView3->addColumn( tr( "Author" ), -1 ); |
116 | ListView3->setColumnWidthMode( 0, QListView::Manual ); | 106 | ListView3->setColumnAlignment( 1, 1 ); |
117 | ListView3->setColumnWidth(0, 330); | 107 | |
108 | ListView3->addColumn( tr( "Title" ), -1 ); | ||
118 | ListView3->setColumnAlignment( 0, 1 ); | 109 | ListView3->setColumnAlignment( 0, 1 ); |
119 | 110 | ||
120 | ListView3->addColumn( tr( "Author" ) ); | ||
121 | ListView3->setColumnWidthMode( 1, QListView::Manual ); | ||
122 | ListView3->setColumnWidth(1, 170); | ||
123 | ListView3->setColumnAlignment( 1, 1 ); | ||
124 | 111 | ||
125 | ListView3->addColumn( tr( "Year" ) ); | 112 | ListView3->addColumn( tr( "Year" ), -1 ); |
126 | ListView3->setColumnWidthMode( 2, QListView::Manual ); | 113 | ListView3->setColumnWidthMode( 2, QListView::Manual ); |
127 | ListView3->setColumnWidth(2, 50); | ||
128 | ListView3->setColumnAlignment( 2, 1 ); | 114 | ListView3->setColumnAlignment( 2, 1 ); |
129 | 115 | ||
130 | ListView3->addColumn( tr( "File" ) ); | 116 | ListView3->addColumn( tr( "File" ), -1 ); |
131 | ListView3->setColumnWidthMode( 3, QListView::Manual ); | 117 | ListView3->setColumnWidthMode( 3, QListView::Manual ); |
132 | ListView3->setColumnWidth(3, 100); | ||
133 | ListView3->setColumnAlignment( 3, 1 ); | 118 | ListView3->setColumnAlignment( 3, 1 ); |
134 | 119 | ||
135 | 120 | ||
136 | ListView4->addColumn( tr( "Title" ) ); | 121 | ListView4->addColumn( tr( "Author" ), -1 ); |
137 | ListView4->setColumnWidthMode( 0, QListView::Manual ); | ||
138 | ListView4->setColumnWidth(0, 330); | ||
139 | ListView4->setColumnAlignment( 0, 1 ); | ||
140 | |||
141 | ListView4->addColumn( tr( "Author" ) ); | ||
142 | ListView4->setColumnWidthMode( 1, QListView::Manual ); | ||
143 | ListView4->setColumnWidth(1, 170); | ||
144 | ListView4->setColumnAlignment( 1, 1 ); | 122 | ListView4->setColumnAlignment( 1, 1 ); |
123 | ListView4->addColumn( tr( "Title" ), -1 ); | ||
124 | ListView4->setColumnAlignment( 0, 1 ); | ||
145 | 125 | ||
146 | ListView4->addColumn( tr( "Year" ) ); | 126 | ListView4->addColumn( tr( "Year" ), -1 ); |
147 | ListView4->setColumnWidthMode( 2, QListView::Manual ); | 127 | ListView4->setColumnWidthMode( 2, QListView::Manual ); |
148 | ListView4->setColumnWidth(2, 50); | ||
149 | ListView4->setColumnAlignment( 2, 1 ); | 128 | ListView4->setColumnAlignment( 2, 1 ); |
150 | 129 | ||
151 | ListView4->addColumn( tr( "File" ) ); | 130 | ListView4->addColumn( tr( "File" ), -1 ); |
152 | ListView4->setColumnWidthMode( 3, QListView::Manual ); | 131 | ListView4->setColumnWidthMode( 3, QListView::Manual ); |
153 | ListView4->setColumnWidth(3, 100); | ||
154 | ListView4->setColumnAlignment( 3, 1 ); | 132 | ListView4->setColumnAlignment( 3, 1 ); |
155 | 133 | ||
156 | ListView5->addColumn( tr( "Title" ) ); | 134 | ListView5->addColumn( tr( "Author" ), -1 ); |
157 | ListView5->setColumnWidthMode( 0, QListView::Manual ); | 135 | ListView5->setColumnAlignment( 1, 1 ); |
158 | ListView5->setColumnWidth(0, 330); | 136 | |
137 | ListView5->addColumn( tr( "Title" ), -1 ); | ||
159 | ListView5->setColumnAlignment( 0, 1 ); | 138 | ListView5->setColumnAlignment( 0, 1 ); |
160 | 139 | ||
161 | ListView5->addColumn( tr( "Author" ) ); | ||
162 | ListView5->setColumnWidthMode( 1, QListView::Manual ); | ||
163 | ListView5->setColumnWidth(1, 170); | ||
164 | ListView5->setColumnAlignment( 1, 1 ); | ||
165 | 140 | ||
166 | ListView5->addColumn( tr( "Year" ) ); | 141 | ListView5->addColumn( tr( "Year" ), -1 ); |
167 | ListView5->setColumnWidthMode( 2, QListView::Manual ); | 142 | ListView5->setColumnWidthMode( 2, QListView::Manual ); |
168 | ListView5->setColumnWidth(2, 50); | ||
169 | ListView5->setColumnAlignment( 2, 1 ); | 143 | ListView5->setColumnAlignment( 2, 1 ); |
170 | 144 | ||
171 | ListView5->addColumn( tr( "File" ) ); | 145 | ListView5->addColumn( tr( "File" ), -1 ); |
172 | ListView5->setColumnWidthMode( 3, QListView::Manual ); | 146 | ListView5->setColumnWidthMode( 3, QListView::Manual ); |
173 | ListView5->setColumnWidth(3, 100); | ||
174 | ListView5->setColumnAlignment( 3, 1 ); | 147 | ListView5->setColumnAlignment( 3, 1 ); |
175 | 148 | ||
176 | tabWidget->insertTab( widget_1, tr( "A-F" ) ); | 149 | tabWidget->insertTab( widget_1, tr( "A-F" ) ); |
177 | tabWidget->insertTab( widget_2, tr( "G-M" ) ); | 150 | tabWidget->insertTab( widget_2, tr( "G-M" ) ); |
178 | tabWidget->insertTab( widget_3, tr( "N-R" ) ); | 151 | tabWidget->insertTab( widget_3, tr( "N-R" ) ); |
179 | tabWidget->insertTab( widget_4, tr( "S-Z" ) ); | 152 | tabWidget->insertTab( widget_4, tr( "S-Z" ) ); |
180 | tabWidget->insertTab( widget_5, tr( " " ) ); | 153 | tabWidget->insertTab( widget_5, tr( " " ) ); |
181 | 154 | ||
182 | ListView1->setMultiSelection(TRUE); | 155 | ListView1->setMultiSelection(TRUE); |
183 | ListView2->setMultiSelection(TRUE); | 156 | ListView2->setMultiSelection(TRUE); |
184 | ListView3->setMultiSelection(TRUE); | 157 | ListView3->setMultiSelection(TRUE); |
185 | ListView4->setMultiSelection(TRUE); | 158 | ListView4->setMultiSelection(TRUE); |
186 | ListView5->setMultiSelection(TRUE); | 159 | ListView5->setMultiSelection(TRUE); |
187 | 160 | ||
188 | widget_6 = new QWidget( tabWidget, "widget_6" ); | 161 | widget_6 = new QWidget( tabWidget, "widget_6" ); |
189 | tabWidget->insertTab(widget_6,tr("Options")); | 162 | tabWidget->insertTab(widget_6,tr("Options")); |
@@ -194,34 +167,34 @@ void LibraryDialog::initDialog(){ | |||
194 | ListView4->setSorting( 2, TRUE); | 167 | ListView4->setSorting( 2, TRUE); |
195 | ListView5->setSorting( 2, TRUE); | 168 | ListView5->setSorting( 2, TRUE); |
196 | ListView1->setAllColumnsShowFocus( TRUE ); | 169 | ListView1->setAllColumnsShowFocus( TRUE ); |
197 | ListView2->setAllColumnsShowFocus( TRUE ); | 170 | ListView2->setAllColumnsShowFocus( TRUE ); |
198 | ListView3->setAllColumnsShowFocus( TRUE ); | 171 | ListView3->setAllColumnsShowFocus( TRUE ); |
199 | ListView4->setAllColumnsShowFocus( TRUE ); | 172 | ListView4->setAllColumnsShowFocus( TRUE ); |
200 | ListView5->setAllColumnsShowFocus( TRUE ); | 173 | ListView5->setAllColumnsShowFocus( TRUE ); |
201 | 174 | ||
202 | QGridLayout *layout6 = new QGridLayout(widget_6 ); | 175 | QGridLayout *layout6 = new QGridLayout(widget_6 ); |
203 | QComboBox * sortingCombo; | 176 | QComboBox * sortingCombo; |
204 | buttonCancel = new QPushButton( widget_6, "buttonCancel" ); | 177 | buttonCancel = new QPushButton( widget_6, "buttonCancel" ); |
205 | checkBox = new QCheckBox( ( tr("Open Automatically")), widget_6); | 178 | checkBox = new QCheckBox( ( tr("Open Automatically")), widget_6); |
206 | checkBox->setChecked( FALSE); | 179 | checkBox->setChecked( FALSE); |
207 | // httpBox = new QCheckBox( ( tr("Use http")),widget_6); | 180 | // httpBox = new QCheckBox( ( tr("Use http")),widget_6); |
208 | // httpBox->setChecked( FALSE); | 181 | // httpBox->setChecked( FALSE); |
209 | // QToolTip::add( httpBox, ( tr("Use http to download \nproxy users should probably use this.")) ); | 182 | // QToolTip::add( httpBox, ( tr("Use http to download \nproxy users should probably use this.")) ); |
210 | authBox= new QCheckBox( ( tr("Last name first \n(requires library restart)")),widget_6); | 183 | authBox= new QCheckBox( ( tr("Last name first.")),widget_6); |
211 | authBox->setChecked( FALSE); | 184 | authBox->setChecked( true); |
212 | 185 | ||
213 | layout1->addMultiCellWidget( ListView1, 0, 0, 0, 4); | 186 | layout1->addMultiCellWidget( ListView1, 0, 0, 0, 4); |
214 | layout2->addMultiCellWidget( ListView2, 0, 0, 0, 4); | 187 | layout2->addMultiCellWidget( ListView2, 0, 0, 0, 4); |
215 | layout3->addMultiCellWidget( ListView3, 0, 0, 0, 4); | 188 | layout3->addMultiCellWidget( ListView3, 0, 0, 0, 4); |
216 | layout4->addMultiCellWidget( ListView4, 0, 0, 0, 4); | 189 | layout4->addMultiCellWidget( ListView4, 0, 0, 0, 4); |
217 | layout5->addMultiCellWidget( ListView5, 0, 0, 0, 4); | 190 | layout5->addMultiCellWidget( ListView5, 0, 0, 0, 4); |
218 | 191 | ||
219 | buttonSearch = new QPushButton(this,"buttonSearch"); | 192 | buttonSearch = new QPushButton(this,"buttonSearch"); |
220 | buttonLibrary=new QPushButton(this,"buttenLibrary"); | 193 | buttonLibrary=new QPushButton(this,"buttenLibrary"); |
221 | buttonNewList=new QPushButton(this,"NewList"); | 194 | buttonNewList=new QPushButton(this,"NewList"); |
222 | moreInfoButton= new QPushButton(this,"moreInfo"); | 195 | moreInfoButton= new QPushButton(this,"moreInfo"); |
223 | sortingCombo=new QComboBox(widget_6,"sort by combo"); | 196 | sortingCombo=new QComboBox(widget_6,"sort by combo"); |
224 | 197 | ||
225 | 198 | ||
226 | layout6->addMultiCellWidget(buttonCancel, 0, 0, 4, 4); | 199 | layout6->addMultiCellWidget(buttonCancel, 0, 0, 4, 4); |
227 | layout6->addMultiCellWidget(checkBox, 1, 1, 0, 0); | 200 | layout6->addMultiCellWidget(checkBox, 1, 1, 0, 0); |
@@ -259,24 +232,25 @@ void LibraryDialog::initDialog(){ | |||
259 | connect(buttonSearch,SIGNAL(clicked()),this,SLOT(onButtonSearch())); | 232 | connect(buttonSearch,SIGNAL(clicked()),this,SLOT(onButtonSearch())); |
260 | connect(buttonLibrary,SIGNAL(clicked()),this,SLOT(FindLibrary())); | 233 | connect(buttonLibrary,SIGNAL(clicked()),this,SLOT(FindLibrary())); |
261 | connect(buttonCancel,SIGNAL(clicked()),this,SLOT(reject())); | 234 | connect(buttonCancel,SIGNAL(clicked()),this,SLOT(reject())); |
262 | connect(moreInfoButton,SIGNAL(clicked()),this,SLOT(moreInfo())); | 235 | connect(moreInfoButton,SIGNAL(clicked()),this,SLOT(moreInfo())); |
263 | connect(buttonNewList,SIGNAL(clicked()),this,SLOT(newList())); | 236 | connect(buttonNewList,SIGNAL(clicked()),this,SLOT(newList())); |
264 | 237 | ||
265 | connect(ListView1,SIGNAL(doubleClicked(QListViewItem*)),SLOT(select_title(QListViewItem*))); | 238 | connect(ListView1,SIGNAL(doubleClicked(QListViewItem*)),SLOT(select_title(QListViewItem*))); |
266 | connect(ListView1,SIGNAL(returnPressed(QListViewItem*)),SLOT(select_title(QListViewItem*))); | 239 | connect(ListView1,SIGNAL(returnPressed(QListViewItem*)),SLOT(select_title(QListViewItem*))); |
267 | connect(ListView2,SIGNAL(doubleClicked(QListViewItem*)),SLOT(select_title(QListViewItem*))); | 240 | connect(ListView2,SIGNAL(doubleClicked(QListViewItem*)),SLOT(select_title(QListViewItem*))); |
268 | connect(ListView2,SIGNAL(returnPressed(QListViewItem*)),SLOT(select_title(QListViewItem*))); | 241 | connect(ListView2,SIGNAL(returnPressed(QListViewItem*)),SLOT(select_title(QListViewItem*))); |
269 | connect(ListView3,SIGNAL(doubleClicked(QListViewItem*)),SLOT(select_title(QListViewItem*))); | 242 | connect(ListView3,SIGNAL(doubleClicked(QListViewItem*)),SLOT(select_title(QListViewItem*))); |
270 | connect(ListView3,SIGNAL(returnPressed(QListViewItem*)),SLOT(select_title(QListViewItem*))); | 243 | connect(ListView3,SIGNAL(returnPressed(QListViewItem*)),SLOT(select_title(QListViewItem*))); |
271 | connect(ListView4,SIGNAL(doubleClicked(QListViewItem*)),SLOT(select_title(QListViewItem*))); | 244 | connect(ListView4,SIGNAL(doubleClicked(QListViewItem*)),SLOT(select_title(QListViewItem*))); |
272 | connect(ListView4,SIGNAL(returnPressed(QListViewItem*)),SLOT(select_title(QListViewItem*))); | 245 | connect(ListView4,SIGNAL(returnPressed(QListViewItem*)),SLOT(select_title(QListViewItem*))); |
273 | connect(ListView5,SIGNAL(doubleClicked(QListViewItem*)),SLOT(select_title(QListViewItem*))); | 246 | connect(ListView5,SIGNAL(doubleClicked(QListViewItem*)),SLOT(select_title(QListViewItem*))); |
274 | connect(ListView5,SIGNAL(returnPressed(QListViewItem*)),SLOT(select_title(QListViewItem*))); | 247 | connect(ListView5,SIGNAL(returnPressed(QListViewItem*)),SLOT(select_title(QListViewItem*))); |
248 | connect(authBox,SIGNAL(clicked()),this,SLOT(authBoxClicked())); | ||
275 | 249 | ||
276 | connect(sortingCombo,SIGNAL(activated(int)),SLOT(comboSelect(int))); | 250 | connect(sortingCombo,SIGNAL(activated(int)),SLOT(comboSelect(int))); |
277 | 251 | ||
278 | } | 252 | } |
279 | 253 | ||
280 | void LibraryDialog::doListView() { | 254 | void LibraryDialog::doListView() { |
281 | 255 | ||
282 | } | 256 | } |