Merge branch 'master' of https://github.com/calamares/calamares into development

This commit is contained in:
Philip Müller 2019-05-28 07:34:20 +02:00
commit 6cf365e11d
9 changed files with 81 additions and 37 deletions

View File

@ -15,6 +15,10 @@ This release contains contributions from (alphabetically by first name):
- *branding* now supports os-release variables in the *strings* section, - *branding* now supports os-release variables in the *strings* section,
which allows re-using (at runtime) information set in /etc/os-release . which allows re-using (at runtime) information set in /etc/os-release .
This requires KDE Frameworks 5.58. #1150 This requires KDE Frameworks 5.58. #1150
- *branding* allows the use of FreeDesktop.org icon names for the
*productLogo* and *productIcon* keys. If a file is named there, then
the file is used, and otherwise the icon is looked up in the current
theme.
# 3.2.8 (2019-05-10) # # 3.2.8 (2019-05-10) #

View File

@ -7,14 +7,26 @@
# path to a directory or the keyword "local". # path to a directory or the keyword "local".
# #
# "local" means: # "local" means:
# - modules in $LIBDIR/calamares/moduleswith # - modules in $LIBDIR/calamares/modules, with
# - settings in SHARE/calamares/modules or /etc/calamares/modules. # - settings in SHARE/calamares/modules or /etc/calamares/modules.
# In debug-mode (e.g. calamares -d) "local" also adds some paths
# that make sense from inside the build-directory, so that you
# can build-and-run with the latest modules immediately.
#
# Strings other than "local" are taken as paths and interpreted
# relative to wherever Calamares is started. It is therefore **strongly**
# recommended to use only absolute paths here. This is mostly useful
# if your distro has forks of standard Calamares modules, but also
# uses some form of upstream packaging which might overwrite those
# forked modules -- then you can keep modules somewhere outside of
# the "regular" module tree.
#
# #
# YAML: list of strings. # YAML: list of strings.
modules-search: [ local ] modules-search: [ local ]
# Instances section. This section is optional, and it defines custom instances # Instances section. This section is optional, and it defines custom instances
# for modules of any kind. An instance entry has an instance name, a module # for modules of any kind. An instance entry has an module name, an instance
# name, and a configuration file name. The primary goal of this mechanism is # name, and a configuration file name. The primary goal of this mechanism is
# to allow loading multiple instances of the same module, with different # to allow loading multiple instances of the same module, with different
# configuration. If you don't need this, the instances section can safely be # configuration. If you don't need this, the instances section can safely be
@ -22,24 +34,27 @@ modules-search: [ local ]
# #
# Module name plus instance name makes an instance key, e.g. # Module name plus instance name makes an instance key, e.g.
# "webview@owncloud", where "webview" is the module name (for the webview # "webview@owncloud", where "webview" is the module name (for the webview
# viewmodule) and "owncloud" is the instance name, which loads a configuration # viewmodule) and "owncloud" is the instance name. In the *sequence*
# file named "owncloud.conf" from any of the configuration file paths, # section below, use instance-keys to name instances (instead of just
# including the webview module directory. This instance key can then be # a module name, for modules which have only a single instance).
# referenced in the sequence section.
# #
# For all modules without a custom instance specification, a default instance # Every module implicitly has an instance with the instance name equal
# is generated automatically by Calamares. Therefore a statement such as # to its module name, e.g. "welcome@welcome". In the *sequence* section,
# "webview" in the sequence section automatically implies an instance key of # mentioning a module without a full instance key (e.g. "welcome")
# "webview@webview" even without explicitly defining this instance, and the # means that implicit module.
# configuration file for this default instance "<modulename>@<modulename>" is #
# always assumed to be "<modulename>.conf". # An instance must specify its configuration file (e.g. `webview-home.conf`).
# The implicit instances all have configuration files named `<module>.conf`.
# This (implict) way matches the source examples, where the welcome
# module contains an example `welcome.conf`.
# #
# For more information on running module instances, run Calamares in debug # For more information on running module instances, run Calamares in debug
# mode and check the Modules page in the Debug information interface. # mode and check the Modules page in the Debug information interface.
# #
# A module that is often used with instances is dummyprocess, which will # A module that is often used with instances is shellprocess, which will
# run a single (shell) command. By configuring more than one instance of # run shell commands specified in the configuration file. By configuring
# the module, multiple shell commands can be run during install. # more than one instance of the module, multiple shell sessions can be run
# during install.
# #
# YAML: list of maps of string:string key-value pairs. # YAML: list of maps of string:string key-value pairs.
#instances: #instances:

