-rwxr-xr-x | noncore/apps/qashmoney/accountdisplay.cpp | 22 | ||||
-rwxr-xr-x | noncore/apps/qashmoney/budgetdisplay.cpp | 20 | ||||
-rwxr-xr-x | noncore/apps/qashmoney/calculator.cpp | 24 | ||||
-rwxr-xr-x | noncore/apps/qashmoney/datepicker.cpp | 6 | ||||
-rwxr-xr-x | noncore/apps/qashmoney/memorydialog.cpp | 6 | ||||
-rwxr-xr-x | noncore/apps/qashmoney/newaccount.cpp | 8 | ||||
-rwxr-xr-x | noncore/apps/qashmoney/newtransaction.cpp | 8 | ||||
-rwxr-xr-x | noncore/apps/qashmoney/preferencedialogs.cpp | 20 | ||||
-rwxr-xr-x | noncore/apps/qashmoney/qashmoney.cpp | 20 | ||||
-rwxr-xr-x | noncore/apps/qashmoney/transactiondisplay.cpp | 18 | ||||
-rwxr-xr-x | noncore/apps/qashmoney/transferdialog.cpp | 2 |
11 files changed, 77 insertions, 77 deletions
diff --git a/noncore/apps/qashmoney/accountdisplay.cpp b/noncore/apps/qashmoney/accountdisplay.cpp index 5ef5454..0fe5b09 100755 --- a/noncore/apps/qashmoney/accountdisplay.cpp +++ b/noncore/apps/qashmoney/accountdisplay.cpp | |||
@@ -1,73 +1,73 @@ | |||
1 | #include <qmessagebox.h> | 1 | #include <qmessagebox.h> |
2 | #include <qheader.h> | 2 | #include <qheader.h> |
3 | 3 | ||
4 | #include "accountdisplay.h" | 4 | #include "accountdisplay.h" |
5 | #include "newaccount.h" | 5 | #include "newaccount.h" |
6 | #include "transaction.h" | 6 | #include "transaction.h" |
7 | #include "transferdialog.h" | 7 | #include "transferdialog.h" |
8 | #include "transfer.h" | 8 | #include "transfer.h" |
9 | 9 | ||
10 | extern Account *account; | 10 | extern Account *account; |
11 | extern Transaction *transaction; | 11 | extern Transaction *transaction; |
12 | extern Transfer *transfer; | 12 | extern Transfer *transfer; |
13 | extern Preferences *preferences; | 13 | extern Preferences *preferences; |
14 | 14 | ||
15 | AccountDisplay::AccountDisplay ( QWidget *parent ) : QWidget ( parent ) | 15 | AccountDisplay::AccountDisplay ( QWidget *parent ) : QWidget ( parent ) |
16 | { | 16 | { |
17 | cleared = 0; | 17 | cleared = 0; |
18 | 18 | ||
19 | firstline = new QHBox ( this ); | 19 | firstline = new QHBox ( this ); |
20 | firstline->setSpacing ( 2 ); | 20 | firstline->setSpacing ( 2 ); |
21 | 21 | ||
22 | newaccount = new QPushButton ( firstline ); | 22 | newaccount = new QPushButton ( firstline ); |
23 | newaccount->setPixmap ( QPixmap ("/opt/QtPalmtop/pics/new.png") ); | 23 | newaccount->setPixmap ( QPixmap ("/opt/QtPalmtop/pics/new.png") ); |
24 | connect ( newaccount, SIGNAL ( released () ), this, SLOT ( addAccount () ) ); | 24 | connect ( newaccount, SIGNAL ( released() ), this, SLOT ( addAccount() ) ); |
25 | 25 | ||
26 | editaccount = new QPushButton ( firstline ); | 26 | editaccount = new QPushButton ( firstline ); |
27 | editaccount->setPixmap ( QPixmap ("/opt/QtPalmtop/pics/edit.png") ); | 27 | editaccount->setPixmap ( QPixmap ("/opt/QtPalmtop/pics/edit.png") ); |
28 | connect ( editaccount, SIGNAL ( released () ), this, SLOT ( editAccount () ) ); | 28 | connect ( editaccount, SIGNAL ( released() ), this, SLOT ( editAccount() ) ); |
29 | 29 | ||
30 | deleteaccount = new QPushButton ( firstline ); | 30 | deleteaccount = new QPushButton ( firstline ); |
31 | deleteaccount->setPixmap( QPixmap ( "/opt/QtPalmtop/pics/delete.png") ); | 31 | deleteaccount->setPixmap( QPixmap ( "/opt/QtPalmtop/pics/delete.png") ); |
32 | connect ( deleteaccount, SIGNAL ( released () ), this, SLOT ( deleteAccount () ) ); | 32 | connect ( deleteaccount, SIGNAL ( released() ), this, SLOT ( deleteAccount() ) ); |
33 | 33 | ||
34 | transferbutton = new QPushButton ( firstline ); | 34 | transferbutton = new QPushButton ( firstline ); |
35 | transferbutton->setPixmap( QPixmap ( "/opt/QtPalmtop/pics/transfer.png") ); | 35 | transferbutton->setPixmap( QPixmap ( "/opt/QtPalmtop/pics/transfer.png") ); |
36 | transferbutton->setToggleButton ( TRUE ); | 36 | transferbutton->setToggleButton ( TRUE ); |
37 | connect ( transferbutton, SIGNAL ( toggled ( bool ) ), this, SLOT ( accountTransfer ( bool ) ) ); | 37 | connect ( transferbutton, SIGNAL ( toggled(bool) ), this, SLOT ( accountTransfer(bool) ) ); |
38 | 38 | ||
39 | listview = new QListView ( this ); | 39 | listview = new QListView ( this ); |
40 | listview->setAllColumnsShowFocus ( TRUE ); | 40 | listview->setAllColumnsShowFocus ( TRUE ); |
41 | listview->setShowSortIndicator ( TRUE ); | 41 | listview->setShowSortIndicator ( TRUE ); |
42 | listview->setRootIsDecorated ( TRUE ); | 42 | listview->setRootIsDecorated ( TRUE ); |
43 | listview->setMultiSelection ( FALSE ); | 43 | listview->setMultiSelection ( FALSE ); |
44 | connect ( listview, SIGNAL ( expanded ( QListViewItem * ) ), this, SLOT ( setAccountExpanded ( QListViewItem * ) ) ); | 44 | connect ( listview, SIGNAL ( expanded(QListViewItem*) ), this, SLOT ( setAccountExpanded(QListViewItem*) ) ); |
45 | connect ( listview, SIGNAL ( collapsed ( QListViewItem * ) ), this, SLOT ( setAccountCollapsed ( QListViewItem * ) ) ); | 45 | connect ( listview, SIGNAL ( collapsed(QListViewItem*) ), this, SLOT ( setAccountCollapsed(QListViewItem*) ) ); |
46 | 46 | ||
47 | listview->header()->setTracking ( FALSE ); | 47 | listview->header()->setTracking ( FALSE ); |
48 | connect ( listview->header(), SIGNAL ( sizeChange ( int, int, int ) ), this, SLOT ( saveColumnSize ( int, int, int ) ) ); | 48 | connect ( listview->header(), SIGNAL ( sizeChange(int,int,int) ), this, SLOT ( saveColumnSize(int,int,int) ) ); |
49 | connect ( listview->header(), SIGNAL ( clicked ( int ) ), this, SLOT ( saveSortingPreference ( int ) ) ); | 49 | connect ( listview->header(), SIGNAL ( clicked(int) ), this, SLOT ( saveSortingPreference(int) ) ); |
50 | 50 | ||
51 | layout = new QVBoxLayout ( this, 2, 5 ); | 51 | layout = new QVBoxLayout ( this, 2, 5 ); |
52 | layout->addWidget ( firstline ); | 52 | layout->addWidget ( firstline ); |
53 | layout->addWidget ( listview ); | 53 | layout->addWidget ( listview ); |
54 | } | 54 | } |
55 | 55 | ||
56 | void AccountDisplay::setTabs ( QWidget *newtab2, QTabWidget *newtabs ) | 56 | void AccountDisplay::setTabs ( QWidget *newtab2, QTabWidget *newtabs ) |
57 | { | 57 | { |
58 | tab2 = newtab2; | 58 | tab2 = newtab2; |
59 | maintabs = newtabs; | 59 | maintabs = newtabs; |
60 | } | 60 | } |
61 | 61 | ||
62 | void AccountDisplay::addAccount () | 62 | void AccountDisplay::addAccount () |
63 | { | 63 | { |
64 | // initialize local variables | 64 | // initialize local variables |
65 | int parentid = 0; | 65 | int parentid = 0; |
66 | type = 0; | 66 | type = 0; |
67 | QString parentlist [ listview->childCount() + 1 ] [ 3 ] ; | 67 | QString parentlist [ listview->childCount() + 1 ] [ 3 ] ; |
68 | 68 | ||
69 | // create new account window for entering data | 69 | // create new account window for entering data |
70 | NewAccount *newaccount = new NewAccount ( this ); | 70 | NewAccount *newaccount = new NewAccount ( this ); |
71 | int width = this->width(); | 71 | int width = this->width(); |
72 | newaccount->accountbox->setMaximumWidth ( ( int ) ( width * 0.5 ) ); | 72 | newaccount->accountbox->setMaximumWidth ( ( int ) ( width * 0.5 ) ); |
73 | newaccount->datebox->setMaximumWidth ( ( int ) ( width * 0.4 ) ); | 73 | newaccount->datebox->setMaximumWidth ( ( int ) ( width * 0.4 ) ); |
@@ -204,58 +204,58 @@ void AccountDisplay::setToggleButton () | |||
204 | // if there are less than two, disable the transfer button | 204 | // if there are less than two, disable the transfer button |
205 | QListViewItemIterator it ( listview ); | 205 | QListViewItemIterator it ( listview ); |
206 | int counter = 0; | 206 | int counter = 0; |
207 | for ( ; it.current(); ++it ) | 207 | for ( ; it.current(); ++it ) |
208 | { | 208 | { |
209 | // add one to counter if we find a transferable account | 209 | // add one to counter if we find a transferable account |
210 | if ( it.current()->parent() != 0 || ( it.current()->childCount() ) == 0 ) | 210 | if ( it.current()->parent() != 0 || ( it.current()->childCount() ) == 0 ) |
211 | counter++; | 211 | counter++; |
212 | } | 212 | } |
213 | if ( counter > 1 ) | 213 | if ( counter > 1 ) |
214 | transferbutton->show(); | 214 | transferbutton->show(); |
215 | else | 215 | else |
216 | transferbutton->hide(); | 216 | transferbutton->hide(); |
217 | } | 217 | } |
218 | 218 | ||
219 | void AccountDisplay::accountTransfer ( bool state ) | 219 | void AccountDisplay::accountTransfer ( bool state ) |
220 | { | 220 | { |
221 | if ( state == TRUE ) | 221 | if ( state == TRUE ) |
222 | { | 222 | { |
223 | firstaccountid = -1; | 223 | firstaccountid = -1; |
224 | secondaccountid = -1; | 224 | secondaccountid = -1; |
225 | listview->clearSelection (); | 225 | listview->clearSelection (); |
226 | listview->setMultiSelection ( TRUE ); | 226 | listview->setMultiSelection ( TRUE ); |
227 | disableParentsWithChildren (); | 227 | disableParentsWithChildren (); |
228 | connect ( listview, SIGNAL ( clicked ( QListViewItem * ) ), this, SLOT ( getTransferAccounts ( QListViewItem * ) ) ); | 228 | connect ( listview, SIGNAL ( clicked(QListViewItem*) ), this, SLOT ( getTransferAccounts(QListViewItem*) ) ); |
229 | } | 229 | } |
230 | else | 230 | else |
231 | { | 231 | { |
232 | firstaccountid = -1; | 232 | firstaccountid = -1; |
233 | secondaccountid = -1; | 233 | secondaccountid = -1; |
234 | listview->clearSelection (); | 234 | listview->clearSelection (); |
235 | listview->setMultiSelection ( FALSE ); | 235 | listview->setMultiSelection ( FALSE ); |
236 | enableAccounts (); | 236 | enableAccounts (); |
237 | disconnect ( listview, SIGNAL ( clicked ( QListViewItem * ) ), this, SLOT ( getTransferAccounts ( QListViewItem * ) ) ); | 237 | disconnect ( listview, SIGNAL ( clicked(QListViewItem*) ), this, SLOT ( getTransferAccounts(QListViewItem*) ) ); |
238 | } | 238 | } |
239 | } | 239 | } |
240 | 240 | ||
241 | void AccountDisplay::getTransferAccounts ( QListViewItem * item ) | 241 | void AccountDisplay::getTransferAccounts ( QListViewItem * item ) |
242 | { | 242 | { |
243 | if ( item->parent() != 0 || item->childCount() == 0 ) // only set an account for transfer if its a child or parent with no children | 243 | if ( item->parent() != 0 || item->childCount() == 0 ) // only set an account for transfer if its a child or parent with no children |
244 | { | 244 | { |
245 | if ( firstaccountid == -1 ) | 245 | if ( firstaccountid == -1 ) |
246 | firstaccountid = item->text ( getIDColumn() ).toInt(); // set first account if we've selected a valid account | 246 | firstaccountid = item->text ( getIDColumn() ).toInt(); // set first account if we've selected a valid account |
247 | else | 247 | else |
248 | if ( item->text ( getIDColumn() ).toInt() != firstaccountid ) // set the second account if its not equal to the first | 248 | if ( item->text ( getIDColumn() ).toInt() != firstaccountid ) // set the second account if its not equal to the first |
249 | secondaccountid = item->text ( getIDColumn() ).toInt(); | 249 | secondaccountid = item->text ( getIDColumn() ).toInt(); |
250 | } | 250 | } |
251 | 251 | ||
252 | // open transfer window if both accounts are set | 252 | // open transfer window if both accounts are set |
253 | if ( firstaccountid != -1 && secondaccountid != -1 ) | 253 | if ( firstaccountid != -1 && secondaccountid != -1 ) |
254 | { | 254 | { |
255 | // construct the transferdialog window | 255 | // construct the transferdialog window |
256 | TransferDialog *td = new TransferDialog ( this, firstaccountid, secondaccountid ); | 256 | TransferDialog *td = new TransferDialog ( this, firstaccountid, secondaccountid ); |
257 | 257 | ||
258 | // enter today's date in the date box as default | 258 | // enter today's date in the date box as default |
259 | QDate today = QDate::currentDate (); | 259 | QDate today = QDate::currentDate (); |
260 | int defaultday = today.day(); | 260 | int defaultday = today.day(); |
261 | int defaultmonth = today.month(); | 261 | int defaultmonth = today.month(); |
@@ -270,49 +270,49 @@ void AccountDisplay::getTransferAccounts ( QListViewItem * item ) | |||
270 | qDebug("Year from transferdialog = %i",td->getYear()); | 270 | qDebug("Year from transferdialog = %i",td->getYear()); |
271 | // add the transfer with a new date if its been edited or use the default date | 271 | // add the transfer with a new date if its been edited or use the default date |
272 | if ( td->getDateEdited () == TRUE ) | 272 | if ( td->getDateEdited () == TRUE ) |
273 | transfer->addTransfer ( firstaccountid, account->getParentAccountID ( firstaccountid ), secondaccountid, account->getParentAccountID ( secondaccountid ), td->getDay(), td->getMonth(), td->getYear(), td->amount->text().toFloat(), cleared ); | 273 | transfer->addTransfer ( firstaccountid, account->getParentAccountID ( firstaccountid ), secondaccountid, account->getParentAccountID ( secondaccountid ), td->getDay(), td->getMonth(), td->getYear(), td->amount->text().toFloat(), cleared ); |
274 | else | 274 | else |
275 | transfer->addTransfer ( firstaccountid, account->getParentAccountID ( firstaccountid ), secondaccountid, account->getParentAccountID ( secondaccountid ), defaultday, defaultmonth, defaultyear, td->amount->text().toFloat(), cleared ); | 275 | transfer->addTransfer ( firstaccountid, account->getParentAccountID ( firstaccountid ), secondaccountid, account->getParentAccountID ( secondaccountid ), defaultday, defaultmonth, defaultyear, td->amount->text().toFloat(), cleared ); |
276 | 276 | ||
277 | // update account balances of both accounts and parents if necessary | 277 | // update account balances of both accounts and parents if necessary |
278 | account->updateAccountBalance ( firstaccountid ); | 278 | account->updateAccountBalance ( firstaccountid ); |
279 | if ( account->getParentAccountID ( firstaccountid ) != -1 ) | 279 | if ( account->getParentAccountID ( firstaccountid ) != -1 ) |
280 | account->changeParentAccountBalance ( account->getParentAccountID ( firstaccountid ) ); | 280 | account->changeParentAccountBalance ( account->getParentAccountID ( firstaccountid ) ); |
281 | account->updateAccountBalance ( secondaccountid ); | 281 | account->updateAccountBalance ( secondaccountid ); |
282 | if ( account->getParentAccountID ( secondaccountid ) != -1 ) | 282 | if ( account->getParentAccountID ( secondaccountid ) != -1 ) |
283 | account->changeParentAccountBalance ( account->getParentAccountID ( secondaccountid ) ); | 283 | account->changeParentAccountBalance ( account->getParentAccountID ( secondaccountid ) ); |
284 | 284 | ||
285 | // redisplay accounts | 285 | // redisplay accounts |
286 | account->displayAccounts ( listview ); | 286 | account->displayAccounts ( listview ); |
287 | } | 287 | } |
288 | else | 288 | else |
289 | { | 289 | { |
290 | firstaccountid = -1; | 290 | firstaccountid = -1; |
291 | secondaccountid = -1; | 291 | secondaccountid = -1; |
292 | listview->clearSelection (); | 292 | listview->clearSelection (); |
293 | listview->setMultiSelection ( FALSE ); | 293 | listview->setMultiSelection ( FALSE ); |
294 | disconnect ( listview, SIGNAL ( clicked ( QListViewItem * ) ), this, SLOT ( getTransferAccounts ( QListViewItem * ) ) ); | 294 | disconnect ( listview, SIGNAL ( clicked(QListViewItem*) ), this, SLOT ( getTransferAccounts(QListViewItem*) ) ); |
295 | } | 295 | } |
296 | 296 | ||
297 | // reset the accounts display window | 297 | // reset the accounts display window |
298 | transferbutton->toggle(); // toggling this button with clear the window as well | 298 | transferbutton->toggle(); // toggling this button with clear the window as well |
299 | 299 | ||
300 | // reenable all the accounts so the transaction tab will be properly set | 300 | // reenable all the accounts so the transaction tab will be properly set |
301 | enableAccounts (); | 301 | enableAccounts (); |
302 | } | 302 | } |
303 | } | 303 | } |
304 | 304 | ||
305 | void AccountDisplay::disableParentsWithChildren () | 305 | void AccountDisplay::disableParentsWithChildren () |
306 | { | 306 | { |
307 | // iterate through accountdisplay listview and disable all the parents that have children | 307 | // iterate through accountdisplay listview and disable all the parents that have children |
308 | QListViewItemIterator it ( listview ); | 308 | QListViewItemIterator it ( listview ); |
309 | for ( ; it.current(); ++it ) | 309 | for ( ; it.current(); ++it ) |
310 | { | 310 | { |
311 | if ( it.current()->parent() == 0 && it.current()->childCount() != 0 ) | 311 | if ( it.current()->parent() == 0 && it.current()->childCount() != 0 ) |
312 | it.current()->setSelectable ( FALSE ); | 312 | it.current()->setSelectable ( FALSE ); |
313 | } | 313 | } |
314 | } | 314 | } |
315 | 315 | ||
316 | void AccountDisplay::enableAccounts () | 316 | void AccountDisplay::enableAccounts () |
317 | { | 317 | { |
318 | // iterate through accountdisplay listview and enable all accounts | 318 | // iterate through accountdisplay listview and enable all accounts |
diff --git a/noncore/apps/qashmoney/budgetdisplay.cpp b/noncore/apps/qashmoney/budgetdisplay.cpp index d4047bf..3fc4e6c 100755 --- a/noncore/apps/qashmoney/budgetdisplay.cpp +++ b/noncore/apps/qashmoney/budgetdisplay.cpp | |||
@@ -17,90 +17,90 @@ BudgetDisplay::BudgetDisplay ( QWidget *parent ) : QWidget ( parent ) | |||
17 | font.setWeight ( QFont::Bold ); | 17 | font.setWeight ( QFont::Bold ); |
18 | 18 | ||
19 | //set the default date to today | 19 | //set the default date to today |
20 | newDate = QDate::currentDate (); | 20 | newDate = QDate::currentDate (); |
21 | year = newDate.year(); | 21 | year = newDate.year(); |
22 | month = newDate.month(); | 22 | month = newDate.month(); |
23 | day = newDate.day(); | 23 | day = newDate.day(); |
24 | datelabel = preferences->getDate ( year, month ); | 24 | datelabel = preferences->getDate ( year, month ); |
25 | 25 | ||
26 | setCaption ( "Budget" ); | 26 | setCaption ( "Budget" ); |
27 | 27 | ||
28 | firstline = new QHBox ( this ); | 28 | firstline = new QHBox ( this ); |
29 | firstline->setSpacing ( 2 ); | 29 | firstline->setSpacing ( 2 ); |
30 | secondline = new QHBox ( this ); | 30 | secondline = new QHBox ( this ); |
31 | secondline->setSpacing ( 10 ); | 31 | secondline->setSpacing ( 10 ); |
32 | 32 | ||
33 | menu = new QMenuBar ( this ); | 33 | menu = new QMenuBar ( this ); |
34 | menu->setFrameStyle ( QFrame::Box | QFrame::Sunken ); | 34 | menu->setFrameStyle ( QFrame::Box | QFrame::Sunken ); |
35 | budgetmenu = new QPopupMenu ( this ); | 35 | budgetmenu = new QPopupMenu ( this ); |
36 | lineitemsmenu = new QPopupMenu ( this ); | 36 | lineitemsmenu = new QPopupMenu ( this ); |
37 | datemenu = new QPopupMenu ( this ); | 37 | datemenu = new QPopupMenu ( this ); |
38 | menu->insertItem ( "Budget", budgetmenu ); | 38 | menu->insertItem ( "Budget", budgetmenu ); |
39 | menu->insertItem ( "Line Item", lineitemsmenu ); | 39 | menu->insertItem ( "Line Item", lineitemsmenu ); |
40 | menu->insertItem ( "Date", datemenu ); | 40 | menu->insertItem ( "Date", datemenu ); |
41 | budgetmenu->insertItem ( "New", this, SLOT ( newBudget () ), 0, 1 ); | 41 | budgetmenu->insertItem ( "New", this, SLOT ( newBudget() ), 0, 1 ); |
42 | budgetmenu->insertItem ( "Edit", this, SLOT ( editBudget () ), 0, 2 ); | 42 | budgetmenu->insertItem ( "Edit", this, SLOT ( editBudget() ), 0, 2 ); |
43 | budgetmenu->insertItem ( "Delete", this, SLOT ( deleteBudget () ), 0, 3 ); | 43 | budgetmenu->insertItem ( "Delete", this, SLOT ( deleteBudget() ), 0, 3 ); |
44 | lineitemsmenu->insertItem ( "New", this, SLOT ( newLineItem () ), 0, 1 ); | 44 | lineitemsmenu->insertItem ( "New", this, SLOT ( newLineItem() ), 0, 1 ); |
45 | lineitemsmenu->insertItem ( "Edit", this, SLOT ( editLineItem () ), 0, 2 ); | 45 | lineitemsmenu->insertItem ( "Edit", this, SLOT ( editLineItem() ), 0, 2 ); |
46 | lineitemsmenu->insertItem ( "Delete", this, SLOT ( deleteLineItem () ), 0, 3 ); | 46 | lineitemsmenu->insertItem ( "Delete", this, SLOT ( deleteLineItem() ), 0, 3 ); |
47 | datemenu->insertItem ( "Change", this, SLOT ( showCalendar() ) ); | 47 | datemenu->insertItem ( "Change", this, SLOT ( showCalendar() ) ); |
48 | 48 | ||
49 | budgetbox = new QComboBox ( firstline ); | 49 | budgetbox = new QComboBox ( firstline ); |
50 | connect ( budgetbox, SIGNAL ( activated ( int ) ), this, SLOT ( setCurrentBudget ( int ) ) ); | 50 | connect ( budgetbox, SIGNAL ( activated(int) ), this, SLOT ( setCurrentBudget(int) ) ); |
51 | 51 | ||
52 | budgetview = new QComboBox ( firstline ); | 52 | budgetview = new QComboBox ( firstline ); |
53 | budgetview->insertItem ( "Month" ); | 53 | budgetview->insertItem ( "Month" ); |
54 | budgetview->insertItem ( "Year" ); | 54 | budgetview->insertItem ( "Year" ); |
55 | connect ( budgetview, SIGNAL ( activated ( int ) ), this, SLOT ( setCurrentView ( int ) ) ); | 55 | connect ( budgetview, SIGNAL ( activated(int) ), this, SLOT ( setCurrentView(int) ) ); |
56 | 56 | ||
57 | budgeted = new QLabel ( secondline ); | 57 | budgeted = new QLabel ( secondline ); |
58 | budgeted->setFont ( font ); | 58 | budgeted->setFont ( font ); |
59 | actual = new QLabel ( secondline ); | 59 | actual = new QLabel ( secondline ); |
60 | actual->setFont ( font ); | 60 | actual->setFont ( font ); |
61 | date = new QLabel ( secondline ); | 61 | date = new QLabel ( secondline ); |
62 | date->setFont ( font ); | 62 | date->setFont ( font ); |
63 | 63 | ||
64 | listview = new QListView ( this ); | 64 | listview = new QListView ( this ); |
65 | listview->setAllColumnsShowFocus ( TRUE ); | 65 | listview->setAllColumnsShowFocus ( TRUE ); |
66 | listview->setShowSortIndicator ( TRUE ); | 66 | listview->setShowSortIndicator ( TRUE ); |
67 | listview->setRootIsDecorated ( TRUE ); | 67 | listview->setRootIsDecorated ( TRUE ); |
68 | listview->setMultiSelection ( FALSE ); | 68 | listview->setMultiSelection ( FALSE ); |
69 | listview->addColumn ( "Line Item", preferences->getColumnPreference ( 13 ) ); // column id 13 | 69 | listview->addColumn ( "Line Item", preferences->getColumnPreference ( 13 ) ); // column id 13 |
70 | listview->addColumn ( "Budget", preferences->getColumnPreference ( 14 ) ); // column id 14 | 70 | listview->addColumn ( "Budget", preferences->getColumnPreference ( 14 ) ); // column id 14 |
71 | listview->addColumn ( "Actual", preferences->getColumnPreference ( 15 ) ); // column id 15 | 71 | listview->addColumn ( "Actual", preferences->getColumnPreference ( 15 ) ); // column id 15 |
72 | listview->addColumn ( "", 0 ); // line item ids | 72 | listview->addColumn ( "", 0 ); // line item ids |
73 | listview->setColumnWidthMode ( 0, QListView::Manual ); | 73 | listview->setColumnWidthMode ( 0, QListView::Manual ); |
74 | listview->setColumnWidthMode ( 1, QListView::Manual ); | 74 | listview->setColumnWidthMode ( 1, QListView::Manual ); |
75 | listview->setColumnWidthMode ( 2, QListView::Manual ); | 75 | listview->setColumnWidthMode ( 2, QListView::Manual ); |
76 | listview->setColumnAlignment ( 1, Qt::AlignRight ); | 76 | listview->setColumnAlignment ( 1, Qt::AlignRight ); |
77 | listview->setColumnAlignment ( 2, Qt::AlignRight ); | 77 | listview->setColumnAlignment ( 2, Qt::AlignRight ); |
78 | listview->setColumnWidthMode ( 3, QListView::Manual ); | 78 | listview->setColumnWidthMode ( 3, QListView::Manual ); |
79 | 79 | ||
80 | listview->header()->setTracking ( FALSE ); | 80 | listview->header()->setTracking ( FALSE ); |
81 | connect ( listview->header(), SIGNAL ( sizeChange ( int, int, int ) ), this, SLOT ( saveColumnSize ( int, int, int ) ) ); | 81 | connect ( listview->header(), SIGNAL ( sizeChange(int,int,int) ), this, SLOT ( saveColumnSize(int,int,int) ) ); |
82 | connect ( listview->header(), SIGNAL ( clicked ( int ) ), this, SLOT ( saveSortingPreference ( int ) ) ); | 82 | connect ( listview->header(), SIGNAL ( clicked(int) ), this, SLOT ( saveSortingPreference(int) ) ); |
83 | 83 | ||
84 | // pull the column sorting preference from the preferences table, and configure the listview accordingly | 84 | // pull the column sorting preference from the preferences table, and configure the listview accordingly |
85 | int column = 0; | 85 | int column = 0; |
86 | int direction = 0; | 86 | int direction = 0; |
87 | preferences->getSortingPreference ( 3, &column, &direction ); | 87 | preferences->getSortingPreference ( 3, &column, &direction ); |
88 | listview->setSorting ( column, direction ); | 88 | listview->setSorting ( column, direction ); |
89 | 89 | ||
90 | displayBudgetNames(); | 90 | displayBudgetNames(); |
91 | 91 | ||
92 | layout = new QVBoxLayout ( this, 2, 2 ); | 92 | layout = new QVBoxLayout ( this, 2, 2 ); |
93 | layout->setMenuBar ( menu ); | 93 | layout->setMenuBar ( menu ); |
94 | layout->addWidget ( firstline ); | 94 | layout->addWidget ( firstline ); |
95 | layout->addWidget ( secondline ); | 95 | layout->addWidget ( secondline ); |
96 | layout->addWidget ( listview ); | 96 | layout->addWidget ( listview ); |
97 | } | 97 | } |
98 | 98 | ||
99 | void BudgetDisplay::deleteBudget () | 99 | void BudgetDisplay::deleteBudget () |
100 | { | 100 | { |
101 | listview->clear(); | 101 | listview->clear(); |
102 | transaction->clearBudgetIDs ( currentbudget ); | 102 | transaction->clearBudgetIDs ( currentbudget ); |
103 | budget->deleteBudget ( currentbudget ); | 103 | budget->deleteBudget ( currentbudget ); |
104 | if ( budgetbox->count() != 0 ) | 104 | if ( budgetbox->count() != 0 ) |
105 | displayBudgetNames(); | 105 | displayBudgetNames(); |
106 | checkBudgets(); | 106 | checkBudgets(); |
diff --git a/noncore/apps/qashmoney/calculator.cpp b/noncore/apps/qashmoney/calculator.cpp index 0e0a043..2c92103 100755 --- a/noncore/apps/qashmoney/calculator.cpp +++ b/noncore/apps/qashmoney/calculator.cpp | |||
@@ -1,82 +1,82 @@ | |||
1 | #include "calculator.h" | 1 | #include "calculator.h" |
2 | 2 | ||
3 | #include <qpushbutton.h> | 3 | #include <qpushbutton.h> |
4 | 4 | ||
5 | Calculator::Calculator ( QWidget* parent ) : QDialog ( parent, 0, TRUE ) | 5 | Calculator::Calculator ( QWidget* parent ) : QDialog ( parent, 0, TRUE ) |
6 | { | 6 | { |
7 | 7 | ||
8 | display = new QLineEdit ( this, "display" ); | 8 | display = new QLineEdit ( this, "display" ); |
9 | display->setFrame ( FALSE ); | 9 | display->setFrame ( FALSE ); |
10 | display->setAlignment ( Qt::AlignRight ); | 10 | display->setAlignment ( Qt::AlignRight ); |
11 | 11 | ||
12 | QPushButton *one = new QPushButton ( "1", this, "one" ); // make buttons for first row | 12 | QPushButton *one = new QPushButton ( "1", this, "one" ); // make buttons for first row |
13 | one->setFlat ( TRUE ); | 13 | one->setFlat ( TRUE ); |
14 | connect ( one, SIGNAL ( released () ), this, SLOT ( displayOne () ) ); | 14 | connect ( one, SIGNAL ( released() ), this, SLOT ( displayOne() ) ); |
15 | 15 | ||
16 | QPushButton *two = new QPushButton ( "2", this, "two" ); | 16 | QPushButton *two = new QPushButton ( "2", this, "two" ); |
17 | two->setFlat ( TRUE ); | 17 | two->setFlat ( TRUE ); |
18 | connect ( two, SIGNAL ( released () ), this, SLOT ( displayTwo () ) ); | 18 | connect ( two, SIGNAL ( released() ), this, SLOT ( displayTwo() ) ); |
19 | 19 | ||
20 | QPushButton *three = new QPushButton ( "3", this, "three" ); | 20 | QPushButton *three = new QPushButton ( "3", this, "three" ); |
21 | three->setFlat ( TRUE ); | 21 | three->setFlat ( TRUE ); |
22 | connect ( three, SIGNAL ( released () ), this, SLOT ( displayThree () ) ); | 22 | connect ( three, SIGNAL ( released() ), this, SLOT ( displayThree() ) ); |
23 | 23 | ||
24 | QPushButton *four = new QPushButton ( "4", this, "four" ); // make buttons for second row | 24 | QPushButton *four = new QPushButton ( "4", this, "four" ); // make buttons for second row |
25 | four->setFlat ( TRUE ); | 25 | four->setFlat ( TRUE ); |
26 | connect ( four, SIGNAL ( released () ), this, SLOT ( displayFour () ) ); | 26 | connect ( four, SIGNAL ( released() ), this, SLOT ( displayFour() ) ); |
27 | 27 | ||
28 | QPushButton *five = new QPushButton ( "5", this, "five" ); | 28 | QPushButton *five = new QPushButton ( "5", this, "five" ); |
29 | five->setFlat ( TRUE ); | 29 | five->setFlat ( TRUE ); |
30 | connect ( five, SIGNAL ( released () ), this, SLOT ( displayFive () ) ); | 30 | connect ( five, SIGNAL ( released() ), this, SLOT ( displayFive() ) ); |
31 | 31 | ||
32 | QPushButton *six = new QPushButton ( "6", this, "six" ); | 32 | QPushButton *six = new QPushButton ( "6", this, "six" ); |
33 | six->setFlat ( TRUE ); | 33 | six->setFlat ( TRUE ); |
34 | connect ( six, SIGNAL ( released () ), this, SLOT ( displaySix () ) ); | 34 | connect ( six, SIGNAL ( released() ), this, SLOT ( displaySix() ) ); |
35 | 35 | ||
36 | QPushButton *seven = new QPushButton ( "7", this, "seven" ); // make buttons for third row | 36 | QPushButton *seven = new QPushButton ( "7", this, "seven" ); // make buttons for third row |
37 | seven->setFlat ( TRUE ); | 37 | seven->setFlat ( TRUE ); |
38 | connect ( seven, SIGNAL ( released () ), this, SLOT ( displaySeven () ) ); | 38 | connect ( seven, SIGNAL ( released() ), this, SLOT ( displaySeven() ) ); |
39 | 39 | ||
40 | QPushButton *eight = new QPushButton ( "8", this, "eight" ); | 40 | QPushButton *eight = new QPushButton ( "8", this, "eight" ); |
41 | eight->setFlat ( TRUE ); | 41 | eight->setFlat ( TRUE ); |
42 | connect ( eight, SIGNAL ( released () ), this, SLOT ( displayEight () ) ); | 42 | connect ( eight, SIGNAL ( released() ), this, SLOT ( displayEight() ) ); |
43 | 43 | ||
44 | QPushButton *nine = new QPushButton ( "9", this, "nine" ); | 44 | QPushButton *nine = new QPushButton ( "9", this, "nine" ); |
45 | nine->setFlat ( TRUE ); | 45 | nine->setFlat ( TRUE ); |
46 | connect ( nine, SIGNAL ( released () ), this, SLOT ( displayNine () ) ); | 46 | connect ( nine, SIGNAL ( released() ), this, SLOT ( displayNine() ) ); |
47 | 47 | ||
48 | QPushButton *zero = new QPushButton ( "0", this, "zero" ); | 48 | QPushButton *zero = new QPushButton ( "0", this, "zero" ); |
49 | zero->setFlat ( TRUE ); | 49 | zero->setFlat ( TRUE ); |
50 | connect ( zero, SIGNAL ( released () ), this, SLOT ( displayZero () ) ); | 50 | connect ( zero, SIGNAL ( released() ), this, SLOT ( displayZero() ) ); |
51 | 51 | ||
52 | QPushButton *dp = new QPushButton ( ".", this, "dp" ); | 52 | QPushButton *dp = new QPushButton ( ".", this, "dp" ); |
53 | dp->setFlat ( TRUE ); | 53 | dp->setFlat ( TRUE ); |
54 | connect ( dp, SIGNAL ( released () ), this, SLOT ( displayPoint () ) ); | 54 | connect ( dp, SIGNAL ( released() ), this, SLOT ( displayPoint() ) ); |
55 | 55 | ||
56 | QPushButton *back = new QPushButton ( "<-", this, "back" ); | 56 | QPushButton *back = new QPushButton ( "<-", this, "back" ); |
57 | back->setFlat ( TRUE ); | 57 | back->setFlat ( TRUE ); |
58 | connect ( back, SIGNAL ( released () ), this, SLOT ( back () ) ); | 58 | connect ( back, SIGNAL ( released() ), this, SLOT ( back() ) ); |
59 | 59 | ||
60 | layout = new QGridLayout ( this, 5, 3, 5, 1, "calculatorlayout" ); | 60 | layout = new QGridLayout ( this, 5, 3, 5, 1, "calculatorlayout" ); |
61 | layout->addMultiCellWidget ( display, 0, 0, 0, 2 ); | 61 | layout->addMultiCellWidget ( display, 0, 0, 0, 2 ); |
62 | layout->addWidget ( one, 1, 0 ); | 62 | layout->addWidget ( one, 1, 0 ); |
63 | layout->addWidget ( two, 1, 1 ); | 63 | layout->addWidget ( two, 1, 1 ); |
64 | layout->addWidget ( three, 1, 2 ); | 64 | layout->addWidget ( three, 1, 2 ); |
65 | layout->addWidget ( four, 2, 0 ); | 65 | layout->addWidget ( four, 2, 0 ); |
66 | layout->addWidget ( five, 2, 1 ); | 66 | layout->addWidget ( five, 2, 1 ); |
67 | layout->addWidget ( six, 2, 2 ); | 67 | layout->addWidget ( six, 2, 2 ); |
68 | layout->addWidget ( seven, 3, 0 ); | 68 | layout->addWidget ( seven, 3, 0 ); |
69 | layout->addWidget ( eight, 3, 1 ); | 69 | layout->addWidget ( eight, 3, 1 ); |
70 | layout->addWidget ( nine, 3, 2 ); | 70 | layout->addWidget ( nine, 3, 2 ); |
71 | layout->addWidget ( zero, 4, 0 ); | 71 | layout->addWidget ( zero, 4, 0 ); |
72 | layout->addWidget ( dp, 4, 1 ); | 72 | layout->addWidget ( dp, 4, 1 ); |
73 | layout->addWidget ( back, 4, 2 ); | 73 | layout->addWidget ( back, 4, 2 ); |
74 | 74 | ||
75 | } | 75 | } |
76 | 76 | ||
77 | void Calculator::displayOne () | 77 | void Calculator::displayOne () |
78 | { display->insert ( "1" ); } | 78 | { display->insert ( "1" ); } |
79 | 79 | ||
80 | void Calculator::displayTwo () | 80 | void Calculator::displayTwo () |
81 | { display->insert ( "2" ); } | 81 | { display->insert ( "2" ); } |
82 | 82 | ||
diff --git a/noncore/apps/qashmoney/datepicker.cpp b/noncore/apps/qashmoney/datepicker.cpp index 02fbcf3..7997c0b 100755 --- a/noncore/apps/qashmoney/datepicker.cpp +++ b/noncore/apps/qashmoney/datepicker.cpp | |||
@@ -1,46 +1,46 @@ | |||
1 | #include "datepicker.h" | 1 | #include "datepicker.h" |
2 | 2 | ||
3 | DatePicker::DatePicker ( QDate entrydate ) : QDialog ( 0, 0, TRUE ) | 3 | DatePicker::DatePicker ( QDate entrydate ) : QDialog ( 0, 0, TRUE ) |
4 | { | 4 | { |
5 | setCaption ( "Select Date" ); | 5 | setCaption ( "Select Date" ); |
6 | date = entrydate; | 6 | date = entrydate; |
7 | day = date.day(); | 7 | day = date.day(); |
8 | month = date.month(); | 8 | month = date.month(); |
9 | year = date.year(); | 9 | year = date.year(); |
10 | 10 | ||
11 | daylabel = new QLabel ( "Day", this ); | 11 | daylabel = new QLabel ( "Day", this ); |
12 | monthlabel = new QLabel ( "Month", this ); | 12 | monthlabel = new QLabel ( "Month", this ); |
13 | yearlabel = new QLabel ( "Year", this ); | 13 | yearlabel = new QLabel ( "Year", this ); |
14 | 14 | ||
15 | daybox = new QComboBox ( this, "daybox" ); | 15 | daybox = new QComboBox ( this, "daybox" ); |
16 | connect ( daybox, SIGNAL ( activated ( int ) ), this, SLOT ( setDay ( int ) ) ); | 16 | connect ( daybox, SIGNAL ( activated(int) ), this, SLOT ( setDay(int) ) ); |
17 | displayDays ( daybox ); | 17 | displayDays ( daybox ); |
18 | monthbox = new QComboBox ( this, "monthbox" ); | 18 | monthbox = new QComboBox ( this, "monthbox" ); |
19 | connect ( monthbox, SIGNAL ( activated ( int ) ), this, SLOT ( setMonth ( int ) ) ); | 19 | connect ( monthbox, SIGNAL ( activated(int) ), this, SLOT ( setMonth(int) ) ); |
20 | displayMonths ( monthbox ); | 20 | displayMonths ( monthbox ); |
21 | yearbox = new QComboBox ( this, "yearbox" ); | 21 | yearbox = new QComboBox ( this, "yearbox" ); |
22 | connect ( yearbox, SIGNAL ( activated ( int ) ), this, SLOT ( setYear ( int ) ) ); | 22 | connect ( yearbox, SIGNAL ( activated(int) ), this, SLOT ( setYear(int) ) ); |
23 | displayYears ( yearbox ); | 23 | displayYears ( yearbox ); |
24 | 24 | ||
25 | layout = new QGridLayout ( this, 2, 3, 5, 5, "datepickerlayout" ); | 25 | layout = new QGridLayout ( this, 2, 3, 5, 5, "datepickerlayout" ); |
26 | layout->addWidget ( daylabel, 0, 2 ); | 26 | layout->addWidget ( daylabel, 0, 2 ); |
27 | layout->addWidget ( monthlabel, 0, 1 ); | 27 | layout->addWidget ( monthlabel, 0, 1 ); |
28 | layout->addWidget ( yearlabel, 0, 0 ); | 28 | layout->addWidget ( yearlabel, 0, 0 ); |
29 | layout->addWidget ( daybox, 1, 2 ); | 29 | layout->addWidget ( daybox, 1, 2 ); |
30 | layout->addWidget ( monthbox, 1, 1 ); | 30 | layout->addWidget ( monthbox, 1, 1 ); |
31 | layout->addWidget ( yearbox, 1, 0 ); | 31 | layout->addWidget ( yearbox, 1, 0 ); |
32 | } | 32 | } |
33 | 33 | ||
34 | void DatePicker::displayDays ( QComboBox *daybox ) | 34 | void DatePicker::displayDays ( QComboBox *daybox ) |
35 | { | 35 | { |
36 | int counter; | 36 | int counter; |
37 | int days = date.daysInMonth(); | 37 | int days = date.daysInMonth(); |
38 | for ( counter = 1; counter <= days; counter++ ) | 38 | for ( counter = 1; counter <= days; counter++ ) |
39 | daybox->insertItem ( QString::number ( counter ) ); | 39 | daybox->insertItem ( QString::number ( counter ) ); |
40 | daybox->setCurrentItem ( ( date.day() ) - 1 ); | 40 | daybox->setCurrentItem ( ( date.day() ) - 1 ); |
41 | } | 41 | } |
42 | 42 | ||
43 | void DatePicker::displayMonths ( QComboBox *monthbox ) | 43 | void DatePicker::displayMonths ( QComboBox *monthbox ) |
44 | { | 44 | { |
45 | int counter; | 45 | int counter; |
46 | for ( counter = 1; counter <= 12; counter++ ) | 46 | for ( counter = 1; counter <= 12; counter++ ) |
diff --git a/noncore/apps/qashmoney/memorydialog.cpp b/noncore/apps/qashmoney/memorydialog.cpp index e9ebd54..ba11540 100755 --- a/noncore/apps/qashmoney/memorydialog.cpp +++ b/noncore/apps/qashmoney/memorydialog.cpp | |||
@@ -1,51 +1,51 @@ | |||
1 | #include "memorydialog.h" | 1 | #include "memorydialog.h" |
2 | #include "memory.h" | 2 | #include "memory.h" |
3 | #include <qmessagebox.h> | 3 | #include <qmessagebox.h> |
4 | 4 | ||
5 | extern Memory *memory; | 5 | extern Memory *memory; |
6 | 6 | ||
7 | MemoryDialog::MemoryDialog () : QDialog ( 0, 0, TRUE ) | 7 | MemoryDialog::MemoryDialog () : QDialog ( 0, 0, TRUE ) |
8 | { | 8 | { |
9 | setCaption ( tr ( "Edit Memory" ) ); | 9 | setCaption ( tr ( "Edit Memory" ) ); |
10 | 10 | ||
11 | listbox = new QListBox ( this, "listbox" ); | 11 | listbox = new QListBox ( this, "listbox" ); |
12 | memory->displayMemoryItems ( listbox ); | 12 | memory->displayMemoryItems ( listbox ); |
13 | listbox->clearSelection(); | 13 | listbox->clearSelection(); |
14 | 14 | ||
15 | secondline = new QHBox ( this ); | 15 | secondline = new QHBox ( this ); |
16 | 16 | ||
17 | newbutton = new QPushButton ( secondline ); | 17 | newbutton = new QPushButton ( secondline ); |
18 | newbutton->setPixmap( QPixmap ("/opt/QtPalmtop/pics/new.png") ); | 18 | newbutton->setPixmap( QPixmap ("/opt/QtPalmtop/pics/new.png") ); |
19 | connect ( newbutton, SIGNAL ( released () ), this, SLOT ( addItem () ) ); | 19 | connect ( newbutton, SIGNAL ( released() ), this, SLOT ( addItem() ) ); |
20 | 20 | ||
21 | editbutton = new QPushButton ( secondline ); | 21 | editbutton = new QPushButton ( secondline ); |
22 | editbutton->setPixmap( QPixmap ("/opt/QtPalmtop/pics/edit.png") ); | 22 | editbutton->setPixmap( QPixmap ("/opt/QtPalmtop/pics/edit.png") ); |
23 | connect ( editbutton, SIGNAL ( released () ), this, SLOT ( editItem () ) ); | 23 | connect ( editbutton, SIGNAL ( released() ), this, SLOT ( editItem() ) ); |
24 | 24 | ||
25 | deletebutton = new QPushButton( secondline ); | 25 | deletebutton = new QPushButton( secondline ); |
26 | deletebutton->setPixmap( QPixmap ("/opt/QtPalmtop/pics/delete.png") ); | 26 | deletebutton->setPixmap( QPixmap ("/opt/QtPalmtop/pics/delete.png") ); |
27 | connect ( deletebutton, SIGNAL ( released () ), this, SLOT ( deleteItem () ) ); | 27 | connect ( deletebutton, SIGNAL ( released() ), this, SLOT ( deleteItem() ) ); |
28 | 28 | ||
29 | lineedit = new QLineEdit ( this ); | 29 | lineedit = new QLineEdit ( this ); |
30 | 30 | ||
31 | layout = new QVBoxLayout ( this, 2, 2 ); | 31 | layout = new QVBoxLayout ( this, 2, 2 ); |
32 | layout->addWidget ( listbox ); | 32 | layout->addWidget ( listbox ); |
33 | layout->addWidget ( secondline ); | 33 | layout->addWidget ( secondline ); |
34 | layout->addWidget ( lineedit ); | 34 | layout->addWidget ( lineedit ); |
35 | } | 35 | } |
36 | 36 | ||
37 | MemoryDialog::~MemoryDialog() | 37 | MemoryDialog::~MemoryDialog() |
38 | { | 38 | { |
39 | } | 39 | } |
40 | 40 | ||
41 | void MemoryDialog::addItem () | 41 | void MemoryDialog::addItem () |
42 | { | 42 | { |
43 | if ( lineedit->text().length() != 0 ) | 43 | if ( lineedit->text().length() != 0 ) |
44 | { | 44 | { |
45 | memory->addMemoryItem ( lineedit->text() ); | 45 | memory->addMemoryItem ( lineedit->text() ); |
46 | listbox->clear (); | 46 | listbox->clear (); |
47 | memory->displayMemoryItems ( listbox ); | 47 | memory->displayMemoryItems ( listbox ); |
48 | listbox->clearFocus(); | 48 | listbox->clearFocus(); |
49 | listbox->clearSelection (); | 49 | listbox->clearSelection (); |
50 | lineedit->clear(); | 50 | lineedit->clear(); |
51 | } | 51 | } |
diff --git a/noncore/apps/qashmoney/newaccount.cpp b/noncore/apps/qashmoney/newaccount.cpp index 7e57a18..5932182 100755 --- a/noncore/apps/qashmoney/newaccount.cpp +++ b/noncore/apps/qashmoney/newaccount.cpp | |||
@@ -55,54 +55,54 @@ NewAccount::NewAccount ( QWidget *parent, const char *name, bool modal ) : QDial | |||
55 | accounttype = new QComboBox ( FALSE, this ); | 55 | accounttype = new QComboBox ( FALSE, this ); |
56 | accounttype->insertItem( tr( "Bank" ) ); | 56 | accounttype->insertItem( tr( "Bank" ) ); |
57 | accounttype->insertItem( tr( "Cash" ) ); | 57 | accounttype->insertItem( tr( "Cash" ) ); |
58 | accounttype->insertItem( tr( "Credit Card" ) ); | 58 | accounttype->insertItem( tr( "Credit Card" ) ); |
59 | accounttype->insertItem( tr( "Equity" ) ); | 59 | accounttype->insertItem( tr( "Equity" ) ); |
60 | accounttype->insertItem( tr( "Asset" ) ); | 60 | accounttype->insertItem( tr( "Asset" ) ); |
61 | accounttype->insertItem( tr( "Liability" ) ); | 61 | accounttype->insertItem( tr( "Liability" ) ); |
62 | 62 | ||
63 | layout = new QGridLayout ( this, 7, 2, 4, 2 ); | 63 | layout = new QGridLayout ( this, 7, 2, 4, 2 ); |
64 | layout->addWidget ( namelabel , 0, 0, Qt::AlignLeft ); | 64 | layout->addWidget ( namelabel , 0, 0, Qt::AlignLeft ); |
65 | layout->addWidget ( accountbox, 1, 0, Qt::AlignLeft ); | 65 | layout->addWidget ( accountbox, 1, 0, Qt::AlignLeft ); |
66 | layout->addWidget ( datelabel, 2, 0, Qt::AlignLeft ); | 66 | layout->addWidget ( datelabel, 2, 0, Qt::AlignLeft ); |
67 | layout->addWidget ( datebox, 3, 0, Qt::AlignLeft ); | 67 | layout->addWidget ( datebox, 3, 0, Qt::AlignLeft ); |
68 | layout->addWidget ( childcheckbox, 4, 0, Qt::AlignLeft ); | 68 | layout->addWidget ( childcheckbox, 4, 0, Qt::AlignLeft ); |
69 | layout->addWidget ( childlabel, 5, 0, Qt::AlignLeft ); | 69 | layout->addWidget ( childlabel, 5, 0, Qt::AlignLeft ); |
70 | layout->addWidget ( childbox, 6, 0, Qt::AlignLeft ); | 70 | layout->addWidget ( childbox, 6, 0, Qt::AlignLeft ); |
71 | layout->addWidget ( balancelabel, 0, 1, Qt::AlignLeft ); | 71 | layout->addWidget ( balancelabel, 0, 1, Qt::AlignLeft ); |
72 | layout->addWidget ( balancebox, 1, 1, Qt::AlignLeft ); | 72 | layout->addWidget ( balancebox, 1, 1, Qt::AlignLeft ); |
73 | layout->addWidget ( creditlimitlabel, 2, 1, Qt::AlignLeft ); | 73 | layout->addWidget ( creditlimitlabel, 2, 1, Qt::AlignLeft ); |
74 | layout->addWidget ( creditlimitbox, 3, 1, Qt::AlignLeft ); | 74 | layout->addWidget ( creditlimitbox, 3, 1, Qt::AlignLeft ); |
75 | layout->addWidget ( currencybox, 4, 1, Qt::AlignLeft ); | 75 | layout->addWidget ( currencybox, 4, 1, Qt::AlignLeft ); |
76 | layout->addWidget ( typelabel, 5, 1, Qt::AlignLeft ); | 76 | layout->addWidget ( typelabel, 5, 1, Qt::AlignLeft ); |
77 | layout->addWidget ( accounttype, 6, 1, Qt::AlignLeft ); | 77 | layout->addWidget ( accounttype, 6, 1, Qt::AlignLeft ); |
78 | 78 | ||
79 | connect ( childcheckbox, SIGNAL ( clicked () ), this, SLOT ( showChildPulldownMenu() ) ); | 79 | connect ( childcheckbox, SIGNAL ( clicked() ), this, SLOT ( showChildPulldownMenu() ) ); |
80 | connect ( balancecalculator, SIGNAL ( released() ), this, SLOT ( showCalculator() ) ); | 80 | connect ( balancecalculator, SIGNAL ( released() ), this, SLOT ( showCalculator() ) ); |
81 | connect ( creditlimitcalculator, SIGNAL ( released() ), this, SLOT ( showCreditLimitCalculator() ) ); | 81 | connect ( creditlimitcalculator, SIGNAL ( released() ), this, SLOT ( showCreditLimitCalculator() ) ); |
82 | connect ( accounttype, SIGNAL ( activated ( int ) ), this, SLOT ( activateCreditLimit ( int ) ) ); | 82 | connect ( accounttype, SIGNAL ( activated(int) ), this, SLOT ( activateCreditLimit(int) ) ); |
83 | connect ( datebutton, SIGNAL ( released () ), this, SLOT ( showCalendar () ) ); | 83 | connect ( datebutton, SIGNAL ( released() ), this, SLOT ( showCalendar() ) ); |
84 | connect ( descriptionbutton, SIGNAL ( released () ), this, SLOT ( addAccountDescription() ) ); | 84 | connect ( descriptionbutton, SIGNAL ( released() ), this, SLOT ( addAccountDescription() ) ); |
85 | } | 85 | } |
86 | 86 | ||
87 | NewAccount::~NewAccount () | 87 | NewAccount::~NewAccount () |
88 | { | 88 | { |
89 | } | 89 | } |
90 | 90 | ||
91 | void NewAccount::showChildPulldownMenu () | 91 | void NewAccount::showChildPulldownMenu () |
92 | { | 92 | { |
93 | if ( childcheckbox->isChecked() == TRUE ) | 93 | if ( childcheckbox->isChecked() == TRUE ) |
94 | { | 94 | { |
95 | childlabel->setEnabled ( TRUE ); | 95 | childlabel->setEnabled ( TRUE ); |
96 | childbox->setEnabled ( TRUE ); | 96 | childbox->setEnabled ( TRUE ); |
97 | } | 97 | } |
98 | else | 98 | else |
99 | hideChildPulldownMenu(); | 99 | hideChildPulldownMenu(); |
100 | } | 100 | } |
101 | 101 | ||
102 | void NewAccount::hideChildPulldownMenu () | 102 | void NewAccount::hideChildPulldownMenu () |
103 | { | 103 | { |
104 | childlabel->setEnabled ( FALSE ); | 104 | childlabel->setEnabled ( FALSE ); |
105 | childbox->setEnabled ( FALSE ); | 105 | childbox->setEnabled ( FALSE ); |
106 | } | 106 | } |
107 | 107 | ||
108 | void NewAccount::showCalculator () | 108 | void NewAccount::showCalculator () |
diff --git a/noncore/apps/qashmoney/newtransaction.cpp b/noncore/apps/qashmoney/newtransaction.cpp index 5c78139..87b7f7e 100755 --- a/noncore/apps/qashmoney/newtransaction.cpp +++ b/noncore/apps/qashmoney/newtransaction.cpp | |||
@@ -4,109 +4,109 @@ | |||
4 | #include "budget.h" | 4 | #include "budget.h" |
5 | 5 | ||
6 | #include <qmultilineedit.h> | 6 | #include <qmultilineedit.h> |
7 | 7 | ||
8 | extern Budget *budget; | 8 | extern Budget *budget; |
9 | extern Preferences *preferences; | 9 | extern Preferences *preferences; |
10 | 10 | ||
11 | NewTransaction::NewTransaction ( QWidget* parent ) : QDialog ( parent, 0, TRUE ) | 11 | NewTransaction::NewTransaction ( QWidget* parent ) : QDialog ( parent, 0, TRUE ) |
12 | { | 12 | { |
13 | transactiondescription = ""; | 13 | transactiondescription = ""; |
14 | currentlineitem = -1; | 14 | currentlineitem = -1; |
15 | currentbudget = -1; | 15 | currentbudget = -1; |
16 | dateedited = FALSE; | 16 | dateedited = FALSE; |
17 | setCaption( tr( "Transaction" ) ); | 17 | setCaption( tr( "Transaction" ) ); |
18 | 18 | ||
19 | // START FIRST COLUMN | 19 | // START FIRST COLUMN |
20 | 20 | ||
21 | namelabel = new QLabel ( "Transaction", this ); | 21 | namelabel = new QLabel ( "Transaction", this ); |
22 | 22 | ||
23 | transactionnamebox = new QHBox ( this ); | 23 | transactionnamebox = new QHBox ( this ); |
24 | transactionname = new QComboBox ( transactionnamebox ); | 24 | transactionname = new QComboBox ( transactionnamebox ); |
25 | transactionname->setEditable ( TRUE ); | 25 | transactionname->setEditable ( TRUE ); |
26 | descriptionbutton = new QPushButton ( transactionnamebox ); | 26 | descriptionbutton = new QPushButton ( transactionnamebox ); |
27 | descriptionbutton->setPixmap ( QPixmap ( "/opt/QtPalmtop/pics/info.png" ) ); | 27 | descriptionbutton->setPixmap ( QPixmap ( "/opt/QtPalmtop/pics/info.png" ) ); |
28 | connect ( descriptionbutton, SIGNAL ( released () ), this, SLOT ( addTransactionDescription() ) ); | 28 | connect ( descriptionbutton, SIGNAL ( released() ), this, SLOT ( addTransactionDescription() ) ); |
29 | 29 | ||
30 | amountlabel = new QLabel ( "Amount", this ); | 30 | amountlabel = new QLabel ( "Amount", this ); |
31 | 31 | ||
32 | transactionamountbox = new QHBox ( this ); | 32 | transactionamountbox = new QHBox ( this ); |
33 | transactionamount = new QLineEdit ( transactionamountbox ); | 33 | transactionamount = new QLineEdit ( transactionamountbox ); |
34 | transactionamount->setAlignment ( Qt::AlignRight ); | 34 | transactionamount->setAlignment ( Qt::AlignRight ); |
35 | transactionamount->setText ( "0.00" ); | 35 | transactionamount->setText ( "0.00" ); |
36 | calculatorbutton = new QPushButton( transactionamountbox ); | 36 | calculatorbutton = new QPushButton( transactionamountbox ); |
37 | calculatorbutton->setPixmap ( QPixmap ( "/opt/QtPalmtop/pics/kcalc.png" ) ); | 37 | calculatorbutton->setPixmap ( QPixmap ( "/opt/QtPalmtop/pics/kcalc.png" ) ); |
38 | connect ( calculatorbutton, SIGNAL ( released() ), this, SLOT ( showCalculator() ) ); | 38 | connect ( calculatorbutton, SIGNAL ( released() ), this, SLOT ( showCalculator() ) ); |
39 | 39 | ||
40 | datelabel = new QLabel ( "Date", this ); | 40 | datelabel = new QLabel ( "Date", this ); |
41 | 41 | ||
42 | transactiondatebox = new QHBox ( this ); | 42 | transactiondatebox = new QHBox ( this ); |
43 | transactiondate = new QLineEdit ( transactiondatebox ); | 43 | transactiondate = new QLineEdit ( transactiondatebox ); |
44 | transactiondate->setAlignment ( Qt::AlignRight ); | 44 | transactiondate->setAlignment ( Qt::AlignRight ); |
45 | transactiondate->setDisabled ( TRUE ); | 45 | transactiondate->setDisabled ( TRUE ); |
46 | datebutton = new QPushButton( transactiondatebox ); | 46 | datebutton = new QPushButton( transactiondatebox ); |
47 | datebutton->setPixmap ( QPixmap ( "/opt/QtPalmtop/pics/date.png" ) ); | 47 | datebutton->setPixmap ( QPixmap ( "/opt/QtPalmtop/pics/date.png" ) ); |
48 | connect ( datebutton, SIGNAL ( released () ), this, SLOT ( showCalendar () ) ); | 48 | connect ( datebutton, SIGNAL ( released() ), this, SLOT ( showCalendar() ) ); |
49 | 49 | ||
50 | clearedcheckbox = new QCheckBox ( "Cleared", this ); | 50 | clearedcheckbox = new QCheckBox ( "Cleared", this ); |
51 | depositbox = new QCheckBox ( "Credit", this ); | 51 | depositbox = new QCheckBox ( "Credit", this ); |
52 | 52 | ||
53 | // START SECOND COLUMN | 53 | // START SECOND COLUMN |
54 | 54 | ||
55 | numberlabel = new QLabel ( "Number", this ); | 55 | numberlabel = new QLabel ( "Number", this ); |
56 | transactionnumber = new QLineEdit ( this ); | 56 | transactionnumber = new QLineEdit ( this ); |
57 | 57 | ||
58 | budgetlabel = new QLabel ( "Budget", this ); | 58 | budgetlabel = new QLabel ( "Budget", this ); |
59 | budgetbox = new QComboBox ( FALSE, this ); | 59 | budgetbox = new QComboBox ( FALSE, this ); |
60 | 60 | ||
61 | lineitemlabel = new QLabel ( "LineItem", this ); | 61 | lineitemlabel = new QLabel ( "LineItem", this ); |
62 | lineitembox = new QComboBox ( FALSE, this ); | 62 | lineitembox = new QComboBox ( FALSE, this ); |
63 | 63 | ||
64 | layout = new QGridLayout ( this, 7, 2, 2, 2 ); | 64 | layout = new QGridLayout ( this, 7, 2, 2, 2 ); |
65 | layout->addWidget ( namelabel, 0, 0, Qt::AlignLeft ); | 65 | layout->addWidget ( namelabel, 0, 0, Qt::AlignLeft ); |
66 | layout->addWidget ( transactionnamebox, 1, 0, Qt::AlignLeft ); | 66 | layout->addWidget ( transactionnamebox, 1, 0, Qt::AlignLeft ); |
67 | layout->addWidget ( amountlabel, 2, 0, Qt::AlignLeft ); | 67 | layout->addWidget ( amountlabel, 2, 0, Qt::AlignLeft ); |
68 | layout->addWidget ( transactionamountbox, 3, 0, Qt::AlignLeft ); | 68 | layout->addWidget ( transactionamountbox, 3, 0, Qt::AlignLeft ); |
69 | layout->addWidget ( datelabel, 4, 0, Qt::AlignLeft ); | 69 | layout->addWidget ( datelabel, 4, 0, Qt::AlignLeft ); |
70 | layout->addWidget ( transactiondatebox, 5, 0, Qt::AlignLeft ); | 70 | layout->addWidget ( transactiondatebox, 5, 0, Qt::AlignLeft ); |
71 | layout->addWidget ( clearedcheckbox, 6, 0, Qt::AlignLeft ); | 71 | layout->addWidget ( clearedcheckbox, 6, 0, Qt::AlignLeft ); |
72 | layout->addWidget ( numberlabel, 0, 1, Qt::AlignLeft ); | 72 | layout->addWidget ( numberlabel, 0, 1, Qt::AlignLeft ); |
73 | layout->addWidget ( transactionnumber, 1, 1, Qt::AlignLeft ); | 73 | layout->addWidget ( transactionnumber, 1, 1, Qt::AlignLeft ); |
74 | layout->addWidget ( budgetlabel, 2, 1, Qt::AlignLeft ); | 74 | layout->addWidget ( budgetlabel, 2, 1, Qt::AlignLeft ); |
75 | layout->addWidget ( budgetbox, 3, 1, Qt::AlignLeft ); | 75 | layout->addWidget ( budgetbox, 3, 1, Qt::AlignLeft ); |
76 | layout->addWidget ( lineitemlabel, 4, 1, Qt::AlignLeft ); | 76 | layout->addWidget ( lineitemlabel, 4, 1, Qt::AlignLeft ); |
77 | layout->addWidget ( lineitembox, 5, 1, Qt::AlignLeft ); | 77 | layout->addWidget ( lineitembox, 5, 1, Qt::AlignLeft ); |
78 | layout->addWidget ( depositbox, 6, 1, Qt::AlignLeft ); | 78 | layout->addWidget ( depositbox, 6, 1, Qt::AlignLeft ); |
79 | 79 | ||
80 | if ( budget->getNumberOfBudgets() != 0 ) | 80 | if ( budget->getNumberOfBudgets() != 0 ) |
81 | { | 81 | { |
82 | budgetnameslist = budget->getBudgetNames(); | 82 | budgetnameslist = budget->getBudgetNames(); |
83 | budgetidslist = budget->getBudgetIDs(); | 83 | budgetidslist = budget->getBudgetIDs(); |
84 | budgetbox->insertStringList ( *budgetnameslist ); | 84 | budgetbox->insertStringList ( *budgetnameslist ); |
85 | lineitemlabel->setEnabled ( FALSE ); | 85 | lineitemlabel->setEnabled ( FALSE ); |
86 | lineitembox->setEnabled ( FALSE ); | 86 | lineitembox->setEnabled ( FALSE ); |
87 | connect ( budgetbox, SIGNAL ( activated ( int ) ), this, SLOT ( setCurrentBudget ( int ) ) ); | 87 | connect ( budgetbox, SIGNAL ( activated(int) ), this, SLOT ( setCurrentBudget(int) ) ); |
88 | connect ( lineitembox, SIGNAL ( activated ( int ) ), this, SLOT ( setCurrentLineItem ( int ) ) ); | 88 | connect ( lineitembox, SIGNAL ( activated(int) ), this, SLOT ( setCurrentLineItem(int) ) ); |
89 | } | 89 | } |
90 | else | 90 | else |
91 | { | 91 | { |
92 | budgetlabel->setEnabled ( FALSE ); | 92 | budgetlabel->setEnabled ( FALSE ); |
93 | budgetbox->setEnabled ( FALSE ); | 93 | budgetbox->setEnabled ( FALSE ); |
94 | lineitemlabel->setEnabled ( FALSE ); | 94 | lineitemlabel->setEnabled ( FALSE ); |
95 | lineitembox->setEnabled ( FALSE ); | 95 | lineitembox->setEnabled ( FALSE ); |
96 | } | 96 | } |
97 | 97 | ||
98 | } | 98 | } |
99 | 99 | ||
100 | NewTransaction::~NewTransaction () | 100 | NewTransaction::~NewTransaction () |
101 | { | 101 | { |
102 | } | 102 | } |
103 | 103 | ||
104 | void NewTransaction::showCalculator () | 104 | void NewTransaction::showCalculator () |
105 | { | 105 | { |
106 | Calculator *calculator = new Calculator ( this ); | 106 | Calculator *calculator = new Calculator ( this ); |
107 | calculator->setMaximumWidth ( ( int ) ( this->size().width() * 0.9 ) ); | 107 | calculator->setMaximumWidth ( ( int ) ( this->size().width() * 0.9 ) ); |
108 | if ( calculator->exec () == QDialog::Accepted ) | 108 | if ( calculator->exec () == QDialog::Accepted ) |
109 | transactionamount->setText ( calculator->display->text() ); | 109 | transactionamount->setText ( calculator->display->text() ); |
110 | } | 110 | } |
111 | 111 | ||
112 | void NewTransaction::showCalendar () | 112 | void NewTransaction::showCalendar () |
diff --git a/noncore/apps/qashmoney/preferencedialogs.cpp b/noncore/apps/qashmoney/preferencedialogs.cpp index 5408a5b..b83c957 100755 --- a/noncore/apps/qashmoney/preferencedialogs.cpp +++ b/noncore/apps/qashmoney/preferencedialogs.cpp | |||
@@ -1,55 +1,55 @@ | |||
1 | #include "preferencedialogs.h" | 1 | #include "preferencedialogs.h" |
2 | #include "preferences.h" | 2 | #include "preferences.h" |
3 | 3 | ||
4 | extern Preferences *preferences; | 4 | extern Preferences *preferences; |
5 | 5 | ||
6 | DatePreferences::DatePreferences ( QWidget* parent ) : QDialog ( parent, 0, TRUE ) | 6 | DatePreferences::DatePreferences ( QWidget* parent ) : QDialog ( parent, 0, TRUE ) |
7 | { | 7 | { |
8 | setCaption( tr( "Date" ) ); | 8 | setCaption( tr( "Date" ) ); |
9 | 9 | ||
10 | QLabel *datelabel = new QLabel ( "Format", this ); | 10 | QLabel *datelabel = new QLabel ( "Format", this ); |
11 | dateformat = new QComboBox ( this ); | 11 | dateformat = new QComboBox ( this ); |
12 | dateformat->setEditable ( FALSE ); | 12 | dateformat->setEditable ( FALSE ); |
13 | dateformat->insertItem ( "yyyymmdd" ); | 13 | dateformat->insertItem ( "yyyymmdd" ); |
14 | dateformat->insertItem ( "yymmdd" ); | 14 | dateformat->insertItem ( "yymmdd" ); |
15 | dateformat->insertItem ( "mmddyyyy" ); | 15 | dateformat->insertItem ( "mmddyyyy" ); |
16 | dateformat->insertItem ( "mmddyy" ); | 16 | dateformat->insertItem ( "mmddyy" ); |
17 | dateformat->insertItem ( "yyyyddmm" ); | 17 | dateformat->insertItem ( "yyyyddmm" ); |
18 | dateformat->insertItem ( "yyddmm" ); | 18 | dateformat->insertItem ( "yyddmm" ); |
19 | dateformat->insertItem ( "ddmmyyyy" ); | 19 | dateformat->insertItem ( "ddmmyyyy" ); |
20 | dateformat->insertItem ( "ddmmyy" ); | 20 | dateformat->insertItem ( "ddmmyy" ); |
21 | connect ( dateformat, SIGNAL ( activated ( int ) ), this, SLOT ( changeDateFormat ( int ) ) ); | 21 | connect ( dateformat, SIGNAL ( activated(int) ), this, SLOT ( changeDateFormat(int) ) ); |
22 | 22 | ||
23 | QLabel *dateseparatorlabel = new QLabel ( "Separator", this ); | 23 | QLabel *dateseparatorlabel = new QLabel ( "Separator", this ); |
24 | dateseparator = new QComboBox ( this ); | 24 | dateseparator = new QComboBox ( this ); |
25 | dateseparator->insertItem ( "/" ); | 25 | dateseparator->insertItem ( "/" ); |
26 | dateseparator->insertItem ( "-" ); | 26 | dateseparator->insertItem ( "-" ); |
27 | dateseparator->insertItem ( "." ); | 27 | dateseparator->insertItem ( "." ); |
28 | connect ( dateseparator, SIGNAL ( activated ( int ) ), this, SLOT ( changeDateSeparator ( int ) ) ); | 28 | connect ( dateseparator, SIGNAL ( activated(int) ), this, SLOT ( changeDateSeparator(int) ) ); |
29 | 29 | ||
30 | defaults = new QPushButton ( QPixmap ( "/opt/QtPalmtop/pics/defaults.png" ), "Defaults", this ); | 30 | defaults = new QPushButton ( QPixmap ( "/opt/QtPalmtop/pics/defaults.png" ), "Defaults", this ); |
31 | connect ( defaults, SIGNAL ( released () ), this, SLOT ( setDefaultDatePreferences () ) ); | 31 | connect ( defaults, SIGNAL ( released() ), this, SLOT ( setDefaultDatePreferences() ) ); |
32 | 32 | ||
33 | dateformat->setCurrentItem ( ( preferences->getPreference ( 1 ) ) - 1 ); | 33 | dateformat->setCurrentItem ( ( preferences->getPreference ( 1 ) ) - 1 ); |
34 | dateseparator->setCurrentItem ( ( preferences->getPreference ( 2 ) ) - 1 ); | 34 | dateseparator->setCurrentItem ( ( preferences->getPreference ( 2 ) ) - 1 ); |
35 | 35 | ||
36 | layout = new QVBoxLayout ( this, 2, 2 ); | 36 | layout = new QVBoxLayout ( this, 2, 2 ); |
37 | layout->addWidget ( datelabel ); | 37 | layout->addWidget ( datelabel ); |
38 | layout->addWidget ( dateformat ); | 38 | layout->addWidget ( dateformat ); |
39 | layout->addWidget ( dateseparatorlabel ); | 39 | layout->addWidget ( dateseparatorlabel ); |
40 | layout->addWidget ( dateseparator ); | 40 | layout->addWidget ( dateseparator ); |
41 | layout->insertSpacing ( 4, 5 ); | 41 | layout->insertSpacing ( 4, 5 ); |
42 | layout->addWidget ( defaults ); | 42 | layout->addWidget ( defaults ); |
43 | 43 | ||
44 | } | 44 | } |
45 | 45 | ||
46 | DatePreferences::~DatePreferences () | 46 | DatePreferences::~DatePreferences () |
47 | { | 47 | { |
48 | } | 48 | } |
49 | 49 | ||
50 | void DatePreferences::changeDateFormat ( int index ) | 50 | void DatePreferences::changeDateFormat ( int index ) |
51 | { | 51 | { |
52 | index ++; | 52 | index ++; |
53 | preferences->changePreference ( 1, index ); | 53 | preferences->changePreference ( 1, index ); |
54 | } | 54 | } |
55 | 55 | ||
@@ -81,60 +81,60 @@ TransactionPreferences::TransactionPreferences ( QWidget* parent ) : QDialog ( p | |||
81 | limittransactions = new QComboBox ( limittransactionsbox ); | 81 | limittransactions = new QComboBox ( limittransactionsbox ); |
82 | QLabel *limittransactionslabel2 = new QLabel ( "of cleared transactions. ", limittransactionsbox ); | 82 | QLabel *limittransactionslabel2 = new QLabel ( "of cleared transactions. ", limittransactionsbox ); |
83 | limittransactions->insertItem ( "14 days" ); | 83 | limittransactions->insertItem ( "14 days" ); |
84 | limittransactions->insertItem ( "30 days" ); | 84 | limittransactions->insertItem ( "30 days" ); |
85 | limittransactions->insertItem ( "90 days" ); | 85 | limittransactions->insertItem ( "90 days" ); |
86 | limittransactions->insertItem ( "180 days" ); | 86 | limittransactions->insertItem ( "180 days" ); |
87 | limittransactions->insertItem ( "365 days" ); | 87 | limittransactions->insertItem ( "365 days" ); |
88 | limittransactions->insertItem ( "All" ); | 88 | limittransactions->insertItem ( "All" ); |
89 | limittransactions->setCurrentItem ( preferences->getPreference ( 7 ) ); | 89 | limittransactions->setCurrentItem ( preferences->getPreference ( 7 ) ); |
90 | 90 | ||
91 | excludetransfers = new QCheckBox ( this ); | 91 | excludetransfers = new QCheckBox ( this ); |
92 | excludetransfers->setText ( "Include Transfers In Limit View" ); | 92 | excludetransfers->setText ( "Include Transfers In Limit View" ); |
93 | 93 | ||
94 | if ( preferences->getPreference ( 3 ) == 1 ) | 94 | if ( preferences->getPreference ( 3 ) == 1 ) |
95 | showclearedtransactions->setChecked ( TRUE ); | 95 | showclearedtransactions->setChecked ( TRUE ); |
96 | else | 96 | else |
97 | showclearedtransactions->setChecked ( FALSE ); | 97 | showclearedtransactions->setChecked ( FALSE ); |
98 | 98 | ||
99 | if ( preferences->getPreference ( 6 ) == 1 ) | 99 | if ( preferences->getPreference ( 6 ) == 1 ) |
100 | excludetransfers->setChecked ( TRUE ); | 100 | excludetransfers->setChecked ( TRUE ); |
101 | else | 101 | else |
102 | excludetransfers->setChecked ( FALSE ); | 102 | excludetransfers->setChecked ( FALSE ); |
103 | 103 | ||
104 | defaults = new QPushButton ( QPixmap ( "/opt/QtPalmtop/pics/defaults.png" ), "Defaults", this ); | 104 | defaults = new QPushButton ( QPixmap ( "/opt/QtPalmtop/pics/defaults.png" ), "Defaults", this ); |
105 | connect ( defaults, SIGNAL ( released () ), this, SLOT ( setDefaultTransactionPreferences () ) ); | 105 | connect ( defaults, SIGNAL ( released() ), this, SLOT ( setDefaultTransactionPreferences() ) ); |
106 | 106 | ||
107 | layout = new QVBoxLayout ( this, 2, 2 ); | 107 | layout = new QVBoxLayout ( this, 2, 2 ); |
108 | layout->addWidget ( showclearedtransactions ); | 108 | layout->addWidget ( showclearedtransactions ); |
109 | layout->addWidget ( limittransactionsbox ); | 109 | layout->addWidget ( limittransactionsbox ); |
110 | layout->addWidget ( excludetransfers ); | 110 | layout->addWidget ( excludetransfers ); |
111 | layout->insertSpacing ( 3, 5 ); | 111 | layout->insertSpacing ( 3, 5 ); |
112 | layout->addWidget ( defaults ); | 112 | layout->addWidget ( defaults ); |
113 | 113 | ||
114 | connect ( showclearedtransactions, SIGNAL ( toggled ( bool ) ), this, SLOT ( changeShowClearedPreference ( bool ) ) ); | 114 | connect ( showclearedtransactions, SIGNAL ( toggled(bool) ), this, SLOT ( changeShowClearedPreference(bool) ) ); |
115 | connect ( excludetransfers, SIGNAL ( toggled ( bool ) ), this, SLOT ( changeExcludeTranfersPreference ( bool ) ) ); | 115 | connect ( excludetransfers, SIGNAL ( toggled(bool) ), this, SLOT ( changeExcludeTranfersPreference(bool) ) ); |
116 | connect ( limittransactions, SIGNAL ( activated ( int ) ), this, SLOT ( changeLimitTransactionsPreference ( int ) ) ); | 116 | connect ( limittransactions, SIGNAL ( activated(int) ), this, SLOT ( changeLimitTransactionsPreference(int) ) ); |
117 | } | 117 | } |
118 | 118 | ||
119 | TransactionPreferences::~TransactionPreferences () | 119 | TransactionPreferences::~TransactionPreferences () |
120 | { | 120 | { |
121 | } | 121 | } |
122 | 122 | ||
123 | void TransactionPreferences::changeLimitTransactionsPreference ( int pref ) | 123 | void TransactionPreferences::changeLimitTransactionsPreference ( int pref ) |
124 | { | 124 | { |
125 | preferences->changePreference ( 7, pref ); | 125 | preferences->changePreference ( 7, pref ); |
126 | } | 126 | } |
127 | 127 | ||
128 | void TransactionPreferences::changeShowClearedPreference ( bool state ) | 128 | void TransactionPreferences::changeShowClearedPreference ( bool state ) |
129 | { | 129 | { |
130 | if ( state == TRUE ) | 130 | if ( state == TRUE ) |
131 | preferences->changePreference ( 3, 1 ); | 131 | preferences->changePreference ( 3, 1 ); |
132 | else | 132 | else |
133 | preferences->changePreference ( 3, 0 ); | 133 | preferences->changePreference ( 3, 0 ); |
134 | } | 134 | } |
135 | 135 | ||
136 | void TransactionPreferences::changeExcludeTranfersPreference ( bool state ) | 136 | void TransactionPreferences::changeExcludeTranfersPreference ( bool state ) |
137 | { | 137 | { |
138 | if ( state == TRUE ) | 138 | if ( state == TRUE ) |
139 | preferences->changePreference ( 6, 1 ); | 139 | preferences->changePreference ( 6, 1 ); |
140 | else | 140 | else |
@@ -153,58 +153,58 @@ void TransactionPreferences::setDefaultTransactionPreferences () | |||
153 | // START ACCOUNT PREFERNCES | 153 | // START ACCOUNT PREFERNCES |
154 | 154 | ||
155 | AccountPreferences::AccountPreferences ( QWidget* parent ) : QDialog ( parent, 0, TRUE ) | 155 | AccountPreferences::AccountPreferences ( QWidget* parent ) : QDialog ( parent, 0, TRUE ) |
156 | { | 156 | { |
157 | 157 | ||
158 | setCaption( tr ( "Account" ) ); | 158 | setCaption( tr ( "Account" ) ); |
159 | 159 | ||
160 | currencysupport = new QCheckBox ( this ); | 160 | currencysupport = new QCheckBox ( this ); |
161 | currencysupport->setText ( "Enable Currency Support" ); | 161 | currencysupport->setText ( "Enable Currency Support" ); |
162 | 162 | ||
163 | onetouch = new QCheckBox ( this ); | 163 | onetouch = new QCheckBox ( this ); |
164 | onetouch->setText ( "One Touch Account Viewing" ); | 164 | onetouch->setText ( "One Touch Account Viewing" ); |
165 | 165 | ||
166 | if ( preferences->getPreference ( 4 ) == 1 ) | 166 | if ( preferences->getPreference ( 4 ) == 1 ) |
167 | currencysupport->setChecked ( TRUE ); | 167 | currencysupport->setChecked ( TRUE ); |
168 | else | 168 | else |
169 | currencysupport->setChecked ( FALSE ); | 169 | currencysupport->setChecked ( FALSE ); |
170 | 170 | ||
171 | if ( preferences->getPreference ( 5 ) == 1 ) | 171 | if ( preferences->getPreference ( 5 ) == 1 ) |
172 | onetouch->setChecked ( TRUE ); | 172 | onetouch->setChecked ( TRUE ); |
173 | else | 173 | else |
174 | onetouch->setChecked ( FALSE ); | 174 | onetouch->setChecked ( FALSE ); |
175 | 175 | ||
176 | defaults = new QPushButton ( QPixmap ( "/opt/QtPalmtop/pics/defaults.png" ), "Defaults", this ); | 176 | defaults = new QPushButton ( QPixmap ( "/opt/QtPalmtop/pics/defaults.png" ), "Defaults", this ); |
177 | connect ( defaults, SIGNAL ( released () ), this, SLOT ( setDefaultAccountPreferences () ) ); | 177 | connect ( defaults, SIGNAL ( released() ), this, SLOT ( setDefaultAccountPreferences() ) ); |
178 | 178 | ||
179 | layout = new QVBoxLayout ( this, 2, 2 ); | 179 | layout = new QVBoxLayout ( this, 2, 2 ); |
180 | layout->addWidget ( currencysupport ); | 180 | layout->addWidget ( currencysupport ); |
181 | layout->addWidget ( onetouch ); | 181 | layout->addWidget ( onetouch ); |
182 | layout->insertSpacing ( 2, 5 ); | 182 | layout->insertSpacing ( 2, 5 ); |
183 | layout->addWidget ( defaults ); | 183 | layout->addWidget ( defaults ); |
184 | 184 | ||
185 | connect ( currencysupport, SIGNAL ( toggled ( bool ) ), this, SLOT ( changeCurrencySupport ( bool ) ) ); | 185 | connect ( currencysupport, SIGNAL ( toggled(bool) ), this, SLOT ( changeCurrencySupport(bool) ) ); |
186 | connect ( onetouch, SIGNAL ( toggled ( bool ) ), this, SLOT ( changeOneTouchViewing ( bool ) ) ); | 186 | connect ( onetouch, SIGNAL ( toggled(bool) ), this, SLOT ( changeOneTouchViewing(bool) ) ); |
187 | } | 187 | } |
188 | 188 | ||
189 | AccountPreferences::~AccountPreferences () | 189 | AccountPreferences::~AccountPreferences () |
190 | { | 190 | { |
191 | } | 191 | } |
192 | 192 | ||
193 | void AccountPreferences::changeCurrencySupport ( bool state ) | 193 | void AccountPreferences::changeCurrencySupport ( bool state ) |
194 | { | 194 | { |
195 | if ( state == TRUE ) | 195 | if ( state == TRUE ) |
196 | preferences->changePreference ( 4, 1 ); | 196 | preferences->changePreference ( 4, 1 ); |
197 | else | 197 | else |
198 | preferences->changePreference ( 4, 0 ); | 198 | preferences->changePreference ( 4, 0 ); |
199 | } | 199 | } |
200 | 200 | ||
201 | void AccountPreferences::changeOneTouchViewing ( bool state ) | 201 | void AccountPreferences::changeOneTouchViewing ( bool state ) |
202 | { | 202 | { |
203 | if ( state == TRUE ) | 203 | if ( state == TRUE ) |
204 | preferences->changePreference ( 5, 1 ); | 204 | preferences->changePreference ( 5, 1 ); |
205 | else | 205 | else |
206 | preferences->changePreference ( 5, 0 ); | 206 | preferences->changePreference ( 5, 0 ); |
207 | } | 207 | } |
208 | 208 | ||
209 | void AccountPreferences::setDefaultAccountPreferences () | 209 | void AccountPreferences::setDefaultAccountPreferences () |
210 | { | 210 | { |
diff --git a/noncore/apps/qashmoney/qashmoney.cpp b/noncore/apps/qashmoney/qashmoney.cpp index d4cbc14..1455eb0 100755 --- a/noncore/apps/qashmoney/qashmoney.cpp +++ b/noncore/apps/qashmoney/qashmoney.cpp | |||
@@ -7,88 +7,88 @@ | |||
7 | Budget *budget = new Budget (); | 7 | Budget *budget = new Budget (); |
8 | Preferences *preferences = new Preferences (); | 8 | Preferences *preferences = new Preferences (); |
9 | Account *account = new Account (); | 9 | Account *account = new Account (); |
10 | Transaction *transaction = new Transaction (); | 10 | Transaction *transaction = new Transaction (); |
11 | Transfer *transfer = new Transfer (); | 11 | Transfer *transfer = new Transfer (); |
12 | Memory *memory = new Memory (); | 12 | Memory *memory = new Memory (); |
13 | 13 | ||
14 | QashMoney::QashMoney () : QWidget () | 14 | QashMoney::QashMoney () : QWidget () |
15 | { | 15 | { |
16 | preferences->addPreferences (); | 16 | preferences->addPreferences (); |
17 | preferences->initializeColumnPreferences (); | 17 | preferences->initializeColumnPreferences (); |
18 | preferences->initializeSortingPreferences (); | 18 | preferences->initializeSortingPreferences (); |
19 | 19 | ||
20 | // set the text in the upper part of the frame | 20 | // set the text in the upper part of the frame |
21 | setCaption ( tr ( "QashMoney" ) ); | 21 | setCaption ( tr ( "QashMoney" ) ); |
22 | 22 | ||
23 | // Create new menubar for our mainwindow | 23 | // Create new menubar for our mainwindow |
24 | // and add menu items | 24 | // and add menu items |
25 | mainmenu = new QMenuBar ( this ); | 25 | mainmenu = new QMenuBar ( this ); |
26 | mainmenu->setFrameStyle ( QFrame::PopupPanel | QFrame::Raised ); | 26 | mainmenu->setFrameStyle ( QFrame::PopupPanel | QFrame::Raised ); |
27 | preferencesmenu = new QPopupMenu ( this ); | 27 | preferencesmenu = new QPopupMenu ( this ); |
28 | utilitiesmenu = new QPopupMenu ( this ); | 28 | utilitiesmenu = new QPopupMenu ( this ); |
29 | mainmenu->insertItem ( "Preferences", preferencesmenu ); | 29 | mainmenu->insertItem ( "Preferences", preferencesmenu ); |
30 | mainmenu->insertItem ( "Utilities", utilitiesmenu ); | 30 | mainmenu->insertItem ( "Utilities", utilitiesmenu ); |
31 | preferencesmenu->insertItem ( "Date", this, SLOT ( displayDatePreferencesDialog () ) ); | 31 | preferencesmenu->insertItem ( "Date", this, SLOT ( displayDatePreferencesDialog() ) ); |
32 | preferencesmenu->insertItem ( "Account", this, SLOT ( displayAccountPreferencesDialog () ) ); | 32 | preferencesmenu->insertItem ( "Account", this, SLOT ( displayAccountPreferencesDialog() ) ); |
33 | preferencesmenu->insertItem ( "Transaction", this, SLOT ( displayTransactionPreferencesDialog () ) ); | 33 | preferencesmenu->insertItem ( "Transaction", this, SLOT ( displayTransactionPreferencesDialog() ) ); |
34 | utilitiesmenu->insertItem ( "Memory", this, SLOT ( displayMemoryDialog () ) ); | 34 | utilitiesmenu->insertItem ( "Memory", this, SLOT ( displayMemoryDialog() ) ); |
35 | 35 | ||
36 | // create the main tabwidget for displaying accounts and transactions | 36 | // create the main tabwidget for displaying accounts and transactions |
37 | maintabs = new QTabWidget ( this ); | 37 | maintabs = new QTabWidget ( this ); |
38 | tab = new QWidget ( this ); | 38 | tab = new QWidget ( this ); |
39 | tab_2 = new QWidget ( this ); | 39 | tab_2 = new QWidget ( this ); |
40 | tab_3 = new QWidget ( this ); | 40 | tab_3 = new QWidget ( this ); |
41 | maintabs->addTab ( tab, "Accounts" ); | 41 | maintabs->addTab ( tab, "Accounts" ); |
42 | maintabs->addTab ( tab_2, "Transactions" ); | 42 | maintabs->addTab ( tab_2, "Transactions" ); |
43 | maintabs->addTab ( tab_3, "Budgets" ); | 43 | maintabs->addTab ( tab_3, "Budgets" ); |
44 | tabheight = tab->height(); | 44 | tabheight = tab->height(); |
45 | maintabs->setTabEnabled ( tab_2, FALSE ); | 45 | maintabs->setTabEnabled ( tab_2, FALSE ); |
46 | 46 | ||
47 | // create a new account display object | 47 | // create a new account display object |
48 | accountdisplay = new AccountDisplay ( maintabs ); | 48 | accountdisplay = new AccountDisplay ( maintabs ); |
49 | accountdisplay->setTabs ( tab_2, maintabs ); | 49 | accountdisplay->setTabs ( tab_2, maintabs ); |
50 | connect ( accountdisplay->listview, SIGNAL ( selectionChanged () ), this, SLOT ( setTransactionTab () ) ); | 50 | connect ( accountdisplay->listview, SIGNAL ( selectionChanged() ), this, SLOT ( setTransactionTab() ) ); |
51 | 51 | ||
52 | // set the connection to disable the one touch account viewing if we are transfering money | 52 | // set the connection to disable the one touch account viewing if we are transfering money |
53 | connect ( accountdisplay->transferbutton, SIGNAL ( toggled ( bool ) ), this, SLOT ( toggleOneTouchViewing ( bool ) ) ); | 53 | connect ( accountdisplay->transferbutton, SIGNAL ( toggled(bool) ), this, SLOT ( toggleOneTouchViewing(bool) ) ); |
54 | 54 | ||
55 | // create a new transactiondisplay object | 55 | // create a new transactiondisplay object |
56 | transactiondisplay = new TransactionDisplay ( maintabs ); | 56 | transactiondisplay = new TransactionDisplay ( maintabs ); |
57 | transactiondisplay->hide(); | 57 | transactiondisplay->hide(); |
58 | 58 | ||
59 | // create new budgetdisplay object | 59 | // create new budgetdisplay object |
60 | budgetdisplay = new BudgetDisplay ( maintabs ); | 60 | budgetdisplay = new BudgetDisplay ( maintabs ); |
61 | budgetdisplay->hide(); | 61 | budgetdisplay->hide(); |
62 | 62 | ||
63 | tabslayout = new QVBoxLayout ( maintabs, 4, 2 ); | 63 | tabslayout = new QVBoxLayout ( maintabs, 4, 2 ); |
64 | tabslayout->addSpacing ( tabheight ); | 64 | tabslayout->addSpacing ( tabheight ); |
65 | tabslayout->addWidget ( accountdisplay ); | 65 | tabslayout->addWidget ( accountdisplay ); |
66 | tabslayout->addWidget ( transactiondisplay ); | 66 | tabslayout->addWidget ( transactiondisplay ); |
67 | tabslayout->addWidget ( budgetdisplay ); | 67 | tabslayout->addWidget ( budgetdisplay ); |
68 | 68 | ||
69 | // connect a change in the maintabs with changing the tab display | 69 | // connect a change in the maintabs with changing the tab display |
70 | connect ( maintabs, SIGNAL ( currentChanged ( QWidget * ) ), this, SLOT ( changeTabDisplay () ) ); | 70 | connect ( maintabs, SIGNAL ( currentChanged(QWidget*) ), this, SLOT ( changeTabDisplay() ) ); |
71 | 71 | ||
72 | // create layout that will contain the menubar and the maintabs | 72 | // create layout that will contain the menubar and the maintabs |
73 | layout = new QVBoxLayout ( this, 2, 2 ); | 73 | layout = new QVBoxLayout ( this, 2, 2 ); |
74 | layout->setMenuBar ( mainmenu ); | 74 | layout->setMenuBar ( mainmenu ); |
75 | layout->addWidget ( maintabs ); | 75 | layout->addWidget ( maintabs ); |
76 | } | 76 | } |
77 | 77 | ||
78 | QashMoney::~QashMoney () | 78 | QashMoney::~QashMoney () |
79 | { | 79 | { |
80 | delete budget; | 80 | delete budget; |
81 | delete preferences; | 81 | delete preferences; |
82 | delete account; | 82 | delete account; |
83 | delete transaction; | 83 | delete transaction; |
84 | delete transfer; | 84 | delete transfer; |
85 | delete memory; | 85 | delete memory; |
86 | } | 86 | } |
87 | 87 | ||
88 | void QashMoney::changeTabDisplay () | 88 | void QashMoney::changeTabDisplay () |
89 | { | 89 | { |
90 | // if the user pressed the transactions tab, hide the account display | 90 | // if the user pressed the transactions tab, hide the account display |
91 | // object and create a new transaction display | 91 | // object and create a new transaction display |
92 | if ( maintabs->currentPageIndex() == 1 ) | 92 | if ( maintabs->currentPageIndex() == 1 ) |
93 | { | 93 | { |
94 | // initialize variables | 94 | // initialize variables |
@@ -331,56 +331,56 @@ void QashMoney::displayAccountPreferencesDialog () | |||
331 | { | 331 | { |
332 | accountdisplay->listview->clear(); | 332 | accountdisplay->listview->clear(); |
333 | account->displayAccounts ( accountdisplay->listview ); | 333 | account->displayAccounts ( accountdisplay->listview ); |
334 | accountdisplay->listview->clearSelection(); | 334 | accountdisplay->listview->clearSelection(); |
335 | maintabs->setTabEnabled ( tab_2, FALSE ); | 335 | maintabs->setTabEnabled ( tab_2, FALSE ); |
336 | } | 336 | } |
337 | changeTabDisplay(); | 337 | changeTabDisplay(); |
338 | } | 338 | } |
339 | 339 | ||
340 | void QashMoney::displayMemoryDialog () | 340 | void QashMoney::displayMemoryDialog () |
341 | { | 341 | { |
342 | // opens a dialog to add, edit and delete memory items | 342 | // opens a dialog to add, edit and delete memory items |
343 | MemoryDialog *md = new MemoryDialog (); | 343 | MemoryDialog *md = new MemoryDialog (); |
344 | md->exec(); | 344 | md->exec(); |
345 | } | 345 | } |
346 | 346 | ||
347 | void QashMoney::showTransactions () | 347 | void QashMoney::showTransactions () |
348 | { | 348 | { |
349 | maintabs->setCurrentPage ( 1 ); | 349 | maintabs->setCurrentPage ( 1 ); |
350 | } | 350 | } |
351 | 351 | ||
352 | void QashMoney::enableOneTouchViewing () | 352 | void QashMoney::enableOneTouchViewing () |
353 | { | 353 | { |
354 | if ( preferences->getPreference ( 5 ) == 1 ) | 354 | if ( preferences->getPreference ( 5 ) == 1 ) |
355 | connect ( accountdisplay->listview, SIGNAL ( selectionChanged () ), this, SLOT ( showTransactions () ) ); | 355 | connect ( accountdisplay->listview, SIGNAL ( selectionChanged() ), this, SLOT ( showTransactions() ) ); |
356 | else | 356 | else |
357 | disconnect ( accountdisplay->listview, SIGNAL ( selectionChanged () ), this, SLOT ( showTransactions () ) ); | 357 | disconnect ( accountdisplay->listview, SIGNAL ( selectionChanged() ), this, SLOT ( showTransactions() ) ); |
358 | } | 358 | } |
359 | 359 | ||
360 | void QashMoney::disableOneTouchViewing () | 360 | void QashMoney::disableOneTouchViewing () |
361 | { | 361 | { |
362 | disconnect ( accountdisplay->listview, SIGNAL ( selectionChanged () ), this, SLOT ( showTransactions () ) ); | 362 | disconnect ( accountdisplay->listview, SIGNAL ( selectionChanged() ), this, SLOT ( showTransactions() ) ); |
363 | } | 363 | } |
364 | 364 | ||
365 | void QashMoney::toggleOneTouchViewing ( bool state ) | 365 | void QashMoney::toggleOneTouchViewing ( bool state ) |
366 | { | 366 | { |
367 | if ( state == TRUE ) | 367 | if ( state == TRUE ) |
368 | disableOneTouchViewing(); | 368 | disableOneTouchViewing(); |
369 | else | 369 | else |
370 | enableOneTouchViewing(); | 370 | enableOneTouchViewing(); |
371 | } | 371 | } |
372 | 372 | ||
373 | void QashMoney::setTransactionDisplayDate () | 373 | void QashMoney::setTransactionDisplayDate () |
374 | { | 374 | { |
375 | // determine how many days of transactions to show | 375 | // determine how many days of transactions to show |
376 | int limittype = preferences->getPreference ( 7 ); | 376 | int limittype = preferences->getPreference ( 7 ); |
377 | if ( limittype != 5 ) // set today's date if we are not showing all transactions | 377 | if ( limittype != 5 ) // set today's date if we are not showing all transactions |
378 | { | 378 | { |
379 | QDate today = QDate::currentDate (); | 379 | QDate today = QDate::currentDate (); |
380 | switch ( limittype ) // if we are not showing all transactions | 380 | switch ( limittype ) // if we are not showing all transactions |
381 | { | 381 | { |
382 | case 0: // viewing two weeks | 382 | case 0: // viewing two weeks |
383 | newdate = today.addDays ( -14 ); | 383 | newdate = today.addDays ( -14 ); |
384 | break; | 384 | break; |
385 | case 1: // viewing one month | 385 | case 1: // viewing one month |
386 | newdate = today.addDays ( -30 ); | 386 | newdate = today.addDays ( -30 ); |
diff --git a/noncore/apps/qashmoney/transactiondisplay.cpp b/noncore/apps/qashmoney/transactiondisplay.cpp index 474f11e..0b94d62 100755 --- a/noncore/apps/qashmoney/transactiondisplay.cpp +++ b/noncore/apps/qashmoney/transactiondisplay.cpp | |||
@@ -8,83 +8,83 @@ | |||
8 | #include "datepicker.h" | 8 | #include "datepicker.h" |
9 | 9 | ||
10 | #include <qmessagebox.h> | 10 | #include <qmessagebox.h> |
11 | #include <qheader.h> | 11 | #include <qheader.h> |
12 | #include <qmultilineedit.h> | 12 | #include <qmultilineedit.h> |
13 | 13 | ||
14 | extern Transaction *transaction; | 14 | extern Transaction *transaction; |
15 | extern Budget *budget; | 15 | extern Budget *budget; |
16 | extern Account *account; | 16 | extern Account *account; |
17 | extern Preferences *preferences; | 17 | extern Preferences *preferences; |
18 | extern Memory *memory; | 18 | extern Memory *memory; |
19 | extern Transfer *transfer; | 19 | extern Transfer *transfer; |
20 | 20 | ||
21 | TransactionDisplay::TransactionDisplay ( QWidget* parent ) : QWidget ( parent ) | 21 | TransactionDisplay::TransactionDisplay ( QWidget* parent ) : QWidget ( parent ) |
22 | { | 22 | { |
23 | // set transactiondisplay variables; | 23 | // set transactiondisplay variables; |
24 | accountid = 0; | 24 | accountid = 0; |
25 | children = TRUE; | 25 | children = TRUE; |
26 | 26 | ||
27 | firstline = new QHBox ( this ); | 27 | firstline = new QHBox ( this ); |
28 | firstline->setSpacing ( 2 ); | 28 | firstline->setSpacing ( 2 ); |
29 | 29 | ||
30 | newtransaction = new QPushButton ( firstline ); | 30 | newtransaction = new QPushButton ( firstline ); |
31 | newtransaction->setPixmap ( QPixmap ("/opt/QtPalmtop/pics/new.png") ); | 31 | newtransaction->setPixmap ( QPixmap ("/opt/QtPalmtop/pics/new.png") ); |
32 | connect ( newtransaction, SIGNAL ( released () ), this, SLOT ( addTransaction () ) ); | 32 | connect ( newtransaction, SIGNAL ( released() ), this, SLOT ( addTransaction() ) ); |
33 | 33 | ||
34 | edittransaction = new QPushButton ( firstline ); | 34 | edittransaction = new QPushButton ( firstline ); |
35 | edittransaction->setPixmap( QPixmap ("/opt/QtPalmtop/pics/edit.png") ); | 35 | edittransaction->setPixmap( QPixmap ("/opt/QtPalmtop/pics/edit.png") ); |
36 | connect ( edittransaction, SIGNAL ( released () ), this, SLOT ( checkListViewEdit () ) ); | 36 | connect ( edittransaction, SIGNAL ( released() ), this, SLOT ( checkListViewEdit() ) ); |
37 | 37 | ||
38 | deletetransaction = new QPushButton ( firstline ); | 38 | deletetransaction = new QPushButton ( firstline ); |
39 | deletetransaction->setPixmap( QPixmap ( "/opt/QtPalmtop/pics/delete.png") ); | 39 | deletetransaction->setPixmap( QPixmap ( "/opt/QtPalmtop/pics/delete.png") ); |
40 | connect ( deletetransaction, SIGNAL ( released () ), this, SLOT ( checkListViewDelete () ) ); | 40 | connect ( deletetransaction, SIGNAL ( released() ), this, SLOT ( checkListViewDelete() ) ); |
41 | 41 | ||
42 | toggletransaction = new QPushButton ( firstline ); | 42 | toggletransaction = new QPushButton ( firstline ); |
43 | toggletransaction->setPixmap( QPixmap ( "/opt/QtPalmtop/pics/redo.png") ); | 43 | toggletransaction->setPixmap( QPixmap ( "/opt/QtPalmtop/pics/redo.png") ); |
44 | connect ( toggletransaction, SIGNAL ( released () ), this, SLOT ( checkListViewToggle () ) ); | 44 | connect ( toggletransaction, SIGNAL ( released() ), this, SLOT ( checkListViewToggle() ) ); |
45 | 45 | ||
46 | viewtransactionnotes = new QPushButton ( firstline ); | 46 | viewtransactionnotes = new QPushButton ( firstline ); |
47 | viewtransactionnotes->setPixmap( QPixmap ( "/opt/QtPalmtop/pics/info.png") ); | 47 | viewtransactionnotes->setPixmap( QPixmap ( "/opt/QtPalmtop/pics/info.png") ); |
48 | connect ( viewtransactionnotes, SIGNAL ( released () ), this, SLOT ( showTransactionNotes () ) ); | 48 | connect ( viewtransactionnotes, SIGNAL ( released() ), this, SLOT ( showTransactionNotes() ) ); |
49 | 49 | ||
50 | secondline = new QHBox ( this ); | 50 | secondline = new QHBox ( this ); |
51 | secondline->setSpacing ( 5 ); | 51 | secondline->setSpacing ( 5 ); |
52 | 52 | ||
53 | name = new QLabel ( secondline ); | 53 | name = new QLabel ( secondline ); |
54 | balance = new QLabel ( secondline ); | 54 | balance = new QLabel ( secondline ); |
55 | 55 | ||
56 | QLabel *limit = new QLabel ( "Limit", secondline ); | 56 | QLabel *limit = new QLabel ( "Limit", secondline ); |
57 | limitbox = new QLineEdit ( secondline ); | 57 | limitbox = new QLineEdit ( secondline ); |
58 | limitbox->setMinimumWidth ( ( int ) ( this->width() / 6 ) ); | 58 | limitbox->setMinimumWidth ( ( int ) ( this->width() / 6 ) ); |
59 | connect ( limitbox, SIGNAL ( textChanged ( const QString & ) ), this, SLOT ( limitDisplay ( const QString & ) ) ); | 59 | connect ( limitbox, SIGNAL ( textChanged(const QString&) ), this, SLOT ( limitDisplay(const QString&) ) ); |
60 | 60 | ||
61 | listview = new QListView ( this ); | 61 | listview = new QListView ( this ); |
62 | listview->setAllColumnsShowFocus ( TRUE ); | 62 | listview->setAllColumnsShowFocus ( TRUE ); |
63 | listview->setShowSortIndicator ( TRUE ); | 63 | listview->setShowSortIndicator ( TRUE ); |
64 | listview->header()->setTracking ( FALSE ); | 64 | listview->header()->setTracking ( FALSE ); |
65 | connect ( listview->header(), SIGNAL ( sizeChange ( int, int, int ) ), this, SLOT ( saveColumnSize ( int, int, int ) ) ); | 65 | connect ( listview->header(), SIGNAL ( sizeChange(int,int,int) ), this, SLOT ( saveColumnSize(int,int,int) ) ); |
66 | connect ( listview->header(), SIGNAL ( clicked ( int ) ), this, SLOT ( saveSortingPreference ( int ) ) ); | 66 | connect ( listview->header(), SIGNAL ( clicked(int) ), this, SLOT ( saveSortingPreference(int) ) ); |
67 | 67 | ||
68 | layout = new QVBoxLayout ( this, 2, 2 ); | 68 | layout = new QVBoxLayout ( this, 2, 2 ); |
69 | layout->addWidget ( firstline ); | 69 | layout->addWidget ( firstline ); |
70 | layout->addWidget ( secondline ); | 70 | layout->addWidget ( secondline ); |
71 | layout->addWidget ( listview ); | 71 | layout->addWidget ( listview ); |
72 | } | 72 | } |
73 | 73 | ||
74 | void TransactionDisplay::addTransaction () | 74 | void TransactionDisplay::addTransaction () |
75 | { | 75 | { |
76 | // create local variables | 76 | // create local variables |
77 | int cleared = -1; | 77 | int cleared = -1; |
78 | 78 | ||
79 | // create new transaction window | 79 | // create new transaction window |
80 | NewTransaction *newtransaction = new NewTransaction ( this ); | 80 | NewTransaction *newtransaction = new NewTransaction ( this ); |
81 | int width = this->size().width(); | 81 | int width = this->size().width(); |
82 | newtransaction->transactionname->setMaximumWidth ( ( int ) ( width * 0.45 ) ); | 82 | newtransaction->transactionname->setMaximumWidth ( ( int ) ( width * 0.45 ) ); |
83 | newtransaction->transactionname->setMinimumWidth ( ( int ) ( width * 0.35 ) ); | 83 | newtransaction->transactionname->setMinimumWidth ( ( int ) ( width * 0.35 ) ); |
84 | newtransaction->lineitembox->setMaximumWidth ( ( int ) ( width * 0.45 ) ); | 84 | newtransaction->lineitembox->setMaximumWidth ( ( int ) ( width * 0.45 ) ); |
85 | newtransaction->transactiondatebox->setMaximumWidth ( ( int ) ( width * 0.4 ) ); | 85 | newtransaction->transactiondatebox->setMaximumWidth ( ( int ) ( width * 0.4 ) ); |
86 | newtransaction->transactionamountbox->setMaximumWidth ( ( int ) ( width * 0.4 ) ); | 86 | newtransaction->transactionamountbox->setMaximumWidth ( ( int ) ( width * 0.4 ) ); |
87 | newtransaction->transactionnumber->setMaximumWidth ( ( int ) ( width * 0.25 ) ); | 87 | newtransaction->transactionnumber->setMaximumWidth ( ( int ) ( width * 0.25 ) ); |
88 | 88 | ||
89 | // enter today's date in the date box as defaul | 89 | // enter today's date in the date box as defaul |
90 | QDate today = QDate::currentDate (); | 90 | QDate today = QDate::currentDate (); |
@@ -192,49 +192,49 @@ void TransactionDisplay::editTransfer () | |||
192 | QFont f = this->font(); | 192 | QFont f = this->font(); |
193 | f.setWeight ( QFont::Bold ); | 193 | f.setWeight ( QFont::Bold ); |
194 | fromaccountlabel->setFont ( f ); | 194 | fromaccountlabel->setFont ( f ); |
195 | 195 | ||
196 | QComboBox *fromaccountbox = new QComboBox ( editransfer ); | 196 | QComboBox *fromaccountbox = new QComboBox ( editransfer ); |
197 | fromaccountbox->insertStringList ( accountnames ); | 197 | fromaccountbox->insertStringList ( accountnames ); |
198 | fromaccountbox->setCurrentItem ( accountids.findIndex ( QString::number ( fromaccount ) ) ); | 198 | fromaccountbox->setCurrentItem ( accountids.findIndex ( QString::number ( fromaccount ) ) ); |
199 | 199 | ||
200 | QLabel *toaccountlabel = new QLabel ( "To Account:", editransfer ); | 200 | QLabel *toaccountlabel = new QLabel ( "To Account:", editransfer ); |
201 | toaccountlabel->setFont ( f ); | 201 | toaccountlabel->setFont ( f ); |
202 | 202 | ||
203 | QComboBox *toaccountbox = new QComboBox ( editransfer ); | 203 | QComboBox *toaccountbox = new QComboBox ( editransfer ); |
204 | toaccountbox->insertStringList ( accountnames ); | 204 | toaccountbox->insertStringList ( accountnames ); |
205 | toaccountbox->setCurrentItem ( accountids.findIndex ( QString::number ( toaccount ) ) ); | 205 | toaccountbox->setCurrentItem ( accountids.findIndex ( QString::number ( toaccount ) ) ); |
206 | 206 | ||
207 | QLabel *datelabel = new QLabel ( "Date", editransfer ); | 207 | QLabel *datelabel = new QLabel ( "Date", editransfer ); |
208 | QHBox *datebox = new QHBox ( editransfer ); | 208 | QHBox *datebox = new QHBox ( editransfer ); |
209 | datebox->setSpacing ( 2 ); | 209 | datebox->setSpacing ( 2 ); |
210 | date = new QLineEdit ( datebox ); | 210 | date = new QLineEdit ( datebox ); |
211 | date->setAlignment ( Qt::AlignRight ); | 211 | date->setAlignment ( Qt::AlignRight ); |
212 | date->setDisabled ( TRUE ); | 212 | date->setDisabled ( TRUE ); |
213 | date->setText ( preferences->getDate ( year, month, day ) ); | 213 | date->setText ( preferences->getDate ( year, month, day ) ); |
214 | QPushButton *datebutton = new QPushButton ( datebox ); | 214 | QPushButton *datebutton = new QPushButton ( datebox ); |
215 | datebutton->setPixmap ( QPixmap ( "/opt/QtPalmtop/pics/date.png" ) ); | 215 | datebutton->setPixmap ( QPixmap ( "/opt/QtPalmtop/pics/date.png" ) ); |
216 | connect ( datebutton, SIGNAL ( released () ), this, SLOT ( showCalendar () ) ); | 216 | connect ( datebutton, SIGNAL ( released() ), this, SLOT ( showCalendar() ) ); |
217 | 217 | ||
218 | QLabel *amounttlabel = new QLabel ( "Amount", editransfer ); | 218 | QLabel *amounttlabel = new QLabel ( "Amount", editransfer ); |
219 | 219 | ||
220 | QHBox *amountbox = new QHBox ( editransfer ); | 220 | QHBox *amountbox = new QHBox ( editransfer ); |
221 | amountbox->setSpacing ( 2 ); | 221 | amountbox->setSpacing ( 2 ); |
222 | amount = new QLineEdit ( amountbox ); | 222 | amount = new QLineEdit ( amountbox ); |
223 | amount->setAlignment ( Qt::AlignRight ); | 223 | amount->setAlignment ( Qt::AlignRight ); |
224 | amount->setText ( transfer->getAmount ( transferid ) ); | 224 | amount->setText ( transfer->getAmount ( transferid ) ); |
225 | QPushButton *calculatorbutton = new QPushButton( amountbox ); | 225 | QPushButton *calculatorbutton = new QPushButton( amountbox ); |
226 | calculatorbutton->setPixmap ( QPixmap ( "/opt/QtPalmtop/pics/kcalc.png" ) ); | 226 | calculatorbutton->setPixmap ( QPixmap ( "/opt/QtPalmtop/pics/kcalc.png" ) ); |
227 | connect ( calculatorbutton, SIGNAL ( released() ), this, SLOT ( showCalculator() ) ); | 227 | connect ( calculatorbutton, SIGNAL ( released() ), this, SLOT ( showCalculator() ) ); |
228 | 228 | ||
229 | QCheckBox *clearedcheckbox = new QCheckBox ( "Cleared", editransfer ); | 229 | QCheckBox *clearedcheckbox = new QCheckBox ( "Cleared", editransfer ); |
230 | 230 | ||
231 | QBoxLayout *layout = new QVBoxLayout ( editransfer, 4, 2 ); | 231 | QBoxLayout *layout = new QVBoxLayout ( editransfer, 4, 2 ); |
232 | layout->addWidget ( fromaccountlabel, Qt::AlignLeft ); | 232 | layout->addWidget ( fromaccountlabel, Qt::AlignLeft ); |
233 | layout->addWidget ( fromaccountbox, Qt::AlignLeft ); | 233 | layout->addWidget ( fromaccountbox, Qt::AlignLeft ); |
234 | layout->addWidget ( toaccountlabel, Qt::AlignLeft ); | 234 | layout->addWidget ( toaccountlabel, Qt::AlignLeft ); |
235 | layout->addWidget ( toaccountbox, Qt::AlignLeft ); | 235 | layout->addWidget ( toaccountbox, Qt::AlignLeft ); |
236 | layout->addSpacing ( 5 ); | 236 | layout->addSpacing ( 5 ); |
237 | layout->addWidget ( datelabel, Qt::AlignLeft ); | 237 | layout->addWidget ( datelabel, Qt::AlignLeft ); |
238 | layout->addWidget ( datebox, Qt::AlignLeft ); | 238 | layout->addWidget ( datebox, Qt::AlignLeft ); |
239 | layout->addWidget ( amounttlabel, Qt::AlignLeft ); | 239 | layout->addWidget ( amounttlabel, Qt::AlignLeft ); |
240 | layout->addWidget ( amountbox, Qt::AlignLeft ); | 240 | layout->addWidget ( amountbox, Qt::AlignLeft ); |
diff --git a/noncore/apps/qashmoney/transferdialog.cpp b/noncore/apps/qashmoney/transferdialog.cpp index 558abec..7a12fbf 100755 --- a/noncore/apps/qashmoney/transferdialog.cpp +++ b/noncore/apps/qashmoney/transferdialog.cpp | |||
@@ -9,49 +9,49 @@ extern Account *account; | |||
9 | TransferDialog::TransferDialog ( QWidget *parent, int fromaccountid, int toaccountid ) : QDialog ( parent, 0, TRUE ) | 9 | TransferDialog::TransferDialog ( QWidget *parent, int fromaccountid, int toaccountid ) : QDialog ( parent, 0, TRUE ) |
10 | { | 10 | { |
11 | dateedited = FALSE; | 11 | dateedited = FALSE; |
12 | setCaption ( "Transfer" ); | 12 | setCaption ( "Transfer" ); |
13 | 13 | ||
14 | fromaccountlabel = new QLabel ( "From account:", this ); | 14 | fromaccountlabel = new QLabel ( "From account:", this ); |
15 | QFont f = this->font(); | 15 | QFont f = this->font(); |
16 | f.setWeight ( QFont::Bold ); | 16 | f.setWeight ( QFont::Bold ); |
17 | fromaccountlabel->setFont ( f ); | 17 | fromaccountlabel->setFont ( f ); |
18 | fromaccount = new QLabel ( account->getAccountName ( fromaccountid ), this ); | 18 | fromaccount = new QLabel ( account->getAccountName ( fromaccountid ), this ); |
19 | 19 | ||
20 | toaccountlabel = new QLabel ( "To Account:", this ); | 20 | toaccountlabel = new QLabel ( "To Account:", this ); |
21 | toaccountlabel->setFont ( f ); | 21 | toaccountlabel->setFont ( f ); |
22 | toaccount = new QLabel ( account->getAccountName ( toaccountid ), this ); | 22 | toaccount = new QLabel ( account->getAccountName ( toaccountid ), this ); |
23 | 23 | ||
24 | datelabel = new QLabel ( "Date", this ); | 24 | datelabel = new QLabel ( "Date", this ); |
25 | 25 | ||
26 | datebox = new QHBox ( this ); | 26 | datebox = new QHBox ( this ); |
27 | datebox->setSpacing ( 2 ); | 27 | datebox->setSpacing ( 2 ); |
28 | date = new QLineEdit ( datebox ); | 28 | date = new QLineEdit ( datebox ); |
29 | date->setAlignment ( Qt::AlignRight ); | 29 | date->setAlignment ( Qt::AlignRight ); |
30 | date->setDisabled ( TRUE ); | 30 | date->setDisabled ( TRUE ); |
31 | datebutton = new QPushButton ( datebox ); | 31 | datebutton = new QPushButton ( datebox ); |
32 | datebutton->setPixmap ( QPixmap ( "/opt/QtPalmtop/pics/date.png" ) ); | 32 | datebutton->setPixmap ( QPixmap ( "/opt/QtPalmtop/pics/date.png" ) ); |
33 | connect ( datebutton, SIGNAL ( released () ), this, SLOT ( showCalendar () ) ); | 33 | connect ( datebutton, SIGNAL ( released() ), this, SLOT ( showCalendar() ) ); |
34 | 34 | ||
35 | amounttlabel = new QLabel ( "Amount", this ); | 35 | amounttlabel = new QLabel ( "Amount", this ); |
36 | 36 | ||
37 | amountbox = new QHBox ( this ); | 37 | amountbox = new QHBox ( this ); |
38 | amountbox->setSpacing ( 2 ); | 38 | amountbox->setSpacing ( 2 ); |
39 | amount = new QLineEdit ( amountbox ); | 39 | amount = new QLineEdit ( amountbox ); |
40 | amount->setAlignment ( Qt::AlignRight ); | 40 | amount->setAlignment ( Qt::AlignRight ); |
41 | calculatorbutton = new QPushButton( amountbox ); | 41 | calculatorbutton = new QPushButton( amountbox ); |
42 | calculatorbutton->setPixmap ( QPixmap ( "/opt/QtPalmtop/pics/kcalc.png" ) ); | 42 | calculatorbutton->setPixmap ( QPixmap ( "/opt/QtPalmtop/pics/kcalc.png" ) ); |
43 | connect ( calculatorbutton, SIGNAL ( released() ), this, SLOT ( showCalculator() ) ); | 43 | connect ( calculatorbutton, SIGNAL ( released() ), this, SLOT ( showCalculator() ) ); |
44 | 44 | ||
45 | clearedcheckbox = new QCheckBox ( "Cleared", this ); | 45 | clearedcheckbox = new QCheckBox ( "Cleared", this ); |
46 | 46 | ||
47 | layout = new QVBoxLayout ( this, 4, 2 ); | 47 | layout = new QVBoxLayout ( this, 4, 2 ); |
48 | layout->addWidget ( fromaccountlabel, Qt::AlignLeft ); | 48 | layout->addWidget ( fromaccountlabel, Qt::AlignLeft ); |
49 | layout->addWidget ( fromaccount, Qt::AlignLeft ); | 49 | layout->addWidget ( fromaccount, Qt::AlignLeft ); |
50 | layout->addWidget ( toaccountlabel, Qt::AlignLeft ); | 50 | layout->addWidget ( toaccountlabel, Qt::AlignLeft ); |
51 | layout->addWidget ( toaccount, Qt::AlignLeft ); | 51 | layout->addWidget ( toaccount, Qt::AlignLeft ); |
52 | layout->addSpacing ( 5 ); | 52 | layout->addSpacing ( 5 ); |
53 | layout->addWidget ( datelabel, Qt::AlignLeft ); | 53 | layout->addWidget ( datelabel, Qt::AlignLeft ); |
54 | layout->addWidget ( datebox, Qt::AlignLeft ); | 54 | layout->addWidget ( datebox, Qt::AlignLeft ); |
55 | layout->addWidget ( amounttlabel, Qt::AlignLeft ); | 55 | layout->addWidget ( amounttlabel, Qt::AlignLeft ); |
56 | layout->addWidget ( amountbox, Qt::AlignLeft ); | 56 | layout->addWidget ( amountbox, Qt::AlignLeft ); |
57 | layout->addWidget ( clearedcheckbox, Qt::AlignLeft ); | 57 | layout->addWidget ( clearedcheckbox, Qt::AlignLeft ); |