summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/applets/autorotateapplet/autorotate.cpp8
-rw-r--r--noncore/applets/memoryapplet/swapfile.cpp4
-rw-r--r--noncore/applets/networkapplet/networkapplet.cpp6
-rw-r--r--noncore/applets/notesapplet/notes.cpp5
-rw-r--r--noncore/applets/wirelessapplet/advancedconfig.cpp1
-rw-r--r--noncore/applets/wirelessapplet/wireless.cpp5
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp10
-rw-r--r--noncore/apps/advancedfm/advancedfmMenu.cpp11
-rw-r--r--noncore/apps/checkbook/cfg.cpp3
-rw-r--r--noncore/apps/checkbook/checkbook.cpp1
-rw-r--r--noncore/apps/checkbook/configuration.cpp4
-rw-r--r--noncore/apps/checkbook/mainwindow.cpp4
-rw-r--r--noncore/apps/checkbook/tabledef.cpp2
-rw-r--r--noncore/apps/checkbook/transaction.cpp1
-rw-r--r--noncore/apps/confedit/editwidget.cpp8
-rw-r--r--noncore/apps/confedit/listviewitemconffile.cpp1
-rw-r--r--noncore/apps/confedit/listviewitemconfigentry.cpp1
-rw-r--r--noncore/apps/confedit/mainwindow.cpp9
-rw-r--r--noncore/apps/keyz-cfg/main.cpp2
-rw-r--r--noncore/apps/keyz-cfg/zkb.cpp1
-rw-r--r--noncore/apps/keyz-cfg/zkbnames.cpp1
-rw-r--r--noncore/apps/opie-bartender/bac.cpp3
-rw-r--r--noncore/apps/opie-bartender/bartender.cpp11
-rw-r--r--noncore/apps/opie-bartender/inputDialog.cpp4
-rw-r--r--noncore/apps/opie-bartender/newdrinks.cpp7
-rw-r--r--noncore/apps/opie-bartender/searchresults.cpp9
-rw-r--r--noncore/apps/opie-bartender/showdrinks.cpp9
27 files changed, 1 insertions, 130 deletions
diff --git a/noncore/applets/autorotateapplet/autorotate.cpp b/noncore/applets/autorotateapplet/autorotate.cpp
index e7891c8..5152904 100644
--- a/noncore/applets/autorotateapplet/autorotate.cpp
+++ b/noncore/applets/autorotateapplet/autorotate.cpp
@@ -1,94 +1,86 @@
1/* 1/*
2 * copyright : (c) 2003 by Greg Gilbert 2 * copyright : (c) 2003 by Greg Gilbert
3 * email : greg@treke.net 3 * email : greg@treke.net
4 * based on the cardmon applet by Max Reiss 4 * based on the cardmon applet by Max Reiss
5 * * 5 * *
6 * This program is free software; you can redistribute it and/or modify * 6 * This program is free software; you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by * 7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation; either version 2 of the License, or * 8 * the Free Software Foundation; either version 2 of the License, or *
9 * (at your option) any later version. * 9 * (at your option) any later version. *
10 * * 10 * *
11 *************************************************************************/ 11 *************************************************************************/
12 12
13#include "autorotate.h" 13#include "autorotate.h"
14 14
15/* OPIE */ 15/* OPIE */
16#include <opie2/odevice.h> 16#include <opie2/odevice.h>
17#include <qpe/applnk.h> 17#include <qpe/applnk.h>
18#include <qpe/config.h> 18#include <qpe/config.h>
19#include <qpe/resource.h> 19#include <qpe/resource.h>
20 20
21/* QT */ 21/* QT */
22#include <qapplication.h>
23#include <qfile.h>
24#include <qcopchannel_qws.h>
25#include <qmessagebox.h>
26#include <qpainter.h> 22#include <qpainter.h>
27#include <qpixmap.h>
28#include <qimage.h>
29#include <qtimer.h>
30#include <qtextstream.h>
31 23
32using namespace Opie; 24using namespace Opie;
33 25
34AutoRotate::AutoRotate(QWidget * parent):QWidget(parent) 26AutoRotate::AutoRotate(QWidget * parent):QWidget(parent)
35{ 27{
36 setFixedWidth( AppLnk::smallIconSize() ); 28 setFixedWidth( AppLnk::smallIconSize() );
37 setFixedHeight( AppLnk::smallIconSize() ); 29 setFixedHeight( AppLnk::smallIconSize() );
38 30
39 enabledPm.convertFromImage( Resource::loadImage("autorotate/rotate").smoothScale( height(), width() ) ); 31 enabledPm.convertFromImage( Resource::loadImage("autorotate/rotate").smoothScale( height(), width() ) );
40 disabledPm.convertFromImage( Resource::loadImage("autorotate/norotate").smoothScale( height(), width() ) ); 32 disabledPm.convertFromImage( Resource::loadImage("autorotate/norotate").smoothScale( height(), width() ) );
41 33
42 repaint(true); 34 repaint(true);
43 popupMenu = 0; 35 popupMenu = 0;
44 show(); 36 show();
45} 37}
46 38
47AutoRotate::~AutoRotate() 39AutoRotate::~AutoRotate()
48{ 40{
49 if (popupMenu) { 41 if (popupMenu) {
50 delete popupMenu; 42 delete popupMenu;
51 } 43 }
52} 44}
53 45
54void AutoRotate::mousePressEvent(QMouseEvent *) 46void AutoRotate::mousePressEvent(QMouseEvent *)
55{ 47{
56 QPopupMenu *menu = new QPopupMenu(this); 48 QPopupMenu *menu = new QPopupMenu(this);
57 menu->insertItem( isRotateEnabled()? "Disable Rotation" : "Enable Rotation" ,1 ); 49 menu->insertItem( isRotateEnabled()? "Disable Rotation" : "Enable Rotation" ,1 );
58 50
59 QPoint p = mapToGlobal(QPoint(0, 0)); 51 QPoint p = mapToGlobal(QPoint(0, 0));
60 QSize s = menu->sizeHint(); 52 QSize s = menu->sizeHint();
61 int opt = menu->exec(QPoint(p.x() + (width() / 2) - (s.width() / 2), p.y() - s.height()), 0); 53 int opt = menu->exec(QPoint(p.x() + (width() / 2) - (s.width() / 2), p.y() - s.height()), 0);
62 54
63 if (opt==1) 55 if (opt==1)
64 { 56 {
65 setRotateEnabled( !isRotateEnabled() ); 57 setRotateEnabled( !isRotateEnabled() );
66 repaint(true); 58 repaint(true);
67 } 59 }
68 60
69 delete menu; 61 delete menu;
70} 62}
71 63
72void AutoRotate::paintEvent(QPaintEvent *) 64void AutoRotate::paintEvent(QPaintEvent *)
73{ 65{
74 QPainter p(this); 66 QPainter p(this);
75 p.drawPixmap( 0, 0, isRotateEnabled()? enabledPm : disabledPm ); 67 p.drawPixmap( 0, 0, isRotateEnabled()? enabledPm : disabledPm );
76} 68}
77 69
78void AutoRotate::setRotateEnabled(bool status) 70void AutoRotate::setRotateEnabled(bool status)
79{ 71{
80 Config cfg( "qpe" ); 72 Config cfg( "qpe" );
81 cfg.setGroup( "Appearance" ); 73 cfg.setGroup( "Appearance" );
82 cfg.writeEntry( "rotateEnabled", status ); 74 cfg.writeEntry( "rotateEnabled", status );
83 75
84} 76}
85bool AutoRotate::isRotateEnabled() 77bool AutoRotate::isRotateEnabled()
86{ 78{
87 Config cfg( "qpe" ); 79 Config cfg( "qpe" );
88 cfg.setGroup( "Appearance" ); 80 cfg.setGroup( "Appearance" );
89 81
90 bool res = cfg.readBoolEntry( "rotateEnabled" ); 82 bool res = cfg.readBoolEntry( "rotateEnabled" );
91 83
92 if (res ) 84 if (res )
93 qDebug("Enabled"); 85 qDebug("Enabled");
94 else 86 else
diff --git a/noncore/applets/memoryapplet/swapfile.cpp b/noncore/applets/memoryapplet/swapfile.cpp
index 06746a7..7483592 100644
--- a/noncore/applets/memoryapplet/swapfile.cpp
+++ b/noncore/applets/memoryapplet/swapfile.cpp
@@ -1,105 +1,101 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#include "swapfile.h" 21#include "swapfile.h"
22 22
23#include <qlabel.h> 23#include <qlabel.h>
24#include <qtimer.h> 24#include <qtimer.h>
25#include <qfile.h>
26#include <qtextstream.h>
27#include <qlayout.h> 25#include <qlayout.h>
28#include <qpushbutton.h> 26#include <qpushbutton.h>
29#include <qhbuttongroup.h> 27#include <qhbuttongroup.h>
30#include <qradiobutton.h> 28#include <qradiobutton.h>
31#include <qlineedit.h> 29#include <qlineedit.h>
32#include <qprogressbar.h> 30#include <qprogressbar.h>
33#include <qcombobox.h> 31#include <qcombobox.h>
34#include <qvgroupbox.h> 32#include <qvgroupbox.h>
35#include <qhbox.h> 33#include <qhbox.h>
36#include <qmessagebox.h> 34#include <qmessagebox.h>
37#include <stdio.h> 35#include <stdio.h>
38#include <stdlib.h> 36#include <stdlib.h>
39#include <string.h> 37#include <string.h>
40#include <qfile.h>
41#include <qtextstream.h>
42 38
43#include <qcopchannel_qws.h> 39#include <qcopchannel_qws.h>
44#include <qpe/resource.h> 40#include <qpe/resource.h>
45 41
46#include <unistd.h> 42#include <unistd.h>
47#include <fcntl.h> 43#include <fcntl.h>
48#include <sys/vfs.h> 44#include <sys/vfs.h>
49#include <mntent.h> 45#include <mntent.h>
50#include <unistd.h> 46#include <unistd.h>
51#include <sys/types.h> 47#include <sys/types.h>
52 48
53Swapfile::Swapfile( QWidget *parent, const char *name, WFlags f ) 49Swapfile::Swapfile( QWidget *parent, const char *name, WFlags f )
54 : QWidget( parent, name, f ) 50 : QWidget( parent, name, f )
55{ 51{
56 // are we running as root? 52 // are we running as root?
57 isRoot = geteuid() == 0; 53 isRoot = geteuid() == 0;
58 54
59 QVBoxLayout* vb = new QVBoxLayout(this, 5); 55 QVBoxLayout* vb = new QVBoxLayout(this, 5);
60 56
61 QHButtonGroup* cfsdRBG = new QHButtonGroup(tr("Swapfile location"), this); 57 QHButtonGroup* cfsdRBG = new QHButtonGroup(tr("Swapfile location"), this);
62 cfsdRBG->setRadioButtonExclusive(true); 58 cfsdRBG->setRadioButtonExclusive(true);
63 vb->addWidget(cfsdRBG); 59 vb->addWidget(cfsdRBG);
64 60
65 ramRB = new QRadioButton(tr("RAM"), cfsdRBG); 61 ramRB = new QRadioButton(tr("RAM"), cfsdRBG);
66 cfRB = new QRadioButton(tr("CF Card"), cfsdRBG); 62 cfRB = new QRadioButton(tr("CF Card"), cfsdRBG);
67 sdRB = new QRadioButton(tr("SD Card"), cfsdRBG); 63 sdRB = new QRadioButton(tr("SD Card"), cfsdRBG);
68 64
69 QHBox *hb1 = new QHBox(this); 65 QHBox *hb1 = new QHBox(this);
70 hb1->setSpacing(5); 66 hb1->setSpacing(5);
71 67
72 swapPath1 = new QLineEdit(hb1); 68 swapPath1 = new QLineEdit(hb1);
73 swapPath1->setEnabled(false); 69 swapPath1->setEnabled(false);
74 70
75 QPushButton* swapOn = new QPushButton(tr(" On "), hb1); 71 QPushButton* swapOn = new QPushButton(tr(" On "), hb1);
76 QPushButton* swapOff = new QPushButton(tr(" Off "), hb1); 72 QPushButton* swapOff = new QPushButton(tr(" Off "), hb1);
77 vb->addWidget(hb1); 73 vb->addWidget(hb1);
78 74
79 QVGroupBox* box1 = new QVGroupBox(tr("Manage Swapfile"), this); 75 QVGroupBox* box1 = new QVGroupBox(tr("Manage Swapfile"), this);
80 vb->addWidget(box1); 76 vb->addWidget(box1);
81 77
82 QHBox *hb2 = new QHBox(box1); 78 QHBox *hb2 = new QHBox(box1);
83 hb2->setSpacing(5); 79 hb2->setSpacing(5);
84 QPushButton* mkSwap = new QPushButton(tr("Generate"), hb2); 80 QPushButton* mkSwap = new QPushButton(tr("Generate"), hb2);
85 QPushButton* rmSwap = new QPushButton(tr("Remove"), hb2); 81 QPushButton* rmSwap = new QPushButton(tr("Remove"), hb2);
86 82
87 QHBox *hb3 = new QHBox(box1); 83 QHBox *hb3 = new QHBox(box1);
88 hb3->setSpacing(5); 84 hb3->setSpacing(5);
89 swapSize = new QComboBox(hb3); 85 swapSize = new QComboBox(hb3);
90 swapSize->insertStringList(QStringList::split(",", tr("2 Mb,4 Mb,6 Mb,8 Mb"))); 86 swapSize->insertStringList(QStringList::split(",", tr("2 Mb,4 Mb,6 Mb,8 Mb")));
91 87
92 mkswapProgress = new QProgressBar(3, hb3); 88 mkswapProgress = new QProgressBar(3, hb3);
93 mkswapProgress->setCenterIndicator(true); 89 mkswapProgress->setCenterIndicator(true);
94 90
95 QHBox *hb4 = new QHBox(this); 91 QHBox *hb4 = new QHBox(this);
96 hb4->setSpacing(5); 92 hb4->setSpacing(5);
97 93
98 swapStatusIcon = new QLabel(hb4); 94 swapStatusIcon = new QLabel(hb4);
99 swapStatus = new QLabel(tr(""), hb4); 95 swapStatus = new QLabel(tr(""), hb4);
100 hb4->setStretchFactor(swapStatus, 99); 96 hb4->setStretchFactor(swapStatus, 99);
101 vb->addWidget(hb4); 97 vb->addWidget(hb4);
102 98
103 connect(swapOn, SIGNAL(clicked()), this, SLOT(swapon())); 99 connect(swapOn, SIGNAL(clicked()), this, SLOT(swapon()));
104 connect(swapOff, SIGNAL(clicked()), this, SLOT(swapoff())); 100 connect(swapOff, SIGNAL(clicked()), this, SLOT(swapoff()));
105 connect(cfRB, SIGNAL(clicked()), this, SLOT(cfsdchecked())); 101 connect(cfRB, SIGNAL(clicked()), this, SLOT(cfsdchecked()));
diff --git a/noncore/applets/networkapplet/networkapplet.cpp b/noncore/applets/networkapplet/networkapplet.cpp
index 9a08568..955ed2e 100644
--- a/noncore/applets/networkapplet/networkapplet.cpp
+++ b/noncore/applets/networkapplet/networkapplet.cpp
@@ -1,114 +1,108 @@
1/* 1/*
2                 This file is part of the Opie Project 2                 This file is part of the Opie Project
3 3
4 =. (C) 2003 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> 4 =. (C) 2003 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de>
5 .=l. 5 .=l.
6           .>+-= 6           .>+-=
7 _;:,     .>    :=|. This program is free software; you can 7 _;:,     .>    :=|. This program is free software; you can
8.> <`_,   >  .   <= redistribute it and/or modify it under 8.> <`_,   >  .   <= redistribute it and/or modify it under
9:`=1 )Y*s>-.--   : the terms of the GNU Library General Public 9:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
10.="- .-=="i,     .._ License as published by the Free Software 10.="- .-=="i,     .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License, 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version. 12     ._= =}       : or (at your option) any later version.
13    .%`+i>       _;_. 13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This program is distributed in the hope that 14    .i_,=:_.      -<s. This program is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of 16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
19..}^=.=       =       ; Library General Public License for more 19..}^=.=       =       ; Library General Public License for more
20++=   -.     .`     .: details. 20++=   -.     .`     .: details.
21 :     =  ...= . :.=- 21 :     =  ...= . :.=-
22 -.   .:....=;==+<; You should have received a copy of the GNU 22 -.   .:....=;==+<; You should have received a copy of the GNU
23  -_. . .   )=.  = Library General Public License along with 23  -_. . .   )=.  = Library General Public License along with
24    --        :-=` this library; see the file COPYING.LIB. 24    --        :-=` this library; see the file COPYING.LIB.
25 If not, write to the Free Software Foundation, 25 If not, write to the Free Software Foundation,
26 Inc., 59 Temple Place - Suite 330, 26 Inc., 59 Temple Place - Suite 330,
27 Boston, MA 02111-1307, USA. 27 Boston, MA 02111-1307, USA.
28 28
29*/ 29*/
30 30
31#include "networkapplet.h" 31#include "networkapplet.h"
32 32
33/* OPIE */ 33/* OPIE */
34#include <opie2/odebug.h> 34#include <opie2/odebug.h>
35#include <opie2/onetwork.h> 35#include <opie2/onetwork.h>
36#include <opie2/otaskbarapplet.h> 36#include <opie2/otaskbarapplet.h>
37#include <qpe/applnk.h> 37#include <qpe/applnk.h>
38#include <qpe/qlibrary.h>
39#include <qpe/resource.h> 38#include <qpe/resource.h>
40#include <qpainter.h> 39#include <qpainter.h>
41 40
42/* QT */ 41/* QT */
43#include <qhostaddress.h>
44#include <qimage.h>
45#include <qlabel.h> 42#include <qlabel.h>
46#include <qlayout.h> 43#include <qlayout.h>
47#include <qlineedit.h>
48#include <qobjectlist.h> 44#include <qobjectlist.h>
49#include <qpushbutton.h>
50#include <qtoolbutton.h>
51 45
52#include <assert.h> 46#include <assert.h>
53 47
54IfaceUpDownButton::IfaceUpDownButton( QWidget* parent, const char* name ) 48IfaceUpDownButton::IfaceUpDownButton( QWidget* parent, const char* name )
55 :QToolButton( parent, name ) 49 :QToolButton( parent, name )
56{ 50{
57 _iface = ONetwork::instance()->interface( name ); 51 _iface = ONetwork::instance()->interface( name );
58 assert( _iface ); 52 assert( _iface );
59 setToggleButton( true ); 53 setToggleButton( true );
60 //setAutoRaise( true ); 54 //setAutoRaise( true );
61 setOnIconSet( QIconSet( Resource::loadPixmap( "up" ) ) ); 55 setOnIconSet( QIconSet( Resource::loadPixmap( "up" ) ) );
62 setOffIconSet( QIconSet( Resource::loadPixmap( "down" ) ) ); 56 setOffIconSet( QIconSet( Resource::loadPixmap( "down" ) ) );
63 setOn( _iface->isUp() ); 57 setOn( _iface->isUp() );
64 //setFixedWidth( 16 ); 58 //setFixedWidth( 16 );
65 connect( this, SIGNAL( clicked() ), this, SLOT( clicked() ) ); 59 connect( this, SIGNAL( clicked() ), this, SLOT( clicked() ) );
66} 60}
67 61
68 62
69IfaceUpDownButton::~IfaceUpDownButton() 63IfaceUpDownButton::~IfaceUpDownButton()
70{ 64{
71} 65}
72 66
73 67
74void IfaceUpDownButton::clicked() 68void IfaceUpDownButton::clicked()
75{ 69{
76 _iface->setUp( isOn() ); 70 _iface->setUp( isOn() );
77 setOn( _iface->isUp() ); // it might not have worked... 71 setOn( _iface->isUp() ); // it might not have worked...
78 repaint(); 72 repaint();
79} 73}
80 74
81 75
82IfaceIPAddress::IfaceIPAddress( QWidget* parent, const char* name ) 76IfaceIPAddress::IfaceIPAddress( QWidget* parent, const char* name )
83 :QLineEdit( parent, name ) 77 :QLineEdit( parent, name )
84{ 78{
85 setFont( QFont( "fixed" ) ); 79 setFont( QFont( "fixed" ) );
86 _iface = ONetwork::instance()->interface( name ); 80 _iface = ONetwork::instance()->interface( name );
87 setFixedWidth( 105 ); 81 setFixedWidth( 105 );
88 setText( _iface->ipV4Address() ); 82 setText( _iface->ipV4Address() );
89 connect( this, SIGNAL( returnPressed() ), this, SLOT( returnPressed() ) ); 83 connect( this, SIGNAL( returnPressed() ), this, SLOT( returnPressed() ) );
90} 84}
91 85
92 86
93IfaceIPAddress::~IfaceIPAddress() 87IfaceIPAddress::~IfaceIPAddress()
94{ 88{
95} 89}
96 90
97 91
98void IfaceIPAddress::returnPressed() 92void IfaceIPAddress::returnPressed()
99{ 93{
100 QHostAddress a; 94 QHostAddress a;
101 a.setAddress( text() ); 95 a.setAddress( text() );
102 QHostAddress mask; 96 QHostAddress mask;
103 mask.setAddress( _iface->ipV4Netmask() ); // setIPV4Address destroys the netmask... 97 mask.setAddress( _iface->ipV4Netmask() ); // setIPV4Address destroys the netmask...
104 _iface->setIPV4Address( a ); 98 _iface->setIPV4Address( a );
105 _iface->setIPV4Netmask( mask ); // recover the old netmask 99 _iface->setIPV4Netmask( mask ); // recover the old netmask
106 setText( _iface->ipV4Address() ); 100 setText( _iface->ipV4Address() );
107 repaint(); 101 repaint();
108} 102}
109 103
110 104
111NetworkAppletControl::NetworkAppletControl( OTaskbarApplet* parent, const char* name ) 105NetworkAppletControl::NetworkAppletControl( OTaskbarApplet* parent, const char* name )
112 :QFrame( parent, name, WStyle_StaysOnTop | WType_Popup ), l(0) 106 :QFrame( parent, name, WStyle_StaysOnTop | WType_Popup ), l(0)
113{ 107{
114 setFrameStyle( QFrame::PopupPanel | QFrame::Raised ); 108 setFrameStyle( QFrame::PopupPanel | QFrame::Raised );
diff --git a/noncore/applets/notesapplet/notes.cpp b/noncore/applets/notesapplet/notes.cpp
index e2b0c2a..7b8bdd9 100644
--- a/noncore/applets/notesapplet/notes.cpp
+++ b/noncore/applets/notesapplet/notes.cpp
@@ -1,94 +1,91 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2002 L.J. Potter <llornkcor@handhelds.org> 2** Copyright (C) 2002 L.J. Potter <llornkcor@handhelds.org>
3 3
4** All rights reserved. 4** All rights reserved.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14**********************************************************************/ 14**********************************************************************/
15 15
16#include "notes.h" 16#include "notes.h"
17 17
18#include <qapplication.h> 18#include <qapplication.h>
19#include <stdlib.h> 19#include <stdlib.h>
20#include <qstringlist.h> 20#include <qstringlist.h>
21 21
22#include <qpe/filemanager.h> 22#include <qpe/filemanager.h>
23#include <qpe/resource.h>
24#include <qpe/qpeapplication.h> 23#include <qpe/qpeapplication.h>
25#include <qpe/timestring.h> 24#include <qpe/timestring.h>
26#include <qpe/resource.h>
27#include <qpe/config.h>
28#include <qpe/applnk.h> 25#include <qpe/applnk.h>
29#include <qpe/config.h>
30#include <qpe/ir.h> 26#include <qpe/ir.h>
27#include <qpe/config.h>
31 28
32// #include <qsocket.h> 29// #include <qsocket.h>
33// #include <qclipboard.h> 30// #include <qclipboard.h>
34#include <qmultilineedit.h> 31#include <qmultilineedit.h>
35#include <qlistbox.h> 32#include <qlistbox.h>
36#include <qpopupmenu.h> 33#include <qpopupmenu.h>
37#include <qmessagebox.h> 34#include <qmessagebox.h>
38 35
39#include <qdir.h> 36#include <qdir.h>
40#include <qfile.h> 37#include <qfile.h>
41#include <qpoint.h> 38#include <qpoint.h>
42#include <qpushbutton.h> 39#include <qpushbutton.h>
43#include <qpainter.h> 40#include <qpainter.h>
44#include <qlayout.h> 41#include <qlayout.h>
45#include <qframe.h> 42#include <qframe.h>
46#include <qpixmap.h> 43#include <qpixmap.h>
47#include <qstring.h> 44#include <qstring.h>
48#include <qtimer.h> 45#include <qtimer.h>
49 46
50/* XPM */ 47/* XPM */
51static char * notes_xpm[] = { 48static char * notes_xpm[] = {
52"16 16 11 1", 49"16 16 11 1",
53" c None", 50" c None",
54". c #000000", 51". c #000000",
55"+ c #7F7F7F", 52"+ c #7F7F7F",
56"@ c #BFBFBF", 53"@ c #BFBFBF",
57"# c #BFC1FF", 54"# c #BFC1FF",
58"$ c #FF0000", 55"$ c #FF0000",
59"% c #FFFFFF", 56"% c #FFFFFF",
60"& c #00037F", 57"& c #00037F",
61"* c #0006FF", 58"* c #0006FF",
62"= c #0005BF", 59"= c #0005BF",
63"- c #7F0000", 60"- c #7F0000",
64" .. ", 61" .. ",
65" .. ", 62" .. ",
66" ... ", 63" ... ",
67" .+ ", 64" .+ ",
68" .@. ", 65" .@. ",
69" . .+ ", 66" . .+ ",
70" ..#.@. ", 67" ..#.@. ",
71" ..###.+.. ", 68" ..###.+.. ",
72" ..###$...##.. ", 69" ..###$...##.. ",
73"..###$$$%+$$##&.", 70"..###$$$%+$$##&.",
74".*=####$-###&=&.", 71".*=####$-###&=&.",
75".=**=###==&=&=..", 72".=**=###==&=&=..",
76" ..=**=#&=&=.. ", 73" ..=**=#&=&=.. ",
77" ..=*=&=.. ", 74" ..=*=&=.. ",
78" ..=.. ", 75" ..=.. ",
79" . "}; 76" . "};
80 77
81 78
82NotesControl::NotesControl( QWidget *, const char * ) 79NotesControl::NotesControl( QWidget *, const char * )
83 : QVBox( 0, "NotesControl",/* WDestructiveClose | */WStyle_StaysOnTop ) 80 : QVBox( 0, "NotesControl",/* WDestructiveClose | */WStyle_StaysOnTop )
84// : QFrame( parent, name, WDestructiveClose | WStyle_StaysOnTop | WType_Popup ) 81// : QFrame( parent, name, WDestructiveClose | WStyle_StaysOnTop | WType_Popup )
85{ 82{
86 QDir d( QDir::homeDirPath()+"/notes"); 83 QDir d( QDir::homeDirPath()+"/notes");
87 if( !d.exists()) { 84 if( !d.exists()) {
88 qDebug("make dir"); 85 qDebug("make dir");
89 if(!d.mkdir( QDir::homeDirPath()+"/notes", true)) 86 if(!d.mkdir( QDir::homeDirPath()+"/notes", true))
90 qDebug("<<<<<<<<<<<<<<<<<<<<<<<<<<<make dir failed"); 87 qDebug("<<<<<<<<<<<<<<<<<<<<<<<<<<<make dir failed");
91 } 88 }
92 Config cfg("Notes"); 89 Config cfg("Notes");
93 cfg.setGroup("Options"); 90 cfg.setGroup("Options");
94 showMax = cfg.readBoolEntry("ShowMax", false); 91 showMax = cfg.readBoolEntry("ShowMax", false);
diff --git a/noncore/applets/wirelessapplet/advancedconfig.cpp b/noncore/applets/wirelessapplet/advancedconfig.cpp
index 97b008d..aba0fee 100644
--- a/noncore/applets/wirelessapplet/advancedconfig.cpp
+++ b/noncore/applets/wirelessapplet/advancedconfig.cpp
@@ -1,55 +1,54 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2002 Michael 'Mickey' Lauer 2** Copyright (C) 2002 Michael 'Mickey' Lauer
3** <mickey@tm.informatik.uni-frankfurt.de> 3** <mickey@tm.informatik.uni-frankfurt.de>
4** http://www.Vanille.de 4** http://www.Vanille.de
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14**********************************************************************/ 14**********************************************************************/
15 15
16#include "advancedconfig.h" 16#include "advancedconfig.h"
17 17
18#include <qpe/config.h> 18#include <qpe/config.h>
19#include <qwidget.h>
20#include <qcheckbox.h> 19#include <qcheckbox.h>
21 20
22AdvancedConfig::AdvancedConfig( QWidget* parent, const char* name, bool modal, WFlags fl ) 21AdvancedConfig::AdvancedConfig( QWidget* parent, const char* name, bool modal, WFlags fl )
23 : AdvancedConfigBase( parent, name, modal, fl ) 22 : AdvancedConfigBase( parent, name, modal, fl )
24{ 23{
25 Config cfg( "qpe" ); 24 Config cfg( "qpe" );
26 cfg.setGroup( "Wireless" ); 25 cfg.setGroup( "Wireless" );
27 26
28 bool rocESSID = cfg.readBoolEntry( "renew_dhcp_on_essid_change", false ); 27 bool rocESSID = cfg.readBoolEntry( "renew_dhcp_on_essid_change", false );
29 bool rocFREQ = cfg.readBoolEntry( "renew_dhcp_on_freq_change", false ); 28 bool rocFREQ = cfg.readBoolEntry( "renew_dhcp_on_freq_change", false );
30 bool rocAP = cfg.readBoolEntry( "renew_dhcp_on_ap_change", false ); 29 bool rocAP = cfg.readBoolEntry( "renew_dhcp_on_ap_change", false );
31 bool rocMODE = cfg.readBoolEntry( "renew_dhcp_on_mode_change", false ); 30 bool rocMODE = cfg.readBoolEntry( "renew_dhcp_on_mode_change", false );
32 31
33 cbESSID->setChecked( rocESSID ); 32 cbESSID->setChecked( rocESSID );
34 cbFrequency->setChecked( rocFREQ ); 33 cbFrequency->setChecked( rocFREQ );
35 cbAccessPoint->setChecked( rocAP ); 34 cbAccessPoint->setChecked( rocAP );
36 cbMODE->setChecked( rocMODE ); 35 cbMODE->setChecked( rocMODE );
37} 36}
38 37
39AdvancedConfig::~AdvancedConfig() 38AdvancedConfig::~AdvancedConfig()
40{ 39{
41} 40}
42 41
43void AdvancedConfig::accept() 42void AdvancedConfig::accept()
44{ 43{
45 44
46 Config cfg( "qpe" ); 45 Config cfg( "qpe" );
47 cfg.setGroup( "Wireless" ); 46 cfg.setGroup( "Wireless" );
48 cfg.writeEntry( "renew_dhcp_on_essid_change", cbESSID->isChecked() ); 47 cfg.writeEntry( "renew_dhcp_on_essid_change", cbESSID->isChecked() );
49 cfg.writeEntry( "renew_dhcp_on_freq_change", cbFrequency->isChecked() ); 48 cfg.writeEntry( "renew_dhcp_on_freq_change", cbFrequency->isChecked() );
50 cfg.writeEntry( "renew_dhcp_on_ap_change", cbAccessPoint->isChecked() ); 49 cfg.writeEntry( "renew_dhcp_on_ap_change", cbAccessPoint->isChecked() );
51 cfg.writeEntry( "renew_dhcp_on_mode_change", cbMODE->isChecked() ); 50 cfg.writeEntry( "renew_dhcp_on_mode_change", cbMODE->isChecked() );
52 51
53 AdvancedConfigBase::accept(); 52 AdvancedConfigBase::accept();
54} 53}
55 54
diff --git a/noncore/applets/wirelessapplet/wireless.cpp b/noncore/applets/wirelessapplet/wireless.cpp
index cee789c..9ce6618 100644
--- a/noncore/applets/wirelessapplet/wireless.cpp
+++ b/noncore/applets/wirelessapplet/wireless.cpp
@@ -1,106 +1,101 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2002-2004 Michael 'Mickey' Lauer <mickey@vanille.de> 2** Copyright (C) 2002-2004 Michael 'Mickey' Lauer <mickey@vanille.de>
3** 3**
4** This file may be distributed and/or modified under the terms of the 4** This file may be distributed and/or modified under the terms of the
5** GNU General Public License version 2 as published by the Free Software 5** GNU General Public License version 2 as published by the Free Software
6** Foundation and appearing in the file LICENSE.GPL included in the 6** Foundation and appearing in the file LICENSE.GPL included in the
7** packaging of this file. 7** packaging of this file.
8** 8**
9** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 9** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
10** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 10** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
11** 11**
12**********************************************************************/ 12**********************************************************************/
13 13
14#include "wireless.h" 14#include "wireless.h"
15#include "mgraph.h" 15#include "mgraph.h"
16#include "advancedconfig.h" 16#include "advancedconfig.h"
17#include "connect0.xpm" 17#include "connect0.xpm"
18#include "connect1.xpm" 18#include "connect1.xpm"
19#include "connect2.xpm" 19#include "connect2.xpm"
20#include "connect3.xpm" 20#include "connect3.xpm"
21#include "connect4.xpm" 21#include "connect4.xpm"
22#include "connect5.xpm" 22#include "connect5.xpm"
23#include "nowireless.xpm" 23#include "nowireless.xpm"
24 24
25/* OPIE */ 25/* OPIE */
26#include <opie2/onetwork.h> 26#include <opie2/onetwork.h>
27#include <opie2/otaskbarapplet.h> 27#include <opie2/otaskbarapplet.h>
28#include <qpe/qpeapplication.h>
29#include <qpe/config.h> 28#include <qpe/config.h>
30 29
31/* QT */ 30/* QT */
32#include <qpoint.h>
33#include <qradiobutton.h> 31#include <qradiobutton.h>
34#include <qpushbutton.h> 32#include <qpushbutton.h>
35#include <qpainter.h> 33#include <qpainter.h>
36#include <qlabel.h> 34#include <qlabel.h>
37#include <qslider.h> 35#include <qslider.h>
38#include <qbuttongroup.h> 36#include <qbuttongroup.h>
39#include <qlayout.h> 37#include <qlayout.h>
40#include <qframe.h>
41#include <qpixmap.h>
42#include <qstring.h>
43#include <qfile.h> 38#include <qfile.h>
44#include <qtextstream.h> 39#include <qtextstream.h>
45 40
46/* STD */ 41/* STD */
47#include <sys/types.h> 42#include <sys/types.h>
48#include <signal.h> 43#include <signal.h>
49 44
50#define STYLE_BARS 0 45#define STYLE_BARS 0
51#define STYLE_ANTENNA 1 46#define STYLE_ANTENNA 1
52 47
53//#define MDEBUG 48//#define MDEBUG
54#undef MDEBUG 49#undef MDEBUG
55 50
56WirelessControl::WirelessControl( WirelessApplet *applet, QWidget *parent, const char *name ) 51WirelessControl::WirelessControl( WirelessApplet *applet, QWidget *parent, const char *name )
57 : QFrame( parent, name, WStyle_StaysOnTop | WType_Popup ), applet( applet ) 52 : QFrame( parent, name, WStyle_StaysOnTop | WType_Popup ), applet( applet )
58{ 53{
59 54
60 readConfig(); 55 readConfig();
61 writeConfigEntry( "UpdateFrequency", updateFrequency ); 56 writeConfigEntry( "UpdateFrequency", updateFrequency );
62 writeConfigEntry( "DisplayStyle", displayStyle ); 57 writeConfigEntry( "DisplayStyle", displayStyle );
63 58
64 setFrameStyle( QFrame::PopupPanel | QFrame::Raised ); 59 setFrameStyle( QFrame::PopupPanel | QFrame::Raised );
65 QGridLayout *grid = new QGridLayout( this, 3, 2, 6, 2, "top layout" ); 60 QGridLayout *grid = new QGridLayout( this, 3, 2, 6, 2, "top layout" );
66 61
67 /* status label */ 62 /* status label */
68 63
69 statusLabel = new QLabel( this, "statuslabel" ); 64 statusLabel = new QLabel( this, "statuslabel" );
70 QString text( "Wireless Status:<br>" 65 QString text( "Wireless Status:<br>"
71 "*** Unknown ***<br>" 66 "*** Unknown ***<br>"
72 "Card not inserted ?<br>" 67 "Card not inserted ?<br>"
73 "Or Sharp ROM ?<br>" 68 "Or Sharp ROM ?<br>"
74 "CELL: 00:00:00:00:00:00" ); 69 "CELL: 00:00:00:00:00:00" );
75 /* QString text( "Station: Unknown<br>" 70 /* QString text( "Station: Unknown<br>"
76 "ESSID: Unknown<br>" 71 "ESSID: Unknown<br>"
77 "MODE: Unknown<br>" 72 "MODE: Unknown<br>"
78 "FREQ: Unknown<br>" 73 "FREQ: Unknown<br>"
79 "CELL: AA:BB:CC:DD:EE:FF" ); */ 74 "CELL: AA:BB:CC:DD:EE:FF" ); */
80 statusLabel->setText( text ); 75 statusLabel->setText( text );
81 statusLabel->setFixedSize( statusLabel->sizeHint() ); 76 statusLabel->setFixedSize( statusLabel->sizeHint() );
82 grid->addWidget( statusLabel, 0, 0 ); 77 grid->addWidget( statusLabel, 0, 0 );
83 78
84 /* visualization group box */ 79 /* visualization group box */
85 80
86 QButtonGroup* group = new QButtonGroup( 1, Qt::Horizontal, "Visualization", this ); 81 QButtonGroup* group = new QButtonGroup( 1, Qt::Horizontal, "Visualization", this );
87 QRadioButton* r1 = new QRadioButton( "Color Bars", group ); 82 QRadioButton* r1 = new QRadioButton( "Color Bars", group );
88 QRadioButton* r2 = new QRadioButton( "Antenna", group ); 83 QRadioButton* r2 = new QRadioButton( "Antenna", group );
89 r1->setFocusPolicy( QWidget::NoFocus ); 84 r1->setFocusPolicy( QWidget::NoFocus );
90 r2->setFocusPolicy( QWidget::NoFocus ); 85 r2->setFocusPolicy( QWidget::NoFocus );
91 group->setFocusPolicy( QWidget::NoFocus ); 86 group->setFocusPolicy( QWidget::NoFocus );
92 group->setButton( displayStyle ); 87 group->setButton( displayStyle );
93 grid->addWidget( group, 0, 1 ); 88 grid->addWidget( group, 0, 1 );
94 89
95 /* quality graph */ 90 /* quality graph */
96 91
97 mgraph = new MGraph( this ); 92 mgraph = new MGraph( this );
98 mgraph->setFrameStyle( QFrame::Panel | QFrame::Sunken ); 93 mgraph->setFrameStyle( QFrame::Panel | QFrame::Sunken );
99 mgraph->setMin( 0 ); 94 mgraph->setMin( 0 );
100 mgraph->setMax( 92 ); 95 mgraph->setMax( 92 );
101 grid->addWidget( mgraph, 1, 0 ); 96 grid->addWidget( mgraph, 1, 0 );
102 mgraph->setFocusPolicy( QWidget::NoFocus ); 97 mgraph->setFocusPolicy( QWidget::NoFocus );
103 98
104 /* advanced configuration Button */ 99 /* advanced configuration Button */
105 100
106 QPushButton* advanced = new QPushButton( "Advanced...", this ); 101 QPushButton* advanced = new QPushButton( "Advanced...", this );
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp
index 5148172..c44d387 100644
--- a/noncore/apps/advancedfm/advancedfm.cpp
+++ b/noncore/apps/advancedfm/advancedfm.cpp
@@ -1,101 +1,91 @@
1/*************************************************************************** 1/***************************************************************************
2 AdvancedFm.cpp 2 AdvancedFm.cpp
3 ------------------- 3 -------------------
4 ** Created: Sat Mar 9 23:33:09 2002 4 ** Created: Sat Mar 9 23:33:09 2002
5 copyright : (C) 2002 by ljp 5 copyright : (C) 2002 by ljp
6 email : ljp@llornkcor.com 6 email : ljp@llornkcor.com
7 * This program is free software; you can redistribute it and/or modify * 7 * This program is free software; you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by * 8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation; either version 2 of the License, or * 9 * the Free Software Foundation; either version 2 of the License, or *
10 * (at your option) any later version. * 10 * (at your option) any later version. *
11 ***************************************************************************/ 11 ***************************************************************************/
12#define DEVELOPERS_VERSION 12#define DEVELOPERS_VERSION
13#include "advancedfm.h" 13#include "advancedfm.h"
14 14
15#include <qpe/filemanager.h>
16#include <qpe/qcopenvelope_qws.h>
17#include <qpe/qpeapplication.h> 15#include <qpe/qpeapplication.h>
18#include <qpe/config.h> 16#include <qpe/config.h>
19#include <qpe/mimetype.h> 17#include <qpe/mimetype.h>
20#include <qpe/applnk.h> 18#include <qpe/applnk.h>
21#include <qpe/ir.h>
22#include <qpe/resource.h> 19#include <qpe/resource.h>
23#include <qpe/menubutton.h> 20#include <qpe/menubutton.h>
24 21
25#include <qdatetime.h>
26#include <qfile.h>
27#include <qcombobox.h> 22#include <qcombobox.h>
28#include <qpopupmenu.h> 23#include <qpopupmenu.h>
29#include <qlistview.h> 24#include <qlistview.h>
30#include <qlabel.h>
31#include <qwidget.h>
32#include <qlayout.h>
33#include <qimage.h>
34#include <qmessagebox.h> 25#include <qmessagebox.h>
35#include <qlineedit.h> 26#include <qlineedit.h>
36 27
37#include <qpe/qpemessagebox.h>
38 28
39#include <sys/stat.h> 29#include <sys/stat.h>
40#include <time.h> 30#include <time.h>
41#include <dirent.h> 31#include <dirent.h>
42#include <fcntl.h> 32#include <fcntl.h>
43#include <sys/vfs.h> 33#include <sys/vfs.h>
44#include <mntent.h> 34#include <mntent.h>
45 35
46#ifdef NOQUICKLAUNCH 36#ifdef NOQUICKLAUNCH
47AdvancedFm::AdvancedFm( ) 37AdvancedFm::AdvancedFm( )
48#else 38#else
49AdvancedFm::AdvancedFm(QWidget *,const char*, WFlags ) 39AdvancedFm::AdvancedFm(QWidget *,const char*, WFlags )
50#endif 40#endif
51 : QMainWindow( ) { 41 : QMainWindow( ) {
52 init(); 42 init();
53 renameBox = 0; 43 renameBox = 0;
54 44
55 unknownXpm = Resource::loadImage( "UnknownDocument" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ); 45 unknownXpm = Resource::loadImage( "UnknownDocument" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() );
56 46
57 initConnections(); 47 initConnections();
58 whichTab=1; 48 whichTab=1;
59 rePopulate(); 49 rePopulate();
60 currentPathCombo->setFocus(); 50 currentPathCombo->setFocus();
61 channel = new QCopChannel( "QPE/Application/advancedfm", this ); 51 channel = new QCopChannel( "QPE/Application/advancedfm", this );
62 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), 52 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)),
63 this, SLOT( qcopReceive(const QCString&, const QByteArray&)) ); 53 this, SLOT( qcopReceive(const QCString&, const QByteArray&)) );
64} 54}
65 55
66AdvancedFm::~AdvancedFm() { 56AdvancedFm::~AdvancedFm() {
67} 57}
68 58
69 59
70void AdvancedFm::cleanUp() { 60void AdvancedFm::cleanUp() {
71 QString sfile=QDir::homeDirPath(); 61 QString sfile=QDir::homeDirPath();
72 if(sfile.right(1) != "/") 62 if(sfile.right(1) != "/")
73 sfile+="/._temp"; 63 sfile+="/._temp";
74 else 64 else
75 sfile+="._temp"; 65 sfile+="._temp";
76 QFile file( sfile); 66 QFile file( sfile);
77 if(file.exists()) 67 if(file.exists())
78 file.remove(); 68 file.remove();
79} 69}
80 70
81void AdvancedFm::tabChanged(QWidget *) { 71void AdvancedFm::tabChanged(QWidget *) {
82// qWarning("tab changed"); 72// qWarning("tab changed");
83 QString path = CurrentDir()->canonicalPath(); 73 QString path = CurrentDir()->canonicalPath();
84 currentPathCombo->lineEdit()->setText( path ); 74 currentPathCombo->lineEdit()->setText( path );
85 75
86 if(whichTab == 1) { 76 if(whichTab == 1) {
87 viewMenu->setItemChecked(viewMenu->idAt(0), true); 77 viewMenu->setItemChecked(viewMenu->idAt(0), true);
88 viewMenu->setItemChecked(viewMenu->idAt(1), false); 78 viewMenu->setItemChecked(viewMenu->idAt(1), false);
89 } else { 79 } else {
90 viewMenu->setItemChecked(viewMenu->idAt(0), false); 80 viewMenu->setItemChecked(viewMenu->idAt(0), false);
91 viewMenu->setItemChecked(viewMenu->idAt(1), true); 81 viewMenu->setItemChecked(viewMenu->idAt(1), true);
92 } 82 }
93 83
94 QString fs= getFileSystemType( (const QString &) path); 84 QString fs= getFileSystemType( (const QString &) path);
95 85
96 setCaption(tr("AdvancedFm :: ")+fs+" :: " 86 setCaption(tr("AdvancedFm :: ")+fs+" :: "
97 +checkDiskSpace( (const QString &) path )+ tr(" kB free") ); 87 +checkDiskSpace( (const QString &) path )+ tr(" kB free") );
98 chdir( path.latin1()); 88 chdir( path.latin1());
99} 89}
100 90
101 91
diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp
index 18bbd43..9ad1146 100644
--- a/noncore/apps/advancedfm/advancedfmMenu.cpp
+++ b/noncore/apps/advancedfm/advancedfmMenu.cpp
@@ -1,98 +1,87 @@
1/*************************************************************************** 1/***************************************************************************
2 AdvancedFm.cpp 2 AdvancedFm.cpp
3 ------------------- 3 -------------------
4 ** Created: Sat Mar 9 23:33:09 2002 4 ** Created: Sat Mar 9 23:33:09 2002
5 copyright : (C) 2002 by ljp 5 copyright : (C) 2002 by ljp
6 email : ljp@llornkcor.com 6 email : ljp@llornkcor.com
7 * This program is free software; you can redistribute it and/or modify * 7 * This program is free software; you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by * 8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation; either version 2 of the License, or * 9 * the Free Software Foundation; either version 2 of the License, or *
10 * (at your option) any later version. * 10 * (at your option) any later version. *
11 ***************************************************************************/ 11 ***************************************************************************/
12#include "advancedfm.h" 12#include "advancedfm.h"
13#include "output.h" 13#include "output.h"
14#include "filePermissions.h" 14#include "filePermissions.h"
15 15
16#include <qpe/lnkproperties.h> 16#include <qpe/lnkproperties.h>
17#include <qpe/qpeapplication.h> 17#include <qpe/qpeapplication.h>
18#include <qpe/resource.h>
19#include <qpe/qcopenvelope_qws.h>
20#include <qpe/applnk.h> 18#include <qpe/applnk.h>
21#include <qpe/ir.h>
22 19
23#include <qmessagebox.h> 20#include <qmessagebox.h>
24#include <qmultilineedit.h>
25 21
26#include <qstring.h>
27 22
28#include <qlayout.h>
29#include <qpixmap.h>
30#include <qcombobox.h>
31#include <qpopupmenu.h> 23#include <qpopupmenu.h>
32#include <qtabwidget.h>
33#include <qtoolbutton.h>
34#include <qlineedit.h>
35#include <qlistview.h> 24#include <qlistview.h>
36 25
37#include <errno.h> 26#include <errno.h>
38#include <stdlib.h> 27#include <stdlib.h>
39#include <unistd.h> 28#include <unistd.h>
40#include <sys/stat.h> 29#include <sys/stat.h>
41#include <dirent.h> 30#include <dirent.h>
42#include <sys/sendfile.h> 31#include <sys/sendfile.h>
43#include <fcntl.h> 32#include <fcntl.h>
44 33
45 34
46void AdvancedFm::doDirChange() { 35void AdvancedFm::doDirChange() {
47 QString pathItem = CurrentView()->currentItem()->text(0); 36 QString pathItem = CurrentView()->currentItem()->text(0);
48 if( pathItem == "../") { 37 if( pathItem == "../") {
49 ListClicked( CurrentView()->currentItem()); 38 ListClicked( CurrentView()->currentItem());
50 } else { 39 } else {
51 if( pathItem.find(" -> ",0,TRUE) != -1) 40 if( pathItem.find(" -> ",0,TRUE) != -1)
52 pathItem = dealWithSymName((const QString&)pathItem)+"/"; 41 pathItem = dealWithSymName((const QString&)pathItem)+"/";
53// qWarning(pathItem); 42// qWarning(pathItem);
54 gotoDirectory( CurrentDir()->path()+"/"+pathItem.left( pathItem.length() - 1) ); 43 gotoDirectory( CurrentDir()->path()+"/"+pathItem.left( pathItem.length() - 1) );
55 } 44 }
56} 45}
57 46
58void AdvancedFm::showMenuHidden() { 47void AdvancedFm::showMenuHidden() {
59 if (b) { 48 if (b) {
60 CurrentDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); 49 CurrentDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
61 OtherDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); 50 OtherDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
62 fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); 51 fileMenu->setItemChecked( fileMenu->idAt(0),TRUE);
63 } else { 52 } else {
64 CurrentDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); 53 CurrentDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All);
65 OtherDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); 54 OtherDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All);
66 fileMenu->setItemChecked( fileMenu->idAt(0),FALSE); 55 fileMenu->setItemChecked( fileMenu->idAt(0),FALSE);
67 } 56 }
68 b = !b; 57 b = !b;
69 populateView(); 58 populateView();
70} 59}
71 60
72void AdvancedFm::showHidden() { 61void AdvancedFm::showHidden() {
73 if (b) { 62 if (b) {
74 CurrentDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); 63 CurrentDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
75 OtherDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); 64 OtherDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
76 } else { 65 } else {
77 CurrentDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); 66 CurrentDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All);
78 OtherDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); 67 OtherDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All);
79 } 68 }
80 populateView(); 69 populateView();
81} 70}
82 71
83QString AdvancedFm::dealWithSymName(const QString &fileName) { 72QString AdvancedFm::dealWithSymName(const QString &fileName) {
84 QString strItem = fileName; 73 QString strItem = fileName;
85 return strItem.right( (strItem.length() - strItem.find("->",0,TRUE)) - 4); 74 return strItem.right( (strItem.length() - strItem.find("->",0,TRUE)) - 4);
86} 75}
87 76
88void AdvancedFm::runThis() { 77void AdvancedFm::runThis() {
89 if( !CurrentView()->currentItem()) return; 78 if( !CurrentView()->currentItem()) return;
90 QString fs; 79 QString fs;
91 QDir *thisDir = CurrentDir(); 80 QDir *thisDir = CurrentDir();
92 81
93 QString curFile = CurrentView()->currentItem()->text(0); 82 QString curFile = CurrentView()->currentItem()->text(0);
94 QString path = thisDir->canonicalPath(); 83 QString path = thisDir->canonicalPath();
95 84
96 if( curFile.find("@",0,TRUE) !=-1 || curFile.find("->",0,TRUE) !=-1 ) //if symlink 85 if( curFile.find("@",0,TRUE) !=-1 || curFile.find("->",0,TRUE) !=-1 ) //if symlink
97 86
98 curFile = dealWithSymName((const QString&)curFile); 87 curFile = dealWithSymName((const QString&)curFile);
diff --git a/noncore/apps/checkbook/cfg.cpp b/noncore/apps/checkbook/cfg.cpp
index 0d5d9ed..24fa4cb 100644
--- a/noncore/apps/checkbook/cfg.cpp
+++ b/noncore/apps/checkbook/cfg.cpp
@@ -1,98 +1,95 @@
1/* 1/*
2                This file is part of the OPIE Project 2                This file is part of the OPIE Project
3 =. 3 =.
4             .=l. Copyright (c) 2002 Dan Williams <drw@handhelds.org> 4             .=l. Copyright (c) 2002 Dan Williams <drw@handhelds.org>
5           .>+-= 5           .>+-=
6 _;:,     .>    :=|. This file is free software; you can 6 _;:,     .>    :=|. This file is free software; you can
7.> <`_,   >  .   <= redistribute it and/or modify it under 7.> <`_,   >  .   <= redistribute it and/or modify it under
8:`=1 )Y*s>-.--   : the terms of the GNU General Public 8:`=1 )Y*s>-.--   : the terms of the GNU General Public
9.="- .-=="i,     .._ License as published by the Free Software 9.="- .-=="i,     .._ License as published by the Free Software
10 - .   .-<_>     .<> Foundation; either version 2 of the License, 10 - .   .-<_>     .<> Foundation; either version 2 of the License,
11     ._= =}       : or (at your option) any later version. 11     ._= =}       : or (at your option) any later version.
12    .%`+i>       _;_. 12    .%`+i>       _;_.
13    .i_,=:_.      -<s. This file is distributed in the hope that 13    .i_,=:_.      -<s. This file is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of 15    : ..    .:,     . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
18..}^=.=       =       ; Public License for more details. 18..}^=.=       =       ; Public License for more details.
19++=   -.     .`     .: 19++=   -.     .`     .:
20 :     =  ...= . :.=- You should have received a copy of the GNU 20 :     =  ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file; 21 -.   .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the 22  -_. . .   )=.  = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc., 23    --        :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330, 24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29#include <stdio.h> 29#include <stdio.h>
30 30
31#include <qstring.h>
32#include <qstringlist.h>
33#include <qwidget.h> 31#include <qwidget.h>
34#include <qpe/resource.h>
35#include <qpe/config.h> 32#include <qpe/config.h>
36 33
37#include "cfg.h" 34#include "cfg.h"
38 35
39// --- Cfg -------------------------------------------------------------------- 36// --- Cfg --------------------------------------------------------------------
40Cfg::Cfg() 37Cfg::Cfg()
41{ 38{
42 _currencySymbol="$"; 39 _currencySymbol="$";
43 _showLocks=FALSE; 40 _showLocks=FALSE;
44 _showBalances=FALSE; 41 _showBalances=FALSE;
45 _pCategories=new CategoryList(); 42 _pCategories=new CategoryList();
46 _bDirty=false; 43 _bDirty=false;
47} 44}
48 45
49// --- readStringList --------------------------------------------------------- 46// --- readStringList ---------------------------------------------------------
50// Reads the entries for the control from a configuration file and returns 47// Reads the entries for the control from a configuration file and returns
51// them in a StringList. Later this list can be used to create the control. It 48// them in a StringList. Later this list can be used to create the control. It
52// is assumed, that the group is already set. Key is used to enumerate the 49// is assumed, that the group is already set. Key is used to enumerate the
53// entries. 50// entries.
54void Cfg::readStringList(Config &cfg, const char *sKey, QStringList &lst) 51void Cfg::readStringList(Config &cfg, const char *sKey, QStringList &lst)
55{ 52{
56 QString sEntry; 53 QString sEntry;
57 int iCount; 54 int iCount;
58 55
59 // read count of elements 56 // read count of elements
60 sEntry.sprintf("%s_Count", sKey); 57 sEntry.sprintf("%s_Count", sKey);
61 iCount=cfg.readNumEntry(sEntry, 0); 58 iCount=cfg.readNumEntry(sEntry, 0);
62 59
63 // read entries 60 // read entries
64 for(int i=1; i<=iCount; i++) { 61 for(int i=1; i<=iCount; i++) {
65 sEntry.sprintf("%s%d", sKey, i); 62 sEntry.sprintf("%s%d", sKey, i);
66 QString sType=cfg.readEntry(sEntry); 63 QString sType=cfg.readEntry(sEntry);
67 if( sType!=NULL ) 64 if( sType!=NULL )
68 lst.append(sType); 65 lst.append(sType);
69 } 66 }
70} 67}
71 68
72 69
73// --- readConfig ------------------------------------------------------------- 70// --- readConfig -------------------------------------------------------------
74// Reads the member data from the given config file. It will also set the group 71// Reads the member data from the given config file. It will also set the group
75// "Config" 72// "Config"
76void Cfg::readConfig(Config &config) 73void Cfg::readConfig(Config &config)
77{ 74{
78 // set group 75 // set group
79 config.setGroup( "Config" ); 76 config.setGroup( "Config" );
80 77
81 // read scalars 78 // read scalars
82 _currencySymbol = config.readEntry( "CurrencySymbol", "$" ); 79 _currencySymbol = config.readEntry( "CurrencySymbol", "$" );
83 _showLocks = config.readBoolEntry( "ShowLocks", FALSE ); 80 _showLocks = config.readBoolEntry( "ShowLocks", FALSE );
84 _showBalances = config.readBoolEntry( "ShowBalances", FALSE ); 81 _showBalances = config.readBoolEntry( "ShowBalances", FALSE );
85 _openLastBook = config.readBoolEntry( "OpenLastBook", FALSE ); 82 _openLastBook = config.readBoolEntry( "OpenLastBook", FALSE );
86 _sLastBook = config.readEntry("LastBook", ""); 83 _sLastBook = config.readEntry("LastBook", "");
87 _showLastTab = config.readBoolEntry( "ShowLastTab", FALSE ); 84 _showLastTab = config.readBoolEntry( "ShowLastTab", FALSE );
88 _bSavePayees = config.readBoolEntry( "SavePayees", FALSE ); 85 _bSavePayees = config.readBoolEntry( "SavePayees", FALSE );
89 86
90 // Account types 87 // Account types
91 readStringList(config, "AccType", _AccountTypes); 88 readStringList(config, "AccType", _AccountTypes);
92 if( _AccountTypes.isEmpty() ) { 89 if( _AccountTypes.isEmpty() ) {
93 _AccountTypes+= (const char *)QWidget::tr("Savings"); 90 _AccountTypes+= (const char *)QWidget::tr("Savings");
94 _AccountTypes+= (const char *)QWidget::tr("Checking"); 91 _AccountTypes+= (const char *)QWidget::tr("Checking");
95 _AccountTypes+= (const char *)QWidget::tr("CD"); 92 _AccountTypes+= (const char *)QWidget::tr("CD");
96 _AccountTypes+= (const char *)QWidget::tr("Money market"); 93 _AccountTypes+= (const char *)QWidget::tr("Money market");
97 _AccountTypes+= (const char *)QWidget::tr("Mutual fund"); 94 _AccountTypes+= (const char *)QWidget::tr("Mutual fund");
98 _AccountTypes+= (const char *)QWidget::tr("Other"); 95 _AccountTypes+= (const char *)QWidget::tr("Other");
diff --git a/noncore/apps/checkbook/checkbook.cpp b/noncore/apps/checkbook/checkbook.cpp
index 4ca764f..26b2533 100644
--- a/noncore/apps/checkbook/checkbook.cpp
+++ b/noncore/apps/checkbook/checkbook.cpp
@@ -1,100 +1,99 @@
1/* 1/*
2                This file is part of the OPIE Project 2                This file is part of the OPIE Project
3 =. 3 =.
4             .=l. Copyright (c) 2002 Dan Williams <drw@handhelds.org> 4             .=l. Copyright (c) 2002 Dan Williams <drw@handhelds.org>
5           .>+-= 5           .>+-=
6 _;:,     .>    :=|. This file is free software; you can 6 _;:,     .>    :=|. This file is free software; you can
7.> <`_,   >  .   <= redistribute it and/or modify it under 7.> <`_,   >  .   <= redistribute it and/or modify it under
8:`=1 )Y*s>-.--   : the terms of the GNU General Public 8:`=1 )Y*s>-.--   : the terms of the GNU General Public
9.="- .-=="i,     .._ License as published by the Free Software 9.="- .-=="i,     .._ License as published by the Free Software
10 - .   .-<_>     .<> Foundation; either version 2 of the License, 10 - .   .-<_>     .<> Foundation; either version 2 of the License,
11     ._= =}       : or (at your option) any later version. 11     ._= =}       : or (at your option) any later version.
12    .%`+i>       _;_. 12    .%`+i>       _;_.
13    .i_,=:_.      -<s. This file is distributed in the hope that 13    .i_,=:_.      -<s. This file is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of 15    : ..    .:,     . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
18..}^=.=       =       ; Public License for more details. 18..}^=.=       =       ; Public License for more details.
19++=   -.     .`     .: 19++=   -.     .`     .:
20 :     =  ...= . :.=- You should have received a copy of the GNU 20 :     =  ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file; 21 -.   .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the 22  -_. . .   )=.  = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc., 23    --        :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330, 24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29#include "checkbook.h" 29#include "checkbook.h"
30#include "cbinfo.h" 30#include "cbinfo.h"
31#include "transaction.h" 31#include "transaction.h"
32#include "traninfo.h" 32#include "traninfo.h"
33#include "graph.h" 33#include "graph.h"
34#include "graphinfo.h" 34#include "graphinfo.h"
35#include "password.h" 35#include "password.h"
36#include "mainwindow.h"
37#include "cfg.h" 36#include "cfg.h"
38 37
39#include <qpe/qpeapplication.h> 38#include <qpe/qpeapplication.h>
40#include <qpe/qpemessagebox.h> 39#include <qpe/qpemessagebox.h>
41#include <qpe/resource.h> 40#include <qpe/resource.h>
42 41
43#include <qcheckbox.h> 42#include <qcheckbox.h>
44#include <qcombobox.h> 43#include <qcombobox.h>
45#include <qlabel.h> 44#include <qlabel.h>
46#include <qlayout.h> 45#include <qlayout.h>
47#include <qlineedit.h> 46#include <qlineedit.h>
48#include <qmultilineedit.h> 47#include <qmultilineedit.h>
49#include <qpushbutton.h> 48#include <qpushbutton.h>
50#include <qwhatsthis.h> 49#include <qwhatsthis.h>
51#include <qpopupmenu.h> 50#include <qpopupmenu.h>
52 51
53#define COL_ID 0 52#define COL_ID 0
54#define COL_SORTDATE 1 53#define COL_SORTDATE 1
55#define COL_NUM 2 54#define COL_NUM 2
56#define COL_DATE 3 55#define COL_DATE 3
57#define COL_DESC 4 56#define COL_DESC 4
58#define COL_AMOUNT 5 57#define COL_AMOUNT 5
59#define COL_BAL 6 58#define COL_BAL 6
60 59
61// --- Checkbook -------------------------------------------------------------- 60// --- Checkbook --------------------------------------------------------------
62Checkbook::Checkbook( QWidget *parent, CBInfo *i, Cfg *cfg ) 61Checkbook::Checkbook( QWidget *parent, CBInfo *i, Cfg *cfg )
63 : QDialog( parent, 0, TRUE, WStyle_ContextHelp ) 62 : QDialog( parent, 0, TRUE, WStyle_ContextHelp )
64{ 63{
65 info = i; 64 info = i;
66 _pCfg=cfg; 65 _pCfg=cfg;
67 66
68 // Title bar 67 // Title bar
69 if ( info->name() != "" ) 68 if ( info->name() != "" )
70 { 69 {
71 QString tempstr = info->name(); 70 QString tempstr = info->name();
72 tempstr.append( " - " ); 71 tempstr.append( " - " );
73 tempstr.append( tr( "Checkbook" ) ); 72 tempstr.append( tr( "Checkbook" ) );
74 setCaption( tempstr ); 73 setCaption( tempstr );
75 } 74 }
76 else 75 else
77 { 76 {
78 setCaption( tr( "New checkbook" ) ); 77 setCaption( tr( "New checkbook" ) );
79 } 78 }
80 79
81 80
82 // Setup layout to make everything pretty 81 // Setup layout to make everything pretty
83 QVBoxLayout *layout = new QVBoxLayout( this ); 82 QVBoxLayout *layout = new QVBoxLayout( this );
84 layout->setMargin( 2 ); 83 layout->setMargin( 2 );
85 layout->setSpacing( 4 ); 84 layout->setSpacing( 4 );
86 85
87 // Setup tabs for all info 86 // Setup tabs for all info
88 mainWidget = new OTabWidget( this ); 87 mainWidget = new OTabWidget( this );
89 layout->addWidget( mainWidget ); 88 layout->addWidget( mainWidget );
90 mainWidget->addTab( initInfo(), "checkbook/infotab", tr( "Info" ) ); 89 mainWidget->addTab( initInfo(), "checkbook/infotab", tr( "Info" ) );
91 mainWidget->addTab( initTransactions(), "checkbook/trantab", tr( "Transactions" ) ); 90 mainWidget->addTab( initTransactions(), "checkbook/trantab", tr( "Transactions" ) );
92 mainWidget->addTab( initCharts(), "checkbook/charttab", tr( "Charts" ) ); 91 mainWidget->addTab( initCharts(), "checkbook/charttab", tr( "Charts" ) );
93 if( _pCfg->isShowLastTab() ) 92 if( _pCfg->isShowLastTab() )
94 mainWidget->setCurrentTab( info->getLastTab() ); 93 mainWidget->setCurrentTab( info->getLastTab() );
95 else 94 else
96 mainWidget->setCurrentTab( tr( "Info" ) ); 95 mainWidget->setCurrentTab( tr( "Info" ) );
97 connect( mainWidget, SIGNAL( currentChanged(QWidget *) ), this, SLOT( slotTab(QWidget *) ) ); 96 connect( mainWidget, SIGNAL( currentChanged(QWidget *) ), this, SLOT( slotTab(QWidget *) ) );
98 97
99 // Load checkbook information 98 // Load checkbook information
100 loadCheckbook(); 99 loadCheckbook();
diff --git a/noncore/apps/checkbook/configuration.cpp b/noncore/apps/checkbook/configuration.cpp
index dfae446..872d9b2 100644
--- a/noncore/apps/checkbook/configuration.cpp
+++ b/noncore/apps/checkbook/configuration.cpp
@@ -1,106 +1,102 @@
1/* 1/*
2                This file is part of the OPIE Project 2                This file is part of the OPIE Project
3 =. 3 =.
4             .=l. Copyright (c) 2002 Dan Williams <drw@handhelds.org> 4             .=l. Copyright (c) 2002 Dan Williams <drw@handhelds.org>
5           .>+-= 5           .>+-=
6 _;:,     .>    :=|. This file is free software; you can 6 _;:,     .>    :=|. This file is free software; you can
7.> <`_,   >  .   <= redistribute it and/or modify it under 7.> <`_,   >  .   <= redistribute it and/or modify it under
8:`=1 )Y*s>-.--   : the terms of the GNU General Public 8:`=1 )Y*s>-.--   : the terms of the GNU General Public
9.="- .-=="i,     .._ License as published by the Free Software 9.="- .-=="i,     .._ License as published by the Free Software
10 - .   .-<_>     .<> Foundation; either version 2 of the License, 10 - .   .-<_>     .<> Foundation; either version 2 of the License,
11     ._= =}       : or (at your option) any later version. 11     ._= =}       : or (at your option) any later version.
12    .%`+i>       _;_. 12    .%`+i>       _;_.
13    .i_,=:_.      -<s. This file is distributed in the hope that 13    .i_,=:_.      -<s. This file is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of 15    : ..    .:,     . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
18..}^=.=       =       ; Public License for more details. 18..}^=.=       =       ; Public License for more details.
19++=   -.     .`     .: 19++=   -.     .`     .:
20 :     =  ...= . :.=- You should have received a copy of the GNU 20 :     =  ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file; 21 -.   .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the 22  -_. . .   )=.  = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc., 23    --        :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330, 24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29#include "configuration.h" 29#include "configuration.h"
30#include "mainwindow.h"
31#include "listedit.h" 30#include "listedit.h"
32#include "tabledef.h"
33 31
34#include <qcheckbox.h> 32#include <qcheckbox.h>
35#include <qlabel.h> 33#include <qlabel.h>
36#include <qlayout.h> 34#include <qlayout.h>
37#include <qlineedit.h> 35#include <qlineedit.h>
38#include <qwhatsthis.h> 36#include <qwhatsthis.h>
39#include <qlistview.h> 37#include <qlistview.h>
40#include <qpushbutton.h>
41#include <qtabwidget.h> 38#include <qtabwidget.h>
42#include <qpe/resource.h>
43 39
44Configuration::Configuration( QWidget *parent, Cfg &cfg ) 40Configuration::Configuration( QWidget *parent, Cfg &cfg )
45 : QDialog( parent, 0, TRUE, WStyle_ContextHelp ) 41 : QDialog( parent, 0, TRUE, WStyle_ContextHelp )
46{ 42{
47 setCaption( tr( "Configure Checkbook" ) ); 43 setCaption( tr( "Configure Checkbook" ) );
48 44
49 // Setup layout to make everything pretty 45 // Setup layout to make everything pretty
50 QVBoxLayout *layout = new QVBoxLayout( this ); 46 QVBoxLayout *layout = new QVBoxLayout( this );
51 layout->setMargin( 2 ); 47 layout->setMargin( 2 );
52 layout->setSpacing( 4 ); 48 layout->setSpacing( 4 );
53 49
54 // Setup tabs for all info 50 // Setup tabs for all info
55 _mainWidget = new QTabWidget( this ); 51 _mainWidget = new QTabWidget( this );
56 layout->addWidget( _mainWidget ); 52 layout->addWidget( _mainWidget );
57 53
58 // Settings tab 54 // Settings tab
59 _mainWidget->addTab( initSettings(cfg), tr( "&Settings" ) ); 55 _mainWidget->addTab( initSettings(cfg), tr( "&Settings" ) );
60 56
61 // Account Types tab 57 // Account Types tab
62 ColumnDef *d; 58 ColumnDef *d;
63 _listEditTypes=new ListEdit(_mainWidget, "TYPES" ); 59 _listEditTypes=new ListEdit(_mainWidget, "TYPES" );
64 d=new ColumnDef( tr("Type"), (ColumnDef::ColumnType)(ColumnDef::typeString | ColumnDef::typeUnique), tr("New Account Type")); 60 d=new ColumnDef( tr("Type"), (ColumnDef::ColumnType)(ColumnDef::typeString | ColumnDef::typeUnique), tr("New Account Type"));
65 _listEditTypes->addColumnDef( d ); 61 _listEditTypes->addColumnDef( d );
66 _listEditTypes->addData( cfg.getAccountTypes() ); 62 _listEditTypes->addData( cfg.getAccountTypes() );
67 _mainWidget->addTab( _listEditTypes, tr( "&Account Types" ) ); 63 _mainWidget->addTab( _listEditTypes, tr( "&Account Types" ) );
68 64
69 // Categories tab 65 // Categories tab
70 _listEditCategories=new ListEdit(_mainWidget, "CATEGORIES" ); 66 _listEditCategories=new ListEdit(_mainWidget, "CATEGORIES" );
71 _listEditCategories->addColumnDef( new ColumnDef( tr("Category"), (ColumnDef::ColumnType)(ColumnDef::typeString | ColumnDef::typeUnique), tr("New Category")) ); 67 _listEditCategories->addColumnDef( new ColumnDef( tr("Category"), (ColumnDef::ColumnType)(ColumnDef::typeString | ColumnDef::typeUnique), tr("New Category")) );
72 d=new ColumnDef( tr("Type"), ColumnDef::typeList, tr("Expense") ); 68 d=new ColumnDef( tr("Type"), ColumnDef::typeList, tr("Expense") );
73 d->addColumnValue( tr("Expense") ); 69 d->addColumnValue( tr("Expense") );
74 d->addColumnValue( tr("Income") ); 70 d->addColumnValue( tr("Income") );
75 _listEditCategories->addColumnDef( d ); 71 _listEditCategories->addColumnDef( d );
76 QStringList lst=cfg.getCategories(); 72 QStringList lst=cfg.getCategories();
77 _listEditCategories->addData( lst ); 73 _listEditCategories->addData( lst );
78 _mainWidget->addTab( _listEditCategories, tr( "&Categories" ) ); 74 _mainWidget->addTab( _listEditCategories, tr( "&Categories" ) );
79 75
80 // Payees tab 76 // Payees tab
81 _listEditPayees=new ListEdit(_mainWidget, "PAYEES"); 77 _listEditPayees=new ListEdit(_mainWidget, "PAYEES");
82 _listEditPayees->addColumnDef( new ColumnDef( tr("Payee"), (ColumnDef::ColumnType)(ColumnDef::typeString | ColumnDef::typeUnique), tr("New Payee")) ); 78 _listEditPayees->addColumnDef( new ColumnDef( tr("Payee"), (ColumnDef::ColumnType)(ColumnDef::typeString | ColumnDef::typeUnique), tr("New Payee")) );
83 _listEditPayees->addData( cfg.getPayees() ); 79 _listEditPayees->addData( cfg.getPayees() );
84 _mainWidget->addTab( _listEditPayees, tr("&Payees") ); 80 _mainWidget->addTab( _listEditPayees, tr("&Payees") );
85} 81}
86 82
87Configuration::~Configuration() 83Configuration::~Configuration()
88{ 84{
89} 85}
90 86
91// ---- initSettings ---------------------------------------------------------- 87// ---- initSettings ----------------------------------------------------------
92QWidget *Configuration::initSettings(Cfg &cfg) 88QWidget *Configuration::initSettings(Cfg &cfg)
93{ 89{
94 QWidget *control = new QWidget( _mainWidget ); 90 QWidget *control = new QWidget( _mainWidget );
95 91
96 QFontMetrics fm = fontMetrics(); 92 QFontMetrics fm = fontMetrics();
97 int fh = fm.height(); 93 int fh = fm.height();
98 94
99 QVBoxLayout *vb = new QVBoxLayout( control ); 95 QVBoxLayout *vb = new QVBoxLayout( control );
100 96
101 QScrollView *sv = new QScrollView( control ); 97 QScrollView *sv = new QScrollView( control );
102 vb->addWidget( sv, 0, 0 ); 98 vb->addWidget( sv, 0, 0 );
103 sv->setResizePolicy( QScrollView::AutoOneFit ); 99 sv->setResizePolicy( QScrollView::AutoOneFit );
104 sv->setFrameStyle( QFrame::NoFrame ); 100 sv->setFrameStyle( QFrame::NoFrame );
105 101
106 QWidget *container = new QWidget( sv->viewport() ); 102 QWidget *container = new QWidget( sv->viewport() );
diff --git a/noncore/apps/checkbook/mainwindow.cpp b/noncore/apps/checkbook/mainwindow.cpp
index 60aea42..d0fac3b 100644
--- a/noncore/apps/checkbook/mainwindow.cpp
+++ b/noncore/apps/checkbook/mainwindow.cpp
@@ -1,111 +1,107 @@
1/* 1/*
2                This file is part of the OPIE Project 2                This file is part of the OPIE Project
3 =. 3 =.
4             .=l. Copyright (c) 2002 Dan Williams <drw@handhelds.org> 4             .=l. Copyright (c) 2002 Dan Williams <drw@handhelds.org>
5           .>+-= 5           .>+-=
6 _;:,     .>    :=|. This file is free software; you can 6 _;:,     .>    :=|. This file is free software; you can
7.> <`_,   >  .   <= redistribute it and/or modify it under 7.> <`_,   >  .   <= redistribute it and/or modify it under
8:`=1 )Y*s>-.--   : the terms of the GNU General Public 8:`=1 )Y*s>-.--   : the terms of the GNU General Public
9.="- .-=="i,     .._ License as published by the Free Software 9.="- .-=="i,     .._ License as published by the Free Software
10 - .   .-<_>     .<> Foundation; either version 2 of the License, 10 - .   .-<_>     .<> Foundation; either version 2 of the License,
11     ._= =}       : or (at your option) any later version. 11     ._= =}       : or (at your option) any later version.
12    .%`+i>       _;_. 12    .%`+i>       _;_.
13    .i_,=:_.      -<s. This file is distributed in the hope that 13    .i_,=:_.      -<s. This file is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of 15    : ..    .:,     . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
18..}^=.=       =       ; Public License for more details. 18..}^=.=       =       ; Public License for more details.
19++=   -.     .`     .: 19++=   -.     .`     .:
20 :     =  ...= . :.=- You should have received a copy of the GNU 20 :     =  ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file; 21 -.   .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the 22  -_. . .   )=.  = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc., 23    --        :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330, 24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29#include "mainwindow.h" 29#include "mainwindow.h"
30#include "cbinfo.h" 30#include "cbinfo.h"
31#include "configuration.h" 31#include "configuration.h"
32#include "password.h" 32#include "password.h"
33#include "checkbook.h" 33#include "checkbook.h"
34#include "listedit.h"
35 34
36#include <qpe/config.h> 35#include <qpe/config.h>
37#include <qpe/global.h>
38#include <qpe/qpeapplication.h> 36#include <qpe/qpeapplication.h>
39#include <qpe/qpemessagebox.h> 37#include <qpe/qpemessagebox.h>
40#include <qpe/qpetoolbar.h> 38#include <qpe/qpetoolbar.h>
41#include <qpe/resource.h> 39#include <qpe/resource.h>
42 40
43#include <qmenubar.h> 41#include <qmenubar.h>
44#include <qaction.h> 42#include <qaction.h>
45#include <qcheckbox.h>
46#include <qdir.h> 43#include <qdir.h>
47#include <qlineedit.h>
48#include <qwhatsthis.h> 44#include <qwhatsthis.h>
49 45
50 46
51MainWindow::MainWindow( QWidget* parent, const char* name, WFlags /*fl*/ ) 47MainWindow::MainWindow( QWidget* parent, const char* name, WFlags /*fl*/ )
52 : QMainWindow( parent, name, WStyle_ContextHelp ) 48 : QMainWindow( parent, name, WStyle_ContextHelp )
53{ 49{
54 setCaption( tr( "Checkbook" ) ); 50 setCaption( tr( "Checkbook" ) );
55 51
56 cbDir = Global::applicationFileName( "checkbook", "" ); 52 cbDir = Global::applicationFileName( "checkbook", "" );
57 lockIcon = Resource::loadPixmap( "locked" ); 53 lockIcon = Resource::loadPixmap( "locked" );
58 54
59 // Load configuration options 55 // Load configuration options
60 Config config( "checkbook" ); 56 Config config( "checkbook" );
61 _cfg.readConfig( config ); 57 _cfg.readConfig( config );
62 58
63 59
64 // Build menu and tool bars 60 // Build menu and tool bars
65 setToolBarsMovable( FALSE ); 61 setToolBarsMovable( FALSE );
66 62
67 QToolBar *bar = new QToolBar( this ); 63 QToolBar *bar = new QToolBar( this );
68 bar->setHorizontalStretchable( TRUE ); 64 bar->setHorizontalStretchable( TRUE );
69 QMenuBar *mb = new QMenuBar( bar ); 65 QMenuBar *mb = new QMenuBar( bar );
70 mb->setMargin( 0 ); 66 mb->setMargin( 0 );
71 QPopupMenu *popup = new QPopupMenu( this ); 67 QPopupMenu *popup = new QPopupMenu( this );
72 68
73 bar = new QToolBar( this ); 69 bar = new QToolBar( this );
74 QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, 0, this, 0 ); 70 QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, 0, this, 0 );
75 a->setWhatsThis( tr( "Click here to create a new checkbook.\n\nYou also can select New from the Checkbook menu." ) ); 71 a->setWhatsThis( tr( "Click here to create a new checkbook.\n\nYou also can select New from the Checkbook menu." ) );
76 connect( a, SIGNAL( activated() ), this, SLOT( slotNew() ) ); 72 connect( a, SIGNAL( activated() ), this, SLOT( slotNew() ) );
77 a->addTo( popup ); 73 a->addTo( popup );
78 a->addTo( bar ); 74 a->addTo( bar );
79 75
80 actionOpen = new QAction( tr( "Edit" ), Resource::loadPixmap( "edit" ), QString::null, 76 actionOpen = new QAction( tr( "Edit" ), Resource::loadPixmap( "edit" ), QString::null,
81 0, this, 0 ); 77 0, this, 0 );
82 actionOpen->setWhatsThis( tr( "Select a checkbook and then click here to edit it.\n\nYou also can select Edit from the Checkbook menu, or click and hold on a checkbook name." ) ); 78 actionOpen->setWhatsThis( tr( "Select a checkbook and then click here to edit it.\n\nYou also can select Edit from the Checkbook menu, or click and hold on a checkbook name." ) );
83 connect( actionOpen, SIGNAL( activated() ), this, SLOT( slotEdit() ) ); 79 connect( actionOpen, SIGNAL( activated() ), this, SLOT( slotEdit() ) );
84 actionOpen->addTo( popup ); 80 actionOpen->addTo( popup );
85 actionOpen->addTo( bar ); 81 actionOpen->addTo( bar );
86 82
87 actionDelete = new QAction( tr( "Delete" ), Resource::loadPixmap( "trash" ), QString::null, 83 actionDelete = new QAction( tr( "Delete" ), Resource::loadPixmap( "trash" ), QString::null,
88 0, this, 0 ); 84 0, this, 0 );
89 actionDelete->setWhatsThis( tr( "Select a checkbook and then click here delete it.\n\nYou also can select Delete from the Checkbook menu." ) ); 85 actionDelete->setWhatsThis( tr( "Select a checkbook and then click here delete it.\n\nYou also can select Delete from the Checkbook menu." ) );
90 connect( actionDelete, SIGNAL( activated() ), this, SLOT( slotDelete() ) ); 86 connect( actionDelete, SIGNAL( activated() ), this, SLOT( slotDelete() ) );
91 actionDelete->addTo( popup ); 87 actionDelete->addTo( popup );
92 actionDelete->addTo( bar ); 88 actionDelete->addTo( bar );
93 89
94 popup->insertSeparator(); 90 popup->insertSeparator();
95 91
96 a = new QAction( tr( "Configure" ), Resource::loadPixmap( "SettingsIcon" ), QString::null, 0, this, 0 ); 92 a = new QAction( tr( "Configure" ), Resource::loadPixmap( "SettingsIcon" ), QString::null, 0, this, 0 );
97 a->setWhatsThis( tr( "Click here to configure this app." ) ); 93 a->setWhatsThis( tr( "Click here to configure this app." ) );
98 connect( a, SIGNAL( activated() ), this, SLOT( slotConfigure() ) ); 94 connect( a, SIGNAL( activated() ), this, SLOT( slotConfigure() ) );
99 a->addTo( popup ); 95 a->addTo( popup );
100 a->addTo( bar ); 96 a->addTo( bar );
101 97
102 mb->insertItem( tr( "Checkbook" ), popup ); 98 mb->insertItem( tr( "Checkbook" ), popup );
103 99
104 // Load Checkbook selection list 100 // Load Checkbook selection list
105 checkbooks = new CBInfoList(); 101 checkbooks = new CBInfoList();
106 102
107 QDir checkdir( cbDir ); 103 QDir checkdir( cbDir );
108 if (checkdir.exists() == true) 104 if (checkdir.exists() == true)
109 { 105 {
110 QStringList cblist = checkdir.entryList( "*.qcb", QDir::Files|QDir::Readable|QDir::Writable, 106 QStringList cblist = checkdir.entryList( "*.qcb", QDir::Files|QDir::Readable|QDir::Writable,
111 QDir::Time ); 107 QDir::Time );
diff --git a/noncore/apps/checkbook/tabledef.cpp b/noncore/apps/checkbook/tabledef.cpp
index 13edded..9a42308 100644
--- a/noncore/apps/checkbook/tabledef.cpp
+++ b/noncore/apps/checkbook/tabledef.cpp
@@ -1,76 +1,74 @@
1/* 1/*
2                This file is part of the OPIE Project 2                This file is part of the OPIE Project
3 =. 3 =.
4             .=l. Copyright (c) 2002 Dan Williams <drw@handhelds.org> 4             .=l. Copyright (c) 2002 Dan Williams <drw@handhelds.org>
5           .>+-= 5           .>+-=
6 _;:,     .>    :=|. This file is free software; you can 6 _;:,     .>    :=|. This file is free software; you can
7.> <`_,   >  .   <= redistribute it and/or modify it under 7.> <`_,   >  .   <= redistribute it and/or modify it under
8:`=1 )Y*s>-.--   : the terms of the GNU General Public 8:`=1 )Y*s>-.--   : the terms of the GNU General Public
9.="- .-=="i,     .._ License as published by the Free Software 9.="- .-=="i,     .._ License as published by the Free Software
10 - .   .-<_>     .<> Foundation; either version 2 of the License, 10 - .   .-<_>     .<> Foundation; either version 2 of the License,
11     ._= =}       : or (at your option) any later version. 11     ._= =}       : or (at your option) any later version.
12    .%`+i>       _;_. 12    .%`+i>       _;_.
13    .i_,=:_.      -<s. This file is distributed in the hope that 13    .i_,=:_.      -<s. This file is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of 15    : ..    .:,     . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
18..}^=.=       =       ; Public License for more details. 18..}^=.=       =       ; Public License for more details.
19++=   -.     .`     .: 19++=   -.     .`     .:
20 :     =  ...= . :.=- You should have received a copy of the GNU 20 :     =  ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file; 21 -.   .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the 22  -_. . .   )=.  = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc., 23    --        :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330, 24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29#include "tabledef.h" 29#include "tabledef.h"
30 30
31#include <qstring.h>
32#include <qpe/resource.h>
33 31
34// --- ColumnDef -------------------------------------------------------------- 32// --- ColumnDef --------------------------------------------------------------
35ColumnDef::ColumnDef(const char *sName, ColumnType type, const char *sNewValue) 33ColumnDef::ColumnDef(const char *sName, ColumnType type, const char *sNewValue)
36{ 34{
37 _sName=sName; 35 _sName=sName;
38 _type=type; 36 _type=type;
39 _sNewValue=sNewValue; 37 _sNewValue=sNewValue;
40} 38}
41 39
42 40
43// --- addColumnValue --------------------------------------------------------- 41// --- addColumnValue ---------------------------------------------------------
44void ColumnDef::addColumnValue(const QString &sValue) 42void ColumnDef::addColumnValue(const QString &sValue)
45{ 43{
46 if( (_type & 0x00ffffff) !=typeList ) 44 if( (_type & 0x00ffffff) !=typeList )
47 qDebug("Column %s is not a list", (const char *)_sName); 45 qDebug("Column %s is not a list", (const char *)_sName);
48 else 46 else
49 _valueList.append(sValue); 47 _valueList.append(sValue);
50} 48}
51void ColumnDef::addColumnValue(const char *sValue) 49void ColumnDef::addColumnValue(const char *sValue)
52{ 50{
53 if( (_type & 0x00ffffff)!=typeList ) 51 if( (_type & 0x00ffffff)!=typeList )
54 qDebug("Column %s is not a list", (const char *)_sName); 52 qDebug("Column %s is not a list", (const char *)_sName);
55 else 53 else
56 _valueList.append(sValue); 54 _valueList.append(sValue);
57} 55}
58 56
59// --- TableDef --------------------------------------------------------------- 57// --- TableDef ---------------------------------------------------------------
60TableDef::TableDef(const char *sName) 58TableDef::TableDef(const char *sName)
61{ 59{
62 _sName=sName; 60 _sName=sName;
63 _vColumns.setAutoDelete(TRUE); 61 _vColumns.setAutoDelete(TRUE);
64} 62}
65 63
66 64
67// --- ~TableDef -------------------------------------------------------------- 65// --- ~TableDef --------------------------------------------------------------
68TableDef::~TableDef() 66TableDef::~TableDef()
69{ 67{
70} 68}
71 69
72// --- addColumnDef ----------------------------------------------------------- 70// --- addColumnDef -----------------------------------------------------------
73void TableDef::addColumnDef(ColumnDef *pDef) 71void TableDef::addColumnDef(ColumnDef *pDef)
74{ 72{
75 _vColumns.append(pDef); 73 _vColumns.append(pDef);
76} 74}
diff --git a/noncore/apps/checkbook/transaction.cpp b/noncore/apps/checkbook/transaction.cpp
index 9379da0..a72a48b 100644
--- a/noncore/apps/checkbook/transaction.cpp
+++ b/noncore/apps/checkbook/transaction.cpp
@@ -1,99 +1,98 @@
1/* 1/*
2                This file is part of the OPIE Project 2                This file is part of the OPIE Project
3 =. 3 =.
4             .=l. Copyright (c) 2002 Dan Williams <drw@handhelds.org> 4             .=l. Copyright (c) 2002 Dan Williams <drw@handhelds.org>
5           .>+-= 5           .>+-=
6 _;:,     .>    :=|. This file is free software; you can 6 _;:,     .>    :=|. This file is free software; you can
7.> <`_,   >  .   <= redistribute it and/or modify it under 7.> <`_,   >  .   <= redistribute it and/or modify it under
8:`=1 )Y*s>-.--   : the terms of the GNU General Public 8:`=1 )Y*s>-.--   : the terms of the GNU General Public
9.="- .-=="i,     .._ License as published by the Free Software 9.="- .-=="i,     .._ License as published by the Free Software
10 - .   .-<_>     .<> Foundation; either version 2 of the License, 10 - .   .-<_>     .<> Foundation; either version 2 of the License,
11     ._= =}       : or (at your option) any later version. 11     ._= =}       : or (at your option) any later version.
12    .%`+i>       _;_. 12    .%`+i>       _;_.
13    .i_,=:_.      -<s. This file is distributed in the hope that 13    .i_,=:_.      -<s. This file is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of 15    : ..    .:,     . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
18..}^=.=       =       ; Public License for more details. 18..}^=.=       =       ; Public License for more details.
19++=   -.     .`     .: 19++=   -.     .`     .:
20 :     =  ...= . :.=- You should have received a copy of the GNU 20 :     =  ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file; 21 -.   .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the 22  -_. . .   )=.  = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc., 23    --        :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330, 24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29#include "transaction.h" 29#include "transaction.h"
30#include "traninfo.h" 30#include "traninfo.h"
31#include "cfg.h" 31#include "cfg.h"
32#include "checkbook.h" 32#include "checkbook.h"
33 33
34#include <qpe/datebookmonth.h> 34#include <qpe/datebookmonth.h>
35#include <qpe/resource.h>
36 35
37#include <qbuttongroup.h> 36#include <qbuttongroup.h>
38#include <qcombobox.h> 37#include <qcombobox.h>
39#include <qlabel.h> 38#include <qlabel.h>
40#include <qlayout.h> 39#include <qlayout.h>
41#include <qlineedit.h> 40#include <qlineedit.h>
42#include <qmultilineedit.h> 41#include <qmultilineedit.h>
43#include <qradiobutton.h> 42#include <qradiobutton.h>
44#include <qwhatsthis.h> 43#include <qwhatsthis.h>
45 44
46Transaction::Transaction( QWidget *parent, bool bNew, const QString &acctname, 45Transaction::Transaction( QWidget *parent, bool bNew, const QString &acctname,
47 TranInfo *info, Cfg *pCfg ) 46 TranInfo *info, Cfg *pCfg )
48 : QDialog( parent, 0, TRUE, WStyle_ContextHelp ) 47 : QDialog( parent, 0, TRUE, WStyle_ContextHelp )
49{ 48{
50 QString tempstr = tr( "Transaction for " ); 49 QString tempstr = tr( "Transaction for " );
51 tempstr.append( acctname ); 50 tempstr.append( acctname );
52 setCaption( tempstr ); 51 setCaption( tempstr );
53 52
54 _bNew=bNew; 53 _bNew=bNew;
55 tran = info; 54 tran = info;
56 _pCfg=pCfg; 55 _pCfg=pCfg;
57 56
58 QVBoxLayout *vb = new QVBoxLayout( this ); 57 QVBoxLayout *vb = new QVBoxLayout( this );
59 58
60 QScrollView *sv = new QScrollView( this ); 59 QScrollView *sv = new QScrollView( this );
61 vb->addWidget( sv, 0, 0 ); 60 vb->addWidget( sv, 0, 0 );
62 sv->setResizePolicy( QScrollView::AutoOneFit ); 61 sv->setResizePolicy( QScrollView::AutoOneFit );
63 sv->setFrameStyle( QFrame::NoFrame ); 62 sv->setFrameStyle( QFrame::NoFrame );
64 63
65 QWidget *container = new QWidget( sv->viewport() ); 64 QWidget *container = new QWidget( sv->viewport() );
66 sv->addChild( container ); 65 sv->addChild( container );
67 66
68 QGridLayout *layout = new QGridLayout( container ); 67 QGridLayout *layout = new QGridLayout( container );
69 layout->setSpacing( 2 ); 68 layout->setSpacing( 2 );
70 layout->setMargin( 4 ); 69 layout->setMargin( 4 );
71 70
72 // Withdrawal/Deposit 71 // Withdrawal/Deposit
73 QButtonGroup *btngrp = new QButtonGroup( container ); 72 QButtonGroup *btngrp = new QButtonGroup( container );
74 btngrp->setColumnLayout(0, Qt::Vertical ); 73 btngrp->setColumnLayout(0, Qt::Vertical );
75 btngrp->layout()->setSpacing( 0 ); 74 btngrp->layout()->setSpacing( 0 );
76 btngrp->layout()->setMargin( 0 ); 75 btngrp->layout()->setMargin( 0 );
77 btngrp->setMaximumWidth( 220 ); 76 btngrp->setMaximumWidth( 220 );
78 QGridLayout *layout2 = new QGridLayout( btngrp->layout() ); 77 QGridLayout *layout2 = new QGridLayout( btngrp->layout() );
79 layout2->setSpacing( 2 ); 78 layout2->setSpacing( 2 );
80 layout2->setMargin( 2 ); 79 layout2->setMargin( 2 );
81 withBtn = new QRadioButton( tr( "Withdrawal" ), btngrp ); 80 withBtn = new QRadioButton( tr( "Withdrawal" ), btngrp );
82 QWhatsThis::add( withBtn, tr( "Select whether the transaction is a withdrawal or deposit here." ) ); 81 QWhatsThis::add( withBtn, tr( "Select whether the transaction is a withdrawal or deposit here." ) );
83 layout2->addWidget( withBtn, 0, 0 ); 82 layout2->addWidget( withBtn, 0, 0 );
84 connect( withBtn, SIGNAL( clicked() ), this, SLOT( slotWithdrawalClicked() ) ); 83 connect( withBtn, SIGNAL( clicked() ), this, SLOT( slotWithdrawalClicked() ) );
85 depBtn = new QRadioButton( tr( "Deposit" ), btngrp ); 84 depBtn = new QRadioButton( tr( "Deposit" ), btngrp );
86 QWhatsThis::add( depBtn, tr( "Select whether the transaction is a withdrawal or deposit here." ) ); 85 QWhatsThis::add( depBtn, tr( "Select whether the transaction is a withdrawal or deposit here." ) );
87 layout2->addWidget( depBtn, 0, 1 ); 86 layout2->addWidget( depBtn, 0, 1 );
88 btngrp->setMaximumSize( 320, withBtn->height() ); 87 btngrp->setMaximumSize( 320, withBtn->height() );
89 connect( depBtn, SIGNAL( clicked() ), this, SLOT( slotDepositClicked() ) ); 88 connect( depBtn, SIGNAL( clicked() ), this, SLOT( slotDepositClicked() ) );
90 layout->addMultiCellWidget( btngrp, 0, 0, 0, 3 ); 89 layout->addMultiCellWidget( btngrp, 0, 0, 0, 3 );
91 90
92 // Date 91 // Date
93 QLabel *label = new QLabel( tr( "Date:" ), container ); 92 QLabel *label = new QLabel( tr( "Date:" ), container );
94 QWhatsThis::add( label, tr( "Select date of transaction here." ) ); 93 QWhatsThis::add( label, tr( "Select date of transaction here." ) );
95 layout->addWidget( label, 1, 0 ); 94 layout->addWidget( label, 1, 0 );
96 dateBtn = new QPushButton( TimeString::shortDate( QDate::currentDate() ), 95 dateBtn = new QPushButton( TimeString::shortDate( QDate::currentDate() ),
97 container ); 96 container );
98 QWhatsThis::add( dateBtn, tr( "Select date of transaction here." ) ); 97 QWhatsThis::add( dateBtn, tr( "Select date of transaction here." ) );
99 QPopupMenu *m1 = new QPopupMenu( container ); 98 QPopupMenu *m1 = new QPopupMenu( container );
diff --git a/noncore/apps/confedit/editwidget.cpp b/noncore/apps/confedit/editwidget.cpp
index f7dc408..21f69c7 100644
--- a/noncore/apps/confedit/editwidget.cpp
+++ b/noncore/apps/confedit/editwidget.cpp
@@ -1,77 +1,69 @@
1#include "editwidget.h" 1#include "editwidget.h"
2 2
3#include <qlabel.h> 3#include <qlabel.h>
4#include <qlineedit.h> 4#include <qlineedit.h>
5#include <qpushbutton.h>
6#include <qlayout.h> 5#include <qlayout.h>
7#include <qvariant.h>
8#include <qtooltip.h>
9#include <qwhatsthis.h>
10#include <qtimer.h>
11#include <qpopupmenu.h>
12#include <qaction.h>
13#include "listviewitemconfigentry.h"
14 6
15EditWidget::EditWidget( QWidget* parent, const char* name, WFlags fl ) 7EditWidget::EditWidget( QWidget* parent, const char* name, WFlags fl )
16 : QWidget( parent, name, fl ) 8 : QWidget( parent, name, fl )
17{ 9{
18 10
19 EditWidgetLayout = new QGridLayout( this ); 11 EditWidgetLayout = new QGridLayout( this );
20 EditWidgetLayout->setSpacing( 0 ); 12 EditWidgetLayout->setSpacing( 0 );
21 EditWidgetLayout->setMargin( 0 ); 13 EditWidgetLayout->setMargin( 0 );
22// setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Maximum));//, sizePolicy().hasHeightForWidth() ) ); 14// setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Maximum));//, sizePolicy().hasHeightForWidth() ) );
23 15
24 TextLabelFileName = new QLabel( this, "TextLabelFileName" ); 16 TextLabelFileName = new QLabel( this, "TextLabelFileName" );
25 TextLabelFileName->setText( tr( "File Name:" ) ); 17 TextLabelFileName->setText( tr( "File Name:" ) );
26 EditWidgetLayout->addWidget( TextLabelFileName, 0, 0 ); 18 EditWidgetLayout->addWidget( TextLabelFileName, 0, 0 );
27 TextFileName = new QLabel( this, "TextFileName" ); 19 TextFileName = new QLabel( this, "TextFileName" );
28 EditWidgetLayout->addWidget( TextFileName, 0, 1 ); 20 EditWidgetLayout->addWidget( TextFileName, 0, 1 );
29 21
30 TextLabelGroup = new QLabel( this, "TextLabelGroup" ); 22 TextLabelGroup = new QLabel( this, "TextLabelGroup" );
31 TextLabelGroup->setText( tr( "Group:" ) ); 23 TextLabelGroup->setText( tr( "Group:" ) );
32 EditWidgetLayout->addWidget( TextLabelGroup, 1, 0 ); 24 EditWidgetLayout->addWidget( TextLabelGroup, 1, 0 );
33 LineEditGroup = new QLineEdit( this, "LineEditGroup" ); 25 LineEditGroup = new QLineEdit( this, "LineEditGroup" );
34 EditWidgetLayout->addWidget( LineEditGroup, 1, 1 ); 26 EditWidgetLayout->addWidget( LineEditGroup, 1, 1 );
35 27
36 TextLabelKey = new QLabel( this, "TextLabelKey" ); 28 TextLabelKey = new QLabel( this, "TextLabelKey" );
37 TextLabelKey->setText( tr( "Key:" ) ); 29 TextLabelKey->setText( tr( "Key:" ) );
38 EditWidgetLayout->addWidget( TextLabelKey, 2, 0 ); 30 EditWidgetLayout->addWidget( TextLabelKey, 2, 0 );
39 LineEditKey = new QLineEdit( this, "LineEditKey" ); 31 LineEditKey = new QLineEdit( this, "LineEditKey" );
40 EditWidgetLayout->addWidget( LineEditKey, 2, 1 ); 32 EditWidgetLayout->addWidget( LineEditKey, 2, 1 );
41 33
42 TextLabelValue = new QLabel( this, "TextLabelValue" ); 34 TextLabelValue = new QLabel( this, "TextLabelValue" );
43 TextLabelValue->setText( tr( "Value:" ) ); 35 TextLabelValue->setText( tr( "Value:" ) );
44 EditWidgetLayout->addWidget( TextLabelValue, 3, 0 ); 36 EditWidgetLayout->addWidget( TextLabelValue, 3, 0 );
45 LineEditValue = new QLineEdit( this, "LineEditValue" ); 37 LineEditValue = new QLineEdit( this, "LineEditValue" );
46 EditWidgetLayout->addWidget( LineEditValue, 3, 1 ); 38 EditWidgetLayout->addWidget( LineEditValue, 3, 1 );
47 39
48 // layoutType(Nothing); 40 // layoutType(Nothing);
49} 41}
50 42
51 43
52EditWidget::~EditWidget() 44EditWidget::~EditWidget()
53{ 45{
54} 46}
55 47
56 48
57void EditWidget::layoutType(int t) 49void EditWidget::layoutType(int t)
58{ 50{
59 switch (t) 51 switch (t)
60 { 52 {
61 case Entry: 53 case Entry:
62 LineEditGroup->setEnabled(false); 54 LineEditGroup->setEnabled(false);
63 TextLabelKey->show(); 55 TextLabelKey->show();
64 LineEditKey->show(); 56 LineEditKey->show();
65 TextLabelValue->show(); 57 TextLabelValue->show();
66 LineEditValue->show(); 58 LineEditValue->show();
67 TextLabelGroup->show(); 59 TextLabelGroup->show();
68 LineEditGroup->show(); 60 LineEditGroup->show();
69 TextLabelFileName->show(); 61 TextLabelFileName->show();
70 TextFileName->show(); 62 TextFileName->show();
71 break; 63 break;
72 case Group: 64 case Group:
73 LineEditGroup->setEnabled(true); 65 LineEditGroup->setEnabled(true);
74 TextLabelKey->hide(); 66 TextLabelKey->hide();
75 LineEditKey->hide(); 67 LineEditKey->hide();
76 TextLabelValue->hide(); 68 TextLabelValue->hide();
77 LineEditValue->hide(); 69 LineEditValue->hide();
diff --git a/noncore/apps/confedit/listviewitemconffile.cpp b/noncore/apps/confedit/listviewitemconffile.cpp
index ce6504c..1ff2c44 100644
--- a/noncore/apps/confedit/listviewitemconffile.cpp
+++ b/noncore/apps/confedit/listviewitemconffile.cpp
@@ -1,78 +1,77 @@
1/*************************************************************************** 1/***************************************************************************
2 * * 2 * *
3 * This program is free software; you can redistribute it and/or modify * 3 * This program is free software; you can redistribute it and/or modify *
4 * it under the terms of the GNU General Public License as published by * 4 * it under the terms of the GNU General Public License as published by *
5 * the Free Software Foundation; either version 2 of the License, or * 5 * the Free Software Foundation; either version 2 of the License, or *
6 * (at your option) any later version. * 6 * (at your option) any later version. *
7 * * 7 * *
8 ***************************************************************************/ 8 ***************************************************************************/
9// (c) 2002 Patrick S. Vogt <tille@handhelds.org> 9// (c) 2002 Patrick S. Vogt <tille@handhelds.org>
10 10
11#include "listviewitemconffile.h" 11#include "listviewitemconffile.h"
12#include <qmessagebox.h> 12#include <qmessagebox.h>
13#include <qtextstream.h> 13#include <qtextstream.h>
14#include <qstring.h>
15#include "listviewitemconfigentry.h" 14#include "listviewitemconfigentry.h"
16 15
17#define tr QObject::tr 16#define tr QObject::tr
18 17
19ListViewItemConfFile::ListViewItemConfFile(QFileInfo *file, QListView *parent) 18ListViewItemConfFile::ListViewItemConfFile(QFileInfo *file, QListView *parent)
20 : ListViewItemConf(parent), _valid(false) 19 : ListViewItemConf(parent), _valid(false)
21{ 20{
22 confFileInfo = file; 21 confFileInfo = file;
23// parseFile(); 22// parseFile();
24 displayText(); 23 displayText();
25} 24}
26 25
27ListViewItemConfFile::~ListViewItemConfFile() 26ListViewItemConfFile::~ListViewItemConfFile()
28{ 27{
29} 28}
30 29
31 30
32void ListViewItemConfFile::displayText() 31void ListViewItemConfFile::displayText()
33{ 32{
34 setText(0,(_changed?"*":"")+confFileInfo->fileName()); 33 setText(0,(_changed?"*":"")+confFileInfo->fileName());
35} 34}
36 35
37QString ListViewItemConfFile::fileName() 36QString ListViewItemConfFile::fileName()
38{ 37{
39 return confFileInfo->fileName(); 38 return confFileInfo->fileName();
40} 39}
41 40
42void ListViewItemConfFile::parseFile() 41void ListViewItemConfFile::parseFile()
43{ 42{
44 //qDebug("ListViewItemConfFile::parseFile BEGIN"); 43 //qDebug("ListViewItemConfFile::parseFile BEGIN");
45 QFile confFile(confFileInfo->absFilePath()); 44 QFile confFile(confFileInfo->absFilePath());
46 if(! confFile.open(IO_ReadOnly)) 45 if(! confFile.open(IO_ReadOnly))
47 QMessageBox::critical(0,tr("Could not open"),tr("The file ")+confFileInfo->fileName()+tr(" could not be opened."),1,0); 46 QMessageBox::critical(0,tr("Could not open"),tr("The file ")+confFileInfo->fileName()+tr(" could not be opened."),1,0);
48 QTextStream t( &confFile ); 47 QTextStream t( &confFile );
49 QString s; 48 QString s;
50 QString group; 49 QString group;
51 ListViewItemConfigEntry *groupItem; 50 ListViewItemConfigEntry *groupItem;
52 ListViewItemConfigEntry *item; 51 ListViewItemConfigEntry *item;
53 while ( !t.atEnd() ) 52 while ( !t.atEnd() )
54 { 53 {
55 s = t.readLine().stripWhiteSpace(); 54 s = t.readLine().stripWhiteSpace();
56 //qDebug( "line: >%s<\n", s.latin1() ); 55 //qDebug( "line: >%s<\n", s.latin1() );
57 if (s.contains("<?xml")) 56 if (s.contains("<?xml"))
58 { 57 {
59 _valid = false; 58 _valid = false;
60 break; 59 break;
61 }else 60 }else
62 if ( s[0] == '[' && s[s.length()-1] == ']' ) 61 if ( s[0] == '[' && s[s.length()-1] == ']' )
63 { 62 {
64 // qDebug("got group"+s); 63 // qDebug("got group"+s);
65 group = s.mid(1,s.length()-2); 64 group = s.mid(1,s.length()-2);
66 if (!groupItem) groupItem = new ListViewItemConfigEntry(this, tr("no group") ); 65 if (!groupItem) groupItem = new ListViewItemConfigEntry(this, tr("no group") );
67 groupItem = new ListViewItemConfigEntry(this, group ); 66 groupItem = new ListViewItemConfigEntry(this, group );
68 insertItem( groupItem ); 67 insertItem( groupItem );
69 } else 68 } else
70 if ( int pos = s.find('=') ) 69 if ( int pos = s.find('=') )
71 { 70 {
72// qDebug("got key"+s); 71// qDebug("got key"+s);
73 if (!groupItem) qDebug("PANIK NO GROUP! >%s<",group.latin1()); 72 if (!groupItem) qDebug("PANIK NO GROUP! >%s<",group.latin1());
74 item = new ListViewItemConfigEntry(this, group, s ); 73 item = new ListViewItemConfigEntry(this, group, s );
75 groupItem->insertItem( item ); 74 groupItem->insertItem( item );
76 } 75 }
77 } 76 }
78 confFile.close(); 77 confFile.close();
diff --git a/noncore/apps/confedit/listviewitemconfigentry.cpp b/noncore/apps/confedit/listviewitemconfigentry.cpp
index 5ef9f61..0970125 100644
--- a/noncore/apps/confedit/listviewitemconfigentry.cpp
+++ b/noncore/apps/confedit/listviewitemconfigentry.cpp
@@ -1,76 +1,75 @@
1/*************************************************************************** 1/***************************************************************************
2 * * 2 * *
3 * This program is free software; you can redistribute it and/or modify * 3 * This program is free software; you can redistribute it and/or modify *
4 * it under the terms of the GNU General Public License as published by * 4 * it under the terms of the GNU General Public License as published by *
5 * the Free Software Foundation; either version 2 of the License, or * 5 * the Free Software Foundation; either version 2 of the License, or *
6 * (at your option) any later version. * 6 * (at your option) any later version. *
7 * * 7 * *
8 ***************************************************************************/ 8 ***************************************************************************/
9 // (c) 2002 Patrick S. Vogtp <tille@handhelds.org> 9 // (c) 2002 Patrick S. Vogtp <tille@handhelds.org>
10 10
11#include "listviewitemconfigentry.h" 11#include "listviewitemconfigentry.h"
12#include "listviewitemconffile.h"
13#include <qtextstream.h> 12#include <qtextstream.h>
14 13
15ListViewItemConfigEntry::ListViewItemConfigEntry(ListViewItemConfFile *parent, QString group, QString key) 14ListViewItemConfigEntry::ListViewItemConfigEntry(ListViewItemConfFile *parent, QString group, QString key)
16 : ListViewItemConf(parent) 15 : ListViewItemConf(parent)
17{ 16{
18 _fileItem = parent; 17 _fileItem = parent;
19 _file = parent->fileName(); 18 _file = parent->fileName();
20 _group = group; 19 _group = group;
21 setKey(key); 20 setKey(key);
22 _groupOrig = group; 21 _groupOrig = group;
23 _keyOrig = _key; 22 _keyOrig = _key;
24 _valueOrig = _value; 23 _valueOrig = _value;
25} 24}
26 25
27ListViewItemConfigEntry::~ListViewItemConfigEntry() 26ListViewItemConfigEntry::~ListViewItemConfigEntry()
28{ 27{
29} 28}
30 29
31bool ListViewItemConfigEntry::isGroup() 30bool ListViewItemConfigEntry::isGroup()
32{ 31{
33 return _key.isEmpty(); 32 return _key.isEmpty();
34} 33}
35 34
36bool ListViewItemConfigEntry::isKey() 35bool ListViewItemConfigEntry::isKey()
37{ 36{
38 return !_key.isEmpty(); 37 return !_key.isEmpty();
39} 38}
40 39
41QString ListViewItemConfigEntry::getFile() 40QString ListViewItemConfigEntry::getFile()
42{ 41{
43 return _file; 42 return _file;
44} 43}
45 44
46void ListViewItemConfigEntry::setGroup(QString g) 45void ListViewItemConfigEntry::setGroup(QString g)
47{ 46{
48 if (g==_group) return; 47 if (g==_group) return;
49 _group = g; 48 _group = g;
50 changed(); 49 changed();
51} 50}
52 51
53QString ListViewItemConfigEntry::getGroup() 52QString ListViewItemConfigEntry::getGroup()
54{ 53{
55 return _group; 54 return _group;
56} 55}
57 56
58void ListViewItemConfigEntry::setKey(QString key) 57void ListViewItemConfigEntry::setKey(QString key)
59{ 58{
60 int pos = key.find("="); 59 int pos = key.find("=");
61 _key = key.left(pos).stripWhiteSpace(); 60 _key = key.left(pos).stripWhiteSpace();
62 _value = key.right(key.length() - pos - 1).stripWhiteSpace(); 61 _value = key.right(key.length() - pos - 1).stripWhiteSpace();
63 displayText(); 62 displayText();
64} 63}
65 64
66QString ListViewItemConfigEntry::getKey() 65QString ListViewItemConfigEntry::getKey()
67{ 66{
68 return _key; 67 return _key;
69} 68}
70 69
71QString ListViewItemConfigEntry::getValue() 70QString ListViewItemConfigEntry::getValue()
72{ 71{
73 return _value; 72 return _value;
74} 73}
75 74
76void ListViewItemConfigEntry::keyChanged(QString k) 75void ListViewItemConfigEntry::keyChanged(QString k)
diff --git a/noncore/apps/confedit/mainwindow.cpp b/noncore/apps/confedit/mainwindow.cpp
index 4fe45ba..5f7ad50 100644
--- a/noncore/apps/confedit/mainwindow.cpp
+++ b/noncore/apps/confedit/mainwindow.cpp
@@ -1,92 +1,83 @@
1/*************************************************************************** 1/***************************************************************************
2 * * 2 * *
3 * This program is free software; you can redistribute it and/or modify * 3 * This program is free software; you can redistribute it and/or modify *
4 * it under the terms of the GNU General Public License as published by * 4 * it under the terms of the GNU General Public License as published by *
5 * the Free Software Foundation; either version 2 of the License, or * 5 * the Free Software Foundation; either version 2 of the License, or *
6 * (at your option) any later version. * 6 * (at your option) any later version. *
7 * * 7 * *
8 ***************************************************************************/ 8 ***************************************************************************/
9 9
10// (c) 2002 Patrick S. Vogt <tille@handhelds.org> 10// (c) 2002 Patrick S. Vogt <tille@handhelds.org>
11 11
12 12
13#include "mainwindow.h" 13#include "mainwindow.h"
14 14
15#include <qaction.h>
16#include <qmessagebox.h>
17#include <qpopupmenu.h>
18#include <qtoolbutton.h>
19#include <qstring.h>
20#include <qlabel.h> 15#include <qlabel.h>
21#include <qfile.h>
22#include <qpushbutton.h>
23#include <qlayout.h> 16#include <qlayout.h>
24#include <qlineedit.h> 17#include <qlineedit.h>
25#include <qcursor.h>
26 18
27#include "listviewconfdir.h" 19#include "listviewconfdir.h"
28#include "listviewitemconf.h"
29#include "listviewitemconfigentry.h" 20#include "listviewitemconfigentry.h"
30 21
31 22
32MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : 23MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) :
33 QMainWindow( parent, name, f ), _currentItem(0), _fileItem(0) 24 QMainWindow( parent, name, f ), _currentItem(0), _fileItem(0)
34{ 25{
35 setCaption( tr("Conf File Editor") ); 26 setCaption( tr("Conf File Editor") );
36 27
37 //setBaseSize( qApp->globalStrut() ); 28 //setBaseSize( qApp->globalStrut() );
38 setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));//, sizePolicy().hasHeightForWidth() ) ); 29 setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));//, sizePolicy().hasHeightForWidth() ) );
39 30
40 mainLayout = new QVBoxLayout( this ); 31 mainLayout = new QVBoxLayout( this );
41 mainLayout->setSpacing( 0 ); 32 mainLayout->setSpacing( 0 );
42 mainLayout->setMargin( 0 ); 33 mainLayout->setMargin( 0 );
43 34
44 35
45 qDebug("creating settingList"); 36 qDebug("creating settingList");
46 settingList = new ListViewConfDir( QDir::homeDirPath() + "/Settings", this, "settingslist"); 37 settingList = new ListViewConfDir( QDir::homeDirPath() + "/Settings", this, "settingslist");
47 settingList->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));//, sizePolicy().hasHeightForWidth() ) ); 38 settingList->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));//, sizePolicy().hasHeightForWidth() ) );
48 mainLayout->addWidget( settingList, 0); 39 mainLayout->addWidget( settingList, 0);
49 40
50 qDebug("creating editor"); 41 qDebug("creating editor");
51 editor = new EditWidget(this); 42 editor = new EditWidget(this);
52 editor->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Maximum));//, sizePolicy().hasHeightForWidth() ) ); 43 editor->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Maximum));//, sizePolicy().hasHeightForWidth() ) );
53 mainLayout->addWidget( editor, 1 ); 44 mainLayout->addWidget( editor, 1 );
54 editor->layoutType( ListViewItemConf::File ); 45 editor->layoutType( ListViewItemConf::File );
55 46
56 makeMenu(); 47 makeMenu();
57 48
58 connect(settingList, SIGNAL( pressed(QListViewItem*) ), 49 connect(settingList, SIGNAL( pressed(QListViewItem*) ),
59 this, SLOT(setCurrent(QListViewItem*))); 50 this, SLOT(setCurrent(QListViewItem*)));
60 connect( settingList, SIGNAL( clicked( QListViewItem* ) ), 51 connect( settingList, SIGNAL( clicked( QListViewItem* ) ),
61 this, SLOT( stopTimer( QListViewItem* ) ) ); 52 this, SLOT( stopTimer( QListViewItem* ) ) );
62 53
63 connect( editor->LineEditGroup, SIGNAL( textChanged(const QString&) ), 54 connect( editor->LineEditGroup, SIGNAL( textChanged(const QString&) ),
64 SLOT( groupChanged(const QString&) ) ); 55 SLOT( groupChanged(const QString&) ) );
65 connect( editor->LineEditKey, SIGNAL( textChanged(const QString&) ), 56 connect( editor->LineEditKey, SIGNAL( textChanged(const QString&) ),
66 SLOT( keyChanged(const QString&) ) ); 57 SLOT( keyChanged(const QString&) ) );
67 connect( editor->LineEditValue, SIGNAL( textChanged(const QString&) ), 58 connect( editor->LineEditValue, SIGNAL( textChanged(const QString&) ),
68 SLOT( valueChanged(const QString&) ) ); 59 SLOT( valueChanged(const QString&) ) );
69 60
70 setCurrent(0); 61 setCurrent(0);
71 editor->layoutType(EditWidget::File); 62 editor->layoutType(EditWidget::File);
72} 63}
73 64
74void MainWindow::makeMenu() 65void MainWindow::makeMenu()
75{ 66{
76 popupTimer = new QTimer(this); 67 popupTimer = new QTimer(this);
77 popupMenuFile = new QPopupMenu(this); 68 popupMenuFile = new QPopupMenu(this);
78 popupMenuEntry = new QPopupMenu(this); 69 popupMenuEntry = new QPopupMenu(this);
79 70
80 popupActionSave = new QAction( tr("Save"),QString::null, 0, this, 0 ); 71 popupActionSave = new QAction( tr("Save"),QString::null, 0, this, 0 );
81 popupActionSave->addTo( popupMenuFile ); 72 popupActionSave->addTo( popupMenuFile );
82 // popupActionSave->addTo( popupMenuEntry ); 73 // popupActionSave->addTo( popupMenuEntry );
83 connect( popupActionSave, SIGNAL( activated() ), 74 connect( popupActionSave, SIGNAL( activated() ),
84 this , SLOT( saveConfFile() ) ); 75 this , SLOT( saveConfFile() ) );
85 76
86 popupActionRevert = new QAction( tr("Revert"),QString::null, 0, this, 0 ); 77 popupActionRevert = new QAction( tr("Revert"),QString::null, 0, this, 0 );
87 popupActionRevert->addTo( popupMenuFile ); 78 popupActionRevert->addTo( popupMenuFile );
88 popupActionRevert->addTo( popupMenuEntry ); 79 popupActionRevert->addTo( popupMenuEntry );
89 connect( popupActionRevert, SIGNAL( activated() ), 80 connect( popupActionRevert, SIGNAL( activated() ),
90 this , SLOT( revertConfFile() ) ); 81 this , SLOT( revertConfFile() ) );
91 82
92 popupActionDelete = new QAction( tr("Delete"),QString::null, 0, this, 0 ); 83 popupActionDelete = new QAction( tr("Delete"),QString::null, 0, this, 0 );
diff --git a/noncore/apps/keyz-cfg/main.cpp b/noncore/apps/keyz-cfg/main.cpp
index 264db20..55cc23e 100644
--- a/noncore/apps/keyz-cfg/main.cpp
+++ b/noncore/apps/keyz-cfg/main.cpp
@@ -1,24 +1,22 @@
1#include <stdio.h> 1#include <stdio.h>
2#include <qpe/qpeapplication.h> 2#include <qpe/qpeapplication.h>
3#include <qpe/qcopenvelope_qws.h>
4#include <qmainwindow.h> 3#include <qmainwindow.h>
5 4
6#include "cfgfile.h"
7#include "cfgdlg.h" 5#include "cfgdlg.h"
8 6
9int main( int argc, char **argv ) { 7int main( int argc, char **argv ) {
10 QPEApplication app(argc, argv); 8 QPEApplication app(argc, argv);
11 CfgFile cfile; 9 CfgFile cfile;
12 CfgParser cp; 10 CfgParser cp;
13 cp.load(QPEApplication::qpeDir()+"/share/zkb/zkb.xml", cfile); 11 cp.load(QPEApplication::qpeDir()+"/share/zkb/zkb.xml", cfile);
14 12
15 QMainWindow m; 13 QMainWindow m;
16 CfgDlg c(&m, &cfile, &app); 14 CfgDlg c(&m, &cfile, &app);
17 app.showMainWidget(&m); 15 app.showMainWidget(&m);
18 m.hide(); 16 m.hide();
19 c.showMaximized(); 17 c.showMaximized();
20 18
21 int ret = app.exec(); 19 int ret = app.exec();
22 20
23 return ret; 21 return ret;
24} 22}
diff --git a/noncore/apps/keyz-cfg/zkb.cpp b/noncore/apps/keyz-cfg/zkb.cpp
index abe1f5f..f315d4b 100644
--- a/noncore/apps/keyz-cfg/zkb.cpp
+++ b/noncore/apps/keyz-cfg/zkb.cpp
@@ -1,65 +1,64 @@
1#include <qnamespace.h>
2#include "zkb.h" 1#include "zkb.h"
3#include <stdio.h> 2#include <stdio.h>
4 3
5// Implementation of Action class 4// Implementation of Action class
6Action::Action():state(0), keycode(0), unicode(0), flags(0) { 5Action::Action():state(0), keycode(0), unicode(0), flags(0) {
7} 6}
8 7
9Action::Action(State* s, ushort kc, ushort uni, int f): 8Action::Action(State* s, ushort kc, ushort uni, int f):
10 state(s), keycode(kc), unicode(uni), flags(f) { 9 state(s), keycode(kc), unicode(uni), flags(f) {
11} 10}
12 11
13Action::~Action() { 12Action::~Action() {
14} 13}
15 14
16State* Action::getState() const { 15State* Action::getState() const {
17 return state; 16 return state;
18} 17}
19 18
20void Action::setState(State* s) { 19void Action::setState(State* s) {
21 state = s; 20 state = s;
22 setDefined(true); 21 setDefined(true);
23} 22}
24 23
25bool Action::hasEvent() const { 24bool Action::hasEvent() const {
26 return flags & Event; 25 return flags & Event;
27} 26}
28 27
29void Action::setEvent(bool e) { 28void Action::setEvent(bool e) {
30 flags = (flags & ~Event) | ((e) ? Event : 0); 29 flags = (flags & ~Event) | ((e) ? Event : 0);
31 30
32 if (e) { 31 if (e) {
33 setDefined(true); 32 setDefined(true);
34 } else { 33 } else {
35 if (state == 0) { 34 if (state == 0) {
36 setDefined(false); 35 setDefined(false);
37 } 36 }
38 } 37 }
39} 38}
40 39
41bool Action::isDefined() const { 40bool Action::isDefined() const {
42 return flags & Defined; 41 return flags & Defined;
43} 42}
44 43
45void Action::setDefined(bool d) { 44void Action::setDefined(bool d) {
46 flags = (flags & ~Defined) | ((d) ? Defined : 0); 45 flags = (flags & ~Defined) | ((d) ? Defined : 0);
47} 46}
48 47
49int Action::getKeycode() const { 48int Action::getKeycode() const {
50 return keycode; 49 return keycode;
51} 50}
52 51
53void Action::setKeycode(int c) { 52void Action::setKeycode(int c) {
54 keycode = (ushort) c; 53 keycode = (ushort) c;
55 setEvent(true); 54 setEvent(true);
56} 55}
57 56
58int Action::getUnicode() const { 57int Action::getUnicode() const {
59 return unicode; 58 return unicode;
60} 59}
61 60
62void Action::setUnicode(int u) { 61void Action::setUnicode(int u) {
63 unicode = (ushort) u; 62 unicode = (ushort) u;
64 setEvent(true); 63 setEvent(true);
65} 64}
diff --git a/noncore/apps/keyz-cfg/zkbnames.cpp b/noncore/apps/keyz-cfg/zkbnames.cpp
index c20a114..b2180ba 100644
--- a/noncore/apps/keyz-cfg/zkbnames.cpp
+++ b/noncore/apps/keyz-cfg/zkbnames.cpp
@@ -1,66 +1,65 @@
1#include <qmap.h> 1#include <qmap.h>
2#include <qstring.h>
3 2
4#include "zkbnames.h" 3#include "zkbnames.h"
5 4
6QString Null_String((const char*) 0); 5QString Null_String((const char*) 0);
7 6
8// Implementation of KeyNames 7// Implementation of KeyNames
9static struct { 8static struct {
10 int key; 9 int key;
11 char *name; 10 char *name;
12} Key_Names[] = { 11} Key_Names[] = {
13 { 32, "Space" }, 12 { 32, "Space" },
14 { 39, "Apostrophe" }, 13 { 39, "Apostrophe" },
15 { 44, "Comma" }, 14 { 44, "Comma" },
16 { 46, "Period" }, 15 { 46, "Period" },
17 { 47, "Slash" }, 16 { 47, "Slash" },
18 { 65, "A" }, 17 { 65, "A" },
19 { 66, "B" }, 18 { 66, "B" },
20 { 67, "C" }, 19 { 67, "C" },
21 { 68, "D" }, 20 { 68, "D" },
22 { 69, "E" }, 21 { 69, "E" },
23 { 70, "F" }, 22 { 70, "F" },
24 { 71, "G" }, 23 { 71, "G" },
25 { 72, "H" }, 24 { 72, "H" },
26 { 73, "I" }, 25 { 73, "I" },
27 { 74, "J" }, 26 { 74, "J" },
28 { 75, "K" }, 27 { 75, "K" },
29 { 76, "L" }, 28 { 76, "L" },
30 { 77, "M" }, 29 { 77, "M" },
31 { 78, "N" }, 30 { 78, "N" },
32 { 79, "O" }, 31 { 79, "O" },
33 { 80, "P" }, 32 { 80, "P" },
34 { 81, "Q" }, 33 { 81, "Q" },
35 { 82, "R" }, 34 { 82, "R" },
36 { 83, "S" }, 35 { 83, "S" },
37 { 84, "T" }, 36 { 84, "T" },
38 { 85, "U" }, 37 { 85, "U" },
39 { 86, "V" }, 38 { 86, "V" },
40 { 87, "W" }, 39 { 87, "W" },
41 { 88, "X" }, 40 { 88, "X" },
42 { 89, "Y" }, 41 { 89, "Y" },
43 { 90, "Z" }, 42 { 90, "Z" },
44 { 4096, "Cancel" }, 43 { 4096, "Cancel" },
45 { 4097, "Tab" }, 44 { 4097, "Tab" },
46 { 4099, "Backspace" }, 45 { 4099, "Backspace" },
47 { 4100, "Enter" }, 46 { 4100, "Enter" },
48 { 4114, "Left" }, 47 { 4114, "Left" },
49 { 4115, "Up" }, 48 { 4115, "Up" },
50 { 4116, "Right" }, 49 { 4116, "Right" },
51 { 4117, "Down" }, 50 { 4117, "Down" },
52 { 4128, "Left Shift" }, 51 { 4128, "Left Shift" },
53 { 4130, "Right Shift" }, 52 { 4130, "Right Shift" },
54 { 4152, "Calendar" }, 53 { 4152, "Calendar" },
55 { 4153, "Addressbook" }, 54 { 4153, "Addressbook" },
56 { 4154, "Menu" }, 55 { 4154, "Menu" },
57 { 4155, "Home" }, 56 { 4155, "Home" },
58 { 4156, "Mail" }, 57 { 4156, "Mail" },
59 { 4165, "Fn" }, 58 { 4165, "Fn" },
60 { 4173, "Middle" }, 59 { 4173, "Middle" },
61 { 4176, "OK" }, 60 { 4176, "OK" },
62 { 4177, "Off" }, 61 { 4177, "Off" },
63 { 4178, "Light" }, 62 { 4178, "Light" },
64 { 0, 0 } 63 { 0, 0 }
65}; 64};
66 65
diff --git a/noncore/apps/opie-bartender/bac.cpp b/noncore/apps/opie-bartender/bac.cpp
index ac8a83e..c97a253 100644
--- a/noncore/apps/opie-bartender/bac.cpp
+++ b/noncore/apps/opie-bartender/bac.cpp
@@ -1,86 +1,83 @@
1/**************************************************************************** 1/****************************************************************************
2** 2**
3** Created: Sun Jul 21 19:00:14 2002 3** Created: Sun Jul 21 19:00:14 2002
4** by: L.J. Potter <ljp@llornkcor.com> 4** by: L.J. Potter <ljp@llornkcor.com>
5** copyright : (C) 2002 by ljp 5** copyright : (C) 2002 by ljp
6 email : ljp@llornkcor.com 6 email : ljp@llornkcor.com
7 * This program is free software; you can redistribute it and/or modify * 7 * This program is free software; you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by * 8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation; either version 2 of the License, or * 9 * the Free Software Foundation; either version 2 of the License, or *
10 * (at your option) any later version. * 10 * (at your option) any later version. *
11 ***************************************************************************/ 11 ***************************************************************************/
12#include "bac.h" 12#include "bac.h"
13 13
14#include <qcombobox.h> 14#include <qcombobox.h>
15#include <qlabel.h> 15#include <qlabel.h>
16#include <qlcdnumber.h> 16#include <qlcdnumber.h>
17#include <qpushbutton.h> 17#include <qpushbutton.h>
18#include <qspinbox.h> 18#include <qspinbox.h>
19#include <qlayout.h> 19#include <qlayout.h>
20#include <qvariant.h>
21#include <qtooltip.h>
22#include <qwhatsthis.h>
23BacDialog::BacDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) 20BacDialog::BacDialog( QWidget* parent, const char* name, bool modal, WFlags fl )
24 : QDialog( parent, name, modal, fl ) 21 : QDialog( parent, name, modal, fl )
25{ 22{
26 if ( !name ) 23 if ( !name )
27 setName( "BacDialog" ); 24 setName( "BacDialog" );
28 setCaption( tr( "Blood Alcohol Estimator" ) ); 25 setCaption( tr( "Blood Alcohol Estimator" ) );
29 26
30 Layout7 = new QVBoxLayout( this); 27 Layout7 = new QVBoxLayout( this);
31 Layout7->setSpacing( 6 ); 28 Layout7->setSpacing( 6 );
32 Layout7->setMargin( 0 ); 29 Layout7->setMargin( 0 );
33 30
34 Layout1 = new QHBoxLayout; 31 Layout1 = new QHBoxLayout;
35 Layout1->setSpacing( 6 ); 32 Layout1->setSpacing( 6 );
36 Layout1->setMargin( 0 ); 33 Layout1->setMargin( 0 );
37 34
38 NumberSpinBox = new QSpinBox( this, "NumberSpinBox" ); 35 NumberSpinBox = new QSpinBox( this, "NumberSpinBox" );
39 Layout1->addWidget( NumberSpinBox ); 36 Layout1->addWidget( NumberSpinBox );
40 37
41 TextLabel1 = new QLabel(this, "TextLabel1" ); 38 TextLabel1 = new QLabel(this, "TextLabel1" );
42 TextLabel1->setText( tr( "Number of Drinks Consumed" ) ); 39 TextLabel1->setText( tr( "Number of Drinks Consumed" ) );
43 Layout1->addWidget( TextLabel1 ); 40 Layout1->addWidget( TextLabel1 );
44 Layout7->addLayout( Layout1 ); 41 Layout7->addLayout( Layout1 );
45 42
46 Layout2 = new QHBoxLayout; 43 Layout2 = new QHBoxLayout;
47 Layout2->setSpacing( 6 ); 44 Layout2->setSpacing( 6 );
48 Layout2->setMargin( 0 ); 45 Layout2->setMargin( 0 );
49 46
50 WeightSpinBox = new QSpinBox( this, "WeightSpinBox" ); 47 WeightSpinBox = new QSpinBox( this, "WeightSpinBox" );
51 Layout2->addWidget( WeightSpinBox ); 48 Layout2->addWidget( WeightSpinBox );
52 WeightSpinBox->setMaxValue(500); 49 WeightSpinBox->setMaxValue(500);
53 50
54 TextLabel2 = new QLabel( this, "TextLabel2" ); 51 TextLabel2 = new QLabel( this, "TextLabel2" );
55 TextLabel2->setText( tr( "Weight" ) ); 52 TextLabel2->setText( tr( "Weight" ) );
56 Layout2->addWidget( TextLabel2 ); 53 Layout2->addWidget( TextLabel2 );
57 Layout7->addLayout( Layout2 ); 54 Layout7->addLayout( Layout2 );
58 55
59 Layout3 = new QHBoxLayout; 56 Layout3 = new QHBoxLayout;
60 Layout3->setSpacing( 6 ); 57 Layout3->setSpacing( 6 );
61 Layout3->setMargin( 0 ); 58 Layout3->setMargin( 0 );
62 59
63 TimeSpinBox = new QSpinBox( this, "TimeSpinBox" ); 60 TimeSpinBox = new QSpinBox( this, "TimeSpinBox" );
64 Layout3->addWidget( TimeSpinBox ); 61 Layout3->addWidget( TimeSpinBox );
65 TimeSpinBox->setMaxValue(24); 62 TimeSpinBox->setMaxValue(24);
66 63
67 TextLabel3 = new QLabel( this, "TextLabel3" ); 64 TextLabel3 = new QLabel( this, "TextLabel3" );
68 TextLabel3->setText( tr( "Period of Time (hours)" ) ); 65 TextLabel3->setText( tr( "Period of Time (hours)" ) );
69 Layout3->addWidget( TextLabel3 ); 66 Layout3->addWidget( TextLabel3 );
70 Layout7->addLayout( Layout3 ); 67 Layout7->addLayout( Layout3 );
71 68
72 Layout4 = new QHBoxLayout; 69 Layout4 = new QHBoxLayout;
73 Layout4->setSpacing( 6 ); 70 Layout4->setSpacing( 6 );
74 Layout4->setMargin( 0 ); 71 Layout4->setMargin( 0 );
75 72
76 GenderComboBox = new QComboBox( FALSE, this, "GenderComboBox" ); 73 GenderComboBox = new QComboBox( FALSE, this, "GenderComboBox" );
77 GenderComboBox->insertItem( tr( "Male" ) ); 74 GenderComboBox->insertItem( tr( "Male" ) );
78 GenderComboBox->insertItem( tr( "Female" ) ); 75 GenderComboBox->insertItem( tr( "Female" ) );
79 GenderComboBox->insertItem( tr( "Unknown" ) ); 76 GenderComboBox->insertItem( tr( "Unknown" ) );
80 Layout4->addWidget( GenderComboBox ); 77 Layout4->addWidget( GenderComboBox );
81 78
82 TextLabel4 = new QLabel( this, "TextLabel4" ); 79 TextLabel4 = new QLabel( this, "TextLabel4" );
83 TextLabel4->setText( tr( "Gender" ) ); 80 TextLabel4->setText( tr( "Gender" ) );
84 Layout4->addWidget( TextLabel4 ); 81 Layout4->addWidget( TextLabel4 );
85 Layout7->addLayout( Layout4 ); 82 Layout7->addLayout( Layout4 );
86 83
diff --git a/noncore/apps/opie-bartender/bartender.cpp b/noncore/apps/opie-bartender/bartender.cpp
index 740478f..3c010e9 100644
--- a/noncore/apps/opie-bartender/bartender.cpp
+++ b/noncore/apps/opie-bartender/bartender.cpp
@@ -1,110 +1,99 @@
1/**************************************************************************** 1/****************************************************************************
2** 2**
3** Created: Sat Jul 20 08:10:53 2002 3** Created: Sat Jul 20 08:10:53 2002
4** by: L.J. Potter <ljp@llornkcor.com> 4** by: L.J. Potter <ljp@llornkcor.com>
5** copyright : (C) 2002 by ljp 5** copyright : (C) 2002 by ljp
6 email : ljp@llornkcor.com 6 email : ljp@llornkcor.com
7 * This program is free software; you can redistribute it and/or modify * 7 * This program is free software; you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by * 8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation; either version 2 of the License, or * 9 * the Free Software Foundation; either version 2 of the License, or *
10 * (at your option) any later version. * 10 * (at your option) any later version. *
11 ***************************************************************************/ 11 ***************************************************************************/
12 12
13#include "bartender.h" 13#include "bartender.h"
14#include "newdrinks.h"
15#include "showdrinks.h" 14#include "showdrinks.h"
16#include "inputDialog.h" 15#include "inputDialog.h"
17#include "searchresults.h" 16#include "searchresults.h"
18#include "bac.h" 17#include "bac.h"
19 18
20#include <qpe/qpetoolbar.h> 19#include <qpe/qpetoolbar.h>
21#include <qmenubar.h> 20#include <qmenubar.h>
22//#include <opie2/colorpopupmenu.h> 21//#include <opie2/colorpopupmenu.h>
23#include <qpe/qpeapplication.h> 22#include <qpe/qpeapplication.h>
24#include <qpe/resource.h> 23#include <qpe/resource.h>
25 24
26#include <qcstring.h>
27#include <qlineedit.h> 25#include <qlineedit.h>
28#include <qdir.h> 26#include <qdir.h>
29#include <qpushbutton.h> 27#include <qpushbutton.h>
30#include <qlistbox.h> 28#include <qlistbox.h>
31#include <qstringlist.h>
32#include <qmultilineedit.h> 29#include <qmultilineedit.h>
33#include <qmessagebox.h> 30#include <qmessagebox.h>
34#include <qfile.h>
35#include <qtextstream.h> 31#include <qtextstream.h>
36#include <qfile.h>
37#include <qaction.h> 32#include <qaction.h>
38#include <qheader.h> 33#include <qheader.h>
39#include <qlistview.h> 34#include <qlistview.h>
40#include <qwidget.h>
41#include <qlayout.h> 35#include <qlayout.h>
42#include <qvariant.h>
43#include <qtooltip.h>
44#include <qwhatsthis.h>
45#include <qimage.h>
46#include <qpixmap.h>
47 36
48#include <fcntl.h> 37#include <fcntl.h>
49#include <unistd.h> 38#include <unistd.h>
50#include <stdlib.h> 39#include <stdlib.h>
51#include <stdio.h> 40#include <stdio.h>
52#include <errno.h> 41#include <errno.h>
53 42
54 43
55Bartender::Bartender( QWidget* parent, const char* name, WFlags fl ) 44Bartender::Bartender( QWidget* parent, const char* name, WFlags fl )
56 : QMainWindow( parent, name, fl ) { 45 : QMainWindow( parent, name, fl ) {
57 if ( !name ) 46 if ( !name )
58 setName( "Bartender" ); 47 setName( "Bartender" );
59 QGridLayout *layout = new QGridLayout( this ); 48 QGridLayout *layout = new QGridLayout( this );
60 layout->setSpacing( 2); 49 layout->setSpacing( 2);
61 layout->setMargin( 2); 50 layout->setMargin( 2);
62 connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); 51 connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) );
63 52
64 setCaption( tr( "Bartender" ) ); 53 setCaption( tr( "Bartender" ) );
65 54
66 ToolBar1 = new QToolBar( this, "ToolBar1" ); 55 ToolBar1 = new QToolBar( this, "ToolBar1" );
67 ToolBar1->setFixedHeight(22); 56 ToolBar1->setFixedHeight(22);
68 layout->addMultiCellWidget( ToolBar1, 0, 0, 0, 4 ); 57 layout->addMultiCellWidget( ToolBar1, 0, 0, 0, 4 );
69 58
70 QMenuBar *menuBar = new QMenuBar( ToolBar1 ); 59 QMenuBar *menuBar = new QMenuBar( ToolBar1 );
71 QPopupMenu *fileMenu; 60 QPopupMenu *fileMenu;
72 fileMenu = new QPopupMenu( this); 61 fileMenu = new QPopupMenu( this);
73 menuBar->insertItem( tr("File"), fileMenu ); 62 menuBar->insertItem( tr("File"), fileMenu );
74 63
75 fileMenu->insertItem(tr("New Drink")); 64 fileMenu->insertItem(tr("New Drink"));
76 fileMenu->insertItem(tr("Open Drink")); 65 fileMenu->insertItem(tr("Open Drink"));
77 fileMenu->insertItem(tr("Find by Drink Name")); 66 fileMenu->insertItem(tr("Find by Drink Name"));
78 fileMenu->insertItem(tr("Find by Alcohol")); 67 fileMenu->insertItem(tr("Find by Alcohol"));
79 68
80 QPopupMenu *editMenu; 69 QPopupMenu *editMenu;
81 editMenu = new QPopupMenu( this); 70 editMenu = new QPopupMenu( this);
82 menuBar->insertItem( tr("Edit"), editMenu ); 71 menuBar->insertItem( tr("Edit"), editMenu );
83 editMenu->insertItem(tr("edit")); 72 editMenu->insertItem(tr("edit"));
84 73
85 connect( fileMenu, SIGNAL( activated(int) ), this, SLOT( fileMenuActivated(int) )); 74 connect( fileMenu, SIGNAL( activated(int) ), this, SLOT( fileMenuActivated(int) ));
86 connect( editMenu, SIGNAL( activated(int) ), this, SLOT( editMenuActivated(int) )); 75 connect( editMenu, SIGNAL( activated(int) ), this, SLOT( editMenuActivated(int) ));
87 76
88 77
89 QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), "New", 0, this, 0 ); 78 QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), "New", 0, this, 0 );
90 connect( a, SIGNAL( activated() ), this, SLOT( fileNew() ) ); 79 connect( a, SIGNAL( activated() ), this, SLOT( fileNew() ) );
91 a->addTo( ToolBar1 ); 80 a->addTo( ToolBar1 );
92 81
93 a = new QAction( tr( "Open" ), Resource::loadPixmap( "bartender/bartender_sm" ), "open", 0, this, 0 ); 82 a = new QAction( tr( "Open" ), Resource::loadPixmap( "bartender/bartender_sm" ), "open", 0, this, 0 );
94 connect( a, SIGNAL( activated() ), this, SLOT( openCurrentDrink() ) ); 83 connect( a, SIGNAL( activated() ), this, SLOT( openCurrentDrink() ) );
95 a->addTo( ToolBar1 ); 84 a->addTo( ToolBar1 );
96 85
97 a = new QAction( tr( "Find" ), Resource::loadPixmap( "find" ), "Find", 0, this, 0 ); 86 a = new QAction( tr( "Find" ), Resource::loadPixmap( "find" ), "Find", 0, this, 0 );
98 connect( a, SIGNAL( activated() ), this, SLOT( askSearch() ) ); 87 connect( a, SIGNAL( activated() ), this, SLOT( askSearch() ) );
99 a->addTo( ToolBar1 ); 88 a->addTo( ToolBar1 );
100 89
101 a = new QAction( tr( "Edit" ), Resource::loadPixmap( "edit" ),"Edit", 0, this, 0 ); 90 a = new QAction( tr( "Edit" ), Resource::loadPixmap( "edit" ),"Edit", 0, this, 0 );
102 connect( a, SIGNAL( activated() ), this, SLOT( doEdit() ) ); 91 connect( a, SIGNAL( activated() ), this, SLOT( doEdit() ) );
103 a->addTo( ToolBar1 ); 92 a->addTo( ToolBar1 );
104 93
105 QPushButton *t; 94 QPushButton *t;
106 t= new QPushButton( "BAC", ToolBar1, "bacButtin"); 95 t= new QPushButton( "BAC", ToolBar1, "bacButtin");
107 connect( t, SIGNAL( clicked() ), this, SLOT( doBac() ) ); 96 connect( t, SIGNAL( clicked() ), this, SLOT( doBac() ) );
108 97
109 DrinkView = new QListView( this, "DrinkView" ); 98 DrinkView = new QListView( this, "DrinkView" );
110 DrinkView->addColumn( tr( "Name of Drink" ) ); 99 DrinkView->addColumn( tr( "Name of Drink" ) );
diff --git a/noncore/apps/opie-bartender/inputDialog.cpp b/noncore/apps/opie-bartender/inputDialog.cpp
index 4f4cb84..29643ff 100644
--- a/noncore/apps/opie-bartender/inputDialog.cpp
+++ b/noncore/apps/opie-bartender/inputDialog.cpp
@@ -1,47 +1,43 @@
1/**************************************************************************** 1/****************************************************************************
2 inputDialog.cpp 2 inputDialog.cpp
3 ------------------- 3 -------------------
4** Created: Sat Mar 9 23:33:09 2002 4** Created: Sat Mar 9 23:33:09 2002
5 copyright : (C) 2002 by ljp 5 copyright : (C) 2002 by ljp
6 email : ljp@llornkcor.com 6 email : ljp@llornkcor.com
7** by: L.J. Potter <ljp@llornkcor.com> 7** by: L.J. Potter <ljp@llornkcor.com>
8** copyright : (C) 2002 by ljp 8** copyright : (C) 2002 by ljp
9 email : ljp@llornkcor.com 9 email : ljp@llornkcor.com
10 * This program is free software; you can redistribute it and/or modify * 10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by * 11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or * 12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. * 13 * (at your option) any later version. *
14 ***************************************************************************/ 14 ***************************************************************************/
15 15
16#include "inputDialog.h" 16#include "inputDialog.h"
17 17
18#include <qlineedit.h> 18#include <qlineedit.h>
19#include <qlayout.h>
20#include <qvariant.h>
21#include <qtooltip.h>
22#include <qwhatsthis.h>
23 19
24 20
25InputDialog::InputDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) 21InputDialog::InputDialog( QWidget* parent, const char* name, bool modal, WFlags fl )
26 : QDialog( parent, name, modal, fl ) 22 : QDialog( parent, name, modal, fl )
27{ 23{
28 if ( !name ) 24 if ( !name )
29 setName( "InputDialog" ); 25 setName( "InputDialog" );
30 resize( 234, 50 ); 26 resize( 234, 50 );
31 setMaximumSize( QSize( 240, 50 ) ); 27 setMaximumSize( QSize( 240, 50 ) );
32 setCaption( tr(name ) ); 28 setCaption( tr(name ) );
33 29
34 LineEdit1 = new QLineEdit( this, "LineEdit1" ); 30 LineEdit1 = new QLineEdit( this, "LineEdit1" );
35 LineEdit1->setGeometry( QRect( 10, 10, 216, 22 ) ); 31 LineEdit1->setGeometry( QRect( 10, 10, 216, 22 ) );
36} 32}
37 33
38InputDialog::~InputDialog() 34InputDialog::~InputDialog()
39{ 35{
40 inputText = LineEdit1->text(); 36 inputText = LineEdit1->text();
41 37
42} 38}
43 39
44void InputDialog::setInputText(const QString &string) 40void InputDialog::setInputText(const QString &string)
45{ 41{
46LineEdit1->setText( string); 42LineEdit1->setText( string);
47} 43}
diff --git a/noncore/apps/opie-bartender/newdrinks.cpp b/noncore/apps/opie-bartender/newdrinks.cpp
index 86bcc3c..a7ada3a 100644
--- a/noncore/apps/opie-bartender/newdrinks.cpp
+++ b/noncore/apps/opie-bartender/newdrinks.cpp
@@ -1,67 +1,60 @@
1/**************************************************************************** 1/****************************************************************************
2** Created: Sat Jul 20 08:23:27 2002 2** Created: Sat Jul 20 08:23:27 2002
3** by: L.J. Potter <ljp@llornkcor.com> 3** by: L.J. Potter <ljp@llornkcor.com>
4** copyright : (C) 2002 by ljp 4** copyright : (C) 2002 by ljp
5 email : ljp@llornkcor.com 5 email : ljp@llornkcor.com
6 * This program is free software; you can redistribute it and/or modify * 6 * This program is free software; you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by * 7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation; either version 2 of the License, or * 8 * the Free Software Foundation; either version 2 of the License, or *
9 * (at your option) any later version. * 9 * (at your option) any later version. *
10 ***************************************************************************/ 10 ***************************************************************************/
11#include "newdrinks.h" 11#include "newdrinks.h"
12 12
13#include <qpe/resource.h>
14 13
15#include <qaction.h>
16#include <qlabel.h> 14#include <qlabel.h>
17#include <qlineedit.h> 15#include <qlineedit.h>
18#include <qmultilineedit.h> 16#include <qmultilineedit.h>
19#include <qpushbutton.h>
20#include <qwidget.h>
21#include <qlayout.h> 17#include <qlayout.h>
22#include <qvariant.h>
23#include <qtooltip.h>
24#include <qwhatsthis.h>
25 18
26New_Drink::New_Drink( QWidget* parent, const char* name, bool modal, WFlags fl ) 19New_Drink::New_Drink( QWidget* parent, const char* name, bool modal, WFlags fl )
27 : QDialog( parent, name, modal, fl ) 20 : QDialog( parent, name, modal, fl )
28{ 21{
29 QString drinkName = name; 22 QString drinkName = name;
30 if ( !name ) 23 if ( !name )
31 setName( drinkName ); 24 setName( drinkName );
32 setCaption( drinkName); 25 setCaption( drinkName);
33 26
34 Layout5 = new QGridLayout( this); 27 Layout5 = new QGridLayout( this);
35 Layout5->setSpacing( 6 ); 28 Layout5->setSpacing( 6 );
36 Layout5->setMargin( 4 ); 29 Layout5->setMargin( 4 );
37 30
38// Layout4 = new QHBoxLayout; 31// Layout4 = new QHBoxLayout;
39// Layout4->setSpacing( 6 ); 32// Layout4->setSpacing( 6 );
40// Layout4->setMargin( 4 ); 33// Layout4->setMargin( 4 );
41 34
42 TextLabel1 = new QLabel( this, "TextLabel1" ); 35 TextLabel1 = new QLabel( this, "TextLabel1" );
43 TextLabel1->setText( tr( "Name" ) ); 36 TextLabel1->setText( tr( "Name" ) );
44 Layout5->addMultiCellWidget( TextLabel1, 0, 0, 0, 0); 37 Layout5->addMultiCellWidget( TextLabel1, 0, 0, 0, 0);
45 38
46 LineEdit1 = new QLineEdit( this, "LineEdit1" ); 39 LineEdit1 = new QLineEdit( this, "LineEdit1" );
47 Layout5->addMultiCellWidget( LineEdit1, 0, 0, 1, 2); 40 Layout5->addMultiCellWidget( LineEdit1, 0, 0, 1, 2);
48 41
49 42
50 TextLabel2 = new QLabel( this, "TextLabel2" ); 43 TextLabel2 = new QLabel( this, "TextLabel2" );
51 TextLabel2->setText( tr( "Ingredients" ) ); 44 TextLabel2->setText( tr( "Ingredients" ) );
52 45
53 Layout5->addMultiCellWidget( TextLabel2, 1, 1, 0, 0); 46 Layout5->addMultiCellWidget( TextLabel2, 1, 1, 0, 0);
54 47
55 MultiLineEdit1 = new QMultiLineEdit( this, "MultiLineEdit1" ); 48 MultiLineEdit1 = new QMultiLineEdit( this, "MultiLineEdit1" );
56 49
57 Layout5->addMultiCellWidget( MultiLineEdit1, 2, 2, 0, 2); 50 Layout5->addMultiCellWidget( MultiLineEdit1, 2, 2, 0, 2);
58} 51}
59 52
60/* 53/*
61 * Destroys the object and frees any allocated resources 54 * Destroys the object and frees any allocated resources
62 */ 55 */
63New_Drink::~New_Drink() 56New_Drink::~New_Drink()
64{ 57{
65 // no need to delete child widgets, Qt does it all for us 58 // no need to delete child widgets, Qt does it all for us
66} 59}
67 60
diff --git a/noncore/apps/opie-bartender/searchresults.cpp b/noncore/apps/opie-bartender/searchresults.cpp
index 1a82c6c..4900d1f 100644
--- a/noncore/apps/opie-bartender/searchresults.cpp
+++ b/noncore/apps/opie-bartender/searchresults.cpp
@@ -1,52 +1,43 @@
1/**************************************************************************** 1/****************************************************************************
2** Created: Sat Jul 20 08:23:27 2002 2** Created: Sat Jul 20 08:23:27 2002
3** by: L.J. Potter <ljp@llornkcor.com> 3** by: L.J. Potter <ljp@llornkcor.com>
4** copyright : (C) 2002 by ljp 4** copyright : (C) 2002 by ljp
5 email : ljp@llornkcor.com 5 email : ljp@llornkcor.com
6 * This program is free software; you can redistribute it and/or modify * 6 * This program is free software; you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by * 7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation; either version 2 of the License, or * 8 * the Free Software Foundation; either version 2 of the License, or *
9 * (at your option) any later version. * 9 * (at your option) any later version. *
10 ***************************************************************************/ 10 ***************************************************************************/
11#include "searchresults.h" 11#include "searchresults.h"
12 12
13#include <qpe/resource.h>
14 13
15#include <qaction.h>
16#include <qlabel.h>
17#include <qlineedit.h>
18#include <qlistbox.h> 14#include <qlistbox.h>
19#include <qpushbutton.h>
20#include <qwidget.h>
21#include <qlayout.h> 15#include <qlayout.h>
22#include <qvariant.h>
23#include <qtooltip.h>
24#include <qwhatsthis.h>
25 16
26Search_Results::Search_Results( QWidget* parent, const char* name, bool modal, WFlags fl ) 17Search_Results::Search_Results( QWidget* parent, const char* name, bool modal, WFlags fl )
27 : QDialog( parent, name, modal, fl ) { 18 : QDialog( parent, name, modal, fl ) {
28 if ( !name ) 19 if ( !name )
29 setName( drinkName); 20 setName( drinkName);
30 21
31 drinkName = name; 22 drinkName = name;
32 setCaption( drinkName ); 23 setCaption( drinkName );
33 24
34 Layout5 = new QGridLayout( this ); 25 Layout5 = new QGridLayout( this );
35 Layout5->setSpacing( 6 ); 26 Layout5->setSpacing( 6 );
36 Layout5->setMargin( 4 ); 27 Layout5->setMargin( 4 );
37 28
38 ListBox1 = new QListBox( this, "ListBox1" ); 29 ListBox1 = new QListBox( this, "ListBox1" );
39 30
40 Layout5->addMultiCellWidget( ListBox1, 0, 1, 0, 3 ); 31 Layout5->addMultiCellWidget( ListBox1, 0, 1, 0, 3 );
41 connect( ListBox1, SIGNAL( clicked( QListBoxItem *)), SLOT( listSelected( QListBoxItem *)) ); 32 connect( ListBox1, SIGNAL( clicked( QListBoxItem *)), SLOT( listSelected( QListBoxItem *)) );
42} 33}
43 34
44Search_Results::~Search_Results() { 35Search_Results::~Search_Results() {
45} 36}
46 37
47 38
48void Search_Results::listSelected(QListBoxItem *) { 39void Search_Results::listSelected(QListBoxItem *) {
49 40
50 QDialog::accept(); 41 QDialog::accept();
51} 42}
52 43
diff --git a/noncore/apps/opie-bartender/showdrinks.cpp b/noncore/apps/opie-bartender/showdrinks.cpp
index 745f7db..dcfce16 100644
--- a/noncore/apps/opie-bartender/showdrinks.cpp
+++ b/noncore/apps/opie-bartender/showdrinks.cpp
@@ -1,56 +1,47 @@
1/**************************************************************************** 1/****************************************************************************
2** Created: Sat Jul 20 08:23:27 2002 2** Created: Sat Jul 20 08:23:27 2002
3** by: L.J. Potter <ljp@llornkcor.com> 3** by: L.J. Potter <ljp@llornkcor.com>
4** copyright : (C) 2002 by ljp 4** copyright : (C) 2002 by ljp
5 email : ljp@llornkcor.com 5 email : ljp@llornkcor.com
6 * This program is free software; you can redistribute it and/or modify * 6 * This program is free software; you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by * 7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation; either version 2 of the License, or * 8 * the Free Software Foundation; either version 2 of the License, or *
9 * (at your option) any later version. * 9 * (at your option) any later version. *
10 ***************************************************************************/ 10 ***************************************************************************/
11#include "showdrinks.h" 11#include "showdrinks.h"
12#include "bartender.h"
13 12
14#include <qpe/resource.h>
15 13
16#include <qaction.h>
17#include <qlabel.h>
18#include <qlineedit.h>
19#include <qmultilineedit.h> 14#include <qmultilineedit.h>
20#include <qpushbutton.h> 15#include <qpushbutton.h>
21#include <qwidget.h>
22#include <qlayout.h> 16#include <qlayout.h>
23#include <qvariant.h>
24#include <qtooltip.h>
25#include <qwhatsthis.h>
26 17
27//extern Bartender *bart; 18//extern Bartender *bart;
28 19
29Show_Drink::Show_Drink( QWidget* parent, const char* name, bool modal, WFlags fl ) 20Show_Drink::Show_Drink( QWidget* parent, const char* name, bool modal, WFlags fl )
30 : QDialog( parent, name, modal, fl ) { 21 : QDialog( parent, name, modal, fl ) {
31 if ( !name ) 22 if ( !name )
32 setName( drinkName); 23 setName( drinkName);
33 24
34 drinkName = name; 25 drinkName = name;
35 setCaption( drinkName ); 26 setCaption( drinkName );
36 27
37 Layout5 = new QGridLayout( this); 28 Layout5 = new QGridLayout( this);
38 Layout5->setSpacing( 6 ); 29 Layout5->setSpacing( 6 );
39 Layout5->setMargin( 4 ); 30 Layout5->setMargin( 4 );
40 31
41 32
42 editDrinkButton = new QPushButton( tr("Edit"), this,"editBtn"); 33 editDrinkButton = new QPushButton( tr("Edit"), this,"editBtn");
43 Layout5->addMultiCellWidget( editDrinkButton, 0, 0, 0, 0 ); 34 Layout5->addMultiCellWidget( editDrinkButton, 0, 0, 0, 0 );
44 connect(editDrinkButton, SIGNAL(clicked()), this, SLOT(slotEditDrink())); 35 connect(editDrinkButton, SIGNAL(clicked()), this, SLOT(slotEditDrink()));
45 36
46 MultiLineEdit1 = new QMultiLineEdit( this, "MultiLineEdit1" ); 37 MultiLineEdit1 = new QMultiLineEdit( this, "MultiLineEdit1" );
47 MultiLineEdit1->setWordWrap(QMultiLineEdit::WidgetWidth); 38 MultiLineEdit1->setWordWrap(QMultiLineEdit::WidgetWidth);
48 Layout5->addMultiCellWidget( MultiLineEdit1, 1, 3, 0, 3 ); 39 Layout5->addMultiCellWidget( MultiLineEdit1, 1, 3, 0, 3 );
49} 40}
50 41
51Show_Drink::~Show_Drink() { 42Show_Drink::~Show_Drink() {
52} 43}
53 44
54void Show_Drink::slotEditDrink() { 45void Show_Drink::slotEditDrink() {
55 reject(); 46 reject();
56} 47}