View File

@ -363,6 +363,12 @@ CalamaresApplication::initViewSteps()
ProgressTreeModel* m = new ProgressTreeModel( nullptr ); ProgressTreeModel* m = new ProgressTreeModel( nullptr );
ProgressTreeView::instance()->setModel( m ); ProgressTreeView::instance()->setModel( m );
cDebug() << "STARTUP: Window now visible and ProgressTreeView populated"; cDebug() << "STARTUP: Window now visible and ProgressTreeView populated";
const auto steps = Calamares::ViewManager::instance()->viewSteps();
cDebug() << Logger::SubEntry << steps.count() << "view steps loaded.";
// Tell the first view that it's been shown.
if ( steps.count() > 0 )
steps[0]->onActivate();
} }
void void

View File

@ -132,6 +132,7 @@ CalamaresWindow::CalamaresWindow( QWidget* parent )
if ( Calamares::Settings::instance()->debugMode() ) if ( Calamares::Settings::instance()->debugMode() )
{ {
QPushButton* debugWindowBtn = new QPushButton; QPushButton* debugWindowBtn = new QPushButton;
debugWindowBtn->setObjectName( "debugButton" );
CALAMARES_RETRANSLATE( CALAMARES_RETRANSLATE(
debugWindowBtn->setText( tr( "Show debug information" ) ); debugWindowBtn->setText( tr( "Show debug information" ) );
) )

View File

@ -1,7 +1,7 @@
/* === This file is part of Calamares - <https://github.com/calamares> === /* === This file is part of Calamares - <https://github.com/calamares> ===
* *
* Copyright 2014-2015, Teo Mrnjavac <teo@kde.org> * Copyright 2014-2015, Teo Mrnjavac <teo@kde.org>
* Copyright 2017-2018, Adriaan de Groot <groot@kde.org> * Copyright 2017-2019, Adriaan de Groot <groot@kde.org>
* Copyright 2018, Raul Rodrigo Segura (raurodse) * Copyright 2018, Raul Rodrigo Segura (raurodse)
* *
* Calamares is free software: you can redistribute it and/or modify * Calamares is free software: you can redistribute it and/or modify
@ -29,6 +29,7 @@
#include <QDir> #include <QDir>
#include <QFile> #include <QFile>
#include <QIcon>
#include <QPixmap> #include <QPixmap>
#include <QVariantMap> #include <QVariantMap>
@ -185,9 +186,16 @@ Branding::Branding( const QString& brandingFilePath,
loadStrings( m_images, doc, "images", loadStrings( m_images, doc, "images",
[&]( const QString& s ) -> QString [&]( const QString& s ) -> QString
{ {
QFileInfo imageFi( componentDir.absoluteFilePath( expand( s ) ) ); const QString imageName( expand( s ) );
QFileInfo imageFi( componentDir.absoluteFilePath( imageName ) );
if ( !imageFi.exists() ) if ( !imageFi.exists() )
bail( QString( "Image file %1 does not exist." ).arg( imageFi.absoluteFilePath() ) ); {
const auto icon = QIcon::fromTheme( imageName );
// Not found, bail out with the filename used
if ( icon.isNull() )
bail( QString( "Image file %1 does not exist." ).arg( imageFi.absoluteFilePath() ) );
return imageName; // Not turned into a path
}
return imageFi.absoluteFilePath(); return imageFi.absoluteFilePath();
} }
); );
@ -289,15 +297,21 @@ Branding::imagePath( Branding::ImageEntry imageEntry ) const
QPixmap QPixmap
Branding::image( Branding::ImageEntry imageEntry, const QSize& size ) const Branding::image( Branding::ImageEntry imageEntry, const QSize& size ) const
{ {
QPixmap pixmap = const auto path = imagePath( imageEntry );
ImageRegistry::instance()->pixmap( imagePath( imageEntry ), size ); if ( path.contains( '/' ) )
if ( pixmap.isNull() )
{ {
Q_ASSERT( false ); QPixmap pixmap = ImageRegistry::instance()->pixmap( path, size );
return QPixmap();
Q_ASSERT( !pixmap.isNull() );
return pixmap;
}
else
{
auto icon = QIcon::fromTheme(path);
Q_ASSERT( !icon.isNull() );
return icon.pixmap( size );
} }
return pixmap;
} }
QString QString

View File

@ -99,12 +99,18 @@ RequirementsChecker::run()
void void
RequirementsChecker::finished() RequirementsChecker::finished()
{ {
if ( std::all_of( m_watchers.cbegin(), m_watchers.cend(), []( const Watcher *w ) { return w && w->isFinished(); } ) ) static QMutex finishedMutex;
QMutexLocker lock( &finishedMutex );
if ( m_progressTimer && std::all_of( m_watchers.cbegin(), m_watchers.cend(), []( const Watcher *w ) { return w && w->isFinished(); } ) )
{ {
cDebug() << "All requirements have been checked."; cDebug() << "All requirements have been checked.";
if ( m_progressTimer ) if ( m_progressTimer )
{
m_progressTimer->stop(); m_progressTimer->stop();
delete m_progressTimer;
m_progressTimer = nullptr;
}
bool acceptable = true; bool acceptable = true;
int count = 0; int count = 0;

View File

@ -61,9 +61,9 @@ ImageRegistry::cacheKey( const QSize& size, float opacity, QColor tint )
QPixmap QPixmap
ImageRegistry::pixmap( const QString& image, const QSize& size, CalamaresUtils::ImageMode mode, float opacity, QColor tint ) ImageRegistry::pixmap( const QString& image, const QSize& size, CalamaresUtils::ImageMode mode, float opacity, QColor tint )
{ {
Q_ASSERT( !(size.width() < 0 || size.height() < 0) );
if ( size.width() < 0 || size.height() < 0 ) if ( size.width() < 0 || size.height() < 0 )
{ {
Q_ASSERT( false );
return QPixmap(); return QPixmap();
} }
@ -159,15 +159,9 @@ ImageRegistry::putInCache( const QString& image, const QSize& size, CalamaresUti
if ( s_cache.contains( image ) ) if ( s_cache.contains( image ) )
{ {
subcache = s_cache.value( image ); subcache = s_cache.value( image );
if ( subcache.contains( mode ) ) if ( subcache.contains( mode ) )
{ {
subsubcache = subcache.value( mode ); subsubcache = subcache.value( mode );
/* if ( subsubcache.contains( size.width() * size.height() ) )
{
Q_ASSERT( false );
}*/
} }
} }

