Git commit bb2ffb74b2223b57d04d8b6d51325615c9b3c6ba by Alexander Semke. Committed on 19/05/2016 at 19:24. Pushed by asemke into branch 'integrate-cantor'.
Merge branch 'frameworks' into integrate-cantor M +28 -10 CMakeLists.txt M +86 -13 doc/index.docbook M +11 -4 src/CMakeLists.txt M +11 -5 src/backend/core/AspectTreeModel.cpp M +2 -6 src/backend/core/Folder.cpp M +24 -15 src/backend/core/Project.cpp M +156 -9 src/backend/core/column/Column.cpp M +40 -0 src/backend/core/column/Column.h M +3 -4 src/backend/datasources/FileDataSource.h M +4 -3 src/backend/spreadsheet/Spreadsheet.h M +3 -3 src/backend/worksheet/TextLabel.cpp M +1 -1 src/backend/worksheet/TextLabel.h M +3 -3 src/backend/worksheet/Worksheet.h M +6 -3 src/backend/worksheet/plots/cartesian/Axis.h M +28 -16 src/backend/worksheet/plots/cartesian/CartesianPlot.h M +1 -1 src/backend/worksheet/plots/cartesian/XYFitCurve.h M +659 -247 src/commonfrontend/spreadsheet/SpreadsheetView.cpp M +50 -0 src/commonfrontend/worksheet/WorksheetView.cpp M +36 -0 src/kdefrontend/GuiObserver.cpp M +29 -17 src/kdefrontend/MainWin.cpp M +4 -0 src/kdefrontend/MainWin.h M +18 -4 src/kdefrontend/datasources/FileInfoDialog.cpp M +2 -1 src/kdefrontend/datasources/ImportFileWidget.cpp M +405 -229 src/kdefrontend/dockwidgets/CartesianPlotDock.cpp M +5 -2 src/kdefrontend/dockwidgets/XYCurveDock.cpp M +3 -2 src/kdefrontend/dockwidgets/XYEquationCurveDock.cpp M +18 -9 src/kdefrontend/dockwidgets/XYFitCurveDock.cpp M +1 -1 src/kdefrontend/labplot2ui.rc M +144 -22 src/kdefrontend/spreadsheet/ExportSpreadsheetDialog.cpp M +154 -72 src/kdefrontend/spreadsheet/RandomValuesDialog.cpp M +53 -27 src/kdefrontend/widgets/LabelWidget.cpp M +4 -2 src/kdefrontend/widgets/LabelWidget.h http://commits.kde.org/labplot/bb2ffb74b2223b57d04d8b6d51325615c9b3c6ba diff --cc src/kdefrontend/GuiObserver.cpp index a40003e,4adfbcf..3fab3f0 --- a/src/kdefrontend/GuiObserver.cpp +++ b/src/kdefrontend/GuiObserver.cpp @@@ -55,9 -54,10 +55,11 @@@ #include "kdefrontend/dockwidgets/XYCurveDock.h" #include "kdefrontend/dockwidgets/XYEquationCurveDock.h" #include "kdefrontend/dockwidgets/XYFitCurveDock.h" + #include "kdefrontend/dockwidgets/XYFourierFilterCurveDock.h" + #include "kdefrontend/dockwidgets/XYInterpolationCurveDock.h" #include "kdefrontend/dockwidgets/CustomPointDock.h" #include "kdefrontend/dockwidgets/WorksheetDock.h" +#include "kdefrontend/dockwidgets/CantorWorksheetDock.h" #include "kdefrontend/widgets/LabelWidget.h" #include "kdefrontend/widgets/DatapickerImageWidget.h" #include "kdefrontend/widgets/DatapickerCurveWidget.h" diff --cc src/kdefrontend/MainWin.cpp index 1959d00,dd9db31..c16ae19 --- a/src/kdefrontend/MainWin.cpp +++ b/src/kdefrontend/MainWin.cpp @@@ -478,18 -435,15 +480,19 @@@ void MainWin::updateGUIOnProjectChanges m_togglePropertiesDockAction->setEnabled(!b); if (!m_mdiArea->currentSubWindow()) { - factory->container("worksheet", this)->setEnabled(false); factory->container("spreadsheet", this)->setEnabled(false); - factory->container("datapicker", this)->setEnabled(false); factory->container("matrix", this)->setEnabled(false); + factory->container("worksheet", this)->setEnabled(false); + factory->container("analysis", this)->setEnabled(false); + factory->container("datapicker", this)->setEnabled(false); + factory->container("spreadsheet_toolbar", this)->hide(); factory->container("worksheet_toolbar", this)->hide(); factory->container("cartesian_plot_toolbar", this)->hide(); - factory->container("spreadsheet_toolbar", this)->hide(); factory->container("datapicker_toolbar", this)->hide(); +#ifdef HAVE_CANTOR_LIBS + factory->container("casWorksheet", this)->setEnabled(false); + factory->container("cantorworksheet_toolbar", this)->hide(); +#endif } factory->container("new", this)->setEnabled(!b); @@@ -521,18 -475,15 +524,19 @@@ void MainWin::updateGUI() } if (!m_mdiArea->currentSubWindow()) { - factory->container("worksheet", this)->setEnabled(false); factory->container("spreadsheet", this)->setEnabled(false); - factory->container("datapicker", this)->setEnabled(false); factory->container("matrix", this)->setEnabled(false); + factory->container("worksheet", this)->setEnabled(false); + factory->container("analysis", this)->setEnabled(false); + factory->container("datapicker", this)->setEnabled(false); + factory->container("spreadsheet_toolbar", this)->hide(); factory->container("worksheet_toolbar", this)->hide(); factory->container("cartesian_plot_toolbar", this)->hide(); - factory->container("spreadsheet_toolbar", this)->hide(); factory->container("datapicker_toolbar", this)->hide(); +#ifdef HAVE_CANTOR_LIBS + factory->container("casWorksheet", this)->setEnabled(false); + factory->container("cantorworksheet_toolbar", this)->hide(); +#endif return; } diff --cc src/kdefrontend/dockwidgets/CartesianPlotDock.cpp index 1bba819,88d06aa..853dcec --- a/src/kdefrontend/dockwidgets/CartesianPlotDock.cpp +++ b/src/kdefrontend/dockwidgets/CartesianPlotDock.cpp @@@ -226,16 -225,16 +225,16 @@@ void CartesianPlotDock::setPlots(QList< m_initializing = true; m_plotList = list; - m_plot=list.first(); + m_plot=list.first(); - QList<TextLabel*> labels; - foreach(CartesianPlot* plot, list) - labels.append(plot->title()); + QList<TextLabel*> labels; + foreach(CartesianPlot* plot, list) + labels.append(plot->title()); - labelWidget->setLabels(labels); + labelWidget->setLabels(labels); //if there is more then one plot in the list, disable the name and comment fields in the tab "general" - if (list.size()==1){ + if (list.size()==1) { ui.lName->setEnabled(true); ui.leName->setEnabled(true); ui.lComment->setEnabled(true); @@@ -249,114 -248,118 +248,160 @@@ ui.lComment->setEnabled(false); ui.leComment->setEnabled(false); - ui.leName->setText(""); - ui.leComment->setText(""); - } + ui.leName->setText(""); + ui.leComment->setText(""); + } //show the properties of the first plot - this->load(); - - //update active widgets - backgroundTypeChanged(ui.cbBackgroundType->currentIndex()); - - //Deactivate the geometry related widgets, if the worksheet layout is active. - //Currently, a plot can only be a child of the worksheet itself, so we only need to ask the parent aspect (=worksheet). - //TODO redesign this, if the hierarchy will be changend in future (a plot is a child of a new object group/container or so) - Worksheet* w = dynamic_cast<Worksheet*>(m_plot->parentAspect()); - if (w){ - bool b = (w->layout()==Worksheet::NoLayout); - ui.sbTop->setEnabled(b); - ui.sbLeft->setEnabled(b); - ui.sbWidth->setEnabled(b); - ui.sbHeight->setEnabled(b); - connect(w, SIGNAL(layoutChanged(Worksheet::Layout)), this, SLOT(layoutChanged(Worksheet::Layout))); - } + this->load(); + + //update active widgets + backgroundTypeChanged(ui.cbBackgroundType->currentIndex()); + + //Deactivate the geometry related widgets, if the worksheet layout is active. + //Currently, a plot can only be a child of the worksheet itself, so we only need to ask the parent aspect (=worksheet). + //TODO redesign this, if the hierarchy will be changend in future (a plot is a child of a new object group/container or so) + Worksheet* w = dynamic_cast<Worksheet*>(m_plot->parentAspect()); + if (w) { + bool b = (w->layout()==Worksheet::NoLayout); + ui.sbTop->setEnabled(b); + ui.sbLeft->setEnabled(b); + ui.sbWidth->setEnabled(b); + ui.sbHeight->setEnabled(b); + connect(w, SIGNAL(layoutChanged(Worksheet::Layout)), this, SLOT(layoutChanged(Worksheet::Layout))); + } + + //SIGNALs/SLOTs + connect( m_plot, SIGNAL(aspectDescriptionChanged(const AbstractAspect*)), this, SLOT(plotDescriptionChanged(const AbstractAspect*)) ); + connect( m_plot, SIGNAL(rectChanged(QRectF&)), this, SLOT(plotRectChanged(QRectF&)) ); + connect( m_plot, SIGNAL(xAutoScaleChanged(bool)), this, SLOT(plotXAutoScaleChanged(bool)) ); + connect( m_plot, SIGNAL(xMinChanged(float)), this, SLOT(plotXMinChanged(float)) ); + connect( m_plot, SIGNAL(xMaxChanged(float)), this, SLOT(plotXMaxChanged(float)) ); + connect( m_plot, SIGNAL(xScaleChanged(int)), this, SLOT(plotXScaleChanged(int)) ); + connect( m_plot, SIGNAL(yAutoScaleChanged(bool)), this, SLOT(plotYAutoScaleChanged(bool)) ); + connect( m_plot, SIGNAL(yMinChanged(float)), this, SLOT(plotYMinChanged(float)) ); + connect( m_plot, SIGNAL(yMaxChanged(float)), this, SLOT(plotYMaxChanged(float)) ); + connect( m_plot, SIGNAL(yScaleChanged(int)), this, SLOT(plotYScaleChanged(int)) ); + connect( m_plot, SIGNAL(visibleChanged(bool)), this, SLOT(plotVisibleChanged(bool)) ); + + //range breaks + connect( m_plot, SIGNAL(xRangeBreakingEnabledChanged(bool)), this, SLOT(plotXRangeBreakingEnabledChanged(bool)) ); + connect( m_plot, SIGNAL(xRangeBreaksChanged(CartesianPlot::RangeBreaks)), this, SLOT(plotXRangeBreaksChanged(CartesianPlot::RangeBreaks)) ); + connect( m_plot, SIGNAL(yRangeBreakingEnabledChanged(bool)), this, SLOT(plotYRangeBreakingEnabledChanged(bool)) ); + connect( m_plot, SIGNAL(yRangeBreaksChanged(CartesianPlot::RangeBreaks)), this, SLOT(plotYRangeBreaksChanged(CartesianPlot::RangeBreaks)) ); + + // Plot Area + connect( m_plot->plotArea(), SIGNAL(backgroundTypeChanged(PlotArea::BackgroundType)), this, SLOT(plotBackgroundTypeChanged(PlotArea::BackgroundType)) ); + connect( m_plot->plotArea(), SIGNAL(backgroundColorStyleChanged(PlotArea::BackgroundColorStyle)), this, SLOT(plotBackgroundColorStyleChanged(PlotArea::BackgroundColorStyle)) ); + connect( m_plot->plotArea(), SIGNAL(backgroundImageStyleChanged(PlotArea::BackgroundImageStyle)), this, SLOT(plotBackgroundImageStyleChanged(PlotArea::BackgroundImageStyle)) ); + connect( m_plot->plotArea(), SIGNAL(backgroundBrushStyleChanged(Qt::BrushStyle)), this, SLOT(plotBackgroundBrushStyleChanged(Qt::BrushStyle)) ); + connect( m_plot->plotArea(), SIGNAL(backgroundFirstColorChanged(QColor&)), this, SLOT(plotBackgroundFirstColorChanged(QColor&)) ); + connect( m_plot->plotArea(), SIGNAL(backgroundSecondColorChanged(QColor&)), this, SLOT(plotBackgroundSecondColorChanged(QColor&)) ); + connect( m_plot->plotArea(), SIGNAL(backgroundFileNameChanged(QString&)), this, SLOT(plotBackgroundFileNameChanged(QString&)) ); + connect( m_plot->plotArea(), SIGNAL(backgroundOpacityChanged(float)), this, SLOT(plotBackgroundOpacityChanged(float)) ); + connect( m_plot->plotArea(), SIGNAL(borderPenChanged(QPen&)), this, SLOT(plotBorderPenChanged(QPen&)) ); + connect( m_plot->plotArea(), SIGNAL(borderOpacityChanged(float)), this, SLOT(plotBorderOpacityChanged(float)) ); + connect( m_plot, SIGNAL(horizontalPaddingChanged(float)), this, SLOT(plotHorizontalPaddingChanged(float)) ); + connect( m_plot, SIGNAL(verticalPaddingChanged(float)), this, SLOT(plotVerticalPaddingChanged(float)) ); - //SIGNALs/SLOTs - connect( m_plot, SIGNAL(aspectDescriptionChanged(const AbstractAspect*)), this, SLOT(plotDescriptionChanged(const AbstractAspect*)) ); - connect( m_plot, SIGNAL(rectChanged(QRectF&)), this, SLOT(plotRectChanged(QRectF&)) ); - connect( m_plot, SIGNAL(xMinChanged(float)), this, SLOT(plotXMinChanged(float)) ); - connect( m_plot, SIGNAL(xMaxChanged(float)), this, SLOT(plotXMaxChanged(float)) ); - connect( m_plot, SIGNAL(xScaleChanged(int)), this, SLOT(plotXScaleChanged(int)) ); - connect( m_plot, SIGNAL(xAutoScaleChanged(bool)), this, SLOT(plotXAutoScaleChanged(bool)) ); - connect( m_plot, SIGNAL(yMinChanged(float)), this, SLOT(plotYMinChanged(float)) ); - connect( m_plot, SIGNAL(yMaxChanged(float)), this, SLOT(plotYMaxChanged(float)) ); - connect( m_plot, SIGNAL(yScaleChanged(int)), this, SLOT(plotYScaleChanged(int)) ); - connect( m_plot, SIGNAL(yAutoScaleChanged(bool)), this, SLOT(plotYAutoScaleChanged(bool)) ); - connect( m_plot, SIGNAL(xScaleBreakingsChanged(CartesianPlot::ScaleBreakings)), this, SLOT(plotXScaleBreakingChanged(CartesianPlot::ScaleBreakings)) ); - connect( m_plot, SIGNAL(yScaleBreakingsChanged(CartesianPlot::ScaleBreakings)), this, SLOT(plotYScaleBreakingChanged(CartesianPlot::ScaleBreakings)) ); - connect( m_plot, SIGNAL(visibleChanged(bool)), this, SLOT(plotVisibleChanged(bool)) ); - - // Plot Area - connect( m_plot->plotArea(), SIGNAL(backgroundTypeChanged(PlotArea::BackgroundType)), this, SLOT(plotBackgroundTypeChanged(PlotArea::BackgroundType)) ); - connect( m_plot->plotArea(), SIGNAL(backgroundColorStyleChanged(PlotArea::BackgroundColorStyle)), this, SLOT(plotBackgroundColorStyleChanged(PlotArea::BackgroundColorStyle)) ); - connect( m_plot->plotArea(), SIGNAL(backgroundImageStyleChanged(PlotArea::BackgroundImageStyle)), this, SLOT(plotBackgroundImageStyleChanged(PlotArea::BackgroundImageStyle)) ); - connect( m_plot->plotArea(), SIGNAL(backgroundBrushStyleChanged(Qt::BrushStyle)), this, SLOT(plotBackgroundBrushStyleChanged(Qt::BrushStyle)) ); - connect( m_plot->plotArea(), SIGNAL(backgroundFirstColorChanged(QColor&)), this, SLOT(plotBackgroundFirstColorChanged(QColor&)) ); - connect( m_plot->plotArea(), SIGNAL(backgroundSecondColorChanged(QColor&)), this, SLOT(plotBackgroundSecondColorChanged(QColor&)) ); - connect( m_plot->plotArea(), SIGNAL(backgroundFileNameChanged(QString&)), this, SLOT(plotBackgroundFileNameChanged(QString&)) ); - connect( m_plot->plotArea(), SIGNAL(backgroundOpacityChanged(float)), this, SLOT(plotBackgroundOpacityChanged(float)) ); - connect( m_plot->plotArea(), SIGNAL(borderPenChanged(QPen&)), this, SLOT(plotBorderPenChanged(QPen&)) ); - connect( m_plot->plotArea(), SIGNAL(borderOpacityChanged(float)), this, SLOT(plotBorderOpacityChanged(float)) ); - connect( m_plot, SIGNAL(horizontalPaddingChanged(float)), this, SLOT(plotHorizontalPaddingChanged(float)) ); - connect( m_plot, SIGNAL(verticalPaddingChanged(float)), this, SLOT(plotVerticalPaddingChanged(float)) ); - - m_initializing = false; - } - - void CartesianPlotDock::activateTitleTab(){ + m_initializing = false; + } + + void CartesianPlotDock::activateTitleTab() { ui.tabWidget->setCurrentWidget(ui.tabTitle); } //************************************************************ //**** SLOTs for changes triggered in CartesianPlotDock ****** //************************************************************ - void CartesianPlotDock::retranslateUi(){ + void CartesianPlotDock::retranslateUi() { m_initializing = true; + //general + ui.cbXScaling->addItem( i18n("linear") ); + ui.cbXScaling->addItem( i18n("log(x)") ); + ui.cbXScaling->addItem( i18n("log2(x)") ); + ui.cbXScaling->addItem( i18n("ln(x)") ); + + ui.cbYScaling->addItem( i18n("linear") ); + ui.cbYScaling->addItem( i18n("log(y)") ); + ui.cbYScaling->addItem( i18n("log2(y)") ); + ui.cbYScaling->addItem( i18n("ln(y)") ); + + //scale breakings + ui.cbXBreakStyle->addItem( i18n("simple") ); + ui.cbXBreakStyle->addItem( i18n("vertical") ); + ui.cbXBreakStyle->addItem( i18n("sloped") ); + + ui.cbYBreakStyle->addItem( i18n("simple") ); + ui.cbYBreakStyle->addItem( i18n("vertical") ); + ui.cbYBreakStyle->addItem( i18n("sloped") ); + + //plot area + ui.cbBackgroundType->addItem(i18n("color")); + ui.cbBackgroundType->addItem(i18n("image")); + ui.cbBackgroundType->addItem(i18n("pattern")); + + ui.cbBackgroundColorStyle->addItem(i18n("single color")); + ui.cbBackgroundColorStyle->addItem(i18n("horizontal linear gradient")); + ui.cbBackgroundColorStyle->addItem(i18n("vertical linear gradient")); + ui.cbBackgroundColorStyle->addItem(i18n("diagonal linear gradient (start from top left)")); + ui.cbBackgroundColorStyle->addItem(i18n("diagonal linear gradient (start from bottom left)")); + ui.cbBackgroundColorStyle->addItem(i18n("radial gradient")); + + ui.cbBackgroundImageStyle->addItem(i18n("scaled and cropped")); + ui.cbBackgroundImageStyle->addItem(i18n("scaled")); + ui.cbBackgroundImageStyle->addItem(i18n("scaled, keep proportions")); + ui.cbBackgroundImageStyle->addItem(i18n("centered")); + ui.cbBackgroundImageStyle->addItem(i18n("tiled")); + ui.cbBackgroundImageStyle->addItem(i18n("center tiled")); + + GuiTools::updatePenStyles(ui.cbBorderStyle, Qt::black); + GuiTools::updateBrushStyles(ui.cbBackgroundBrushStyle, Qt::SolidPattern); + - m_initializing = false; + //general + ui.cbXScaling->addItem( i18n("linear") ); + ui.cbXScaling->addItem( i18n("log(x)") ); + ui.cbXScaling->addItem( i18n("log2(x)") ); + ui.cbXScaling->addItem( i18n("ln(x)") ); + + ui.cbYScaling->addItem( i18n("linear") ); + ui.cbYScaling->addItem( i18n("log(y)") ); + ui.cbYScaling->addItem( i18n("log2(y)") ); + ui.cbYScaling->addItem( i18n("ln(y)") ); + + //scale breakings + ui.cbXBreakStyle->addItem( i18n("simple") ); + ui.cbXBreakStyle->addItem( i18n("vertical") ); + ui.cbXBreakStyle->addItem( i18n("sloped") ); + + ui.cbYBreakStyle->addItem( i18n("simple") ); + ui.cbYBreakStyle->addItem( i18n("vertical") ); + ui.cbYBreakStyle->addItem( i18n("sloped") ); + + //plot area + ui.cbBackgroundType->addItem(i18n("color")); + ui.cbBackgroundType->addItem(i18n("image")); + ui.cbBackgroundType->addItem(i18n("pattern")); + + ui.cbBackgroundColorStyle->addItem(i18n("single color")); + ui.cbBackgroundColorStyle->addItem(i18n("horizontal linear gradient")); + ui.cbBackgroundColorStyle->addItem(i18n("vertical linear gradient")); + ui.cbBackgroundColorStyle->addItem(i18n("diagonal linear gradient (start from top left)")); + ui.cbBackgroundColorStyle->addItem(i18n("diagonal linear gradient (start from bottom left)")); + ui.cbBackgroundColorStyle->addItem(i18n("radial gradient")); + + ui.cbBackgroundImageStyle->addItem(i18n("scaled and cropped")); + ui.cbBackgroundImageStyle->addItem(i18n("scaled")); + ui.cbBackgroundImageStyle->addItem(i18n("scaled, keep proportions")); + ui.cbBackgroundImageStyle->addItem(i18n("centered")); + ui.cbBackgroundImageStyle->addItem(i18n("tiled")); + ui.cbBackgroundImageStyle->addItem(i18n("center tiled")); + + GuiTools::updatePenStyles(ui.cbBorderStyle, Qt::black); + GuiTools::updateBrushStyles(ui.cbBackgroundBrushStyle, Qt::SolidPattern); + + m_initializing = false; } // "General"-tab @@@ -422,23 -416,23 +458,23 @@@ void CartesianPlotDock::autoScaleXChang ui.kleXMin->setEnabled(!checked); ui.kleXMax->setEnabled(!checked); - if (m_initializing) - return; + if (m_initializing) + return; - foreach(CartesianPlot* plot, m_plotList) - plot->setAutoScaleX(checked); + foreach(CartesianPlot* plot, m_plotList) + plot->setAutoScaleX(checked); } - void CartesianPlotDock::xMinChanged(){ + void CartesianPlotDock::xMinChanged() { if (m_initializing) return; - float value = ui.kleXMin->text().toDouble(); - foreach(CartesianPlot* plot, m_plotList) - plot->setXMin(value); + float value = ui.kleXMin->text().toDouble(); + foreach(CartesianPlot* plot, m_plotList) + plot->setXMin(value); } - void CartesianPlotDock::xMaxChanged(){ + void CartesianPlotDock::xMaxChanged() { if (m_initializing) return; @@@ -463,23 -457,23 +499,23 @@@ void CartesianPlotDock::autoScaleYChang ui.kleYMin->setEnabled(!checked); ui.kleYMax->setEnabled(!checked); - if (m_initializing) - return; + if (m_initializing) + return; - foreach(CartesianPlot* plot, m_plotList) - plot->setAutoScaleY(checked); + foreach(CartesianPlot* plot, m_plotList) + plot->setAutoScaleY(checked); } - void CartesianPlotDock::yMinChanged(){ + void CartesianPlotDock::yMinChanged() { if (m_initializing) return; - float value = ui.kleYMin->text().toDouble(); - foreach(CartesianPlot* plot, m_plotList) - plot->setYMin(value); + float value = ui.kleYMin->text().toDouble(); + foreach(CartesianPlot* plot, m_plotList) + plot->setYMin(value); } - void CartesianPlotDock::yMaxChanged(){ + void CartesianPlotDock::yMaxChanged() { if (m_initializing) return; @@@ -698,15 -817,14 +859,14 @@@ void CartesianPlotDock::backgroundColor ui.cbBackgroundBrushStyle->hide(); } - if (m_initializing) - return; + if (m_initializing) + return; - foreach(CartesianPlot* plot, m_plotList){ + foreach(CartesianPlot* plot, m_plotList) plot->plotArea()->setBackgroundColorStyle(style); - } } - void CartesianPlotDock::backgroundImageStyleChanged(int index){ + void CartesianPlotDock::backgroundImageStyleChanged(int index) { if (m_initializing) return; @@@ -770,11 -884,11 +926,11 @@@ void CartesianPlotDock::selectFile() ui.kleBackgroundFileName->setText( path ); - foreach(CartesianPlot* plot, m_plotList) - plot->plotArea()->setBackgroundFileName(path); + foreach(CartesianPlot* plot, m_plotList) + plot->plotArea()->setBackgroundFileName(path); } - void CartesianPlotDock::fileNameChanged(){ + void CartesianPlotDock::fileNameChanged() { if (m_initializing) return; @@@ -839,20 -952,20 +994,20 @@@ void CartesianPlotDock::borderCornerRad if (m_initializing) return; - foreach(CartesianPlot* plot, m_plotList) - plot->plotArea()->setBorderCornerRadius(Worksheet::convertToSceneUnits(value, Worksheet::Centimeter)); + foreach(CartesianPlot* plot, m_plotList) + plot->plotArea()->setBorderCornerRadius(Worksheet::convertToSceneUnits(value, Worksheet::Centimeter)); } - void CartesianPlotDock::borderOpacityChanged(int value){ + void CartesianPlotDock::borderOpacityChanged(int value) { if (m_initializing) return; - qreal opacity = (float)value/100.; - foreach(CartesianPlot* plot, m_plotList) - plot->plotArea()->setBorderOpacity(opacity); + qreal opacity = (float)value/100.; + foreach(CartesianPlot* plot, m_plotList) + plot->plotArea()->setBorderOpacity(opacity); } - void CartesianPlotDock::horizontalPaddingChanged(double value){ + void CartesianPlotDock::horizontalPaddingChanged(double value) { if (m_initializing) return; @@@ -873,19 -986,19 +1028,19 @@@ void CartesianPlotDock::verticalPadding //************************************************************* //general void CartesianPlotDock::plotDescriptionChanged(const AbstractAspect* aspect) { - if (m_plot != aspect) - return; - - m_initializing = true; - if (aspect->name() != ui.leName->text()) { - ui.leName->setText(aspect->name()); - } else if (aspect->comment() != ui.leComment->text()) { - ui.leComment->setText(aspect->comment()); - } - m_initializing = false; + if (m_plot != aspect) + return; + + m_initializing = true; + if (aspect->name() != ui.leName->text()) { + ui.leName->setText(aspect->name()); + } else if (aspect->comment() != ui.leComment->text()) { + ui.leComment->setText(aspect->comment()); + } + m_initializing = false; } - void CartesianPlotDock::plotRectChanged(QRectF& rect){ + void CartesianPlotDock::plotRectChanged(QRectF& rect) { m_initializing = true; ui.sbLeft->setValue(Worksheet::convertFromSceneUnits(rect.x(), Worksheet::Centimeter)); ui.sbTop->setValue(Worksheet::convertFromSceneUnits(rect.y(), Worksheet::Centimeter)); @@@ -1047,26 -1171,26 +1213,26 @@@ void CartesianPlotDock::plotVerticalPad //******************** SETTINGS ******************************* //************************************************************* void CartesianPlotDock::loadConfigFromTemplate(KConfig& config) { - //extract the name of the template from the file name - QString name; - int index = config.name().lastIndexOf(QDir::separator()); - if (index!=-1) - name = config.name().right(config.name().size() - index - 1); - else - name = config.name(); + //extract the name of the template from the file name + QString name; + int index = config.name().lastIndexOf(QDir::separator()); + if (index!=-1) + name = config.name().right(config.name().size() - index - 1); + else + name = config.name(); - int size = m_plotList.size(); - if (size>1) - m_plot->beginMacro(i18n("%1 cartesian plots: template \"%2\" loaded", size, name)); - else - m_plot->beginMacro(i18n("%1: template \"%2\" loaded", m_plot->name(), name)); + int size = m_plotList.size(); + if (size>1) + m_plot->beginMacro(i18n("%1 cartesian plots: template \"%2\" loaded", size, name)); + else + m_plot->beginMacro(i18n("%1: template \"%2\" loaded", m_plot->name(), name)); - this->loadConfig(config); + this->loadConfig(config); - m_plot->endMacro(); + m_plot->endMacro(); } - void CartesianPlotDock::load(){ + void CartesianPlotDock::load() { //General-tab ui.chkVisible->setChecked(m_plot->isVisible()); ui.sbLeft->setValue(Worksheet::convertFromSceneUnits(m_plot->rect().x(), Worksheet::Centimeter)); @@@ -1205,33 -1340,32 +1382,32 @@@ void CartesianPlotDock::saveConfigAsTem // group.writeEntry("yMax", ui.kleYMax->text()); // group.writeEntry("yScale", ui.cbYScaling->currentIndex()); - //Title - KConfigGroup group = config.group("PlotTitle"); - labelWidget->saveConfig(group); - - //Scale breakings - //TODO - - //Background - group = config.group("PlotArea"); - group.writeEntry("BackgroundType", ui.cbBackgroundType->currentIndex()); - group.writeEntry("BackgroundColorStyle", ui.cbBackgroundColorStyle->currentIndex()); - group.writeEntry("BackgroundImageStyle", ui.cbBackgroundImageStyle->currentIndex()); - group.writeEntry("BackgroundBrushStyle", ui.cbBackgroundBrushStyle->currentIndex()); - group.writeEntry("BackgroundFileName", ui.kleBackgroundFileName->text()); - group.writeEntry("BackgroundFirstColor", ui.kcbBackgroundFirstColor->color()); - group.writeEntry("BackgroundSecondColor", ui.kcbBackgroundSecondColor->color()); - group.writeEntry("BackgroundOpacity", ui.sbBackgroundOpacity->value()/100.0); - group.writeEntry("HorizontalPadding", Worksheet::convertToSceneUnits(ui.sbPaddingHorizontal->value(), Worksheet::Centimeter)); - group.writeEntry("VerticalPadding", Worksheet::convertToSceneUnits(ui.sbPaddingVertical->value(), Worksheet::Centimeter)); - - //Border - group.writeEntry("BorderStyle", ui.cbBorderStyle->currentIndex()); - group.writeEntry("BorderColor", ui.kcbBorderColor->color()); - group.writeEntry("BorderWidth", Worksheet::convertToSceneUnits(ui.sbBorderWidth->value(), Worksheet::Point)); - group.writeEntry("BorderCornerRadius", Worksheet::convertToSceneUnits(ui.sbBorderCornerRadius->value(), Worksheet::Centimeter)); - group.writeEntry("BorderOpacity", ui.sbBorderOpacity->value()/100.0); - - config.sync(); + //Title + KConfigGroup group = config.group("PlotTitle"); + labelWidget->saveConfig(group); + + //Scale breakings + //TODO + + //Background + group = config.group("PlotArea"); + group.writeEntry("BackgroundType", ui.cbBackgroundType->currentIndex()); + group.writeEntry("BackgroundColorStyle", ui.cbBackgroundColorStyle->currentIndex()); + group.writeEntry("BackgroundImageStyle", ui.cbBackgroundImageStyle->currentIndex()); + group.writeEntry("BackgroundBrushStyle", ui.cbBackgroundBrushStyle->currentIndex()); + group.writeEntry("BackgroundFileName", ui.kleBackgroundFileName->text()); + group.writeEntry("BackgroundFirstColor", ui.kcbBackgroundFirstColor->color()); + group.writeEntry("BackgroundSecondColor", ui.kcbBackgroundSecondColor->color()); + group.writeEntry("BackgroundOpacity", ui.sbBackgroundOpacity->value()/100.0); + group.writeEntry("HorizontalPadding", Worksheet::convertToSceneUnits(ui.sbPaddingHorizontal->value(), Worksheet::Centimeter)); + group.writeEntry("VerticalPadding", Worksheet::convertToSceneUnits(ui.sbPaddingVertical->value(), Worksheet::Centimeter)); + + //Border + group.writeEntry("BorderStyle", ui.cbBorderStyle->currentIndex()); + group.writeEntry("BorderColor", ui.kcbBorderColor->color()); + group.writeEntry("BorderWidth", Worksheet::convertToSceneUnits(ui.sbBorderWidth->value(), Worksheet::Point)); + group.writeEntry("BorderCornerRadius", Worksheet::convertToSceneUnits(ui.sbBorderCornerRadius->value(), Worksheet::Centimeter)); + group.writeEntry("BorderOpacity", ui.sbBorderOpacity->value()/100.0); + + config.sync(); } - diff --cc src/kdefrontend/dockwidgets/XYCurveDock.cpp index dfbb2e2,7d21920..4843568 --- a/src/kdefrontend/dockwidgets/XYCurveDock.cpp +++ b/src/kdefrontend/dockwidgets/XYCurveDock.cpp @@@ -488,7 -488,10 +488,10 @@@ void XYCurveDock::init() void XYCurveDock::setModel() { QList<const char*> list; - list<<"Folder"<<"Workbook"<<"Datapicker"<<"DatapickerCurve"<<"Spreadsheet"<<"FileDataSource"<<"Column"<<"Worksheet"<<"CartesianPlot"<<"XYFitCurve"<<"CantorWorksheet"; + list<<"Folder"<<"Workbook"<<"Datapicker"<<"DatapickerCurve"<<"Spreadsheet" - <<"FileDataSource"<<"Column"<<"Worksheet"<<"CartesianPlot" ++ <<"FileDataSource"<<"Column"<<"Worksheet"<<"CartesianPlot"<<"CantorWorksheet" + <<"XYInterpolationCurve"<<"XYFitCurve"<<"XYFourierFilterCurve"; + if (cbXColumn) { cbXColumn->setTopLevelClasses(list); cbYColumn->setTopLevelClasses(list); diff --cc src/kdefrontend/labplot2ui.rc index 804829b,79108dd..5080a97 --- a/src/kdefrontend/labplot2ui.rc +++ b/src/kdefrontend/labplot2ui.rc @@@ -70,9 -62,8 +70,9 @@@ <Menu name="spreadsheet"><text>&Spreadsheet</text></Menu> <Menu name="matrix"><text>&Matrix</text></Menu> <Menu name="worksheet"><text>&Worksheet</text></Menu> +<Menu name="casWorksheet"><text>&CAS Worksheet</text></Menu> + <Menu name="analysis"><text>&Analysis</text></Menu> <Menu name="datapicker"><text>&Datapicker</text></Menu> - <!-- <Menu name="analysis"><text>&Analysis</text></Menu> --> <!-- <Menu name="drawing"><text>&Drawing</text></Menu> --> <!-- <Menu name="script"><text>&Script</text></Menu> --> <Menu name="windows"><text>&Windows</text> diff --cc src/kdefrontend/spreadsheet/ExportSpreadsheetDialog.cpp index 0a5a64b,47bc8b8..6bf1fcd --- a/src/kdefrontend/spreadsheet/ExportSpreadsheetDialog.cpp +++ b/src/kdefrontend/spreadsheet/ExportSpreadsheetDialog.cpp @@@ -77,9 -77,10 +77,10 @@@ ExportSpreadsheetDialog::ExportSpreadsh connect( ui.bOpen, SIGNAL(clicked()), this, SLOT (selectFile()) ); connect( ui.kleFileName, SIGNAL(textChanged(QString)), this, SLOT(fileNameChanged(QString)) ); connect(this,SIGNAL(user1Clicked()), this, SLOT(toggleOptions())); + connect(ui.cbFormat, SIGNAL(currentIndexChanged(int)), this, SLOT(formatChanged(int))); setCaption(i18n("Export spreadsheet")); - setWindowIcon(QIcon::fromTheme("document-export-database")); + setWindowIcon(QIcon::fromTheme("document-export-database")); //restore saved settings KConfigGroup conf(KSharedConfig::openConfig(), "ExportSpreadsheetDialog"); diff --cc src/kdefrontend/widgets/LabelWidget.cpp index 803235e,a220db2..9c1d1a2 --- a/src/kdefrontend/widgets/LabelWidget.cpp +++ b/src/kdefrontend/widgets/LabelWidget.cpp @@@ -127,14 -128,17 +128,17 @@@ LabelWidget::LabelWidget(QWidget *paren } void LabelWidget::setLabels(QList<TextLabel*> labels){ - m_labelsList = labels; - m_label = labels.first(); + m_labelsList = labels; + m_label = labels.first(); - ui.lOffset->hide(); - ui.sbOffset->hide(); + ui.lOffsetX->hide(); + ui.lOffsetY->hide(); + + ui.sbOffsetX->hide(); + ui.sbOffsetY->hide(); - this->load(); - initConnections(); + this->load(); + initConnections(); } void LabelWidget::setAxes(QList<Axis*> axes){ @@@ -434,19 -443,18 +443,18 @@@ void LabelWidget::insertDateTime(QActio */ void LabelWidget::positionXChanged(int index){ //Enable/disable the spinbox for the x- oordinates if the "custom position"-item is selected/deselected - if (index == ui.cbPositionX->count()-1 ){ + if (index == ui.cbPositionX->count()-1 ) ui.sbPositionX->setEnabled(true); - }else{ + else ui.sbPositionX->setEnabled(false); - } - if (m_initializing) - return; + if (m_initializing) + return; - TextLabel::PositionWrapper position = m_label->position(); - position.horizontalPosition = TextLabel::HorizontalPosition(index); - foreach(TextLabel* label, m_labelsList) - label->setPosition(position); + TextLabel::PositionWrapper position = m_label->position(); + position.horizontalPosition = TextLabel::HorizontalPosition(index); + foreach(TextLabel* label, m_labelsList) + label->setPosition(position); } /*! @@@ -506,14 -514,14 +514,14 @@@ void LabelWidget::verticalAlignmentChan } void LabelWidget::rotationChanged(int value){ - if (m_initializing) - return; + if (m_initializing) + return; - foreach(TextLabel* label, m_labelsList) - label->setRotationAngle(value); + foreach(TextLabel* label, m_labelsList) + label->setRotationAngle(value); } - void LabelWidget::offsetChanged(double value){ + void LabelWidget::offsetXChanged(double value){ if (m_initializing) return; @@@ -576,14 -592,20 +592,20 @@@ void LabelWidget::labelHorizontalAlignm } void LabelWidget::labelVerticalAlignmentChanged(TextLabel::VerticalAlignment index){ - m_initializing = true; - ui.cbVerticalAlignment->setCurrentIndex(index); - m_initializing = false; + m_initializing = true; + ui.cbVerticalAlignment->setCurrentIndex(index); + m_initializing = false; } - void LabelWidget::labelOffsetChanged(float offset){ + void LabelWidget::labelOffsetxChanged(float offset){ m_initializing = true; - ui.sbOffset->setValue(Worksheet::convertFromSceneUnits(offset, Worksheet::Point)); + ui.sbOffsetX->setValue(Worksheet::convertFromSceneUnits(offset, Worksheet::Point)); + m_initializing = false; + } + + void LabelWidget::labelOffsetyChanged(float offset){ + m_initializing = true; + ui.sbOffsetY->setValue(Worksheet::convertFromSceneUnits(offset, Worksheet::Point)); m_initializing = false; } _______________________________________________ kde-doc-english mailing list [email protected] https://mail.kde.org/mailman/listinfo/kde-doc-english
