author | drw <drw> | 2004-02-23 18:59:17 (UTC) |
---|---|---|
committer | drw <drw> | 2004-02-23 18:59:17 (UTC) |
commit | 4f8be1658bc82040bac404aa98fe70c24239f10c (patch) (unidiff) | |
tree | b502a5f03f488065d7b9868b79116fb0846d2994 /noncore/apps | |
parent | d66f871dfeae78babeb1fa0b8a3e1c72dd10ea2b (diff) | |
download | opie-4f8be1658bc82040bac404aa98fe70c24239f10c.zip opie-4f8be1658bc82040bac404aa98fe70c24239f10c.tar.gz opie-4f8be1658bc82040bac404aa98fe70c24239f10c.tar.bz2 |
Fixed control file so ipkg will build and commented out an unused include (but did convert to libopie2)
-rw-r--r-- | noncore/apps/opie-bartender/bartender.cpp | 36 | ||||
-rw-r--r-- | noncore/apps/opie-bartender/opie-bartender.control | 4 |
2 files changed, 20 insertions, 20 deletions
diff --git a/noncore/apps/opie-bartender/bartender.cpp b/noncore/apps/opie-bartender/bartender.cpp index cd0a364..740478f 100644 --- a/noncore/apps/opie-bartender/bartender.cpp +++ b/noncore/apps/opie-bartender/bartender.cpp | |||
@@ -16,13 +16,13 @@ | |||
16 | #include "inputDialog.h" | 16 | #include "inputDialog.h" |
17 | #include "searchresults.h" | 17 | #include "searchresults.h" |
18 | #include "bac.h" | 18 | #include "bac.h" |
19 | 19 | ||
20 | #include <qpe/qpetoolbar.h> | 20 | #include <qpe/qpetoolbar.h> |
21 | #include <qmenubar.h> | 21 | #include <qmenubar.h> |
22 | #include <opie/colorpopupmenu.h> | 22 | //#include <opie2/colorpopupmenu.h> |
23 | #include <qpe/qpeapplication.h> | 23 | #include <qpe/qpeapplication.h> |
24 | #include <qpe/resource.h> | 24 | #include <qpe/resource.h> |
25 | 25 | ||
26 | #include <qcstring.h> | 26 | #include <qcstring.h> |
27 | #include <qlineedit.h> | 27 | #include <qlineedit.h> |
28 | #include <qdir.h> | 28 | #include <qdir.h> |
@@ -73,18 +73,18 @@ Bartender::Bartender( QWidget* parent, const char* name, WFlags fl ) | |||
73 | menuBar->insertItem( tr("File"), fileMenu ); | 73 | menuBar->insertItem( tr("File"), fileMenu ); |
74 | 74 | ||
75 | fileMenu->insertItem(tr("New Drink")); | 75 | fileMenu->insertItem(tr("New Drink")); |
76 | fileMenu->insertItem(tr("Open Drink")); | 76 | fileMenu->insertItem(tr("Open Drink")); |
77 | fileMenu->insertItem(tr("Find by Drink Name")); | 77 | fileMenu->insertItem(tr("Find by Drink Name")); |
78 | fileMenu->insertItem(tr("Find by Alcohol")); | 78 | fileMenu->insertItem(tr("Find by Alcohol")); |
79 | 79 | ||
80 | QPopupMenu *editMenu; | 80 | QPopupMenu *editMenu; |
81 | editMenu = new QPopupMenu( this); | 81 | editMenu = new QPopupMenu( this); |
82 | menuBar->insertItem( tr("Edit"), editMenu ); | 82 | menuBar->insertItem( tr("Edit"), editMenu ); |
83 | editMenu->insertItem(tr("edit")); | 83 | editMenu->insertItem(tr("edit")); |
84 | 84 | ||
85 | connect( fileMenu, SIGNAL( activated(int) ), this, SLOT( fileMenuActivated(int) )); | 85 | connect( fileMenu, SIGNAL( activated(int) ), this, SLOT( fileMenuActivated(int) )); |
86 | connect( editMenu, SIGNAL( activated(int) ), this, SLOT( editMenuActivated(int) )); | 86 | connect( editMenu, SIGNAL( activated(int) ), this, SLOT( editMenuActivated(int) )); |
87 | 87 | ||
88 | 88 | ||
89 | QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), "New", 0, this, 0 ); | 89 | QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), "New", 0, this, 0 ); |
90 | connect( a, SIGNAL( activated() ), this, SLOT( fileNew() ) ); | 90 | connect( a, SIGNAL( activated() ), this, SLOT( fileNew() ) ); |
@@ -102,16 +102,16 @@ Bartender::Bartender( QWidget* parent, const char* name, WFlags fl ) | |||
102 | connect( a, SIGNAL( activated() ), this, SLOT( doEdit() ) ); | 102 | connect( a, SIGNAL( activated() ), this, SLOT( doEdit() ) ); |
103 | a->addTo( ToolBar1 ); | 103 | a->addTo( ToolBar1 ); |
104 | 104 | ||
105 | QPushButton *t; | 105 | QPushButton *t; |
106 | t= new QPushButton( "BAC", ToolBar1, "bacButtin"); | 106 | t= new QPushButton( "BAC", ToolBar1, "bacButtin"); |
107 | connect( t, SIGNAL( clicked() ), this, SLOT( doBac() ) ); | 107 | connect( t, SIGNAL( clicked() ), this, SLOT( doBac() ) ); |
108 | 108 | ||
109 | DrinkView = new QListView( this, "DrinkView" ); | 109 | DrinkView = new QListView( this, "DrinkView" ); |
110 | DrinkView->addColumn( tr( "Name of Drink" ) ); | 110 | DrinkView->addColumn( tr( "Name of Drink" ) ); |
111 | // DrinkView->setRootIsDecorated( TRUE ); | 111 | // DrinkView->setRootIsDecorated( TRUE ); |
112 | DrinkView->header()->hide(); | 112 | DrinkView->header()->hide(); |
113 | 113 | ||
114 | QPEApplication::setStylusOperation( DrinkView->viewport(),QPEApplication::RightOnHold); | 114 | QPEApplication::setStylusOperation( DrinkView->viewport(),QPEApplication::RightOnHold); |
115 | 115 | ||
116 | connect(DrinkView, SIGNAL( doubleClicked(QListViewItem*)),this,SLOT(showDrink( QListViewItem*))); | 116 | connect(DrinkView, SIGNAL( doubleClicked(QListViewItem*)),this,SLOT(showDrink( QListViewItem*))); |
117 | connect(DrinkView, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), | 117 | connect(DrinkView, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), |
@@ -183,16 +183,16 @@ void Bartender::fileNew() { | |||
183 | QString newDrink="\n# "+newName+"\n"; | 183 | QString newDrink="\n# "+newName+"\n"; |
184 | newDrink.append(newIng+"\n"); | 184 | newDrink.append(newIng+"\n"); |
185 | qDebug("writing "+newDrink); | 185 | qDebug("writing "+newDrink); |
186 | dbFile.writeBlock( newDrink.latin1(), newDrink.length()); | 186 | dbFile.writeBlock( newDrink.latin1(), newDrink.length()); |
187 | clearList(); | 187 | clearList(); |
188 | dbFile.close(); | 188 | dbFile.close(); |
189 | 189 | ||
190 | initDrinkDb(); | 190 | initDrinkDb(); |
191 | } | 191 | } |
192 | delete newDrinks; | 192 | delete newDrinks; |
193 | } | 193 | } |
194 | 194 | ||
195 | void Bartender::showDrink(int mouse, QListViewItem * item, const QPoint&, int) { | 195 | void Bartender::showDrink(int mouse, QListViewItem * item, const QPoint&, int) { |
196 | switch (mouse) { | 196 | switch (mouse) { |
197 | case 1: | 197 | case 1: |
198 | // showDrink(item); | 198 | // showDrink(item); |
@@ -207,13 +207,13 @@ void Bartender::showDrink( QListViewItem *item) { | |||
207 | if(item==NULL) return; | 207 | if(item==NULL) return; |
208 | dbFile.at(0); | 208 | dbFile.at(0); |
209 | Show_Drink *showDrinks; | 209 | Show_Drink *showDrinks; |
210 | QString myDrink=item->text(0); | 210 | QString myDrink=item->text(0); |
211 | showDrinks = new Show_Drink(this, myDrink, TRUE); | 211 | showDrinks = new Show_Drink(this, myDrink, TRUE); |
212 | QTextStream t( &dbFile); | 212 | QTextStream t( &dbFile); |
213 | 213 | ||
214 | QString s, s2; | 214 | QString s, s2; |
215 | while ( !t.eof()) { | 215 | while ( !t.eof()) { |
216 | s = t.readLine(); | 216 | s = t.readLine(); |
217 | if(s.find( myDrink, 0, TRUE) != -1) { | 217 | if(s.find( myDrink, 0, TRUE) != -1) { |
218 | for(int i=0;s2.find( "#", 0, TRUE) == -1;i++) { | 218 | for(int i=0;s2.find( "#", 0, TRUE) == -1;i++) { |
219 | s2 = t.readLine(); | 219 | s2 = t.readLine(); |
@@ -272,27 +272,27 @@ void Bartender::doSearchByName() { | |||
272 | } | 272 | } |
273 | 273 | ||
274 | void Bartender::doSearchByDrink() { | 274 | void Bartender::doSearchByDrink() { |
275 | // if( DrinkView->currentItem() == NULL) return; | 275 | // if( DrinkView->currentItem() == NULL) return; |
276 | QStringList searchList; | 276 | QStringList searchList; |
277 | QString searchForDrinkName, lastDrinkName, tempName; | 277 | QString searchForDrinkName, lastDrinkName, tempName; |
278 | 278 | ||
279 | InputDialog *fileDlg; | 279 | InputDialog *fileDlg; |
280 | fileDlg = new InputDialog(this,tr("Find by Alcohol"),TRUE, 0); | 280 | fileDlg = new InputDialog(this,tr("Find by Alcohol"),TRUE, 0); |
281 | fileDlg->exec(); | 281 | fileDlg->exec(); |
282 | if( fileDlg->result() == 1 ) { | 282 | if( fileDlg->result() == 1 ) { |
283 | searchForDrinkName = fileDlg->LineEdit1->text(); | 283 | searchForDrinkName = fileDlg->LineEdit1->text(); |
284 | 284 | ||
285 | dbFile.at(0); | 285 | dbFile.at(0); |
286 | QTextStream t( &dbFile); | 286 | QTextStream t( &dbFile); |
287 | 287 | ||
288 | QString s, s2; | 288 | QString s, s2; |
289 | while ( !t.eof()) { | 289 | while ( !t.eof()) { |
290 | s = t.readLine(); | 290 | s = t.readLine(); |
291 | if(s.find("#",0,TRUE) != -1) { | 291 | if(s.find("#",0,TRUE) != -1) { |
292 | lastDrinkName=s.right(s.length()-2); | 292 | lastDrinkName=s.right(s.length()-2); |
293 | // qDebug("last drink name "+lastDrinkName); | 293 | // qDebug("last drink name "+lastDrinkName); |
294 | } | 294 | } |
295 | else if( s.find( searchForDrinkName ,0, FALSE) != -1 && lastDrinkName != tempName ) { | 295 | else if( s.find( searchForDrinkName ,0, FALSE) != -1 && lastDrinkName != tempName ) { |
296 | // qDebug("appending "+lastDrinkName); | 296 | // qDebug("appending "+lastDrinkName); |
297 | searchList.append( lastDrinkName); | 297 | searchList.append( lastDrinkName); |
298 | tempName=lastDrinkName; | 298 | tempName=lastDrinkName; |
@@ -310,13 +310,13 @@ void Bartender::doSearchByDrink() { | |||
310 | 310 | ||
311 | void Bartender::showSearchResult(QStringList &searchList) { | 311 | void Bartender::showSearchResult(QStringList &searchList) { |
312 | QString result; | 312 | QString result; |
313 | Search_Results *searchDlg; | 313 | Search_Results *searchDlg; |
314 | 314 | ||
315 | searchList.sort(); | 315 | searchList.sort(); |
316 | 316 | ||
317 | searchDlg = new Search_Results(this, "Search Results", TRUE); | 317 | searchDlg = new Search_Results(this, "Search Results", TRUE); |
318 | searchDlg->ListBox1->insertStringList( searchList,-1); | 318 | searchDlg->ListBox1->insertStringList( searchList,-1); |
319 | QPEApplication::execDialog( searchDlg ); | 319 | QPEApplication::execDialog( searchDlg ); |
320 | 320 | ||
321 | if( searchDlg->result() == 1 ) { | 321 | if( searchDlg->result() == 1 ) { |
322 | result= searchDlg->ListBox1->currentText(); | 322 | result= searchDlg->ListBox1->currentText(); |
@@ -372,24 +372,24 @@ void Bartender::doEdit() { | |||
372 | if ( !dbFile.open( IO_ReadWrite )) { | 372 | if ( !dbFile.open( IO_ReadWrite )) { |
373 | QMessageBox::message( (tr("Note")), (tr("Drink database not opened sucessfully.\n")) ); | 373 | QMessageBox::message( (tr("Note")), (tr("Drink database not opened sucessfully.\n")) ); |
374 | return; | 374 | return; |
375 | } | 375 | } |
376 | int fd = dbFile.handle(); | 376 | int fd = dbFile.handle(); |
377 | lseek( fd, foundAt, SEEK_SET); | 377 | lseek( fd, foundAt, SEEK_SET); |
378 | 378 | ||
379 | // dbFile.at( foundAt); | 379 | // dbFile.at( foundAt); |
380 | #warning FIXME problems with editing drinks db | 380 | #warning FIXME problems with editing drinks db |
381 | ////////// FIXME write to user file | 381 | ////////// FIXME write to user file |
382 | QString newDrink="# "+newName+"\n"; | 382 | QString newDrink="# "+newName+"\n"; |
383 | newDrink.append(newIng+"\n"); | 383 | newDrink.append(newIng+"\n"); |
384 | qDebug("writing "+newDrink); | 384 | qDebug("writing "+newDrink); |
385 | dbFile.writeBlock( newDrink.latin1(), newDrink.length()); | 385 | dbFile.writeBlock( newDrink.latin1(), newDrink.length()); |
386 | clearList(); | 386 | clearList(); |
387 | 387 | ||
388 | dbFile.flush(); | 388 | dbFile.flush(); |
389 | 389 | ||
390 | initDrinkDb(); | 390 | initDrinkDb(); |
391 | } | 391 | } |
392 | } | 392 | } |
393 | 393 | ||
394 | void Bartender::clearList() { | 394 | void Bartender::clearList() { |
395 | DrinkView->clear(); | 395 | DrinkView->clear(); |
@@ -421,23 +421,23 @@ void Bartender::fileMenuActivated( int item) { | |||
421 | 421 | ||
422 | break; | 422 | break; |
423 | case -6:// alcohol -6 | 423 | case -6:// alcohol -6 |
424 | doSearchByDrink(); | 424 | doSearchByDrink(); |
425 | 425 | ||
426 | break; | 426 | break; |
427 | 427 | ||
428 | } | 428 | } |
429 | } | 429 | } |
430 | 430 | ||
431 | void Bartender::editMenuActivated(int item) { | 431 | void Bartender::editMenuActivated(int item) { |
432 | qDebug("Item %d", item); | 432 | qDebug("Item %d", item); |
433 | /* | 433 | /* |
434 | edit -8 | 434 | edit -8 |
435 | */ | 435 | */ |
436 | switch(item) { | 436 | switch(item) { |
437 | case -8: | 437 | case -8: |
438 | doEdit() ; | 438 | doEdit() ; |
439 | break; | 439 | break; |
440 | 440 | ||
441 | } | 441 | } |
442 | } | 442 | } |
443 | 443 | ||
diff --git a/noncore/apps/opie-bartender/opie-bartender.control b/noncore/apps/opie-bartender/opie-bartender.control index acd3304..a8bf860 100644 --- a/noncore/apps/opie-bartender/opie-bartender.control +++ b/noncore/apps/opie-bartender/opie-bartender.control | |||
@@ -2,9 +2,9 @@ Files: bin/bartender apps/Applications/bartender.desktop | |||
2 | Priority: optional | 2 | Priority: optional |
3 | Package: opie-bartender | 3 | Package: opie-bartender |
4 | Section: opie/applications | 4 | Section: opie/applications |
5 | Maintainer: L.J. Potter <lpotter@trolltech.com> | 5 | Maintainer: L.J. Potter <lpotter@trolltech.com> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: $QPE_VERSION-$SUB_VERSION | 7 | Version: $QPE_VERSION-$SUB_VERSION |
8 | Depends: qpe-base ($QPE_VERSION) | 8 | Depends: task-opie-minimal |
9 | Description: Bartender drink receipe database lookup, and | 9 | Description: Bartender drink receipe database lookup, and |
10 | blood alcohol estimator. | 10 | blood alcohol estimator. |