Diffstat (limited to 'noncore/apps/qashmoney/budgetdisplay.cpp') (more/less context) (ignore whitespace changes)
-rwxr-xr-x | noncore/apps/qashmoney/budgetdisplay.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/noncore/apps/qashmoney/budgetdisplay.cpp b/noncore/apps/qashmoney/budgetdisplay.cpp index 09f62b2..afc6a2d 100755 --- a/noncore/apps/qashmoney/budgetdisplay.cpp +++ b/noncore/apps/qashmoney/budgetdisplay.cpp | |||
@@ -81,8 +81,15 @@ BudgetDisplay::BudgetDisplay ( QWidget *parent ) : QWidget ( parent ) | |||
81 | listview->setColumnWidthMode ( 3, QListView::Manual ); | 81 | listview->setColumnWidthMode ( 3, QListView::Manual ); |
82 | 82 | ||
83 | listview->header()->setTracking ( FALSE ); | 83 | listview->header()->setTracking ( FALSE ); |
84 | connect ( listview->header(), SIGNAL ( sizeChange ( int, int, int ) ), this, SLOT ( saveColumnSize ( int, int, int ) ) ); | 84 | connect ( listview->header(), SIGNAL ( sizeChange ( int, int, int ) ), this, SLOT ( saveColumnSize ( int, int, int ) ) ); |
85 | connect ( listview->header(), SIGNAL ( clicked ( int ) ), this, SLOT ( saveSortingPreference ( int ) ) ); | ||
86 | |||
87 | // pull the column sorting preference from the preferences table, and configure the listview accordingly | ||
88 | int column = 0; | ||
89 | int direction = 0; | ||
90 | preferences->getSortingPreference ( 3, &column, &direction ); | ||
91 | listview->setSorting ( column, direction ); | ||
85 | 92 | ||
86 | displayBudgetNames(); | 93 | displayBudgetNames(); |
87 | 94 | ||
88 | layout = new QVBoxLayout ( this, 2, 2 ); | 95 | layout = new QVBoxLayout ( this, 2, 2 ); |
@@ -117,8 +124,13 @@ void BudgetDisplay::saveColumnSize ( int column, int oldsize, int newsize ) | |||
117 | break; | 124 | break; |
118 | } | 125 | } |
119 | } | 126 | } |
120 | 127 | ||
128 | void BudgetDisplay::saveSortingPreference ( int column ) | ||
129 | { | ||
130 | preferences->changeSortingPreference ( 3, column ); | ||
131 | } | ||
132 | |||
121 | int BudgetDisplay::getIDColumn () | 133 | int BudgetDisplay::getIDColumn () |
122 | { | 134 | { |
123 | int counter; | 135 | int counter; |
124 | int columns = listview->columns(); | 136 | int columns = listview->columns(); |