Git commit 8f78e6e92f3ca7831486a5b9f9e89dc603f7c790 by Stefan Gerlach. Committed on 14/10/2016 at 16:02. Pushed by sgerlach into branch 'frameworks'.
fixed merge conflicts M +1 -1 CMakeLists.txt M +1 -0 INSTALL M +33 -10 doc/index.docbook M +7 -2 src/CMakeLists.txt M +5 -0 src/backend/core/Project.cpp M +4 -3 src/backend/gsl/ExpressionParser.cpp M +324 -334 src/backend/worksheet/Worksheet.cpp M +14 -0 src/backend/worksheet/plots/cartesian/CartesianPlot.cpp M +64 -207 src/backend/worksheet/plots/cartesian/XYCurve.cpp M +27 -75 src/backend/worksheet/plots/cartesian/XYDataReductionCurve.cpp M +20 -38 src/backend/worksheet/plots/cartesian/XYDifferentiationCurve.cpp M +6 -20 src/backend/worksheet/plots/cartesian/XYEquationCurve.cpp M +118 -154 src/backend/worksheet/plots/cartesian/XYFitCurve.cpp M +28 -71 src/backend/worksheet/plots/cartesian/XYFourierFilterCurve.cpp M +22 -57 src/backend/worksheet/plots/cartesian/XYFourierTransformCurve.cpp M +30 -80 src/backend/worksheet/plots/cartesian/XYInterpolationCurve.cpp M +26 -73 src/backend/worksheet/plots/cartesian/XYSmoothCurve.cpp M +35 -3 src/commonfrontend/worksheet/WorksheetView.cpp M +3 -0 src/commonfrontend/worksheet/WorksheetView.h M +37 -40 src/kdefrontend/GuiObserver.cpp M +1 -1 src/kdefrontend/HistoryDialog.cpp M +15 -19 src/kdefrontend/MainWin.cpp M +2 -0 src/kdefrontend/MainWin.h M +1 -0 src/kdefrontend/SettingsDialog.cpp M +45 -0 src/kdefrontend/SettingsGeneralPage.cpp M +3 -2 src/kdefrontend/datasources/ImportFileDialog.cpp M +449 -455 src/kdefrontend/dockwidgets/XYCurveDock.cpp M +56 -2 src/kdefrontend/dockwidgets/XYDataReductionCurveDock.cpp M +49 -1 src/kdefrontend/dockwidgets/XYDifferentiationCurveDock.cpp M +91 -20 src/kdefrontend/dockwidgets/XYFitCurveDock.cpp M +51 -0 src/kdefrontend/dockwidgets/XYFourierFilterCurveDock.cpp M +53 -2 src/kdefrontend/dockwidgets/XYFourierTransformCurveDock.cpp M +49 -0 src/kdefrontend/dockwidgets/XYInterpolationCurveDock.cpp M +49 -0 src/kdefrontend/dockwidgets/XYSmoothCurveDock.cpp M +20 -5 src/tools/TeXRenderer.cpp http://commits.kde.org/labplot/8f78e6e92f3ca7831486a5b9f9e89dc603f7c790 diff --cc CMakeLists.txt index e7c6cb6,2d0c80e..98c901d --- a/CMakeLists.txt +++ b/CMakeLists.txt @@@ -4,19 -4,17 +4,19 @@@ cmake_minimum_required(VERSION 2.8.12 find_package(ECM 1.3.0 REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) -find_package(Qt4 REQUIRED) -find_package(KDE4 REQUIRED) +find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Widgets Svg Concurrent) +find_package(KF5 REQUIRED COMPONENTS I18n KDELibs4Support NewStuff) +include(FeatureSummary) include(ECMInstallIcons) include(KDEInstallDirs) -include(KDE4Defaults) +include(KDECompilerSettings) +include(KDECMakeSettings) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wundef -Wpointer-arith -Wcast-align -Wunreachable-code -Wunused -fno-omit-frame-pointer -fstack-protector -fno-exceptions") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O2 -Wall -Wextra -Wundef -Wpointer-arith -Wcast-align -Wunreachable-code -Wunused -fno-omit-frame-pointer -fstack-protector -fno-exceptions") -add_definitions (${QT_DEFINITIONS} ${QT_QTDBUS_DEFINITIONS} ${KDE4_DEFINITIONS}) -include_directories (${QDBUS_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDE4_INCLUDES}) +add_definitions (${QT_DEFINITIONS} ${QT_QTDBUS_DEFINITIONS}) +include_directories (${QDBUS_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR}) set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH}) add_definitions (-DLVERSION=\"2.3.0\") # add_definitions (-DLDEBUG='1') diff --cc doc/index.docbook index 700ef48,ce2dda7..e87a291 --- a/doc/index.docbook +++ b/doc/index.docbook @@@ -96,12 -89,8 +96,12 @@@ Features <listitem><para>Cartesian plots, created either from imported or manually created data sets or via mathematical equation</para></listitem> <listitem><para>Definition of mathematical formulas is supported by syntax-highlighting and completion and by the list of thematicaly grouped mathematical and physical constants and functions</para></listitem> <listitem><para>Investigation of plotted data is supported by many zooming and navigation features</para></listitem> - <listitem><para>Several analysis functions and methods for data reduction, differentiation, interpolation, smoothing, (nonlinear) fitting, Fourier filter and Fourier transform</para></listitem> + <listitem><para>Several analysis functions and methods for data reduction, differentiation, integration, interpolation, smoothing, (nonlinear) fitting, Fourier filter and Fourier transform</para></listitem> <listitem><para>Linear and non-linear fits to data, several fit-models are predefined and custom models with arbitrary number of parameters can be provided</para></listitem> +<listitem><para>Supports many CAS backends like Maxima, Python, KAlgebra, Sage</para></listitem> +<listitem><para>Nice Worksheet view for evaluating expressions</para></listitem> +<listitem><para>Easy plugin based structure to add different Backends</para></listitem> +<listitem><para>Plugin based assistant dialogs for common tasks (like integrating a function or entering a matrix)</para></listitem> <listitem><para>Datapicker for manual or (semi-)automatic data extraction from imported images containing plots and curves.</para></listitem> </itemizedlist> </para> diff --cc src/CMakeLists.txt index 03f459b,de544ee..0123b25 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@@ -272,10 -263,9 +277,10 @@@ ENDIF (HDF5_FOUND ############## installation ################################ -install(TARGETS labplot2 DESTINATION ${BIN_INSTALL_DIR}) -install(FILES ${KDEFRONTEND_DIR}/labplot2ui.rc ${KDEFRONTEND_DIR}/splash.png DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}) +install(TARGETS labplot2 DESTINATION ${INSTALL_TARGETS_DEFAULT_ARGS}) +install(FILES ${KDEFRONTEND_DIR}/labplot2ui.rc DESTINATION ${KXMLGUI_INSTALL_DIR}/${PROJECT_NAME}) +install(FILES ${KDEFRONTEND_DIR}/labplot2ui.rc ${KDEFRONTEND_DIR}/splash.png ${KDEFRONTEND_DIR}/labplot2.ico DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}) install(PROGRAMS labplot2.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} ) install( FILES labplot2.xml DESTINATION ${XDG_MIME_INSTALL_DIR} ) - install( FILES labplot2_themes.knsrc DESTINATION ${KDE_INSTALL_CONFDIR} ) + install( FILES labplot2_themes.knsrc DESTINATION ${CONFIG_INSTALL_DIR} ) update_xdg_mimetypes( ${XDG_MIME_INSTALL_DIR} ) diff --cc src/backend/worksheet/Worksheet.cpp index ef5cf78,9210a3b..922d11b --- a/src/backend/worksheet/Worksheet.cpp +++ b/src/backend/worksheet/Worksheet.cpp @@@ -40,10 -40,8 +40,8 @@@ #include <QPrintDialog> #include <QPrintPreviewDialog> -#include <KIcon> +#include "QIcon" #include <KConfigGroup> - #include <KLocale> - #include <QDebug> #include <cmath> /** @@@ -142,14 -142,12 +142,12 @@@ float Worksheet::convertFromSceneUnits( return 0; } - //! Return an icon to be used for decorating my views. QIcon Worksheet::icon() const { - return KIcon("labplot-worksheet"); + return QIcon::fromTheme("labplot-worksheet"); } - //! Return a new context menu. /** - * The caller takes ownership of the menu. + * Return a new context menu. The caller takes ownership of the menu. */ QMenu *Worksheet::createContextMenu() { QMenu *menu = AbstractPart::createContextMenu(); diff --cc src/backend/worksheet/plots/cartesian/XYInterpolationCurve.cpp index c83aca8,671be4c..9137b80 --- a/src/backend/worksheet/plots/cartesian/XYInterpolationCurve.cpp +++ b/src/backend/worksheet/plots/cartesian/XYInterpolationCurve.cpp @@@ -46,8 -46,10 +46,9 @@@ extern "C" #include <gsl/gsl_interp.h> #include <gsl/gsl_spline.h> #include "backend/nsl/nsl_diff.h" + #include "backend/nsl/nsl_int.h" } -#include <KIcon> #include <KLocale> #include <QElapsedTimer> #include <QThreadPool> diff --cc src/commonfrontend/worksheet/WorksheetView.cpp index b8ecf3a,7fef32c..eb41df5 --- a/src/commonfrontend/worksheet/WorksheetView.cpp +++ b/src/commonfrontend/worksheet/WorksheetView.cpp @@@ -214,24 -215,26 +215,26 @@@ void WorksheetView::initActions() noGridAction->setChecked(true); noGridAction->setData(WorksheetView::NoGrid); - denseLineGridAction = new KAction(i18n("dense line grid"), gridActionGroup); + denseLineGridAction = new QAction(i18n("dense line grid"), gridActionGroup); denseLineGridAction->setCheckable(true); - sparseLineGridAction = new KAction(i18n("sparse line grid"), gridActionGroup); + sparseLineGridAction = new QAction(i18n("sparse line grid"), gridActionGroup); sparseLineGridAction->setCheckable(true); - denseDotGridAction = new KAction(i18n("dense dot grid"), gridActionGroup); + denseDotGridAction = new QAction(i18n("dense dot grid"), gridActionGroup); denseDotGridAction->setCheckable(true); - sparseDotGridAction = new KAction(i18n("sparse dot grid"), gridActionGroup); + sparseDotGridAction = new QAction(i18n("sparse dot grid"), gridActionGroup); sparseDotGridAction->setCheckable(true); - customGridAction = new KAction(i18n("custom grid"), gridActionGroup); + customGridAction = new QAction(i18n("custom grid"), gridActionGroup); customGridAction->setCheckable(true); - snapToGridAction = new KAction(i18n("snap to grid"), this); + snapToGridAction = new QAction(i18n("snap to grid"), this); snapToGridAction->setCheckable(true); + showPresenterMode = new KAction(KIcon("view-fullscreen"), i18n("Show in presenter mode"), this); + //check the action corresponding to the currently active layout in worksheet this->layoutChanged(m_worksheet->layout()); diff --cc src/kdefrontend/HistoryDialog.cpp index ba0e17f,92e1b1d..7b8b057 --- a/src/kdefrontend/HistoryDialog.cpp +++ b/src/kdefrontend/HistoryDialog.cpp @@@ -48,10 -48,10 +48,10 @@@ HistoryDialog::HistoryDialog(QWidget* p "Select an item in the list to navigate to the corresponding step.")); setMainWidget(undoView); - setWindowIcon( KIcon("view-history") ); + setWindowIcon( QIcon::fromTheme("view-history") ); setWindowTitle(i18n("Undo/Redo History")); showButtonSeparator(true); - + setAttribute(Qt::WA_DeleteOnClose); if (stack->count()) { setButtons( KDialog::Ok | KDialog::User1 | KDialog::Cancel ); setButtonToolTip(KDialog::User1, i18n("Clears the undo history. Commands are not undone or redone; the state of the project remains unchanged.")); diff --cc src/kdefrontend/MainWin.cpp index cc2d03d,9d8c1e3..474f67f --- a/src/kdefrontend/MainWin.cpp +++ b/src/kdefrontend/MainWin.cpp @@@ -577,9 -513,8 +578,8 @@@ void MainWin::updateGUI() //We need to set the style explicitly when the toolbar is shown for the first time //(no subgroup in the group "MainWindow" available) //TODO: is this the usual behaviour for toolbars defined in the rc-file? - KConfigGroup group = KGlobal::config()->group("MainWindow"); + KConfigGroup group = KSharedConfig::openConfig()->group("MainWindow"); - //Handle the Worksheet-object Worksheet* w = this->activeWorksheet(); if (w!=0) { @@@ -606,20 -541,20 +606,20 @@@ //populate worksheet-toolbar QToolBar* toolbar=qobject_cast<QToolBar*>(factory->container("worksheet_toolbar", this)); if (group.groupList().indexOf("Toolbar worksheet_toolbar")==-1) - toolbar->setToolButtonStyle(KToolBar::toolButtonStyleSetting()); + toolbar->setToolButtonStyle(Qt::ToolButtonFollowStyle); - toolbar->setVisible(true); toolbar->clear(); view->fillToolBar(toolbar); + toolbar->setVisible(true); //populate the toolbar for cartesian plots toolbar=qobject_cast<QToolBar*>(factory->container("cartesian_plot_toolbar", this)); if (group.groupList().indexOf("Toolbar cartesian_plot_toolbar")==-1) - toolbar->setToolButtonStyle(KToolBar::toolButtonStyleSetting()); + toolbar->setToolButtonStyle(Qt::ToolButtonFollowStyle); - toolbar->setVisible(true); toolbar->clear(); view->fillCartesianPlotToolBar(toolbar); + toolbar->setVisible(true); //hide the spreadsheet toolbar factory->container("spreadsheet_toolbar", this)->setVisible(false); @@@ -703,11 -617,11 +702,11 @@@ //populate spreadsheet-toolbar QToolBar* toolbar=qobject_cast<QToolBar*>(factory->container("datapicker_toolbar", this)); if (group.groupList().indexOf("Toolbar datapicker_toolbar")==-1) - toolbar->setToolButtonStyle(KToolBar::toolButtonStyleSetting()); + toolbar->setToolButtonStyle(Qt::ToolButtonFollowStyle); - toolbar->setVisible(true); toolbar->clear(); view->fillToolBar(toolbar); + toolbar->setVisible(true); } else { factory->container("datapicker", this)->setEnabled(false); factory->container("datapicker_toolbar", this)->setVisible(false); diff --cc src/kdefrontend/SettingsDialog.cpp index ab944ba,b648641..9480492 --- a/src/kdefrontend/SettingsDialog.cpp +++ b/src/kdefrontend/SettingsDialog.cpp @@@ -49,65 -41,44 +49,66 @@@ SettingsDialog::SettingsDialog(QWidget setMinimumSize(QSize(512, minSize.height())); setFaceType(List); - setCaption(i18n("Preferences")); - setWindowIcon(KIcon("preferences-other")); - setButtons(KDialog::Ok | KDialog::Apply | KDialog::Cancel | KDialog::Default); - setDefaultButton(KDialog::Ok); - enableButton(KDialog::Apply, false); - setAttribute(Qt::WA_DeleteOnClose); + setWindowTitle(i18n("Preferences")); + setWindowIcon(QIcon::fromTheme("preferences-other")); + + //setButtons( KDialog::Ok | KDialog::Cancel | KDialog::Apply ); + connect(this, &QDialog::accepted, this, &SettingsDialog::onOkButton); + //connect(this, &KPageDialog::applyClicked, this, &SettingsDialog::onApplyButton); + //TODO: enableButtonApply(false); ++ setAttribute(Qt::WA_DeleteOnClose); generalPage = new SettingsGeneralPage(this); - KPageWidgetItem* generalFrame = addPage(generalPage, i18n("General")); - generalFrame->setIcon(KIcon("system-run")); connect(generalPage, SIGNAL(settingsChanged()), this, SLOT(changed())); + KPageWidgetItem* generalFrame = addPage(generalPage, i18n("General")); + generalFrame->setIcon(QIcon::fromTheme("system-run")); + + //QPushButton* defaultbutton = dialogButtonBox->addButton(QDialogButtonBox::RestoreDefaults); + //connect( defaultbutton, &QAbstractButton::clicked, this, &SettingsDialog::onRestoreDefaultsButton ); - KConfigGroup conf(KSharedConfig::openConfig(), "SettingsDialog"); - restoreDialogSize(conf); + // unused + //QVBoxLayout* layout = new QVBoxLayout; + //layout->addWidget( dialogButtonBox ); + //setLayout( layout ); + +// printingPage = new SettingsPrintingPage(mainWindow, this); +// KPageWidgetItem* printingFrame = addPage(printingPage, i18nc("@title:group", "Print")); +// printingFrame->setIcon(KIcon("document-print")); + + const KConfigGroup dialogConfig = KSharedConfig::openConfig()->group("SettingsDialog"); + KWindowConfig::restoreWindowSize(windowHandle(), dialogConfig); +} + +SettingsDialog::~SettingsDialog(){ + KConfigGroup dialogConfig = KSharedConfig::openConfig()->group("SettingsDialog"); + KWindowConfig::saveWindowSize(windowHandle(), dialogConfig); } -SettingsDialog::~SettingsDialog() { - KConfigGroup conf(KSharedConfig::openConfig(), "SettingsDialog"); - saveDialogSize(conf); +void SettingsDialog::onOkButton(){ + if (m_changed){ + applySettings(); + setWindowTitle(i18n("Preferences")); +// applybutton->setEnabled(false); + } } -void SettingsDialog::slotButtonClicked(int button) { - if ((button == KDialog::Ok) || (button == KDialog::Apply)) { - if (m_changed){ - applySettings(); - setCaption(i18n("Preferences")); - enableButton(KDialog::Apply, false); - } - } else if (button == KDialog::Default) { - const QString text(i18n("All settings will be reset to default values. Do you want to continue?")); - if (KMessageBox::questionYesNo(this, text) == KMessageBox::Yes) { - restoreDefaults(); - setCaption(i18n("Preferences")); - enableButton(KDialog::Apply, false); - } +/*void SettingsDialog::onApplyButton(){ + qDebug()<<"SettingsDialog::onApplyButton()"; +>>>>>>> frameworks + if (m_changed){ + applySettings(); + setWindowTitle(i18n("Preferences")); + applybutton->setEnabled(false); } +}*/ - KPageDialog::slotButtonClicked(button); +void SettingsDialog::onRestoreDefaultsButton(){ + const QString text(i18n("All settings will be reset to default values. Do you want to continue?")); + if (KMessageBox::questionYesNo(this, text) == KMessageBox::Yes) { + restoreDefaults(); + setWindowTitle(i18n("Preferences")); +// applybutton->setEnabled(false); + } } void SettingsDialog::changed() { diff --cc src/kdefrontend/SettingsGeneralPage.cpp index b20307d,8f998cf..9774fdb --- a/src/kdefrontend/SettingsGeneralPage.cpp +++ b/src/kdefrontend/SettingsGeneralPage.cpp @@@ -29,11 -29,16 +29,17 @@@ #include "SettingsGeneralPage.h" #include "MainWin.h" -#include <KDialog> -#include <KLocale> +#include <KLocalizedString> +#include <KConfigGroup> +#include <KSharedConfig> #include <kfiledialog.h> + #if QT_VERSION >= QT_VERSION_CHECK(5,0,0) + #include <QStandardPaths> + #else + #include <KStandardDirs> + #endif + /** * \brief Page for the 'General' settings of the Labplot settings dialog. * diff --cc src/kdefrontend/datasources/ImportFileDialog.cpp index d18442d,a130a81..0948047 --- a/src/kdefrontend/datasources/ImportFileDialog.cpp +++ b/src/kdefrontend/datasources/ImportFileDialog.cpp @@@ -80,10 -78,11 +80,11 @@@ ImportFileDialog::ImportFileDialog(Main connect(this,SIGNAL(user1Clicked()), this, SLOT(toggleOptions())); connect(importFileWidget, SIGNAL(fileNameChanged()), this, SLOT(checkOkButton())); -- connect(importFileWidget, SIGNAL(checkedFitsTableToMatrix()), this, SLOT(checkOnFitsTableToMatrix())); ++ connect(importFileWidget, SIGNAL(checkedFitsTableToMatrix()), this, SLOT(checkOnFitsTableToMatrix())); setCaption(i18n("Import Data to Spreadsheet or Matrix")); - setWindowIcon(QIcon::fromTheme("document-import-database")); - setWindowIcon(KIcon("document-import-database")); - setAttribute(Qt::WA_DeleteOnClose); ++ setWindowIcon(QIcon::fromTheme("document-import-database")); ++ setAttribute(Qt::WA_DeleteOnClose); //restore saved settings KConfigGroup conf(KSharedConfig::openConfig(),"ImportFileDialog"); diff --cc src/kdefrontend/dockwidgets/XYCurveDock.cpp index 992bacd,66e8b0d..5afba52 --- a/src/kdefrontend/dockwidgets/XYCurveDock.cpp +++ b/src/kdefrontend/dockwidgets/XYCurveDock.cpp @@@ -400,10 -399,10 +400,10 @@@ void XYCurveDock::init() pa.translate(iconSize/2,iconSize/2); pa.drawPath(trafo.map(Symbol::pathFromStyle(style))); pa.end(); - ui.cbSymbolStyle->addItem(QIcon(pm), Symbol::nameFromStyle(style)); + ui.cbSymbolStyle->addItem(QIcon(pm), Symbol::nameFromStyle(style)); } - GuiTools::updateBrushStyles(ui.cbSymbolFillingStyle, Qt::black); + GuiTools::updateBrushStyles(ui.cbSymbolFillingStyle, Qt::black); m_initializing = false; //Values