summaryrefslogtreecommitdiff
path: root/noncore/apps/checkbook
Unidiff
Diffstat (limited to 'noncore/apps/checkbook') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/checkbook/checkbook.cpp18
-rw-r--r--noncore/apps/checkbook/listedit.cpp6
-rw-r--r--noncore/apps/checkbook/mainwindow.cpp2
-rw-r--r--noncore/apps/checkbook/password.cpp2
-rw-r--r--noncore/apps/checkbook/transaction.cpp14
5 files changed, 21 insertions, 21 deletions
diff --git a/noncore/apps/checkbook/checkbook.cpp b/noncore/apps/checkbook/checkbook.cpp
index 26b2533..1b933f2 100644
--- a/noncore/apps/checkbook/checkbook.cpp
+++ b/noncore/apps/checkbook/checkbook.cpp
@@ -72,197 +72,197 @@ Checkbook::Checkbook( QWidget *parent, CBInfo *i, Cfg *cfg )
72 tempstr.append( tr( "Checkbook" ) ); 72 tempstr.append( tr( "Checkbook" ) );
73 setCaption( tempstr ); 73 setCaption( tempstr );
74 } 74 }
75 else 75 else
76 { 76 {
77 setCaption( tr( "New checkbook" ) ); 77 setCaption( tr( "New checkbook" ) );
78 } 78 }
79 79
80 80
81 // Setup layout to make everything pretty 81 // Setup layout to make everything pretty
82 QVBoxLayout *layout = new QVBoxLayout( this ); 82 QVBoxLayout *layout = new QVBoxLayout( this );
83 layout->setMargin( 2 ); 83 layout->setMargin( 2 );
84 layout->setSpacing( 4 ); 84 layout->setSpacing( 4 );
85 85
86 // Setup tabs for all info 86 // Setup tabs for all info
87 mainWidget = new OTabWidget( this ); 87 mainWidget = new OTabWidget( this );
88 layout->addWidget( mainWidget ); 88 layout->addWidget( mainWidget );
89 mainWidget->addTab( initInfo(), "checkbook/infotab", tr( "Info" ) ); 89 mainWidget->addTab( initInfo(), "checkbook/infotab", tr( "Info" ) );
90 mainWidget->addTab( initTransactions(), "checkbook/trantab", tr( "Transactions" ) ); 90 mainWidget->addTab( initTransactions(), "checkbook/trantab", tr( "Transactions" ) );
91 mainWidget->addTab( initCharts(), "checkbook/charttab", tr( "Charts" ) ); 91 mainWidget->addTab( initCharts(), "checkbook/charttab", tr( "Charts" ) );
92 if( _pCfg->isShowLastTab() ) 92 if( _pCfg->isShowLastTab() )
93 mainWidget->setCurrentTab( info->getLastTab() ); 93 mainWidget->setCurrentTab( info->getLastTab() );
94 else 94 else
95 mainWidget->setCurrentTab( tr( "Info" ) ); 95 mainWidget->setCurrentTab( tr( "Info" ) );
96 connect( mainWidget, SIGNAL( currentChanged(QWidget *) ), this, SLOT( slotTab(QWidget *) ) ); 96 connect( mainWidget, SIGNAL( currentChanged(QWidget*) ), this, SLOT( slotTab(QWidget*) ) );
97 97
98 // Load checkbook information 98 // Load checkbook information
99 loadCheckbook(); 99 loadCheckbook();
100} 100}
101 101
102Checkbook::~Checkbook() 102Checkbook::~Checkbook()
103{ 103{
104} 104}
105 105
106// --- initInfo --------------------------------------------------------------- 106// --- initInfo ---------------------------------------------------------------
107QWidget *Checkbook::initInfo() 107QWidget *Checkbook::initInfo()
108{ 108{
109 QWidget *control = new QWidget( mainWidget, tr("Info") ); 109 QWidget *control = new QWidget( mainWidget, tr("Info") );
110 110
111 QVBoxLayout *vb = new QVBoxLayout( control ); 111 QVBoxLayout *vb = new QVBoxLayout( control );
112 112
113 QScrollView *sv = new QScrollView( control ); 113 QScrollView *sv = new QScrollView( control );
114 vb->addWidget( sv, 0, 0 ); 114 vb->addWidget( sv, 0, 0 );
115 sv->setResizePolicy( QScrollView::AutoOneFit ); 115 sv->setResizePolicy( QScrollView::AutoOneFit );
116 sv->setFrameStyle( QFrame::NoFrame ); 116 sv->setFrameStyle( QFrame::NoFrame );
117 117
118 QWidget *container = new QWidget( sv->viewport() ); 118 QWidget *container = new QWidget( sv->viewport() );
119 sv->addChild( container ); 119 sv->addChild( container );
120 120
121 QGridLayout *layout = new QGridLayout( container ); 121 QGridLayout *layout = new QGridLayout( container );
122 layout->setSpacing( 2 ); 122 layout->setSpacing( 2 );
123 layout->setMargin( 4 ); 123 layout->setMargin( 4 );
124 124
125 // Password protection 125 // Password protection
126 passwordCB = new QCheckBox( tr( "Password protect" ), container ); 126 passwordCB = new QCheckBox( tr( "Password protect" ), container );
127 QWhatsThis::add( passwordCB, tr( "Click here to enable/disable password protection of this checkbook." ) ); 127 QWhatsThis::add( passwordCB, tr( "Click here to enable/disable password protection of this checkbook." ) );
128 connect( passwordCB, SIGNAL( clicked() ), this, SLOT( slotPasswordClicked() ) ); 128 connect( passwordCB, SIGNAL( clicked() ), this, SLOT( slotPasswordClicked() ) );
129 layout->addMultiCellWidget( passwordCB, 0, 0, 0, 1 ); 129 layout->addMultiCellWidget( passwordCB, 0, 0, 0, 1 );
130 130
131 // Account name 131 // Account name
132 QLabel *label = new QLabel( tr( "Name:" ), container ); 132 QLabel *label = new QLabel( tr( "Name:" ), container );
133 QWhatsThis::add( label, tr( "Enter name of checkbook here." ) ); 133 QWhatsThis::add( label, tr( "Enter name of checkbook here." ) );
134 layout->addWidget( label, 1, 0 ); 134 layout->addWidget( label, 1, 0 );
135 nameEdit = new QLineEdit( container ); 135 nameEdit = new QLineEdit( container );
136 QWhatsThis::add( nameEdit, tr( "Enter name of checkbook here." ) ); 136 QWhatsThis::add( nameEdit, tr( "Enter name of checkbook here." ) );
137 connect( nameEdit, SIGNAL( textChanged( const QString & ) ), 137 connect( nameEdit, SIGNAL( textChanged(const QString&) ),
138 this, SLOT( slotNameChanged( const QString & ) ) ); 138 this, SLOT( slotNameChanged(const QString&) ) );
139 layout->addWidget( nameEdit, 1, 1 ); 139 layout->addWidget( nameEdit, 1, 1 );
140 140
141 // Type of account 141 // Type of account
142 label = new QLabel( tr( "Type:" ), container ); 142 label = new QLabel( tr( "Type:" ), container );
143 QWhatsThis::add( label, tr( "Select type of checkbook here." ) ); 143 QWhatsThis::add( label, tr( "Select type of checkbook here." ) );
144 layout->addWidget( label, 2, 0 ); 144 layout->addWidget( label, 2, 0 );
145 typeList = new QComboBox( container ); 145 typeList = new QComboBox( container );
146 QWhatsThis::add( typeList, tr( "Select type of checkbook here." ) ); 146 QWhatsThis::add( typeList, tr( "Select type of checkbook here." ) );
147 typeList->insertStringList( _pCfg->getAccountTypes() ); 147 typeList->insertStringList( _pCfg->getAccountTypes() );
148 layout->addWidget( typeList, 2, 1 ); 148 layout->addWidget( typeList, 2, 1 );
149 149
150 // Bank/institution name 150 // Bank/institution name
151 label = new QLabel( tr( "Bank:" ), container ); 151 label = new QLabel( tr( "Bank:" ), container );
152 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." ) );
153 layout->addWidget( label, 3, 0 ); 153 layout->addWidget( label, 3, 0 );
154 bankEdit = new QLineEdit( container ); 154 bankEdit = new QLineEdit( container );
155 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." ) );
156 layout->addWidget( bankEdit, 3, 1 ); 156 layout->addWidget( bankEdit, 3, 1 );
157 157
158 // Account number 158 // Account number
159 label = new QLabel( tr( "Account number:" ), container ); 159 label = new QLabel( tr( "Account number:" ), container );
160 QWhatsThis::add( label, tr( "Enter account number for this checkbook here." ) ); 160 QWhatsThis::add( label, tr( "Enter account number for this checkbook here." ) );
161 layout->addWidget( label, 4, 0 ); 161 layout->addWidget( label, 4, 0 );
162 acctNumEdit = new QLineEdit( container ); 162 acctNumEdit = new QLineEdit( container );
163 QWhatsThis::add( acctNumEdit, tr( "Enter account number for this checkbook here." ) ); 163 QWhatsThis::add( acctNumEdit, tr( "Enter account number for this checkbook here." ) );
164 layout->addWidget( acctNumEdit, 4, 1 ); 164 layout->addWidget( acctNumEdit, 4, 1 );
165 165
166 // PIN number 166 // PIN number
167 label = new QLabel( tr( "PIN number:" ), container ); 167 label = new QLabel( tr( "PIN number:" ), container );
168 QWhatsThis::add( label, tr( "Enter PIN number for this checkbook here." ) ); 168 QWhatsThis::add( label, tr( "Enter PIN number for this checkbook here." ) );
169 layout->addWidget( label, 5, 0 ); 169 layout->addWidget( label, 5, 0 );
170 pinNumEdit = new QLineEdit( container ); 170 pinNumEdit = new QLineEdit( container );
171 QWhatsThis::add( pinNumEdit, tr( "Enter PIN number for this checkbook here." ) ); 171 QWhatsThis::add( pinNumEdit, tr( "Enter PIN number for this checkbook here." ) );
172 layout->addWidget( pinNumEdit, 5, 1 ); 172 layout->addWidget( pinNumEdit, 5, 1 );
173 173
174 // Starting balance 174 // Starting balance
175 label = new QLabel( tr( "Starting balance:" ), container ); 175 label = new QLabel( tr( "Starting balance:" ), container );
176 QWhatsThis::add( label, tr( "Enter the initial balance for this checkbook here." ) ); 176 QWhatsThis::add( label, tr( "Enter the initial balance for this checkbook here." ) );
177 layout->addWidget( label, 6, 0 ); 177 layout->addWidget( label, 6, 0 );
178 balanceEdit = new QLineEdit( container ); 178 balanceEdit = new QLineEdit( container );
179 QWhatsThis::add( balanceEdit, tr( "Enter the initial balance for this checkbook here." ) ); 179 QWhatsThis::add( balanceEdit, tr( "Enter the initial balance for this checkbook here." ) );
180 connect( balanceEdit, SIGNAL( textChanged( const QString & ) ), 180 connect( balanceEdit, SIGNAL( textChanged(const QString&) ),
181 this, SLOT( slotStartingBalanceChanged( const QString & ) ) ); 181 this, SLOT( slotStartingBalanceChanged(const QString&) ) );
182 layout->addWidget( balanceEdit, 6, 1 ); 182 layout->addWidget( balanceEdit, 6, 1 );
183 183
184 // Notes 184 // Notes
185 label = new QLabel( tr( "Notes:" ), container ); 185 label = new QLabel( tr( "Notes:" ), container );
186 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." ) );
187 layout->addWidget( label, 7, 0 ); 187 layout->addWidget( label, 7, 0 );
188 notesEdit = new QMultiLineEdit( container ); 188 notesEdit = new QMultiLineEdit( container );
189 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." ) );
190 notesEdit->setMinimumHeight( 25 ); 190 notesEdit->setMinimumHeight( 25 );
191 notesEdit->setMaximumHeight( 65 ); 191 notesEdit->setMaximumHeight( 65 );
192 layout->addMultiCellWidget( notesEdit, 8, 8, 0, 1 ); 192 layout->addMultiCellWidget( notesEdit, 8, 8, 0, 1 );
193 193
194 return control; 194 return control;
195} 195}
196 196
197 197
198// --- initTransactions ------------------------------------------------------- 198// --- initTransactions -------------------------------------------------------
199QWidget *Checkbook::initTransactions() 199QWidget *Checkbook::initTransactions()
200{ 200{
201 QWidget *control = new QWidget( mainWidget, tr("Transactions") ); 201 QWidget *control = new QWidget( mainWidget, tr("Transactions") );
202 202
203 QGridLayout *layout = new QGridLayout( control ); 203 QGridLayout *layout = new QGridLayout( control );
204 layout->setSpacing( 2 ); 204 layout->setSpacing( 2 );
205 layout->setMargin( 4 ); 205 layout->setMargin( 4 );
206 206
207 // Sort selector 207 // Sort selector
208 QLabel *label = new QLabel( tr( "Sort by:" ), control ); 208 QLabel *label = new QLabel( tr( "Sort by:" ), control );
209 QWhatsThis::add( label, tr( "Select checkbook sorting here." ) ); 209 QWhatsThis::add( label, tr( "Select checkbook sorting here." ) );
210 layout->addMultiCellWidget( label, 0, 0, 0, 1 ); 210 layout->addMultiCellWidget( label, 0, 0, 0, 1 );
211 _cbSortType=new QComboBox( control ); 211 _cbSortType=new QComboBox( control );
212 _cbSortType->insertItem( tr("Entry Order") ); 212 _cbSortType->insertItem( tr("Entry Order") );
213 _cbSortType->insertItem( tr("Date") ); 213 _cbSortType->insertItem( tr("Date") );
214 _cbSortType->insertItem( tr("Number") ); 214 _cbSortType->insertItem( tr("Number") );
215 layout->addMultiCellWidget( _cbSortType, 0, 0, 1, 2 ); 215 layout->addMultiCellWidget( _cbSortType, 0, 0, 1, 2 );
216 connect( _cbSortType, SIGNAL( activated(const QString &) ), this, SLOT( slotSortChanged( const QString & ) ) ); 216 connect( _cbSortType, SIGNAL( activated(const QString&) ), this, SLOT( slotSortChanged(const QString&) ) );
217 217
218 // Table 218 // Table
219 tranTable = new QListView( control ); 219 tranTable = new QListView( control );
220 QFont fnt(QPEApplication::font()); 220 QFont fnt(QPEApplication::font());
221 fnt.setPointSize( fnt.pointSize()-1 ); 221 fnt.setPointSize( fnt.pointSize()-1 );
222 tranTable->setFont( fnt ); 222 tranTable->setFont( fnt );
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." ) ); 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." ) );
224 tranTable->addColumn( tr( "Id" ) ); 224 tranTable->addColumn( tr( "Id" ) );
225 tranTable->setColumnWidthMode( COL_ID, QListView::Manual ); 225 tranTable->setColumnWidthMode( COL_ID, QListView::Manual );
226 tranTable->setColumnWidth( COL_ID, 0); 226 tranTable->setColumnWidth( COL_ID, 0);
227 tranTable->addColumn( tr( "SortDate" ) ); 227 tranTable->addColumn( tr( "SortDate" ) );
228 tranTable->setColumnWidthMode( COL_SORTDATE, QListView::Manual ); 228 tranTable->setColumnWidthMode( COL_SORTDATE, QListView::Manual );
229 tranTable->setColumnWidth( COL_SORTDATE, 0); 229 tranTable->setColumnWidth( COL_SORTDATE, 0);
230 tranTable->addColumn( tr( "Num" ) ); 230 tranTable->addColumn( tr( "Num" ) );
231 tranTable->addColumn( tr( "Date" ) ); 231 tranTable->addColumn( tr( "Date" ) );
232 //tranTable->addColumn( tr( "Cleared" ) ); 232 //tranTable->addColumn( tr( "Cleared" ) );
233 tranTable->addColumn( tr( "Description" ) ); 233 tranTable->addColumn( tr( "Description" ) );
234 int column = tranTable->addColumn( tr( "Amount" ) ); 234 int column = tranTable->addColumn( tr( "Amount" ) );
235 tranTable->setColumnAlignment( column, Qt::AlignRight ); 235 tranTable->setColumnAlignment( column, Qt::AlignRight );
236 column=tranTable->addColumn( tr("Balance") ); 236 column=tranTable->addColumn( tr("Balance") );
237 tranTable->setColumnAlignment( column, Qt::AlignRight ); 237 tranTable->setColumnAlignment( column, Qt::AlignRight );
238 tranTable->setAllColumnsShowFocus( TRUE ); 238 tranTable->setAllColumnsShowFocus( TRUE );
239 tranTable->setSorting( -1 ); 239 tranTable->setSorting( -1 );
240 layout->addMultiCellWidget( tranTable, 1, 1, 0, 2 ); 240 layout->addMultiCellWidget( tranTable, 1, 1, 0, 2 );
241 QPEApplication::setStylusOperation( tranTable->viewport(), QPEApplication::RightOnHold ); 241 QPEApplication::setStylusOperation( tranTable->viewport(), QPEApplication::RightOnHold );
242 connect( tranTable, SIGNAL( rightButtonPressed( QListViewItem *, const QPoint &, int ) ), 242 connect( tranTable, SIGNAL( rightButtonPressed(QListViewItem*,const QPoint&,int) ),
243 this, SLOT( slotMenuTran(QListViewItem *, const QPoint &) ) ); 243 this, SLOT( slotMenuTran(QListViewItem*,const QPoint&) ) );
244 connect( tranTable, SIGNAL( doubleClicked( QListViewItem * ) ), 244 connect( tranTable, SIGNAL( doubleClicked(QListViewItem*) ),
245 this, SLOT( slotEditTran() ) ); 245 this, SLOT( slotEditTran() ) );
246 _sortCol=COL_ID; 246 _sortCol=COL_ID;
247 247
248 // Buttons 248 // Buttons
249 QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), control ); 249 QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), control );
250 QWhatsThis::add( btn, tr( "Click here to add a new transaction." ) ); 250 QWhatsThis::add( btn, tr( "Click here to add a new transaction." ) );
251 connect( btn, SIGNAL( clicked() ), this, SLOT( slotNewTran() ) ); 251 connect( btn, SIGNAL( clicked() ), this, SLOT( slotNewTran() ) );
252 layout->addWidget( btn, 2, 0 ); 252 layout->addWidget( btn, 2, 0 );
253 253
254 btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Edit" ), control ); 254 btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Edit" ), control );
255 QWhatsThis::add( btn, tr( "Select a transaction and then click here to edit it." ) ); 255 QWhatsThis::add( btn, tr( "Select a transaction and then click here to edit it." ) );
256 connect( btn, SIGNAL( clicked() ), this, SLOT( slotEditTran() ) ); 256 connect( btn, SIGNAL( clicked() ), this, SLOT( slotEditTran() ) );
257 layout->addWidget( btn, 2, 1 ); 257 layout->addWidget( btn, 2, 1 );
258 258
259 btn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), control ); 259 btn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), control );
260 QWhatsThis::add( btn, tr( "Select a checkbook and then click here to delete it." ) ); 260 QWhatsThis::add( btn, tr( "Select a checkbook and then click here to delete it." ) );
261 connect( btn, SIGNAL( clicked() ), this, SLOT( slotDeleteTran() ) ); 261 connect( btn, SIGNAL( clicked() ), this, SLOT( slotDeleteTran() ) );
262 layout->addWidget( btn, 2, 2 ); 262 layout->addWidget( btn, 2, 2 );
263 263
264 return( control ); 264 return( control );
265} 265}
266 266
267 267
268// --- initCharts ------------------------------------------------------------- 268// --- initCharts -------------------------------------------------------------
diff --git a/noncore/apps/checkbook/listedit.cpp b/noncore/apps/checkbook/listedit.cpp
index 37f05f0..d00e305 100644
--- a/noncore/apps/checkbook/listedit.cpp
+++ b/noncore/apps/checkbook/listedit.cpp
@@ -34,63 +34,63 @@
34#include <qcombobox.h> 34#include <qcombobox.h>
35#include <qpushbutton.h> 35#include <qpushbutton.h>
36#include <qpe/resource.h> 36#include <qpe/resource.h>
37 37
38 38
39// --- ListEdit --------------------------------------------------------------- 39// --- ListEdit ---------------------------------------------------------------
40ListEdit::ListEdit( QWidget *parent, const char *sName ) 40ListEdit::ListEdit( QWidget *parent, const char *sName )
41 : QWidget(parent, sName), TableDef(sName) 41 : QWidget(parent, sName), TableDef(sName)
42{ 42{
43 // get font height 43 // get font height
44 int fh = fontMetrics().height(); 44 int fh = fontMetrics().height();
45 45
46 // create layout 46 // create layout
47 QGridLayout *layout=new QGridLayout(this); 47 QGridLayout *layout=new QGridLayout(this);
48 layout->setSpacing( 2 ); 48 layout->setSpacing( 2 );
49 layout->setMargin( 4 ); 49 layout->setMargin( 4 );
50 50
51 // type table 51 // type table
52 _typeTable = new QListView( this ); 52 _typeTable = new QListView( this );
53 ColumnDef *def=first(); 53 ColumnDef *def=first();
54 while( def ) { 54 while( def ) {
55 _typeTable->addColumn( def->getName() ); 55 _typeTable->addColumn( def->getName() );
56 def=next(); 56 def=next();
57 } 57 }
58 connect( _typeTable, SIGNAL( clicked(QListViewItem *, const QPoint &, int) ), this, SLOT( slotClick(QListViewItem *, const QPoint &, int ) ) ); 58 connect( _typeTable, SIGNAL( clicked(QListViewItem*,const QPoint&,int) ), this, SLOT( slotClick(QListViewItem*,const QPoint&,int) ) );
59 layout->addMultiCellWidget(_typeTable, 0,4,0,4); 59 layout->addMultiCellWidget(_typeTable, 0,4,0,4);
60 _currentItem=NULL; 60 _currentItem=NULL;
61 61
62 // edit field 62 // edit field
63 _stack=new QWidgetStack( this ); 63 _stack=new QWidgetStack( this );
64 _stack->setMaximumHeight(fh+5); 64 _stack->setMaximumHeight(fh+5);
65 layout->addMultiCellWidget(_stack, 5,5,0,2); 65 layout->addMultiCellWidget(_stack, 5,5,0,2);
66 _typeEdit = new QLineEdit( _stack ); 66 _typeEdit = new QLineEdit( _stack );
67 _stack->raiseWidget(_typeEdit ); 67 _stack->raiseWidget(_typeEdit );
68 connect( _typeEdit, SIGNAL( textChanged(const QString &) ), this, SLOT( slotEditChanged(const QString &) ) ); 68 connect( _typeEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( slotEditChanged(const QString&) ) );
69 69
70 // combo box 70 // combo box
71 _box=new QComboBox( _stack ); 71 _box=new QComboBox( _stack );
72 connect( _box, SIGNAL( activated(const QString &) ), this, SLOT( slotActivated(const QString &) ) ); 72 connect( _box, SIGNAL( activated(const QString&) ), this, SLOT( slotActivated(const QString&) ) );
73 73
74 74
75 // add button 75 // add button
76 QPushButton *btn = new QPushButton( Resource::loadPixmap( "checkbook/add" ), tr( "Add" ), this ); 76 QPushButton *btn = new QPushButton( Resource::loadPixmap( "checkbook/add" ), tr( "Add" ), this );
77 connect( btn, SIGNAL( clicked() ), this, SLOT( slotAdd() ) ); 77 connect( btn, SIGNAL( clicked() ), this, SLOT( slotAdd() ) );
78 layout->addWidget( btn, 5, 3 ); 78 layout->addWidget( btn, 5, 3 );
79 79
80 // delete button 80 // delete button
81 btn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), this ); 81 btn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), this );
82 connect( btn, SIGNAL( clicked() ), this, SLOT( slotDel() ) ); 82 connect( btn, SIGNAL( clicked() ), this, SLOT( slotDel() ) );
83 layout->addWidget( btn, 5, 4 ); 83 layout->addWidget( btn, 5, 4 );
84} 84}
85 85
86// --- ~ListEdit -------------------------------------------------------------- 86// --- ~ListEdit --------------------------------------------------------------
87ListEdit::~ListEdit() 87ListEdit::~ListEdit()
88{ 88{
89} 89}
90 90
91 91
92// --- slotEditTypeChanged ---------------------------------------------------- 92// --- slotEditTypeChanged ----------------------------------------------------
93void ListEdit::slotEditChanged(const QString &str) 93void ListEdit::slotEditChanged(const QString &str)
94{ 94{
95 if( !_currentItem || _currentColumn<0 ) return; 95 if( !_currentItem || _currentColumn<0 ) return;
96 _currentItem->setText(_currentColumn, str); 96 _currentItem->setText(_currentColumn, str);
diff --git a/noncore/apps/checkbook/mainwindow.cpp b/noncore/apps/checkbook/mainwindow.cpp
index d0fac3b..254ce6a 100644
--- a/noncore/apps/checkbook/mainwindow.cpp
+++ b/noncore/apps/checkbook/mainwindow.cpp
@@ -151,49 +151,49 @@ void MainWindow::buildList()
151 if ( cbList ) 151 if ( cbList )
152 delete cbList; 152 delete cbList;
153 153
154 cbList = new QListView( this ); 154 cbList = new QListView( this );
155 QWhatsThis::add( cbList, tr( "This is a listing of all checkbooks currently available." ) ); 155 QWhatsThis::add( cbList, tr( "This is a listing of all checkbooks currently available." ) );
156 156
157 if ( _cfg.getShowLocks() ) 157 if ( _cfg.getShowLocks() )
158 { 158 {
159 cbList->addColumn( Resource::loadIconSet( "locked" ), "", 24 ); 159 cbList->addColumn( Resource::loadIconSet( "locked" ), "", 24 );
160 posName = 1; 160 posName = 1;
161 } 161 }
162 else 162 else
163 { 163 {
164 posName = 0; 164 posName = 0;
165 } 165 }
166 cbList->addColumn( tr( "Checkbook Name" ) ); 166 cbList->addColumn( tr( "Checkbook Name" ) );
167 if ( _cfg.getShowBalances() ) 167 if ( _cfg.getShowBalances() )
168 { 168 {
169 int colnum = cbList->addColumn( tr( "Balance" ) ); 169 int colnum = cbList->addColumn( tr( "Balance" ) );
170 cbList->setColumnAlignment( colnum, Qt::AlignRight ); 170 cbList->setColumnAlignment( colnum, Qt::AlignRight );
171 } 171 }
172 cbList->setAllColumnsShowFocus( TRUE ); 172 cbList->setAllColumnsShowFocus( TRUE );
173 cbList->setSorting( posName ); 173 cbList->setSorting( posName );
174 QPEApplication::setStylusOperation( cbList->viewport(), QPEApplication::RightOnHold ); 174 QPEApplication::setStylusOperation( cbList->viewport(), QPEApplication::RightOnHold );
175 connect( cbList, SIGNAL( rightButtonPressed( QListViewItem *, const QPoint &, int ) ), 175 connect( cbList, SIGNAL( rightButtonPressed(QListViewItem*,const QPoint&,int) ),
176 this, SLOT( slotEdit() ) ); 176 this, SLOT( slotEdit() ) );
177 setCentralWidget( cbList ); 177 setCentralWidget( cbList );
178 178
179 for ( CBInfo *cb = checkbooks->first(); cb; cb = checkbooks->next() ) 179 for ( CBInfo *cb = checkbooks->first(); cb; cb = checkbooks->next() )
180 { 180 {
181 addCheckbook( cb ); 181 addCheckbook( cb );
182 } 182 }
183} 183}
184 184
185void MainWindow::addCheckbook( CBInfo *cb ) 185void MainWindow::addCheckbook( CBInfo *cb )
186{ 186{
187 QListViewItem *lvi = new QListViewItem( cbList ); 187 QListViewItem *lvi = new QListViewItem( cbList );
188 if ( _cfg.getShowLocks() && !cb->password().isNull() ) 188 if ( _cfg.getShowLocks() && !cb->password().isNull() )
189 { 189 {
190 lvi->setPixmap( 0, lockIcon ); 190 lvi->setPixmap( 0, lockIcon );
191 } 191 }
192 lvi->setText( posName, cb->name() ); 192 lvi->setText( posName, cb->name() );
193 if ( _cfg.getShowBalances() ) 193 if ( _cfg.getShowBalances() )
194 { 194 {
195 QString balance; 195 QString balance;
196 balance.sprintf( "%s%.2f", _cfg.getCurrencySymbol().latin1(), cb->balance() ); 196 balance.sprintf( "%s%.2f", _cfg.getCurrencySymbol().latin1(), cb->balance() );
197 lvi->setText( posName + 1, balance ); 197 lvi->setText( posName + 1, balance );
198 } 198 }
199} 199}
diff --git a/noncore/apps/checkbook/password.cpp b/noncore/apps/checkbook/password.cpp
index f381271..89a6bc6 100644
--- a/noncore/apps/checkbook/password.cpp
+++ b/noncore/apps/checkbook/password.cpp
@@ -54,44 +54,44 @@ static const char* const showhideimage_data[] = {
54".#....#..#.#..#.", 54".#....#..#.#..#.",
55"................"}; 55"................"};
56 56
57Password::Password( QWidget *parent, const char *caption, const char *prompt ) 57Password::Password( QWidget *parent, const char *caption, const char *prompt )
58 : QDialog( parent, 0x0, TRUE, 0x0 ) 58 : QDialog( parent, 0x0, TRUE, 0x0 )
59{ 59{
60 setCaption( caption ); 60 setCaption( caption );
61 61
62 QGridLayout *layout = new QGridLayout( this ); 62 QGridLayout *layout = new QGridLayout( this );
63 layout->setSpacing( 2 ); 63 layout->setSpacing( 2 );
64 layout->setMargin( 4 ); 64 layout->setMargin( 4 );
65 65
66 QLabel *label = new QLabel( prompt, this ); 66 QLabel *label = new QLabel( prompt, this );
67 label->setAlignment( AlignLeft | AlignTop | WordBreak ); 67 label->setAlignment( AlignLeft | AlignTop | WordBreak );
68 layout->addMultiCellWidget( label, 0, 0, 0, 1 ); 68 layout->addMultiCellWidget( label, 0, 0, 0, 1 );
69 69
70 pw = new QLineEdit( this ); 70 pw = new QLineEdit( this );
71 pw->setEchoMode( QLineEdit::Password ); 71 pw->setEchoMode( QLineEdit::Password );
72 layout->addWidget( pw, 1, 0 ); 72 layout->addWidget( pw, 1, 0 );
73 73
74 QPixmap *pic = new QPixmap( ( const char** ) showhideimage_data ); 74 QPixmap *pic = new QPixmap( ( const char** ) showhideimage_data );
75 QPushButton *btn = new QPushButton( ( QIconSet ) *pic, QString::null, this ); 75 QPushButton *btn = new QPushButton( ( QIconSet ) *pic, QString::null, this );
76 btn->setMaximumSize( pic->width() + 10, pic->height() + 10 ); 76 btn->setMaximumSize( pic->width() + 10, pic->height() + 10 );
77 btn->setToggleButton( TRUE ); 77 btn->setToggleButton( TRUE );
78 connect( btn, SIGNAL( toggled( bool ) ), this, SLOT( slotTogglePassword( bool ) ) ); 78 connect( btn, SIGNAL( toggled(bool) ), this, SLOT( slotTogglePassword(bool) ) );
79 layout->addWidget( btn, 1, 1 ); 79 layout->addWidget( btn, 1, 1 );
80 80
81 password == ""; 81 password == "";
82} 82}
83 83
84Password::~Password() 84Password::~Password()
85{ 85{
86} 86}
87 87
88void Password::accept() 88void Password::accept()
89{ 89{
90 password = pw->text(); 90 password = pw->text();
91 QDialog::accept(); 91 QDialog::accept();
92} 92}
93 93
94void Password::slotTogglePassword( bool showPW ) 94void Password::slotTogglePassword( bool showPW )
95{ 95{
96 showPW ? pw->setEchoMode( QLineEdit::Normal ) : pw->setEchoMode( QLineEdit::Password ); 96 showPW ? pw->setEchoMode( QLineEdit::Normal ) : pw->setEchoMode( QLineEdit::Password );
97} 97}
diff --git a/noncore/apps/checkbook/transaction.cpp b/noncore/apps/checkbook/transaction.cpp
index a72a48b..1b08b24 100644
--- a/noncore/apps/checkbook/transaction.cpp
+++ b/noncore/apps/checkbook/transaction.cpp
@@ -78,70 +78,70 @@ Transaction::Transaction( QWidget *parent, bool bNew, const QString &acctname,
78 layout2->setSpacing( 2 ); 78 layout2->setSpacing( 2 );
79 layout2->setMargin( 2 ); 79 layout2->setMargin( 2 );
80 withBtn = new QRadioButton( tr( "Withdrawal" ), btngrp ); 80 withBtn = new QRadioButton( tr( "Withdrawal" ), btngrp );
81 QWhatsThis::add( withBtn, tr( "Select whether the transaction is a withdrawal or deposit here." ) ); 81 QWhatsThis::add( withBtn, tr( "Select whether the transaction is a withdrawal or deposit here." ) );
82 layout2->addWidget( withBtn, 0, 0 ); 82 layout2->addWidget( withBtn, 0, 0 );
83 connect( withBtn, SIGNAL( clicked() ), this, SLOT( slotWithdrawalClicked() ) ); 83 connect( withBtn, SIGNAL( clicked() ), this, SLOT( slotWithdrawalClicked() ) );
84 depBtn = new QRadioButton( tr( "Deposit" ), btngrp ); 84 depBtn = new QRadioButton( tr( "Deposit" ), btngrp );
85 QWhatsThis::add( depBtn, tr( "Select whether the transaction is a withdrawal or deposit here." ) ); 85 QWhatsThis::add( depBtn, tr( "Select whether the transaction is a withdrawal or deposit here." ) );
86 layout2->addWidget( depBtn, 0, 1 ); 86 layout2->addWidget( depBtn, 0, 1 );
87 btngrp->setMaximumSize( 320, withBtn->height() ); 87 btngrp->setMaximumSize( 320, withBtn->height() );
88 connect( depBtn, SIGNAL( clicked() ), this, SLOT( slotDepositClicked() ) ); 88 connect( depBtn, SIGNAL( clicked() ), this, SLOT( slotDepositClicked() ) );
89 layout->addMultiCellWidget( btngrp, 0, 0, 0, 3 ); 89 layout->addMultiCellWidget( btngrp, 0, 0, 0, 3 );
90 90
91 // Date 91 // Date
92 QLabel *label = new QLabel( tr( "Date:" ), container ); 92 QLabel *label = new QLabel( tr( "Date:" ), container );
93 QWhatsThis::add( label, tr( "Select date of transaction here." ) ); 93 QWhatsThis::add( label, tr( "Select date of transaction here." ) );
94 layout->addWidget( label, 1, 0 ); 94 layout->addWidget( label, 1, 0 );
95 dateBtn = new QPushButton( TimeString::shortDate( QDate::currentDate() ), 95 dateBtn = new QPushButton( TimeString::shortDate( QDate::currentDate() ),
96 container ); 96 container );
97 QWhatsThis::add( dateBtn, tr( "Select date of transaction here." ) ); 97 QWhatsThis::add( dateBtn, tr( "Select date of transaction here." ) );
98 QPopupMenu *m1 = new QPopupMenu( container ); 98 QPopupMenu *m1 = new QPopupMenu( container );
99 datePicker = new DateBookMonth( m1, 0, TRUE ); 99 datePicker = new DateBookMonth( m1, 0, TRUE );
100 m1->insertItem( datePicker ); 100 m1->insertItem( datePicker );
101 dateBtn->setPopup( m1 ); 101 dateBtn->setPopup( m1 );
102 connect( datePicker, SIGNAL( dateClicked( int, int, int ) ), 102 connect( datePicker, SIGNAL( dateClicked(int,int,int) ),
103 this, SLOT( slotDateChanged( int, int, int ) ) ); 103 this, SLOT( slotDateChanged(int,int,int) ) );
104 layout->addWidget( dateBtn, 1, 1 ); 104 layout->addWidget( dateBtn, 1, 1 );
105 105
106 // Check number 106 // Check number
107 label = new QLabel( tr( "Number:" ), container ); 107 label = new QLabel( tr( "Number:" ), container );
108 QWhatsThis::add( label, tr( "Enter check number here." ) ); 108 QWhatsThis::add( label, tr( "Enter check number here." ) );
109 layout->addWidget( label, 1, 2 ); 109 layout->addWidget( label, 1, 2 );
110 numEdit = new QLineEdit( container ); 110 numEdit = new QLineEdit( container );
111 QWhatsThis::add( numEdit, tr( "Enter check number here." ) ); 111 QWhatsThis::add( numEdit, tr( "Enter check number here." ) );
112 numEdit->setMaximumWidth( 40 ); 112 numEdit->setMaximumWidth( 40 );
113 layout->addWidget( numEdit, 1, 3 ); 113 layout->addWidget( numEdit, 1, 3 );
114 114
115 // Description 115 // Description
116 label = new QLabel( tr( "Description:" ), container ); 116 label = new QLabel( tr( "Description:" ), container );
117 QWhatsThis::add( label, tr( "Enter description of transaction here." ) ); 117 QWhatsThis::add( label, tr( "Enter description of transaction here." ) );
118 layout->addWidget( label, 2, 0 ); 118 layout->addWidget( label, 2, 0 );
119 _cbDesc=new QComboBox( true, container ); 119 _cbDesc=new QComboBox( true, container );
120 _cbDesc->insertStringList( _pCfg->getPayees() ); 120 _cbDesc->insertStringList( _pCfg->getPayees() );
121 QWhatsThis::add( _cbDesc, tr( "Enter description of transaction here." ) ); 121 QWhatsThis::add( _cbDesc, tr( "Enter description of transaction here." ) );
122 layout->addMultiCellWidget( _cbDesc, 2, 2, 1, 3 ); 122 layout->addMultiCellWidget( _cbDesc, 2, 2, 1, 3 );
123 connect( _cbDesc, SIGNAL( activated(const QString &) ), this, SLOT( slotActivated(const QString &) ) ); 123 connect( _cbDesc, SIGNAL( activated(const QString&) ), this, SLOT( slotActivated(const QString&) ) );
124 124
125 125
126 // Category 126 // Category
127 label = new QLabel( tr( "Category:" ), container ); 127 label = new QLabel( tr( "Category:" ), container );
128 QWhatsThis::add( label, tr( "Select transaction category here." ) ); 128 QWhatsThis::add( label, tr( "Select transaction category here." ) );
129 layout->addWidget( label, 3, 0 ); 129 layout->addWidget( label, 3, 0 );
130 catList = new QComboBox( container ); 130 catList = new QComboBox( container );
131 QWhatsThis::add( catList, tr( "Select transaction category here." ) ); 131 QWhatsThis::add( catList, tr( "Select transaction category here." ) );
132 layout->addMultiCellWidget( catList, 3, 3, 1, 3 ); 132 layout->addMultiCellWidget( catList, 3, 3, 1, 3 );
133 133
134 // Type 134 // Type
135 label = new QLabel( tr( "Type:" ), container ); 135 label = new QLabel( tr( "Type:" ), container );
136 QWhatsThis::add( label, tr( "Select transaction type here.\n\nThe options available vary based on whether the transaction is a deposit or withdrawal." ) ); 136 QWhatsThis::add( label, tr( "Select transaction type here.\n\nThe options available vary based on whether the transaction is a deposit or withdrawal." ) );
137 layout->addWidget( label, 4, 0 ); 137 layout->addWidget( label, 4, 0 );
138 typeList = new QComboBox( container ); 138 typeList = new QComboBox( container );
139 QWhatsThis::add( typeList, tr( "Select transaction type here.\n\nThe options available vary based on whether the transaction is a deposit or withdrawal." ) ); 139 QWhatsThis::add( typeList, tr( "Select transaction type here.\n\nThe options available vary based on whether the transaction is a deposit or withdrawal." ) );
140 layout->addMultiCellWidget( typeList, 4, 4, 1, 3 ); 140 layout->addMultiCellWidget( typeList, 4, 4, 1, 3 );
141 141
142 142
143 // Amount 143 // Amount
144 label = new QLabel( tr( "Amount:" ), container ); 144 label = new QLabel( tr( "Amount:" ), container );
145 QWhatsThis::add( label, tr( "Enter the amount of transaction here.\n\nThe value entered should always be positive." ) ); 145 QWhatsThis::add( label, tr( "Enter the amount of transaction here.\n\nThe value entered should always be positive." ) );
146 layout->addWidget( label, 5, 0 ); 146 layout->addWidget( label, 5, 0 );
147 amtEdit = new QLineEdit( container ); 147 amtEdit = new QLineEdit( container );
@@ -149,52 +149,52 @@ Transaction::Transaction( QWidget *parent, bool bNew, const QString &acctname,
149 layout->addMultiCellWidget( amtEdit, 5, 5, 1, 3 ); 149 layout->addMultiCellWidget( amtEdit, 5, 5, 1, 3 );
150 150
151 // Fee 151 // Fee
152 label = new QLabel( tr( "Fee:" ), container ); 152 label = new QLabel( tr( "Fee:" ), container );
153 QWhatsThis::add( label, tr( "Enter any fee amount assoiciated with this transaction.\n\nThe value entered should always be positive." ) ); 153 QWhatsThis::add( label, tr( "Enter any fee amount assoiciated with this transaction.\n\nThe value entered should always be positive." ) );
154 layout->addWidget( label, 6, 0 ); 154 layout->addWidget( label, 6, 0 );
155 feeEdit = new QLineEdit( container ); 155 feeEdit = new QLineEdit( container );
156 QWhatsThis::add( feeEdit, tr( "Enter any fee amount assoiciated with this transaction.\n\nThe value entered should always be positive." ) ); 156 QWhatsThis::add( feeEdit, tr( "Enter any fee amount assoiciated with this transaction.\n\nThe value entered should always be positive." ) );
157 layout->addMultiCellWidget( feeEdit, 6, 6, 1, 3 ); 157 layout->addMultiCellWidget( feeEdit, 6, 6, 1, 3 );
158 158
159 // Notes 159 // Notes
160 label = new QLabel( tr( "Notes:" ), container ); 160 label = new QLabel( tr( "Notes:" ), container );
161 QWhatsThis::add( label, tr( "Enter any additional information for this transaction here." ) ); 161 QWhatsThis::add( label, tr( "Enter any additional information for this transaction here." ) );
162 layout->addWidget( label, 7, 0 ); 162 layout->addWidget( label, 7, 0 );
163 noteEdit = new QMultiLineEdit( container ); 163 noteEdit = new QMultiLineEdit( container );
164 QWhatsThis::add( noteEdit, tr( "Enter any additional information for this transaction here." ) ); 164 QWhatsThis::add( noteEdit, tr( "Enter any additional information for this transaction here." ) );
165 layout->addMultiCellWidget( noteEdit, 8, 8, 0, 3 ); 165 layout->addMultiCellWidget( noteEdit, 8, 8, 0, 3 );
166 166
167 // init date 167 // init date
168 initFromInfo( info ); 168 initFromInfo( info );
169 169
170 // not new handlers 170 // not new handlers
171 connect( withBtn, SIGNAL( toggled(bool) ), this, SLOT( slotNotNew() ) ); 171 connect( withBtn, SIGNAL( toggled(bool) ), this, SLOT( slotNotNew() ) );
172 connect( depBtn, SIGNAL( toggled(bool) ), this, SLOT( slotNotNew() ) ); 172 connect( depBtn, SIGNAL( toggled(bool) ), this, SLOT( slotNotNew() ) );
173 connect( catList, SIGNAL(activated(const QString &)), this, SLOT( slotNotNew() ) ); 173 connect( catList, SIGNAL(activated(const QString&)), this, SLOT( slotNotNew() ) );
174 connect( typeList, SIGNAL(activated(const QString &)), this, SLOT( slotNotNew() ) ); 174 connect( typeList, SIGNAL(activated(const QString&)), this, SLOT( slotNotNew() ) );
175 connect( amtEdit, SIGNAL(textChanged(const QString &)), this, SLOT( slotNotNew() ) ); 175 connect( amtEdit, SIGNAL(textChanged(const QString&)), this, SLOT( slotNotNew() ) );
176 connect( feeEdit, SIGNAL(textChanged(const QString &)), this, SLOT( slotNotNew() ) ); 176 connect( feeEdit, SIGNAL(textChanged(const QString&)), this, SLOT( slotNotNew() ) );
177 connect( noteEdit, SIGNAL(textChanged()), this, SLOT( slotNotNew() ) ); 177 connect( noteEdit, SIGNAL(textChanged()), this, SLOT( slotNotNew() ) );
178} 178}
179 179
180// --- initFromInfo ----------------------------------------------------------- 180// --- initFromInfo -----------------------------------------------------------
181void Transaction::initFromInfo(TranInfo *info, bool bPopulateOld) 181void Transaction::initFromInfo(TranInfo *info, bool bPopulateOld)
182{ 182{
183 // Populate current values if provided 183 // Populate current values if provided
184 if ( info ) 184 if ( info )
185 { 185 {
186 if ( info->withdrawal() ) 186 if ( info->withdrawal() )
187 { 187 {
188 withBtn->setChecked( TRUE ); 188 withBtn->setChecked( TRUE );
189 slotWithdrawalClicked(); 189 slotWithdrawalClicked();
190 } 190 }
191 else 191 else
192 { 192 {
193 depBtn->setChecked( TRUE ); 193 depBtn->setChecked( TRUE );
194 slotDepositClicked(); 194 slotDepositClicked();
195 } 195 }
196 196
197 if( !bPopulateOld ) { 197 if( !bPopulateOld ) {
198 QDate dt = info->date(); 198 QDate dt = info->date();
199 slotDateChanged( dt.year(), dt.month(), dt.day() ); 199 slotDateChanged( dt.year(), dt.month(), dt.day() );
200 datePicker->setDate( dt ); 200 datePicker->setDate( dt );