summaryrefslogtreecommitdiff
path: root/noncore/apps/qashmoney/budgetdisplay.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/qashmoney/budgetdisplay.cpp') (more/less context) (show whitespace changes)
-rwxr-xr-xnoncore/apps/qashmoney/budgetdisplay.cpp12
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
@@ -82,6 +82,13 @@ BudgetDisplay::BudgetDisplay ( QWidget *parent ) : QWidget ( parent )
listview->header()->setTracking ( FALSE );
connect ( listview->header(), SIGNAL ( sizeChange ( int, int, int ) ), this, SLOT ( saveColumnSize ( int, int, int ) ) );
+ connect ( listview->header(), SIGNAL ( clicked ( int ) ), this, SLOT ( saveSortingPreference ( int ) ) );
+
+ // pull the column sorting preference from the preferences table, and configure the listview accordingly
+ int column = 0;
+ int direction = 0;
+ preferences->getSortingPreference ( 3, &column, &direction );
+ listview->setSorting ( column, direction );
displayBudgetNames();
@@ -118,6 +125,11 @@ void BudgetDisplay::saveColumnSize ( int column, int oldsize, int newsize )
}
}
+void BudgetDisplay::saveSortingPreference ( int column )
+ {
+ preferences->changeSortingPreference ( 3, column );
+ }
+
int BudgetDisplay::getIDColumn ()
{
int counter;