Merge branch 'no-qml'
This commit is contained in:
commit
dd0491e5ca
4
CHANGES
4
CHANGES
@ -12,6 +12,10 @@ This release contains contributions from (alphabetically by first name):
|
|||||||
- The slideshow in `branding.desc` can be configured with QML (recommended,
|
- The slideshow in `branding.desc` can be configured with QML (recommended,
|
||||||
as it has been for the past umpteen releases) or with a list of
|
as it has been for the past umpteen releases) or with a list of
|
||||||
images (new).
|
images (new).
|
||||||
|
- It is possible to turn off all the new QML code -- navigation, slideshow,
|
||||||
|
QML-based modules -- with a single `-DWITH_QML=OFF` at CMake time.
|
||||||
|
This removes QML from Calamares' dependency footprint (but only saves
|
||||||
|
200kB in Calamares itself).
|
||||||
|
|
||||||
## Modules ##
|
## Modules ##
|
||||||
- No module changes yet
|
- No module changes yet
|
||||||
|
@ -56,7 +56,8 @@ option( WITH_KF5DBus "Use DBus service for unique-application." OFF )
|
|||||||
# When adding WITH_* that affects the ABI offered by libcalamares,
|
# When adding WITH_* that affects the ABI offered by libcalamares,
|
||||||
# also update libcalamares/CalamaresConfig.h.in
|
# also update libcalamares/CalamaresConfig.h.in
|
||||||
option( WITH_PYTHON "Enable Python modules API (requires Boost.Python)." ON )
|
option( WITH_PYTHON "Enable Python modules API (requires Boost.Python)." ON )
|
||||||
option( WITH_PYTHONQT "Enable next generation Python modules API (experimental, requires PythonQt)." OFF )
|
option( WITH_PYTHONQT "Enable Python view modules API (deprecated, requires PythonQt)." OFF )
|
||||||
|
option( WITH_QML "Enable QML UI options." ON )
|
||||||
|
|
||||||
# Possible debugging flags are:
|
# Possible debugging flags are:
|
||||||
# - DEBUG_TIMEZONES draws latitude and longitude lines on the timezone
|
# - DEBUG_TIMEZONES draws latitude and longitude lines on the timezone
|
||||||
@ -253,7 +254,10 @@ include( CMakeColors )
|
|||||||
|
|
||||||
### DEPENDENCIES
|
### DEPENDENCIES
|
||||||
#
|
#
|
||||||
find_package( Qt5 ${QT_VERSION} CONFIG REQUIRED Concurrent Core Gui Widgets LinguistTools Svg Quick QuickWidgets )
|
find_package( Qt5 ${QT_VERSION} CONFIG REQUIRED Concurrent Core Gui LinguistTools Network Svg Widgets )
|
||||||
|
if( WITH_QML )
|
||||||
|
find_package( Qt5 ${QT_VERSION} CONFIG REQUIRED Quick QuickWidgets )
|
||||||
|
endif()
|
||||||
if( Qt5_VERSION VERSION_GREATER 5.12.1 )
|
if( Qt5_VERSION VERSION_GREATER 5.12.1 )
|
||||||
# At least Qt 5.12.2 seems to support Esperanto in QLocale
|
# At least Qt 5.12.2 seems to support Esperanto in QLocale
|
||||||
if( "eo" IN_LIST _tx_incomplete )
|
if( "eo" IN_LIST _tx_incomplete )
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
#include "CalamaresWindow.h"
|
#include "CalamaresWindow.h"
|
||||||
|
|
||||||
#include "Branding.h"
|
#include "Branding.h"
|
||||||
|
#include "CalamaresConfig.h"
|
||||||
#include "DebugWindow.h"
|
#include "DebugWindow.h"
|
||||||
#include "Settings.h"
|
#include "Settings.h"
|
||||||
#include "ViewManager.h"
|
#include "ViewManager.h"
|
||||||
@ -38,8 +39,10 @@
|
|||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
|
#ifdef WITH_QML
|
||||||
#include <QQuickItem>
|
#include <QQuickItem>
|
||||||
#include <QQuickWidget>
|
#include <QQuickWidget>
|
||||||
|
#endif
|
||||||
#include <QTreeView>
|
#include <QTreeView>
|
||||||
|
|
||||||
static inline int
|
static inline int
|
||||||
@ -132,18 +135,6 @@ CalamaresWindow::getWidgetSidebar( QWidget* parent, int desiredWidth )
|
|||||||
return sideBox;
|
return sideBox;
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget*
|
|
||||||
CalamaresWindow::getQmlSidebar( QWidget* parent, int )
|
|
||||||
{
|
|
||||||
CalamaresUtils::registerCalamaresModels();
|
|
||||||
QQuickWidget* w = new QQuickWidget( parent );
|
|
||||||
w->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
|
|
||||||
w->setResizeMode( QQuickWidget::SizeRootObjectToView );
|
|
||||||
w->setSource( QUrl(
|
|
||||||
CalamaresUtils::searchQmlFile( CalamaresUtils::QmlSearch::Both, QStringLiteral( "calamares-sidebar" ) ) ) );
|
|
||||||
return w;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @brief Get a button-sized icon. */
|
/** @brief Get a button-sized icon. */
|
||||||
static inline QPixmap
|
static inline QPixmap
|
||||||
getButtonIcon( const QString& name )
|
getButtonIcon( const QString& name )
|
||||||
@ -213,6 +204,19 @@ CalamaresWindow::getWidgetNavigation( QWidget* parent )
|
|||||||
return navigation;
|
return navigation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef WITH_QML
|
||||||
|
QWidget*
|
||||||
|
CalamaresWindow::getQmlSidebar( QWidget* parent, int )
|
||||||
|
{
|
||||||
|
CalamaresUtils::registerCalamaresModels();
|
||||||
|
QQuickWidget* w = new QQuickWidget( parent );
|
||||||
|
w->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
|
||||||
|
w->setResizeMode( QQuickWidget::SizeRootObjectToView );
|
||||||
|
w->setSource( QUrl(
|
||||||
|
CalamaresUtils::searchQmlFile( CalamaresUtils::QmlSearch::Both, QStringLiteral( "calamares-sidebar" ) ) ) );
|
||||||
|
return w;
|
||||||
|
}
|
||||||
|
|
||||||
QWidget*
|
QWidget*
|
||||||
CalamaresWindow::getQmlNavigation( QWidget* parent )
|
CalamaresWindow::getQmlNavigation( QWidget* parent )
|
||||||
{
|
{
|
||||||
@ -231,6 +235,19 @@ CalamaresWindow::getQmlNavigation( QWidget* parent )
|
|||||||
|
|
||||||
return w;
|
return w;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
// Bogus to keep the linker happy
|
||||||
|
QWidget * CalamaresWindow::getQmlSidebar(QWidget* , int )
|
||||||
|
{
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
QWidget * CalamaresWindow::getQmlNavigation(QWidget* )
|
||||||
|
{
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
/**@brief Picks one of two methods to call
|
/**@brief Picks one of two methods to call
|
||||||
*
|
*
|
||||||
@ -243,16 +260,21 @@ flavoredWidget( Calamares::Branding::PanelFlavor flavor,
|
|||||||
CalamaresWindow* w,
|
CalamaresWindow* w,
|
||||||
QWidget* parent,
|
QWidget* parent,
|
||||||
widgetMaker widget,
|
widgetMaker widget,
|
||||||
widgetMaker qml,
|
widgetMaker qml, // Only if WITH_QML is on
|
||||||
args... a )
|
args... a )
|
||||||
{
|
{
|
||||||
|
#ifndef WITH_QML
|
||||||
|
Q_UNUSED( qml )
|
||||||
|
#endif
|
||||||
// Member-function calling syntax is (object.*member)(args)
|
// Member-function calling syntax is (object.*member)(args)
|
||||||
switch ( flavor )
|
switch ( flavor )
|
||||||
{
|
{
|
||||||
case Calamares::Branding::PanelFlavor::Widget:
|
case Calamares::Branding::PanelFlavor::Widget:
|
||||||
return ( w->*widget )( parent, a... );
|
return ( w->*widget )( parent, a... );
|
||||||
|
#ifdef WITH_QML
|
||||||
case Calamares::Branding::PanelFlavor::Qml:
|
case Calamares::Branding::PanelFlavor::Qml:
|
||||||
return ( w->*qml )( parent, a... );
|
return ( w->*qml )( parent, a... );
|
||||||
|
#endif
|
||||||
case Calamares::Branding::PanelFlavor::None:
|
case Calamares::Branding::PanelFlavor::None:
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
@ -11,5 +11,6 @@
|
|||||||
//cmakedefines for CMake variables (e.g. for optdepends) go here
|
//cmakedefines for CMake variables (e.g. for optdepends) go here
|
||||||
#cmakedefine WITH_PYTHON
|
#cmakedefine WITH_PYTHON
|
||||||
#cmakedefine WITH_PYTHONQT
|
#cmakedefine WITH_PYTHONQT
|
||||||
|
#cmakedefine WITH_QML
|
||||||
|
|
||||||
#endif // CALAMARESCONFIG_H
|
#endif // CALAMARESCONFIG_H
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#ifndef DLLMACRO_H
|
#ifndef DLLMACRO_H
|
||||||
#define DLLMACRO_H
|
#define DLLMACRO_H
|
||||||
|
|
||||||
#include <QtCore/qglobal.h>
|
#include <qglobal.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mark symbols exported from Calamares non-GUI library with DLLEXPORT.
|
* Mark symbols exported from Calamares non-GUI library with DLLEXPORT.
|
||||||
|
@ -180,6 +180,7 @@ Branding::Branding( const QString& brandingFilePath, QObject* parent )
|
|||||||
"component directory." );
|
"component directory." );
|
||||||
|
|
||||||
initSimpleSettings( doc );
|
initSimpleSettings( doc );
|
||||||
|
initSlideshowSettings( doc );
|
||||||
|
|
||||||
#ifdef WITH_KOSRelease
|
#ifdef WITH_KOSRelease
|
||||||
// Copy the os-release information into a QHash for use by KMacroExpander.
|
// Copy the os-release information into a QHash for use by KMacroExpander.
|
||||||
@ -202,17 +203,15 @@ Branding::Branding( const QString& brandingFilePath, QObject* parent )
|
|||||||
{ QStringLiteral( "VARIANT" ), relInfo.variant() },
|
{ QStringLiteral( "VARIANT" ), relInfo.variant() },
|
||||||
{ QStringLiteral( "VARIANT_ID" ), relInfo.variantId() },
|
{ QStringLiteral( "VARIANT_ID" ), relInfo.variantId() },
|
||||||
{ QStringLiteral( "LOGO" ), relInfo.logo() } } };
|
{ QStringLiteral( "LOGO" ), relInfo.logo() } } };
|
||||||
auto expand = [ & ]( const QString& s ) -> QString {
|
auto expand = [&]( const QString& s ) -> QString {
|
||||||
return KMacroExpander::expandMacros( s, relMap, QLatin1Char( '@' ) );
|
return KMacroExpander::expandMacros( s, relMap, QLatin1Char( '@' ) );
|
||||||
};
|
};
|
||||||
#else
|
#else
|
||||||
auto expand = []( const QString& s ) -> QString { return s; };
|
auto expand = []( const QString& s ) -> QString { return s; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// Massage the strings, images and style sections.
|
// Massage the strings, images and style sections.
|
||||||
loadStrings( m_strings, doc, "strings", expand );
|
loadStrings( m_strings, doc, "strings", expand );
|
||||||
loadStrings( m_images, doc, "images", [ & ]( const QString& s ) -> QString {
|
loadStrings( m_images, doc, "images", [&]( const QString& s ) -> QString {
|
||||||
// See also image()
|
// See also image()
|
||||||
const QString imageName( expand( s ) );
|
const QString imageName( expand( s ) );
|
||||||
QFileInfo imageFi( componentDir.absoluteFilePath( imageName ) );
|
QFileInfo imageFi( componentDir.absoluteFilePath( imageName ) );
|
||||||
@ -230,50 +229,6 @@ Branding::Branding( const QString& brandingFilePath, QObject* parent )
|
|||||||
return imageFi.absoluteFilePath();
|
return imageFi.absoluteFilePath();
|
||||||
} );
|
} );
|
||||||
loadStrings( m_style, doc, "style", []( const QString& s ) -> QString { return s; } );
|
loadStrings( m_style, doc, "style", []( const QString& s ) -> QString { return s; } );
|
||||||
|
|
||||||
if ( doc[ "slideshow" ].IsSequence() )
|
|
||||||
{
|
|
||||||
QStringList slideShowPictures;
|
|
||||||
doc[ "slideshow" ] >> slideShowPictures;
|
|
||||||
for ( int i = 0; i < slideShowPictures.count(); ++i )
|
|
||||||
{
|
|
||||||
QString pathString = slideShowPictures[ i ];
|
|
||||||
QFileInfo imageFi( componentDir.absoluteFilePath( pathString ) );
|
|
||||||
if ( !imageFi.exists() )
|
|
||||||
{
|
|
||||||
bail( m_descriptorPath,
|
|
||||||
QString( "Slideshow file %1 does not exist." ).arg( imageFi.absoluteFilePath() ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
slideShowPictures[ i ] = imageFi.absoluteFilePath();
|
|
||||||
}
|
|
||||||
|
|
||||||
m_slideshowFilenames = slideShowPictures;
|
|
||||||
m_slideshowAPI = -1;
|
|
||||||
}
|
|
||||||
else if ( doc[ "slideshow" ].IsScalar() )
|
|
||||||
{
|
|
||||||
QString slideshowPath = QString::fromStdString( doc[ "slideshow" ].as< std::string >() );
|
|
||||||
QFileInfo slideshowFi( componentDir.absoluteFilePath( slideshowPath ) );
|
|
||||||
if ( !slideshowFi.exists() || !slideshowFi.fileName().toLower().endsWith( ".qml" ) )
|
|
||||||
bail( m_descriptorPath,
|
|
||||||
QString( "Slideshow file %1 does not exist or is not a valid QML file." )
|
|
||||||
.arg( slideshowFi.absoluteFilePath() ) );
|
|
||||||
m_slideshowPath = slideshowFi.absoluteFilePath();
|
|
||||||
|
|
||||||
// API choice is relevant for QML slideshow
|
|
||||||
int api = doc[ "slideshowAPI" ].IsScalar() ? doc[ "slideshowAPI" ].as< int >() : -1;
|
|
||||||
if ( ( api < 1 ) || ( api > 2 ) )
|
|
||||||
{
|
|
||||||
cWarning() << "Invalid or missing *slideshowAPI* in branding file.";
|
|
||||||
api = 1;
|
|
||||||
}
|
|
||||||
m_slideshowAPI = api;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
bail( m_descriptorPath, "Syntax error in slideshow sequence." );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch ( YAML::Exception& e )
|
catch ( YAML::Exception& e )
|
||||||
{
|
{
|
||||||
@ -436,8 +391,11 @@ flavorAndSide( const YAML::Node& doc, const char* key, Branding::PanelFlavor& fl
|
|||||||
static const NamedEnumTable< PanelFlavor > sidebarFlavorNames {
|
static const NamedEnumTable< PanelFlavor > sidebarFlavorNames {
|
||||||
{ QStringLiteral( "widget" ), PanelFlavor::Widget },
|
{ QStringLiteral( "widget" ), PanelFlavor::Widget },
|
||||||
{ QStringLiteral( "none" ), PanelFlavor::None },
|
{ QStringLiteral( "none" ), PanelFlavor::None },
|
||||||
{ QStringLiteral( "hidden" ), PanelFlavor::None },
|
{ QStringLiteral( "hidden" ), PanelFlavor::None }
|
||||||
|
#ifdef WITH_QML
|
||||||
|
,
|
||||||
{ QStringLiteral( "qml" ), PanelFlavor::Qml }
|
{ QStringLiteral( "qml" ), PanelFlavor::Qml }
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
static const NamedEnumTable< PanelSide > panelSideNames {
|
static const NamedEnumTable< PanelSide > panelSideNames {
|
||||||
{ QStringLiteral( "left" ), PanelSide::Left },
|
{ QStringLiteral( "left" ), PanelSide::Left },
|
||||||
@ -553,4 +511,62 @@ Branding::initSimpleSettings( const YAML::Node& doc )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Branding::initSlideshowSettings( const YAML::Node& doc )
|
||||||
|
{
|
||||||
|
QDir componentDir( componentDirectory() );
|
||||||
|
|
||||||
|
if ( doc[ "slideshow" ].IsSequence() )
|
||||||
|
{
|
||||||
|
QStringList slideShowPictures;
|
||||||
|
doc[ "slideshow" ] >> slideShowPictures;
|
||||||
|
for ( int i = 0; i < slideShowPictures.count(); ++i )
|
||||||
|
{
|
||||||
|
QString pathString = slideShowPictures[ i ];
|
||||||
|
QFileInfo imageFi( componentDir.absoluteFilePath( pathString ) );
|
||||||
|
if ( !imageFi.exists() )
|
||||||
|
{
|
||||||
|
bail( m_descriptorPath,
|
||||||
|
QString( "Slideshow file %1 does not exist." ).arg( imageFi.absoluteFilePath() ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
slideShowPictures[ i ] = imageFi.absoluteFilePath();
|
||||||
|
}
|
||||||
|
|
||||||
|
m_slideshowFilenames = slideShowPictures;
|
||||||
|
m_slideshowAPI = -1;
|
||||||
|
}
|
||||||
|
#ifdef WITH_QML
|
||||||
|
else if ( doc[ "slideshow" ].IsScalar() )
|
||||||
|
{
|
||||||
|
QString slideshowPath = QString::fromStdString( doc[ "slideshow" ].as< std::string >() );
|
||||||
|
QFileInfo slideshowFi( componentDir.absoluteFilePath( slideshowPath ) );
|
||||||
|
if ( !slideshowFi.exists() || !slideshowFi.fileName().toLower().endsWith( ".qml" ) )
|
||||||
|
bail( m_descriptorPath,
|
||||||
|
QString( "Slideshow file %1 does not exist or is not a valid QML file." )
|
||||||
|
.arg( slideshowFi.absoluteFilePath() ) );
|
||||||
|
m_slideshowPath = slideshowFi.absoluteFilePath();
|
||||||
|
|
||||||
|
// API choice is relevant for QML slideshow
|
||||||
|
int api = doc[ "slideshowAPI" ].IsScalar() ? doc[ "slideshowAPI" ].as< int >() : -1;
|
||||||
|
if ( ( api < 1 ) || ( api > 2 ) )
|
||||||
|
{
|
||||||
|
cWarning() << "Invalid or missing *slideshowAPI* in branding file.";
|
||||||
|
api = 1;
|
||||||
|
}
|
||||||
|
m_slideshowAPI = api;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
else if ( doc[ "slideshow" ].IsScalar() )
|
||||||
|
{
|
||||||
|
cWarning() << "Invalid *slideshow* setting, must be list of images.";
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
else
|
||||||
|
{
|
||||||
|
bail( m_descriptorPath, "Syntax error in slideshow sequence." );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace Calamares
|
} // namespace Calamares
|
||||||
|
@ -22,8 +22,8 @@
|
|||||||
#ifndef BRANDING_H
|
#ifndef BRANDING_H
|
||||||
#define BRANDING_H
|
#define BRANDING_H
|
||||||
|
|
||||||
|
#include "CalamaresConfig.h"
|
||||||
#include "DllMacro.h"
|
#include "DllMacro.h"
|
||||||
|
|
||||||
#include "utils/NamedSuffix.h"
|
#include "utils/NamedSuffix.h"
|
||||||
|
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
@ -131,8 +131,11 @@ public:
|
|||||||
enum class PanelFlavor
|
enum class PanelFlavor
|
||||||
{
|
{
|
||||||
None,
|
None,
|
||||||
Widget,
|
Widget
|
||||||
|
#ifdef WITH_QML
|
||||||
|
,
|
||||||
Qml
|
Qml
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
Q_ENUM( PanelFlavor )
|
Q_ENUM( PanelFlavor )
|
||||||
///@brief Where to place a panel (sidebar, navigation)
|
///@brief Where to place a panel (sidebar, navigation)
|
||||||
@ -259,6 +262,8 @@ private:
|
|||||||
|
|
||||||
/** @brief Initialize the simple settings below */
|
/** @brief Initialize the simple settings below */
|
||||||
void initSimpleSettings( const YAML::Node& doc );
|
void initSimpleSettings( const YAML::Node& doc );
|
||||||
|
///@brief Initialize the slideshow settings, above
|
||||||
|
void initSlideshowSettings( const YAML::Node& doc );
|
||||||
|
|
||||||
bool m_welcomeStyleCalamares;
|
bool m_welcomeStyleCalamares;
|
||||||
bool m_welcomeExpandingLogo;
|
bool m_welcomeExpandingLogo;
|
||||||
|
@ -14,11 +14,9 @@ set( calamaresui_SOURCES
|
|||||||
utils/CalamaresUtilsGui.cpp
|
utils/CalamaresUtilsGui.cpp
|
||||||
utils/ImageRegistry.cpp
|
utils/ImageRegistry.cpp
|
||||||
utils/Paste.cpp
|
utils/Paste.cpp
|
||||||
utils/Qml.cpp
|
|
||||||
|
|
||||||
viewpages/BlankViewStep.cpp
|
viewpages/BlankViewStep.cpp
|
||||||
viewpages/ExecutionViewStep.cpp
|
viewpages/ExecutionViewStep.cpp
|
||||||
viewpages/QmlViewStep.cpp
|
|
||||||
viewpages/Slideshow.cpp
|
viewpages/Slideshow.cpp
|
||||||
viewpages/ViewStep.cpp
|
viewpages/ViewStep.cpp
|
||||||
|
|
||||||
@ -45,10 +43,6 @@ if( WITH_PYTHON )
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if( WITH_PYTHONQT )
|
if( WITH_PYTHONQT )
|
||||||
include_directories(${PYTHON_INCLUDE_DIRS})
|
|
||||||
# *_DIRS because we also use extensions
|
|
||||||
include_directories(${PYTHONQT_INCLUDE_DIRS})
|
|
||||||
|
|
||||||
list( APPEND calamaresui_SOURCES
|
list( APPEND calamaresui_SOURCES
|
||||||
modulesystem/PythonQtViewModule.cpp
|
modulesystem/PythonQtViewModule.cpp
|
||||||
utils/PythonQtUtils.cpp
|
utils/PythonQtUtils.cpp
|
||||||
@ -57,25 +51,33 @@ if( WITH_PYTHONQT )
|
|||||||
viewpages/PythonQtGlobalStorageWrapper.cpp
|
viewpages/PythonQtGlobalStorageWrapper.cpp
|
||||||
viewpages/PythonQtUtilsWrapper.cpp
|
viewpages/PythonQtUtilsWrapper.cpp
|
||||||
)
|
)
|
||||||
set( OPTIONAL_PYTHON_LIBRARIES
|
endif()
|
||||||
${PYTHON_LIBRARIES}
|
|
||||||
${PYTHONQT_LIBRARIES}
|
if( WITH_QML )
|
||||||
|
list( APPEND calamaresui_SOURCES
|
||||||
|
utils/Qml.cpp
|
||||||
|
viewpages/QmlViewStep.cpp
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
calamares_add_library( calamaresui
|
calamares_add_library( calamaresui
|
||||||
SOURCES ${calamaresui_SOURCES}
|
SOURCES ${calamaresui_SOURCES}
|
||||||
EXPORT_MACRO UIDLLEXPORT_PRO
|
EXPORT_MACRO UIDLLEXPORT_PRO
|
||||||
LINK_PRIVATE_LIBRARIES
|
|
||||||
${OPTIONAL_PYTHON_LIBRARIES}
|
|
||||||
LINK_LIBRARIES
|
LINK_LIBRARIES
|
||||||
Qt5::Svg
|
Qt5::Svg
|
||||||
Qt5::QuickWidgets
|
|
||||||
RESOURCES libcalamaresui.qrc
|
RESOURCES libcalamaresui.qrc
|
||||||
EXPORT CalamaresLibraryDepends
|
EXPORT CalamaresLibraryDepends
|
||||||
VERSION ${CALAMARES_VERSION_SHORT}
|
VERSION ${CALAMARES_VERSION_SHORT}
|
||||||
)
|
)
|
||||||
|
|
||||||
if ( KF5CoreAddons_FOUND AND KF5CoreAddons_VERSION VERSION_GREATER_EQUAL 5.58 )
|
if( KF5CoreAddons_FOUND AND KF5CoreAddons_VERSION VERSION_GREATER_EQUAL 5.58 )
|
||||||
target_compile_definitions( calamaresui PRIVATE WITH_KOSRelease )
|
target_compile_definitions( calamaresui PRIVATE WITH_KOSRelease )
|
||||||
endif()
|
endif()
|
||||||
|
if( WITH_PYTHONQT )
|
||||||
|
# *_DIRS because we also use extensions
|
||||||
|
target_include_directories( calamaresui PRIVATE ${PYTHON_INCLUDE_DIRS} ${PYTHONQT_INCLUDE_DIRS} )
|
||||||
|
target_link_libraries( calamaresui PRIVATE ${PYTHON_LIBRARIES} ${PYTHONQT_LIBRARIES} )
|
||||||
|
endif()
|
||||||
|
if( WITH_QML )
|
||||||
|
target_link_libraries( calamaresui PUBLIC Qt5::QuickWidgets )
|
||||||
|
endif()
|
||||||
|
@ -23,11 +23,11 @@
|
|||||||
#include "Slideshow.h"
|
#include "Slideshow.h"
|
||||||
|
|
||||||
#include "Branding.h"
|
#include "Branding.h"
|
||||||
|
#include "CalamaresConfig.h"
|
||||||
#include "Job.h"
|
#include "Job.h"
|
||||||
#include "JobQueue.h"
|
#include "JobQueue.h"
|
||||||
#include "Settings.h"
|
#include "Settings.h"
|
||||||
#include "ViewManager.h"
|
#include "ViewManager.h"
|
||||||
|
|
||||||
#include "modulesystem/Module.h"
|
#include "modulesystem/Module.h"
|
||||||
#include "modulesystem/ModuleManager.h"
|
#include "modulesystem/ModuleManager.h"
|
||||||
#include "utils/CalamaresUtilsGui.h"
|
#include "utils/CalamaresUtilsGui.h"
|
||||||
@ -49,10 +49,12 @@ makeSlideshow( QWidget* parent )
|
|||||||
{
|
{
|
||||||
case -1:
|
case -1:
|
||||||
return new Calamares::SlideshowPictures( parent );
|
return new Calamares::SlideshowPictures( parent );
|
||||||
|
#ifdef WITH_QML
|
||||||
case 1:
|
case 1:
|
||||||
FALLTHRU;
|
FALLTHRU;
|
||||||
case 2:
|
case 2:
|
||||||
return new Calamares::SlideshowQML( parent );
|
return new Calamares::SlideshowQML( parent );
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
cWarning() << "Unknown Branding slideshow API" << api;
|
cWarning() << "Unknown Branding slideshow API" << api;
|
||||||
return new Calamares::SlideshowPictures( parent );
|
return new Calamares::SlideshowPictures( parent );
|
||||||
|
@ -28,10 +28,12 @@
|
|||||||
|
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QMutexLocker>
|
#include <QMutexLocker>
|
||||||
|
#ifdef WITH_QML
|
||||||
#include <QQmlComponent>
|
#include <QQmlComponent>
|
||||||
#include <QQmlEngine>
|
#include <QQmlEngine>
|
||||||
#include <QQuickItem>
|
#include <QQuickItem>
|
||||||
#include <QQuickWidget>
|
#include <QQuickWidget>
|
||||||
|
#endif
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
@ -41,6 +43,7 @@ namespace Calamares
|
|||||||
|
|
||||||
Slideshow::~Slideshow() {}
|
Slideshow::~Slideshow() {}
|
||||||
|
|
||||||
|
#ifdef WITH_QML
|
||||||
SlideshowQML::SlideshowQML( QWidget* parent )
|
SlideshowQML::SlideshowQML( QWidget* parent )
|
||||||
: Slideshow( parent )
|
: Slideshow( parent )
|
||||||
, m_qmlShow( new QQuickWidget )
|
, m_qmlShow( new QQuickWidget )
|
||||||
@ -173,6 +176,7 @@ SlideshowQML::changeSlideShowState( Action state )
|
|||||||
|
|
||||||
m_state = state;
|
m_state = state;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
SlideshowPictures::SlideshowPictures( QWidget* parent )
|
SlideshowPictures::SlideshowPictures( QWidget* parent )
|
||||||
: Slideshow( parent )
|
: Slideshow( parent )
|
||||||
|
@ -21,15 +21,19 @@
|
|||||||
#ifndef LIBCALAMARESUI_SLIDESHOW_H
|
#ifndef LIBCALAMARESUI_SLIDESHOW_H
|
||||||
#define LIBCALAMARESUI_SLIDESHOW_H
|
#define LIBCALAMARESUI_SLIDESHOW_H
|
||||||
|
|
||||||
|
#include "CalamaresConfig.h"
|
||||||
|
|
||||||
#include <QMutex>
|
#include <QMutex>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
class QLabel;
|
class QLabel;
|
||||||
class QTimer;
|
class QTimer;
|
||||||
|
#ifdef WITH_QML
|
||||||
class QQmlComponent;
|
class QQmlComponent;
|
||||||
class QQuickItem;
|
class QQuickItem;
|
||||||
class QQuickWidget;
|
class QQuickWidget;
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace Calamares
|
namespace Calamares
|
||||||
{
|
{
|
||||||
@ -81,6 +85,7 @@ protected:
|
|||||||
Action m_state = Stop;
|
Action m_state = Stop;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef WITH_QML
|
||||||
/** @brief Slideshow using a QML file
|
/** @brief Slideshow using a QML file
|
||||||
*
|
*
|
||||||
* This is the "classic" slideshow in Calamares, which runs some QML
|
* This is the "classic" slideshow in Calamares, which runs some QML
|
||||||
@ -109,6 +114,7 @@ private:
|
|||||||
QQmlComponent* m_qmlComponent;
|
QQmlComponent* m_qmlComponent;
|
||||||
QQuickItem* m_qmlObject; ///< The actual show
|
QQuickItem* m_qmlObject; ///< The actual show
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
/** @brief Slideshow using images
|
/** @brief Slideshow using images
|
||||||
*
|
*
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
if( NOT WITH_QML )
|
||||||
|
calamares_skip_module( "keyboardq (QML is not supported in this build)" )
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
set( _keyboard ${CMAKE_CURRENT_SOURCE_DIR}/../keyboard )
|
set( _keyboard ${CMAKE_CURRENT_SOURCE_DIR}/../keyboard )
|
||||||
|
|
||||||
include_directories( ${_keyboard} )
|
include_directories( ${_keyboard} )
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
if( NOT WITH_QML )
|
||||||
|
calamares_skip_module( "localeq (QML is not supported in this build)" )
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
# When debugging the timezone widget, add this debugging definition
|
# When debugging the timezone widget, add this debugging definition
|
||||||
# to have a debugging-friendly timezone widget, debug logging,
|
# to have a debugging-friendly timezone widget, debug logging,
|
||||||
# and no intrusive timezone-setting while clicking around.
|
# and no intrusive timezone-setting while clicking around.
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
if( NOT WITH_QML )
|
||||||
|
calamares_skip_module( "notesqml (QML is not supported in this build)" )
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
calamares_add_plugin( notesqml
|
calamares_add_plugin( notesqml
|
||||||
TYPE viewmodule
|
TYPE viewmodule
|
||||||
EXPORT_MACRO PLUGINDLLEXPORT_PRO
|
EXPORT_MACRO PLUGINDLLEXPORT_PRO
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
# This is a re-write of the welcome module using QML view steps
|
# This is a re-write of the welcome module using QML view steps
|
||||||
# instead of widgets.
|
# instead of widgets.
|
||||||
|
|
||||||
|
if( NOT WITH_QML )
|
||||||
|
calamares_skip_module( "welcomeq (QML is not supported in this build)" )
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
set( _welcome ${CMAKE_CURRENT_SOURCE_DIR}/../welcome )
|
set( _welcome ${CMAKE_CURRENT_SOURCE_DIR}/../welcome )
|
||||||
|
|
||||||
include_directories( ${PROJECT_BINARY_DIR}/src/libcalamaresui ${CMAKE_CURRENT_SOURCE_DIR}/../../libcalamares ${_welcome} )
|
include_directories( ${PROJECT_BINARY_DIR}/src/libcalamaresui ${CMAKE_CURRENT_SOURCE_DIR}/../../libcalamares ${_welcome} )
|
||||||
|
Loading…
Reference in New Issue
Block a user