Diffstat (limited to 'noncore/apps/checkbook/configuration.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/checkbook/configuration.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/noncore/apps/checkbook/configuration.cpp b/noncore/apps/checkbook/configuration.cpp index 3f5662d..dfae446 100644 --- a/noncore/apps/checkbook/configuration.cpp +++ b/noncore/apps/checkbook/configuration.cpp | |||
@@ -73,12 +73,18 @@ Configuration::Configuration( QWidget *parent, Cfg &cfg ) | |||
73 | d->addColumnValue( tr("Expense") ); | 73 | d->addColumnValue( tr("Expense") ); |
74 | d->addColumnValue( tr("Income") ); | 74 | d->addColumnValue( tr("Income") ); |
75 | _listEditCategories->addColumnDef( d ); | 75 | _listEditCategories->addColumnDef( d ); |
76 | QStringList lst=cfg.getCategories(); | 76 | QStringList lst=cfg.getCategories(); |
77 | _listEditCategories->addData( lst ); | 77 | _listEditCategories->addData( lst ); |
78 | _mainWidget->addTab( _listEditCategories, tr( "&Categories" ) ); | 78 | _mainWidget->addTab( _listEditCategories, tr( "&Categories" ) ); |
79 | |||
80 | // Payees tab | ||
81 | _listEditPayees=new ListEdit(_mainWidget, "PAYEES"); | ||
82 | _listEditPayees->addColumnDef( new ColumnDef( tr("Payee"), (ColumnDef::ColumnType)(ColumnDef::typeString | ColumnDef::typeUnique), tr("New Payee")) ); | ||
83 | _listEditPayees->addData( cfg.getPayees() ); | ||
84 | _mainWidget->addTab( _listEditPayees, tr("&Payees") ); | ||
79 | } | 85 | } |
80 | 86 | ||
81 | Configuration::~Configuration() | 87 | Configuration::~Configuration() |
82 | { | 88 | { |
83 | } | 89 | } |
84 | 90 | ||
@@ -135,27 +141,37 @@ QWidget *Configuration::initSettings(Cfg &cfg) | |||
135 | lastTabCB = new QCheckBox( tr("Show last checkbook tab" ), container ); | 141 | lastTabCB = new QCheckBox( tr("Show last checkbook tab" ), container ); |
136 | QWhatsThis::add( lastTabCB, tr("Click here to select whether the last tab in a checkbook should be displayed.") ); | 142 | QWhatsThis::add( lastTabCB, tr("Click here to select whether the last tab in a checkbook should be displayed.") ); |
137 | lastTabCB->setMaximumHeight(fh+5); | 143 | lastTabCB->setMaximumHeight(fh+5); |
138 | lastTabCB->setChecked( cfg.isShowLastTab() ); | 144 | lastTabCB->setChecked( cfg.isShowLastTab() ); |
139 | layout->addMultiCellWidget( lastTabCB, 4, 4, 0, 1 ); | 145 | layout->addMultiCellWidget( lastTabCB, 4, 4, 0, 1 ); |
140 | 146 | ||
147 | savePayees = new QCheckBox( tr("Save new description as payee"), container ); | ||
148 | QWhatsThis::add( savePayees, tr("Click here to save new descriptions in the list of payess.") ); | ||
149 | savePayees->setMaximumHeight(fh+5); | ||
150 | savePayees->setChecked( cfg.getSavePayees() ); | ||
151 | layout->addMultiCellWidget( savePayees, 5, 5, 0, 1 ); | ||
152 | |||
141 | return(control); | 153 | return(control); |
142 | } | 154 | } |
143 | 155 | ||
144 | // --- saveConfig ------------------------------------------------------------- | 156 | // --- saveConfig ------------------------------------------------------------- |
145 | void Configuration::saveConfig(Cfg &cfg) | 157 | void Configuration::saveConfig(Cfg &cfg) |
146 | { | 158 | { |
147 | // Settings | 159 | // Settings |
148 | cfg.setCurrencySymbol( symbolEdit->text() ); | 160 | cfg.setCurrencySymbol( symbolEdit->text() ); |
149 | cfg.setShowLocks( lockCB->isChecked() ); | 161 | cfg.setShowLocks( lockCB->isChecked() ); |
150 | cfg.setShowBalances( balCB->isChecked() ); | 162 | cfg.setShowBalances( balCB->isChecked() ); |
151 | cfg.setOpenLastBook( openLastBookCB->isChecked() ); | 163 | cfg.setOpenLastBook( openLastBookCB->isChecked() ); |
152 | cfg.setShowLastTab( lastTabCB->isChecked() ); | 164 | cfg.setShowLastTab( lastTabCB->isChecked() ); |
165 | cfg.setSavePayees( savePayees->isChecked() ); | ||
153 | 166 | ||
154 | // Typelist | 167 | // Typelist |
155 | _listEditTypes->storeInList( cfg.getAccountTypes() ); | 168 | _listEditTypes->storeInList( cfg.getAccountTypes() ); |
156 | 169 | ||
157 | // Category list | 170 | // Category list |
158 | QStringList lst; | 171 | QStringList lst; |
159 | _listEditCategories->storeInList( lst ); | 172 | _listEditCategories->storeInList( lst ); |
160 | cfg.setCategories( lst ); | 173 | cfg.setCategories( lst ); |
174 | |||
175 | // Payees | ||
176 | _listEditPayees->storeInList( cfg.getPayees() ); | ||
161 | } | 177 | } |