File indexing completed on 2024-05-12 16:33:36

0001 /* This file is part of the KDE project
0002 
0003    Copyright 2007-2008 Johannes Simon <johannes.simon@gmail.com>
0004    Copyright 2009      Inge Wallin    <inge@lysator.liu.se>
0005    Copyright 2018 Dag Andersen <danders@get2net.dk>
0006 
0007    This library is free software; you can redistribute it and/or
0008    modify it under the terms of the GNU Library General Public
0009    License as published by the Free Software Foundation; either
0010    version 2 of the License, or (at your option) any later version.
0011 
0012    This library is distributed in the hope that it will be useful,
0013    but WITHOUT ANY WARRANTY; without even the implied warranty of
0014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0015    Library General Public License for more details.
0016 
0017    You should have received a copy of the GNU Library General Public License
0018    along with this library; see the file COPYING.LIB.  If not, write to
0019    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0020    Boston, MA 02110-1301, USA.
0021 */
0022 
0023 // Own
0024 #include "TitlesConfigWidget.h"
0025 
0026 // KoChart
0027 #include "ChartDebug.h"
0028 
0029 using namespace KoChart;
0030 
0031 
0032 
0033 TitlesConfigWidget::TitlesConfigWidget()
0034 {
0035     setObjectName("TitlesConfigWdget");
0036     ui.setupUi(this);
0037 }
0038 
0039 TitlesConfigWidget::~TitlesConfigWidget()
0040 {
0041 }
0042 
0043 void TitlesConfigWidget::updateData()
0044 {
0045     if (!chart) {
0046         return;
0047     }
0048     blockSignals(true);
0049 
0050     ui.showTitle->setChecked(chart->title()->isVisible());
0051     ui.titlePositioning->setCurrentIndex(chart->title()->additionalStyleAttribute("chart:auto-position") == "true" ? 0 : 1);
0052 
0053     ui.showSubTitle->setChecked(chart->subTitle()->isVisible());
0054     ui.subtitlePositioning->setCurrentIndex(chart->subTitle()->additionalStyleAttribute("chart:auto-position") == "true" ? 0 : 1);
0055 
0056     ui.showFooter->setChecked(chart->footer()->isVisible());
0057     ui.footerPositioning->setCurrentIndex(chart->footer()->additionalStyleAttribute("chart:auto-position") == "true" ? 0 : 1);
0058 
0059     blockSignals(false);
0060 }
0061 
0062 
0063