author | mickeyl <mickeyl> | 2004-11-04 10:33:04 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-11-04 10:33:04 (UTC) |
commit | 7855b19ce0241a7b7b4fc72e3a8ddd9bf73b0a77 (patch) (side-by-side diff) | |
tree | e76604c6af3da9c19b69dcdcf8105d58bac63f71 /noncore/unsupported/qashmoney/preferencedialogs.cpp | |
parent | cd2d50799e087fad5b56df9d7fe9aa572a313e64 (diff) | |
download | opie-7855b19ce0241a7b7b4fc72e3a8ddd9bf73b0a77.zip opie-7855b19ce0241a7b7b4fc72e3a8ddd9bf73b0a77.tar.gz opie-7855b19ce0241a7b7b4fc72e3a8ddd9bf73b0a77.tar.bz2 |
opie-qashmoney is now unsupported
Diffstat (limited to 'noncore/unsupported/qashmoney/preferencedialogs.cpp') (more/less context) (show whitespace changes)
-rwxr-xr-x | noncore/unsupported/qashmoney/preferencedialogs.cpp | 216 |
1 files changed, 216 insertions, 0 deletions
diff --git a/noncore/unsupported/qashmoney/preferencedialogs.cpp b/noncore/unsupported/qashmoney/preferencedialogs.cpp new file mode 100755 index 0000000..b83c957 --- a/dev/null +++ b/noncore/unsupported/qashmoney/preferencedialogs.cpp @@ -0,0 +1,216 @@ +#include "preferencedialogs.h" +#include "preferences.h" + +extern Preferences *preferences; + +DatePreferences::DatePreferences ( QWidget* parent ) : QDialog ( parent, 0, TRUE ) + { + setCaption( tr( "Date" ) ); + + QLabel *datelabel = new QLabel ( "Format", this ); + dateformat = new QComboBox ( this ); + dateformat->setEditable ( FALSE ); + dateformat->insertItem ( "yyyymmdd" ); + dateformat->insertItem ( "yymmdd" ); + dateformat->insertItem ( "mmddyyyy" ); + dateformat->insertItem ( "mmddyy" ); + dateformat->insertItem ( "yyyyddmm" ); + dateformat->insertItem ( "yyddmm" ); + dateformat->insertItem ( "ddmmyyyy" ); + dateformat->insertItem ( "ddmmyy" ); + connect ( dateformat, SIGNAL ( activated(int) ), this, SLOT ( changeDateFormat(int) ) ); + + QLabel *dateseparatorlabel = new QLabel ( "Separator", this ); + dateseparator = new QComboBox ( this ); + dateseparator->insertItem ( "/" ); + dateseparator->insertItem ( "-" ); + dateseparator->insertItem ( "." ); + connect ( dateseparator, SIGNAL ( activated(int) ), this, SLOT ( changeDateSeparator(int) ) ); + + defaults = new QPushButton ( QPixmap ( "/opt/QtPalmtop/pics/defaults.png" ), "Defaults", this ); + connect ( defaults, SIGNAL ( released() ), this, SLOT ( setDefaultDatePreferences() ) ); + + dateformat->setCurrentItem ( ( preferences->getPreference ( 1 ) ) - 1 ); + dateseparator->setCurrentItem ( ( preferences->getPreference ( 2 ) ) - 1 ); + + layout = new QVBoxLayout ( this, 2, 2 ); + layout->addWidget ( datelabel ); + layout->addWidget ( dateformat ); + layout->addWidget ( dateseparatorlabel ); + layout->addWidget ( dateseparator ); + layout->insertSpacing ( 4, 5 ); + layout->addWidget ( defaults ); + + } + +DatePreferences::~DatePreferences () + { + } + +void DatePreferences::changeDateFormat ( int index ) + { + index ++; + preferences->changePreference ( 1, index ); + } + +void DatePreferences::changeDateSeparator ( int index ) + { + index ++; + preferences->changePreference ( 2, index ); + } + +void DatePreferences::setDefaultDatePreferences () + { + preferences->setDefaultDatePreferences (); + dateformat->setCurrentItem ( ( preferences->getPreference ( 1 ) ) - 1 ); + dateseparator->setCurrentItem ( ( preferences->getPreference ( 2 ) ) - 1 ); + } + +// START TRANSACTION PREFERENCES + +TransactionPreferences::TransactionPreferences ( QWidget* parent ) : QDialog ( parent, 0, TRUE ) +{ + setCaption( tr ( "Transaction" ) ); + + showclearedtransactions = new QCheckBox ( this ); + showclearedtransactions->setText ( "Show Cleared Transactions" ); + + limittransactionsbox = new QHBox ( this ); + limittransactionsbox->setSpacing ( 2 ); + limittransactionslabel = new QLabel ( "Show ", limittransactionsbox ); + limittransactions = new QComboBox ( limittransactionsbox ); + QLabel *limittransactionslabel2 = new QLabel ( "of cleared transactions. ", limittransactionsbox ); + limittransactions->insertItem ( "14 days" ); + limittransactions->insertItem ( "30 days" ); + limittransactions->insertItem ( "90 days" ); + limittransactions->insertItem ( "180 days" ); + limittransactions->insertItem ( "365 days" ); + limittransactions->insertItem ( "All" ); + limittransactions->setCurrentItem ( preferences->getPreference ( 7 ) ); + + excludetransfers = new QCheckBox ( this ); + excludetransfers->setText ( "Include Transfers In Limit View" ); + + 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 ( limittransactionsbox ); + layout->addWidget ( excludetransfers ); + 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" ); + + onetouch = new QCheckBox ( this ); + onetouch->setText ( "One Touch Account Viewing" ); + + if ( preferences->getPreference ( 4 ) == 1 ) + currencysupport->setChecked ( TRUE ); + else + currencysupport->setChecked ( FALSE ); + + if ( preferences->getPreference ( 5 ) == 1 ) + onetouch->setChecked ( TRUE ); + else + onetouch->setChecked ( FALSE ); + + defaults = new QPushButton ( QPixmap ( "/opt/QtPalmtop/pics/defaults.png" ), "Defaults", this ); + connect ( defaults, SIGNAL ( released() ), this, SLOT ( setDefaultAccountPreferences() ) ); + + layout = new QVBoxLayout ( this, 2, 2 ); + layout->addWidget ( currencysupport ); + layout->addWidget ( onetouch ); + layout->insertSpacing ( 2, 5 ); + layout->addWidget ( defaults ); + + connect ( currencysupport, SIGNAL ( toggled(bool) ), this, SLOT ( changeCurrencySupport(bool) ) ); + connect ( onetouch, SIGNAL ( toggled(bool) ), this, SLOT ( changeOneTouchViewing(bool) ) ); +} + +AccountPreferences::~AccountPreferences () + { + } + +void AccountPreferences::changeCurrencySupport ( bool state ) + { + if ( state == TRUE ) + preferences->changePreference ( 4, 1 ); + else + preferences->changePreference ( 4, 0 ); + } + +void AccountPreferences::changeOneTouchViewing ( bool state ) + { + if ( state == TRUE ) + preferences->changePreference ( 5, 1 ); + else + preferences->changePreference ( 5, 0 ); + } + +void AccountPreferences::setDefaultAccountPreferences () + { + preferences->changePreference ( 4, 0 ); + preferences->changePreference ( 5, 0 ); + currencysupport->setChecked ( FALSE ); + onetouch->setChecked ( FALSE ); + } + |