Diffstat (limited to 'noncore/apps/checkbook/checkbook.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/checkbook/checkbook.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/noncore/apps/checkbook/checkbook.cpp b/noncore/apps/checkbook/checkbook.cpp index 26b2533..1b933f2 100644 --- a/noncore/apps/checkbook/checkbook.cpp +++ b/noncore/apps/checkbook/checkbook.cpp | |||
@@ -84,25 +84,25 @@ Checkbook::Checkbook( QWidget *parent, CBInfo *i, Cfg *cfg ) | |||
84 | layout->setSpacing( 4 ); | 84 | layout->setSpacing( 4 ); |
85 | 85 | ||
86 | // Setup tabs for all info | 86 | // Setup tabs for all info |
87 | mainWidget = new OTabWidget( this ); | 87 | mainWidget = new OTabWidget( this ); |
88 | layout->addWidget( mainWidget ); | 88 | layout->addWidget( mainWidget ); |
89 | mainWidget->addTab( initInfo(), "checkbook/infotab", tr( "Info" ) ); | 89 | mainWidget->addTab( initInfo(), "checkbook/infotab", tr( "Info" ) ); |
90 | mainWidget->addTab( initTransactions(), "checkbook/trantab", tr( "Transactions" ) ); | 90 | mainWidget->addTab( initTransactions(), "checkbook/trantab", tr( "Transactions" ) ); |
91 | mainWidget->addTab( initCharts(), "checkbook/charttab", tr( "Charts" ) ); | 91 | mainWidget->addTab( initCharts(), "checkbook/charttab", tr( "Charts" ) ); |
92 | if( _pCfg->isShowLastTab() ) | 92 | if( _pCfg->isShowLastTab() ) |
93 | mainWidget->setCurrentTab( info->getLastTab() ); | 93 | mainWidget->setCurrentTab( info->getLastTab() ); |
94 | else | 94 | else |
95 | mainWidget->setCurrentTab( tr( "Info" ) ); | 95 | mainWidget->setCurrentTab( tr( "Info" ) ); |
96 | connect( mainWidget, SIGNAL( currentChanged(QWidget *) ), this, SLOT( slotTab(QWidget *) ) ); | 96 | connect( mainWidget, SIGNAL( currentChanged(QWidget*) ), this, SLOT( slotTab(QWidget*) ) ); |
97 | 97 | ||
98 | // Load checkbook information | 98 | // Load checkbook information |
99 | loadCheckbook(); | 99 | loadCheckbook(); |
100 | } | 100 | } |
101 | 101 | ||
102 | Checkbook::~Checkbook() | 102 | Checkbook::~Checkbook() |
103 | { | 103 | { |
104 | } | 104 | } |
105 | 105 | ||
106 | // --- initInfo --------------------------------------------------------------- | 106 | // --- initInfo --------------------------------------------------------------- |
107 | QWidget *Checkbook::initInfo() | 107 | QWidget *Checkbook::initInfo() |
108 | { | 108 | { |
@@ -125,26 +125,26 @@ QWidget *Checkbook::initInfo() | |||
125 | // Password protection | 125 | // Password protection |
126 | passwordCB = new QCheckBox( tr( "Password protect" ), container ); | 126 | passwordCB = new QCheckBox( tr( "Password protect" ), container ); |
127 | QWhatsThis::add( passwordCB, tr( "Click here to enable/disable password protection of this checkbook." ) ); | 127 | QWhatsThis::add( passwordCB, tr( "Click here to enable/disable password protection of this checkbook." ) ); |
128 | connect( passwordCB, SIGNAL( clicked() ), this, SLOT( slotPasswordClicked() ) ); | 128 | connect( passwordCB, SIGNAL( clicked() ), this, SLOT( slotPasswordClicked() ) ); |
129 | layout->addMultiCellWidget( passwordCB, 0, 0, 0, 1 ); | 129 | layout->addMultiCellWidget( passwordCB, 0, 0, 0, 1 ); |
130 | 130 | ||
131 | // Account name | 131 | // Account name |
132 | QLabel *label = new QLabel( tr( "Name:" ), container ); | 132 | QLabel *label = new QLabel( tr( "Name:" ), container ); |
133 | QWhatsThis::add( label, tr( "Enter name of checkbook here." ) ); | 133 | QWhatsThis::add( label, tr( "Enter name of checkbook here." ) ); |
134 | layout->addWidget( label, 1, 0 ); | 134 | layout->addWidget( label, 1, 0 ); |
135 | nameEdit = new QLineEdit( container ); | 135 | nameEdit = new QLineEdit( container ); |
136 | QWhatsThis::add( nameEdit, tr( "Enter name of checkbook here." ) ); | 136 | QWhatsThis::add( nameEdit, tr( "Enter name of checkbook here." ) ); |
137 | connect( nameEdit, SIGNAL( textChanged( const QString & ) ), | 137 | connect( nameEdit, SIGNAL( textChanged(const QString&) ), |
138 | this, SLOT( slotNameChanged( const QString & ) ) ); | 138 | this, SLOT( slotNameChanged(const QString&) ) ); |
139 | layout->addWidget( nameEdit, 1, 1 ); | 139 | layout->addWidget( nameEdit, 1, 1 ); |
140 | 140 | ||
141 | // Type of account | 141 | // Type of account |
142 | label = new QLabel( tr( "Type:" ), container ); | 142 | label = new QLabel( tr( "Type:" ), container ); |
143 | QWhatsThis::add( label, tr( "Select type of checkbook here." ) ); | 143 | QWhatsThis::add( label, tr( "Select type of checkbook here." ) ); |
144 | layout->addWidget( label, 2, 0 ); | 144 | layout->addWidget( label, 2, 0 ); |
145 | typeList = new QComboBox( container ); | 145 | typeList = new QComboBox( container ); |
146 | QWhatsThis::add( typeList, tr( "Select type of checkbook here." ) ); | 146 | QWhatsThis::add( typeList, tr( "Select type of checkbook here." ) ); |
147 | typeList->insertStringList( _pCfg->getAccountTypes() ); | 147 | typeList->insertStringList( _pCfg->getAccountTypes() ); |
148 | layout->addWidget( typeList, 2, 1 ); | 148 | layout->addWidget( typeList, 2, 1 ); |
149 | 149 | ||
150 | // Bank/institution name | 150 | // Bank/institution name |
@@ -168,26 +168,26 @@ QWidget *Checkbook::initInfo() | |||
168 | QWhatsThis::add( label, tr( "Enter PIN number for this checkbook here." ) ); | 168 | QWhatsThis::add( label, tr( "Enter PIN number for this checkbook here." ) ); |
169 | layout->addWidget( label, 5, 0 ); | 169 | layout->addWidget( label, 5, 0 ); |
170 | pinNumEdit = new QLineEdit( container ); | 170 | pinNumEdit = new QLineEdit( container ); |
171 | QWhatsThis::add( pinNumEdit, tr( "Enter PIN number for this checkbook here." ) ); | 171 | QWhatsThis::add( pinNumEdit, tr( "Enter PIN number for this checkbook here." ) ); |
172 | layout->addWidget( pinNumEdit, 5, 1 ); | 172 | layout->addWidget( pinNumEdit, 5, 1 ); |
173 | 173 | ||
174 | // Starting balance | 174 | // Starting balance |
175 | label = new QLabel( tr( "Starting balance:" ), container ); | 175 | label = new QLabel( tr( "Starting balance:" ), container ); |
176 | QWhatsThis::add( label, tr( "Enter the initial balance for this checkbook here." ) ); | 176 | QWhatsThis::add( label, tr( "Enter the initial balance for this checkbook here." ) ); |
177 | layout->addWidget( label, 6, 0 ); | 177 | layout->addWidget( label, 6, 0 ); |
178 | balanceEdit = new QLineEdit( container ); | 178 | balanceEdit = new QLineEdit( container ); |
179 | QWhatsThis::add( balanceEdit, tr( "Enter the initial balance for this checkbook here." ) ); | 179 | QWhatsThis::add( balanceEdit, tr( "Enter the initial balance for this checkbook here." ) ); |
180 | connect( balanceEdit, SIGNAL( textChanged( const QString & ) ), | 180 | connect( balanceEdit, SIGNAL( textChanged(const QString&) ), |
181 | this, SLOT( slotStartingBalanceChanged( const QString & ) ) ); | 181 | this, SLOT( slotStartingBalanceChanged(const QString&) ) ); |
182 | layout->addWidget( balanceEdit, 6, 1 ); | 182 | layout->addWidget( balanceEdit, 6, 1 ); |
183 | 183 | ||
184 | // Notes | 184 | // Notes |
185 | label = new QLabel( tr( "Notes:" ), container ); | 185 | label = new QLabel( tr( "Notes:" ), container ); |
186 | QWhatsThis::add( label, tr( "Enter any additional information for this checkbook here." ) ); | 186 | QWhatsThis::add( label, tr( "Enter any additional information for this checkbook here." ) ); |
187 | layout->addWidget( label, 7, 0 ); | 187 | layout->addWidget( label, 7, 0 ); |
188 | notesEdit = new QMultiLineEdit( container ); | 188 | notesEdit = new QMultiLineEdit( container ); |
189 | QWhatsThis::add( notesEdit, tr( "Enter any additional information for this checkbook here." ) ); | 189 | QWhatsThis::add( notesEdit, tr( "Enter any additional information for this checkbook here." ) ); |
190 | notesEdit->setMinimumHeight( 25 ); | 190 | notesEdit->setMinimumHeight( 25 ); |
191 | notesEdit->setMaximumHeight( 65 ); | 191 | notesEdit->setMaximumHeight( 65 ); |
192 | layout->addMultiCellWidget( notesEdit, 8, 8, 0, 1 ); | 192 | layout->addMultiCellWidget( notesEdit, 8, 8, 0, 1 ); |
193 | 193 | ||
@@ -204,25 +204,25 @@ QWidget *Checkbook::initTransactions() | |||
204 | layout->setSpacing( 2 ); | 204 | layout->setSpacing( 2 ); |
205 | layout->setMargin( 4 ); | 205 | layout->setMargin( 4 ); |
206 | 206 | ||
207 | // Sort selector | 207 | // Sort selector |
208 | QLabel *label = new QLabel( tr( "Sort by:" ), control ); | 208 | QLabel *label = new QLabel( tr( "Sort by:" ), control ); |
209 | QWhatsThis::add( label, tr( "Select checkbook sorting here." ) ); | 209 | QWhatsThis::add( label, tr( "Select checkbook sorting here." ) ); |
210 | layout->addMultiCellWidget( label, 0, 0, 0, 1 ); | 210 | layout->addMultiCellWidget( label, 0, 0, 0, 1 ); |
211 | _cbSortType=new QComboBox( control ); | 211 | _cbSortType=new QComboBox( control ); |
212 | _cbSortType->insertItem( tr("Entry Order") ); | 212 | _cbSortType->insertItem( tr("Entry Order") ); |
213 | _cbSortType->insertItem( tr("Date") ); | 213 | _cbSortType->insertItem( tr("Date") ); |
214 | _cbSortType->insertItem( tr("Number") ); | 214 | _cbSortType->insertItem( tr("Number") ); |
215 | layout->addMultiCellWidget( _cbSortType, 0, 0, 1, 2 ); | 215 | layout->addMultiCellWidget( _cbSortType, 0, 0, 1, 2 ); |
216 | connect( _cbSortType, SIGNAL( activated(const QString &) ), this, SLOT( slotSortChanged( const QString & ) ) ); | 216 | connect( _cbSortType, SIGNAL( activated(const QString&) ), this, SLOT( slotSortChanged(const QString&) ) ); |
217 | 217 | ||
218 | // Table | 218 | // Table |
219 | tranTable = new QListView( control ); | 219 | tranTable = new QListView( control ); |
220 | QFont fnt(QPEApplication::font()); | 220 | QFont fnt(QPEApplication::font()); |
221 | fnt.setPointSize( fnt.pointSize()-1 ); | 221 | fnt.setPointSize( fnt.pointSize()-1 ); |
222 | tranTable->setFont( fnt ); | 222 | tranTable->setFont( fnt ); |
223 | QWhatsThis::add( tranTable, tr( "This is a listing of all transactions entered for this checkbook.\n\nTo sort entries by a specific field, click on the column name." ) ); | 223 | QWhatsThis::add( tranTable, tr( "This is a listing of all transactions entered for this checkbook.\n\nTo sort entries by a specific field, click on the column name." ) ); |
224 | tranTable->addColumn( tr( "Id" ) ); | 224 | tranTable->addColumn( tr( "Id" ) ); |
225 | tranTable->setColumnWidthMode( COL_ID, QListView::Manual ); | 225 | tranTable->setColumnWidthMode( COL_ID, QListView::Manual ); |
226 | tranTable->setColumnWidth( COL_ID, 0); | 226 | tranTable->setColumnWidth( COL_ID, 0); |
227 | tranTable->addColumn( tr( "SortDate" ) ); | 227 | tranTable->addColumn( tr( "SortDate" ) ); |
228 | tranTable->setColumnWidthMode( COL_SORTDATE, QListView::Manual ); | 228 | tranTable->setColumnWidthMode( COL_SORTDATE, QListView::Manual ); |
@@ -230,27 +230,27 @@ QWidget *Checkbook::initTransactions() | |||
230 | tranTable->addColumn( tr( "Num" ) ); | 230 | tranTable->addColumn( tr( "Num" ) ); |
231 | tranTable->addColumn( tr( "Date" ) ); | 231 | tranTable->addColumn( tr( "Date" ) ); |
232 | //tranTable->addColumn( tr( "Cleared" ) ); | 232 | //tranTable->addColumn( tr( "Cleared" ) ); |
233 | tranTable->addColumn( tr( "Description" ) ); | 233 | tranTable->addColumn( tr( "Description" ) ); |
234 | int column = tranTable->addColumn( tr( "Amount" ) ); | 234 | int column = tranTable->addColumn( tr( "Amount" ) ); |
235 | tranTable->setColumnAlignment( column, Qt::AlignRight ); | 235 | tranTable->setColumnAlignment( column, Qt::AlignRight ); |
236 | column=tranTable->addColumn( tr("Balance") ); | 236 | column=tranTable->addColumn( tr("Balance") ); |
237 | tranTable->setColumnAlignment( column, Qt::AlignRight ); | 237 | tranTable->setColumnAlignment( column, Qt::AlignRight ); |
238 | tranTable->setAllColumnsShowFocus( TRUE ); | 238 | tranTable->setAllColumnsShowFocus( TRUE ); |
239 | tranTable->setSorting( -1 ); | 239 | tranTable->setSorting( -1 ); |
240 | layout->addMultiCellWidget( tranTable, 1, 1, 0, 2 ); | 240 | layout->addMultiCellWidget( tranTable, 1, 1, 0, 2 ); |
241 | QPEApplication::setStylusOperation( tranTable->viewport(), QPEApplication::RightOnHold ); | 241 | QPEApplication::setStylusOperation( tranTable->viewport(), QPEApplication::RightOnHold ); |
242 | connect( tranTable, SIGNAL( rightButtonPressed( QListViewItem *, const QPoint &, int ) ), | 242 | connect( tranTable, SIGNAL( rightButtonPressed(QListViewItem*,const QPoint&,int) ), |
243 | this, SLOT( slotMenuTran(QListViewItem *, const QPoint &) ) ); | 243 | this, SLOT( slotMenuTran(QListViewItem*,const QPoint&) ) ); |
244 | connect( tranTable, SIGNAL( doubleClicked( QListViewItem * ) ), | 244 | connect( tranTable, SIGNAL( doubleClicked(QListViewItem*) ), |
245 | this, SLOT( slotEditTran() ) ); | 245 | this, SLOT( slotEditTran() ) ); |
246 | _sortCol=COL_ID; | 246 | _sortCol=COL_ID; |
247 | 247 | ||
248 | // Buttons | 248 | // Buttons |
249 | QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), control ); | 249 | QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), control ); |
250 | QWhatsThis::add( btn, tr( "Click here to add a new transaction." ) ); | 250 | QWhatsThis::add( btn, tr( "Click here to add a new transaction." ) ); |
251 | connect( btn, SIGNAL( clicked() ), this, SLOT( slotNewTran() ) ); | 251 | connect( btn, SIGNAL( clicked() ), this, SLOT( slotNewTran() ) ); |
252 | layout->addWidget( btn, 2, 0 ); | 252 | layout->addWidget( btn, 2, 0 ); |
253 | 253 | ||
254 | btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Edit" ), control ); | 254 | btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Edit" ), control ); |
255 | QWhatsThis::add( btn, tr( "Select a transaction and then click here to edit it." ) ); | 255 | QWhatsThis::add( btn, tr( "Select a transaction and then click here to edit it." ) ); |
256 | connect( btn, SIGNAL( clicked() ), this, SLOT( slotEditTran() ) ); | 256 | connect( btn, SIGNAL( clicked() ), this, SLOT( slotEditTran() ) ); |