summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-gutenbrowser/SearchDialog.cpp
Unidiff
Diffstat (limited to 'noncore/apps/opie-gutenbrowser/SearchDialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-gutenbrowser/SearchDialog.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/noncore/apps/opie-gutenbrowser/SearchDialog.cpp b/noncore/apps/opie-gutenbrowser/SearchDialog.cpp
index d989304..055ffee 100644
--- a/noncore/apps/opie-gutenbrowser/SearchDialog.cpp
+++ b/noncore/apps/opie-gutenbrowser/SearchDialog.cpp
@@ -9,50 +9,50 @@
9#include <qlayout.h> 9#include <qlayout.h>
10#include <qcheckbox.h> 10#include <qcheckbox.h>
11#include <qlabel.h> 11#include <qlabel.h>
12#include <qlineedit.h> 12#include <qlineedit.h>
13#include <qpushbutton.h> 13#include <qpushbutton.h>
14#include <qvariant.h> 14#include <qvariant.h>
15#include <qtooltip.h> 15#include <qtooltip.h>
16#include <qwhatsthis.h> 16#include <qwhatsthis.h>
17#include <qmessagebox.h> 17#include <qmessagebox.h>
18#include <qdir.h> 18#include <qdir.h>
19#include <qpe/config.h> 19#include <qpe/config.h>
20 20
21/*This is just a single text entry dialog */ 21/*This is just a single text entry dialog */
22SearchDialog::SearchDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) 22SearchDialog::SearchDialog( QWidget* parent, const char* name, bool modal, WFlags fl )
23 : QDialog( parent, name, modal, fl ) 23 : QDialog( parent, name, modal, fl )
24{ 24{
25 if ( !name ) 25 if ( !name )
26 setName( "SearchDialog" ); 26 setName( "SearchDialog" );
27 Config cfg("Gutenbrowser"); 27 Config cfg("Gutenbrowser");
28 cfg.setGroup("General"); 28 cfg.setGroup("General");
29 QString lastSearch=cfg.readEntry("LastSearch",""); 29 QString lastSearch=cfg.readEntry("LastSearch","");
30 30
31#warning FIXME 31#warning FIXME
32 // FIXME 32 // FIXME
33 resize( 220,100); 33 resize( 220,110);
34 34
35 QGridLayout *layout = new QGridLayout( this ); 35 QGridLayout *layout = new QGridLayout( this );
36 layout->setSpacing( 2); 36 layout->setSpacing( 2);
37 layout->setMargin( 2); 37 layout->setMargin( 2);
38 38
39 QString local_library = (QDir::homeDirPath ()) +"/Applications/gutenbrowser/"; 39 QString local_library = (QDir::homeDirPath ()) +"/Applications/gutenbrowser/";
40 TextLabel1 = new QLabel( this, "TextLabel1" ); 40 TextLabel1 = new QLabel( this, "TextLabel1" );
41 layout->addMultiCellWidget( TextLabel1, 0, 0, 0, 1); 41 layout->addMultiCellWidget( TextLabel1, 0, 0, 0, 1);
42 42
43 label1Str= "<P>Enter text to search etext for </P>" ; 43 label1Str= "<P>Enter text to search etext for </P>" ;
44 TextLabel1->setText( tr( label1Str) ); 44 TextLabel1->setText( tr( label1Str) );
45 45
46 SearchLineEdit = new QLineEdit( this, "SearchLineEdit" ); 46 SearchLineEdit = new QLineEdit( this, "SearchLineEdit" );
47 layout->addMultiCellWidget( SearchLineEdit, 1, 1, 0, 1); 47 layout->addMultiCellWidget( SearchLineEdit, 1, 1, 0, 1);
48 48
49 buttonOk = new QPushButton( this, "buttonOk" ); 49 buttonOk = new QPushButton( this, "buttonOk" );
50 buttonOk->setText( tr( "Sea&rch" ) ); 50 buttonOk->setText( tr( "Sea&rch" ) );
51 buttonOk->setAutoDefault( TRUE ); 51 buttonOk->setAutoDefault( TRUE );
52 buttonOk->setToggleButton( TRUE); 52 buttonOk->setToggleButton( TRUE);
53 buttonOk->setDefault( TRUE ); 53 buttonOk->setDefault( TRUE );
54 54
55 layout->addMultiCellWidget(buttonOk, 2, 2, 0, 0); 55 layout->addMultiCellWidget(buttonOk, 2, 2, 0, 0);
56 56
57 buttonCancel = new QPushButton( this, "buttonCancel" ); 57 buttonCancel = new QPushButton( this, "buttonCancel" );
58 buttonCancel->setText( tr( "&Cancel" ) ); 58 buttonCancel->setText( tr( "&Cancel" ) );
@@ -77,60 +77,60 @@ SearchDialog::SearchDialog( QWidget* parent, const char* name, bool modal, WFla
77SearchDialog::~SearchDialog() 77SearchDialog::~SearchDialog()
78{ 78{
79} 79}
80 80
81QString SearchDialog::get_text() { 81QString SearchDialog::get_text() {
82 return SearchLineEdit->text(); 82 return SearchLineEdit->text();
83} 83}
84 84
85bool SearchDialog::get_direction() { 85bool SearchDialog::get_direction() {
86 return false; //search forward 86 return false; //search forward
87} 87}
88 88
89bool SearchDialog::case_sensitive() { 89bool SearchDialog::case_sensitive() {
90 return true; 90 return true;
91} 91}
92 92
93bool SearchDialog::forward_search() { 93bool SearchDialog::forward_search() {
94 return true; 94 return true;
95} 95}
96 96
97void SearchDialog::byeBye() 97void SearchDialog::byeBye()
98{ 98{
99 99
100 searchString = get_text(); 100 searchString = get_text();
101// odebug << "Search string is "+searchString << oendl; 101// odebug << "Search string is "+searchString << oendl;
102 Config cfg("Gutenbrowser"); 102 Config cfg("Gutenbrowser");
103 cfg.setGroup("General"); 103 cfg.setGroup("General");
104 cfg.writeEntry("LastSearch",searchString); 104 cfg.writeEntry("LastSearch",searchString);
105 105
106 QString thisName=name(); 106 QString thisName=name();
107 if( thisName.find("Library Search", 0, TRUE) != -1) { 107 if( thisName.find("Library Search", 0, TRUE) != -1) {
108 // searchString = SearchLineEdit->text(); 108 // searchString = SearchLineEdit->text();
109 accept(); 109 accept();
110 } else { 110 } else {
111 111
112 buttonOk->setDown(TRUE); 112 buttonOk->setDown(TRUE);
113 113
114 emit search_signal(); 114 emit search_signal();
115 buttonOk->setDown(FALSE); 115 buttonOk->setDown(FALSE);
116 } 116 }
117} 117}
118 118
119void SearchDialog::closed() 119void SearchDialog::closed()
120{ 120{
121 searchString = get_text(); 121 searchString = get_text();
122// odebug << "Search string is "+searchString << oendl; 122// odebug << "Search string is "+searchString << oendl;
123 Config cfg("Gutenbrowser"); 123 Config cfg("Gutenbrowser");
124 cfg.setGroup("General"); 124 cfg.setGroup("General");
125 cfg.writeEntry("LastSearch",searchString); 125 cfg.writeEntry("LastSearch",searchString);
126 126
127 emit search_done_signal(); 127 emit search_done_signal();
128 //this->reject(); 128 //this->reject();
129 this->hide(); 129 this->hide();
130} 130}
131 131
132 132
133void SearchDialog::setLabel(QString labelText) 133void SearchDialog::setLabel(QString labelText)
134{ 134{
135 TextLabel1->setText( tr( label1Str+labelText) ); 135 TextLabel1->setText( tr( label1Str+labelText) );
136} 136}