diff --git a/src/calamares/CalamaresApplication.cpp b/src/calamares/CalamaresApplication.cpp index c7851d6b7..78b16e3bb 100644 --- a/src/calamares/CalamaresApplication.cpp +++ b/src/calamares/CalamaresApplication.cpp @@ -316,5 +316,6 @@ CalamaresApplication::onPluginsReady() void CalamaresApplication::initJobQueue() { - new Calamares::JobQueue( this ); + Calamares::JobQueue *jobQueue = new Calamares::JobQueue( this ); + Calamares::Branding::instance()->setGlobals( jobQueue->globalStorage() ); } diff --git a/src/libcalamaresui/Branding.cpp b/src/libcalamaresui/Branding.cpp index b1672f899..8943f9ea9 100644 --- a/src/libcalamaresui/Branding.cpp +++ b/src/libcalamaresui/Branding.cpp @@ -18,6 +18,7 @@ #include "Branding.h" +#include "GlobalStorage.h" #include "utils/CalamaresUtils.h" #include "utils/Logger.h" #include "utils/YamlUtils.h" @@ -26,6 +27,7 @@ #include #include #include +#include #include @@ -200,6 +202,19 @@ Branding::slideshowPaths() const } +void +Branding::setGlobals( GlobalStorage* globalStorage ) const +{ + QVariantMap brandingMap; + brandingMap.insert( "productName", string( ProductName ) ); + brandingMap.insert( "version", string( Version ) ); + brandingMap.insert( "shortVersion", string( ShortVersion ) ); + brandingMap.insert( "versionedName", string( VersionedName ) ); + brandingMap.insert( "shortVersionedName", string( ShortVersionedName ) ); + globalStorage->insert( "branding", brandingMap ); +} + + void Branding::bail( const QString& message ) { diff --git a/src/libcalamaresui/Branding.h b/src/libcalamaresui/Branding.h index d86c92878..991aafa39 100644 --- a/src/libcalamaresui/Branding.h +++ b/src/libcalamaresui/Branding.h @@ -30,6 +30,8 @@ namespace Calamares { +class GlobalStorage; + class UIDLLEXPORT Branding : public QObject { Q_OBJECT @@ -63,6 +65,13 @@ public: QPixmap image( Branding::ImageEntry imageEntry, const QSize& size ) const; QStringList slideshowPaths() const; + /** + * Creates a map called "branding" in the global storage, and inserts an + * entry for each of the branding strings. This makes the branding + * information accessible to the Python modules. + */ + void setGlobals( GlobalStorage* globalStorage ) const; + private: static Branding* s_instance;