Diffstat (limited to 'noncore/apps/qashmoney/preferencedialogs.cpp') (more/less context) (show whitespace changes)
-rwxr-xr-x | noncore/apps/qashmoney/preferencedialogs.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/noncore/apps/qashmoney/preferencedialogs.cpp b/noncore/apps/qashmoney/preferencedialogs.cpp index 3c2fb97..00d52c6 100755 --- a/noncore/apps/qashmoney/preferencedialogs.cpp +++ b/noncore/apps/qashmoney/preferencedialogs.cpp @@ -70,72 +70,93 @@ void DatePreferences::setDefaultDatePreferences () // START TRANSACTION PREFERENCES TransactionPreferences::TransactionPreferences ( QWidget* parent ) : QDialog ( parent, 0, TRUE ) { setCaption( tr ( "Transaction" ) ); showclearedtransactions = new QCheckBox ( this ); showclearedtransactions->setText ( "Show Cleared Transactions" ); excludetransfers = new QCheckBox ( this ); excludetransfers->setText ( "Include Transfers In Limit View" ); + limittransactionsbox = new QHBox ( this ); + limittransactionsbox->setSpacing ( 2 ); + limittransactionslabel = new QLabel ( "Limit All Transactions To", limittransactionsbox ); + limittransactions = new QComboBox ( limittransactionsbox ); + limittransactions->insertItem ( "14 days" ); + limittransactions->insertItem ( "30 days" ); + limittransactions->insertItem ( "60 days" ); + limittransactions->insertItem ( "90 days" ); + limittransactions->insertItem ( "180 days" ); + limittransactions->insertItem ( "365 days" ); + limittransactions->insertItem ( "All" ); + if ( preferences->getPreference ( 3 ) == 1 ) showclearedtransactions->setChecked ( TRUE ); else showclearedtransactions->setChecked ( FALSE ); if ( preferences->getPreference ( 6 ) == 1 ) excludetransfers->setChecked ( TRUE ); else excludetransfers->setChecked ( FALSE ); defaults = new QPushButton ( QPixmap ( "/opt/QtPalmtop/pics/defaults.png" ), "Defaults", this ); connect ( defaults, SIGNAL ( released () ), this, SLOT ( setDefaultTransactionPreferences () ) ); layout = new QVBoxLayout ( this, 2, 2 ); layout->addWidget ( showclearedtransactions ); layout->addWidget ( excludetransfers ); - layout->insertSpacing ( 2, 5 ); + layout->addWidget ( limittransactionsbox ); + layout->insertSpacing ( 3, 5 ); layout->addWidget ( defaults ); connect ( showclearedtransactions, SIGNAL ( toggled ( bool ) ), this, SLOT ( changeShowClearedPreference ( bool ) ) ); connect ( excludetransfers, SIGNAL ( toggled ( bool ) ), this, SLOT ( changeExcludeTranfersPreference ( bool ) ) ); + connect ( limittransactions, SIGNAL ( activated ( int ) ), this, SLOT ( changeLimitTransactionsPreference ( int ) ) ); } TransactionPreferences::~TransactionPreferences () { } +void TransactionPreferences::changeLimitTransactionsPreference ( int pref ) + { + preferences->changePreference ( 7, pref ); + } + void TransactionPreferences::changeShowClearedPreference ( bool state ) { if ( state == TRUE ) preferences->changePreference ( 3, 1 ); else preferences->changePreference ( 3, 0 ); } void TransactionPreferences::changeExcludeTranfersPreference ( bool state ) { if ( state == TRUE ) preferences->changePreference ( 6, 1 ); else preferences->changePreference ( 6, 0 ); } void TransactionPreferences::setDefaultTransactionPreferences () { preferences->changePreference ( 3, 0 ); preferences->changePreference ( 6, 0 ); + preferences->changePreference ( 7, 0 ); showclearedtransactions->setChecked ( FALSE ); + limittransactions->setCurrentItem ( 0 ); } // START ACCOUNT PREFERNCES AccountPreferences::AccountPreferences ( QWidget* parent ) : QDialog ( parent, 0, TRUE ) { setCaption( tr ( "Account" ) ); currencysupport = new QCheckBox ( this ); currencysupport->setText ( "Enable Currency Support" ); |