summaryrefslogtreecommitdiff
authormickeyl <mickeyl>2003-10-27 19:51:32 (UTC)
committer mickeyl <mickeyl>2003-10-27 19:51:32 (UTC)
commit951d1d4125a80dc814f95d2956853bf53ca52e9a (patch) (unidiff)
tree46c7a70b80a7eebb54cd59c46204c28335f3821c
parentf0a15a9866f9eddfe10596e63a1e6300b92b9e3f (diff)
downloadopie-951d1d4125a80dc814f95d2956853bf53ca52e9a.zip
opie-951d1d4125a80dc814f95d2956853bf53ca52e9a.tar.gz
opie-951d1d4125a80dc814f95d2956853bf53ca52e9a.tar.bz2
merge noncore/apps/* except
- advancedfm (ljp, please...) - odict (tille, please...)
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/checkbook/cbinfo.cpp116
-rw-r--r--noncore/apps/checkbook/cbinfo.h24
-rw-r--r--noncore/apps/checkbook/cfg.cpp213
-rw-r--r--noncore/apps/checkbook/cfg.h120
-rw-r--r--noncore/apps/checkbook/checkbook.cpp228
-rw-r--r--noncore/apps/checkbook/checkbook.h32
-rw-r--r--noncore/apps/checkbook/checkbook.pro12
-rw-r--r--noncore/apps/checkbook/configuration.cpp107
-rw-r--r--noncore/apps/checkbook/configuration.h18
-rw-r--r--noncore/apps/checkbook/listedit.cpp340
-rw-r--r--noncore/apps/checkbook/listedit.h78
-rw-r--r--noncore/apps/checkbook/main.cpp14
-rw-r--r--noncore/apps/checkbook/mainwindow.cpp119
-rw-r--r--noncore/apps/checkbook/mainwindow.h15
-rw-r--r--noncore/apps/checkbook/tabledef.cpp76
-rw-r--r--noncore/apps/checkbook/tabledef.h99
-rw-r--r--noncore/apps/checkbook/traninfo.cpp54
-rw-r--r--noncore/apps/checkbook/traninfo.h17
-rw-r--r--noncore/apps/checkbook/transaction.cpp40
-rw-r--r--noncore/apps/checkbook/transaction.h6
-rw-r--r--noncore/apps/odict/main.cpp11
-rw-r--r--noncore/apps/odict/odict.cpp34
-rw-r--r--noncore/apps/odict/odict.h4
-rw-r--r--noncore/apps/odict/odict.pro5
-rw-r--r--noncore/apps/opie-console/opie-console.control2
-rw-r--r--noncore/apps/opie-reader/opie-reader.pro7
-rw-r--r--noncore/apps/opie-sheet/main.cpp10
-rw-r--r--noncore/apps/opie-sheet/mainwindow.cpp4
-rw-r--r--noncore/apps/opie-sheet/mainwindow.h3
-rw-r--r--noncore/apps/opie-sheet/opie-sheet.pro4
-rw-r--r--noncore/apps/opie-write/main.cpp13
-rw-r--r--noncore/apps/opie-write/mainwindow.cpp4
-rw-r--r--noncore/apps/opie-write/mainwindow.h4
-rw-r--r--noncore/apps/opie-write/opie-write.pro23
-rw-r--r--noncore/apps/oxygen/main.cpp11
-rw-r--r--noncore/apps/oxygen/oxygen.cpp6
-rw-r--r--noncore/apps/oxygen/oxygen.h15
-rw-r--r--noncore/apps/oxygen/oxygen.pro28
-rw-r--r--noncore/apps/tableviewer/main.cpp11
-rw-r--r--noncore/apps/tableviewer/tableviewer.h1
-rw-r--r--noncore/apps/tableviewer/tableviewer.pro4
-rw-r--r--noncore/apps/tinykate/main.cpp10
-rw-r--r--noncore/apps/tinykate/opie-tinykate.control2
-rw-r--r--noncore/apps/tinykate/tinykate.h2
-rw-r--r--noncore/apps/tinykate/tinykate.pro4
-rw-r--r--noncore/apps/zsafe/.cvsignore3
-rw-r--r--noncore/settings/aqpkg/.cvsignore1
-rw-r--r--noncore/settings/aqpkg/aqpkg.pro26
-rw-r--r--noncore/settings/aqpkg/main.cpp44
-rw-r--r--noncore/settings/aqpkg/mainwin.cpp31
-rw-r--r--noncore/settings/aqpkg/mainwin.h5
-rw-r--r--noncore/settings/sysinfo/main.cpp11
-rw-r--r--noncore/settings/sysinfo/storage.cpp27
-rw-r--r--noncore/settings/sysinfo/sysinfo.h1
-rw-r--r--noncore/settings/sysinfo/sysinfo.pro9
55 files changed, 1595 insertions, 513 deletions
diff --git a/noncore/apps/checkbook/cbinfo.cpp b/noncore/apps/checkbook/cbinfo.cpp
index 9fdc6b2..36dde04 100644
--- a/noncore/apps/checkbook/cbinfo.cpp
+++ b/noncore/apps/checkbook/cbinfo.cpp
@@ -24,171 +24,203 @@
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 "cbinfo.h" 29#include "cbinfo.h"
30#include "traninfo.h" 30#include "traninfo.h"
31 31
32#include <qpe/config.h> 32#include <qpe/config.h>
33 33
34#include <qfile.h> 34#include <qfile.h>
35 35
36// --- CBInfo -----------------------------------------------------------------
36CBInfo::CBInfo() 37CBInfo::CBInfo()
37{ 38{
38 n = ""; 39 n = "";
39 fn = ""; 40 fn = "";
40 pw = QString::null; 41 pw = QString::null;
41 t = ""; 42 t = "";
42 bn = ""; 43 bn = "";
43 a = ""; 44 a = "";
44 p = ""; 45 p = "";
45 nt = ""; 46 nt = "";
46 sb = 0.0; 47 sb = 0.0;
48 _sLastTab="";
49 _first=-1;
50 _last=-1;
47 51
48 tl = new TranInfoList(); 52 tl = new TranInfoList();
49} 53}
50 54
55
56// --- CBInfo -----------------------------------------------------------------
51CBInfo::CBInfo( const QString &name, const QString &filename ) 57CBInfo::CBInfo( const QString &name, const QString &filename )
52{ 58{
53 Config config( filename, Config::File ); 59 Config config( filename, Config::File );
54 config.setGroup( "Account" ); 60 config.setGroup( "Account" );
55 61
56 n = name; 62 n = name;
57 fn = filename; 63 fn = filename;
58 pw = config.readEntryCrypt( "Password", QString::null ); 64 pw = config.readEntryCrypt( "Password", QString::null );
59 65
60 t = config.readEntry( "Type" ); 66 t = config.readEntry( "Type" );
61 bn = config.readEntry( "Bank", "" ); 67 bn = config.readEntry( "Bank", "" );
62 a = config.readEntryCrypt( "Number", "" ); 68 a = config.readEntryCrypt( "Number", "" );
63 p = config.readEntryCrypt( "PINNumber", "" ); 69 p = config.readEntryCrypt( "PINNumber", "" );
64 nt = config.readEntry( "Notes", "" ); 70 nt = config.readEntry( "Notes", "" );
71 _sLastTab = config.readEntry("LastTab", "");
72 _first=config.readNumEntry("First", -1);
73 _sSortOrder = config.readEntry( "SortOrder", QWidget::tr("Date") );
65 74
66 bool ok; 75 bool ok;
67 sb = config.readEntry( "Balance", "0.0" ).toFloat( &ok ); 76 sb = config.readEntry( "Balance", "0.0" ).toFloat( &ok );
68 77
69 loadTransactions(); 78 loadTransactions();
70} 79}
71 80
81// --- balance ----------------------------------------------------------------
72float CBInfo::balance() 82float CBInfo::balance()
73{ 83{
74 calcBalance(); 84 calcBalance();
75 return b; 85 return b;
76} 86}
77 87
88// --- write ------------------------------------------------------------------
78void CBInfo::write() 89void CBInfo::write()
79{ 90{
80 QFile f( fn ); 91 QFile f( fn );
81 if ( f.exists() ) 92 if ( f.exists() )
82 {
83 f.remove(); 93 f.remove();
84 }
85 94
86 Config *config = new Config(fn, Config::File); 95 Config *config = new Config(fn, Config::File);
87 96
88 // Save info 97
98 // fix transaction numbers
99 _first=-1;
100 TranInfo *prev=NULL;
101 for ( TranInfo *tran = tl->first(); tran; tran = tl->next() ) {
102 if( _first<0 ) _first=tran->id();
103 if( prev ) prev->setNext( tran->id() );
104 tran->setNext(-1);
105 prev=tran;
106 }
107
108 // Save transactions
109 for ( TranInfo *tran = tl->first(); tran; tran = tl->next() ) {
110 tran->write(config);
111 }
112
113 // Save info
114 if( _first<0 && _last>=0 ) _first=_last;
89 config->setGroup( "Account" ); 115 config->setGroup( "Account" );
90 config->writeEntryCrypt( "Password", pw ); 116 config->writeEntryCrypt( "Password", pw );
91 config->writeEntry( "Type", t ); 117 config->writeEntry( "Type", t );
92 config->writeEntry( "Bank", bn ); 118 config->writeEntry( "Bank", bn );
93 config->writeEntryCrypt( "Number", a ); 119 config->writeEntryCrypt( "Number", a );
94 config->writeEntryCrypt( "PINNumber", p ); 120 config->writeEntryCrypt( "PINNumber", p );
95 config->writeEntry( "Notes", nt ); 121 config->writeEntry( "Notes", nt );
122 config->writeEntry( "LastTab", _sLastTab );
96 QString balstr; 123 QString balstr;
97 balstr.setNum( sb, 'f', 2 ); 124 balstr.setNum( sb, 'f', 2 );
98 config->writeEntry( "Balance", balstr ); 125 config->writeEntry( "Balance", balstr );
126 config->writeEntry( "First", _first );
127 config->writeEntry( "SortOrder", _sSortOrder );
99 128
100 // Save transactions 129 config->write();
101 int i = 1;
102 for ( TranInfo *tran = tl->first(); tran; tran = tl->next() )
103 {
104 tran->write( config, i );
105 i++;
106 }
107 config->write();
108
109 delete config; 130 delete config;
110} 131}
111 132
112TranInfo *CBInfo::findTransaction( const QString &checknum, const QString &date, 133
113 const QString &desc ) 134// --- findTransaction --------------------------------------------------------
135TranInfo *CBInfo::findTransaction( const QString &sId )
114{ 136{
115 TranInfo *traninfo = tl->first(); 137 bool bOk;
116 while ( traninfo ) 138 int id=sId.toInt( &bOk );
117 { 139 if( !bOk )
118 if ( traninfo->number() == checknum && traninfo->datestr() == date && 140 return(false);
119 traninfo->desc() == desc ) 141 TranInfo *traninfo;
120 break; 142 for(traninfo=tl->first(); traninfo; traninfo=tl->next()) {
121 traninfo = tl->next(); 143 if( traninfo->id() == id )
122 } 144 break;
123 return( traninfo ); 145 }
146 return(traninfo);
124} 147}
125 148
126void CBInfo::addTransaction( TranInfo *tran ) 149void CBInfo::addTransaction( TranInfo *tran )
127{ 150{
128 tl->inSort( tran ); 151 tl->append( tran );
129 calcBalance(); 152 calcBalance();
130} 153}
131 154
132void CBInfo::removeTransaction( TranInfo *tran ) 155void CBInfo::removeTransaction( TranInfo *tran )
133{ 156{
134 tl->remove( tran ); 157 tl->removeRef( tran );
135 delete tran; 158 delete tran;
136 calcBalance(); 159 calcBalance();
137} 160}
138 161
162
163// --- loadTransactions -------------------------------------------------------
164// Reads the transactions. Either the old way 1-n or as linked list.
139void CBInfo::loadTransactions() 165void CBInfo::loadTransactions()
140{ 166{
141 TranInfo *tran; 167 TranInfo *tran;
142 QString trandesc = ""; 168 QString trandesc = "";
143 169
144 tl = new TranInfoList(); 170 tl = new TranInfoList();
145 171
146 Config config( fn, Config::File ); 172 Config config( fn, Config::File );
147 173 int i=_first;
148 for ( int i = 1; trandesc != QString::null; i++ ) 174 bool bOld=false;
149 { 175 if( i==-1 ) {
150 tran = new TranInfo( config, i ); 176 i=1;
151 trandesc = tran->desc(); 177 bOld=true;
152 if ( trandesc != QString::null ) 178 }
153 { 179 while( i>=0 ) {
154 tl->inSort( tran ); 180 _last=i;
155 } 181 tran=new TranInfo(config, i);
156 else 182 trandesc = tran->desc();
157 { 183 if( trandesc==QString::null ) {
158 delete tran; 184 delete tran;
159 } 185 break;
160 } 186 }
161 187 tl->append(tran);
162 calcBalance(); 188 i= bOld ? i+1 : tran->getNext();
189 }
190
191 calcBalance();
163} 192}
164 193
194
195// --- calcBalance ------------------------------------------------------------
165void CBInfo::calcBalance() 196void CBInfo::calcBalance()
166{ 197{
167 float amount; 198 float amount;
168 199
169 b = sb; 200 b = sb;
170 201
171 for ( TranInfo *tran = tl->first(); tran; tran = tl->next() ) 202 for ( TranInfo *tran = tl->first(); tran; tran = tl->next() )
172 { 203 {
173 b -= tran->fee(); 204 b -= tran->fee();
174 amount = tran->amount(); 205 amount = tran->amount();
175 if ( tran->withdrawal() ) 206 if ( tran->withdrawal() )
176 { 207 {
177 amount *= -1; 208 amount *= -1;
178 } 209 }
179 b += amount; 210 b += amount;
180 } 211 }
181} 212}
182 213
214
183int CBInfoList::compareItems( QCollection::Item item1, QCollection::Item item2 ) 215int CBInfoList::compareItems( QCollection::Item item1, QCollection::Item item2 )
184{ 216{
185 QString n1 = ((CBInfo *)item1)->name(); 217 QString n1 = ((CBInfo *)item1)->name();
186 QString n2 = ((CBInfo *)item2)->name(); 218 QString n2 = ((CBInfo *)item2)->name();
187 int r = -1; 219 int r = -1;
188 220
189 if ( n1 < n2 ) 221 if ( n1 < n2 )
190 r = -1; 222 r = -1;
191 else if ( n1 == n2 ) 223 else if ( n1 == n2 )
192 r = 0; 224 r = 0;
193 else if ( n1 > n2 ) 225 else if ( n1 > n2 )
194 r = 1; 226 r = 1;
diff --git a/noncore/apps/checkbook/cbinfo.h b/noncore/apps/checkbook/cbinfo.h
index 5e65db2..0b5b818 100644
--- a/noncore/apps/checkbook/cbinfo.h
+++ b/noncore/apps/checkbook/cbinfo.h
@@ -20,24 +20,25 @@
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#ifndef CBINFO_H 29#ifndef CBINFO_H
30#define CBINFO_H 30#define CBINFO_H
31 31
32#include <qwidget.h>
32#include <qlist.h> 33#include <qlist.h>
33#include <qstring.h> 34#include <qstring.h>
34 35
35class Config; 36class Config;
36class TranInfo; 37class TranInfo;
37class TranInfoList; 38class TranInfoList;
38 39
39class CBInfo 40class CBInfo
40{ 41{
41 public: 42 public:
42 CBInfo(); 43 CBInfo();
43 CBInfo( const QString &, const QString & ); 44 CBInfo( const QString &, const QString & );
@@ -54,42 +55,59 @@ class CBInfo
54 float balance(); 55 float balance();
55 56
56 void setName( const QString &name ) { n = name; } 57 void setName( const QString &name ) { n = name; }
57 void setFilename( const QString &filename ){ fn = filename; } 58 void setFilename( const QString &filename ){ fn = filename; }
58 void setPassword( const QString &password ){ pw = password; } 59 void setPassword( const QString &password ){ pw = password; }
59 void setType( const QString &type ) { t = type; } 60 void setType( const QString &type ) { t = type; }
60 void setBank( const QString &bank ) { bn = bank; } 61 void setBank( const QString &bank ) { bn = bank; }
61 void setAccount( const QString &account ) { a = account; } 62 void setAccount( const QString &account ) { a = account; }
62 void setPin( const QString &pin ) { p = pin; } 63 void setPin( const QString &pin ) { p = pin; }
63 void setNotes( const QString &notes ) { nt = notes; } 64 void setNotes( const QString &notes ) { nt = notes; }
64 void setStartingBalance( float startbal ) { sb = startbal; } 65 void setStartingBalance( float startbal ) { sb = startbal; }
65 66
67 // write
66 void write(); 68 void write();
67 69
70 // transactions
68 TranInfoList *transactions() const { return tl; } 71 TranInfoList *transactions() const { return tl; }
69 TranInfo *findTransaction( const QString &, const QString &, const QString & ); 72 TranInfo *findTransaction( const QString & );
70 void addTransaction( TranInfo * ); 73 void addTransaction( TranInfo * );
71 void removeTransaction( TranInfo * ); 74 void removeTransaction( TranInfo * );
75
76 // lastTab
77 void setLastTab(const QString &sLastTab) { _sLastTab=sLastTab; }
78 QString &getLastTab() { return(_sLastTab); }
79
80 // getNextNumber
81 int getNextNumber() { return( ++_last ); }
82
83 // sortOrder
84 void setSortOrder(const QString &sSortOrder) { _sSortOrder=sSortOrder; }
85 QString &getSortOrder() { return(_sSortOrder); }
72 86
73 private: 87 private:
74 QString n; 88 QString n;
75 QString fn; 89 QString fn;
76 QString pw; 90 QString pw;
77 QString t; 91 QString t;
78 QString bn; 92 QString bn;
79 QString a; 93 QString a;
80 QString p; 94 QString p;
81 QString nt; 95 QString nt;
82 float sb; 96 float sb;
83 float b; 97 float b;
98 QString _sLastTab;
99 int _first;
100 int _last;
101 QString _sSortOrder;
84 102
85 TranInfoList *tl; 103 TranInfoList *tl;
86 104
87 void loadTransactions(); 105 void loadTransactions();
88 void calcBalance(); 106 void calcBalance();
89}; 107};
90 108
91class CBInfoList : public QList<CBInfo> 109class CBInfoList : public QList<CBInfo>
92{ 110{
93 protected: 111 protected:
94 int compareItems( QCollection::Item, QCollection::Item ); 112 int compareItems( QCollection::Item, QCollection::Item );
95}; 113};
diff --git a/noncore/apps/checkbook/cfg.cpp b/noncore/apps/checkbook/cfg.cpp
new file mode 100644
index 0000000..1e0ec5c
--- a/dev/null
+++ b/noncore/apps/checkbook/cfg.cpp
@@ -0,0 +1,213 @@
1/*
2                This file is part of the OPIE Project
3 =.
4             .=l. Copyright (c) 2002 Dan Williams <drw@handhelds.org>
5           .>+-=
6 _;:,     .>    :=|. This file is free software; you can
7.> <`_,   >  .   <= redistribute it and/or modify it under
8:`=1 )Y*s>-.--   : the terms of the GNU General Public
9.="- .-=="i,     .._ License as published by the Free Software
10 - .   .-<_>     .<> Foundation; either version 2 of the License,
11     ._= =}       : or (at your option) any later version.
12    .%`+i>       _;_.
13    .i_,=:_.      -<s. This file is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
18..}^=.=       =       ; Public License for more details.
19++=   -.     .`     .:
20 :     =  ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
28
29#include <stdio.h>
30
31#include <qstring.h>
32#include <qstringlist.h>
33#include <qwidget.h>
34#include <qpe/resource.h>
35#include <qpe/config.h>
36
37#include "cfg.h"
38
39// --- Cfg --------------------------------------------------------------------
40Cfg::Cfg()
41{
42 _currencySymbol="$";
43 _showLocks=FALSE;
44 _showBalances=FALSE;
45 _pCategories=new CategoryList();
46}
47
48// --- readStringList ---------------------------------------------------------
49// Reads the entries for the control from a configuration file and returns
50// them in a StringList. Later this list can be used to create the control. It
51// is assumed, that the group is already set. Key is used to enumerate the
52// entries.
53void Cfg::readStringList(Config &cfg, const char *sKey, QStringList &lst)
54{
55qDebug( "%s", sKey );
56
57 QString sEntry;
58 int iCount;
59
60 // read count of elements
61 sEntry.sprintf("%s_Count", sKey);
62 iCount=cfg.readNumEntry(sEntry, 0);
63
64 // read entries
65 for(int i=1; i<=iCount; i++) {
66 sEntry.sprintf("%s%d", sKey, i);
67 QString sType=cfg.readEntry(sEntry);
68 if( sType!=NULL )
69 lst.append(sType);
70 }
71}
72
73
74// --- readConfig -------------------------------------------------------------
75// Reads the member data from the given config file. It will also set the group
76// "Config"
77void Cfg::readConfig(Config &config)
78{
79 // set group
80 config.setGroup( "Config" );
81
82 // read scalars
83 _currencySymbol = config.readEntry( "CurrencySymbol", "$" );
84 _showLocks = config.readBoolEntry( "ShowLocks", FALSE );
85 _showBalances = config.readBoolEntry( "ShowBalances", FALSE );
86 _openLastBook = config.readBoolEntry( "OpenLastBook", FALSE );
87 _sLastBook = config.readEntry("LastBook", "");
88 _showLastTab = config.readBoolEntry( "ShowLastTab", FALSE );
89
90 // Account types
91 readStringList(config, "AccType", _AccountTypes);
92 if( _AccountTypes.isEmpty() ) {
93 _AccountTypes+= (const char *)QWidget::tr("Savings");
94 _AccountTypes+= (const char *)QWidget::tr("Checking");
95 _AccountTypes+= (const char *)QWidget::tr("CD");
96 _AccountTypes+= (const char *)QWidget::tr("Money market");
97 _AccountTypes+= (const char *)QWidget::tr("Mutual fund");
98 _AccountTypes+= (const char *)QWidget::tr("Other");
99 writeStringList(config, "AccType", _AccountTypes);
100 config.write();
101 }
102
103 // Read Categories
104 QStringList lst;
105 readStringList(config, "Category", lst);
106 if( lst.isEmpty() ) {
107 QString type=QWidget::tr("Expense");
108 lst += QWidget::tr( "Automobile" )+";"+type;
109 lst += QWidget::tr( "Bills" )+";"+type;
110 lst += QWidget::tr( "CDs" )+";"+type;
111 lst += QWidget::tr( "Clothing" )+";"+type;
112 lst += QWidget::tr( "Computer" )+";"+type;
113 lst += QWidget::tr( "DVDs" )+";"+type;
114 lst += QWidget::tr( "Electronics" )+";"+type;
115 lst += QWidget::tr( "Entertainment" )+";"+type;
116 lst += QWidget::tr( "Food" )+";"+type;
117 lst += QWidget::tr( "Gasoline" )+";"+type;
118 lst += QWidget::tr( "Misc" )+";"+type;
119 lst += QWidget::tr( "Movies" )+";"+type;
120 lst += QWidget::tr( "Rent" )+";"+type;
121 lst += QWidget::tr( "Travel" )+";"+type;
122
123 type=QWidget::tr( "Income" );
124 lst += QWidget::tr( "Work" )+";"+type;
125 lst += QWidget::tr( "Family Member" )+";"+type;
126 lst += QWidget::tr( "Misc. Credit" )+";"+type;
127
128 setCategories(lst);
129 writeStringList(config, "Category", lst);
130 config.write();
131 } else {
132 setCategories(lst);
133 }
134}
135
136
137// --- writeStringList --------------------------------------------------------
138// Writes the entries in the control in a configuration file. It is assumed,
139// that the group is already set. Key is used to enumerate the entries
140void Cfg::writeStringList(Config &cfg, const char *sKey, QStringList &lst)
141{
142 QString sEntry;
143 int iCount=0;
144 QStringList::Iterator itr;
145 for(itr=lst.begin(); itr!=lst.end(); itr++) {
146 sEntry.sprintf("%s%d", sKey, ++iCount);
147 cfg.writeEntry(sEntry, *itr );
148 }
149 sEntry.sprintf("%s_Count", sKey);
150 cfg.writeEntry(sEntry, iCount);
151}
152
153
154// --- writeConfig -----------------------------------------------------------
155// Writes all config data back to the config file. The group will be set to
156// "Config" and the write be commited
157void Cfg::writeConfig(Config &config)
158{
159 // set the group
160 config.setGroup( "Config" );
161
162 // write scalars
163 config.writeEntry( "CurrencySymbol", _currencySymbol );
164 config.writeEntry( "ShowLocks", _showLocks );
165 config.writeEntry( "ShowBalances", _showBalances );
166 config.writeEntry( "OpenLastBook", _openLastBook );
167 config.writeEntry( "LastBook", _sLastBook );
168 config.writeEntry( "ShowLastTab", _showLastTab );
169
170 // write account types
171 writeStringList(config, "AccType", _AccountTypes);
172
173 // write categories
174 QStringList lst=getCategories();
175 writeStringList(config, "Category", lst );
176
177 // commit write
178 config.write();
179}
180
181
182// --- getCategories ----------------------------------------------------------
183QStringList Cfg::getCategories()
184{
185 QStringList ret;
186 for(Category *itr=_pCategories->first(); itr; itr=_pCategories->next() ) {
187 QString sEntry;
188 sEntry.sprintf("%s;%s", (const char *)itr->getName(), (const char *)(itr->isIncome() ? QWidget::tr("Income") : QWidget::tr("Expense")) );
189 ret.append(sEntry);
190 }
191 return(ret);
192}
193
194
195// --- setCategories ----------------------------------------------------------
196void Cfg::setCategories(QStringList &lst)
197{
198 _pCategories->clear();
199 QStringList::Iterator itr;
200 for(itr=lst.begin(); itr!=lst.end(); itr++) {
201 QStringList split=QStringList::split(";", *itr, true);
202 if( split.count()<2 ) continue;
203 bool bIncome= (split[1]==QWidget::tr("Income"));
204 _pCategories->append( new Category(split[0], bIncome) );
205 }
206}
207
208
209// --- CategoryList ------------------------------------------------------------
210CategoryList::CategoryList() : QList<Category>()
211{
212 setAutoDelete(true);
213}
diff --git a/noncore/apps/checkbook/cfg.h b/noncore/apps/checkbook/cfg.h
new file mode 100644
index 0000000..2b69368
--- a/dev/null
+++ b/noncore/apps/checkbook/cfg.h
@@ -0,0 +1,120 @@
1/*
2                This file is part of the OPIE Project
3 =.
4             .=l. Copyright (c) 2002 Dan Williams <drw@handhelds.org>
5           .>+-=
6 _;:,     .>    :=|. This file is free software; you can
7.> <`_,   >  .   <= redistribute it and/or modify it under
8:`=1 )Y*s>-.--   : the terms of the GNU General Public
9.="- .-=="i,     .._ License as published by the Free Software
10 - .   .-<_>     .<> Foundation; either version 2 of the License,
11     ._= =}       : or (at your option) any later version.
12    .%`+i>       _;_.
13    .i_,=:_.      -<s. This file is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
18..}^=.=       =       ; Public License for more details.
19++=   -.     .`     .:
20 :     =  ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
28
29#ifndef CFG_H
30#define CFG_H
31
32#include <qstring.h>
33#include <qlist.h>
34#include <qstringlist.h>
35class Config;
36
37// --- Category ---------------------------------------------------------------
38class Category
39{
40 public:
41 // --- Constructor:
42 Category(QString &sName, bool bIncome=false) { _sName=sName; _bIncome=bIncome; }
43
44 // members
45 QString &getName() { return(_sName); }
46 bool isIncome() { return(_bIncome); }
47 void setName(QString &sName) { _sName=sName; }
48 void setIncome(bool bIncome) { _bIncome=bIncome; }
49
50 private:
51 QString _sName;
52 bool _bIncome;
53};
54
55class CategoryList : public QList<Category>
56{
57 public:
58 // --- Constructor
59 CategoryList();
60};
61
62
63// --- Cfg --------------------------------------------------------------------
64class Cfg
65{
66 public:
67 // --- Constructor
68 Cfg();
69
70 // --- members
71 bool getShowLocks() { return(_showLocks); }
72 void setShowLocks(bool n) { _showLocks=n; }
73 bool getShowBalances() { return(_showBalances); }
74 void setShowBalances(bool n) { _showBalances=n; }
75 QString &getCurrencySymbol() { return(_currencySymbol); }
76 void setCurrencySymbol(QString n) {_currencySymbol= n; }
77 void setCurrencySymbol(const char *n) { _currencySymbol=n; }
78 QStringList &getAccountTypes() { return(_AccountTypes); }
79
80 // --- Categories
81 QStringList getCategories();
82 void setCategories(QStringList &lst);
83 CategoryList *getCategoryList() { return(_pCategories); }
84
85 // --- last book
86 void setOpenLastBook(bool openLastBook) { _openLastBook=openLastBook; }
87 bool isOpenLastBook() { return(_openLastBook); }
88 void setLastBook(const QString &lastBook) { _sLastBook=lastBook; }
89 QString &getLastBook() { return(_sLastBook); }
90
91 // --- last tab
92 void setShowLastTab(bool showLastTab) { _showLastTab=showLastTab; }
93 bool isShowLastTab() { return(_showLastTab); }
94
95 // --- reads data from config file
96 void readConfig(Config &cfg);
97
98 // --- writes data to config file
99 void writeConfig(Config &cfg);
100
101 // --- reads list from config file
102 static void readStringList(Config &cfg, const char *sKey, QStringList &lst);
103
104 // --- writes list in configuration file
105 static void writeStringList(Config &cfg, const char *sKey, QStringList &lst);
106
107
108
109 private:
110 QString _currencySymbol;
111 bool _showLocks;
112 bool _showBalances;
113 bool _openLastBook;
114 bool _showLastTab;
115 QString _sLastBook;
116 QStringList _AccountTypes;
117 CategoryList *_pCategories;
118};
119
120#endif
diff --git a/noncore/apps/checkbook/checkbook.cpp b/noncore/apps/checkbook/checkbook.cpp
index 653ee4a..c53e889 100644
--- a/noncore/apps/checkbook/checkbook.cpp
+++ b/noncore/apps/checkbook/checkbook.cpp
@@ -24,82 +24,98 @@
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 38
37#include <opie/otabwidget.h> 39#include <opie/otabwidget.h>
38#include <qpe/qpeapplication.h> 40#include <qpe/qpeapplication.h>
39#include <qpe/qpemessagebox.h> 41#include <qpe/qpemessagebox.h>
40#include <qpe/resource.h> 42#include <qpe/resource.h>
41 43
42#include <qcheckbox.h> 44#include <qcheckbox.h>
43#include <qcombobox.h> 45#include <qcombobox.h>
44#include <qlabel.h> 46#include <qlabel.h>
45#include <qlayout.h> 47#include <qlayout.h>
46#include <qlineedit.h> 48#include <qlineedit.h>
47#include <qmultilineedit.h> 49#include <qmultilineedit.h>
48#include <qpushbutton.h> 50#include <qpushbutton.h>
49#include <qwhatsthis.h> 51#include <qwhatsthis.h>
50 52
51Checkbook::Checkbook( QWidget *parent, CBInfo *i, const QString &symbol ) 53#define COL_ID 0
54#define COL_NUM 1
55#define COL_DATE 2
56#define COL_DESC 3
57#define COL_AMOUNT 4
58#define COL_BAL 5
59
60// --- Checkbook --------------------------------------------------------------
61Checkbook::Checkbook( QWidget *parent, CBInfo *i, Cfg *cfg )
52 : QDialog( parent, 0, TRUE, WStyle_ContextHelp ) 62 : QDialog( parent, 0, TRUE, WStyle_ContextHelp )
53{ 63{
54 info = i; 64 info = i;
55 currencySymbol = symbol; 65 _pCfg=cfg;
56 66
67 // Title bar
57 if ( info->name() != "" ) 68 if ( info->name() != "" )
58 { 69 {
59 QString tempstr = info->name(); 70 QString tempstr = info->name();
60 tempstr.append( " - " ); 71 tempstr.append( " - " );
61 tempstr.append( tr( "Checkbook" ) ); 72 tempstr.append( tr( "Checkbook" ) );
62 setCaption( tempstr ); 73 setCaption( tempstr );
63 } 74 }
64 else 75 else
65 { 76 {
66 setCaption( tr( "New checkbook" ) ); 77 setCaption( tr( "New checkbook" ) );
67 } 78 }
68 79
80
69 // Setup layout to make everything pretty 81 // Setup layout to make everything pretty
70 QVBoxLayout *layout = new QVBoxLayout( this ); 82 QVBoxLayout *layout = new QVBoxLayout( this );
71 layout->setMargin( 2 ); 83 layout->setMargin( 2 );
72 layout->setSpacing( 4 ); 84 layout->setSpacing( 4 );
73 85
74 // Setup tabs for all info 86 // Setup tabs for all info
75 mainWidget = new OTabWidget( this ); 87 mainWidget = new OTabWidget( this );
76 layout->addWidget( mainWidget ); 88 layout->addWidget( mainWidget );
77
78 mainWidget->addTab( initInfo(), "checkbook/infotab", tr( "Info" ) ); 89 mainWidget->addTab( initInfo(), "checkbook/infotab", tr( "Info" ) );
79 mainWidget->addTab( initTransactions(), "checkbook/trantab", tr( "Transactions" ) ); 90 mainWidget->addTab( initTransactions(), "checkbook/trantab", tr( "Transactions" ) );
80 mainWidget->addTab( initCharts(), "checkbook/charttab", tr( "Charts" ) ); 91 mainWidget->addTab( initCharts(), "checkbook/charttab", tr( "Charts" ) );
81 mainWidget->setCurrentTab( tr( "Info" ) ); 92 if( _pCfg->isShowLastTab() )
93 mainWidget->setCurrentTab( info->getLastTab() );
94 else
95 mainWidget->setCurrentTab( tr( "Info" ) );
96 connect( mainWidget, SIGNAL( currentChanged(QWidget *) ), this, SLOT( slotTab(QWidget *) ) );
82 97
83 // Load checkbook information 98 // Load checkbook information
84 loadCheckbook(); 99 loadCheckbook();
85} 100}
86 101
87Checkbook::~Checkbook() 102Checkbook::~Checkbook()
88{ 103{
89} 104}
90 105
106// --- initInfo ---------------------------------------------------------------
91QWidget *Checkbook::initInfo() 107QWidget *Checkbook::initInfo()
92{ 108{
93 QWidget *control = new QWidget( mainWidget ); 109 QWidget *control = new QWidget( mainWidget, tr("Info") );
94 110
95 QVBoxLayout *vb = new QVBoxLayout( control ); 111 QVBoxLayout *vb = new QVBoxLayout( control );
96 112
97 QScrollView *sv = new QScrollView( control ); 113 QScrollView *sv = new QScrollView( control );
98 vb->addWidget( sv, 0, 0 ); 114 vb->addWidget( sv, 0, 0 );
99 sv->setResizePolicy( QScrollView::AutoOneFit ); 115 sv->setResizePolicy( QScrollView::AutoOneFit );
100 sv->setFrameStyle( QFrame::NoFrame ); 116 sv->setFrameStyle( QFrame::NoFrame );
101 117
102 QWidget *container = new QWidget( sv->viewport() ); 118 QWidget *container = new QWidget( sv->viewport() );
103 sv->addChild( container ); 119 sv->addChild( container );
104 120
105 QGridLayout *layout = new QGridLayout( container ); 121 QGridLayout *layout = new QGridLayout( container );
@@ -119,31 +135,26 @@ QWidget *Checkbook::initInfo()
119 nameEdit = new QLineEdit( container ); 135 nameEdit = new QLineEdit( container );
120 QWhatsThis::add( nameEdit, tr( "Enter name of checkbook here." ) ); 136 QWhatsThis::add( nameEdit, tr( "Enter name of checkbook here." ) );
121 connect( nameEdit, SIGNAL( textChanged( const QString & ) ), 137 connect( nameEdit, SIGNAL( textChanged( const QString & ) ),
122 this, SLOT( slotNameChanged( const QString & ) ) ); 138 this, SLOT( slotNameChanged( const QString & ) ) );
123 layout->addWidget( nameEdit, 1, 1 ); 139 layout->addWidget( nameEdit, 1, 1 );
124 140
125 // Type of account 141 // Type of account
126 label = new QLabel( tr( "Type:" ), container ); 142 label = new QLabel( tr( "Type:" ), container );
127 QWhatsThis::add( label, tr( "Select type of checkbook here." ) ); 143 QWhatsThis::add( label, tr( "Select type of checkbook here." ) );
128 layout->addWidget( label, 2, 0 ); 144 layout->addWidget( label, 2, 0 );
129 typeList = new QComboBox( container ); 145 typeList = new QComboBox( container );
130 QWhatsThis::add( typeList, tr( "Select type of checkbook here." ) ); 146 QWhatsThis::add( typeList, tr( "Select type of checkbook here." ) );
131 typeList->insertItem( tr( "Savings" ) ); // 0 147 typeList->insertStringList( _pCfg->getAccountTypes() );
132 typeList->insertItem( tr( "Checking" ) ); // 1 148 layout->addWidget( typeList, 2, 1 );
133 typeList->insertItem( tr( "CD" ) ); // 2
134 typeList->insertItem( tr( "Money market" ) );// 3
135 typeList->insertItem( tr( "Mutual fund" ) );// 4
136 typeList->insertItem( tr( "Other" ) ); // 5
137 layout->addWidget( typeList, 2, 1 );
138 149
139 // Bank/institution name 150 // Bank/institution name
140 label = new QLabel( tr( "Bank:" ), container ); 151 label = new QLabel( tr( "Bank:" ), container );
141 QWhatsThis::add( label, tr( "Enter name of the bank for this checkbook here." ) ); 152 QWhatsThis::add( label, tr( "Enter name of the bank for this checkbook here." ) );
142 layout->addWidget( label, 3, 0 ); 153 layout->addWidget( label, 3, 0 );
143 bankEdit = new QLineEdit( container ); 154 bankEdit = new QLineEdit( container );
144 QWhatsThis::add( bankEdit, tr( "Enter name of the bank for this checkbook here." ) ); 155 QWhatsThis::add( bankEdit, tr( "Enter name of the bank for this checkbook here." ) );
145 layout->addWidget( bankEdit, 3, 1 ); 156 layout->addWidget( bankEdit, 3, 1 );
146 157
147 // Account number 158 // Account number
148 label = new QLabel( tr( "Account number:" ), container ); 159 label = new QLabel( tr( "Account number:" ), container );
149 QWhatsThis::add( label, tr( "Enter account number for this checkbook here." ) ); 160 QWhatsThis::add( label, tr( "Enter account number for this checkbook here." ) );
@@ -174,75 +185,96 @@ QWidget *Checkbook::initInfo()
174 label = new QLabel( tr( "Notes:" ), container ); 185 label = new QLabel( tr( "Notes:" ), container );
175 QWhatsThis::add( label, tr( "Enter any additional information for this checkbook here." ) ); 186 QWhatsThis::add( label, tr( "Enter any additional information for this checkbook here." ) );
176 layout->addWidget( label, 7, 0 ); 187 layout->addWidget( label, 7, 0 );
177 notesEdit = new QMultiLineEdit( container ); 188 notesEdit = new QMultiLineEdit( container );
178 QWhatsThis::add( notesEdit, tr( "Enter any additional information for this checkbook here." ) ); 189 QWhatsThis::add( notesEdit, tr( "Enter any additional information for this checkbook here." ) );
179 notesEdit->setMinimumHeight( 25 ); 190 notesEdit->setMinimumHeight( 25 );
180 notesEdit->setMaximumHeight( 65 ); 191 notesEdit->setMaximumHeight( 65 );
181 layout->addMultiCellWidget( notesEdit, 8, 8, 0, 1 ); 192 layout->addMultiCellWidget( notesEdit, 8, 8, 0, 1 );
182 193
183 return control; 194 return control;
184} 195}
185 196
197
198// --- initTransactions -------------------------------------------------------
186QWidget *Checkbook::initTransactions() 199QWidget *Checkbook::initTransactions()
187{ 200{
188 QWidget *control = new QWidget( mainWidget ); 201 QWidget *control = new QWidget( mainWidget, tr("Transactions") );
189 202
190 QGridLayout *layout = new QGridLayout( control ); 203 QGridLayout *layout = new QGridLayout( control );
191 layout->setSpacing( 2 ); 204 layout->setSpacing( 2 );
192 layout->setMargin( 4 ); 205 layout->setMargin( 4 );
193 206
194 balanceLabel = new QLabel( tr( "Current balance: %10.00" ).arg( currencySymbol ), 207 // Sort selector
195 control ); 208 QLabel *label = new QLabel( tr( "Sort by:" ), control );
196 QWhatsThis::add( balanceLabel, tr( "This area shows the current balance in this checkbook." ) ); 209 QWhatsThis::add( label, tr( "Select checkbook sorting here." ) );
197 layout->addMultiCellWidget( balanceLabel, 0, 0, 0, 2 ); 210 layout->addMultiCellWidget( label, 0, 0, 0, 1 );
198 211 _cbSortType=new QComboBox( control );
199 tranTable = new QListView( control ); 212 _cbSortType->insertItem( tr("Entry Order") );
213 _cbSortType->insertItem( tr("Date") );
214 _cbSortType->insertItem( tr("Number") );
215 layout->addMultiCellWidget( _cbSortType, 0, 0, 1, 2 );
216 connect( _cbSortType, SIGNAL( activated(const QString &) ), this, SLOT( slotSortChanged( const QString & ) ) );
217
218 // Table
219 tranTable = new QListView( control );
220 QFont fnt(QPEApplication::font());
221 fnt.setPointSize( fnt.pointSize()-1 );
222 tranTable->setFont( fnt );
200 QWhatsThis::add( tranTable, tr( "This is a listing of all transactions entered for this checkbook.\n\nTo sort entries by a specific field, click on the column name." ) ); 223 QWhatsThis::add( tranTable, tr( "This is a listing of all transactions entered for this checkbook.\n\nTo sort entries by a specific field, click on the column name." ) );
201 tranTable->addColumn( tr( "Num" ) ); 224 tranTable->addColumn( tr( "Id" ) );
225 tranTable->setColumnWidthMode( COL_ID, QListView::Manual );
226 tranTable->setColumnWidth( COL_ID, 0);
227 tranTable->addColumn( tr( "Num" ) );
202 tranTable->addColumn( tr( "Date" ) ); 228 tranTable->addColumn( tr( "Date" ) );
203 //tranTable->addColumn( tr( "Cleared" ) ); 229 //tranTable->addColumn( tr( "Cleared" ) );
204 tranTable->addColumn( tr( "Description" ) ); 230 tranTable->addColumn( tr( "Description" ) );
205 int colnum = tranTable->addColumn( tr( "Amount" ) ); 231 int column = tranTable->addColumn( tr( "Amount" ) );
206 tranTable->setColumnAlignment( colnum, Qt::AlignRight ); 232 tranTable->setColumnAlignment( column, Qt::AlignRight );
233 column=tranTable->addColumn( tr("Balance") );
234 tranTable->setColumnAlignment( column, Qt::AlignRight );
207 tranTable->setAllColumnsShowFocus( TRUE ); 235 tranTable->setAllColumnsShowFocus( TRUE );
208 tranTable->setSorting( 1 ); 236 tranTable->setSorting( -1 );
209 layout->addMultiCellWidget( tranTable, 1, 1, 0, 2 ); 237 layout->addMultiCellWidget( tranTable, 1, 1, 0, 2 );
210 QPEApplication::setStylusOperation( tranTable->viewport(), QPEApplication::RightOnHold ); 238 QPEApplication::setStylusOperation( tranTable->viewport(), QPEApplication::RightOnHold );
211 connect( tranTable, SIGNAL( rightButtonPressed( QListViewItem *, const QPoint &, int ) ), 239 connect( tranTable, SIGNAL( rightButtonPressed( QListViewItem *, const QPoint &, int ) ),
212 this, SLOT( slotEditTran() ) ); 240 this, SLOT( slotEditTran() ) );
241 _sortCol=COL_ID;
213 242
243 // Buttons
214 QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), control ); 244 QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), control );
215 QWhatsThis::add( btn, tr( "Click here to add a new transaction." ) ); 245 QWhatsThis::add( btn, tr( "Click here to add a new transaction." ) );
216 connect( btn, SIGNAL( clicked() ), this, SLOT( slotNewTran() ) ); 246 connect( btn, SIGNAL( clicked() ), this, SLOT( slotNewTran() ) );
217 layout->addWidget( btn, 2, 0 ); 247 layout->addWidget( btn, 2, 0 );
218 248
219 btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Edit" ), control ); 249 btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Edit" ), control );
220 QWhatsThis::add( btn, tr( "Select a transaction and then click here to edit it." ) ); 250 QWhatsThis::add( btn, tr( "Select a transaction and then click here to edit it." ) );
221 connect( btn, SIGNAL( clicked() ), this, SLOT( slotEditTran() ) ); 251 connect( btn, SIGNAL( clicked() ), this, SLOT( slotEditTran() ) );
222 layout->addWidget( btn, 2, 1 ); 252 layout->addWidget( btn, 2, 1 );
223 253
224 btn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), control ); 254 btn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), control );
225 QWhatsThis::add( btn, tr( "Select a checkbook and then click here to delete it." ) ); 255 QWhatsThis::add( btn, tr( "Select a checkbook and then click here to delete it." ) );
226 connect( btn, SIGNAL( clicked() ), this, SLOT( slotDeleteTran() ) ); 256 connect( btn, SIGNAL( clicked() ), this, SLOT( slotDeleteTran() ) );
227 layout->addWidget( btn, 2, 2 ); 257 layout->addWidget( btn, 2, 2 );
228 258
229 return( control ); 259 return( control );
230} 260}
231 261
262
263// --- initCharts -------------------------------------------------------------
232QWidget *Checkbook::initCharts() 264QWidget *Checkbook::initCharts()
233{ 265{
234 graphInfo = 0x0; 266 graphInfo = 0x0;
235 267
236 QWidget *control = new QWidget( mainWidget ); 268 QWidget *control = new QWidget( mainWidget, tr("Charts") );
237 269
238 QGridLayout *layout = new QGridLayout( control ); 270 QGridLayout *layout = new QGridLayout( control );
239 layout->setSpacing( 2 ); 271 layout->setSpacing( 2 );
240 layout->setMargin( 4 ); 272 layout->setMargin( 4 );
241 273
242 graphWidget = new Graph( control ); 274 graphWidget = new Graph( control );
243 QWhatsThis::add( graphWidget, tr( "Select the desired chart below and then click on the Draw button." ) ); 275 QWhatsThis::add( graphWidget, tr( "Select the desired chart below and then click on the Draw button." ) );
244 layout->addMultiCellWidget( graphWidget, 0, 0, 0, 2 ); 276 layout->addMultiCellWidget( graphWidget, 0, 0, 0, 2 );
245 277
246 graphList = new QComboBox( control ); 278 graphList = new QComboBox( control );
247 QWhatsThis::add( graphList, tr( "Click here to select the desired chart type." ) ); 279 QWhatsThis::add( graphList, tr( "Click here to select the desired chart type." ) );
248 graphList->insertItem( tr( "Account balance" ) ); 280 graphList->insertItem( tr( "Account balance" ) );
@@ -250,91 +282,115 @@ QWidget *Checkbook::initCharts()
250 graphList->insertItem( tr( "Deposits by category" ) ); 282 graphList->insertItem( tr( "Deposits by category" ) );
251 283
252 layout->addMultiCellWidget( graphList, 1, 1, 0, 1 ); 284 layout->addMultiCellWidget( graphList, 1, 1, 0, 1 );
253 285
254 QPushButton *btn = new QPushButton( Resource::loadPixmap( "checkbook/drawbtn" ), tr( "Draw" ), control ); 286 QPushButton *btn = new QPushButton( Resource::loadPixmap( "checkbook/drawbtn" ), tr( "Draw" ), control );
255 QWhatsThis::add( btn, tr( "Click here to draw the selected chart." ) ); 287 QWhatsThis::add( btn, tr( "Click here to draw the selected chart." ) );
256 connect( btn, SIGNAL( clicked() ), this, SLOT( slotDrawGraph() ) ); 288 connect( btn, SIGNAL( clicked() ), this, SLOT( slotDrawGraph() ) );
257 layout->addWidget( btn, 1, 2 ); 289 layout->addWidget( btn, 1, 2 );
258 290
259 return control; 291 return control;
260} 292}
261 293
294// --- loadCheckbook ----------------------------------------------------------
262void Checkbook::loadCheckbook() 295void Checkbook::loadCheckbook()
263{ 296{
264 if ( !info ) 297 if ( !info )
265 { 298 {
266 return; 299 return;
267 } 300 }
268 301
269 tranList = info->transactions(); 302 tranList = info->transactions();
270 303
271 passwordCB->setChecked( !info->password().isNull() ); 304 passwordCB->setChecked( !info->password().isNull() );
272 nameEdit->setText( info->name() ); 305 nameEdit->setText( info->name() );
273 QString temptext = info->type(); 306 QString temptext = info->type();
274 int i = typeList->count(); 307 int i = typeList->count();
275 while ( i > 0 ) 308 while ( i > 0 )
276 { 309 {
277 i--; 310 i--;
278 typeList->setCurrentItem( i ); 311 typeList->setCurrentItem( i );
279 if ( typeList->currentText() == temptext ) 312 if ( typeList->currentText() == temptext )
280 { 313 {
281 break; 314 break;
282 } 315 }
283 } 316 }
317 if( i<=0 ) {
318 typeList->insertItem( temptext, 0 );
319 typeList->setCurrentItem(0);
320 }
284 bankEdit->setText( info->bank() ); 321 bankEdit->setText( info->bank() );
285 acctNumEdit->setText( info->account() ); 322 acctNumEdit->setText( info->account() );
286 pinNumEdit->setText( info->pin() ); 323 pinNumEdit->setText( info->pin() );
287 temptext.setNum( info->startingBalance(), 'f', 2 ); 324 temptext.setNum( info->startingBalance(), 'f', 2 );
288 balanceEdit->setText( temptext ); 325 balanceEdit->setText( temptext );
289 notesEdit->setText( info->notes() ); 326 notesEdit->setText( info->notes() );
290 327
291 // Load transactions 328 // Load transactions
292 float amount; 329 float amount;
293 QString stramount; 330 QString stramount;
294 331 for ( TranInfo *tran = tranList->first(); tran; tran = tranList->next() )
295 for ( TranInfo *tran = tranList->first(); tran; tran = tranList->next() )
296 { 332 {
297 amount = tran->amount(); 333 amount = tran->amount();
298 if ( tran->withdrawal() ) 334 if ( tran->withdrawal() )
299 { 335 {
300 amount *= -1; 336 amount *= -1;
301 } 337 }
302 stramount.sprintf( "%s%.2f", currencySymbol.latin1(), amount ); 338 stramount.sprintf( "%s%.2f", _pCfg->getCurrencySymbol().latin1(), amount );
303 ( void ) new CBListItem( tranTable, tran->number(), tran->datestr(), tran->desc(), stramount ); 339 ( void ) new CBListItem( tran, tranTable, tran->getIdStr(), tran->number(), tran->datestr(), tran->desc(), stramount );
304 } 340 }
305 341
306 balanceLabel->setText( tr( "Current balance: %1%2" ).arg( currencySymbol ).arg( info->balance(), 0, 'f', 2 ) ); 342 // set sort order
307 343 bool bOk=false;
308 highTranNum = tranList->count(); 344 for(int i=0; i<_cbSortType->count(); i++) {
345 if( _cbSortType->text(i)==info->getSortOrder() ) {
346 _cbSortType->setCurrentItem(i);
347 slotSortChanged( info->getSortOrder() );
348 bOk=true;
349 break;
350 }
351 }
352 if( !bOk ) {
353 _cbSortType->setCurrentItem(0);
354 slotSortChanged( _cbSortType->currentText() );
355 }
356
357 // calc running balance
358 adjustBalance();
309} 359}
310 360
361// --- adjustBalance ----------------------------------------------------------
311void Checkbook::adjustBalance() 362void Checkbook::adjustBalance()
312{ 363{
313 balanceLabel->setText( tr( "Current balance: %1%2" ).arg( currencySymbol ).arg( info->balance(), 0, 'f', 2 ) ); 364 // update running balance in register
365 QString sRunning;
366 float bal=info->startingBalance();
367 for(CBListItem *item=(CBListItem *)tranTable->firstChild(); item; item=(CBListItem *)item->nextSibling() ) {
368 TranInfo *tran=item->getTranInfo();
369 bal=bal + (tran->withdrawal() ? -1 : 1)*tran->amount() - tran->fee();
370 sRunning.sprintf( "%s%.2f", _pCfg->getCurrencySymbol().latin1(), bal );
371 item->setText( COL_BAL, sRunning);
372 }
314} 373}
315 374
316TranInfo *Checkbook::findTran( const QString &checknum, const QString &date, const QString &desc ) 375// --- resort -----------------------------------------------------------------
376void Checkbook::resort()
317{ 377{
318 TranInfo *traninfo = tranList->first(); 378 tranTable->setSorting(_sortCol);
319 while ( traninfo ) 379 tranTable->sort();
320 { 380 tranTable->setSorting(-1);
321 if ( traninfo->number() == checknum && traninfo->datestr() == date &&
322 traninfo->desc() == desc )
323 break;
324 traninfo = tranList->next();
325 }
326 return( traninfo );
327} 381}
328 382
383
384// --- accept -----------------------------------------------------------------
329void Checkbook::accept() 385void Checkbook::accept()
330{ 386{
331 info->setName( nameEdit->text() ); 387 info->setName( nameEdit->text() );
332 info->setType( typeList->currentText() ); 388 info->setType( typeList->currentText() );
333 info->setBank( bankEdit->text() ); 389 info->setBank( bankEdit->text() );
334 info->setAccount( acctNumEdit->text() ); 390 info->setAccount( acctNumEdit->text() );
335 info->setPin( pinNumEdit->text() ); 391 info->setPin( pinNumEdit->text() );
336 bool ok; 392 bool ok;
337 info->setStartingBalance( balanceEdit->text().toFloat( &ok ) ); 393 info->setStartingBalance( balanceEdit->text().toFloat( &ok ) );
338 info->setNotes( notesEdit->text() ); 394 info->setNotes( notesEdit->text() );
339 395
340 QDialog::accept(); 396 QDialog::accept();
@@ -389,119 +445,115 @@ void Checkbook::slotNameChanged( const QString &newname )
389 // TODO - need filedir 445 // TODO - need filedir
390 //QString namestr = filedir; 446 //QString namestr = filedir;
391 //namestr.append( newname ); 447 //namestr.append( newname );
392 //namestr.append( ".qcb" ); 448 //namestr.append( ".qcb" );
393 //info->setFilename( namestr ); 449 //info->setFilename( namestr );
394 450
395 QString namestr = newname; 451 QString namestr = newname;
396 namestr.append( " - " ); 452 namestr.append( " - " );
397 namestr.append( tr( "Checkbook" ) ); 453 namestr.append( tr( "Checkbook" ) );
398 setCaption( namestr ); 454 setCaption( namestr );
399} 455}
400 456
457
458// ---slotStartingBalanceChanged ----------------------------------------------
401void Checkbook::slotStartingBalanceChanged( const QString &newbalance ) 459void Checkbook::slotStartingBalanceChanged( const QString &newbalance )
402{ 460{
403 bool ok; 461 bool ok;
404 info->setStartingBalance( newbalance.toFloat( &ok ) ); 462 info->setStartingBalance( newbalance.toFloat( &ok ) );
405 adjustBalance(); 463 adjustBalance();
406} 464}
407 465
466
408void Checkbook::slotNewTran() 467void Checkbook::slotNewTran()
409{ 468{
410 highTranNum++; 469 TranInfo *traninfo = new TranInfo( info->getNextNumber() );
411 TranInfo *traninfo = new TranInfo( highTranNum ); 470 if( !_dLastNew.isNull() )
471 traninfo->setDate(_dLastNew);
412 472
413 Transaction *currtran = new Transaction( this, info->name(), 473 Transaction *currtran = new Transaction( this, info->name(),
414 traninfo, 474 traninfo,
415 currencySymbol ); 475 _pCfg );
416 currtran->showMaximized(); 476 currtran->showMaximized();
417 if ( currtran->exec() == QDialog::Accepted ) 477 if ( currtran->exec() == QDialog::Accepted )
418 { 478 {
419 // Add to transaction list 479 // Add to transaction list
420 info->addTransaction( traninfo ); 480 info->addTransaction( traninfo );
421 481
422 // Add to transaction table 482 // Add to transaction table
423 float amount; 483 float amount;
424 QString stramount; 484 QString stramount;
425 485 amount = (traninfo->withdrawal() ? -1 : 1)*traninfo->amount();
426 amount = traninfo->amount(); 486 stramount.sprintf( "%s%.2f", _pCfg->getCurrencySymbol().latin1(), amount );
427 if ( traninfo->withdrawal() ) 487 ( void ) new CBListItem( traninfo, tranTable, traninfo->getIdStr(),
428 { 488 traninfo->number(), traninfo->datestr(), traninfo->desc(),
429 amount *= -1; 489 stramount );
430 } 490 resort();
431 stramount.sprintf( "%s%.2f", currencySymbol.latin1(), amount );
432
433 ( void ) new CBListItem( tranTable, traninfo->number(), traninfo->datestr(), traninfo->desc(),
434 stramount );
435
436 adjustBalance(); 491 adjustBalance();
492
493 // save last date
494 _dLastNew = traninfo->date();
437 } 495 }
438 else 496 else
439 { 497 {
440 highTranNum--;
441 delete traninfo; 498 delete traninfo;
442 } 499 }
443} 500}
444 501
445void Checkbook::slotEditTran() 502void Checkbook::slotEditTran()
446{ 503{
447 QListViewItem *curritem = tranTable->currentItem(); 504 QListViewItem *curritem = tranTable->currentItem();
448 if ( !curritem ) 505 if ( !curritem )
449 {
450 return; 506 return;
451 } 507
452 508 TranInfo *traninfo=info->findTransaction( curritem->text(COL_ID) );
453 TranInfo *traninfo = info->findTransaction( curritem->text( 0 ), curritem->text( 1 ),
454 curritem->text( 2 ) );
455 509
456 Transaction *currtran = new Transaction( this, info->name(), 510 Transaction *currtran = new Transaction( this, info->name(),
457 traninfo, 511 traninfo,
458 currencySymbol ); 512 _pCfg );
459 currtran->showMaximized(); 513 currtran->showMaximized();
460 if ( currtran->exec() == QDialog::Accepted ) 514 if ( currtran->exec() == QDialog::Accepted )
461 { 515 {
462 curritem->setText( 0, traninfo->number() ); 516 curritem->setText( COL_NUM, traninfo->number() );
463 curritem->setText( 1, traninfo->datestr() ); 517 curritem->setText( COL_DATE, traninfo->datestr() );
464 curritem->setText( 2, traninfo->desc() ); 518 curritem->setText( COL_DESC, traninfo->desc() );
465 519
466 float amount = traninfo->amount(); 520 float amount = traninfo->amount();
467 if ( traninfo->withdrawal() ) 521 if ( traninfo->withdrawal() )
468 { 522 {
469 amount *= -1; 523 amount *= -1;
470 } 524 }
471 QString stramount; 525 QString stramount;
472 stramount.sprintf( "%s%.2f", currencySymbol.latin1(), amount ); 526 stramount.sprintf( "%s%.2f", _pCfg->getCurrencySymbol().latin1(), amount );
473 curritem->setText( 3, stramount ); 527 curritem->setText( COL_AMOUNT, stramount );
474 528 resort();
475 adjustBalance(); 529 adjustBalance();
476 } 530 }
477 531
478 delete currtran; 532 delete currtran;
479} 533}
480 534
481void Checkbook::slotDeleteTran() 535void Checkbook::slotDeleteTran()
482{ 536{
483 QListViewItem *curritem = tranTable->currentItem(); 537 QListViewItem *curritem = tranTable->currentItem();
484 if ( !curritem ) 538 if ( !curritem )
485 {
486 return; 539 return;
487 }
488 540
489 TranInfo *traninfo = findTran( curritem->text( 0 ), curritem->text( 1 ), curritem->text( 2 ) ); 541 TranInfo *traninfo = info->findTransaction( curritem->text(COL_ID) );
490 542
491 if ( QPEMessageBox::confirmDelete ( this, tr( "Delete transaction" ), traninfo->desc() ) ) 543 if ( QPEMessageBox::confirmDelete ( this, tr( "Delete transaction" ), traninfo->desc() ) )
492 { 544 {
493 info->removeTransaction( traninfo ); 545 info->removeTransaction( traninfo );
494 delete curritem; 546 delete curritem;
495 adjustBalance(); 547 adjustBalance();
496 } 548 }
497} 549}
498 550
499void Checkbook::slotDrawGraph() 551void Checkbook::slotDrawGraph()
500{ 552{
501 if ( graphInfo ) 553 if ( graphInfo )
502 { 554 {
503 delete graphInfo; 555 delete graphInfo;
504 } 556 }
505 557
506 switch ( graphList->currentItem() ) 558 switch ( graphList->currentItem() )
507 { 559 {
@@ -580,29 +632,30 @@ void Checkbook::drawCategoryChart( bool withdrawals )
580 cat->addToValue( tran->amount() ); 632 cat->addToValue( tran->amount() );
581 } 633 }
582 else 634 else
583 { // Didn't find category, add category to list 635 { // Didn't find category, add category to list
584 list->append( new DataPointInfo( tran->category(), tran->amount() ) ); 636 list->append( new DataPointInfo( tran->category(), tran->amount() ) );
585 } 637 }
586 } 638 }
587 } 639 }
588 640
589 graphInfo = new GraphInfo( GraphInfo::PieChart, list ); 641 graphInfo = new GraphInfo( GraphInfo::PieChart, list );
590} 642}
591 643
592CBListItem::CBListItem( QListView *parent, QString label1, QString label2, 644CBListItem::CBListItem( TranInfo *pTran, QListView *parent, QString label1, QString label2,
593 QString label3, QString label4, QString label5, QString label6, QString label7, 645 QString label3, QString label4, QString label5, QString label6, QString label7,
594 QString label8 ) 646 QString label8 )
595 : QListViewItem( parent, label1, label2, label3, label4, label5, label6, label7, label8 ) 647 : QListViewItem( parent, label1, label2, label3, label4, label5, label6, label7, label8 )
596{ 648{
649 _pTran=pTran;
597 m_known = FALSE; 650 m_known = FALSE;
598 owner = parent; 651 owner = parent;
599} 652}
600 653
601void CBListItem::paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int align ) 654void CBListItem::paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int align )
602{ 655{
603 QColorGroup _cg = cg; 656 QColorGroup _cg = cg;
604 const QPixmap *pm = listView()->viewport()->backgroundPixmap(); 657 const QPixmap *pm = listView()->viewport()->backgroundPixmap();
605 if ( pm && !pm->isNull() ) 658 if ( pm && !pm->isNull() )
606 { 659 {
607 _cg.setBrush( QColorGroup::Base, QBrush( cg.base(), *pm ) ); 660 _cg.setBrush( QColorGroup::Base, QBrush( cg.base(), *pm ) );
608 p->setBrushOrigin( -listView()->contentsX(), -listView()->contentsY() ); 661 p->setBrushOrigin( -listView()->contentsX(), -listView()->contentsY() );
@@ -643,12 +696,35 @@ bool CBListItem::isAltBackground()
643 696
644 while(item) 697 while(item)
645 { 698 {
646 item->m_odd = previous = !previous; 699 item->m_odd = previous = !previous;
647 item->m_known = true; 700 item->m_known = true;
648 item = (CBListItem *)( item->nextSibling() ); 701 item = (CBListItem *)( item->nextSibling() );
649 } 702 }
650 } 703 }
651 return m_odd; 704 return m_odd;
652 } 705 }
653 return false; 706 return false;
654} 707}
708
709
710// --- slotTab ----------------------------------------------------------------
711void Checkbook::slotTab(QWidget *tab)
712{
713 if( !tab || !info ) return;
714 info->setLastTab( tab->name() );
715}
716
717
718// --- slotSortChanged ---------------------------------------------------------
719void Checkbook::slotSortChanged( const QString &selc )
720{
721 if( selc==tr("Entry Order") ) {
722 _sortCol=COL_ID;
723 } else if( selc==tr("Number") ) {
724 _sortCol=COL_NUM;
725 } else if( selc==tr("Date") ) {
726 _sortCol=COL_DATE;
727 }
728 info->setSortOrder( selc );
729 resort();
730}
diff --git a/noncore/apps/checkbook/checkbook.h b/noncore/apps/checkbook/checkbook.h
index 4a5011b..1b6a2d3 100644
--- a/noncore/apps/checkbook/checkbook.h
+++ b/noncore/apps/checkbook/checkbook.h
@@ -20,107 +20,123 @@
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#ifndef CHECKBOOK_H 29#ifndef CHECKBOOK_H
30#define CHECKBOOK_H 30#define CHECKBOOK_H
31 31
32#include <qdatetime.h>
32#include <qdialog.h> 33#include <qdialog.h>
33#include <qlistview.h> 34#include <qlistview.h>
34 35
35class OTabWidget; 36class OTabWidget;
36 37
37class CBInfo; 38class CBInfo;
38class Graph; 39class Graph;
39class GraphInfo; 40class GraphInfo;
40class QCheckBox; 41class QCheckBox;
41class QComboBox; 42class QComboBox;
42class QLabel; 43class QLabel;
43class QLineEdit; 44class QLineEdit;
44class QListView; 45class QListView;
45class QMultiLineEdit; 46class QMultiLineEdit;
46class QString; 47class QString;
47class TranInfo; 48class TranInfo;
48class TranInfoList; 49class TranInfoList;
50class Cfg;
49 51
52
53// --- Checkbook --------------------------------------------------------------
50class Checkbook : public QDialog 54class Checkbook : public QDialog
51{ 55{
52 Q_OBJECT 56 Q_OBJECT
53 57
54 public: 58 public:
55 Checkbook( QWidget * = 0x0, CBInfo * = 0x0, const QString & = "$" ); 59 Checkbook( QWidget *, CBInfo *, Cfg *cfg );
56 ~Checkbook(); 60 ~Checkbook();
57 61
62 // resort
63 void resort();
64
58 private: 65 private:
59 CBInfo *info; 66 CBInfo *info;
60 TranInfoList *tranList; 67 TranInfoList *tranList;
61 QString currencySymbol; 68 Cfg *_pCfg;
62 int highTranNum;
63 69
64 OTabWidget *mainWidget; 70 OTabWidget *mainWidget;
65 void loadCheckbook(); 71 void loadCheckbook();
66 void adjustBalance(); 72 void adjustBalance();
67 TranInfo *findTran( const QString &, const QString &, const QString & );
68 73
69 // Info tab 74 // Info tab
70 QWidget *initInfo(); 75 QWidget *initInfo();
71 QCheckBox *passwordCB; 76 QCheckBox *passwordCB;
72 QLineEdit *nameEdit; 77 QLineEdit *nameEdit;
73 QComboBox *typeList; 78 QComboBox *typeList;
74 QLineEdit *bankEdit; 79 QLineEdit *bankEdit;
75 QLineEdit *acctNumEdit; 80 QLineEdit *acctNumEdit;
76 QLineEdit *pinNumEdit; 81 QLineEdit *pinNumEdit;
77 QLineEdit *balanceEdit; 82 QLineEdit *balanceEdit;
78 QMultiLineEdit *notesEdit; 83 QMultiLineEdit *notesEdit;
84 int _sortCol;
79 85
80 // Transactions tab 86 // Transactions tab
81 QWidget *initTransactions(); 87 QWidget *initTransactions();
82 QListView *tranTable; 88 QListView *tranTable;
83 QLabel *balanceLabel; 89 QComboBox *_cbSortType;
90 QDate _dLastNew;
84 91
85 // Charts tab 92 // Charts tab
86 QWidget *initCharts(); 93 QWidget *initCharts();
87 GraphInfo *graphInfo; 94 GraphInfo *graphInfo;
88 QComboBox *graphList; 95 QComboBox *graphList;
89 Graph *graphWidget; 96 Graph *graphWidget;
90 97
91 void drawBalanceChart(); 98 void drawBalanceChart();
92 void drawCategoryChart( bool = TRUE ); 99 void drawCategoryChart( bool = TRUE );
93 100
101
94 protected slots: 102 protected slots:
95 void accept(); 103 void accept();
104 void slotTab(QWidget *tab);
96 105
97 private slots: 106 private slots:
98 void slotPasswordClicked(); 107 void slotPasswordClicked();
99 void slotNameChanged( const QString & ); 108 void slotNameChanged( const QString & );
100 void slotStartingBalanceChanged( const QString & ); 109 void slotStartingBalanceChanged( const QString & );
101 void slotNewTran(); 110 void slotNewTran();
102 void slotEditTran(); 111 void slotEditTran();
103 void slotDeleteTran(); 112 void slotDeleteTran();
104 void slotDrawGraph(); 113 void slotDrawGraph();
114 void slotSortChanged( const QString & );
105}; 115};
106 116
117// --- CBListItem -------------------------------------------------------------
107class CBListItem : public QListViewItem 118class CBListItem : public QListViewItem
108{ 119{
109 //Q_OBJECT 120 //Q_OBJECT
110 121
111 public: 122 public:
112 CBListItem( QListView *, QString = QString::null, QString = QString::null, 123 CBListItem( TranInfo *, QListView *, QString = QString::null, QString = QString::null,
113 QString = QString::null, QString = QString::null, QString = QString::null, 124 QString = QString::null, QString = QString::null, QString = QString::null,
114 QString = QString::null, QString = QString::null, QString = QString::null ); 125 QString = QString::null, QString = QString::null, QString = QString::null );
115 126
116 void paintCell( QPainter *, const QColorGroup &, int, int, int ); 127 void paintCell( QPainter *, const QColorGroup &, int, int, int );
117 128
129 // --- members
130 TranInfo *getTranInfo() { return(_pTran); }
131
118 private: 132 private:
133 TranInfo *_pTran;
119 QListView *owner; 134 QListView *owner;
120 bool m_known; 135 bool m_known;
121 bool m_odd; 136 bool m_odd;
122 137
123 bool isAltBackground(); 138 bool isAltBackground();
124}; 139};
125 140
141
126#endif 142#endif
diff --git a/noncore/apps/checkbook/checkbook.pro b/noncore/apps/checkbook/checkbook.pro
index 9a16a56..c574aff 100644
--- a/noncore/apps/checkbook/checkbook.pro
+++ b/noncore/apps/checkbook/checkbook.pro
@@ -1,38 +1,42 @@
1TEMPLATE = app 1CONFIG = qt warn_on release quick-app
2CONFIG = qt warn_on release
3HEADERS = mainwindow.h \ 2HEADERS = mainwindow.h \
4 cbinfo.h \ 3 cbinfo.h \
5 traninfo.h \ 4 traninfo.h \
6 graphinfo.h \ 5 graphinfo.h \
7 configuration.h \ 6 configuration.h \
8 password.h \ 7 password.h \
9 checkbook.h \ 8 checkbook.h \
10 transaction.h \ 9 transaction.h \
10 tabledef.h \
11 listedit.h \
12 cfg.h \
11 graph.h 13 graph.h
12SOURCES = main.cpp \ 14SOURCES = main.cpp \
13 mainwindow.cpp \ 15 mainwindow.cpp \
14 cbinfo.cpp \ 16 cbinfo.cpp \
15 traninfo.cpp \ 17 traninfo.cpp \
16 graphinfo.cpp \ 18 graphinfo.cpp \
17 configuration.cpp \ 19 configuration.cpp \
18 password.cpp \ 20 password.cpp \
19 checkbook.cpp \ 21 checkbook.cpp \
20 transaction.cpp \ 22 transaction.cpp \
23 tabledef.cpp \
24 listedit.cpp \
25 cfg.cpp \
21 graph.cpp 26 graph.cpp
22INCLUDEPATH += $(OPIEDIR)/include 27INCLUDEPATH += $(OPIEDIR)/include
23DEPENDPATH += $(OPIEDIR)/include 28DEPENDPATH += $(OPIEDIR)/include
24LIBS += -lqpe -lopie 29LIBS += -lqpe -lopie
25TARGET = checkbook 30TARGET = checkbook
26DESTDIR = $(OPIEDIR)/bin
27 31
28TRANSLATIONS = ../../../i18n/de/checkbook.ts \ 32TRANSLATIONS = ../../../i18n/de/checkbook.ts \
29 ../../../i18n/nl/checkbook.ts \ 33 ../../../i18n/nl/checkbook.ts \
30 ../../../i18n/da/checkbook.ts \ 34 ../../../i18n/da/checkbook.ts \
31 ../../../i18n/xx/checkbook.ts \ 35 ../../../i18n/xx/checkbook.ts \
32 ../../../i18n/en/checkbook.ts \ 36 ../../../i18n/en/checkbook.ts \
33 ../../../i18n/es/checkbook.ts \ 37 ../../../i18n/es/checkbook.ts \
34 ../../../i18n/fr/checkbook.ts \ 38 ../../../i18n/fr/checkbook.ts \
35 ../../../i18n/hu/checkbook.ts \ 39 ../../../i18n/hu/checkbook.ts \
36 ../../../i18n/ja/checkbook.ts \ 40 ../../../i18n/ja/checkbook.ts \
37 ../../../i18n/ko/checkbook.ts \ 41 ../../../i18n/ko/checkbook.ts \
38 ../../../i18n/no/checkbook.ts \ 42 ../../../i18n/no/checkbook.ts \
diff --git a/noncore/apps/checkbook/configuration.cpp b/noncore/apps/checkbook/configuration.cpp
index 7731cf3..3f5662d 100644
--- a/noncore/apps/checkbook/configuration.cpp
+++ b/noncore/apps/checkbook/configuration.cpp
@@ -18,57 +18,144 @@
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"
32#include "tabledef.h"
30 33
31#include <qcheckbox.h> 34#include <qcheckbox.h>
32#include <qlabel.h> 35#include <qlabel.h>
33#include <qlayout.h> 36#include <qlayout.h>
34#include <qlineedit.h> 37#include <qlineedit.h>
35#include <qwhatsthis.h> 38#include <qwhatsthis.h>
39#include <qlistview.h>
40#include <qpushbutton.h>
41#include <qtabwidget.h>
42#include <qpe/resource.h>
36 43
37Configuration::Configuration( QWidget *parent, const QString &cs, bool sl, bool sb ) 44Configuration::Configuration( QWidget *parent, Cfg &cfg )
38 : QDialog( parent, 0, TRUE, WStyle_ContextHelp ) 45 : QDialog( parent, 0, TRUE, WStyle_ContextHelp )
39{ 46{
40 setCaption( tr( "Configure Checkbook" ) ); 47 setCaption( tr( "Configure Checkbook" ) );
41 48
42 QFontMetrics fm = fontMetrics(); 49 // Setup layout to make everything pretty
50 QVBoxLayout *layout = new QVBoxLayout( this );
51 layout->setMargin( 2 );
52 layout->setSpacing( 4 );
53
54 // Setup tabs for all info
55 _mainWidget = new QTabWidget( this );
56 layout->addWidget( _mainWidget );
57
58 // Settings tab
59 _mainWidget->addTab( initSettings(cfg), tr( "&Settings" ) );
60
61 // Account Types tab
62 ColumnDef *d;
63 _listEditTypes=new ListEdit(_mainWidget, "TYPES" );
64 d=new ColumnDef( tr("Type"), (ColumnDef::ColumnType)(ColumnDef::typeString | ColumnDef::typeUnique), tr("New Account Type"));
65 _listEditTypes->addColumnDef( d );
66 _listEditTypes->addData( cfg.getAccountTypes() );
67 _mainWidget->addTab( _listEditTypes, tr( "&Account Types" ) );
68
69 // Categories tab
70 _listEditCategories=new ListEdit(_mainWidget, "CATEGORIES" );
71 _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") );
73 d->addColumnValue( tr("Expense") );
74 d->addColumnValue( tr("Income") );
75 _listEditCategories->addColumnDef( d );
76 QStringList lst=cfg.getCategories();
77 _listEditCategories->addData( lst );
78 _mainWidget->addTab( _listEditCategories, tr( "&Categories" ) );
79}
80
81Configuration::~Configuration()
82{
83}
84
85// ---- initSettings ----------------------------------------------------------
86QWidget *Configuration::initSettings(Cfg &cfg)
87{
88 QWidget *control = new QWidget( _mainWidget );
89
90 QFontMetrics fm = fontMetrics();
43 int fh = fm.height(); 91 int fh = fm.height();
44 92
45 QGridLayout *layout = new QGridLayout( this ); 93 QVBoxLayout *vb = new QVBoxLayout( control );
94
95 QScrollView *sv = new QScrollView( control );
96 vb->addWidget( sv, 0, 0 );
97 sv->setResizePolicy( QScrollView::AutoOneFit );
98 sv->setFrameStyle( QFrame::NoFrame );
99
100 QWidget *container = new QWidget( sv->viewport() );
101 sv->addChild( container );
102
103 QGridLayout *layout = new QGridLayout( container );
46 layout->setSpacing( 4 ); 104 layout->setSpacing( 4 );
47 layout->setMargin( 4 ); 105 layout->setMargin( 4 );
48 106
49 QLabel *label = new QLabel( tr( "Enter currency symbol:" ), this ); 107 QLabel *label = new QLabel( tr( "Enter currency symbol:" ), container );
50 QWhatsThis::add( label, tr( "Enter your local currency symbol here." ) ); 108 QWhatsThis::add( label, tr( "Enter your local currency symbol here." ) );
51 label->setMaximumHeight( fh + 3 ); 109 label->setMaximumHeight( fh + 3 );
52 layout->addWidget( label, 0, 0 ); 110 layout->addWidget( label, 0, 0 );
53 111
54 symbolEdit = new QLineEdit( cs, this ); 112 symbolEdit = new QLineEdit( cfg.getCurrencySymbol(), container );
55 QWhatsThis::add( symbolEdit, tr( "Enter your local currency symbol here." ) ); 113 QWhatsThis::add( symbolEdit, tr( "Enter your local currency symbol here." ) );
56 symbolEdit->setMaximumHeight( fh + 5 ); 114 symbolEdit->setMaximumHeight( fh + 5 );
57 symbolEdit->setFocus(); 115 symbolEdit->setFocus();
58 layout->addWidget( symbolEdit, 0, 1 ); 116 layout->addWidget( symbolEdit, 0, 1 );
59 117
60 lockCB = new QCheckBox( tr( "Show whether checkbook is password\nprotected" ), this ); 118 lockCB = new QCheckBox( tr( "Show whether checkbook is password\nprotected" ), container );
61 QWhatsThis::add( lockCB, tr( "Click here to select whether or not the main window will display that the checkbook is protected with a password." ) ); 119 QWhatsThis::add( lockCB, tr( "Click here to select whether or not the main window will display that the checkbook is protected with a password." ) );
62 lockCB->setChecked( sl ); 120 lockCB->setChecked( cfg.getShowLocks() );
63 layout->addMultiCellWidget( lockCB, 1, 1, 0, 1 ); 121 layout->addMultiCellWidget( lockCB, 1, 1, 0, 1 );
64 122
65 balCB = new QCheckBox( tr( "Show checkbook balances" ), this ); 123 balCB = new QCheckBox( tr( "Show checkbook balances" ), container );
66 QWhatsThis::add( balCB, tr( "Click here to select whether or not the main window will display the current balance for each checkbook." ) ); 124 QWhatsThis::add( balCB, tr( "Click here to select whether or not the main window will display the current balance for each checkbook." ) );
67 balCB->setMaximumHeight( fh + 5 ); 125 balCB->setMaximumHeight( fh + 5 );
68 balCB->setChecked( sb ); 126 balCB->setChecked( cfg.getShowBalances() );
69 layout->addMultiCellWidget( balCB, 2, 2, 0, 1 ); 127 layout->addMultiCellWidget( balCB, 2, 2, 0, 1 );
128
129 openLastBookCB = new QCheckBox( tr("Open last checkbook" ), container );
130 QWhatsThis::add( openLastBookCB, tr("Click here to select whether the last open checkbook will be opened at startup.") );
131 openLastBookCB->setMaximumHeight(fh+5);
132 openLastBookCB->setChecked( cfg.isOpenLastBook() );
133 layout->addMultiCellWidget( openLastBookCB, 3, 3, 0, 1 );
134
135 lastTabCB = new QCheckBox( tr("Show last checkbook tab" ), container );
136 QWhatsThis::add( lastTabCB, tr("Click here to select whether the last tab in a checkbook should be displayed.") );
137 lastTabCB->setMaximumHeight(fh+5);
138 lastTabCB->setChecked( cfg.isShowLastTab() );
139 layout->addMultiCellWidget( lastTabCB, 4, 4, 0, 1 );
140
141 return(control);
70} 142}
71 143
72Configuration::~Configuration() 144// --- saveConfig -------------------------------------------------------------
145void Configuration::saveConfig(Cfg &cfg)
73{ 146{
147 // Settings
148 cfg.setCurrencySymbol( symbolEdit->text() );
149 cfg.setShowLocks( lockCB->isChecked() );
150 cfg.setShowBalances( balCB->isChecked() );
151 cfg.setOpenLastBook( openLastBookCB->isChecked() );
152 cfg.setShowLastTab( lastTabCB->isChecked() );
153
154 // Typelist
155 _listEditTypes->storeInList( cfg.getAccountTypes() );
156
157 // Category list
158 QStringList lst;
159 _listEditCategories->storeInList( lst );
160 cfg.setCategories( lst );
74} 161}
diff --git a/noncore/apps/checkbook/configuration.h b/noncore/apps/checkbook/configuration.h
index 9a8de02..5893502 100644
--- a/noncore/apps/checkbook/configuration.h
+++ b/noncore/apps/checkbook/configuration.h
@@ -21,31 +21,47 @@
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#ifndef CONFIGURATION_H 29#ifndef CONFIGURATION_H
30#define CONFIGURATION_H 30#define CONFIGURATION_H
31 31
32#include <qdialog.h> 32#include <qdialog.h>
33#include "cfg.h"
33 34
34class QCheckBox; 35class QCheckBox;
35class QLineEdit; 36class QLineEdit;
36class QString; 37class QString;
38class QTabWidget;
39class ListEdit;
37 40
38class Configuration : public QDialog 41class Configuration : public QDialog
39{ 42{
40 Q_OBJECT 43 Q_OBJECT
41 44
42 public: 45 public:
43 Configuration( QWidget * = 0x0, const QString & = "$", bool = FALSE, bool = FALSE ); 46 // Constructor
47 Configuration( QWidget *, Cfg &cfg);
44 ~Configuration(); 48 ~Configuration();
45 49
46 QLineEdit *symbolEdit; 50 QLineEdit *symbolEdit;
47 QCheckBox *lockCB; 51 QCheckBox *lockCB;
48 QCheckBox *balCB; 52 QCheckBox *balCB;
53 QCheckBox *openLastBookCB;
54 QCheckBox *lastTabCB;
55 QTabWidget *_mainWidget;
56 ListEdit *_listEditTypes;
57 ListEdit *_listEditCategories;
58
59 // saves settings in config struct
60 void saveConfig(Cfg &cfg);
61
62 protected:
63 // creates settings tap from configuration
64 QWidget *initSettings(Cfg &cfg);
49}; 65};
50 66
51#endif 67#endif
diff --git a/noncore/apps/checkbook/listedit.cpp b/noncore/apps/checkbook/listedit.cpp
new file mode 100644
index 0000000..99a6531
--- a/dev/null
+++ b/noncore/apps/checkbook/listedit.cpp
@@ -0,0 +1,340 @@
1/*
2                This file is part of the OPIE Project
3 =.
4             .=l. Copyright (c) 2002 Dan Williams <drw@handhelds.org>
5           .>+-=
6 _;:,     .>    :=|. This file is free software; you can
7.> <`_,   >  .   <= redistribute it and/or modify it under
8:`=1 )Y*s>-.--   : the terms of the GNU General Public
9.="- .-=="i,     .._ License as published by the Free Software
10 - .   .-<_>     .<> Foundation; either version 2 of the License,
11     ._= =}       : or (at your option) any later version.
12    .%`+i>       _;_.
13    .i_,=:_.      -<s. This file is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
18..}^=.=       =       ; Public License for more details.
19++=   -.     .`     .:
20 :     =  ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
28
29#include "listedit.h"
30#include <qlayout.h>
31#include <qlineedit.h>
32#include <qlistview.h>
33#include <qwidgetstack.h>
34#include <qcombobox.h>
35#include <qpushbutton.h>
36#include <qpe/resource.h>
37
38
39// --- ListEdit ---------------------------------------------------------------
40ListEdit::ListEdit( QWidget *parent, const char *sName )
41 : QWidget(parent, sName), TableDef(sName)
42{
43 // get font height
44 int fh = fontMetrics().height();
45
46 // create layout
47 QGridLayout *layout=new QGridLayout(this);
48 layout->setSpacing( 2 );
49 layout->setMargin( 4 );
50
51 // type table
52 _typeTable = new QListView( this );
53 ColumnDef *def=first();
54 while( def ) {
55 _typeTable->addColumn( def->getName() );
56 def=next();
57 }
58 connect( _typeTable, SIGNAL( clicked(QListViewItem *, const QPoint &, int) ), this, SLOT( slotClick(QListViewItem *, const QPoint &, int ) ) );
59 layout->addMultiCellWidget(_typeTable, 0,4,0,4);
60 _currentItem=NULL;
61
62 // edit field
63 _stack=new QWidgetStack( this );
64 _stack->setMaximumHeight(fh+5);
65 layout->addMultiCellWidget(_stack, 5,5,0,2);
66 _typeEdit = new QLineEdit( _stack );
67 _stack->raiseWidget(_typeEdit );
68 connect( _typeEdit, SIGNAL( textChanged(const QString &) ), this, SLOT( slotEditChanged(const QString &) ) );
69
70 // combo box
71 _box=new QComboBox( _stack );
72 connect( _box, SIGNAL( activated(const QString &) ), this, SLOT( slotActivated(const QString &) ) );
73
74
75 // add button
76 QPushButton *btn = new QPushButton( Resource::loadPixmap( "checkbook/add" ), tr( "Add" ), this );
77 connect( btn, SIGNAL( clicked() ), this, SLOT( slotAdd() ) );
78 layout->addWidget( btn, 5, 3 );
79
80 // delete button
81 btn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), this );
82 connect( btn, SIGNAL( clicked() ), this, SLOT( slotDel() ) );
83 layout->addWidget( btn, 5, 4 );
84}
85
86// --- ~ListEdit --------------------------------------------------------------
87ListEdit::~ListEdit()
88{
89}
90
91
92// --- slotEditTypeChanged ----------------------------------------------------
93void ListEdit::slotEditChanged(const QString &str)
94{
95 if( !_currentItem || _currentColumn<0 ) return;
96 _currentItem->setText(_currentColumn, str);
97}
98
99// --- slotAddType ------------------------------------------------------------
100void ListEdit::slotAdd()
101{
102 // construct new row
103 QString args[8];
104 ColumnDef *pCol=this->first();
105 int i=0;
106 while( pCol && i<8 ) {
107 args[i++]=pCol->getNewValue();
108 pCol=this->next();
109 }
110 _currentItem=new QListViewItem(_typeTable, args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7] );
111
112 // fix uniques
113 fixTypes();
114
115 // display col 0 of new value
116 QPoint pnt;
117 slotClick(_currentItem, pnt, 0);
118 _typeTable->setSelected( _currentItem, true );
119}
120
121// --- slotDel -------------------------------------------------------------
122void ListEdit::slotDel()
123{
124 if( !_currentItem ) return;
125 delete _currentItem;
126 _currentItem=NULL;
127 _typeEdit->setText("");
128 _stack->raiseWidget(_typeEdit);
129}
130
131
132// --- fixTypes ----------------------------------------------------------------
133// Makes sure all entries have a unique name and empty entries are replaced
134// by a generic string. The first version performs the operation on a particular
135// column, whereas the 2nd does it for all unique columns.
136class ColMap {
137 public:
138 ColMap(QString sValue, QListViewItem *pEntry) {
139 _sValue=sValue;
140 _pEntry=pEntry;
141 }
142 QString &getValue() { return(_sValue); }
143 QListViewItem *getItem() { return(_pEntry); }
144
145 protected:
146 QString _sValue;
147 QListViewItem *_pEntry;
148};
149
150class ColList : public QList<QString>
151{
152 public:
153 ColList() : QList<QString>() { }
154
155 protected:
156 int compareItems(QCollection::Item, QCollection::Item);
157};
158
159int ColList::compareItems(QCollection::Item i1, QCollection::Item i2) {
160 return( ((QString *)i1)->compare(*(QString *)i2) );
161}
162
163void ListEdit::fixTypes(int iColumn)
164{
165 // get column def
166 ColumnDef *pDef=this->at(iColumn);
167
168 // create map of entries
169 if( !_typeTable->childCount() ) return;
170 ColMap **colMap=new (ColMap *)[_typeTable->childCount()];
171 QListViewItem *cur=_typeTable->firstChild();
172 ColList lst;
173 for(int i=0; i<_typeTable->childCount(); i++) {
174 colMap[i]=new ColMap(cur->text(iColumn), cur);
175 lst.append( &(colMap[i]->getValue()) );
176 cur=cur->nextSibling();
177 }
178
179 // fix empty entries
180 int i=0;
181 for(QString *ptr=lst.first(); ptr; ptr=lst.next()) {
182 *ptr=ptr->stripWhiteSpace();
183 if( ptr->isEmpty() ) {
184 i++;
185 if( i==1 ) *ptr=pDef->getNewValue();
186 else ptr->sprintf("%s %d", (const char *)pDef->getNewValue(), i);
187 }
188 }
189
190 // fix dups
191 lst.sort();
192 QString repl;
193 for(uint iCur=0; iCur<lst.count()-1; iCur++) {
194 QString *current=lst.at(iCur);
195 for(uint iNext=iCur+1; iNext<lst.count(); iNext++ ) {
196 if( *current!=*lst.at(iNext) ) continue;
197 for(int i=2; ; i++) {
198 repl.sprintf("%s %d", (const char *)*current, i);
199 bool bDup=false;
200 uint iChk=iNext+1;
201 while( iChk<lst.count() ) {
202 QString *chk=lst.at(iChk);
203 if( !chk->startsWith(*current) ) break;
204 if( *chk==repl ) {
205 bDup=true;
206 break;
207 }
208 iChk++;
209 }
210 if( !bDup ) {
211 *lst.at(iNext)=repl;
212 break;
213 }
214 }
215 }
216 }
217 lst.sort();
218
219 // copy back clean up col map
220 for(int i=0; i<_typeTable->childCount(); i++) {
221 colMap[i]->getItem()->setText(iColumn, colMap[i]->getValue());
222 delete colMap[i];
223 }
224 delete colMap;
225}
226
227void ListEdit::fixTypes()
228{
229 int i;
230 ColumnDef *pDef;
231 for(pDef=this->first(), i=0; pDef; pDef=this->next(), i++) {
232 if( pDef->hasFlag(ColumnDef::typeUnique) )
233 fixTypes(i);
234 }
235 _typeTable->sort();
236}
237
238
239// --- storeInList ------------------------------------------------------------
240void ListEdit::storeInList(QStringList &lst)
241{
242 // delete old content
243 lst.clear();
244
245 // add new one
246 fixTypes();
247 QListViewItem *itm=_typeTable->firstChild();
248 while( itm ) {
249 int i=0;
250 QString sAdd;
251 ColumnDef *pDef;
252 for(pDef=this->first(), i=0; pDef; pDef=this->next(), i++) {
253 if( i>=1 ) sAdd+=";";
254 sAdd += itm->text(i);
255 }
256 lst.append( sAdd );
257 itm=itm->nextSibling();
258 }
259}
260
261
262// --- slotClicked ------------------------------------------------------------
263void ListEdit::slotClick(QListViewItem *itm, const QPoint &pnt, int col)
264{
265 (void)pnt; // get rid of unused warning;
266
267 // save values
268 _currentItem=itm;
269 _currentColumn=col;
270 if( itm==NULL ) {
271 _typeEdit->setText("");
272 _stack->raiseWidget(_typeEdit);
273 return;
274 }
275
276 // display value
277 if( _currentColumn<0 ) _currentColumn=0;
278 ColumnDef *pDef=this->at(_currentColumn);
279 if( pDef->isType(ColumnDef::typeString) ) {
280 _typeEdit->setText( _currentItem->text(_currentColumn) );
281 _stack->raiseWidget(_typeEdit);
282 } else if( pDef->isType(ColumnDef::typeList) ){
283 _box->clear();
284 _box->insertStringList( pDef->getValueList() );
285 QStringList::Iterator itr;
286 int i=0;
287 for(itr=pDef->getValueList().begin(); itr!=pDef->getValueList().end(); itr++) {
288 if( (*itr)==_currentItem->text(_currentColumn) ) {
289 _box->setCurrentItem(i);
290 i=-1;
291 break;
292 }
293 i++;
294 }
295 if( i>=0 ) {
296 _box->insertItem( _currentItem->text(_currentColumn) );
297 _box->setCurrentItem(i);
298 }
299 _stack->raiseWidget(_box);
300 } else {
301 qDebug( "Unsupported column type for column %s", (const char *)pDef->getName() );
302 _typeEdit->setText("");
303 _stack->raiseWidget(_typeEdit);
304 }
305}
306
307
308// --- addColumnDef -----------------------------------------------------------
309void ListEdit::addColumnDef(ColumnDef *pDef)
310{
311 _typeTable->addColumn( pDef->getName() );
312 _vColumns.append(pDef);
313}
314
315// --- addData ----------------------------------------------------------------
316void ListEdit::addData(QStringList &lst)
317{
318 // run through list
319 QStringList::Iterator itr;
320 for(itr=lst.begin(); itr!=lst.end(); itr++) {
321 QStringList split=QStringList::split(";", *itr, true);
322 QStringList::Iterator entry;
323 QString args[8];
324 int i=0;
325 for(entry=split.begin(); entry!=split.end() && i<8; entry++, i++) {
326 args[i]= (*entry);
327 }
328 while(i<8) {
329 args[i++]="";
330 }
331 new QListViewItem(_typeTable, args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7]);
332 }
333}
334
335// --- slotActivated ----------------------------------------------------------
336void ListEdit::slotActivated(const QString &str)
337{
338 if( _currentItem==NULL || _currentColumn<0 ) return;
339 _currentItem->setText(_currentColumn, str);
340}
diff --git a/noncore/apps/checkbook/listedit.h b/noncore/apps/checkbook/listedit.h
new file mode 100644
index 0000000..d2135ea
--- a/dev/null
+++ b/noncore/apps/checkbook/listedit.h
@@ -0,0 +1,78 @@
1/*
2                This file is part of the OPIE Project
3 =.
4             .=l. Copyright (c) 2002 Dan Williams <drw@handhelds.org>
5           .>+-=
6 _;:,     .>    :=|. This file is free software; you can
7.> <`_,   >  .   <= redistribute it and/or modify it under
8:`=1 )Y*s>-.--   : the terms of the GNU General Public
9.="- .-=="i,     .._ License as published by the Free Software
10 - .   .-<_>     .<> Foundation; either version 2 of the License,
11     ._= =}       : or (at your option) any later version.
12    .%`+i>       _;_.
13    .i_,=:_.      -<s. This file is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
18..}^=.=       =       ; Public License for more details.
19++=   -.     .`     .:
20 :     =  ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
28
29#ifndef LISTEDIT_H
30#define LISTEDIT_H
31
32#include <qwidget.h>
33#include "tabledef.h"
34class QListView;
35class QLineEdit;
36class QListViewItem;
37class QPoint;
38class QWidgetStack;
39class QComboBox;
40
41class ListEdit : public QWidget, public TableDef
42{
43 Q_OBJECT
44
45 public:
46 ListEdit( QWidget *, const char *sName);
47 virtual ~ListEdit();
48
49 QListView *_typeTable;
50 QLineEdit *_typeEdit;
51 QWidgetStack *_stack;
52 QComboBox *_box;
53 QListViewItem *_currentItem;
54 int _currentColumn;
55
56 // resolves dups and empty entries
57 void fixTypes();
58 void fixTypes(int iColumn);
59
60 // stores content in string list
61 void storeInList(QStringList &lst);
62
63 // adds a column definition
64 virtual void addColumnDef(ColumnDef *pDef);
65
66 // adds data to table
67 void addData(QStringList &lst);
68
69
70 public slots:
71 void slotClick(QListViewItem *, const QPoint &pnt, int col);
72 void slotEditChanged(const QString &);
73 void slotAdd();
74 void slotDel();
75 void slotActivated(const QString &);
76};
77
78#endif
diff --git a/noncore/apps/checkbook/main.cpp b/noncore/apps/checkbook/main.cpp
index abfa633..dcaab4a 100644
--- a/noncore/apps/checkbook/main.cpp
+++ b/noncore/apps/checkbook/main.cpp
@@ -17,26 +17,18 @@
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"
30
31#include <qpe/qpeapplication.h> 29#include <qpe/qpeapplication.h>
30#include <opie/oapplicationfactory.h>
32 31
33int main(int argc, char **argv) 32#include "mainwindow.h"
34{
35 QPEApplication app(argc, argv);
36
37 MainWindow *cb = new MainWindow();
38 app.setMainWidget(cb);
39 cb->showMaximized();
40 33
41 return app.exec(); 34OPIE_EXPORT_APP( OApplicationFactory<MainWindow> )
42}
diff --git a/noncore/apps/checkbook/mainwindow.cpp b/noncore/apps/checkbook/mainwindow.cpp
index 6d1d7b9..8d64cad 100644
--- a/noncore/apps/checkbook/mainwindow.cpp
+++ b/noncore/apps/checkbook/mainwindow.cpp
@@ -22,53 +22,54 @@
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"
34 35
35#include <qpe/config.h> 36#include <qpe/config.h>
36#include <qpe/global.h> 37#include <qpe/global.h>
37#include <qpe/qpeapplication.h> 38#include <qpe/qpeapplication.h>
38#include <qpe/qpemenubar.h> 39#include <qpe/qpemenubar.h>
39#include <qpe/qpemessagebox.h> 40#include <qpe/qpemessagebox.h>
40#include <qpe/qpetoolbar.h> 41#include <qpe/qpetoolbar.h>
41#include <qpe/resource.h> 42#include <qpe/resource.h>
42 43
43#include <qaction.h> 44#include <qaction.h>
44#include <qcheckbox.h> 45#include <qcheckbox.h>
45#include <qdir.h> 46#include <qdir.h>
46#include <qlineedit.h> 47#include <qlineedit.h>
47#include <qwhatsthis.h> 48#include <qwhatsthis.h>
48 49
49MainWindow::MainWindow() 50
50 : QMainWindow( 0x0, 0x0, WStyle_ContextHelp ) 51MainWindow::MainWindow( QWidget* parent, const char* name, WFlags fl )
52 : QMainWindow( parent, name, fl || WStyle_ContextHelp )
51{ 53{
52 setCaption( tr( "Checkbook" ) ); 54 setCaption( tr( "Checkbook" ) );
53 55
54 cbDir = Global::applicationFileName( "checkbook", "" ); 56 cbDir = Global::applicationFileName( "checkbook", "" );
55 lockIcon = Resource::loadPixmap( "locked" ); 57 lockIcon = Resource::loadPixmap( "locked" );
56 58
57 // Load configuration options 59 // Load configuration options
58 Config config( "checkbook" ); 60 Config config( "checkbook" );
59 config.setGroup( "Config" ); 61qDebug( "Reading config" );
60 currencySymbol = config.readEntry( "CurrencySymbol", "$" ); 62 _cfg.readConfig( config );
61 showLocks = config.readBoolEntry( "ShowLocks", FALSE ); 63
62 showBalances = config.readBoolEntry( "ShowBalances", FALSE );
63 64
64 // Build menu and tool bars 65 // Build menu and tool bars
65 setToolBarsMovable( FALSE ); 66 setToolBarsMovable( FALSE );
66 67
67 QPEToolBar *bar = new QPEToolBar( this ); 68 QPEToolBar *bar = new QPEToolBar( this );
68 bar->setHorizontalStretchable( TRUE ); 69 bar->setHorizontalStretchable( TRUE );
69 QPEMenuBar *mb = new QPEMenuBar( bar ); 70 QPEMenuBar *mb = new QPEMenuBar( bar );
70 mb->setMargin( 0 ); 71 mb->setMargin( 0 );
71 QPopupMenu *popup = new QPopupMenu( this ); 72 QPopupMenu *popup = new QPopupMenu( this );
72 73
73 bar = new QPEToolBar( this ); 74 bar = new QPEToolBar( this );
74 QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, 0, this, 0 ); 75 QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, 0, this, 0 );
@@ -116,220 +117,244 @@ MainWindow::MainWindow()
116 { 117 {
117 filename = cbDir; 118 filename = cbDir;
118 filename.append( (*it) ); 119 filename.append( (*it) );
119 120
120 cb = new CBInfo( (*it).remove( (*it).find('.'), (*it).length() ), filename ); 121 cb = new CBInfo( (*it).remove( (*it).find('.'), (*it).length() ), filename );
121 checkbooks->inSort( cb ); 122 checkbooks->inSort( cb );
122 } 123 }
123 } 124 }
124 125
125 // Build Checkbook selection list control 126 // Build Checkbook selection list control
126 cbList = 0x0; 127 cbList = 0x0;
127 buildList(); 128 buildList();
129
130 // open last book?
131 if( _cfg.isOpenLastBook() ) {
132 this->show();
133 this->showMaximized();
134 QListViewItem *itm=cbList->firstChild();
135 while( itm ) {
136 if( itm->text(posName)==_cfg.getLastBook() ) {
137 openBook( itm );
138 break;
139 }
140 itm=itm->nextSibling();
141 }
142 }
128} 143}
129 144
145
146// --- ~MainWindow ------------------------------------------------------------
130MainWindow::~MainWindow() 147MainWindow::~MainWindow()
131{ 148{
132 //config.write(); 149 writeConfig();
133} 150}
134 151
152
153// --- buildList --------------------------------------------------------------
135void MainWindow::buildList() 154void MainWindow::buildList()
136{ 155{
137 if ( cbList ) 156 if ( cbList )
138 { 157 delete cbList;
139 delete cbList;
140 }
141 158
142 cbList = new QListView( this ); 159 cbList = new QListView( this );
143 QWhatsThis::add( cbList, tr( "This is a listing of all checkbooks currently available." ) ); 160 QWhatsThis::add( cbList, tr( "This is a listing of all checkbooks currently available." ) );
144 161
145 if ( showLocks ) 162 if ( _cfg.getShowLocks() )
146 { 163 {
147 cbList->addColumn( Resource::loadIconSet( "locked" ), "", 24 ); 164 cbList->addColumn( Resource::loadIconSet( "locked" ), "", 24 );
148 posName = 1; 165 posName = 1;
149 } 166 }
150 else 167 else
151 { 168 {
152 posName = 0; 169 posName = 0;
153 } 170 }
154 cbList->addColumn( tr( "Checkbook Name" ) ); 171 cbList->addColumn( tr( "Checkbook Name" ) );
155 if ( showBalances ) 172 if ( _cfg.getShowBalances() )
156 { 173 {
157 int colnum = cbList->addColumn( tr( "Balance" ) ); 174 int colnum = cbList->addColumn( tr( "Balance" ) );
158 cbList->setColumnAlignment( colnum, Qt::AlignRight ); 175 cbList->setColumnAlignment( colnum, Qt::AlignRight );
159 } 176 }
160 cbList->setAllColumnsShowFocus( TRUE ); 177 cbList->setAllColumnsShowFocus( TRUE );
161 cbList->setSorting( posName ); 178 cbList->setSorting( posName );
162 QPEApplication::setStylusOperation( cbList->viewport(), QPEApplication::RightOnHold ); 179 QPEApplication::setStylusOperation( cbList->viewport(), QPEApplication::RightOnHold );
163 connect( cbList, SIGNAL( rightButtonPressed( QListViewItem *, const QPoint &, int ) ), 180 connect( cbList, SIGNAL( rightButtonPressed( QListViewItem *, const QPoint &, int ) ),
164 this, SLOT( slotEdit() ) ); 181 this, SLOT( slotEdit() ) );
165 setCentralWidget( cbList ); 182 setCentralWidget( cbList );
166 183
167 for ( CBInfo *cb = checkbooks->first(); cb; cb = checkbooks->next() ) 184 for ( CBInfo *cb = checkbooks->first(); cb; cb = checkbooks->next() )
168 { 185 {
169 addCheckbook( cb ); 186 addCheckbook( cb );
170 } 187 }
171} 188}
172 189
173void MainWindow::addCheckbook( CBInfo *cb ) 190void MainWindow::addCheckbook( CBInfo *cb )
174{ 191{
175 QListViewItem *lvi = new QListViewItem( cbList ); 192 QListViewItem *lvi = new QListViewItem( cbList );
176 if ( showLocks && !cb->password().isNull() ) 193 if ( _cfg.getShowLocks() && !cb->password().isNull() )
177 { 194 {
178 lvi->setPixmap( 0, lockIcon ); 195 lvi->setPixmap( 0, lockIcon );
179 } 196 }
180 lvi->setText( posName, cb->name() ); 197 lvi->setText( posName, cb->name() );
181 if ( showBalances ) 198 if ( _cfg.getShowBalances() )
182 { 199 {
183 QString balance; 200 QString balance;
184 balance.sprintf( "%s%.2f", currencySymbol.latin1(), cb->balance() ); 201 balance.sprintf( "%s%.2f", _cfg.getCurrencySymbol().latin1(), cb->balance() );
185 lvi->setText( posName + 1, balance ); 202 lvi->setText( posName + 1, balance );
186 } 203 }
187} 204}
188 205
189void MainWindow::buildFilename( const QString &name ) 206void MainWindow::buildFilename( const QString &name )
190{ 207{
191 tempFilename = cbDir; 208 tempFilename = cbDir;
192 tempFilename.append( name ); 209 tempFilename.append( name );
193 tempFilename.append( ".qcb" ); 210 tempFilename.append( ".qcb" );
194} 211}
195 212
196void MainWindow::slotNew() 213void MainWindow::slotNew()
197{ 214{
198 CBInfo *cb = new CBInfo(); 215 CBInfo *cb = new CBInfo();
199 216
200 Checkbook *currcb = new Checkbook( this, cb, currencySymbol ); 217 Checkbook *currcb = new Checkbook( this, cb, &_cfg );
201 currcb->showMaximized(); 218 currcb->showMaximized();
202 if ( currcb->exec() == QDialog::Accepted ) 219 if ( currcb->exec() == QDialog::Accepted )
203 { 220 {
204 // Save new checkbook 221 // Save new checkbook
205 buildFilename( cb->name() ); 222 buildFilename( cb->name() );
223 _cfg.setLastBook( cb->name() );
206 cb->setFilename( tempFilename ); 224 cb->setFilename( tempFilename );
207 cb->write(); 225 cb->write();
208 226
209 // Add to listbox 227 // Add to listbox
210 checkbooks->inSort( cb ); 228 checkbooks->inSort( cb );
211 addCheckbook( cb ); 229 addCheckbook( cb );
212 } 230 }
213 delete currcb; 231 delete currcb;
214} 232}
215 233
234// --- slotEdit ---------------------------------------------------------------
216void MainWindow::slotEdit() 235void MainWindow::slotEdit()
217{ 236{
218 237 // get name and open it
219 QListViewItem *curritem = cbList->currentItem(); 238 QListViewItem *curritem = cbList->currentItem();
220 if ( !curritem ) 239 if ( !curritem )
221 {
222 return; 240 return;
223 } 241 openBook( curritem );
224 QString currname = curritem->text( posName ); 242}
225 243
226 CBInfo *cb = checkbooks->first(); 244
227 while ( cb ) 245// --- openBook ---------------------------------------------------------------
228 { 246void MainWindow::openBook(QListViewItem *curritem)
247{
248 // find book in List
249 QString currname=curritem->text(posName);
250 CBInfo *cb = checkbooks->first();
251 while ( cb ) {
229 if ( cb->name() == currname ) 252 if ( cb->name() == currname )
230 break; 253 break;
231 cb = checkbooks->next(); 254 cb = checkbooks->next();
232 } 255 }
233 if ( !cb ) 256 if ( !cb ) return;
234 {
235 return;
236 }
237 257
258 //
238 buildFilename( currname ); 259 buildFilename( currname );
239 float currbalance = cb->balance(); 260 float currbalance = cb->balance();
240 bool currlock = !cb->password().isNull(); 261 bool currlock = !cb->password().isNull();
241 262
242 if ( currlock ) 263 if ( currlock )
243 { 264 {
244 Password *pw = new Password( this, tr( "Enter password" ), tr( "Please enter your password:" ) ); 265 Password *pw = new Password( this, tr( "Enter password" ), tr( "Please enter your password:" ) );
245 if ( pw->exec() != QDialog::Accepted || pw->password != cb->password() ) 266 if ( pw->exec() != QDialog::Accepted || pw->password != cb->password() )
246 { 267 {
247 delete pw; 268 delete pw;
248 return; 269 return;
249 } 270 }
250 delete pw; 271 delete pw;
251 } 272 }
252 273
253 Checkbook *currcb = new Checkbook( this, cb, currencySymbol ); 274 _cfg.setLastBook( currname );
275 Checkbook *currcb = new Checkbook( this, cb, &_cfg );
254 currcb->showMaximized(); 276 currcb->showMaximized();
255 if ( currcb->exec() == QDialog::Accepted ) 277 if ( currcb->exec() == QDialog::Accepted )
256 { 278 {
257 QString newname = cb->name(); 279 QString newname = cb->name();
258 if ( currname != newname ) 280 if ( currname != newname )
259 { 281 {
260 // Update name if changed 282 // Update name if changed
261 curritem->setText( posName, newname ); 283 if( curritem ) {
262 cbList->sort(); 284 curritem->setText( posName, newname );
285 cbList->sort();
286 }
287 _cfg.setLastBook( newname );
263 288
264 // Remove old file 289 // Remove old file
265 QFile f( tempFilename ); 290 QFile f( tempFilename );
266 if ( f.exists() ) 291 if ( f.exists() )
267 {
268 f.remove(); 292 f.remove();
269 }
270 293
271 // Get new filename 294 // Get new filename
272 buildFilename( newname ); 295 buildFilename( newname );
273 cb->setFilename( tempFilename ); 296 cb->setFilename( tempFilename );
274 } 297 }
275 298
276 cb->write(); 299 cb->write();
277 300
278 // Update lock if changed 301 // Update lock if changed
279 if ( showLocks && !cb->password().isNull() != currlock ) 302 if ( _cfg.getShowLocks() && !cb->password().isNull() != currlock )
280 { 303 {
281 if ( !cb->password().isNull() ) 304 if ( !cb->password().isNull() )
282 curritem->setPixmap( 0, lockIcon ); 305 curritem->setPixmap( 0, lockIcon );
283 else 306 else
284 curritem->setPixmap( 0, nullIcon ); 307 curritem->setPixmap( 0, nullIcon );
285 } 308 }
286 309
287 // Update balance if changed 310 // Update balance if changed
288 if ( showBalances && cb->balance() != currbalance ) 311 if ( _cfg.getShowBalances() && cb->balance() != currbalance )
289 { 312 {
290 QString tempstr; 313 QString tempstr;
291 tempstr.sprintf( "%s%.2f", currencySymbol.latin1(), cb->balance() ); 314 tempstr.sprintf( "%s%.2f", _cfg.getCurrencySymbol().latin1(), cb->balance() );
292 curritem->setText( posName + 1, tempstr ); 315 curritem->setText( posName + 1, tempstr );
293 } 316 }
294 } 317 }
295 delete currcb; 318 delete currcb;
296} 319}
297 320
321// --- slotDelete -------------------------------------------------------------
298void MainWindow::slotDelete() 322void MainWindow::slotDelete()
299{ 323{
300 QString currname = cbList->currentItem()->text( posName ); 324 QString currname = cbList->currentItem()->text( posName );
301 325
302 if ( QPEMessageBox::confirmDelete ( this, tr( "Delete checkbook" ), currname ) ) 326 if ( QPEMessageBox::confirmDelete ( this, tr( "Delete checkbook" ), currname ) )
303 { 327 {
304 buildFilename( currname ); 328 buildFilename( currname );
305 QFile f( tempFilename ); 329 QFile f( tempFilename );
306 if ( f.exists() ) 330 if ( f.exists() )
307 { 331 {
308 f.remove(); 332 f.remove();
309 } 333 }
310 334
311 delete cbList->currentItem(); 335 delete cbList->currentItem();
312 } 336 }
313} 337}
314 338
339// --- slotConfigure ----------------------------------------------------------
315void MainWindow::slotConfigure() 340void MainWindow::slotConfigure()
316{ 341{
317 Configuration *cfgdlg = new Configuration( this, currencySymbol, showLocks, showBalances ); 342 Configuration *cfgdlg = new Configuration( this, _cfg );
318 cfgdlg->showMaximized(); 343 cfgdlg->showMaximized();
319 if ( cfgdlg->exec() == QDialog::Accepted ) 344 if ( cfgdlg->exec() == QDialog::Accepted )
320 { 345 {
321 currencySymbol = cfgdlg->symbolEdit->text(); 346 // read data from config dialog & save it
322 showLocks = cfgdlg->lockCB->isChecked(); 347 cfgdlg->saveConfig( _cfg );
323 showBalances = cfgdlg->balCB->isChecked(); 348 writeConfig();
324
325 Config config( "checkbook" );
326 config.setGroup( "Config" );
327 config.writeEntry( "CurrencySymbol", currencySymbol );
328 config.writeEntry( "ShowLocks", showLocks );
329 config.writeEntry( "ShowBalances", showBalances );
330 config.write();
331
332 buildList(); 349 buildList();
333 } 350 }
334 delete cfgdlg; 351 delete cfgdlg;
335} 352}
353
354
355// --- writeConfig --------------------------------------------------------------
356void MainWindow::writeConfig()
357{
358 Config config("checkbook");
359 _cfg.writeConfig( config );
360}
diff --git a/noncore/apps/checkbook/mainwindow.h b/noncore/apps/checkbook/mainwindow.h
index 2bc70b3..6275f94 100644
--- a/noncore/apps/checkbook/mainwindow.h
+++ b/noncore/apps/checkbook/mainwindow.h
@@ -22,48 +22,55 @@
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#ifndef MAINWINDOW_H 29#ifndef MAINWINDOW_H
30#define MAINWINDOW_H 30#define MAINWINDOW_H
31 31
32#include <qmainwindow.h> 32#include <qmainwindow.h>
33#include <qpixmap.h> 33#include <qpixmap.h>
34#include "cfg.h"
34 35
35class CBInfo; 36class CBInfo;
36class CBInfoList; 37class CBInfoList;
37class QAction; 38class QAction;
38class QListView; 39class QListView;
39class QString; 40class QString;
41class QListViewItem;
40 42
41class MainWindow : public QMainWindow 43class MainWindow : public QMainWindow
42{ 44{
43 Q_OBJECT 45 Q_OBJECT
44 46
45 public: 47 public:
46 MainWindow(); 48 MainWindow(QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
47 ~MainWindow(); 49 ~MainWindow();
50 static QString appName() { return QString::fromLatin1("checkbook"); };
51
52 // safe config
53 void writeConfig();
54
55 // open a check book
56 void openBook(QListViewItem *curr);
48 57
49 private: 58 private:
50 QListView *cbList; 59 QListView *cbList;
51 QString cbDir; 60 QString cbDir;
52 QAction *actionOpen; 61 QAction *actionOpen;
53 QAction *actionDelete; 62 QAction *actionDelete;
54 63
55 QString currencySymbol; 64 Cfg _cfg;
56 bool showLocks;
57 bool showBalances;
58 int posName; 65 int posName;
59 66
60 CBInfoList *checkbooks; 67 CBInfoList *checkbooks;
61 QString tempFilename; 68 QString tempFilename;
62 QPixmap lockIcon; 69 QPixmap lockIcon;
63 QPixmap nullIcon; 70 QPixmap nullIcon;
64 71
65 void buildList(); 72 void buildList();
66 void addCheckbook( CBInfo * ); 73 void addCheckbook( CBInfo * );
67 void buildFilename( const QString & ); 74 void buildFilename( const QString & );
68 75
69 private slots: 76 private slots:
diff --git a/noncore/apps/checkbook/tabledef.cpp b/noncore/apps/checkbook/tabledef.cpp
new file mode 100644
index 0000000..13edded
--- a/dev/null
+++ b/noncore/apps/checkbook/tabledef.cpp
@@ -0,0 +1,76 @@
1/*
2                This file is part of the OPIE Project
3 =.
4             .=l. Copyright (c) 2002 Dan Williams <drw@handhelds.org>
5           .>+-=
6 _;:,     .>    :=|. This file is free software; you can
7.> <`_,   >  .   <= redistribute it and/or modify it under
8:`=1 )Y*s>-.--   : the terms of the GNU General Public
9.="- .-=="i,     .._ License as published by the Free Software
10 - .   .-<_>     .<> Foundation; either version 2 of the License,
11     ._= =}       : or (at your option) any later version.
12    .%`+i>       _;_.
13    .i_,=:_.      -<s. This file is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
18..}^=.=       =       ; Public License for more details.
19++=   -.     .`     .:
20 :     =  ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
28
29#include "tabledef.h"
30
31#include <qstring.h>
32#include <qpe/resource.h>
33
34// --- ColumnDef --------------------------------------------------------------
35ColumnDef::ColumnDef(const char *sName, ColumnType type, const char *sNewValue)
36{
37 _sName=sName;
38 _type=type;
39 _sNewValue=sNewValue;
40}
41
42
43// --- addColumnValue ---------------------------------------------------------
44void ColumnDef::addColumnValue(const QString &sValue)
45{
46 if( (_type & 0x00ffffff) !=typeList )
47 qDebug("Column %s is not a list", (const char *)_sName);
48 else
49 _valueList.append(sValue);
50}
51void ColumnDef::addColumnValue(const char *sValue)
52{
53 if( (_type & 0x00ffffff)!=typeList )
54 qDebug("Column %s is not a list", (const char *)_sName);
55 else
56 _valueList.append(sValue);
57}
58
59// --- TableDef ---------------------------------------------------------------
60TableDef::TableDef(const char *sName)
61{
62 _sName=sName;
63 _vColumns.setAutoDelete(TRUE);
64}
65
66
67// --- ~TableDef --------------------------------------------------------------
68TableDef::~TableDef()
69{
70}
71
72// --- addColumnDef -----------------------------------------------------------
73void TableDef::addColumnDef(ColumnDef *pDef)
74{
75 _vColumns.append(pDef);
76}
diff --git a/noncore/apps/checkbook/tabledef.h b/noncore/apps/checkbook/tabledef.h
new file mode 100644
index 0000000..5891ad7
--- a/dev/null
+++ b/noncore/apps/checkbook/tabledef.h
@@ -0,0 +1,99 @@
1/*
2                This file is part of the OPIE Project
3 =.
4             .=l. Copyright (c) 2002 Dan Williams <drw@handhelds.org>
5           .>+-=
6 _;:,     .>    :=|. This file is free software; you can
7.> <`_,   >  .   <= redistribute it and/or modify it under
8:`=1 )Y*s>-.--   : the terms of the GNU General Public
9.="- .-=="i,     .._ License as published by the Free Software
10 - .   .-<_>     .<> Foundation; either version 2 of the License,
11     ._= =}       : or (at your option) any later version.
12    .%`+i>       _;_.
13    .i_,=:_.      -<s. This file is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
18..}^=.=       =       ; Public License for more details.
19++=   -.     .`     .:
20 :     =  ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
28
29#ifndef TABLEDEF_H
30#define TABLEDEF_H
31
32#include <qstring.h>
33#include <qstringlist.h>
34#include <qlist.h>
35
36
37
38// --- ColumnDef -------------------------------------------------------------
39class ColumnDef
40{
41 public:
42 enum ColumnType {
43 typeString=0x1,
44 typeList=0x2,
45 typeUnique=0x80000000
46 };
47
48 // Constructor
49 ColumnDef(const char *sName, ColumnType type, const char *sNewValue);
50
51 // add column value
52 void addColumnValue(const QString &Value);
53 void addColumnValue(const char *sValue);
54
55 // member functions
56 const QString getName() { return(_sName); }
57 const QString getNewValue() { return(_sNewValue); }
58
59 // test for type
60 int isType(ColumnType x) { return( (_type & 0x00ffffff)==x ); }
61 int hasFlag(ColumnType x) { return( (_type & x) ); }
62
63 // get value list
64 QStringList &getValueList() { return(_valueList); }
65
66 private:
67 QString _sName;
68 QString _sNewValue;
69 enum ColumnType _type;
70 QStringList _valueList;
71};
72
73typedef QList<ColumnDef> ColumnDefList;
74
75
76// --- TableDef ---------------------------------------------------------------
77class TableDef
78{
79 public:
80 // Constructor & Destructor
81 TableDef(const char *sName);
82 virtual ~TableDef();
83
84 // adds a column definition
85 virtual void addColumnDef(ColumnDef *pDef);
86
87 // movement operators
88 ColumnDef *first() { return(_vColumns.first() ); }
89 ColumnDef *last() { return(_vColumns.last() ); }
90 ColumnDef *next() { return(_vColumns.next() ); }
91 ColumnDef *prev() { return(_vColumns.prev() ); }
92 ColumnDef *at(int i) { return(_vColumns.at(i)); }
93
94 protected:
95 QString _sName;
96 ColumnDefList _vColumns;
97};
98
99#endif
diff --git a/noncore/apps/checkbook/traninfo.cpp b/noncore/apps/checkbook/traninfo.cpp
index 65c190c..d880bb4 100644
--- a/noncore/apps/checkbook/traninfo.cpp
+++ b/noncore/apps/checkbook/traninfo.cpp
@@ -25,36 +25,37 @@
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29#include "traninfo.h" 29#include "traninfo.h"
30 30
31#include <qpe/config.h> 31#include <qpe/config.h>
32 32
33QString tempstr; 33QString tempstr;
34 34
35TranInfo::TranInfo( int id, const QString &desc, const QDate &date, bool withdrawal, 35TranInfo::TranInfo( int id, const QString &desc, const QDate &date, bool withdrawal,
36 const QString &type, const QString &category, float amount, 36 const QString &type, const QString &category, float amount,
37 float fee, const QString &number, const QString &notes ) 37 float fee, const QString &number, const QString &notes, int next )
38{ 38{
39 i = id; 39 i = id;
40 d = desc; 40 d = desc;
41 td = date; 41 td = date;
42 w = withdrawal; 42 w = withdrawal;
43 t = type; 43 t = type;
44 c = category; 44 c = category;
45 a = amount; 45 a = amount;
46 f = fee; 46 f = fee;
47 cn = number; 47 cn = number;
48 n = notes; 48 n = notes;
49 _next=next;
49} 50}
50 51
51TranInfo::TranInfo( Config config, int entry ) 52TranInfo::TranInfo( Config config, int entry )
52{ 53{
53 config.setGroup( QString::number( entry ) ); 54 config.setGroup( QString::number( entry ) );
54 QString desc = config.readEntry( "Description", "Not Found" ); 55 QString desc = config.readEntry( "Description", "Not Found" );
55 if ( desc != "Not Found" ) 56 if ( desc != "Not Found" )
56 { 57 {
57 // ID 58 // ID
58 i = entry; 59 i = entry;
59 60
60 // Description 61 // Description
@@ -102,50 +103,55 @@ TranInfo::TranInfo( Config config, int entry )
102 // Category 103 // Category
103 c = config.readEntry( "Category", "" ); 104 c = config.readEntry( "Category", "" );
104 105
105 // Transaction amount 106 // Transaction amount
106 QString stramount = config.readEntry( "Amount", "0.00" ); 107 QString stramount = config.readEntry( "Amount", "0.00" );
107 bool ok; 108 bool ok;
108 a = stramount.toFloat( &ok ); 109 a = stramount.toFloat( &ok );
109 110
110 // Transaction fee 111 // Transaction fee
111 stramount = config.readEntry( "TransactionFee", "0.00" ); 112 stramount = config.readEntry( "TransactionFee", "0.00" );
112 f = stramount.toFloat( &ok ); 113 f = stramount.toFloat( &ok );
113 114
114 // Transaction number 115 // Transaction number
115 cn = config.readEntry( "CheckNumber", "" ); 116 cn = config.readEntry( "CheckNumber", "" );
116 117
117 // Notes 118 // Notes
118 n = config.readEntry( "Comments", "" ); 119 n = config.readEntry( "Comments", "" );
120
121 // next
122 _next = config.readNumEntry("Next", -1);
119 } 123 }
120} 124}
121 125
126// --- datestr ----------------------------------------------------------------
122const QString &TranInfo::datestr() 127const QString &TranInfo::datestr()
123{ 128{
124 tempstr = QString::number( td.year() ); 129 int y=td.year();
125 tempstr.append( '/' ); 130 y= y>=2000 && y<=2099 ? y-2000 : y;
126 int tempfield = td.month(); 131 tempstr.sprintf( "%02d/%02d/%02d", y ,td.month(), td.day() );
127 if ( tempfield < 10 ) tempstr.append( '0' ); 132 return( tempstr );
128 tempstr.append( QString::number( tempfield ) ); 133}
129 tempstr.append( '/' );
130 tempfield = td.day();
131 if ( tempfield < 10 ) tempstr.append( '0' );
132 tempstr.append( QString::number( tempfield ) );
133 134
134 return( tempstr ); 135// --- getIdStr ---------------------------------------------------------------
136const QString &TranInfo::getIdStr()
137{
138 tempstr.sprintf("%04d", i);
139 return( tempstr );
135} 140}
136 141
137void TranInfo::write( Config *config, int entry ) 142// --- write ------------------------------------------------------------------
143void TranInfo::write( Config *config )
138{ 144{
139 config->setGroup( QString::number( entry ) ); 145 config->setGroup( QString::number( id() ) );
140 146
141 config->writeEntry( "Description", d ); 147 config->writeEntry( "Description", d );
142 148
143 tempstr = QString::number( td.month() ); 149 tempstr = QString::number( td.month() );
144 tempstr.append( '/' ); 150 tempstr.append( '/' );
145 tempstr.append( QString::number( td.day() ) ); 151 tempstr.append( QString::number( td.day() ) );
146 tempstr.append( '/' ); 152 tempstr.append( '/' );
147 tempstr.append( QString::number( td.year() ) ); 153 tempstr.append( QString::number( td.year() ) );
148 config->writeEntry( "Date", tempstr ); 154 config->writeEntry( "Date", tempstr );
149 155
150 w ? tempstr = "true" 156 w ? tempstr = "true"
151 : tempstr = "false"; 157 : tempstr = "false";
@@ -160,31 +166,47 @@ void TranInfo::write( Config *config, int entry )
160 else if ( t == "Credit Card" || t == "Cash" ) 166 else if ( t == "Credit Card" || t == "Cash" )
161 tempstr = "3"; 167 tempstr = "3";
162 config->writeEntry( "Type", tempstr ); 168 config->writeEntry( "Type", tempstr );
163 169
164 config->writeEntry( "Category", c ); 170 config->writeEntry( "Category", c );
165 171
166 tempstr.setNum( a, 'f', 2 ); 172 tempstr.setNum( a, 'f', 2 );
167 config->writeEntry( "Amount", tempstr ); 173 config->writeEntry( "Amount", tempstr );
168 174
169 tempstr.setNum( f, 'f', 2 ); 175 tempstr.setNum( f, 'f', 2 );
170 config->writeEntry( "TransactionFee", tempstr ); 176 config->writeEntry( "TransactionFee", tempstr );
171 177
172 config->writeEntry( "CheckNumber", cn ); 178 config->writeEntry( "CheckNumber", cn );
173
174 config->writeEntry( "Comments", n ); 179 config->writeEntry( "Comments", n );
180 config->writeEntry( "Next", _next );
175} 181}
176 182
183
177int TranInfoList::compareItems( QCollection::Item item1, QCollection::Item item2 ) 184int TranInfoList::compareItems( QCollection::Item item1, QCollection::Item item2 )
178{ 185{
179 QDate d1 = ((TranInfo *)item1)->date(); 186 QDate d1 = ((TranInfo *)item1)->date();
180 QDate d2 = ((TranInfo *)item2)->date(); 187 QDate d2 = ((TranInfo *)item2)->date();
181 int r = -1; 188 int r = -1;
182 189
183 if ( d1 < d2 ) 190 if ( d1 < d2 )
184 r = -1; 191 r = -1;
185 else if ( d1 == d2 ) 192 else if ( d1 == d2 )
186 r = 0; 193 r = 0;
187 else if ( d1 > d2 ) 194 else if ( d1 > d2 )
188 r = 1; 195 r = 1;
189 return( r ); 196 return( r );
190} 197}
198
199// --- toString ---------------------------------------------------------------
200QString TranInfo::toString()
201{
202 QString ret;
203 ret.sprintf("(%4d) %10s %4s %-10s %5.2f %5.2f",
204 id(),
205 (const char *)datestr(),
206 (const char *)number(),
207 (const char *)desc(),
208 (withdrawal() ? -1 : 1) * amount(),
209 fee()
210 );
211 return(ret);
212}
diff --git a/noncore/apps/checkbook/traninfo.h b/noncore/apps/checkbook/traninfo.h
index f6c5cae..0abdc61 100644
--- a/noncore/apps/checkbook/traninfo.h
+++ b/noncore/apps/checkbook/traninfo.h
@@ -31,59 +31,70 @@
31 31
32#include <qdatetime.h> 32#include <qdatetime.h>
33#include <qlist.h> 33#include <qlist.h>
34 34
35class Config; 35class Config;
36 36
37class TranInfo 37class TranInfo
38{ 38{
39 public: 39 public:
40 TranInfo( int = 0, const QString & = 0x0, const QDate & = QDate::currentDate(), 40 TranInfo( int = 0, const QString & = 0x0, const QDate & = QDate::currentDate(),
41 bool = TRUE, const QString & = 0x0, const QString & = 0x0, 41 bool = TRUE, const QString & = 0x0, const QString & = 0x0,
42 float = 0.0, float = 0.0, 42 float = 0.0, float = 0.0,
43 const QString & = 0x0, const QString & = 0x0 ); 43 const QString & = 0x0, const QString & = 0x0, int =-1 );
44 TranInfo( Config, int ); 44 TranInfo( Config, int );
45 45
46 // getters
46 int id() const { return i; } 47 int id() const { return i; }
48 const QString &getIdStr();
49
47 const QString &desc() const { return d; } 50 const QString &desc() const { return d; }
48 const QDate &date() const { return td; } 51 const QDate &date() const { return td; }
49 const QString &datestr(); 52 const QString &datestr();
50 bool withdrawal()const { return w; } 53 bool withdrawal()const { return w; }
51 const QString &type() const { return t; } 54 const QString &type() const { return t; }
52 const QString &category()const { return c; } 55 const QString &category()const { return c; }
53 float amount() const { return a; } 56 float amount() const { return a; }
54 float fee() const { return f; } 57 float fee() const { return f; }
55 const QString &number()const { return cn; } 58 const QString &number()const { return cn; }
56 const QString &notes() const { return n; } 59 const QString &notes() const { return n; }
60 int getNext() { return(_next); }
57 61
58 void setDesc( const QString &desc ) { d = desc; } 62 // setters
63 void setDesc( const QString &desc ) { d = desc; }
59 void setDate( const QDate &date ) { td = date; } 64 void setDate( const QDate &date ) { td = date; }
60 void setWithdrawal( bool withdrawal ) { w = withdrawal; } 65 void setWithdrawal( bool withdrawal ) { w = withdrawal; }
61 void setType( const QString &type ) { t = type; } 66 void setType( const QString &type ) { t = type; }
62 void setCategory( const QString &cat ){ c = cat; } 67 void setCategory( const QString &cat ){ c = cat; }
63 void setAmount( float amount ) { a = amount; } 68 void setAmount( float amount ) { a = amount; }
64 void setFee( float fee ) { f = fee; } 69 void setFee( float fee ) { f = fee; }
65 void setNumber( const QString &num ) { cn = num; } 70 void setNumber( const QString &num ) { cn = num; }
66 void setNotes( const QString &notes ) { n = notes; } 71 void setNotes( const QString &notes ) { n = notes; }
72 void setNext(int next) { _next=next; }
73
74 // write
75 void write( Config * );
67 76
68 void write( Config *, int ); 77 // toString
78 QString toString();
69 79
70 private: 80 private:
71 int i; 81 int i;
72 QString d; 82 QString d;
73 QDate td; 83 QDate td;
74 bool w; 84 bool w;
75 QString t; 85 QString t;
76 QString c; 86 QString c;
77 float a; 87 float a;
78 float f; 88 float f;
79 QString cn; 89 QString cn;
80 QString n; 90 QString n;
91 int _next;
81}; 92};
82 93
83class TranInfoList : public QList<TranInfo> 94class TranInfoList : public QList<TranInfo>
84{ 95{
85 protected: 96 protected:
86 int compareItems( QCollection::Item, QCollection::Item ); 97 int compareItems( QCollection::Item, QCollection::Item );
87}; 98};
88 99
89#endif 100#endif
diff --git a/noncore/apps/checkbook/transaction.cpp b/noncore/apps/checkbook/transaction.cpp
index c94b989..138d0e6 100644
--- a/noncore/apps/checkbook/transaction.cpp
+++ b/noncore/apps/checkbook/transaction.cpp
@@ -19,46 +19,47 @@
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 32
32#include <qpe/datebookmonth.h> 33#include <qpe/datebookmonth.h>
33 34
34#include <qbuttongroup.h> 35#include <qbuttongroup.h>
35#include <qcombobox.h> 36#include <qcombobox.h>
36#include <qlabel.h> 37#include <qlabel.h>
37#include <qlayout.h> 38#include <qlayout.h>
38#include <qlineedit.h> 39#include <qlineedit.h>
39#include <qmultilineedit.h> 40#include <qmultilineedit.h>
40#include <qradiobutton.h> 41#include <qradiobutton.h>
41#include <qwhatsthis.h> 42#include <qwhatsthis.h>
42 43
43Transaction::Transaction( QWidget *parent, const QString &acctname, TranInfo *info, 44Transaction::Transaction( QWidget *parent, const QString &acctname, TranInfo *info,
44 const QString &symbol ) 45 Cfg *pCfg )
45 : QDialog( parent, 0, TRUE, WStyle_ContextHelp ) 46 : QDialog( parent, 0, TRUE, WStyle_ContextHelp )
46{ 47{
47 QString tempstr = tr( "Transaction for " ); 48 QString tempstr = tr( "Transaction for " );
48 tempstr.append( acctname ); 49 tempstr.append( acctname );
49 setCaption( tempstr ); 50 setCaption( tempstr );
50 51
51 tran = info; 52 tran = info;
52 currencySymbol = symbol; 53 _pCfg=pCfg;
53 54
54 QVBoxLayout *vb = new QVBoxLayout( this ); 55 QVBoxLayout *vb = new QVBoxLayout( this );
55 56
56 QScrollView *sv = new QScrollView( this ); 57 QScrollView *sv = new QScrollView( this );
57 vb->addWidget( sv, 0, 0 ); 58 vb->addWidget( sv, 0, 0 );
58 sv->setResizePolicy( QScrollView::AutoOneFit ); 59 sv->setResizePolicy( QScrollView::AutoOneFit );
59 sv->setFrameStyle( QFrame::NoFrame ); 60 sv->setFrameStyle( QFrame::NoFrame );
60 61
61 QWidget *container = new QWidget( sv->viewport() ); 62 QWidget *container = new QWidget( sv->viewport() );
62 sv->addChild( container ); 63 sv->addChild( container );
63 64
64 QGridLayout *layout = new QGridLayout( container ); 65 QGridLayout *layout = new QGridLayout( container );
@@ -214,60 +215,55 @@ Transaction::~Transaction()
214void Transaction::accept() 215void Transaction::accept()
215{ 216{
216 tran->setDesc( descEdit->text() ); 217 tran->setDesc( descEdit->text() );
217 tran->setDate( datePicker->selectedDate() ); 218 tran->setDate( datePicker->selectedDate() );
218 tran->setWithdrawal( withBtn->isChecked() ); 219 tran->setWithdrawal( withBtn->isChecked() );
219 tran->setType( typeList->currentText() ); 220 tran->setType( typeList->currentText() );
220 tran->setCategory( catList->currentText() ); 221 tran->setCategory( catList->currentText() );
221 bool ok; 222 bool ok;
222 tran->setAmount( amtEdit->text().toFloat( &ok ) ); 223 tran->setAmount( amtEdit->text().toFloat( &ok ) );
223 tran->setFee( feeEdit->text().toFloat( &ok ) ); 224 tran->setFee( feeEdit->text().toFloat( &ok ) );
224 tran->setNumber( numEdit->text() ); 225 tran->setNumber( numEdit->text() );
225 tran->setNotes( noteEdit->text() ); 226 tran->setNotes( noteEdit->text() );
226 227
227 QDialog::accept(); 228 QDialog::accept();
228} 229}
229 230
230void Transaction::slotWithdrawalClicked() 231void Transaction::slotWithdrawalClicked()
231{ 232{
232 catList->clear(); 233 catList->clear();
233 catList->insertItem( tr( "Automobile" ) ); 234 CategoryList *pCatList=_pCfg->getCategoryList();
234 catList->insertItem( tr( "Bills" ) ); 235 for(Category *pCat=pCatList->first(); pCat; pCat=pCatList->next()) {
235 catList->insertItem( tr( "CDs" ) ); 236 if( !pCat->isIncome() )
236 catList->insertItem( tr( "Clothing" ) ); 237 catList->insertItem( pCat->getName() );
237 catList->insertItem( tr( "Computer" ) ); 238 }
238 catList->insertItem( tr( "DVDs" ) ); 239 catList->setCurrentItem(0);
239 catList->insertItem( tr( "Electronics" ) ); 240
240 catList->insertItem( tr( "Entertainment" ) );
241 catList->insertItem( tr( "Food" ) );
242 catList->insertItem( tr( "Gasoline" ) );
243 catList->insertItem( tr( "Misc" ) );
244 catList->insertItem( tr( "Movies" ) );
245 catList->insertItem( tr( "Rent" ) );
246 catList->insertItem( tr( "Travel" ) );
247 catList->setCurrentItem( 0 );
248 typeList->clear(); 241 typeList->clear();
249 typeList->insertItem( tr( "Debit Charge" ) ); 242 typeList->insertItem( tr( "Debit Charge" ) );
250 typeList->insertItem( tr( "Written Check" ) ); 243 typeList->insertItem( tr( "Written Check" ) );
251 typeList->insertItem( tr( "Transfer" ) ); 244 typeList->insertItem( tr( "Transfer" ) );
252 typeList->insertItem( tr( "Credit Card" ) ); 245 typeList->insertItem( tr( "Credit Card" ) );
253} 246}
254 247
255void Transaction::slotDepositClicked() 248void Transaction::slotDepositClicked()
256{ 249{
257 catList->clear(); 250 catList->clear();
258 catList->insertItem( tr( "Work" ) ); 251 CategoryList *pCatList=_pCfg->getCategoryList();
259 catList->insertItem( tr( "Family Member" ) ); 252 for(Category *pCat=pCatList->first(); pCat; pCat=pCatList->next()) {
260 catList->insertItem( tr( "Misc. Credit" ) ); 253 if( pCat->isIncome() )
261 catList->setCurrentItem( 0 ); 254 catList->insertItem( pCat->getName() );
255 }
256 catList->setCurrentItem( 0 );
257
262 typeList->clear(); 258 typeList->clear();
263 typeList->insertItem( tr( "Written Check" ) ); 259 typeList->insertItem( tr( "Written Check" ) );
264 typeList->insertItem( tr( "Automatic Payment" ) ); 260 typeList->insertItem( tr( "Automatic Payment" ) );
265 typeList->insertItem( tr( "Transfer" ) ); 261 typeList->insertItem( tr( "Transfer" ) );
266 typeList->insertItem( tr( "Cash" ) ); 262 typeList->insertItem( tr( "Cash" ) );
267} 263}
268 264
269void Transaction::slotDateChanged( int y, int m, int d ) 265void Transaction::slotDateChanged( int y, int m, int d )
270{ 266{
271 QDate date; 267 QDate date;
272 date.setYMD( y, m, d ); 268 date.setYMD( y, m, d );
273 dateBtn->setText( TimeString::shortDate( date ) ); 269 dateBtn->setText( TimeString::shortDate( date ) );
diff --git a/noncore/apps/checkbook/transaction.h b/noncore/apps/checkbook/transaction.h
index 000aee7..fbe9cd3 100644
--- a/noncore/apps/checkbook/transaction.h
+++ b/noncore/apps/checkbook/transaction.h
@@ -31,38 +31,38 @@
31 31
32#include <qdialog.h> 32#include <qdialog.h>
33 33
34class DateBookMonth; 34class DateBookMonth;
35class QComboBox; 35class QComboBox;
36class QLineEdit; 36class QLineEdit;
37class QMultiLineEdit; 37class QMultiLineEdit;
38class QPushButton; 38class QPushButton;
39class QRadioButton; 39class QRadioButton;
40class QString; 40class QString;
41class QWidget; 41class QWidget;
42class TranInfo; 42class TranInfo;
43class Cfg;
43 44
44class Transaction : public QDialog 45class Transaction : public QDialog
45{ 46{
46 Q_OBJECT 47 Q_OBJECT
47 48
48 public: 49 public:
49 Transaction( QWidget * = 0x0, const QString & = 0x0, TranInfo * = 0x0, 50 Transaction( QWidget *, const QString &, TranInfo *, Cfg *);
50 const QString & = "$" );
51 ~Transaction(); 51 ~Transaction();
52 52
53 private: 53 private:
54 TranInfo *tran; 54 TranInfo *tran;
55 55
56 QString currencySymbol; 56 Cfg *_pCfg;
57 57
58 QRadioButton *withBtn; 58 QRadioButton *withBtn;
59 QRadioButton *depBtn; 59 QRadioButton *depBtn;
60 QPushButton *dateBtn; 60 QPushButton *dateBtn;
61 DateBookMonth *datePicker; 61 DateBookMonth *datePicker;
62 QLineEdit *numEdit; 62 QLineEdit *numEdit;
63 QLineEdit *descEdit; 63 QLineEdit *descEdit;
64 QComboBox *catList; 64 QComboBox *catList;
65 QComboBox *typeList; 65 QComboBox *typeList;
66 QLineEdit *amtEdit; 66 QLineEdit *amtEdit;
67 QLineEdit *feeEdit; 67 QLineEdit *feeEdit;
68 QMultiLineEdit *noteEdit; 68 QMultiLineEdit *noteEdit;
diff --git a/noncore/apps/odict/main.cpp b/noncore/apps/odict/main.cpp
index c68253f..0642022 100644
--- a/noncore/apps/odict/main.cpp
+++ b/noncore/apps/odict/main.cpp
@@ -8,22 +8,17 @@
8 8
9/*************************************************************************** 9/***************************************************************************
10 * * 10 * *
11 * This program is free software; you can redistribute it and/or modify * 11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by * 12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or * 13 * the Free Software Foundation; either version 2 of the License, or *
14 * ( at your option ) any later version. * 14 * ( at your option ) any later version. *
15 * * 15 * *
16 **************************************************************************/ 16 **************************************************************************/
17 17
18 18
19#include <qpe/qpeapplication.h> 19#include <qpe/qpeapplication.h>
20#include <opie/oapplicationfactory.h>
20#include "odict.h" 21#include "odict.h"
21 22
22int main(int argc, char **argv) 23
23{ 24OPIE_EXPORT_APP( OApplicationFactory<ODict> )
24 QPEApplication app(argc, argv);
25 ODict *odict= new ODict();
26 app.setMainWidget(odict);
27 odict->showMaximized();
28 return app.exec();
29}
diff --git a/noncore/apps/odict/odict.cpp b/noncore/apps/odict/odict.cpp
index 010545e..9718c5c 100644
--- a/noncore/apps/odict/odict.cpp
+++ b/noncore/apps/odict/odict.cpp
@@ -27,68 +27,68 @@
27#include <qlabel.h> 27#include <qlabel.h>
28#include <qpushbutton.h> 28#include <qpushbutton.h>
29#include <qlineedit.h> 29#include <qlineedit.h>
30#include <qmainwindow.h> 30#include <qmainwindow.h>
31#include <qstring.h> 31#include <qstring.h>
32#include <qaction.h> 32#include <qaction.h>
33#include <qtextbrowser.h> 33#include <qtextbrowser.h>
34#include <qcombobox.h> 34#include <qcombobox.h>
35 35
36#include <qpe/resource.h> 36#include <qpe/resource.h>
37#include <qpe/config.h> 37#include <qpe/config.h>
38 38
39ODict::ODict() : QMainWindow() 39ODict::ODict(QWidget* parent, const char* name, WFlags fl ) : QMainWindow(parent, name, fl )
40{ 40{
41 activated_name = QString::null; 41 activated_name = QString::null;
42 42
43 vbox = new QVBox( this ); 43 vbox = new QVBox( this );
44 setCaption( tr( "Opie-Dictionary" ) ); 44 setCaption( tr( "Opie-Dictionary" ) );
45 setupMenus(); 45 setupMenus();
46 46
47 QHBox *hbox = new QHBox( vbox ); 47 QHBox *hbox = new QHBox( vbox );
48 QLabel* query_label = new QLabel( tr( "Query:" ) , hbox ); 48 QLabel* query_label = new QLabel( tr( "Query:" ) , hbox );
49 query_label->show(); 49 query_label->show();
50 query_le = new QLineEdit( hbox ); 50 query_le = new QLineEdit( hbox );
51 query_co = new QComboBox( hbox ); 51 query_co = new QComboBox( hbox );
52 connect( query_co , SIGNAL( activated(const QString&) ), this, SLOT( slotMethodChanged(const QString&) ) ); 52 connect( query_co , SIGNAL( activated(const QString&) ), this, SLOT( slotMethodChanged(const QString&) ) );
53 ok_button = new QPushButton( tr( "&Ok" ), hbox ); 53 ok_button = new QPushButton( tr( "&Ok" ), hbox );
54 connect( ok_button, SIGNAL( released() ), this, SLOT( slotStartQuery() ) ); 54 connect( ok_button, SIGNAL( released() ), this, SLOT( slotStartQuery() ) );
55 55
56 top_name = new QLabel( vbox ); 56 top_name = new QLabel( vbox );
57 top_name->setAlignment( AlignHCenter ); 57 top_name->setAlignment( AlignHCenter );
58 browser_top = new QTextBrowser( vbox ); 58 browser_top = new QTextBrowser( vbox );
59 bottom_name = new QLabel( vbox ); 59 bottom_name = new QLabel( vbox );
60 bottom_name->setAlignment( AlignHCenter ); 60 bottom_name->setAlignment( AlignHCenter );
61 browser_bottom = new QTextBrowser( vbox ); 61 browser_bottom = new QTextBrowser( vbox );
62 62
63 ding = new DingWidget(); 63 ding = new DingWidget();
64 64
65 loadConfig(); 65 loadConfig();
66 setCentralWidget( vbox ); 66 setCentralWidget( vbox );
67} 67}
68 68
69void ODict::loadConfig() 69void ODict::loadConfig()
70{ 70{
71 /* 71 /*
72 * the name of the last used dictionary 72 * the name of the last used dictionary
73 */ 73 */
74 QString lastname; 74 QString lastname;
75 75
76 Config cfg ( "odict" ); 76 Config cfg ( "odict" );
77 cfg.setGroup( "generalsettings" ); 77 cfg.setGroup( "generalsettings" );
78 casesens = cfg.readEntry( "casesens" ).toInt(); 78 casesens = cfg.readEntry( "casesens" ).toInt();
79 79
80 QString lastDict = cfg.readEntry( "lastdict" ); 80 QString lastDict = cfg.readEntry( "lastdict" );
81 int i = 0, e = 0; 81 int i = 0, e = 0;
82 82
83 QStringList groupListCfg = cfg.groupList().grep( "Method_" ); 83 QStringList groupListCfg = cfg.groupList().grep( "Method_" );
84 query_co->clear(); 84 query_co->clear();
85 for ( QStringList::Iterator it = groupListCfg.begin() ; it != groupListCfg.end() ; ++it ) 85 for ( QStringList::Iterator it = groupListCfg.begin() ; it != groupListCfg.end() ; ++it )
86 { 86 {
87 QString name; 87 QString name;
88 cfg.setGroup( *it ); 88 cfg.setGroup( *it );
89 name = cfg.readEntry( "Name" ); 89 name = cfg.readEntry( "Name" );
90 query_co->insertItem( name ); 90 query_co->insertItem( name );
91 91
92 /* 92 /*
93 * this check is to look up what dictionary has been used the 93 * this check is to look up what dictionary has been used the
94 * last time 94 * last time
@@ -108,65 +108,65 @@ void ODict::loadConfig()
108 ding->loadDict( lastname ); 108 ding->loadDict( lastname );
109 ding->loadValues(); 109 ding->loadValues();
110 110
111 query_co->setCurrentItem( e ); 111 query_co->setCurrentItem( e );
112 top_name->setText( top_name_content ); 112 top_name->setText( top_name_content );
113 bottom_name->setText( bottom_name_content ); 113 bottom_name->setText( bottom_name_content );
114} 114}
115 115
116void ODict::lookupLanguageNames( QString dictname ) 116void ODict::lookupLanguageNames( QString dictname )
117{ 117{
118 Config cfg ( "odict" ); 118 Config cfg ( "odict" );
119 cfg.setGroup( "Method_"+dictname ); 119 cfg.setGroup( "Method_"+dictname );
120 top_name_content = cfg.readEntry( "Lang1" ); 120 top_name_content = cfg.readEntry( "Lang1" );
121 bottom_name_content = cfg.readEntry( "Lang2" ); 121 bottom_name_content = cfg.readEntry( "Lang2" );
122} 122}
123 123
124void ODict::saveConfig() 124void ODict::saveConfig()
125{ 125{
126 Config cfg ( "odict" ); 126 Config cfg ( "odict" );
127 cfg.setGroup( "generalsettings" ); 127 cfg.setGroup( "generalsettings" );
128 cfg.writeEntry( "casesens" , casesens ); 128 cfg.writeEntry( "casesens" , casesens );
129 cfg.writeEntry( "lastdict" , query_co->currentText() ); 129 cfg.writeEntry( "lastdict" , query_co->currentText() );
130} 130}
131 131
132void ODict::slotStartQuery() 132void ODict::slotStartQuery()
133{ 133{
134 QString querystring = query_le->text(); 134 QString querystring = query_le->text();
135 if ( !querystring.isEmpty() ) 135 if ( !querystring.isEmpty() )
136 { 136 {
137 /* 137 /*
138 * if the user has not yet defined a dictionary 138 * if the user has not yet defined a dictionary
139 */ 139 */
140 if ( !query_co->currentText() ) 140 if ( !query_co->currentText() )
141 { 141 {
142 switch ( QMessageBox::information( this, tr( "OPIE-Dictionary" ), 142 switch ( QMessageBox::information( this, tr( "OPIE-Dictionary" ),
143 tr( "No dictionary defined" ), 143 tr( "No dictionary defined" ),
144 tr( "&Define one" ), 144 tr( "&Define one" ),
145 tr( "&Cancel" ), 145 tr( "&Cancel" ),
146 0, // Define a dict 146 0, // Define a dict
147 1 ) ) // Cancel choosen 147 1 ) ) // Cancel choosen
148 { 148 {
149 case 0: 149 case 0:
150 slotSettings(); 150 slotSettings();
151 break; 151 break;
152 case 1: // stop here 152 case 1: // stop here
153 return; 153 return;
154 } 154 }
155 } 155 }
156 156
157 /* 157 /*
158 * ok, the user has defined a dict 158 * ok, the user has defined a dict
159 */ 159 */
160 ding->setCaseSensitive( casesens ); 160 ding->setCaseSensitive( casesens );
161 161
162 BroswerContent test = ding->setText( querystring ); 162 BroswerContent test = ding->setText( querystring );
163 163
164 browser_top->setText( test.top ); 164 browser_top->setText( test.top );
165 browser_bottom->setText( test.bottom ); 165 browser_bottom->setText( test.bottom );
166 } 166 }
167} 167}
168 168
169void ODict::slotSettings() 169void ODict::slotSettings()
170{ 170{
171 ConfigDlg dlg( this, "Config" , true); 171 ConfigDlg dlg( this, "Config" , true);
172 if ( dlg.exec() == QDialog::Accepted ) 172 if ( dlg.exec() == QDialog::Accepted )
@@ -180,41 +180,41 @@ void ODict::slotSetParameter( int count )
180 if ( casesens ) 180 if ( casesens )
181 casesens = false; 181 casesens = false;
182 else 182 else
183 casesens = true; 183 casesens = true;
184 } 184 }
185 185
186 saveConfig(); 186 saveConfig();
187} 187}
188 188
189void ODict::slotMethodChanged( const QString& methodnumber ) 189void ODict::slotMethodChanged( const QString& methodnumber )
190{ 190{
191 activated_name = methodnumber; 191 activated_name = methodnumber;
192 192
193 if ( activated_name != ding->loadedDict() ) 193 if ( activated_name != ding->loadedDict() )
194 { 194 {
195 ding->loadDict(activated_name); 195 ding->loadDict(activated_name);
196 196
197 lookupLanguageNames( activated_name ); 197 lookupLanguageNames( activated_name );
198 top_name->setText( top_name_content ); 198 top_name->setText( top_name_content );
199 bottom_name->setText( bottom_name_content ); 199 bottom_name->setText( bottom_name_content );
200 } 200 }
201} 201}
202 202
203void ODict::setupMenus() 203void ODict::setupMenus()
204{ 204{
205 menu = new QMenuBar( this ); 205 menu = new QMenuBar( this );
206 206
207 settings = new QPopupMenu( menu ); 207 settings = new QPopupMenu( menu );
208 setting_a = new QAction(tr( "Configuration" ), Resource::loadPixmap( "new" ), QString::null, 0, this, 0 ); 208 setting_a = new QAction(tr( "Configuration" ), Resource::loadPixmap( "new" ), QString::null, 0, this, 0 );
209 connect( setting_a, SIGNAL( activated() ), this, SLOT( slotSettings() ) ); 209 connect( setting_a, SIGNAL( activated() ), this, SLOT( slotSettings() ) );
210 setting_a->addTo( settings ); 210 setting_a->addTo( settings );
211 setting_b = new QAction(tr( "Searchmethods" ), Resource::loadPixmap( "edit" ), QString::null, 0, this, 0 ); 211 setting_b = new QAction(tr( "Searchmethods" ), Resource::loadPixmap( "edit" ), QString::null, 0, this, 0 );
212 212
213 parameter = new QPopupMenu( menu ); 213 parameter = new QPopupMenu( menu );
214 connect( parameter, SIGNAL( activated( int ) ), this, SLOT( slotSetParameter( int ) ) ); 214 connect( parameter, SIGNAL( activated( int ) ), this, SLOT( slotSetParameter( int ) ) );
215 parameter->insertItem( tr( "C&ase sensitive" ), 0 ,0 ); 215 parameter->insertItem( tr( "C&ase sensitive" ), 0 ,0 );
216 parameter->insertSeparator(); 216 parameter->insertSeparator();
217 217
218 menu->insertItem( tr( "Settings" ) , settings ); 218 menu->insertItem( tr( "Settings" ) , settings );
219 menu->insertItem( tr( "Parameter" ) , parameter ); 219 menu->insertItem( tr( "Parameter" ) , parameter );
220} 220}
diff --git a/noncore/apps/odict/odict.h b/noncore/apps/odict/odict.h
index be2a532..68a8f95 100644
--- a/noncore/apps/odict/odict.h
+++ b/noncore/apps/odict/odict.h
@@ -20,30 +20,30 @@ class QAction;
20class QVBoxLayout; 20class QVBoxLayout;
21class QActionGroup; 21class QActionGroup;
22class DingWidget; 22class DingWidget;
23class QTextBrowser; 23class QTextBrowser;
24class QComboBox; 24class QComboBox;
25class DingWidget; 25class DingWidget;
26 26
27class ODict : public QMainWindow 27class ODict : public QMainWindow
28{ 28{
29 Q_OBJECT 29 Q_OBJECT
30 30
31 public: 31 public:
32 ODict(); 32 ODict(QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
33 QVBox *vbox; 33 QVBox *vbox;
34 QTextBrowser *browser_top, 34 QTextBrowser *browser_top,
35 *browser_bottom; 35 *browser_bottom;
36 DingWidget *ding; 36 DingWidget *ding;
37 37 static QString appName() { return QString::fromLatin1("odict"); }
38 private: 38 private:
39 QPopupMenu *help, *settings, *parameter; 39 QPopupMenu *help, *settings, *parameter;
40 QMenuBar *menu; 40 QMenuBar *menu;
41 QHBox *hbox; 41 QHBox *hbox;
42 QLineEdit *query_le; 42 QLineEdit *query_le;
43 QComboBox *query_co; 43 QComboBox *query_co;
44 QPushButton *ok_button; 44 QPushButton *ok_button;
45 45
46 QVBoxLayout *vbox_layout; 46 QVBoxLayout *vbox_layout;
47 47
48 QAction *setting_a, *setting_b; 48 QAction *setting_a, *setting_b;
49 49
diff --git a/noncore/apps/odict/odict.pro b/noncore/apps/odict/odict.pro
index 82f6a41..4ad287b 100644
--- a/noncore/apps/odict/odict.pro
+++ b/noncore/apps/odict/odict.pro
@@ -1,30 +1,27 @@
1 TEMPLATE= app 1 CONFIG = qt warn_on release quick-app
2 CONFIG = qt warn_on debug
3 #CONFIG = qt warn_on release
4 HEADERS = odict.h \ 2 HEADERS = odict.h \
5 searchmethoddlg.h \ 3 searchmethoddlg.h \
6 configdlg.h \ 4 configdlg.h \
7 dingwidget.h 5 dingwidget.h
8 6
9 SOURCES = main.cpp \ 7 SOURCES = main.cpp \
10 odict.cpp \ 8 odict.cpp \
11 searchmethoddlg.cpp \ 9 searchmethoddlg.cpp \
12 configdlg.cpp \ 10 configdlg.cpp \
13 dingwidget.cpp 11 dingwidget.cpp
14INCLUDEPATH += $(OPIEDIR)/include 12INCLUDEPATH += $(OPIEDIR)/include
15DEPENDPATH += $(OPIEDIR)/include 13DEPENDPATH += $(OPIEDIR)/include
16 LIBS += -lqpe -lstdc++ -lopie 14 LIBS += -lqpe -lstdc++ -lopie
17 TARGET = odict 15 TARGET = odict
18 DESTDIR = $(OPIEDIR)/bin
19 16
20TRANSLATIONS = ../../../i18n/de/odict.ts \ 17TRANSLATIONS = ../../../i18n/de/odict.ts \
21 ../../../i18n/nl/odict.ts \ 18 ../../../i18n/nl/odict.ts \
22 ../../../i18n/xx/odict.ts \ 19 ../../../i18n/xx/odict.ts \
23 ../../../i18n/en/odict.ts \ 20 ../../../i18n/en/odict.ts \
24 ../../../i18n/es/odict.ts \ 21 ../../../i18n/es/odict.ts \
25 ../../../i18n/fr/odict.ts \ 22 ../../../i18n/fr/odict.ts \
26 ../../../i18n/hu/odict.ts \ 23 ../../../i18n/hu/odict.ts \
27 ../../../i18n/ja/odict.ts \ 24 ../../../i18n/ja/odict.ts \
28 ../../../i18n/ko/odict.ts \ 25 ../../../i18n/ko/odict.ts \
29 ../../../i18n/no/odict.ts \ 26 ../../../i18n/no/odict.ts \
30 ../../../i18n/pl/odict.ts \ 27 ../../../i18n/pl/odict.ts \
diff --git a/noncore/apps/opie-console/opie-console.control b/noncore/apps/opie-console/opie-console.control
index 3934fa1..504de85 100644
--- a/noncore/apps/opie-console/opie-console.control
+++ b/noncore/apps/opie-console/opie-console.control
@@ -1,11 +1,11 @@
1Package: opie-console 1Package: opie-console
2Files: plugins/application/libopie-console.so* bin/opie-console apps/Applications/opie-console.desktop pics/console/* 2Files: bin/opie-console apps/Applications/opie-console.desktop pics/console/*
3Priority: optional 3Priority: optional
4Section: opie/applications 4Section: opie/applications
5Maintainer: Opie team <opie@handhelds.org> 5Maintainer: Opie team <opie@handhelds.org>
6Architecture: arm 6Architecture: arm
7Version: 0.6-$SUB_VERSION 7Version: 0.6-$SUB_VERSION
8Depends: qpe-base, libopie1, opie-console-help-en, lrzsz, opie-keytabs 8Depends: qpe-base, libopie1, opie-console-help-en, lrzsz, opie-keytabs
9License: GPL 9License: GPL
10Description: Opie terminal app 10Description: Opie terminal app
11 11
diff --git a/noncore/apps/opie-reader/opie-reader.pro b/noncore/apps/opie-reader/opie-reader.pro
index 62113c3..686f083 100644
--- a/noncore/apps/opie-reader/opie-reader.pro
+++ b/noncore/apps/opie-reader/opie-reader.pro
@@ -1,13 +1,12 @@
1 TEMPLATE= app
2 CONFIG = qt warn_on release 1 CONFIG = qt warn_on release
3 HEADERS = Aportis.h \ 2 HEADERS = Aportis.h \
4 Bkmks.h \ 3 Bkmks.h \
5 BuffDoc.h \ 4 BuffDoc.h \
6 CAnnoEdit.h \ 5 CAnnoEdit.h \
7 CBuffer.h \ 6 CBuffer.h \
8 CDrawBuffer.h \ 7 CDrawBuffer.h \
9 CEncoding.h \ 8 CEncoding.h \
10 CEncoding_tables.h \ 9 CEncoding_tables.h \
11 CExpander.h \ 10 CExpander.h \
12 CFilter.h \ 11 CFilter.h \
13 CloseDialog.h \ 12 CloseDialog.h \
@@ -72,22 +71,22 @@ SOURCES = Aportis.cpp \
72 arith_d.cpp \ 71 arith_d.cpp \
73 fileBrowser.cpp \ 72 fileBrowser.cpp \
74 infowin.cpp \ 73 infowin.cpp \
75 main.cpp \ 74 main.cpp \
76 pdb.cpp \ 75 pdb.cpp \
77 plucker.cpp \ 76 plucker.cpp \
78 plucker_base.cpp \ 77 plucker_base.cpp \
79 ppm.cpp \ 78 ppm.cpp \
80 ppm_expander.cpp \ 79 ppm_expander.cpp \
81 version.cpp \ 80 version.cpp \
82 ztxt.cpp 81 ztxt.cpp
83 82
84 INTERFACES= 83DESTDIR = $(OPIEDIR)/bin
85 DESTDIR = $(OPIEDIR)/bin 84TARGET = reader
85
86 INCLUDEPATH+= $(OPIEDIR)/include 86 INCLUDEPATH+= $(OPIEDIR)/include
87 DEPENDPATH+= $(OPIEDIR)/include 87 DEPENDPATH+= $(OPIEDIR)/include
88 TARGET = reader
89 LIBS += -lqpe 88 LIBS += -lqpe
90 89
91include ( $(OPIEDIR)/include.pro ) 90include ( $(OPIEDIR)/include.pro )
92 91
93 92
diff --git a/noncore/apps/opie-sheet/main.cpp b/noncore/apps/opie-sheet/main.cpp
index e42b4a5..d0a2995 100644
--- a/noncore/apps/opie-sheet/main.cpp
+++ b/noncore/apps/opie-sheet/main.cpp
@@ -7,22 +7,16 @@
7 * * 7 * *
8 ***************************************************************************/ 8 ***************************************************************************/
9 9
10/* 10/*
11 * Opie Sheet (formerly Sheet/Qt) 11 * Opie Sheet (formerly Sheet/Qt)
12 * by Serdar Ozler <sozler@sitebest.com> 12 * by Serdar Ozler <sozler@sitebest.com>
13 */ 13 */
14 14
15#include <qpe/qpeapplication.h> 15#include <qpe/qpeapplication.h>
16 16
17#include "mainwindow.h" 17#include "mainwindow.h"
18 18
19int main(int argc, char **argv) 19#include <opie/oapplicationfactory.h>
20{
21 QPEApplication application(argc, argv);
22 20
23 MainWindow windowMain; 21OPIE_EXPORT_APP( OApplicationFactory<MainWindow> )
24 windowMain.setHelpFile(application.qpeDir()+"/help/html/"+QString(argv[0])+".html");
25 application.showMainDocumentWidget(&windowMain);
26 22
27 return application.exec();
28}
diff --git a/noncore/apps/opie-sheet/mainwindow.cpp b/noncore/apps/opie-sheet/mainwindow.cpp
index 43e5131..3915e52 100644
--- a/noncore/apps/opie-sheet/mainwindow.cpp
+++ b/noncore/apps/opie-sheet/mainwindow.cpp
@@ -34,26 +34,26 @@
34#include "func-divide.xpm" 34#include "func-divide.xpm"
35#include "func-paran-open.xpm" 35#include "func-paran-open.xpm"
36#include "func-paran-close.xpm" 36#include "func-paran-close.xpm"
37#include "func-comma.xpm" 37#include "func-comma.xpm"
38#include "func-func.xpm" 38#include "func-func.xpm"
39#include "func-equal.xpm" 39#include "func-equal.xpm"
40#include "cell-select.xpm" 40#include "cell-select.xpm"
41 41
42#define DEFAULT_NUM_ROWS 199 42#define DEFAULT_NUM_ROWS 199
43#define DEFAULT_NUM_COLS (26*3) 43#define DEFAULT_NUM_COLS (26*3)
44#define DEFAULT_NUM_SHEETS 3 44#define DEFAULT_NUM_SHEETS 3
45 45
46MainWindow::MainWindow() 46MainWindow::MainWindow(QWidget *parent, const char* n, WFlags fl)
47 :QMainWindow() 47 :QMainWindow(parent, n, fl)
48{ 48{
49 // initialize variables 49 // initialize variables
50 documentModified=FALSE; 50 documentModified=FALSE;
51 51
52 // construct objects 52 // construct objects
53 currentDoc=0; 53 currentDoc=0;
54 fileSelector=new FileSelector("application/sheet-qt", this, QString::null); 54 fileSelector=new FileSelector("application/sheet-qt", this, QString::null);
55 connect(fileSelector, SIGNAL(closeMe()), this, SLOT(selectorHide())); 55 connect(fileSelector, SIGNAL(closeMe()), this, SLOT(selectorHide()));
56 connect(fileSelector, SIGNAL(newSelected(const DocLnk &)), this, SLOT(selectorFileNew(const DocLnk &))); 56 connect(fileSelector, SIGNAL(newSelected(const DocLnk &)), this, SLOT(selectorFileNew(const DocLnk &)));
57 connect(fileSelector, SIGNAL(fileSelected(const DocLnk &)), this, SLOT(selectorFileOpen(const DocLnk &))); 57 connect(fileSelector, SIGNAL(fileSelected(const DocLnk &)), this, SLOT(selectorFileOpen(const DocLnk &)));
58 58
59 listSheets.setAutoDelete(TRUE); 59 listSheets.setAutoDelete(TRUE);
diff --git a/noncore/apps/opie-sheet/mainwindow.h b/noncore/apps/opie-sheet/mainwindow.h
index 10d6650..370d82e 100644
--- a/noncore/apps/opie-sheet/mainwindow.h
+++ b/noncore/apps/opie-sheet/mainwindow.h
@@ -111,22 +111,23 @@ class MainWindow: public QMainWindow
111 void slotSheetRemove(); 111 void slotSheetRemove();
112 void slotFuncOutput(); 112 void slotFuncOutput();
113 void slotCellSelect(bool lock); 113 void slotCellSelect(bool lock);
114 void slotCellClicked(const QString &cell); 114 void slotCellClicked(const QString &cell);
115 void slotSheetChanged(const QString &name); 115 void slotSheetChanged(const QString &name);
116 void slotDocModified(); 116 void slotDocModified();
117 void selectorShow(); 117 void selectorShow();
118 void selectorHide(); 118 void selectorHide();
119 void selectorFileNew(const DocLnk &lnkDoc); 119 void selectorFileNew(const DocLnk &lnkDoc);
120 void selectorFileOpen(const DocLnk &lnkDoc); 120 void selectorFileOpen(const DocLnk &lnkDoc);
121 121
122 public: 122 public:
123 MainWindow(); 123 static QString appName() { return QString::fromLatin1("sheetqt"); }
124 MainWindow(QWidget *p, const char*, WFlags);
124 ~MainWindow(); 125 ~MainWindow();
125 126
126 void setHelpFile(const QString &help_filename) { helpFile=help_filename; } 127 void setHelpFile(const QString &help_filename) { helpFile=help_filename; }
127 128
128 public slots: 129 public slots:
129 void setDocument(const QString &applnk_filename); 130 void setDocument(const QString &applnk_filename);
130}; 131};
131 132
132#endif 133#endif
diff --git a/noncore/apps/opie-sheet/opie-sheet.pro b/noncore/apps/opie-sheet/opie-sheet.pro
index 1435af6..acd5fa0 100644
--- a/noncore/apps/opie-sheet/opie-sheet.pro
+++ b/noncore/apps/opie-sheet/opie-sheet.pro
@@ -1,15 +1,13 @@
1 TEMPLATE= app 1 CONFIG = qt warn_on release quick-app
2 CONFIG = qt warn_on release
3 DESTDIR = $(OPIEDIR)/bin
4 HEADERS = mainwindow.h sheet.h cellformat.h finddlg.h numberdlg.h sortdlg.h textdlg.h 2 HEADERS = mainwindow.h sheet.h cellformat.h finddlg.h numberdlg.h sortdlg.h textdlg.h
5 SOURCES = main.cpp mainwindow.cpp sheet.cpp cellformat.cpp finddlg.cpp numberdlg.cpp sortdlg.cpp textdlg.cpp 3 SOURCES = main.cpp mainwindow.cpp sheet.cpp cellformat.cpp finddlg.cpp numberdlg.cpp sortdlg.cpp textdlg.cpp
6 INCLUDEPATH+= $(OPIEDIR)/include 4 INCLUDEPATH+= $(OPIEDIR)/include
7 DEPENDPATH+= $(OPIEDIR)/include 5 DEPENDPATH+= $(OPIEDIR)/include
8LIBS += -lqpe 6LIBS += -lqpe
9 TARGET = sheetqt 7 TARGET = sheetqt
10 8
11TRANSLATIONS = ../../../i18n/de/sheetqt.ts \ 9TRANSLATIONS = ../../../i18n/de/sheetqt.ts \
12 ../../../i18n/nl/sheetqt.ts \ 10 ../../../i18n/nl/sheetqt.ts \
13 ../../../i18n/da/sheetqt.ts \ 11 ../../../i18n/da/sheetqt.ts \
14 ../../../i18n/xx/sheetqt.ts \ 12 ../../../i18n/xx/sheetqt.ts \
15 ../../../i18n/en/sheetqt.ts \ 13 ../../../i18n/en/sheetqt.ts \
diff --git a/noncore/apps/opie-write/main.cpp b/noncore/apps/opie-write/main.cpp
index 027af38..2cdfa55 100644
--- a/noncore/apps/opie-write/main.cpp
+++ b/noncore/apps/opie-write/main.cpp
@@ -11,27 +11,18 @@
11** THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR 11** THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
12** PURPOSE. 12** PURPOSE.
13** 13**
14** email sales@trolltech.com for information about Qtopia License 14** email sales@trolltech.com for information about Qtopia License
15** Agreements. 15** Agreements.
16** 16**
17** Contact info@trolltech.com if any conditions of this licensing are 17** Contact info@trolltech.com if any conditions of this licensing are
18** not clear to you. 18** not clear to you.
19** 19**
20**********************************************************************/ 20**********************************************************************/
21 21
22#include <qpe/qpeapplication.h> 22#include <qpe/qpeapplication.h>
23#include <qpe/fileselector.h> 23#include <opie/oapplicationfactory.h>
24#include "mainwindow.h" 24#include "mainwindow.h"
25 25
26int main( int argc, char ** argv ) 26OPIE_EXPORT_APP( OApplicationFactory<MainWindow> )
27{
28 QPEApplication a( argc, argv );
29 27
30 MainWindow e;
31 a.showMainDocumentWidget(&e);
32 28
33 QObject::connect( &a, SIGNAL( lastWindowClosed() ),
34 &a, SLOT( quit() ) );
35
36 a.exec();
37}
diff --git a/noncore/apps/opie-write/mainwindow.cpp b/noncore/apps/opie-write/mainwindow.cpp
index 4a49abf..6bb524f 100644
--- a/noncore/apps/opie-write/mainwindow.cpp
+++ b/noncore/apps/opie-write/mainwindow.cpp
@@ -91,26 +91,26 @@ protected:
91 virtual void drawButtonLabel( QPainter *p ) { 91 virtual void drawButtonLabel( QPainter *p ) {
92 p->translate( -4, 0 ); 92 p->translate( -4, 0 );
93 QToolButton::drawButtonLabel( p ); 93 QToolButton::drawButtonLabel( p );
94 p->translate( 4, 0 ); 94 p->translate( 4, 0 );
95 } 95 }
96 96
97private: 97private:
98 int current; 98 int current;
99}; 99};
100 100
101//=========================================================================== 101//===========================================================================
102 102
103MainWindow::MainWindow( QWidget *parent, const char *name ) 103MainWindow::MainWindow( QWidget *parent, const char *name, WFlags fl )
104 : QMainWindow( parent, name ), 104 : QMainWindow( parent, name, fl ),
105 doc( 0 ) 105 doc( 0 )
106{ 106{
107 setRightJustification(TRUE); 107 setRightJustification(TRUE);
108 108
109 editorStack = new QWidgetStack( this ); 109 editorStack = new QWidgetStack( this );
110 110
111 fileSelector = new FileSelector( "text/html", 111 fileSelector = new FileSelector( "text/html",
112 editorStack, "fileselector" ); 112 editorStack, "fileselector" );
113 113
114 114
115 fileSelector->setCloseVisible( FALSE ); 115 fileSelector->setCloseVisible( FALSE );
116 editorStack->addWidget( fileSelector, 0 ); 116 editorStack->addWidget( fileSelector, 0 );
diff --git a/noncore/apps/opie-write/mainwindow.h b/noncore/apps/opie-write/mainwindow.h
index 565ad05..17713d8 100644
--- a/noncore/apps/opie-write/mainwindow.h
+++ b/noncore/apps/opie-write/mainwindow.h
@@ -36,27 +36,29 @@ class ButtonMenu;
36 36
37namespace Qt3 { 37namespace Qt3 {
38 38
39class QTextEdit; 39class QTextEdit;
40 40
41} 41}
42 42
43class MainWindow : public QMainWindow 43class MainWindow : public QMainWindow
44{ 44{
45 Q_OBJECT 45 Q_OBJECT
46 46
47public: 47public:
48 MainWindow( QWidget *parent = 0, const char *name = 0 ); 48 MainWindow( QWidget *parent = 0, const char *name = 0 , WFlags fl = 0);
49 ~MainWindow(); 49 ~MainWindow();
50 50
51 static QString appName() { return QString::fromLatin1("opie-write"); }
52
51protected: 53protected:
52 void closeEvent( QCloseEvent *e ); 54 void closeEvent( QCloseEvent *e );
53 55
54private slots: 56private slots:
55 // new file functions 57 // new file functions
56 void fileOpen(); 58 void fileOpen();
57 void fileRevert(); 59 void fileRevert();
58 void fileNew(); 60 void fileNew();
59 61
60 void editUndo(); 62 void editUndo();
61 void editRedo(); 63 void editRedo();
62 void editCut(); 64 void editCut();
diff --git a/noncore/apps/opie-write/opie-write.pro b/noncore/apps/opie-write/opie-write.pro
index 21a3c3a..bbaacd3 100644
--- a/noncore/apps/opie-write/opie-write.pro
+++ b/noncore/apps/opie-write/opie-write.pro
@@ -1,46 +1,27 @@
1 TEMPLATE= app
2 CONFIG += qt warn_on release
3 1
4 DESTDIR = $(OPIEDIR)/bin 2 CONFIG += qt warn on release quick-app
3
5 4
6 HEADERS =qcleanuphandler.h \ 5 HEADERS =qcleanuphandler.h \
7 qcomplextext_p.h \ 6 qcomplextext_p.h \
8 qrichtext_p.h \ 7 qrichtext_p.h \
9 qstylesheet.h \ 8 qstylesheet.h \
10 qtextedit.h \ 9 qtextedit.h \
11 mainwindow.h 10 mainwindow.h
12 11
13 SOURCES =qcomplextext.cpp \ 12 SOURCES =qcomplextext.cpp \
14 qstylesheet.cpp \ 13 qstylesheet.cpp \
15 qrichtext_p.cpp \ 14 qrichtext_p.cpp \
16 qrichtext.cpp \ 15 qrichtext.cpp \
17 qtextedit.cpp \ 16 qtextedit.cpp \
18 main.cpp \ 17 main.cpp \
19 mainwindow.cpp 18 mainwindow.cpp
20 19
21 INCLUDEPATH+= $(OPIEDIR)/include 20 INCLUDEPATH+= $(OPIEDIR)/include
22 DEPENDPATH+= $(OPIEDIR)/include 21 DEPENDPATH+= $(OPIEDIR)/include
23LIBS += -lqpe 22LIBS += -lqpe
24 23
25 TARGET = opie-write 24 TARGET = opie-write
26 25
27TRANSLATIONS = ../../../i18n/de/opie-write.ts \
28 ../../../i18n/nl/opie-write.ts \
29 ../../../i18n/da/opie-write.ts \
30 ../../../i18n/xx/opie-write.ts \
31 ../../../i18n/en/opie-write.ts \
32 ../../../i18n/es/opie-write.ts \
33 ../../../i18n/fr/opie-write.ts \
34 ../../../i18n/hu/opie-write.ts \
35 ../../../i18n/ja/opie-write.ts \
36 ../../../i18n/ko/opie-write.ts \
37 ../../../i18n/no/opie-write.ts \
38 ../../../i18n/pl/opie-write.ts \
39 ../../../i18n/pt/opie-write.ts \
40 ../../../i18n/pt_BR/opie-write.ts \
41 ../../../i18n/sl/opie-write.ts \
42 ../../../i18n/zh_CN/opie-write.ts \
43 ../../../i18n/zh_TW/opie-write.ts
44
45 26
46include ( $(OPIEDIR)/include.pro ) 27include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/apps/oxygen/main.cpp b/noncore/apps/oxygen/main.cpp
index c8fcdb4..ac992aa 100644
--- a/noncore/apps/oxygen/main.cpp
+++ b/noncore/apps/oxygen/main.cpp
@@ -8,22 +8,17 @@
8 8
9/*************************************************************************** 9/***************************************************************************
10 * * 10 * *
11 * This program is free software; you can redistribute it and/or modify * 11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by * 12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or * 13 * the Free Software Foundation; either version 2 of the License, or *
14 * ( at your option ) any later version. * 14 * ( at your option ) any later version. *
15 * * 15 * *
16 **************************************************************************/ 16 **************************************************************************/
17 17
18 18
19#include <qpe/qpeapplication.h> 19#include <qpe/qpeapplication.h>
20#include <opie/oapplicationfactory.h>
20#include "oxygen.h" 21#include "oxygen.h"
21 22
22int main(int argc, char **argv) 23
23{ 24OPIE_EXPORT_APP( OApplicationFactory<Oxygen> )
24 QPEApplication app(argc, argv);
25 Oxygen *oxi = new Oxygen();
26 app.setMainWidget(oxi);
27 oxi->showMaximized();
28 return app.exec();
29}
diff --git a/noncore/apps/oxygen/oxygen.cpp b/noncore/apps/oxygen/oxygen.cpp
index 5999cb0..5bdc2aa 100644
--- a/noncore/apps/oxygen/oxygen.cpp
+++ b/noncore/apps/oxygen/oxygen.cpp
@@ -16,33 +16,33 @@
16 **************************************************************************/ 16 **************************************************************************/
17#include "oxygen.h" 17#include "oxygen.h"
18 18
19#include <qapplication.h> 19#include <qapplication.h>
20#include <qtabwidget.h> 20#include <qtabwidget.h>
21 21
22#include "calcdlg.h" 22#include "calcdlg.h"
23#include "calcdlgui.h" 23#include "calcdlgui.h"
24#include "datawidgetui.h" 24#include "datawidgetui.h"
25#include "psewidget.h" 25#include "psewidget.h"
26 26
27 27
28Oxygen::Oxygen() : QMainWindow() 28Oxygen::Oxygen( QWidget *parent, const char *name, WFlags f) : QMainWindow( parent, name, f )
29{ 29{
30 loadNames(); 30 loadNames();
31 calcDlgUI *CalcDlgUI = new calcDlgUI(); 31 calcDlgUI *CalcDlgUI = new calcDlgUI();
32 PSEWidget *pse = new PSEWidget(names); 32 PSEWidget *pse = new PSEWidget(names);
33 dataWidgetUI *DataWidgetUI = new dataWidgetUI(names); 33 dataWidgetUI *DataWidgetUI = new dataWidgetUI(names);
34 34
35 setCaption( tr( "Oxygen" ) ); 35 setCaption( tr( "Oxygen" ) );
36 36
37 QTabWidget *tabw = new QTabWidget( this , "qtab" ); 37 QTabWidget *tabw = new QTabWidget( this , "qtab" );
38 tabw->addTab( pse, tr( "PSE" )); 38 tabw->addTab( pse, tr( "PSE" ));
39 tabw->addTab( DataWidgetUI , tr( "Data" ) ); 39 tabw->addTab( DataWidgetUI , tr( "Data" ) );
40 tabw->addTab( CalcDlgUI, tr( "Calculations" ) ); 40 tabw->addTab( CalcDlgUI, tr( "Calculations" ) );
41 setCentralWidget( tabw ); 41 setCentralWidget( tabw );
42} 42}
43 43
44void Oxygen::loadNames() 44void Oxygen::loadNames()
45{ 45{
46 names.clear(); 46 names.clear();
47 names.append( tr("Hydrogen") ); 47 names.append( tr("Hydrogen") );
48 names.append( tr("Helium") ); 48 names.append( tr("Helium") );
diff --git a/noncore/apps/oxygen/oxygen.h b/noncore/apps/oxygen/oxygen.h
index 57fe9fe..c59662d 100644
--- a/noncore/apps/oxygen/oxygen.h
+++ b/noncore/apps/oxygen/oxygen.h
@@ -4,21 +4,22 @@
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
10class QStringList; 10class QStringList;
11 11
12#include <qmainwindow.h> 12#include <qmainwindow.h>
13 13
14class Oxygen : public QMainWindow 14class Oxygen : public QMainWindow
15{ 15{
16 Q_OBJECT 16 Q_OBJECT
17 17
18 public: 18 public:
19 Oxygen(); 19 Oxygen(QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
20 20 static QString appName() { return QString::fromLatin1("oxygen"); }
21 private: 21
22 void loadNames(); 22 private:
23 QStringList names; 23 void loadNames();
24 QStringList names;
24}; 25};
diff --git a/noncore/apps/oxygen/oxygen.pro b/noncore/apps/oxygen/oxygen.pro
index a41bf7b..71d4dac 100644
--- a/noncore/apps/oxygen/oxygen.pro
+++ b/noncore/apps/oxygen/oxygen.pro
@@ -1,49 +1,27 @@
1 TEMPLATE= app 1 CONFIG = qt warn_on release quick-app
2 CONFIG = qt warn_on release
3 HEADERS = oxygen.h \ 2 HEADERS = oxygen.h \
4 kmolcalc.h \ 3 kmolcalc.h \
5 kmolelements.h \ 4 kmolelements.h \
6 calcdlgui.h \ 5 calcdlgui.h \
7 dataTable.h \ 6 dataTable.h \
8 psewidget.h \ 7 psewidget.h \
9 oxyframe.h \ 8 oxyframe.h \
10 datawidgetui.h 9 datawidgetui.h
11 10
12 SOURCES = main.cpp \ 11 SOURCES = main.cpp \
13 oxygen.cpp \ 12 oxygen.cpp \
14 kmolcalc.cpp \ 13 kmolcalc.cpp \
15 calcdlgui.cpp \ 14 calcdlgui.cpp \
16 kmolelements.cpp \ 15 kmolelements.cpp \
17 dataTable.cpp \ 16 dataTable.cpp \
18 psewidget.cpp \ 17 psewidget.cpp \
19 oxyframe.cpp \ 18 oxyframe.cpp \
20 datawidgetui.cpp 19 datawidgetui.cpp
21INCLUDEPATH += $(OPIEDIR)/include 20INCLUDEPATH += $(OPIEDIR)/include
22DEPENDPATH += $(OPIEDIR)/include 21DEPENDPATH += $(OPIEDIR)/include
23 LIBS += -lqpe -lstdc++ 22 LIBS += -lqpe
24 INTERFACES= calcdlg.ui 23 INTERFACES= calcdlg.ui
25 TARGET = oxygen
26 DESTDIR = $(OPIEDIR)/bin
27
28TRANSLATIONS = ../../../i18n/de/oxygen.ts \
29 ../../../i18n/nl/oxygen.ts \
30 ../../../i18n/xx/oxygen.ts \
31 ../../../i18n/en/oxygen.ts \
32 ../../../i18n/es/oxygen.ts \
33 ../../../i18n/fr/oxygen.ts \
34 ../../../i18n/hu/oxygen.ts \
35 ../../../i18n/ja/oxygen.ts \
36 ../../../i18n/ko/oxygen.ts \
37 ../../../i18n/no/oxygen.ts \
38 ../../../i18n/pl/oxygen.ts \
39 ../../../i18n/pt/oxygen.ts \
40 ../../../i18n/pt_BR/oxygen.ts \
41 ../../../i18n/sl/oxygen.ts \
42 ../../../i18n/zh_CN/oxygen.ts \
43 ../../../i18n/zh_TW/oxygen.ts \
44 ../../../i18n/it/oxygen.ts \
45 ../../../i18n/da/oxygen.ts
46
47 24
25 TARGET= oxygen
48 26
49include ( $(OPIEDIR)/include.pro ) 27include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/apps/tableviewer/main.cpp b/noncore/apps/tableviewer/main.cpp
index d17ee65..ce39c84 100644
--- a/noncore/apps/tableviewer/main.cpp
+++ b/noncore/apps/tableviewer/main.cpp
@@ -10,23 +10,16 @@
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#include "tableviewer.h" 20#include "tableviewer.h"
21#include <qpe/qpeapplication.h> 21#include <qpe/qpeapplication.h>
22#include <opie/oapplicationfactory.h>
22 23
23int main( int argc, char ** argv ) 24OPIE_EXPORT_APP( OApplicationFactory<TableViewerWindow> )
24{
25 QPEApplication a( argc, argv );
26 25
27 TableViewerWindow mw;
28 mw.setCaption( TableViewerWindow::tr("Table Viewer") );
29 a.showMainWidget(&mw);
30
31 return a.exec();
32}
diff --git a/noncore/apps/tableviewer/tableviewer.h b/noncore/apps/tableviewer/tableviewer.h
index 817db21..f56a460 100644
--- a/noncore/apps/tableviewer/tableviewer.h
+++ b/noncore/apps/tableviewer/tableviewer.h
@@ -31,24 +31,25 @@ class QMenuBar;
31 31
32class TVListView; 32class TVListView;
33class TVBrowseView; 33class TVBrowseView;
34class TVFilterView; 34class TVFilterView;
35class TVEditView; 35class TVEditView;
36 36
37class DBStore; 37class DBStore;
38 38
39class TableViewerWindow: public QMainWindow 39class TableViewerWindow: public QMainWindow
40{ 40{
41 Q_OBJECT 41 Q_OBJECT
42public: 42public:
43 static QString appName() { return QString::fromLatin1("tableviewer"); }
43 TableViewerWindow( QWidget *parent = 0, 44 TableViewerWindow( QWidget *parent = 0,
44 const char *name = 0, WFlags f = 0 ); 45 const char *name = 0, WFlags f = 0 );
45 ~TableViewerWindow(); 46 ~TableViewerWindow();
46 47
47public slots: 48public slots:
48 void selectDocument(); 49 void selectDocument();
49 50
50 void newDocument(); 51 void newDocument();
51 void saveDocument(); 52 void saveDocument();
52 void setDocument(const QString &); 53 void setDocument(const QString &);
53 void openDocument(const DocLnk &); 54 void openDocument(const DocLnk &);
54 55
diff --git a/noncore/apps/tableviewer/tableviewer.pro b/noncore/apps/tableviewer/tableviewer.pro
index f047e0b..c6d9e68 100644
--- a/noncore/apps/tableviewer/tableviewer.pro
+++ b/noncore/apps/tableviewer/tableviewer.pro
@@ -1,15 +1,13 @@
1 TEMPLATE= app 1 CONFIG = qt warn_on debug quick-app
2 CONFIG = qt warn_on debug
3 DESTDIR = $(OPIEDIR)/bin
4 SUBDIRS = db ui 2 SUBDIRS = db ui
5 HEADERS = tableviewer.h \ 3 HEADERS = tableviewer.h \
6 xmlencodeattr.h \ 4 xmlencodeattr.h \
7 ui/commonwidgets.h \ 5 ui/commonwidgets.h \
8 ui/tvbrowseview.h \ 6 ui/tvbrowseview.h \
9 ui/tvlistview.h \ 7 ui/tvlistview.h \
10 ui/tvfilterview.h \ 8 ui/tvfilterview.h \
11 ui/tveditview.h \ 9 ui/tveditview.h \
12 ui/browsekeyentry.h \ 10 ui/browsekeyentry.h \
13 ui/filterkeyentry.h \ 11 ui/filterkeyentry.h \
14 ui/tvkeyedit.h \ 12 ui/tvkeyedit.h \
15 db/datacache.h \ 13 db/datacache.h \
diff --git a/noncore/apps/tinykate/main.cpp b/noncore/apps/tinykate/main.cpp
index e06668a..e21c040 100644
--- a/noncore/apps/tinykate/main.cpp
+++ b/noncore/apps/tinykate/main.cpp
@@ -4,25 +4,19 @@
4 begin : November 2002 4 begin : November 2002
5 copyright : (C) 2002 by Joseph Wenninger <jowenn@kde.org> 5 copyright : (C) 2002 by Joseph Wenninger <jowenn@kde.org>
6 ***************************************************************************/ 6 ***************************************************************************/
7 7
8/*************************************************************************** 8/***************************************************************************
9 * * 9 * *
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. * 12 * the Free Software Foundation. *
13 * ONLY VERSION 2 OF THE LICENSE IS APPLICABLE * 13 * ONLY VERSION 2 OF THE LICENSE IS APPLICABLE *
14 * * 14 * *
15 ***************************************************************************/ 15 ***************************************************************************/
16#include <qpe/qpeapplication.h>
17#include <qmainwindow.h> 16#include <qmainwindow.h>
18#include "tinykate.h" 17#include "tinykate.h"
19 18
19#include <opie/oapplicationfactory.h>
20 20
21int main( int argc, char ** argv ) 21OPIE_EXPORT_APP( OApplicationFactory<TinyKate> )
22{
23 QPEApplication a( argc, argv );
24 22
25 TinyKate m;
26 a.showMainWidget(&m );
27 return a.exec();
28}
diff --git a/noncore/apps/tinykate/opie-tinykate.control b/noncore/apps/tinykate/opie-tinykate.control
index 1fde467..9bc0130 100644
--- a/noncore/apps/tinykate/opie-tinykate.control
+++ b/noncore/apps/tinykate/opie-tinykate.control
@@ -1,9 +1,9 @@
1Package: opie-tinykate 1Package: opie-tinykate
2Files: plugins/application/libtinykate.so* bin/tinykate apps/Applications/tinykate.desktop pics/tinykate $OPIEDIR/lib/libtinykate.so.1.0.0 $OPIEDIR/lib/libtinykate.so.1.0 $OPIEDIR/lib/libtinykate.so.1 2Files: plugins/application/libkate.so* bin/kate apps/Applications/tinykate.desktop pics/tinykate $OPIEDIR/lib/libtinykate.so.1.0.0 $OPIEDIR/lib/libtinykate.so.1.0 $OPIEDIR/lib/libtinykate.so.1
3Priority: optional 3Priority: optional
4Section: opie/applications 4Section: opie/applications
5Maintainer: Opie Team <opie@handhelds.org> 5Maintainer: Opie Team <opie@handhelds.org>
6Architecture: arm 6Architecture: arm
7Depends: task-opie-minimal 7Depends: task-opie-minimal
8Description: Kate for opie 8Description: Kate for opie
9Version: $QPE_VERSION$EXTRAVERSION 9Version: $QPE_VERSION$EXTRAVERSION
diff --git a/noncore/apps/tinykate/tinykate.h b/noncore/apps/tinykate/tinykate.h
index 2bf4de6..a5ee9b9 100644
--- a/noncore/apps/tinykate/tinykate.h
+++ b/noncore/apps/tinykate/tinykate.h
@@ -24,24 +24,26 @@
24#include <ktexteditor.h> 24#include <ktexteditor.h>
25 25
26class QToolButton; 26class QToolButton;
27class QAction; 27class QAction;
28class QPopupMenu; 28class QPopupMenu;
29 29
30class TinyKate : public QMainWindow 30class TinyKate : public QMainWindow
31{ 31{
32Q_OBJECT 32Q_OBJECT
33public: 33public:
34 TinyKate( QWidget *parent=0, const char *name=0, WFlags f = 0); 34 TinyKate( QWidget *parent=0, const char *name=0, WFlags f = 0);
35 ~TinyKate( ); 35 ~TinyKate( );
36 static QString appName() { return QString::fromLatin1( "kate" ); };
37
36 38
37public slots: 39public slots:
38 void slotNew(); 40 void slotNew();
39 void setDocument(const QString& fileref); 41 void setDocument(const QString& fileref);
40 42
41protected slots: 43protected slots:
42 void slotOpen(); 44 void slotOpen();
43 void slotClose(); 45 void slotClose();
44 void slotCurrentChanged(QWidget *); 46 void slotCurrentChanged(QWidget *);
45 void slotSave(); 47 void slotSave();
46 void slotSaveAs(); 48 void slotSaveAs();
47protected: 49protected:
diff --git a/noncore/apps/tinykate/tinykate.pro b/noncore/apps/tinykate/tinykate.pro
index 632bd49..91d4230 100644
--- a/noncore/apps/tinykate/tinykate.pro
+++ b/noncore/apps/tinykate/tinykate.pro
@@ -1,22 +1,22 @@
1 TEMPLATE= app 1 TEMPLATE= app
2 CONFIG = qt warn_on release 2 CONFIG = qt warn_on release quick-app
3 DESTDIR = $(OPIEDIR)/bin 3 DESTDIR = $(OPIEDIR)/bin
4 HEADERS = tinykate.h 4 HEADERS = tinykate.h
5 SOURCES = tinykate.cpp main.cpp 5 SOURCES = tinykate.cpp main.cpp
6 INTERFACES= 6 INTERFACES=
7 INCLUDEPATH+= $(OPIEDIR)/include \ 7 INCLUDEPATH+= $(OPIEDIR)/include \
8 $(OPIEDIR)/noncore/apps/tinykate/libkate \ 8 $(OPIEDIR)/noncore/apps/tinykate/libkate \
9 $(OPIEDIR)/noncore/apps/tinykate/libkate/microkde \ 9 $(OPIEDIR)/noncore/apps/tinykate/libkate/microkde \
10 $(OPIEDIR)/noncore/apps/tinykate/libkate/document \ 10 $(OPIEDIR)/noncore/apps/tinykate/libkate/document \
11 $(OPIEDIR)/noncore/apps/tinykate/libkate/view \ 11 $(OPIEDIR)/noncore/apps/tinykate/libkate/view \
12 $(OPIEDIR)/noncore/apps/tinykate/libkate/interfaces \ 12 $(OPIEDIR)/noncore/apps/tinykate/libkate/interfaces \
13 $(OPIEDIR)/noncore/apps/tinykate/libkate/ktexteditor \ 13 $(OPIEDIR)/noncore/apps/tinykate/libkate/ktexteditor \
14 $(OPIEDIR)/noncore/apps/tinykate/libkate/qt3back 14 $(OPIEDIR)/noncore/apps/tinykate/libkate/qt3back
15 15
16 DEPENDPATH+= $(OPIEDIR)/include 16 DEPENDPATH+= $(OPIEDIR)/include
17LIBS += -lqpe -ltinykate -lopie 17LIBS += -lqpe -ltinykate -lopie
18 TARGET = tinykate 18 TARGET = kate
19 19
20 20
21 21
22include ( $(OPIEDIR)/include.pro ) 22include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/apps/zsafe/.cvsignore b/noncore/apps/zsafe/.cvsignore
new file mode 100644
index 0000000..2f8556e
--- a/dev/null
+++ b/noncore/apps/zsafe/.cvsignore
@@ -0,0 +1,3 @@
1Makefile
2Makefile.in
3moc*
diff --git a/noncore/settings/aqpkg/.cvsignore b/noncore/settings/aqpkg/.cvsignore
index 2888d4a..4183697 100644
--- a/noncore/settings/aqpkg/.cvsignore
+++ b/noncore/settings/aqpkg/.cvsignore
@@ -1,2 +1,3 @@
1Makefile* 1Makefile*
2moc* 2moc*
3.moc*
diff --git a/noncore/settings/aqpkg/aqpkg.pro b/noncore/settings/aqpkg/aqpkg.pro
index d241d1b..882cfd4 100644
--- a/noncore/settings/aqpkg/aqpkg.pro
+++ b/noncore/settings/aqpkg/aqpkg.pro
@@ -1,14 +1,13 @@
1 TEMPLATE= app 1 CONFIG = qt warn_on release quick-app
2 CONFIG = qt warn_on release
3 HEADERS = global.h \ 2 HEADERS = global.h \
4 mainwin.h \ 3 mainwin.h \
5 datamgr.h \ 4 datamgr.h \
6 settingsimpl.h \ 5 settingsimpl.h \
7 ipkg.h \ 6 ipkg.h \
8 packagewin.h \ 7 packagewin.h \
9 package.h \ 8 package.h \
10 installdlgimpl.h \ 9 installdlgimpl.h \
11 instoptionsimpl.h \ 10 instoptionsimpl.h \
12 destination.h \ 11 destination.h \
13 utils.h \ 12 utils.h \
14 server.h \ 13 server.h \
@@ -23,40 +22,19 @@ SOURCES = mainwin.cpp \
23 main.cpp \ 22 main.cpp \
24 packagewin.cpp \ 23 packagewin.cpp \
25 package.cpp \ 24 package.cpp \
26 installdlgimpl.cpp \ 25 installdlgimpl.cpp \
27 instoptionsimpl.cpp \ 26 instoptionsimpl.cpp \
28 destination.cpp \ 27 destination.cpp \
29 utils.cpp \ 28 utils.cpp \
30 server.cpp \ 29 server.cpp \
31 letterpushbutton.cpp \ 30 letterpushbutton.cpp \
32 inputdlg.cpp \ 31 inputdlg.cpp \
33 version.cpp \ 32 version.cpp \
34 categoryfilterimpl.cpp 33 categoryfilterimpl.cpp
35 INTERFACES=
36 TARGET = aqpkg 34 TARGET = aqpkg
37INCLUDEPATH += $(OPIEDIR)/include 35INCLUDEPATH += $(OPIEDIR)/include
38DEPENDPATH += $(OPIEDIR)/include 36DEPENDPATH += $(OPIEDIR)/include
39LIBS += -lqpe -lopie -lstdc++ 37LIBS += -lqpe -lopie -lstdc++
40DESTDIR = $(OPIEDIR)/bin
41
42TRANSLATIONS = ../../../i18n/de/aqpkg.ts \
43 ../../../i18n/nl/aqpkg.ts \
44 ../../../i18n/xx/aqpkg.ts \
45 ../../../i18n/en/aqpkg.ts \
46 ../../../i18n/es/aqpkg.ts \
47 ../../../i18n/fr/aqpkg.ts \
48 ../../../i18n/hu/aqpkg.ts \
49 ../../../i18n/ja/aqpkg.ts \
50 ../../../i18n/ko/aqpkg.ts \
51 ../../../i18n/no/aqpkg.ts \
52 ../../../i18n/pl/aqpkg.ts \
53 ../../../i18n/pt/aqpkg.ts \
54 ../../../i18n/pt_BR/aqpkg.ts \
55 ../../../i18n/sl/aqpkg.ts \
56 ../../../i18n/zh_CN/aqpkg.ts \
57 ../../../i18n/zh_TW/aqpkg.ts \
58 ../../../i18n/it/aqpkg.ts \
59 ../../../i18n/da/aqpkg.ts
60
61 38
62include ( $(OPIEDIR)/include.pro ) 39include ( $(OPIEDIR)/include.pro )
40
diff --git a/noncore/settings/aqpkg/main.cpp b/noncore/settings/aqpkg/main.cpp
index b7f8b7b..179f8b7 100644
--- a/noncore/settings/aqpkg/main.cpp
+++ b/noncore/settings/aqpkg/main.cpp
@@ -18,61 +18,21 @@
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details. 19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .: 20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU 21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file; 22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the 23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc., 24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330, 25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA. 26 Boston, MA 02111-1307, USA.
27 27
28*/ 28*/
29 29
30#ifdef QWS
31#include <qpe/qpeapplication.h>
32#include <qpe/qcopenvelope_qws.h>
33#else
34#include <qapplication.h>
35#endif
36
37#include <qobjectdefs.h>
38
39#include "mainwin.h" 30#include "mainwin.h"
40#include "server.h"
41
42#include "global.h"
43 31
32#include <opie/oapplicationfactory.h>
44 33
45/* be less intrusive for translation -zecke */ 34/* be less intrusive for translation -zecke */
46extern QString LOCAL_SERVER; 35extern QString LOCAL_SERVER;
47extern QString LOCAL_IPKGS; 36extern QString LOCAL_IPKGS;
48 37
49int main(int argc, char *argv[]) 38OPIE_EXPORT_APP( OApplicationFactory<MainWindow> )
50{
51#ifdef QWS
52 QPEApplication a( argc, argv );
53#else
54 QApplication a( argc, argv );
55#endif
56
57#ifdef QWS
58 // Disable suspend mode
59 QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::DisableSuspend;
60#endif
61
62 LOCAL_SERVER = QObject::tr( "Installed packages" );
63 LOCAL_IPKGS = QObject::tr( "Local packages" );
64
65 MainWindow *win = new MainWindow();
66 a.setMainWidget(win);
67 win->showMaximized();
68
69 a.exec();
70
71#ifdef QWS
72 // Reenable suspend mode
73 QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable;
74#endif
75 #ifdef _DEBUG
76 DumpUnfreed();
77 #endif
78}
diff --git a/noncore/settings/aqpkg/mainwin.cpp b/noncore/settings/aqpkg/mainwin.cpp
index 42093cf..dbe694e 100644
--- a/noncore/settings/aqpkg/mainwin.cpp
+++ b/noncore/settings/aqpkg/mainwin.cpp
@@ -1,15 +1,15 @@
1/* 1/*
2                This file is part of the OPIE Project 2                This file is part of the OPIE Project
3 3
4 =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk> 4 =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk>
5             .=l. Dan Williams <drw@handhelds.org> 5             .=l. Dan Williams <drw@handhelds.org>
6           .>+-= 6           .>+-=
7 _;:,     .>    :=|. This file is free software; you can 7 _;:,     .>    :=|. This file 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 General Public 9:`=1 )Y*s>-.--   : the terms of the GNU 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 file is distributed in the hope that 14    .i_,=:_.      -<s. This file is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
@@ -57,27 +57,33 @@
57#include "global.h" 57#include "global.h"
58#include "inputdlg.h" 58#include "inputdlg.h"
59#include "ipkg.h" 59#include "ipkg.h"
60#include "installdlgimpl.h" 60#include "installdlgimpl.h"
61#include "letterpushbutton.h" 61#include "letterpushbutton.h"
62#include "mainwin.h" 62#include "mainwin.h"
63#include "packagewin.h" 63#include "packagewin.h"
64#include "settingsimpl.h" 64#include "settingsimpl.h"
65#include "utils.h" 65#include "utils.h"
66 66
67extern int compareVersions( const char *v1, const char *v2 ); 67extern int compareVersions( const char *v1, const char *v2 );
68 68
69MainWindow :: MainWindow() 69MainWindow :: MainWindow( QWidget* parent, const char* name, WFlags fl )
70 :QMainWindow( 0x0, 0x0, WStyle_ContextHelp ) 70 :QMainWindow( parent, name, fl || WStyle_ContextHelp )
71{ 71{
72 // Disable suspend mode
73 QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::DisableSuspend;
74
75 LOCAL_SERVER = QObject::tr( "Installed packages" );
76 LOCAL_IPKGS = QObject::tr( "Local packages" );
77
72 setCaption( tr( "AQPkg - Package Manager" ) ); 78 setCaption( tr( "AQPkg - Package Manager" ) );
73 79
74 // Create UI widgets 80 // Create UI widgets
75 initMainWidget(); 81 initMainWidget();
76 initProgressWidget(); 82 initProgressWidget();
77 83
78 // Build menu and tool bars 84 // Build menu and tool bars
79 setToolBarsMovable( FALSE ); 85 setToolBarsMovable( FALSE );
80 86
81 QToolBar *bar = new QToolBar( this ); 87 QToolBar *bar = new QToolBar( this );
82 bar->setHorizontalStretchable( TRUE ); 88 bar->setHorizontalStretchable( TRUE );
83 QMenuBar *mb = new QMenuBar( bar ); 89 QMenuBar *mb = new QMenuBar( bar );
@@ -225,24 +231,27 @@ MainWindow :: MainWindow()
225 stack->addWidget( progressWindow, 2 ); 231 stack->addWidget( progressWindow, 2 );
226 stack->addWidget( networkPkgWindow, 1 ); 232 stack->addWidget( networkPkgWindow, 1 );
227 setCentralWidget( stack ); 233 setCentralWidget( stack );
228 stack->raiseWidget( progressWindow ); 234 stack->raiseWidget( progressWindow );
229 235
230 // Delayed call to finish initialization 236 // Delayed call to finish initialization
231 QTimer::singleShot( 100, this, SLOT( init() ) ); 237 QTimer::singleShot( 100, this, SLOT( init() ) );
232} 238}
233 239
234MainWindow :: ~MainWindow() 240MainWindow :: ~MainWindow()
235{ 241{
236 delete mgr; 242 delete mgr;
243
244 // Reenable suspend mode
245 QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable;
237} 246}
238 247
239void MainWindow :: initMainWidget() 248void MainWindow :: initMainWidget()
240{ 249{
241 networkPkgWindow = new QWidget( this ); 250 networkPkgWindow = new QWidget( this );
242 251
243 QLabel *l = new QLabel( tr( "Servers:" ), networkPkgWindow ); 252 QLabel *l = new QLabel( tr( "Servers:" ), networkPkgWindow );
244 253
245 serversList = new QComboBox( networkPkgWindow ); 254 serversList = new QComboBox( networkPkgWindow );
246 connect( serversList, SIGNAL(activated(int)), this, SLOT(serverSelected(int)) ); 255 connect( serversList, SIGNAL(activated(int)), this, SLOT(serverSelected(int)) );
247 QWhatsThis::add( serversList, tr( "Click here to select a package feed." ) ); 256 QWhatsThis::add( serversList, tr( "Click here to select a package feed." ) );
248 257
@@ -1003,25 +1012,24 @@ InstallData *MainWindow :: dealWithItem( QCheckListItem *item )
1003 QString dest = "root"; 1012 QString dest = "root";
1004 if ( !p->isInstalled() ) 1013 if ( !p->isInstalled() )
1005 { 1014 {
1006 InstallData *newitem = new InstallData(); 1015 InstallData *newitem = new InstallData();
1007 newitem->option = "I"; 1016 newitem->option = "I";
1008 newitem->packageName = name; 1017 newitem->packageName = name;
1009 return newitem; 1018 return newitem;
1010 } 1019 }
1011 else 1020 else
1012 { 1021 {
1013 InstallData *newitem = new InstallData(); 1022 InstallData *newitem = new InstallData();
1014 newitem->option = "D"; 1023 newitem->option = "D";
1015
1016 // If local file, remove using package name, not filename 1024 // If local file, remove using package name, not filename
1017 if ( p->isPackageStoredLocally() ) 1025 if ( p->isPackageStoredLocally() )
1018 name = item->text(); 1026 name = item->text();
1019 1027
1020 if ( !p->isPackageStoredLocally() ) 1028 if ( !p->isPackageStoredLocally() )
1021 newitem->packageName = p->getInstalledPackageName(); 1029 newitem->packageName = p->getInstalledPackageName();
1022 else 1030 else
1023 newitem->packageName = name; 1031 newitem->packageName = name;
1024 1032
1025 if ( p->getInstalledTo() ) 1033 if ( p->getInstalledTo() )
1026 { 1034 {
1027 newitem->destination = p->getInstalledTo(); 1035 newitem->destination = p->getInstalledTo();
@@ -1037,25 +1045,24 @@ InstallData *MainWindow :: dealWithItem( QCheckListItem *item )
1037 // If the version requested is older and user selected a local ipk file, then reinstall the file 1045 // If the version requested is older and user selected a local ipk file, then reinstall the file
1038 if ( p->isPackageStoredLocally() && val == -1 ) 1046 if ( p->isPackageStoredLocally() && val == -1 )
1039 val = 0; 1047 val = 0;
1040 1048
1041 if ( val == -2 ) 1049 if ( val == -2 )
1042 { 1050 {
1043 // Error - should handle 1051 // Error - should handle
1044 } 1052 }
1045 else if ( val == -1 ) 1053 else if ( val == -1 )
1046 { 1054 {
1047 // Version available is older - remove only 1055 // Version available is older - remove only
1048 newitem->option = "D"; 1056 newitem->option = "D";
1049
1050 // If local file, remove using package name, not filename 1057 // If local file, remove using package name, not filename
1051 if ( p->isPackageStoredLocally() ) 1058 if ( p->isPackageStoredLocally() )
1052 name = item->text(); 1059 name = item->text();
1053 } 1060 }
1054 else 1061 else
1055 { 1062 {
1056 QString caption; 1063 QString caption;
1057 QString text; 1064 QString text;
1058 QString secondButton; 1065 QString secondButton;
1059 QString secondOption; 1066 QString secondOption;
1060 if ( val == 0 ) 1067 if ( val == 0 )
1061 { 1068 {
@@ -1180,54 +1187,54 @@ void MainWindow :: letterPushed( QString t )
1180void MainWindow :: slotDisplayPackage( QListViewItem *item ) 1187void MainWindow :: slotDisplayPackage( QListViewItem *item )
1181{ 1188{
1182 QString itemstr( ((QCheckListItem*)item)->text() ); 1189 QString itemstr( ((QCheckListItem*)item)->text() );
1183 PackageWindow *p = new PackageWindow( mgr->getServer( serversList->currentText() )->getPackage( itemstr ) ); 1190 PackageWindow *p = new PackageWindow( mgr->getServer( serversList->currentText() )->getPackage( itemstr ) );
1184 p->showMaximized(); 1191 p->showMaximized();
1185} 1192}
1186 1193
1187QuestionDlg::QuestionDlg( const QString &caption, const QString &text, const QString &secondbtn ) 1194QuestionDlg::QuestionDlg( const QString &caption, const QString &text, const QString &secondbtn )
1188 : QWidget( 0x0, 0x0, WType_Modal | WType_TopLevel | WStyle_Dialog ) 1195 : QWidget( 0x0, 0x0, WType_Modal | WType_TopLevel | WStyle_Dialog )
1189{ 1196{
1190 setCaption( caption ); 1197 setCaption( caption );
1191 resize( 175, 100 ); 1198 resize( 175, 100 );
1192 1199
1193 QGridLayout *layout = new QGridLayout( this ); 1200 QGridLayout *layout = new QGridLayout( this );
1194 1201
1195 QLabel *l = new QLabel( text, this ); 1202 QLabel *l = new QLabel( text, this );
1196 l->setAlignment( AlignCenter | WordBreak ); 1203 l->setAlignment( AlignCenter | WordBreak );
1197 layout->addMultiCellWidget( l, 0, 0, 0, 1 ); 1204 layout->addMultiCellWidget( l, 0, 0, 0, 1 );
1198 1205
1199 btn1 = new QPushButton( tr( "Remove" ), this ); 1206 btn1 = new QPushButton( tr( "Remove" ), this );
1200 connect( btn1, SIGNAL(clicked()), this, SLOT(slotButtonPressed()) ); 1207 connect( btn1, SIGNAL(clicked()), this, SLOT(slotButtonPressed()) );
1201 layout->addWidget( btn1, 1, 0 ); 1208 layout->addWidget( btn1, 1, 0 );
1202 1209
1203 btn2 = new QPushButton( secondbtn, this ); 1210 btn2 = new QPushButton( secondbtn, this );
1204 connect( btn2, SIGNAL(clicked()), this, SLOT(slotButtonPressed()) ); 1211 connect( btn2, SIGNAL(clicked()), this, SLOT(slotButtonPressed()) );
1205 layout->addWidget( btn2, 1, 1 ); 1212 layout->addWidget( btn2, 1, 1 );
1206 1213
1207 executing = FALSE; 1214 executing = FALSE;
1208} 1215}
1209 1216
1210int QuestionDlg::exec() 1217int QuestionDlg::exec()
1211{ 1218{
1212 show(); 1219 show();
1213 1220
1214 if ( !executing ) 1221 if ( !executing )
1215 { 1222 {
1216 executing = TRUE; 1223 executing = TRUE;
1217 qApp->enter_loop(); 1224 qApp->enter_loop();
1218 } 1225 }
1219 1226
1220 return buttonpressed; 1227 return buttonpressed;
1221} 1228}
1222 1229
1223void QuestionDlg::slotButtonPressed() 1230void QuestionDlg::slotButtonPressed()
1224{ 1231{
1225 if ( sender() == btn1 ) 1232 if ( sender() == btn1 )
1226 buttonpressed = 1; 1233 buttonpressed = 1;
1227 else if ( sender() == btn2 ) 1234 else if ( sender() == btn2 )
1228 buttonpressed = 2; 1235 buttonpressed = 2;
1229 else 1236 else
1230 buttonpressed = 0; 1237 buttonpressed = 0;
1231 1238
1232 qApp->exit_loop(); 1239 qApp->exit_loop();
1233} 1240}
diff --git a/noncore/settings/aqpkg/mainwin.h b/noncore/settings/aqpkg/mainwin.h
index 615ff8b..b8e1c98 100644
--- a/noncore/settings/aqpkg/mainwin.h
+++ b/noncore/settings/aqpkg/mainwin.h
@@ -42,29 +42,30 @@ class QCheckListItem;
42class QComboBox; 42class QComboBox;
43class QLabel; 43class QLabel;
44class QLineEdit; 44class QLineEdit;
45class QListView; 45class QListView;
46class QListViewItem; 46class QListViewItem;
47class QToolBar; 47class QToolBar;
48class QProgressBar; 48class QProgressBar;
49class QPushButton; 49class QPushButton;
50class QWidgetStack; 50class QWidgetStack;
51 51
52class MainWindow :public QMainWindow 52class MainWindow :public QMainWindow
53{ 53{
54 Q_OBJECT 54 Q_OBJECT
55public: 55public:
56 56
57 MainWindow(); 57 MainWindow( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
58 ~MainWindow(); 58 ~MainWindow();
59 static QString appName() { return QString::fromLatin1( "aqpkg" ); };
59 60
60protected: 61protected:
61 void closeEvent( QCloseEvent* e ); 62 void closeEvent( QCloseEvent* e );
62 63
63private: 64private:
64 DataManager *mgr; 65 DataManager *mgr;
65 66
66 QWidgetStack *stack; 67 QWidgetStack *stack;
67 68
68 QToolBar *findBar; 69 QToolBar *findBar;
69 QToolBar *jumpBar; 70 QToolBar *jumpBar;
70 QLineEdit *findEdit; 71 QLineEdit *findEdit;
diff --git a/noncore/settings/sysinfo/main.cpp b/noncore/settings/sysinfo/main.cpp
index 6e889db..02b1098 100644
--- a/noncore/settings/sysinfo/main.cpp
+++ b/noncore/settings/sysinfo/main.cpp
@@ -12,23 +12,16 @@
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 "sysinfo.h" 21#include "sysinfo.h"
22 22
23#include <qpe/qpeapplication.h> 23#include <qpe/qpeapplication.h>
24#include <opie/oapplicationfactory.h>
24 25
25int main( int argc, char *argv[] )
26{
27 QPEApplication a( argc, argv );
28
29 SystemInfo *si = new SystemInfo();
30 a.showMainWidget( si );
31
32 return a.exec();
33}
34 26
27OPIE_EXPORT_APP( OApplicationFactory<SystemInfo> )
diff --git a/noncore/settings/sysinfo/storage.cpp b/noncore/settings/sysinfo/storage.cpp
index c4474d5..4ef7122 100644
--- a/noncore/settings/sysinfo/storage.cpp
+++ b/noncore/settings/sysinfo/storage.cpp
@@ -41,75 +41,67 @@ FileSysInfo::FileSysInfo( QWidget *parent, const char *name )
41{ 41{
42 QVBoxLayout *tmpvb = new QVBoxLayout( this ); 42 QVBoxLayout *tmpvb = new QVBoxLayout( this );
43 QScrollView *sv = new QScrollView( this ); 43 QScrollView *sv = new QScrollView( this );
44 tmpvb->addWidget( sv, 0, 0 ); 44 tmpvb->addWidget( sv, 0, 0 );
45 sv->setResizePolicy( QScrollView::AutoOneFit ); 45 sv->setResizePolicy( QScrollView::AutoOneFit );
46 sv->setFrameStyle( QFrame::NoFrame ); 46 sv->setFrameStyle( QFrame::NoFrame );
47 container = new QWidget( sv->viewport() ); 47 container = new QWidget( sv->viewport() );
48 sv->addChild( container ); 48 sv->addChild( container );
49 vb = 0x0; 49 vb = 0x0;
50 50
51 storage = new StorageInfo( this ); 51 storage = new StorageInfo( this );
52 connect( storage, SIGNAL( disksChanged() ), this, SLOT( disksChanged() ) ); 52 connect( storage, SIGNAL( disksChanged() ), this, SLOT( disksChanged() ) );
53 53
54 lines.setAutoDelete(TRUE); 54 lines.setAutoDelete(TRUE);
55 55
56 rebuildDisks = TRUE; 56 rebuildDisks = TRUE;
57 updateMounts(); 57 updateMounts();
58 startTimer( 5000 ); 58 startTimer( 5000 );
59} 59}
60 60
61
61void FileSysInfo::timerEvent(QTimerEvent*) 62void FileSysInfo::timerEvent(QTimerEvent*)
62{ 63{
63 updateMounts(); 64 updateMounts();
64} 65}
65 66
66void FileSysInfo::updateMounts() 67void FileSysInfo::updateMounts()
67{ 68{
68 storage->update(); 69 storage->update();
69 70
70 if ( rebuildDisks ) 71 if ( rebuildDisks )
71 { 72 {
72 // Cannot auto delete QDict<MountInfo> disks because it seems to delete
73 // the filesystem object as well causing a segfault
74 MountInfo *mi;
75 for ( QDictIterator<MountInfo> delit(disks); delit.current(); ++delit )
76 {
77 mi = delit.current();
78 mi->fs = 0x0;
79 delete mi;
80 }
81 disks.clear(); 73 disks.clear();
82 lines.clear(); 74 lines.clear();
83 75
84 delete vb; 76 delete vb;
85 vb = new QVBoxLayout( container/*, n > 3 ? 1 : 5*/ ); 77 vb = new QVBoxLayout( container/*, n > 3 ? 1 : 5*/ );
86 78
87 bool frst=TRUE; 79 bool frst=TRUE;
88 80
89 FileSystem *fs; 81 FileSystem *fs;
90 for ( QListIterator<FileSystem> it(storage->fileSystems()); it.current(); ++it ) 82 for ( QListIterator<FileSystem> it(storage->fileSystems()); it.current(); ++it )
91 { 83 {
92 fs = it.current(); 84 fs = it.current();
93 85
94 if ( !frst ) 86 if ( !frst )
95 { 87 {
96 QFrame *f = new QFrame( container ); 88 QFrame *f = new QFrame( container );
97 vb->addWidget(f); 89 vb->addWidget(f);
98 f->setFrameStyle( QFrame::HLine | QFrame::Sunken ); 90 f->setFrameStyle( QFrame::HLine | QFrame::Sunken );
99 lines.append(f); 91 lines.append(f);
100 f->show(); 92 f->show();
101 } 93 }
102 frst = FALSE; 94 frst = FALSE;
103 95
104 MountInfo *mi = new MountInfo( fs, container ); 96 MountInfo *mi = new MountInfo( fs, container );
105 vb->addWidget( mi ); 97 vb->addWidget( mi );
106 disks.insert( fs->path(), mi ); 98 disks.insert( fs->path(), mi );
107 mi->show(); 99 mi->show();
108 QString tempstr = fs->name().left( 2 ); 100 QString tempstr = fs->name().left( 2 );
109 if ( tempstr == tr( "CF" ) ) 101 if ( tempstr == tr( "CF" ) )
110 QWhatsThis::add( mi, tr( "This graph represents how much memory is currently used on this Compact Flash memory card." ) ); 102 QWhatsThis::add( mi, tr( "This graph represents how much memory is currently used on this Compact Flash memory card." ) );
111 else if ( tempstr == tr( "Ha" ) ) 103 else if ( tempstr == tr( "Ha" ) )
112 QWhatsThis::add( mi, tr( "This graph represents how much storage is currently used on this hard drive." ) ); 104 QWhatsThis::add( mi, tr( "This graph represents how much storage is currently used on this hard drive." ) );
113 else if ( tempstr == tr( "SD" ) ) 105 else if ( tempstr == tr( "SD" ) )
114 QWhatsThis::add( mi, tr( "This graph represents how much memory is currently used on this Secure Digital memory card." ) ); 106 QWhatsThis::add( mi, tr( "This graph represents how much memory is currently used on this Secure Digital memory card." ) );
115 else if ( tempstr == tr( "SC" ) ) 107 else if ( tempstr == tr( "SC" ) )
@@ -117,62 +109,61 @@ void FileSysInfo::updateMounts()
117 else if ( tempstr == tr( "In" ) ) 109 else if ( tempstr == tr( "In" ) )
118 QWhatsThis::add( mi, tr( "This graph represents how much memory is currently used of the built-in memory (i.e. Flash memory) on this handheld device." ) ); 110 QWhatsThis::add( mi, tr( "This graph represents how much memory is currently used of the built-in memory (i.e. Flash memory) on this handheld device." ) );
119 else if ( tempstr == tr( "RA" ) ) 111 else if ( tempstr == tr( "RA" ) )
120 QWhatsThis::add( mi, tr( "This graph represents how much memory is currently used of the temporary RAM disk." ) ); 112 QWhatsThis::add( mi, tr( "This graph represents how much memory is currently used of the temporary RAM disk." ) );
121 } 113 }
122 vb->addStretch(); 114 vb->addStretch();
123 } 115 }
124 else 116 else
125 { 117 {
126 for (QDictIterator<MountInfo> i(disks); i.current(); ++i) 118 for (QDictIterator<MountInfo> i(disks); i.current(); ++i)
127 i.current()->updateData(); 119 i.current()->updateData();
128 } 120 }
129 121
130 rebuildDisks = FALSE; 122 rebuildDisks = FALSE;
131} 123}
132 124
133void FileSysInfo::disksChanged() 125void FileSysInfo::disksChanged()
134{ 126{
135 rebuildDisks = TRUE; 127 rebuildDisks = TRUE;
136} 128}
137 129
138MountInfo::MountInfo( FileSystem *filesys, QWidget *parent, const char *name ) 130MountInfo::MountInfo( FileSystem *filesys, QWidget *parent, const char *name )
139 : QWidget( parent, name ) 131 : QWidget( parent, name )
140{ 132{
141 QVBoxLayout *vb = new QVBoxLayout( this, 3 ); 133 QVBoxLayout *vb = new QVBoxLayout( this, 3 );
142 134
143 totalSize = new QLabel( this ); 135 totalSize = new QLabel( this );
144 vb->addWidget( totalSize ); 136 vb->addWidget( totalSize );
145 137
146 fs = filesys; 138 fs = filesys;
147 title = fs->name(); 139 title = fs->name();
148 140
149 data = new GraphData(); 141 data = new GraphData();
150 graph = new BarGraph( this ); 142 graph = new BarGraph( this );
151 graph->setFrameStyle( QFrame::Panel | QFrame::Sunken ); 143 graph->setFrameStyle( QFrame::Panel | QFrame::Sunken );
152 vb->addWidget( graph, 1 ); 144 vb->addWidget( graph, 1 );
153 graph->setData( data ); 145 graph->setData( data );
154 146
155 legend = new GraphLegend( this ); 147 legend = new GraphLegend( this );
156 legend->setOrientation(Horizontal); 148 legend->setOrientation(Horizontal);
157 vb->addWidget( legend ); 149 vb->addWidget( legend );
158 legend->setData( data ); 150 legend->setData( data );
159 151
160 updateData(); 152 updateData();
161} 153}
162 154
163MountInfo::~MountInfo() 155MountInfo::~MountInfo()
164{ 156{
165 delete data; 157 delete data;
166 delete fs;
167} 158}
168 159
169void MountInfo::updateData() 160void MountInfo::updateData()
170{ 161{
171 long mult = fs->blockSize() / 1024; 162 long mult = fs->blockSize() / 1024;
172 long div = 1024 / fs->blockSize(); 163 long div = 1024 / fs->blockSize();
173 if ( !mult ) mult = 1; 164 if ( !mult ) mult = 1;
174 if ( !div ) div = 1; 165 if ( !div ) div = 1;
175 long total = fs->totalBlocks() * mult / div; 166 long total = fs->totalBlocks() * mult / div;
176 long avail = fs->availBlocks() * mult / div; 167 long avail = fs->availBlocks() * mult / div;
177 long used = total - avail; 168 long used = total - avail;
178 totalSize->setText( title + tr(" : %1 kB").arg( total ) ); 169 totalSize->setText( title + tr(" : %1 kB").arg( total ) );
diff --git a/noncore/settings/sysinfo/sysinfo.h b/noncore/settings/sysinfo/sysinfo.h
index d69346a..94c3876 100644
--- a/noncore/settings/sysinfo/sysinfo.h
+++ b/noncore/settings/sysinfo/sysinfo.h
@@ -20,14 +20,15 @@
20** 20**
21** Enhancements by: Dan Williams, <williamsdr@acm.org> 21** Enhancements by: Dan Williams, <williamsdr@acm.org>
22** 22**
23**********************************************************************/ 23**********************************************************************/
24 24
25#include <qwidget.h> 25#include <qwidget.h>
26 26
27class SystemInfo : public QWidget 27class SystemInfo : public QWidget
28{ 28{
29 Q_OBJECT 29 Q_OBJECT
30public: 30public:
31 SystemInfo( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); 31 SystemInfo( QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
32 static QString appName() { return QString::fromLatin1("sysinfo"); }
32}; 33};
33 34
diff --git a/noncore/settings/sysinfo/sysinfo.pro b/noncore/settings/sysinfo/sysinfo.pro
index 2582ea2..2322989 100644
--- a/noncore/settings/sysinfo/sysinfo.pro
+++ b/noncore/settings/sysinfo/sysinfo.pro
@@ -1,39 +1,38 @@
1TEMPLATE = app 1CONFIG = qt warn_on release quick-app
2CONFIG = qt warn_on release
3DESTDIR = $(OPIEDIR)/bin
4HEADERS = memory.h \ 2HEADERS = memory.h \
5 graph.h \ 3 graph.h \
6 load.h \ 4 load.h \
7 storage.h \ 5 storage.h \
8 processinfo.h \ 6 processinfo.h \
9 modulesinfo.h \ 7 modulesinfo.h \
10 detail.h \ 8 detail.h \
11 versioninfo.h \ 9 versioninfo.h \
12 sysinfo.h 10 sysinfo.h
13SOURCES = main.cpp \ 11SOURCES = main.cpp \
14 memory.cpp \ 12 memory.cpp \
15 graph.cpp \ 13 graph.cpp \
16 load.cpp \ 14 load.cpp \
17 storage.cpp \ 15 storage.cpp \
18 processinfo.cpp \ 16 processinfo.cpp \
19 modulesinfo.cpp \ 17 modulesinfo.cpp \
20 detail.cpp \ 18 detail.cpp \
21 versioninfo.cpp \ 19 versioninfo.cpp \
22 sysinfo.cpp 20 sysinfo.cpp
23INTERFACES = 21
24INCLUDEPATH += $(OPIEDIR)/include 22INCLUDEPATH += $(OPIEDIR)/include
25DEPENDPATH += $(OPIEDIR)/include 23DEPENDPATH += $(OPIEDIR)/include
26LIBS += -lqpe -lopie 24LIBS += -lqpe -lopie
27TARGET = sysinfo 25
26 TARGET= sysinfo
28 27
29TRANSLATIONS = ../../../i18n/de/sysinfo.ts \ 28TRANSLATIONS = ../../../i18n/de/sysinfo.ts \
30 ../../../i18n/nl/sysinfo.ts \ 29 ../../../i18n/nl/sysinfo.ts \
31 ../../../i18n/xx/sysinfo.ts \ 30 ../../../i18n/xx/sysinfo.ts \
32 ../../../i18n/en/sysinfo.ts \ 31 ../../../i18n/en/sysinfo.ts \
33 ../../../i18n/es/sysinfo.ts \ 32 ../../../i18n/es/sysinfo.ts \
34 ../../../i18n/fr/sysinfo.ts \ 33 ../../../i18n/fr/sysinfo.ts \
35 ../../../i18n/hu/sysinfo.ts \ 34 ../../../i18n/hu/sysinfo.ts \
36 ../../../i18n/ja/sysinfo.ts \ 35 ../../../i18n/ja/sysinfo.ts \
37 ../../../i18n/ko/sysinfo.ts \ 36 ../../../i18n/ko/sysinfo.ts \
38 ../../../i18n/no/sysinfo.ts \ 37 ../../../i18n/no/sysinfo.ts \
39 ../../../i18n/pl/sysinfo.ts \ 38 ../../../i18n/pl/sysinfo.ts \