Commit 7c8ac050 authored by Filipe Saraiva's avatar Filipe Saraiva
Browse files

Begin Cantor port to KF5 - Cantor core and libs working

DIGEST: Begin Cantor port to KF5 - Cantor core and libs working
REVIEW: 120300
parent 1c853ae2
project(cantor)
find_package(KDE4 REQUIRED)
include(KDE4Defaults)
set(CMAKE_MODULE_PATH ${cantor_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
macro_optional_find_package(Analitza)
macro_log_feature(Analitza_FOUND "libanalitza" "A library provided by KAlgebra" FALSE "" "Backend to use KAlgebra with Cantor.")
macro_optional_find_package(R)
macro_log_feature(R_FOUND "R" "A free software environment for statistical computing and graphics" "http://www.r-project.org/" FALSE "" "Backend to use R with Cantor.")
cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR)
# set (QT_MIN_VERSION "5.2.0")
add_definitions(-DMAKE_CANTORLIBS_LIB)
find_package(ECM 1.1.0 REQUIRED CONFIG)
set(CMAKE_MODULE_PATH ${cantor_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
find_package(Qt5 CONFIG REQUIRED
Core
Widgets
Svg
Xml
XmlPatterns
Test)
find_package(KF5 REQUIRED
NewStuff
TextEditor
CoreAddons
Archive
Parts
KDELibs4Support)
include(FeatureSummary)
include(ECMInstallIcons)
include(ECMSetupVersion)
include(KDEInstallDirs)
include(KDECompilerSettings)
include(KDECMakeSettings)
include(KDEFrameworkCompilerSettings)
if(NOT WIN32)
macro_optional_find_package(LibSpectre)
macro_log_feature(LIBSPECTRE_FOUND "libspectre" "A PostScript rendering library" "http://libspectre.freedesktop.org/wiki/" FALSE "${LIBSPECTRE_MINIMUM_VERSION}" "Support for rendering EPS files in Cantor.")
if(LIBSPECTRE_FOUND)
set( WITH_EPS On )
else(LIBSPECTRE_FOUND)
set( WITH_EPS Off )
endif(LIBSPECTRE_FOUND)
find_package(LibSpectre)
set_package_properties(LibSpectre PROPERTIES DESCRIPTION "A PostScript rendering library"
URL "http://libspectre.freedesktop.org/wiki/"
TYPE OPTIONAL
PURPOSE "Support for rendering EPS files in Cantor")
if(LibSpectre_FOUND)
set(WITH_EPS On)
else(LibSpectre_FOUND)
set(WITH_EPS Off)
endif(LibSpectre_FOUND)
else(NOT WIN32)
set( WITH_EPS Off )
set(WITH_EPS Off)
endif(NOT WIN32)
include_directories( ${KDE4_INCLUDES} ${QT_INCLUDES} )
include_directories(${KDE4_INCLUDES})
add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
add_subdirectory(doc)
add_subdirectory(src)
add_subdirectory(icons)
add_subdirectory( doc )
add_subdirectory( src )
add_subdirectory( icons )
if (${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_SOURCE_DIR})
macro_display_feature_log()
endif (${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_SOURCE_DIR})
install( FILES cantor.appdata.xml DESTINATION ${SHARE_INSTALL_PREFIX}/appdata/ )
install(FILES cantor.appdata.xml DESTINATION ${SHARE_INSTALL_PREFIX}/appdata/)
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
\ No newline at end of file
########### install files ###############
#
kde4_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR cantor)
kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR cantor)
kde4_install_icons( ${ICON_INSTALL_DIR} )
#ecm_install_icons( ${ICON_INSTALL_DIR} )
ecm_install_icons(ICONS
hi16-apps-cantor.png
hi32-apps-cantor.png
hi48-apps-cantor.png
hi48-apps-luabackend.png
hi48-apps-maximabackend.png
hi48-apps-octavebackend.png
hi48-apps-pythonbackend.png
hi48-apps-qalculatebackend.png
hi48-apps-rbackend.png
hi48-apps-sagebackend.png
hi48-apps-scilabbackend.png
DESTINATION ${ICON_INSTALL_DIR})
......@@ -11,16 +11,16 @@ endif(KDE4_BUILD_TESTS)
if(LIBSPECTRE_FOUND)
include_directories(${LIBSPECTRE_INCLUDE_DIR})
endif(LIBSPECTRE_FOUND)
add_subdirectory(backends)
add_subdirectory(assistants)
#add_subdirectory(backends)
#add_subdirectory(assistants)
add_subdirectory(xslt)
add_subdirectory(panelplugins)
#add_subdirectory(panelplugins)
#build the config object in a separate library, shared between shell and part
kde4_add_kcfg_files(config_SRCS settings.kcfgc)
kde4_add_library( cantor_config SHARED ${config_SRCS} )
target_link_libraries( cantor_config ${KDE4_KDEUI_LIBS} ${KDE4_KPARTS_LIBS} ${KDE4_KNEWSTUFF3_LIBS} )
kconfig_add_kcfg_files(config_SRCS settings.kcfgc)
add_library( cantor_config SHARED ${config_SRCS} )
target_link_libraries( cantor_config KF5::Parts KF5::NewStuff )
install( TARGETS cantor_config ${INSTALL_TARGETS_DEFAULT_ARGS} )
set(cantor_SRCS
......@@ -31,32 +31,32 @@ set(cantor_SRCS
install(FILES cantor.kcfg DESTINATION ${KCFG_INSTALL_DIR})
kde4_add_ui_files(cantor_SRCS settings.ui)
kde4_add_ui_files(cantor_SRCS backendchooser.ui)
ki18n_wrap_ui(cantor_SRCS settings.ui)
ki18n_wrap_ui(cantor_SRCS backendchooser.ui)
kde4_add_app_icon(cantor_SRCS
"${CMAKE_CURRENT_SOURCE_DIR}/../icons/hi*-app-cantor.png")
kde4_add_executable(cantor ${cantor_SRCS})
add_executable(cantor ${cantor_SRCS})
target_link_libraries(cantor ${KDE4_KDEUI_LIBS} ${KDE4_KPARTS_LIBS} ${KDE4_KNEWSTUFF3_LIBS} cantorlibs cantor_config)
target_link_libraries(cantor KF5::Parts KF5::NewStuff cantorlibs cantor_config)
########### install files ###############
install(TARGETS cantor ${INSTALL_TARGETS_DEFAULT_ARGS} )
install( PROGRAMS cantor.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
install( FILES cantor_shell.rc DESTINATION ${DATA_INSTALL_DIR}/cantor )
install( FILES cantor.knsrc DESTINATION ${CONFIG_INSTALL_DIR} )
install( FILES cantor_maxima.knsrc DESTINATION ${CONFIG_INSTALL_DIR} )
install( FILES cantor_sage.knsrc DESTINATION ${CONFIG_INSTALL_DIR} )
install( FILES cantor_kalgebra.knsrc DESTINATION ${CONFIG_INSTALL_DIR} )
install( FILES cantor_lua.knsrc DESTINATION ${CONFIG_INSTALL_DIR} )
install( FILES cantor_octave.knsrc DESTINATION ${CONFIG_INSTALL_DIR} )
install( FILES cantor_qalculate.knsrc DESTINATION ${CONFIG_INSTALL_DIR} )
install( FILES cantor_python2.knsrc DESTINATION ${CONFIG_INSTALL_DIR} )
install( FILES cantor_scilab.knsrc DESTINATION ${CONFIG_INSTALL_DIR} )
if (R_FOUND)
install( FILES cantor_r.knsrc DESTINATION ${CONFIG_INSTALL_DIR} )
endif (R_FOUND)
# install( FILES cantor.knsrc DESTINATION ${CONFIG_INSTALL_DIR} )
# install( FILES cantor_maxima.knsrc DESTINATION ${CONFIG_INSTALL_DIR} )
# install( FILES cantor_sage.knsrc DESTINATION ${CONFIG_INSTALL_DIR} )
# install( FILES cantor_kalgebra.knsrc DESTINATION ${CONFIG_INSTALL_DIR} )
# install( FILES cantor_lua.knsrc DESTINATION ${CONFIG_INSTALL_DIR} )
# install( FILES cantor_octave.knsrc DESTINATION ${CONFIG_INSTALL_DIR} )
# install( FILES cantor_qalculate.knsrc DESTINATION ${CONFIG_INSTALL_DIR} )
# install( FILES cantor_python2.knsrc DESTINATION ${CONFIG_INSTALL_DIR} )
# install( FILES cantor_scilab.knsrc DESTINATION ${CONFIG_INSTALL_DIR} )
# if (R_FOUND)
# install( FILES cantor_r.knsrc DESTINATION ${CONFIG_INSTALL_DIR} )
# endif (R_FOUND)
#########################################################################
# KPART SECTION
......@@ -90,21 +90,22 @@ set(cantor_PART_SRCS
epsrenderer.cpp
)
kde4_add_ui_files(cantor_PART_SRCS imagesettings.ui)
kde4_add_ui_files(cantor_PART_SRCS standardsearchbar.ui)
kde4_add_ui_files(cantor_PART_SRCS extendedsearchbar.ui)
ki18n_wrap_ui(cantor_PART_SRCS imagesettings.ui)
ki18n_wrap_ui(cantor_PART_SRCS standardsearchbar.ui)
ki18n_wrap_ui(cantor_PART_SRCS extendedsearchbar.ui)
configure_file (config-cantor.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-cantor.h )
kde4_add_plugin(cantorpart WITH_PREFIX ${cantor_PART_SRCS})
# add_library(cantorpart MODULE WITH_PREFIX ${cantor_PART_SRCS})
add_library(cantorpart MODULE ${cantor_PART_SRCS})
set_target_properties(cantorpart PROPERTIES PREFIX "${CMAKE_SHARED_LIBRARY_PREFIX}")
#add_library(blahtexcore STATIC IMPORTED)
#set_property(TARGET blahtexcore PROPERTY IMPORTED_LOCATION Path_To_BlahtexCore_Library/libblahtexcore.a)
target_link_libraries(cantorpart ${KDE4_KDEUI_LIBS} ${KDE4_KPARTS_LIBS} ${KDE4_KNEWSTUFF3_LIBS}
${KDE4_KTEXTEDITOR_LIBS} ${QT_QTXMLPATTERNS_LIBRARY}
cantorlibs cantor_config )
target_link_libraries(cantorpart KF5::Parts KF5::NewStuff
KF5::TextEditor ${Qt5XmlPatterns_LIBRARIES}
cantorlibs cantor_config )
if(LIBSPECTRE_FOUND)
target_link_libraries(cantorpart ${LIBSPECTRE_LIBRARY})
endif(LIBSPECTRE_FOUND)
......@@ -113,4 +114,4 @@ install( FILES cantor_part.desktop DESTINATION ${SERVICES_INSTALL_DIR}/cantor )
install( FILES cantor_part.rc DESTINATION ${DATA_INSTALL_DIR}/cantor )
install( FILES cantor_scripteditor.rc DESTINATION ${DATA_INSTALL_DIR}/cantor )
install(TARGETS cantorpart DESTINATION ${PLUGIN_INSTALL_DIR} )
install(TARGETS cantorpart DESTINATION ${PLUGIN_INSTALL_DIR} )
\ No newline at end of file
......@@ -42,7 +42,7 @@ ActionBar::~ActionBar()
{
}
WorksheetToolButton* ActionBar::addButton(const KIcon& icon, QString toolTip,
WorksheetToolButton* ActionBar::addButton(const QIcon& icon, QString toolTip,
QObject* receiver, const char* method )
{
WorksheetToolButton* button = new WorksheetToolButton(this);
......
......@@ -23,7 +23,7 @@
#include <QGraphicsObject>
#include <KIcon>
#include <QIcon>
class Worksheet;
class WorksheetEntry;
......@@ -36,7 +36,7 @@ class ActionBar : public QGraphicsObject
ActionBar(WorksheetEntry* parent);
~ActionBar();
WorksheetToolButton* addButton(const KIcon& icon, QString toolTip,
WorksheetToolButton* addButton(const QIcon& icon, QString toolTip,
QObject* receiver = 0,
const char* method = 0);
void addSpace();
......@@ -46,7 +46,7 @@ class ActionBar : public QGraphicsObject
QRectF boundingRect() const;
void paint(QPainter*, const QStyleOptionGraphicsItem*, QWidget*);
public slots:
public Q_SLOTS:
void updatePosition();
private:
......
......@@ -21,7 +21,7 @@
#include "animation.h"
#include <QMovie>
#include <kdebug.h>
#include <QDebug>
Animation::Animation(QObject* parent) : QObject(parent)
{
......@@ -70,7 +70,7 @@ void Animation::movieFrameChanged()
cursor.mergeCharFormat(format2);
} else {
// we got removed from the document
kDebug()<<"animation got removed";
qDebug()<<"animation got removed";
disconnect(m_movie, SIGNAL(frameChanged(int)), this, SLOT(movieFrameChanged()));
}
}
......
......@@ -42,7 +42,7 @@ class Animation : public QObject
void setPosition(const QTextCursor& cursor);
QTextCursor position();
public slots:
public Q_SLOTS:
void movieFrameChanged();
private:
......
......@@ -24,7 +24,7 @@
#include "lib/animationresult.h"
#include <KFileDialog>
#include <KDebug>
#include <QDebug>
#include <KLocale>
AnimationResultItem::AnimationResultItem(QGraphicsObject* parent)
......@@ -53,17 +53,17 @@ void AnimationResultItem::populateMenu(KMenu* menu, const QPointF& pos)
menu->addSeparator();
if (m_movie) {
if (m_movie->state() == QMovie::Running)
menu->addAction(KIcon("media-playback-pause"), i18n("Pause"),
menu->addAction(QIcon::fromTheme(QLatin1String("media-playback-pause")), i18n("Pause"),
this, SLOT(pauseMovie()));
else
menu->addAction(KIcon("media-playback-start"), i18n("Start"),
menu->addAction(QIcon::fromTheme(QLatin1String("media-playback-start")), i18n("Start"),
m_movie, SLOT(start()));
if (m_movie->state() == QMovie::Running ||
m_movie->state() == QMovie::Paused)
menu->addAction(KIcon("media-playback-stop"), i18n("Stop"),
menu->addAction(QIcon::fromTheme(QLatin1String("media-playback-stop")), i18n("Stop"),
this, SLOT(stopMovie()));
}
kDebug() << "populate Menu";
qDebug() << "populate Menu";
emit menuCreated(menu, mapToParent(pos));
}
......@@ -132,7 +132,7 @@ void AnimationResultItem::saveResult()
{
Cantor::Result* res = result();
const QString& filename=KFileDialog::getSaveFileName(KUrl(), res->mimeType(), worksheet()->worksheetView());
kDebug()<<"saving result to "<<filename;
qDebug()<<"saving result to "<<filename;
res->save(filename);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment