summaryrefslogtreecommitdiff
authordrw <drw>2004-02-23 18:59:17 (UTC)
committer drw <drw>2004-02-23 18:59:17 (UTC)
commit4f8be1658bc82040bac404aa98fe70c24239f10c (patch) (unidiff)
treeb502a5f03f488065d7b9868b79116fb0846d2994
parentd66f871dfeae78babeb1fa0b8a3e1c72dd10ea2b (diff)
downloadopie-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)
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
@@ -14,17 +14,17 @@
14#include "newdrinks.h" 14#include "newdrinks.h"
15#include "showdrinks.h" 15#include "showdrinks.h"
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>
29#include <qpushbutton.h> 29#include <qpushbutton.h>
30#include <qlistbox.h> 30#include <qlistbox.h>
@@ -71,22 +71,22 @@ Bartender::Bartender( QWidget* parent, const char* name, WFlags fl )
71 QPopupMenu *fileMenu; 71 QPopupMenu *fileMenu;
72 fileMenu = new QPopupMenu( this); 72 fileMenu = new QPopupMenu( this);
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() ) );
91 a->addTo( ToolBar1 ); 91 a->addTo( ToolBar1 );
92 92
@@ -100,20 +100,20 @@ Bartender::Bartender( QWidget* parent, const char* name, WFlags fl )
100 100
101 a = new QAction( tr( "Edit" ), Resource::loadPixmap( "edit" ),"Edit", 0, this, 0 ); 101 a = new QAction( tr( "Edit" ), Resource::loadPixmap( "edit" ),"Edit", 0, this, 0 );
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)),
118 this,SLOT( showDrink(int, QListViewItem *, const QPoint&, int))); 118 this,SLOT( showDrink(int, QListViewItem *, const QPoint&, int)));
119 119
@@ -181,20 +181,20 @@ void Bartender::fileNew() {
181 } 181 }
182 if(newDrinks ->result() == 1 ) { 182 if(newDrinks ->result() == 1 ) {
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
195void Bartender::showDrink(int mouse, QListViewItem * item, const QPoint&, int) { 195void 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);
199 break; 199 break;
200 case 2: 200 case 2:
@@ -205,17 +205,17 @@ void Bartender::showDrink(int mouse, QListViewItem * item, const QPoint&, int) {
205 205
206void Bartender::showDrink( QListViewItem *item) { 206void 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();
220 if(s2.find("#",0,TRUE) == -1 || dbFile.atEnd() ) { 220 if(s2.find("#",0,TRUE) == -1 || dbFile.atEnd() ) {
221// qDebug(s2); 221// qDebug(s2);
@@ -270,31 +270,31 @@ void Bartender::doSearchByName() {
270 }//end Inputdialog 270 }//end Inputdialog
271 delete fileDlg; 271 delete fileDlg;
272} 272}
273 273
274void Bartender::doSearchByDrink() { 274void 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;
299 } 299 }
300// if( dbFile.atEnd() ) break; 300// if( dbFile.atEnd() ) break;
@@ -308,17 +308,17 @@ void Bartender::doSearchByDrink() {
308 delete fileDlg; 308 delete fileDlg;
309} 309}
310 310
311void Bartender::showSearchResult(QStringList &searchList) { 311void 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();
323 } 323 }
324 QListViewItemIterator it2( DrinkView ); 324 QListViewItemIterator it2( DrinkView );
@@ -370,28 +370,28 @@ void Bartender::doEdit() {
370 if(dbFile.isOpen()) 370 if(dbFile.isOpen())
371 dbFile.close(); 371 dbFile.close();
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
394void Bartender::clearList() { 394void Bartender::clearList() {
395 DrinkView->clear(); 395 DrinkView->clear();
396} 396}
397 397
@@ -419,25 +419,25 @@ void Bartender::fileMenuActivated( int item) {
419 case -5:// drink -5 419 case -5:// drink -5
420 doSearchByName(); 420 doSearchByName();
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
431void Bartender::editMenuActivated(int item) { 431void 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
@@ -1,10 +1,10 @@
1Files: bin/bartender apps/Applications/bartender.desktop 1Files: bin/bartender apps/Applications/bartender.desktop
2Priority: optional 2Priority: optional
3Package: opie-bartender 3Package: opie-bartender
4Section: opie/applications 4Section: 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.