mirror of https://github.com/cutefishos/calamares
Added CMake magic for plugin infrastructure.
Added ViewManager. Added dummy Settings class. Added dummy plugin interface (UI plugins only). Added dummy greeting plugin. Added DLLEXPORT macros for UI plugin interface and plugins.main
parent
bfc5316c56
commit
6899b1f0fa
@ -0,0 +1,112 @@
|
||||
include( CMakeParseArguments )
|
||||
|
||||
function(calamares_add_library)
|
||||
# parse arguments (name needs to be saved before passing ARGN into the macro)
|
||||
set(NAME ${ARGV0})
|
||||
set(options NO_INSTALL NO_VERSION)
|
||||
set(oneValueArgs NAME TYPE EXPORT_MACRO TARGET TARGET_TYPE EXPORT VERSION SOVERSION INSTALL_BINDIR)
|
||||
set(multiValueArgs SOURCES UI LINK_LIBRARIES LINK_PRIVATE_LIBRARIES COMPILE_DEFINITIONS QT5_MODULES)
|
||||
cmake_parse_arguments(LIBRARY "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
set(LIBRARY_NAME ${NAME})
|
||||
|
||||
|
||||
# message("*** Arguments for ${LIBRARY_NAME}")
|
||||
# message("Sources: ${LIBRARY_SOURCES}")
|
||||
# message("Link libraries: ${LIBRARY_LINK_LIBRARIES}")
|
||||
# message("UI: ${LIBRARY_UI}")
|
||||
# message("TARGET_TYPE: ${LIBRARY_TARGET_TYPE}")
|
||||
# message("EXPORT_MACRO: ${LIBRARY_EXPORT_MACRO}")
|
||||
# message("NO_INSTALL: ${LIBRARY_NO_INSTALL}")
|
||||
|
||||
set(target ${LIBRARY_NAME})
|
||||
|
||||
# qt stuff
|
||||
include_directories(${CMAKE_CURRENT_LIST_DIR})
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
if(LIBRARY_UI)
|
||||
qt_wrap_ui(LIBRARY_UI_SOURCES ${LIBRARY_UI})
|
||||
list(APPEND LIBRARY_SOURCES ${LIBRARY_UI_SOURCES})
|
||||
endif()
|
||||
|
||||
# add resources from current dir
|
||||
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/resources.qrc")
|
||||
qt_add_resources(LIBRARY_RC_SOURCES "resources.qrc")
|
||||
list(APPEND LIBRARY_SOURCES ${LIBRARY_RC_SOURCES})
|
||||
unset(LIBRARY_RC_SOURCES)
|
||||
endif()
|
||||
|
||||
# add target
|
||||
if(LIBRARY_TARGET_TYPE STREQUAL "STATIC")
|
||||
add_library(${target} STATIC ${LIBRARY_SOURCES})
|
||||
elseif(LIBRARY_TARGET_TYPE STREQUAL "MODULE")
|
||||
add_library(${target} MODULE ${LIBRARY_SOURCES})
|
||||
else() # default
|
||||
add_library(${target} SHARED ${LIBRARY_SOURCES})
|
||||
endif()
|
||||
|
||||
# HACK: add qt modules - every lib should define its own set of modules
|
||||
qt5_use_modules(${target} Core Gui Widgets ${LIBRARY_QT5_MODULES})
|
||||
|
||||
# definitions - can this be moved into set_target_properties below?
|
||||
add_definitions(${QT_DEFINITIONS})
|
||||
set_target_properties(${target} PROPERTIES AUTOMOC TRUE)
|
||||
|
||||
if(LIBRARY_EXPORT_MACRO)
|
||||
set_target_properties(${target} PROPERTIES COMPILE_DEFINITIONS ${LIBRARY_EXPORT_MACRO})
|
||||
endif()
|
||||
|
||||
if(LIBRARY_COMPILE_DEFINITIONS)
|
||||
# Dear CMake, i hate you! Sincerely, domme
|
||||
# At least in CMake 2.8.8, you CANNOT set more than one COMPILE_DEFINITIONS value
|
||||
# only takes the first one if called multiple times or bails out with wrong number of arguments
|
||||
# when passing in a list, thus i redefine the export macro here in hope it won't mess up other targets
|
||||
add_definitions( "-D${LIBRARY_EXPORT_MACRO}" )
|
||||
|
||||
set_target_properties(${target} PROPERTIES COMPILE_DEFINITIONS ${LIBRARY_COMPILE_DEFINITIONS})
|
||||
endif()
|
||||
|
||||
# add link targets
|
||||
target_link_libraries(${target} ${CALAMARES_LIBRARIES})
|
||||
if(LIBRARY_LINK_LIBRARIES)
|
||||
target_link_libraries(${target} ${LIBRARY_LINK_LIBRARIES})
|
||||
endif()
|
||||
if(LIBRARY_LINK_PRIVATE_LIBRARIES)
|
||||
target_link_libraries(${target} LINK_PRIVATE ${LIBRARY_LINK_PRIVATE_LIBRARIES})
|
||||
endif()
|
||||
|
||||
# add soversion
|
||||
if(NOT LIBRARY_NO_VERSION)
|
||||
set_target_properties(${target} PROPERTIES VERSION ${LIBRARY_VERSION})
|
||||
|
||||
if(NOT LIBRARY_SOVERSION)
|
||||
set(LIBRARY_SOVERSION ${LIBRARY_VERSION})
|
||||
endif()
|
||||
|
||||
set_target_properties(${target} PROPERTIES SOVERSION ${LIBRARY_SOVERSION})
|
||||
endif()
|
||||
|
||||
|
||||
if(NOT LIBRARY_INSTALL_BINDIR)
|
||||
set(LIBRARY_INSTALL_BINDIR "${CMAKE_INSTALL_BINDIR}")
|
||||
endif()
|
||||
|
||||
# make installation optional, maybe useful for dummy plugins one day
|
||||
if(NOT LIBRARY_NO_INSTALL)
|
||||
include(GNUInstallDirs)
|
||||
if(NOT LIBRARY_EXPORT)
|
||||
install( TARGETS ${target}
|
||||
RUNTIME DESTINATION ${LIBRARY_INSTALL_BINDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
)
|
||||
else()
|
||||
install( TARGETS ${target}
|
||||
EXPORT ${LIBRARY_EXPORT}
|
||||
RUNTIME DESTINATION ${LIBRARY_INSTALL_BINDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
@ -0,0 +1,55 @@
|
||||
include( CMakeParseArguments )
|
||||
include( ${CALAMARES_CMAKE_DIR}/CalamaresAddLibrary.cmake )
|
||||
|
||||
function(calamares_add_plugin)
|
||||
# parse arguments (name needs to be saved before passing ARGN into the macro)
|
||||
set(NAME ${ARGV0})
|
||||
set(options NO_INSTALL SHARED_LIB)
|
||||
set(oneValueArgs NAME TYPE EXPORT_MACRO)
|
||||
set(multiValueArgs SOURCES UI LINK_LIBRARIES COMPILE_DEFINITIONS)
|
||||
cmake_parse_arguments(PLUGIN "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
set(PLUGIN_NAME ${NAME})
|
||||
|
||||
# message("*** Arguments for ${PLUGIN_NAME}")
|
||||
# message("Sources: ${PLUGIN_SOURCES}")
|
||||
# message("Link libraries: ${PLUGIN_LINK_LIBRARIES}")
|
||||
# message("UI: ${PLUGIN_UI}")
|
||||
# message("TYPE: ${PLUGIN_TYPE}")
|
||||
# message("EXPORT_MACRO: ${PLUGIN_EXPORT_MACRO}")
|
||||
# message("NO_INSTALL: ${PLUGIN_NO_INSTALL}")
|
||||
|
||||
# create target name once for convenience
|
||||
set(target "calamares_${PLUGIN_TYPE}_${PLUGIN_NAME}")
|
||||
|
||||
# determine target type
|
||||
if(NOT ${PLUGIN_SHARED_LIB})
|
||||
set(target_type "MODULE")
|
||||
else()
|
||||
set(target_type "SHARED")
|
||||
endif()
|
||||
|
||||
list(APPEND calamares_add_library_args
|
||||
"${target}"
|
||||
"EXPORT_MACRO" "${PLUGIN_EXPORT_MACRO}"
|
||||
"TARGET_TYPE" "${target_type}"
|
||||
"SOURCES" "${PLUGIN_SOURCES}"
|
||||
)
|
||||
|
||||
if(PLUGIN_UI)
|
||||
list(APPEND calamares_add_library_args "UI" "${PLUGIN_UI}")
|
||||
endif()
|
||||
|
||||
if(PLUGIN_LINK_LIBRARIES)
|
||||
list(APPEND calamares_add_library_args "LINK_LIBRARIES" "${PLUGIN_LINK_LIBRARIES}")
|
||||
endif()
|
||||
|
||||
if(PLUGIN_COMPILE_DEFINITIONS)
|
||||
list(APPEND calamares_add_library_args "COMPILE_DEFINITIONS" ${PLUGIN_COMPILE_DEFINITIONS})
|
||||
endif()
|
||||
|
||||
list(APPEND calamares_add_library_args "NO_VERSION")
|
||||
|
||||
list(APPEND calamares_add_library_args "INSTALL_BINDIR" "${CMAKE_INSTALL_LIBDIR}")
|
||||
|
||||
calamares_add_library(${calamares_add_library_args})
|
||||
endfunction()
|
@ -0,0 +1,10 @@
|
||||
#FIXME: this duplicates top level cmakelists: how can we reduce code duplication?
|
||||
|
||||
find_package( Qt5 5.3.0 CONFIG REQUIRED Core Gui Widgets LinguistTools )
|
||||
|
||||
if(NOT CALAMARES_CMAKE_DIR)
|
||||
set(CALAMARES_CMAKE_DIR ${CMAKE_CURRENT_LIST_DIR})
|
||||
endif()
|
||||
|
||||
include( "${CALAMARES_CMAKE_DIR}/CalamaresAddLibrary.cmake" )
|
||||
include( "${CALAMARES_CMAKE_DIR}/CalamaresAddPlugin.cmake" )
|
@ -0,0 +1,32 @@
|
||||
/* === This file is part of Calamares - <http://github.com/calamares> ===
|
||||
*
|
||||
* Copyright 2014, Teo Mrnjavac <teo@kde.org>
|
||||
*
|
||||
* Calamares is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Calamares is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef UIDLLMACRO_H
|
||||
#define UIDLLMACRO_H
|
||||
|
||||
#include <QtCore/qglobal.h>
|
||||
|
||||
#ifndef UIDLLEXPORT
|
||||
# if defined (UIDLLEXPORT_PRO)
|
||||
# define UIDLLEXPORT Q_DECL_EXPORT
|
||||
# else
|
||||
# define UIDLLEXPORT Q_DECL_IMPORT
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif
|
@ -0,0 +1,24 @@
|
||||
/* === This file is part of Calamares - <http://github.com/calamares> ===
|
||||
*
|
||||
* Copyright 2014, Teo Mrnjavac <teo@kde.org>
|
||||
*
|
||||
* Calamares is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Calamares is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "Settings.h"
|
||||
|
||||
Settings::Settings( QObject* parent )
|
||||
: QObject( parent )
|
||||
{
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
/* === This file is part of Calamares - <http://github.com/calamares> ===
|
||||
*
|
||||
* Copyright 2014, Teo Mrnjavac <teo@kde.org>
|
||||
*
|
||||
* Calamares is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Calamares is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef SETTINGS_H
|
||||
#define SETTINGS_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
|
||||
// Settings::instance() ?
|
||||
|
||||
class Settings : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit Settings( QObject *parent = 0 );
|
||||
//TODO: load from JSON then emit ready
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
|
||||
};
|
||||
|
||||
#endif // SETTINGS_H
|
@ -0,0 +1,82 @@
|
||||
/* === This file is part of Calamares - <http://github.com/calamares> ===
|
||||
*
|
||||
* Copyright 2014, Teo Mrnjavac <teo@kde.org>
|
||||
*
|
||||
* Calamares is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Calamares is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "ViewManager.h"
|
||||
|
||||
#include <QBoxLayout>
|
||||
|
||||
namespace Calamares
|
||||
{
|
||||
|
||||
ViewManager* ViewManager::s_instance = 0;
|
||||
|
||||
ViewManager*
|
||||
ViewManager::instance()
|
||||
{
|
||||
return s_instance;
|
||||
}
|
||||
|
||||
ViewManager::ViewManager( QObject* parent )
|
||||
: QObject( parent )
|
||||
, m_widget( new QWidget() )
|
||||
{
|
||||
s_instance = this;
|
||||
QBoxLayout* mainLayout = new QVBoxLayout;
|
||||
m_widget->setLayout( mainLayout );
|
||||
|
||||
m_stack = new QStackedWidget( m_widget );
|
||||
mainLayout->addWidget( m_stack );
|
||||
|
||||
m_back = new QPushButton( tr( "&Back" ), m_widget );
|
||||
m_next = new QPushButton( tr( "&Next" ), m_widget );
|
||||
|
||||
QBoxLayout* bottomLayout = new QHBoxLayout;
|
||||
mainLayout->addLayout( bottomLayout );
|
||||
bottomLayout->addStretch();
|
||||
bottomLayout->addWidget( m_back );
|
||||
bottomLayout->addWidget( m_next );
|
||||
}
|
||||
|
||||
|
||||
ViewManager::~ViewManager()
|
||||
{
|
||||
m_widget->deleteLater();
|
||||
}
|
||||
|
||||
|
||||
QWidget*
|
||||
ViewManager::widget()
|
||||
{
|
||||
return m_widget;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ViewManager::next()
|
||||
{
|
||||
Q_ASSERT( 0 );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ViewManager::back()
|
||||
{
|
||||
Q_ASSERT( 0 );
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
/* === This file is part of Calamares - <http://github.com/calamares> ===
|
||||
*
|
||||
* Copyright 2014, Teo Mrnjavac <teo@kde.org>
|
||||
*
|
||||
* Calamares is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Calamares is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef VIEWMANAGER_H
|
||||
#define VIEWMANAGER_H
|
||||
|
||||
#include "DllMacro.h"
|
||||
#include "viewpages/PagePlugin.h"
|
||||
|
||||
#include <QPushButton>
|
||||
#include <QStackedWidget>
|
||||
|
||||
namespace Calamares
|
||||
{
|
||||
|
||||
class UIDLLEXPORT ViewManager : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
static ViewManager* instance();
|
||||
|
||||
explicit ViewManager( QObject* parent = 0 );
|
||||
virtual ~ViewManager();
|
||||
|
||||
QWidget* widget();
|
||||
|
||||
void addPagePlugin( PagePlugin* plugin );
|
||||
|
||||
void insertPage( AbstractPage* page );
|
||||
void setNext( AbstractPage* page );
|
||||
void removePage( AbstractPage* page );
|
||||
|
||||
public slots:
|
||||
void next();
|
||||
void back();
|
||||
|
||||
private:
|
||||
static ViewManager* s_instance;
|
||||
|
||||
QWidget* m_widget;
|
||||
QStackedWidget* m_stack;
|
||||
QPushButton* m_back;
|
||||
QPushButton* m_next;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // VIEWMANAGER_H
|
@ -0,0 +1,29 @@
|
||||
/* === This file is part of Calamares - <http://github.com/calamares> ===
|
||||
*
|
||||
* Copyright 2014, Teo Mrnjavac <teo@kde.org>
|
||||
*
|
||||
* Calamares is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Calamares is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "AbstractPage.h"
|
||||
|
||||
namespace Calamares
|
||||
{
|
||||
|
||||
AbstractPage::AbstractPage( QWidget* parent )
|
||||
: QWidget( parent )
|
||||
{
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
/* === This file is part of Calamares - <http://github.com/calamares> ===
|
||||
*
|
||||
* Copyright 2014, Teo Mrnjavac <teo@kde.org>
|
||||
*
|
||||
* Calamares is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Calamares is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef ABSTRACTPAGE_H
|
||||
#define ABSTRACTPAGE_H
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
#include "../DllMacro.h"
|
||||
|
||||
namespace Calamares
|
||||
{
|
||||
|
||||
class UIDLLEXPORT AbstractPage : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit AbstractPage(QWidget *parent = 0);
|
||||
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // ABSTRACTPAGE_H
|
@ -0,0 +1,29 @@
|
||||
/* === This file is part of Calamares - <http://github.com/calamares> ===
|
||||
*
|
||||
* Copyright 2014, Teo Mrnjavac <teo@kde.org>
|
||||
*
|
||||
* Calamares is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Calamares is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "PagePlugin.h"
|
||||
|
||||
namespace Calamares
|
||||
{
|
||||
|
||||
PagePlugin::PagePlugin( QObject* parent )
|
||||
: QObject( parent )
|
||||
{
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
/* === This file is part of Calamares - <http://github.com/calamares> ===
|
||||
*
|
||||
* Copyright 2014, Teo Mrnjavac <teo@kde.org>
|
||||
*
|
||||
* Calamares is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Calamares is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef PAGEPLUGIN_H
|
||||
#define PAGEPLUGIN_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include "../DllMacro.h"
|
||||
|
||||
namespace Calamares
|
||||
{
|
||||
|
||||
class AbstractPage;
|
||||
|
||||
class UIDLLEXPORT PagePlugin : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit PagePlugin( QObject *parent = 0 );
|
||||
|
||||
signals:
|
||||
void done();
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Q_DECLARE_INTERFACE( Calamares::PagePlugin, "calamares.PagePlugin/1.0" )
|
||||
|
||||
#endif // PAGEPLUGIN_H
|
@ -0,0 +1,32 @@
|
||||
/* === This file is part of Calamares - <http://github.com/calamares> ===
|
||||
*
|
||||
* Copyright 2014, Teo Mrnjavac <teo@kde.org>
|
||||
*
|
||||
* Calamares is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Calamares is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef PLUGINDLLMACRO_H
|
||||
#define PLUGINDLLMACRO_H
|
||||
|
||||
#include <QtCore/qglobal.h>
|
||||
|
||||
#ifndef PLUGINDLLEXPORT
|
||||
# if defined (PLUGINDLLEXPORT_PRO)
|
||||
# define PLUGINDLLEXPORT Q_DECL_EXPORT
|
||||
# else
|
||||
# define PLUGINDLLEXPORT Q_DECL_IMPORT
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif
|
@ -0,0 +1,6 @@
|
||||
file(GLOB SUBDIRECTORIES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*")
|
||||
foreach(SUBDIRECTORY ${SUBDIRECTORIES})
|
||||
if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIRECTORY}" AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIRECTORY}/CMakeLists.txt")
|
||||
add_subdirectory(${SUBDIRECTORY})
|
||||
endif()
|
||||
endforeach()
|
@ -0,0 +1,5 @@
|
||||
Calamares modules directory
|
||||
===
|
||||
|
||||
Calamares modules are plugins that implement the Calamares module API and can provide features like installer pages, batch jobs, etc.
|
||||
To add a module, put it in a subdirectory and make sure it has a CMakeLists.txt, it should be picked up automatically by our CMake magic.
|
@ -0,0 +1,12 @@
|
||||
include_directories( ${PROJECT_BINARY_DIR}/src/calamares )
|
||||
calamares_add_plugin( greeting
|
||||
TYPE pageplugin
|
||||
EXPORT_MACRO PLUGINDLLEXPORT_PRO
|
||||
SOURCES
|
||||
GreetingPagePlugin.cpp
|
||||
GreetingPage.cpp
|
||||
UI
|
||||
LINK_LIBRARIES
|
||||
${CALAMARES_LIBRARIES}
|
||||
SHARED_LIB
|
||||
)
|
@ -0,0 +1,25 @@
|
||||
/* === This file is part of Calamares - <http://github.com/calamares> ===
|
||||
*
|
||||
* Copyright 2014, Teo Mrnjavac <teo@kde.org>
|
||||
*
|
||||
* Calamares is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Calamares is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "GreetingPage.h"
|
||||
|
||||
|
||||
GreetingPage::GreetingPage( QWidget* parent )
|
||||
: AbstractPage( parent )
|
||||
{
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
/* === This file is part of Calamares - <http://github.com/calamares> ===
|
||||
*
|
||||
* Copyright 2014, Teo Mrnjavac <teo@kde.org>
|
||||
*
|
||||
* Calamares is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Calamares is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef GREETINGPAGE_H
|
||||
#define GREETINGPAGE_H
|
||||
|
||||
#include "viewpages/AbstractPage.h"
|
||||
|
||||
class GreetingPage : public Calamares::AbstractPage
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit GreetingPage( QWidget* parent = 0 );
|
||||
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
|
||||
};
|
||||
|
||||
#endif // GREETINGPAGE_H
|
@ -0,0 +1,24 @@
|
||||
/* === This file is part of Calamares - <http://github.com/calamares> ===
|
||||
*
|
||||
* Copyright 2014, Teo Mrnjavac <teo@kde.org>
|
||||
*
|
||||
* Calamares is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Calamares is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "GreetingPagePlugin.h"
|
||||
|
||||
GreetingPagePlugin::GreetingPagePlugin( QObject *parent )
|
||||
: PagePlugin( parent )
|
||||
{
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
/* === This file is part of Calamares - <http://github.com/calamares> ===
|
||||
*
|
||||
* Copyright 2014, Teo Mrnjavac <teo@kde.org>
|
||||
*
|
||||
* Calamares is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Calamares is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef GREETINGPAGEPLUGIN_H
|
||||
#define GREETINGPAGEPLUGIN_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include "viewpages/PagePlugin.h"
|
||||
#include "PluginDllMacro.h"
|
||||
|
||||
class PLUGINDLLEXPORT GreetingPagePlugin : public Calamares::PagePlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA( IID "calamares.PagePlugin/1.0" )
|
||||
//FILE "module.json" )
|
||||
Q_INTERFACES( Calamares::PagePlugin )
|
||||
public:
|
||||
explicit GreetingPagePlugin(QObject *parent = 0);
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif // GREETINGPAGEPLUGIN_H
|
Loading…
Reference in New Issue