summaryrefslogtreecommitdiff
path: root/noncore/apps/checkbook/checkbook.h
Unidiff
Diffstat (limited to 'noncore/apps/checkbook/checkbook.h') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/checkbook/checkbook.h28
1 files changed, 22 insertions, 6 deletions
diff --git a/noncore/apps/checkbook/checkbook.h b/noncore/apps/checkbook/checkbook.h
index 4a5011b..1b6a2d3 100644
--- a/noncore/apps/checkbook/checkbook.h
+++ b/noncore/apps/checkbook/checkbook.h
@@ -29,6 +29,7 @@
29#ifndef CHECKBOOK_H 29#ifndef CHECKBOOK_H
30#define CHECKBOOK_H 30#define CHECKBOOK_H
31 31
32#include <qdatetime.h>
32#include <qdialog.h> 33#include <qdialog.h>
33#include <qlistview.h> 34#include <qlistview.h>
34 35
@@ -46,25 +47,29 @@ class QMultiLineEdit;
46class QString; 47class QString;
47class TranInfo; 48class TranInfo;
48class TranInfoList; 49class TranInfoList;
50class Cfg;
49 51
52
53// --- Checkbook --------------------------------------------------------------
50class Checkbook : public QDialog 54class Checkbook : public QDialog
51{ 55{
52 Q_OBJECT 56 Q_OBJECT
53 57
54 public: 58 public:
55 Checkbook( QWidget * = 0x0, CBInfo * = 0x0, const QString & = "$" ); 59 Checkbook( QWidget *, CBInfo *, Cfg *cfg );
56 ~Checkbook(); 60 ~Checkbook();
57 61
62 // resort
63 void resort();
64
58 private: 65 private:
59 CBInfo *info; 66 CBInfo *info;
60 TranInfoList *tranList; 67 TranInfoList *tranList;
61 QString currencySymbol; 68 Cfg *_pCfg;
62 int highTranNum;
63 69
64 OTabWidget *mainWidget; 70 OTabWidget *mainWidget;
65 void loadCheckbook(); 71 void loadCheckbook();
66 void adjustBalance(); 72 void adjustBalance();
67 TranInfo *findTran( const QString &, const QString &, const QString & );
68 73
69 // Info tab 74 // Info tab
70 QWidget *initInfo(); 75 QWidget *initInfo();
@@ -76,11 +81,13 @@ class Checkbook : public QDialog
76 QLineEdit *pinNumEdit; 81 QLineEdit *pinNumEdit;
77 QLineEdit *balanceEdit; 82 QLineEdit *balanceEdit;
78 QMultiLineEdit *notesEdit; 83 QMultiLineEdit *notesEdit;
84 int _sortCol;
79 85
80 // Transactions tab 86 // Transactions tab
81 QWidget *initTransactions(); 87 QWidget *initTransactions();
82 QListView *tranTable; 88 QListView *tranTable;
83 QLabel *balanceLabel; 89 QComboBox *_cbSortType;
90 QDate _dLastNew;
84 91
85 // Charts tab 92 // Charts tab
86 QWidget *initCharts(); 93 QWidget *initCharts();
@@ -91,8 +98,10 @@ class Checkbook : public QDialog
91 void drawBalanceChart(); 98 void drawBalanceChart();
92 void drawCategoryChart( bool = TRUE ); 99 void drawCategoryChart( bool = TRUE );
93 100
101
94 protected slots: 102 protected slots:
95 void accept(); 103 void accept();
104 void slotTab(QWidget *tab);
96 105
97 private slots: 106 private slots:
98 void slotPasswordClicked(); 107 void slotPasswordClicked();
@@ -102,20 +111,26 @@ class Checkbook : public QDialog
102 void slotEditTran(); 111 void slotEditTran();
103 void slotDeleteTran(); 112 void slotDeleteTran();
104 void slotDrawGraph(); 113 void slotDrawGraph();
114 void slotSortChanged( const QString & );
105}; 115};
106 116
117// --- CBListItem -------------------------------------------------------------
107class CBListItem : public QListViewItem 118class CBListItem : public QListViewItem
108{ 119{
109 //Q_OBJECT 120 //Q_OBJECT
110 121
111 public: 122 public:
112 CBListItem( QListView *, QString = QString::null, QString = QString::null, 123 CBListItem( TranInfo *, QListView *, QString = QString::null, QString = QString::null,
113 QString = QString::null, QString = QString::null, QString = QString::null, 124 QString = QString::null, QString = QString::null, QString = QString::null,
114 QString = QString::null, QString = QString::null, QString = QString::null ); 125 QString = QString::null, QString = QString::null, QString = QString::null );
115 126
116 void paintCell( QPainter *, const QColorGroup &, int, int, int ); 127 void paintCell( QPainter *, const QColorGroup &, int, int, int );
117 128
129 // --- members
130 TranInfo *getTranInfo() { return(_pTran); }
131
118 private: 132 private:
133 TranInfo *_pTran;
119 QListView *owner; 134 QListView *owner;
120 bool m_known; 135 bool m_known;
121 bool m_odd; 136 bool m_odd;
@@ -123,4 +138,5 @@ class CBListItem : public QListViewItem
123 bool isAltBackground(); 138 bool isAltBackground();
124}; 139};
125 140
141
126#endif 142#endif