View File

@ -20,6 +20,8 @@
#include "InteractiveTerminalPage.h" #include "InteractiveTerminalPage.h"
#include "utils/Logger.h"
#include <QVariant> #include <QVariant>
CALAMARES_PLUGIN_FACTORY_DEFINITION( InteractiveTerminalViewStepFactory, registerPlugin<InteractiveTerminalViewStep>(); ) CALAMARES_PLUGIN_FACTORY_DEFINITION( InteractiveTerminalViewStepFactory, registerPlugin<InteractiveTerminalViewStep>(); )
@ -84,6 +86,7 @@ InteractiveTerminalViewStep::isAtEnd() const
QList< Calamares::job_ptr > QList< Calamares::job_ptr >
InteractiveTerminalViewStep::jobs() const InteractiveTerminalViewStep::jobs() const
{ {
cDebug() << "InteractiveTerminal" << prettyName() << "asked for jobs(), this is probably wrong.";
return QList< Calamares::job_ptr >(); return QList< Calamares::job_ptr >();
} }
@ -91,6 +94,7 @@ InteractiveTerminalViewStep::jobs() const
void void
InteractiveTerminalViewStep::onActivate() InteractiveTerminalViewStep::onActivate()
{ {
cDebug() << "InteractiveTerminal" << prettyName() << "activated.";
m_widget->onActivate(); m_widget->onActivate();
} }

View File

@ -290,7 +290,7 @@ class PMPacman(PackageManager):
check_target_env_call(["pacman", "-Sy"]) check_target_env_call(["pacman", "-Sy"])
def update_system(self): def update_system(self):
check_target_env_call(["pacman", "-Su"]) check_target_env_call(["pacman", "-Su", "--noconfirm"])
class PMPortage(PackageManager): class PMPortage(PackageManager):