Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/views/kreportsview.cpp
Context not available. | |||||
238 | m_showingChart = ! m_showingChart; | 238 | m_showingChart = ! m_showingChart; | ||
---|---|---|---|---|---|
239 | } | 239 | } | ||
240 | 240 | | |||
241 | void KReportsView::KReportTab::updateDataRange() | ||||
242 | { | ||||
243 | QList<DataDimension> grids = m_chartView->coordinatePlane()->gridDimensionsList(); | ||||
244 | if (grids.isEmpty()) | ||||
245 | return; | ||||
246 | QChar separator = locale().groupSeparator(); | ||||
247 | QChar decimalPoint = locale().decimalPoint(); | ||||
248 | int precision = KMyMoneyGlobalSettings().pricePrecision(); | ||||
249 | QList<QPair<QString, qreal>> dims; | ||||
250 | dims.append(qMakePair(QString(), grids.at(1).start)); | ||||
251 | dims.append(qMakePair(QString(), grids.at(1).end)); | ||||
252 | dims.append(qMakePair(QString(), grids.at(1).stepWidth)); | ||||
253 | dims.append(qMakePair(QString(), grids.at(1).subStepWidth)); | ||||
254 | | ||||
255 | for (int i = 0; i < 4; ++i) { | ||||
256 | dims[i].first = locale().toString(dims.at(i).second, 'f', precision).remove(separator).remove(QRegularExpression("0+$")).remove(QRegularExpression("\\" + decimalPoint + "$")); | ||||
257 | } | ||||
258 | | ||||
259 | m_report.setDataRangeStart(dims.at(0).first); | ||||
260 | m_report.setDataRangeEnd(dims.at(1).first); | ||||
261 | m_report.setDataMajorTick(dims.at(2).first); | ||||
262 | m_report.setDataMinorTick(dims.at(3).first); | ||||
263 | } | ||||
264 | | ||||
241 | /** | 265 | /** | ||
242 | * KReportsView Implementation | 266 | * KReportsView Implementation | ||
243 | */ | 267 | */ | ||
Context not available. | |||||
663 | return; | 687 | return; | ||
664 | } | 688 | } | ||
665 | 689 | | |||
690 | tab->updateDataRange(); // range will be needed during configuration, but cannot be obtained earlier | ||||
691 | | ||||
666 | MyMoneyReport report = tab->report(); | 692 | MyMoneyReport report = tab->report(); | ||
667 | if (report.comment() == i18n("Default Report") || report.comment() == i18n("Generated Report")) { | 693 | if (report.comment() == i18n("Default Report") || report.comment() == i18n("Generated Report")) { | ||
668 | report.setComment(i18n("Custom Report")); | 694 | report.setComment(i18n("Custom Report")); | ||
Context not available. | |||||
1173 | i18n("Default Report") | 1199 | i18n("Default Report") | ||
1174 | )); | 1200 | )); | ||
1175 | list.back().setChartByDefault(true); | 1201 | list.back().setChartByDefault(true); | ||
1176 | list.back().setChartGridLines(false); | 1202 | list.back().setChartCHGridLines(false); | ||
1203 | list.back().setChartSVGridLines(false); | ||||
1177 | list.back().setChartType(MyMoneyReport::eChartLine); | 1204 | list.back().setChartType(MyMoneyReport::eChartLine); | ||
1178 | 1205 | | |||
1179 | list.push_back(MyMoneyReport( | 1206 | list.push_back(MyMoneyReport( | ||
Context not available. | |||||
1361 | i18n("Default Report") | 1388 | i18n("Default Report") | ||
1362 | )); | 1389 | )); | ||
1363 | list.back().setChartByDefault(true); | 1390 | list.back().setChartByDefault(true); | ||
1364 | list.back().setChartGridLines(false); | 1391 | list.back().setChartCHGridLines(false); | ||
1392 | list.back().setChartSVGridLines(false); | ||||
1365 | list.back().setChartType(MyMoneyReport::eChartPie); | 1393 | list.back().setChartType(MyMoneyReport::eChartPie); | ||
1366 | list.back().setInvestmentsOnly(true); | 1394 | list.back().setInvestmentsOnly(true); | ||
1367 | 1395 | | |||
Context not available. | |||||
1374 | i18n("Default Report") | 1402 | i18n("Default Report") | ||
1375 | )); | 1403 | )); | ||
1376 | list.back().setChartByDefault(true); | 1404 | list.back().setChartByDefault(true); | ||
1377 | list.back().setChartGridLines(false); | 1405 | list.back().setChartCHGridLines(false); | ||
1406 | list.back().setChartSVGridLines(false); | ||||
1378 | list.back().setChartType(MyMoneyReport::eChartLine); | 1407 | list.back().setChartType(MyMoneyReport::eChartLine); | ||
1379 | list.back().setColumnsAreDays(true); | 1408 | list.back().setColumnsAreDays(true); | ||
1380 | list.back().setInvestmentsOnly(true); | 1409 | list.back().setInvestmentsOnly(true); | ||
Context not available. | |||||
1388 | i18n("Default Report") | 1417 | i18n("Default Report") | ||
1389 | )); | 1418 | )); | ||
1390 | list.back().setChartByDefault(true); | 1419 | list.back().setChartByDefault(true); | ||
1391 | list.back().setChartGridLines(false); | 1420 | list.back().setChartCHGridLines(false); | ||
1421 | list.back().setChartSVGridLines(false); | ||||
1392 | list.back().setChartType(MyMoneyReport::eChartLine); | 1422 | list.back().setChartType(MyMoneyReport::eChartLine); | ||
1393 | list.back().setColumnsAreDays(true); | 1423 | list.back().setColumnsAreDays(true); | ||
1394 | list.back().setInvestmentsOnly(true); | 1424 | list.back().setInvestmentsOnly(true); | ||
Context not available. | |||||
1407 | i18n("Default Report") | 1437 | i18n("Default Report") | ||
1408 | )); | 1438 | )); | ||
1409 | list.back().setChartByDefault(true); | 1439 | list.back().setChartByDefault(true); | ||
1410 | list.back().setChartGridLines(false); | 1440 | list.back().setChartCHGridLines(false); | ||
1441 | list.back().setChartSVGridLines(false); | ||||
1411 | list.back().setChartType(MyMoneyReport::eChartLine); | 1442 | list.back().setChartType(MyMoneyReport::eChartLine); | ||
1412 | list.back().setColumnsAreDays(true); | 1443 | list.back().setColumnsAreDays(true); | ||
1413 | list.back().setInvestmentsOnly(true); | 1444 | list.back().setInvestmentsOnly(true); | ||
Context not available. | |||||
1425 | i18n("Investment Moving Average"), | 1456 | i18n("Investment Moving Average"), | ||
1426 | i18n("Default Report") | 1457 | i18n("Default Report") | ||
1427 | )); | 1458 | )); | ||
1428 | list.back().setChartGridLines(false); | 1459 | list.back().setChartCHGridLines(false); | ||
1460 | list.back().setChartSVGridLines(false); | ||||
1429 | list.back().setChartType(MyMoneyReport::eChartLine); | 1461 | list.back().setChartType(MyMoneyReport::eChartLine); | ||
1430 | list.back().setColumnsAreDays(true); | 1462 | list.back().setColumnsAreDays(true); | ||
1431 | list.back().setInvestmentsOnly(true); | 1463 | list.back().setInvestmentsOnly(true); | ||
Context not available. | |||||
1442 | i18n("Default Report") | 1474 | i18n("Default Report") | ||
1443 | )); | 1475 | )); | ||
1444 | list.back().setChartByDefault(true); | 1476 | list.back().setChartByDefault(true); | ||
1445 | list.back().setChartGridLines(false); | 1477 | list.back().setChartCHGridLines(false); | ||
1478 | list.back().setChartSVGridLines(false); | ||||
1446 | list.back().setChartType(MyMoneyReport::eChartLine); | 1479 | list.back().setChartType(MyMoneyReport::eChartLine); | ||
1447 | list.back().setColumnsAreDays(true); | 1480 | list.back().setColumnsAreDays(true); | ||
1448 | list.back().setInvestmentsOnly(true); | 1481 | list.back().setInvestmentsOnly(true); | ||
Context not available. | |||||
1571 | i18n("Default Report") | 1604 | i18n("Default Report") | ||
1572 | )); | 1605 | )); | ||
1573 | list.back().setChartByDefault(true); | 1606 | list.back().setChartByDefault(true); | ||
1574 | list.back().setChartGridLines(false); | 1607 | list.back().setChartCHGridLines(false); | ||
1608 | list.back().setChartSVGridLines(false); | ||||
1575 | list.back().setBudget("Any", true); | 1609 | list.back().setBudget("Any", true); | ||
1576 | list.back().setChartType(MyMoneyReport::eChartLine); | 1610 | list.back().setChartType(MyMoneyReport::eChartLine); | ||
1577 | 1611 | | |||
Context not available. | |||||
1622 | list.back().setColumnsAreDays(true); | 1656 | list.back().setColumnsAreDays(true); | ||
1623 | list.back().setIncludingForecast(true); | 1657 | list.back().setIncludingForecast(true); | ||
1624 | list.back().setChartByDefault(true); | 1658 | list.back().setChartByDefault(true); | ||
1625 | list.back().setChartGridLines(false); | 1659 | list.back().setChartCHGridLines(false); | ||
1660 | list.back().setChartSVGridLines(false); | ||||
1626 | list.back().setChartType(MyMoneyReport::eChartLine); | 1661 | list.back().setChartType(MyMoneyReport::eChartLine); | ||
1627 | groups.push_back(list); | 1662 | groups.push_back(list); | ||
1628 | } | 1663 | } | ||
Context not available. |