author | chicken <chicken> | 2004-11-02 19:46:53 (UTC) |
---|---|---|
committer | chicken <chicken> | 2004-11-02 19:46:53 (UTC) |
commit | 30c9ee6ca6442c66f02c004dd960b26eeab6dee2 (patch) (unidiff) | |
tree | 4e399ff17e29ae3b7769f69e926d76f7dfeb8128 | |
parent | 029fc220470de74b7c1a148c9ea934c17686149f (diff) | |
download | opie-30c9ee6ca6442c66f02c004dd960b26eeab6dee2.zip opie-30c9ee6ca6442c66f02c004dd960b26eeab6dee2.tar.gz opie-30c9ee6ca6442c66f02c004dd960b26eeab6dee2.tar.bz2 |
switching to sqlite3
-rwxr-xr-x | noncore/apps/qashmoney/budgetdisplay.cpp | 2 | ||||
-rwxr-xr-x | noncore/apps/qashmoney/transfer.h | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/noncore/apps/qashmoney/budgetdisplay.cpp b/noncore/apps/qashmoney/budgetdisplay.cpp index 3fc4e6c..b83eb46 100755 --- a/noncore/apps/qashmoney/budgetdisplay.cpp +++ b/noncore/apps/qashmoney/budgetdisplay.cpp | |||
@@ -1,259 +1,259 @@ | |||
1 | #include <qmessagebox.h> | 1 | #include <qmessagebox.h> |
2 | #include <qheader.h> | 2 | #include <qheader.h> |
3 | #include <sqlite.h> | 3 | #include <sqlite3.h> |
4 | 4 | ||
5 | #include "budgetdisplay.h" | 5 | #include "budgetdisplay.h" |
6 | #include "budget.h" | 6 | #include "budget.h" |
7 | #include "datepicker.h" | 7 | #include "datepicker.h" |
8 | #include "transaction.h" | 8 | #include "transaction.h" |
9 | 9 | ||
10 | extern Preferences *preferences; | 10 | extern Preferences *preferences; |
11 | extern Budget *budget; | 11 | extern Budget *budget; |
12 | extern Transaction *transaction; | 12 | extern Transaction *transaction; |
13 | 13 | ||
14 | BudgetDisplay::BudgetDisplay ( QWidget *parent ) : QWidget ( parent ) | 14 | BudgetDisplay::BudgetDisplay ( QWidget *parent ) : QWidget ( parent ) |
15 | { | 15 | { |
16 | QFont font = this->font(); | 16 | QFont font = this->font(); |
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(); |
107 | } | 107 | } |
108 | 108 | ||
109 | void BudgetDisplay::saveColumnSize ( int column, int oldsize, int newsize ) | 109 | void BudgetDisplay::saveColumnSize ( int column, int oldsize, int newsize ) |
110 | { | 110 | { |
111 | switch ( column ) | 111 | switch ( column ) |
112 | { | 112 | { |
113 | case 0: | 113 | case 0: |
114 | preferences->changeColumnPreference ( 13, newsize ); | 114 | preferences->changeColumnPreference ( 13, newsize ); |
115 | break; | 115 | break; |
116 | case 1: | 116 | case 1: |
117 | preferences->changeColumnPreference ( 14, newsize ); | 117 | preferences->changeColumnPreference ( 14, newsize ); |
118 | break; | 118 | break; |
119 | case 2: | 119 | case 2: |
120 | preferences->changeColumnPreference ( 15, newsize ); | 120 | preferences->changeColumnPreference ( 15, newsize ); |
121 | break; | 121 | break; |
122 | } | 122 | } |
123 | } | 123 | } |
124 | 124 | ||
125 | void BudgetDisplay::saveSortingPreference ( int column ) | 125 | void BudgetDisplay::saveSortingPreference ( int column ) |
126 | { | 126 | { |
127 | preferences->changeSortingPreference ( 3, column ); | 127 | preferences->changeSortingPreference ( 3, column ); |
128 | } | 128 | } |
129 | 129 | ||
130 | int BudgetDisplay::getIDColumn () | 130 | int BudgetDisplay::getIDColumn () |
131 | { | 131 | { |
132 | int counter; | 132 | int counter; |
133 | int columns = listview->columns(); | 133 | int columns = listview->columns(); |
134 | for ( counter = 0; counter <= columns; counter++ ) | 134 | for ( counter = 0; counter <= columns; counter++ ) |
135 | if ( listview->header()->label ( counter ).length() == 0 ) | 135 | if ( listview->header()->label ( counter ).length() == 0 ) |
136 | return counter; | 136 | return counter; |
137 | } | 137 | } |
138 | 138 | ||
139 | void BudgetDisplay::newBudget () | 139 | void BudgetDisplay::newBudget () |
140 | { | 140 | { |
141 | constructBudgetWindow(); | 141 | constructBudgetWindow(); |
142 | int response = nb->exec(); | 142 | int response = nb->exec(); |
143 | if ( response == 1 ) | 143 | if ( response == 1 ) |
144 | { | 144 | { |
145 | // open a new budget object | 145 | // open a new budget object |
146 | int addedbudget = budget->addBudget ( budgetname->text(), 0, description->text(), currencybox->currencybox->currentText(), day, month, year, day, month, year, 0 ); | 146 | int addedbudget = budget->addBudget ( budgetname->text(), 0, description->text(), currencybox->currencybox->currentText(), day, month, year, day, month, year, 0 ); |
147 | transaction->clearBudgetIDs ( addedbudget ); | 147 | transaction->clearBudgetIDs ( addedbudget ); |
148 | displayBudgetNames(); | 148 | displayBudgetNames(); |
149 | } | 149 | } |
150 | checkBudgets(); | 150 | checkBudgets(); |
151 | } | 151 | } |
152 | 152 | ||
153 | void BudgetDisplay::constructBudgetWindow () | 153 | void BudgetDisplay::constructBudgetWindow () |
154 | { | 154 | { |
155 | //construct and format the new budget window | 155 | //construct and format the new budget window |
156 | nb = new QDialog ( this, 0, TRUE ); | 156 | nb = new QDialog ( this, 0, TRUE ); |
157 | nb->setCaption ( "Budget" ); | 157 | nb->setCaption ( "Budget" ); |
158 | QLabel *namelabel = new QLabel ( "Budget Name", nb ); | 158 | QLabel *namelabel = new QLabel ( "Budget Name", nb ); |
159 | budgetname = new QLineEdit ( nb ); | 159 | budgetname = new QLineEdit ( nb ); |
160 | QLabel *descriptionlabel = new QLabel ( "Description", nb ); | 160 | QLabel *descriptionlabel = new QLabel ( "Description", nb ); |
161 | description = new QLineEdit ( nb ); | 161 | description = new QLineEdit ( nb ); |
162 | currencybox = new Currency ( nb ); | 162 | currencybox = new Currency ( nb ); |
163 | QBoxLayout *layout = new QVBoxLayout ( nb, 2, 2 ); | 163 | QBoxLayout *layout = new QVBoxLayout ( nb, 2, 2 ); |
164 | layout->addWidget ( namelabel ); | 164 | layout->addWidget ( namelabel ); |
165 | layout->addWidget ( budgetname ); | 165 | layout->addWidget ( budgetname ); |
166 | layout->addWidget ( descriptionlabel ); | 166 | layout->addWidget ( descriptionlabel ); |
167 | layout->addWidget ( description ); | 167 | layout->addWidget ( description ); |
168 | layout->addWidget ( currencybox ); | 168 | layout->addWidget ( currencybox ); |
169 | } | 169 | } |
170 | 170 | ||
171 | void BudgetDisplay::displayBudgetNames () | 171 | void BudgetDisplay::displayBudgetNames () |
172 | { | 172 | { |
173 | budgetbox->clear(); | 173 | budgetbox->clear(); |
174 | if ( budget->getNumberOfBudgets() != 0 ) | 174 | if ( budget->getNumberOfBudgets() != 0 ) |
175 | { | 175 | { |
176 | ids = budget->getBudgetIDs(); | 176 | ids = budget->getBudgetIDs(); |
177 | for ( QStringList::Iterator it = ids->begin(); it != ids->end(); ++it ) | 177 | for ( QStringList::Iterator it = ids->begin(); it != ids->end(); ++it ) |
178 | { | 178 | { |
179 | QString flag = "/opt/QtPalmtop/pics/flags/"; | 179 | QString flag = "/opt/QtPalmtop/pics/flags/"; |
180 | flag.append ( budget->getCurrency ( (*it).toInt() ) ); | 180 | flag.append ( budget->getCurrency ( (*it).toInt() ) ); |
181 | flag.append ( ".png" ); | 181 | flag.append ( ".png" ); |
182 | budgetbox->insertItem ( QPixmap ( flag ), budget->getBudgetName ( (*it).toInt() ) ); | 182 | budgetbox->insertItem ( QPixmap ( flag ), budget->getBudgetName ( (*it).toInt() ) ); |
183 | } | 183 | } |
184 | setCurrentBudget ( 0 ); | 184 | setCurrentBudget ( 0 ); |
185 | } | 185 | } |
186 | else | 186 | else |
187 | checkBudgets(); | 187 | checkBudgets(); |
188 | } | 188 | } |
189 | 189 | ||
190 | void BudgetDisplay::setCurrentBudget ( int index ) | 190 | void BudgetDisplay::setCurrentBudget ( int index ) |
191 | { | 191 | { |
192 | currentbudget = ( ids->operator[] ( index ).toInt() ); | 192 | currentbudget = ( ids->operator[] ( index ).toInt() ); |
193 | displayLineItems(); | 193 | displayLineItems(); |
194 | } | 194 | } |
195 | 195 | ||
196 | void BudgetDisplay::setCurrentView ( int index ) | 196 | void BudgetDisplay::setCurrentView ( int index ) |
197 | { | 197 | { |
198 | displayLineItems(); | 198 | displayLineItems(); |
199 | } | 199 | } |
200 | 200 | ||
201 | void BudgetDisplay::showCalendar () | 201 | void BudgetDisplay::showCalendar () |
202 | { | 202 | { |
203 | // create new calendar object and show it | 203 | // create new calendar object and show it |
204 | DatePicker *dp = new DatePicker ( QDate ( year, month, day ) ); | 204 | DatePicker *dp = new DatePicker ( QDate ( year, month, day ) ); |
205 | dp->daylabel->hide(); | 205 | dp->daylabel->hide(); |
206 | dp->daybox->hide(); | 206 | dp->daybox->hide(); |
207 | if ( budgetview->currentItem() == 1 ) | 207 | if ( budgetview->currentItem() == 1 ) |
208 | { | 208 | { |
209 | dp->monthlabel->hide(); | 209 | dp->monthlabel->hide(); |
210 | dp->monthbox->hide(); | 210 | dp->monthbox->hide(); |
211 | } | 211 | } |
212 | dp->setMaximumWidth ( ( int ) ( this->size().width() * 0.9 ) ); | 212 | dp->setMaximumWidth ( ( int ) ( this->size().width() * 0.9 ) ); |
213 | 213 | ||
214 | int response = dp->exec(); | 214 | int response = dp->exec(); |
215 | if ( response == 1 ) | 215 | if ( response == 1 ) |
216 | { | 216 | { |
217 | // Set date integers | 217 | // Set date integers |
218 | year = dp->getYear(); | 218 | year = dp->getYear(); |
219 | if ( budgetview->currentItem() == 0 ) | 219 | if ( budgetview->currentItem() == 0 ) |
220 | month = dp->getMonth(); | 220 | month = dp->getMonth(); |
221 | else | 221 | else |
222 | month = newDate.month(); | 222 | month = newDate.month(); |
223 | datelabel = preferences->getDate ( year, month ); | 223 | datelabel = preferences->getDate ( year, month ); |
224 | displayLineItems(); | 224 | displayLineItems(); |
225 | } | 225 | } |
226 | } | 226 | } |
227 | 227 | ||
228 | void BudgetDisplay::newLineItem () | 228 | void BudgetDisplay::newLineItem () |
229 | { | 229 | { |
230 | //construct and format the new line item window | 230 | //construct and format the new line item window |
231 | constructLineItemWindow (); | 231 | constructLineItemWindow (); |
232 | 232 | ||
233 | int response = newlineitem->exec(); | 233 | int response = newlineitem->exec(); |
234 | if ( response == 1 ) | 234 | if ( response == 1 ) |
235 | { | 235 | { |
236 | float amount; | 236 | float amount; |
237 | if ( lineitemtime->currentItem() == 0 ) | 237 | if ( lineitemtime->currentItem() == 0 ) |
238 | amount = lineitemamount->text().toFloat(); | 238 | amount = lineitemamount->text().toFloat(); |
239 | else if ( lineitemtime->currentItem() == 1 ) | 239 | else if ( lineitemtime->currentItem() == 1 ) |
240 | amount = lineitemamount->text().toFloat() * 12; | 240 | amount = lineitemamount->text().toFloat() * 12; |
241 | else | 241 | else |
242 | amount = lineitemamount->text().toFloat() * 52; | 242 | amount = lineitemamount->text().toFloat() * 52; |
243 | int lineitemadded = budget->addLineItem ( currentbudget, lineitemname->text(), amount, lineitemtime->currentItem() ); | 243 | int lineitemadded = budget->addLineItem ( currentbudget, lineitemname->text(), amount, lineitemtime->currentItem() ); |
244 | transaction->clearBudgetIDs ( currentbudget, lineitemadded ); | 244 | transaction->clearBudgetIDs ( currentbudget, lineitemadded ); |
245 | displayLineItems(); | 245 | displayLineItems(); |
246 | } | 246 | } |
247 | checkBudgets(); | 247 | checkBudgets(); |
248 | } | 248 | } |
249 | 249 | ||
250 | void BudgetDisplay::constructLineItemWindow () | 250 | void BudgetDisplay::constructLineItemWindow () |
251 | { | 251 | { |
252 | //construct and format the new budget window | 252 | //construct and format the new budget window |
253 | newlineitem = new QDialog ( this, 0, TRUE ); | 253 | newlineitem = new QDialog ( this, 0, TRUE ); |
254 | newlineitem->setCaption ( "Line Item" ); | 254 | newlineitem->setCaption ( "Line Item" ); |
255 | QLabel *namelabel = new QLabel ( "Line Item Name", newlineitem ); | 255 | QLabel *namelabel = new QLabel ( "Line Item Name", newlineitem ); |
256 | lineitemname = new QLineEdit ( newlineitem ); | 256 | lineitemname = new QLineEdit ( newlineitem ); |
257 | QLabel *budgetamountlabel = new QLabel ( "Budget Amount", newlineitem ); | 257 | QLabel *budgetamountlabel = new QLabel ( "Budget Amount", newlineitem ); |
258 | lineitemamount = new QLineEdit ( newlineitem ); | 258 | lineitemamount = new QLineEdit ( newlineitem ); |
259 | QLabel *lineitemtimelabel = new QLabel ( "Per:", newlineitem ); | 259 | QLabel *lineitemtimelabel = new QLabel ( "Per:", newlineitem ); |
diff --git a/noncore/apps/qashmoney/transfer.h b/noncore/apps/qashmoney/transfer.h index e910e7c..cec3386 100755 --- a/noncore/apps/qashmoney/transfer.h +++ b/noncore/apps/qashmoney/transfer.h | |||
@@ -1,52 +1,52 @@ | |||
1 | #ifndef TRANSFER_H | 1 | #ifndef TRANSFER_H |
2 | #define TRANSFER_H | 2 | #define TRANSFER_H |
3 | 3 | ||
4 | #include <qlistview.h> | 4 | #include <qlistview.h> |
5 | #include <qstring.h> | 5 | #include <qstring.h> |
6 | #include <sqlite.h> | 6 | #include <sqlite3.h> |
7 | #include <qdatetime.h> | 7 | #include <qdatetime.h> |
8 | 8 | ||
9 | #include "preferences.h" | 9 | #include "preferences.h" |
10 | 10 | ||
11 | class Transfer | 11 | class Transfer |
12 | { | 12 | { |
13 | public: | 13 | public: |
14 | 14 | ||
15 | Transfer (); | 15 | Transfer (); |
16 | ~Transfer (); | 16 | ~Transfer (); |
17 | 17 | ||
18 | // This function adds a new transfer to the database. It takes the fromaccount, toaccount, | 18 | // This function adds a new transfer to the database. It takes the fromaccount, toaccount, |
19 | // number, frombudget, tobudget, day, month, year, amount, cleared | 19 | // number, frombudget, tobudget, day, month, year, amount, cleared |
20 | void addTransfer ( int fromaccount, int fromparent, int toaccount, int toparent, int day, int month, int year, float amount, int cleared ); | 20 | void addTransfer ( int fromaccount, int fromparent, int toaccount, int toparent, int day, int month, int year, float amount, int cleared ); |
21 | void updateTransfer ( int fromaccount, int fromparent, int toaccount, int toparent, int day, int month, int year, float amount, int cleared, int transferid ); | 21 | void updateTransfer ( int fromaccount, int fromparent, int toaccount, int toparent, int day, int month, int year, float amount, int cleared, int transferid ); |
22 | 22 | ||
23 | // Deletes a transfer. Takes the transferid as its parameter | 23 | // Deletes a transfer. Takes the transferid as its parameter |
24 | void deleteTransfer ( int ); | 24 | void deleteTransfer ( int ); |
25 | 25 | ||
26 | // Deletes all transfers for a given accountid | 26 | // Deletes all transfers for a given accountid |
27 | void deleteAllTransfers ( int accountid ); | 27 | void deleteAllTransfers ( int accountid ); |
28 | 28 | ||
29 | // Returns the number of checking transfers | 29 | // Returns the number of checking transfers |
30 | int getNumberOfTransfers (); | 30 | int getNumberOfTransfers (); |
31 | int getNumberOfTransfers ( int accountid ); | 31 | int getNumberOfTransfers ( int accountid ); |
32 | 32 | ||
33 | void displayTransfers ( QListView *listview, int accountid, bool children, QDate displaydate ); | 33 | void displayTransfers ( QListView *listview, int accountid, bool children, QDate displaydate ); |
34 | int getCleared ( int id ); | 34 | int getCleared ( int id ); |
35 | void setCleared ( int id, int cleared ); | 35 | void setCleared ( int id, int cleared ); |
36 | int getFromAccountID ( int id ); | 36 | int getFromAccountID ( int id ); |
37 | int getToAccountID ( int id ); | 37 | int getToAccountID ( int id ); |
38 | 38 | ||
39 | int getDay ( int id ); | 39 | int getDay ( int id ); |
40 | int getMonth ( int id ); | 40 | int getMonth ( int id ); |
41 | int getYear ( int id ); | 41 | int getYear ( int id ); |
42 | QString getAmount ( int id ); | 42 | QString getAmount ( int id ); |
43 | 43 | ||
44 | private: | 44 | private: |
45 | 45 | ||
46 | sqlite *db; | 46 | sqlite3 *db; |
47 | }; | 47 | }; |
48 | 48 | ||
49 | #endif | 49 | #endif |
50 | 50 | ||
51 | 51 | ||
52 | 52 | ||