summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-bartender/bartender.cpp36
-rw-r--r--noncore/apps/opie-bartender/opie-bartender.control4
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
@@ -19,7 +19,7 @@
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
@@ -76,12 +76,12 @@ Bartender::Bartender( QWidget* parent, const char* name, WFlags fl )
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
@@ -105,10 +105,10 @@ Bartender::Bartender( QWidget* parent, const char* name, WFlags fl )
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);
@@ -186,10 +186,10 @@ void Bartender::fileNew() {
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
195void Bartender::showDrink(int mouse, QListViewItem * item, const QPoint&, int) { 195void Bartender::showDrink(int mouse, QListViewItem * item, const QPoint&, int) {
@@ -210,7 +210,7 @@ void Bartender::showDrink( QListViewItem *item) {
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();
@@ -275,7 +275,7 @@ 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();
@@ -284,12 +284,12 @@ void Bartender::doSearchByDrink() {
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 ) {
@@ -313,7 +313,7 @@ void Bartender::showSearchResult(QStringList &searchList) {
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 );
@@ -375,7 +375,7 @@ void Bartender::doEdit() {
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
@@ -384,9 +384,9 @@ void Bartender::doEdit() {
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}
@@ -424,7 +424,7 @@ void Bartender::fileMenuActivated( int item) {
424 doSearchByDrink(); 424 doSearchByDrink();
425 425
426 break; 426 break;
427 427
428 } 428 }
429} 429}
430 430
@@ -435,9 +435,9 @@ void Bartender::editMenuActivated(int item) {
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
@@ -5,6 +5,6 @@ Section: opie/applications
5Maintainer: L.J. Potter <lpotter@trolltech.com> 5Maintainer: L.J. Potter <lpotter@trolltech.com>
6Architecture: arm 6Architecture: arm
7Version: $QPE_VERSION-$SUB_VERSION 7Version: $QPE_VERSION-$SUB_VERSION
8Depends: qpe-base ($QPE_VERSION) 8Depends: task-opie-minimal
9Description: Bartender drink receipe database lookup, and 9Description: Bartender drink receipe database lookup, and
10blood alcohol estimator. 10 blood alcohol estimator.