author | llornkcor <llornkcor> | 2004-04-07 13:07:42 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2004-04-07 13:07:42 (UTC) |
commit | fc42c7317c956e5bc6e74bfbb1ec185d2faa79f4 (patch) (unidiff) | |
tree | 703e89c7178f764aab25028d4525f74340b28dcb /noncore/apps/opie-gutenbrowser/SearchResults.cpp | |
parent | 9e1ecade17a77c3d50aecc4c92091d852e99e8d9 (diff) | |
download | opie-fc42c7317c956e5bc6e74bfbb1ec185d2faa79f4.zip opie-fc42c7317c956e5bc6e74bfbb1ec185d2faa79f4.tar.gz opie-fc42c7317c956e5bc6e74bfbb1ec185d2faa79f4.tar.bz2 |
add gutenbrowser
Diffstat (limited to 'noncore/apps/opie-gutenbrowser/SearchResults.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-gutenbrowser/SearchResults.cpp | 101 |
1 files changed, 101 insertions, 0 deletions
diff --git a/noncore/apps/opie-gutenbrowser/SearchResults.cpp b/noncore/apps/opie-gutenbrowser/SearchResults.cpp new file mode 100644 index 0000000..c98c53f --- a/dev/null +++ b/noncore/apps/opie-gutenbrowser/SearchResults.cpp | |||
@@ -0,0 +1,101 @@ | |||
1 | /**************************************************************************** | ||
2 | ** Created: Sat Feb 24 23:35:01 2001 | ||
3 | copyright : (C) 2000 -2004 by llornkcor | ||
4 | email : ljp@llornkcor.com | ||
5 | ****************************************************************************/ | ||
6 | #include "SearchResults.h" | ||
7 | #include "gutenbrowser.h" | ||
8 | #include "LibraryDialog.h" | ||
9 | |||
10 | #include <qpe/qpeapplication.h> | ||
11 | #include <stdio.h> | ||
12 | #include <qstrlist.h> | ||
13 | #include <qclipboard.h> | ||
14 | |||
15 | #include <qlayout.h> | ||
16 | #include <qlistbox.h> | ||
17 | #include <qpushbutton.h> | ||
18 | #include <qlayout.h> | ||
19 | #include <qvariant.h> | ||
20 | //#include <qtooltip.h> | ||
21 | //#include <qwhatsthis.h> | ||
22 | |||
23 | SearchResultsDlg::SearchResultsDlg( QWidget* parent, const char* name, bool modal, WFlags fl, QStringList stringList ) | ||
24 | : QDialog( parent, name, modal, fl ) | ||
25 | { | ||
26 | if ( !name ) | ||
27 | setName( "SearchResultsDlg" ); | ||
28 | |||
29 | QGridLayout *layout = new QGridLayout( this ); | ||
30 | layout->setSpacing( 2); | ||
31 | layout->setMargin( 2); | ||
32 | |||
33 | ListBox1 = new QListBox( this, "ListBox1" ); | ||
34 | outPutLabel=new QLabel( this, "outPutLabel" ); | ||
35 | statusLabel=new QLabel( this, "StatusLabel" ); | ||
36 | QString local_library = (QDir::homeDirPath ()) +"/Applications/gutenbrowser/"; | ||
37 | |||
38 | buttonOk = new QPushButton(this,"buttonOk"); | ||
39 | buttonCancel = new QPushButton(this,"buttonCancel"); | ||
40 | |||
41 | layout->addMultiCellWidget( buttonOk, 0, 0, 0, 0); | ||
42 | layout->addMultiCellWidget( buttonCancel, 0, 0, 1, 1); | ||
43 | |||
44 | layout->addMultiCellWidget( ListBox1, 1, 4, 0, 1); | ||
45 | |||
46 | outPutLabel->setMaximumHeight(30); | ||
47 | statusLabel->setMaximumHeight(30); | ||
48 | |||
49 | layout->addMultiCellWidget( outPutLabel, 5, 5, 0, 1); | ||
50 | layout->addMultiCellWidget( statusLabel, 6, 6, 0, 1); | ||
51 | |||
52 | |||
53 | setCaption( tr( "Search Results" ) ); | ||
54 | buttonOk->setText( tr( "&Download" ) ); | ||
55 | buttonOk->setAutoDefault( TRUE ); | ||
56 | buttonCancel->setText( tr( "&Cancel" ) ); | ||
57 | buttonCancel->setAutoDefault( TRUE ); | ||
58 | buttonOk->setDefault( TRUE ); | ||
59 | ListBox1->setSelectionMode( QListBox::Single ); | ||
60 | ListBox1->setMultiSelection(true); | ||
61 | statusLabel->setText( "Double click a title to begin downloading." ); | ||
62 | |||
63 | // signals and slots connections | ||
64 | connect( buttonOk, SIGNAL( clicked() ), this, SLOT( dwnLd() ) ); | ||
65 | connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); | ||
66 | connect( ListBox1, SIGNAL( doubleClicked(QListBoxItem *)), SLOT( slotListClicked(QListBoxItem * )) ); | ||
67 | |||
68 | ListBox1->insertStringList( stringList); | ||
69 | numListItems= ListBox1->numRows(); | ||
70 | QString strOut; | ||
71 | |||
72 | outPutLabel->setText( "Number of results: "+ strOut.sprintf("%d", numListItems) ); | ||
73 | |||
74 | // printf( "Sucessfully entered SearchResults Dialog\n"); | ||
75 | // selText = resultStr; | ||
76 | } | ||
77 | |||
78 | SearchResultsDlg::~SearchResultsDlg() | ||
79 | { | ||
80 | } | ||
81 | |||
82 | void SearchResultsDlg::slotListClicked(QListBoxItem *it) { | ||
83 | |||
84 | resultsList.append(it->text() ); | ||
85 | // resultsList.append(ListBox1->text( 0)); | ||
86 | // selText = ListBox1->currentText(); | ||
87 | accept(); | ||
88 | } | ||
89 | |||
90 | void SearchResultsDlg::dwnLd() { | ||
91 | |||
92 | for(unsigned int ji=0; ji< ListBox1->count() ; ji++ ) { | ||
93 | if( ListBox1->isSelected( ji) ) | ||
94 | resultsList.append(ListBox1->text( ji)); | ||
95 | } | ||
96 | accept(); | ||
97 | } | ||
98 | |||
99 | void SearchResultsDlg::downloadButtonSlot() { | ||
100 | |||
101 | } | ||