Changeset View
Changeset View
Standalone View
Standalone View
src/wrtembed/KReportSectionEditor.cpp
Show First 20 Lines • Show All 106 Lines • ▼ Show 20 Line(s) | 53 | { | |||
---|---|---|---|---|---|
107 | connect(m_btnAdd, SIGNAL(clicked(bool)), this, SLOT(btnAdd_clicked())); | 107 | connect(m_btnAdd, SIGNAL(clicked(bool)), this, SLOT(btnAdd_clicked())); | ||
108 | connect(m_btnEdit, SIGNAL(clicked(bool)), this, SLOT(btnEdit_clicked())); | 108 | connect(m_btnEdit, SIGNAL(clicked(bool)), this, SLOT(btnEdit_clicked())); | ||
109 | connect(m_btnRemove, SIGNAL(clicked(bool)), this, SLOT(btnRemove_clicked())); | 109 | connect(m_btnRemove, SIGNAL(clicked(bool)), this, SLOT(btnRemove_clicked())); | ||
110 | connect(m_btnMoveUp, SIGNAL(clicked(bool)), this, SLOT(btnMoveUp_clicked())); | 110 | connect(m_btnMoveUp, SIGNAL(clicked(bool)), this, SLOT(btnMoveUp_clicked())); | ||
111 | connect(m_btnMoveDown, SIGNAL(clicked(bool)), this, SLOT(brnMoveDown_clicked())); | 111 | connect(m_btnMoveDown, SIGNAL(clicked(bool)), this, SLOT(brnMoveDown_clicked())); | ||
112 | 112 | | |||
113 | // set all the properties | 113 | // set all the properties | ||
114 | 114 | | |||
115 | m_ui.cbReportHeader->setChecked(m_reportDesigner->section(KReportSectionData::ReportHeader)); | 115 | m_ui.cbReportHeader->setChecked(m_reportDesigner->section(KReportSectionData::Type::ReportHeader)); | ||
116 | m_ui.cbReportFooter->setChecked(m_reportDesigner->section(KReportSectionData::ReportFooter)); | 116 | m_ui.cbReportFooter->setChecked(m_reportDesigner->section(KReportSectionData::Type::ReportFooter)); | ||
117 | 117 | | |||
118 | m_ui.cbHeadFirst->setChecked(m_reportDesigner->section(KReportSectionData::PageHeaderFirst)); | 118 | m_ui.cbHeadFirst->setChecked(m_reportDesigner->section(KReportSectionData::Type::PageHeaderFirst)); | ||
119 | m_ui.cbHeadOdd->setChecked(m_reportDesigner->section(KReportSectionData::PageHeaderOdd)); | 119 | m_ui.cbHeadOdd->setChecked(m_reportDesigner->section(KReportSectionData::Type::PageHeaderOdd)); | ||
120 | m_ui.cbHeadEven->setChecked(m_reportDesigner->section(KReportSectionData::PageHeaderEven)); | 120 | m_ui.cbHeadEven->setChecked(m_reportDesigner->section(KReportSectionData::Type::PageHeaderEven)); | ||
121 | m_ui.cbHeadLast->setChecked(m_reportDesigner->section(KReportSectionData::PageHeaderLast)); | 121 | m_ui.cbHeadLast->setChecked(m_reportDesigner->section(KReportSectionData::Type::PageHeaderLast)); | ||
122 | m_ui.cbHeadAny->setChecked(m_reportDesigner->section(KReportSectionData::PageHeaderAny)); | 122 | m_ui.cbHeadAny->setChecked(m_reportDesigner->section(KReportSectionData::Type::PageHeaderAny)); | ||
123 | 123 | | |||
124 | m_ui.cbFootFirst->setChecked(m_reportDesigner->section(KReportSectionData::PageFooterFirst)); | 124 | m_ui.cbFootFirst->setChecked(m_reportDesigner->section(KReportSectionData::Type::PageFooterFirst)); | ||
125 | m_ui.cbFootOdd->setChecked(m_reportDesigner->section(KReportSectionData::PageFooterOdd)); | 125 | m_ui.cbFootOdd->setChecked(m_reportDesigner->section(KReportSectionData::Type::PageFooterOdd)); | ||
126 | m_ui.cbFootEven->setChecked(m_reportDesigner->section(KReportSectionData::PageFooterEven)); | 126 | m_ui.cbFootEven->setChecked(m_reportDesigner->section(KReportSectionData::Type::PageFooterEven)); | ||
127 | m_ui.cbFootLast->setChecked(m_reportDesigner->section(KReportSectionData::PageFooterLast)); | 127 | m_ui.cbFootLast->setChecked(m_reportDesigner->section(KReportSectionData::Type::PageFooterLast)); | ||
128 | m_ui.cbFootAny->setChecked(m_reportDesigner->section(KReportSectionData::PageFooterAny)); | 128 | m_ui.cbFootAny->setChecked(m_reportDesigner->section(KReportSectionData::Type::PageFooterAny)); | ||
129 | 129 | | |||
130 | // now set the rw value | 130 | // now set the rw value | ||
131 | if (m_reportSectionDetail) { | 131 | if (m_reportSectionDetail) { | ||
132 | const QStringList columnNames = m_reportDesigner->fieldNames(); | 132 | const QStringList columnNames = m_reportDesigner->fieldNames(); | ||
133 | const QStringList keys = m_reportDesigner->fieldKeys(); | 133 | const QStringList keys = m_reportDesigner->fieldKeys(); | ||
134 | for (int i = 0; i < m_reportSectionDetail->groupSectionCount(); ++i) { | 134 | for (int i = 0; i < m_reportSectionDetail->groupSectionCount(); ++i) { | ||
135 | const QString key = m_reportSectionDetail->groupSection(i)->column(); | 135 | const QString key = m_reportSectionDetail->groupSection(i)->column(); | ||
136 | const int idx = keys.indexOf(key); | 136 | const int idx = keys.indexOf(key); | ||
Show All 19 Lines | |||||
156 | { | 156 | { | ||
157 | // no need to delete child widgets, Qt does it all for us | 157 | // no need to delete child widgets, Qt does it all for us | ||
158 | } | 158 | } | ||
159 | 159 | | |||
160 | void KReportSectionEditor::cbReportHeader_toggled(bool yes) | 160 | void KReportSectionEditor::cbReportHeader_toggled(bool yes) | ||
161 | { | 161 | { | ||
162 | if (m_reportDesigner) { | 162 | if (m_reportDesigner) { | ||
163 | if (yes) { | 163 | if (yes) { | ||
164 | m_reportDesigner->insertSection(KReportSectionData::ReportHeader); | 164 | m_reportDesigner->insertSection(KReportSectionData::Type::ReportHeader); | ||
165 | } else { | 165 | } else { | ||
166 | m_reportDesigner->removeSection(KReportSectionData::ReportHeader); | 166 | m_reportDesigner->removeSection(KReportSectionData::Type::ReportHeader); | ||
167 | } | 167 | } | ||
168 | } | 168 | } | ||
169 | 169 | | |||
170 | } | 170 | } | ||
171 | 171 | | |||
172 | void KReportSectionEditor::cbReportFooter_toggled(bool yes) | 172 | void KReportSectionEditor::cbReportFooter_toggled(bool yes) | ||
173 | { | 173 | { | ||
174 | if (m_reportDesigner) { | 174 | if (m_reportDesigner) { | ||
175 | if (yes) { | 175 | if (yes) { | ||
176 | m_reportDesigner->insertSection(KReportSectionData::ReportFooter); | 176 | m_reportDesigner->insertSection(KReportSectionData::Type::ReportFooter); | ||
177 | } else { | 177 | } else { | ||
178 | m_reportDesigner->removeSection(KReportSectionData::ReportFooter); | 178 | m_reportDesigner->removeSection(KReportSectionData::Type::ReportFooter); | ||
179 | } | 179 | } | ||
180 | } | 180 | } | ||
181 | 181 | | |||
182 | } | 182 | } | ||
183 | 183 | | |||
184 | void KReportSectionEditor::cbHeadFirst_toggled(bool yes) | 184 | void KReportSectionEditor::cbHeadFirst_toggled(bool yes) | ||
185 | { | 185 | { | ||
186 | if (m_reportDesigner) { | 186 | if (m_reportDesigner) { | ||
187 | if (yes) { | 187 | if (yes) { | ||
188 | m_reportDesigner->insertSection(KReportSectionData::PageHeaderFirst); | 188 | m_reportDesigner->insertSection(KReportSectionData::Type::PageHeaderFirst); | ||
189 | } else { | 189 | } else { | ||
190 | m_reportDesigner->removeSection(KReportSectionData::PageHeaderFirst); | 190 | m_reportDesigner->removeSection(KReportSectionData::Type::PageHeaderFirst); | ||
191 | } | 191 | } | ||
192 | } | 192 | } | ||
193 | 193 | | |||
194 | } | 194 | } | ||
195 | 195 | | |||
196 | void KReportSectionEditor::cbHeadLast_toggled(bool yes) | 196 | void KReportSectionEditor::cbHeadLast_toggled(bool yes) | ||
197 | { | 197 | { | ||
198 | if (m_reportDesigner) { | 198 | if (m_reportDesigner) { | ||
199 | if (yes) { | 199 | if (yes) { | ||
200 | m_reportDesigner->insertSection(KReportSectionData::PageHeaderLast); | 200 | m_reportDesigner->insertSection(KReportSectionData::Type::PageHeaderLast); | ||
201 | } else { | 201 | } else { | ||
202 | m_reportDesigner->removeSection(KReportSectionData::PageHeaderLast); | 202 | m_reportDesigner->removeSection(KReportSectionData::Type::PageHeaderLast); | ||
203 | } | 203 | } | ||
204 | } | 204 | } | ||
205 | 205 | | |||
206 | } | 206 | } | ||
207 | 207 | | |||
208 | void KReportSectionEditor::cbHeadEven_toggled(bool yes) | 208 | void KReportSectionEditor::cbHeadEven_toggled(bool yes) | ||
209 | { | 209 | { | ||
210 | if (m_reportDesigner) { | 210 | if (m_reportDesigner) { | ||
211 | if (yes) { | 211 | if (yes) { | ||
212 | m_reportDesigner->insertSection(KReportSectionData::PageHeaderEven); | 212 | m_reportDesigner->insertSection(KReportSectionData::Type::PageHeaderEven); | ||
213 | } else { | 213 | } else { | ||
214 | m_reportDesigner->removeSection(KReportSectionData::PageHeaderEven); | 214 | m_reportDesigner->removeSection(KReportSectionData::Type::PageHeaderEven); | ||
215 | } | 215 | } | ||
216 | } | 216 | } | ||
217 | 217 | | |||
218 | } | 218 | } | ||
219 | 219 | | |||
220 | void KReportSectionEditor::cbHeadOdd_toggled(bool yes) | 220 | void KReportSectionEditor::cbHeadOdd_toggled(bool yes) | ||
221 | { | 221 | { | ||
222 | if (m_reportDesigner) { | 222 | if (m_reportDesigner) { | ||
223 | if (yes) { | 223 | if (yes) { | ||
224 | m_reportDesigner->insertSection(KReportSectionData::PageHeaderOdd); | 224 | m_reportDesigner->insertSection(KReportSectionData::Type::PageHeaderOdd); | ||
225 | } else { | 225 | } else { | ||
226 | m_reportDesigner->removeSection(KReportSectionData::PageHeaderOdd); | 226 | m_reportDesigner->removeSection(KReportSectionData::Type::PageHeaderOdd); | ||
227 | } | 227 | } | ||
228 | } | 228 | } | ||
229 | 229 | | |||
230 | } | 230 | } | ||
231 | 231 | | |||
232 | void KReportSectionEditor::cbFootFirst_toggled(bool yes) | 232 | void KReportSectionEditor::cbFootFirst_toggled(bool yes) | ||
233 | { | 233 | { | ||
234 | if (m_reportDesigner) { | 234 | if (m_reportDesigner) { | ||
235 | if (yes) { | 235 | if (yes) { | ||
236 | m_reportDesigner->insertSection(KReportSectionData::PageFooterFirst); | 236 | m_reportDesigner->insertSection(KReportSectionData::Type::PageFooterFirst); | ||
237 | } else { | 237 | } else { | ||
238 | m_reportDesigner->removeSection(KReportSectionData::PageFooterFirst); | 238 | m_reportDesigner->removeSection(KReportSectionData::Type::PageFooterFirst); | ||
239 | } | 239 | } | ||
240 | } | 240 | } | ||
241 | 241 | | |||
242 | } | 242 | } | ||
243 | 243 | | |||
244 | void KReportSectionEditor::cbFootLast_toggled(bool yes) | 244 | void KReportSectionEditor::cbFootLast_toggled(bool yes) | ||
245 | { | 245 | { | ||
246 | if (m_reportDesigner) { | 246 | if (m_reportDesigner) { | ||
247 | if (yes) { | 247 | if (yes) { | ||
248 | m_reportDesigner->insertSection(KReportSectionData::PageFooterLast); | 248 | m_reportDesigner->insertSection(KReportSectionData::Type::PageFooterLast); | ||
249 | } else { | 249 | } else { | ||
250 | m_reportDesigner->removeSection(KReportSectionData::PageFooterLast); | 250 | m_reportDesigner->removeSection(KReportSectionData::Type::PageFooterLast); | ||
251 | } | 251 | } | ||
252 | } | 252 | } | ||
253 | 253 | | |||
254 | } | 254 | } | ||
255 | 255 | | |||
256 | void KReportSectionEditor::cbFootEven_toggled(bool yes) | 256 | void KReportSectionEditor::cbFootEven_toggled(bool yes) | ||
257 | { | 257 | { | ||
258 | if (m_reportDesigner) { | 258 | if (m_reportDesigner) { | ||
259 | if (yes) { | 259 | if (yes) { | ||
260 | m_reportDesigner->insertSection(KReportSectionData::PageFooterEven); | 260 | m_reportDesigner->insertSection(KReportSectionData::Type::PageFooterEven); | ||
261 | } else { | 261 | } else { | ||
262 | m_reportDesigner->removeSection(KReportSectionData::PageFooterEven); | 262 | m_reportDesigner->removeSection(KReportSectionData::Type::PageFooterEven); | ||
263 | } | 263 | } | ||
264 | } | 264 | } | ||
265 | 265 | | |||
266 | } | 266 | } | ||
267 | 267 | | |||
268 | void KReportSectionEditor::cbFootOdd_toggled(bool yes) | 268 | void KReportSectionEditor::cbFootOdd_toggled(bool yes) | ||
269 | { | 269 | { | ||
270 | if (m_reportDesigner) { | 270 | if (m_reportDesigner) { | ||
271 | if (yes) { | 271 | if (yes) { | ||
272 | m_reportDesigner->insertSection(KReportSectionData::PageFooterOdd); | 272 | m_reportDesigner->insertSection(KReportSectionData::Type::PageFooterOdd); | ||
273 | } else { | 273 | } else { | ||
274 | m_reportDesigner->removeSection(KReportSectionData::PageFooterOdd); | 274 | m_reportDesigner->removeSection(KReportSectionData::Type::PageFooterOdd); | ||
275 | } | 275 | } | ||
276 | } | 276 | } | ||
277 | 277 | | |||
278 | } | 278 | } | ||
279 | 279 | | |||
280 | bool KReportSectionEditor::editDetailGroup(KReportDesignerSectionDetailGroup * rsdg) | 280 | bool KReportSectionEditor::editDetailGroup(KReportDesignerSectionDetailGroup * rsdg) | ||
281 | { | 281 | { | ||
282 | KReportDetailGroupSectionDialog * dgsd = new KReportDetailGroupSectionDialog(this); | 282 | KReportDetailGroupSectionDialog * dgsd = new KReportDetailGroupSectionDialog(this); | ||
▲ Show 20 Lines • Show All 77 Lines • ▼ Show 20 Line(s) | 356 | { | |||
360 | } | 360 | } | ||
361 | return result; | 361 | return result; | ||
362 | } | 362 | } | ||
363 | 363 | | |||
364 | void KReportSectionEditor::cbHeadAny_toggled(bool yes) | 364 | void KReportSectionEditor::cbHeadAny_toggled(bool yes) | ||
365 | { | 365 | { | ||
366 | if (m_reportDesigner) { | 366 | if (m_reportDesigner) { | ||
367 | if (yes) { | 367 | if (yes) { | ||
368 | m_reportDesigner->insertSection(KReportSectionData::PageHeaderAny); | 368 | m_reportDesigner->insertSection(KReportSectionData::Type::PageHeaderAny); | ||
369 | } else { | 369 | } else { | ||
370 | m_reportDesigner->removeSection(KReportSectionData::PageHeaderAny); | 370 | m_reportDesigner->removeSection(KReportSectionData::Type::PageHeaderAny); | ||
371 | } | 371 | } | ||
372 | } | 372 | } | ||
373 | } | 373 | } | ||
374 | 374 | | |||
375 | void KReportSectionEditor::cbFootAny_toggled(bool yes) | 375 | void KReportSectionEditor::cbFootAny_toggled(bool yes) | ||
376 | { | 376 | { | ||
377 | if (m_reportDesigner) { | 377 | if (m_reportDesigner) { | ||
378 | if (yes) { | 378 | if (yes) { | ||
379 | m_reportDesigner->insertSection(KReportSectionData::PageFooterAny); | 379 | m_reportDesigner->insertSection(KReportSectionData::Type::PageFooterAny); | ||
380 | } else { | 380 | } else { | ||
381 | m_reportDesigner->removeSection(KReportSectionData::PageFooterAny); | 381 | m_reportDesigner->removeSection(KReportSectionData::Type::PageFooterAny); | ||
382 | } | 382 | } | ||
383 | } | 383 | } | ||
384 | } | 384 | } | ||
385 | 385 | | |||
386 | void KReportSectionEditor::btnEdit_clicked() | 386 | void KReportSectionEditor::btnEdit_clicked() | ||
387 | { | 387 | { | ||
388 | if (m_reportSectionDetail) { | 388 | if (m_reportSectionDetail) { | ||
389 | const int idx = m_ui.lbGroups->currentRow(); | 389 | const int idx = m_ui.lbGroups->currentRow(); | ||
▲ Show 20 Lines • Show All 147 Lines • Show Last 20 Lines |