Merge branch 'calamares' of https://github.com/calamares/calamares into development
This commit is contained in:
commit
484a038e68
9
CHANGES
9
CHANGES
@ -7,13 +7,14 @@ contributors are listed. Note that Calamares does not have a historical
|
||||
changelog -- this log starts with version 3.2.0. The release notes on the
|
||||
website will have to do for older versions.
|
||||
|
||||
# 3.2.30 (unreleased) #
|
||||
# 3.2.30 (2020-09-03) #
|
||||
|
||||
This release contains contributions from (alphabetically by first name):
|
||||
- Anke Boersma
|
||||
- Asif Mahmud Shimon
|
||||
- Manzoor Ahmed Munawar
|
||||
- Sai Kamal
|
||||
- Victor Ibragimov
|
||||
|
||||
This release has two giant source-code changes that have no effect
|
||||
on functionality, but do touch each and every source file:
|
||||
@ -32,11 +33,17 @@ on functionality, but do touch each and every source file:
|
||||
via a synchronous ping. (Thanks to Asif)
|
||||
- New Telugu translation. (Thanks to Sai)
|
||||
- Urdu translation started. (Thanks to Manzoor)
|
||||
- Timezones translated in Tajik and Russian. (Thanks to Victor)
|
||||
|
||||
## Modules ##
|
||||
- *keyboardq* and *localeq* improvements. (Thanks to Anke)
|
||||
- *users* module did not set up autologin properly. This is yet another
|
||||
regression left over from 3.2.28. (Reported by Phil and pcrepix, #1498)
|
||||
- *welcome* module now sets the *LANG* key in the locale configuration
|
||||
(which is shared with the *locale* module and consumed by the
|
||||
*localecfg* module). This makes it feasible to drop the *locale*
|
||||
module and still set the installed system's language to the language
|
||||
selected in Calamares. (Reported by FerenOS)
|
||||
|
||||
|
||||
# 3.2.29 (2020-08-20) #
|
||||
|
@ -44,7 +44,7 @@ project( CALAMARES
|
||||
VERSION 3.2.30
|
||||
LANGUAGES C CXX )
|
||||
|
||||
set( CALAMARES_VERSION_RC 1 ) # Set to 0 during release cycle, 1 during development
|
||||
set( CALAMARES_VERSION_RC 0 ) # Set to 0 during release cycle, 1 during development
|
||||
|
||||
### OPTIONS
|
||||
#
|
||||
|
2620
lang/tz_ru.ts
Normal file
2620
lang/tz_ru.ts
Normal file
File diff suppressed because it is too large
Load Diff
@ -58,7 +58,7 @@
|
||||
<location filename="../src/libcalamares/locale/ZoneData_p.cxxtr" line="38"/>
|
||||
<source>Indian</source>
|
||||
<comment>tz_regions</comment>
|
||||
<translation>Ҳиндӣ</translation>
|
||||
<translation>Уқёнуси Ҳинд</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/libcalamares/locale/ZoneData_p.cxxtr" line="39"/>
|
||||
|
@ -39,6 +39,7 @@ set( libSources
|
||||
geoip/Handler.cpp
|
||||
|
||||
# Locale-data service
|
||||
locale/Global.cpp
|
||||
locale/Label.cpp
|
||||
locale/LabelModel.cpp
|
||||
locale/Lookup.cpp
|
||||
|
@ -135,6 +135,7 @@ public:
|
||||
{
|
||||
emitProgress( 1.0 );
|
||||
}
|
||||
m_runningJobs->clear();
|
||||
QMetaObject::invokeMethod( m_queue, "finish", Qt::QueuedConnection );
|
||||
}
|
||||
|
||||
|
@ -77,9 +77,15 @@ signals:
|
||||
*/
|
||||
void queueChanged( const QStringList& jobNames );
|
||||
|
||||
private:
|
||||
public slots:
|
||||
/** @brief Implementation detail
|
||||
*
|
||||
* This is a private implementation detail for the job thread,
|
||||
* which should not be called by other core.
|
||||
*/
|
||||
void finish();
|
||||
|
||||
private:
|
||||
static JobQueue* s_instance;
|
||||
|
||||
JobThread* m_thread;
|
||||
|
78
src/libcalamares/locale/Global.cpp
Normal file
78
src/libcalamares/locale/Global.cpp
Normal file
@ -0,0 +1,78 @@
|
||||
/* === This file is part of Calamares - <https://calamares.io> ===
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2020 Adriaan de Groot <groot@kde.org>
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* Calamares is Free Software: see the License-Identifier above.
|
||||
*
|
||||
*
|
||||
*/
|
||||
#include "Global.h"
|
||||
|
||||
#include "GlobalStorage.h"
|
||||
#include "utils/Logger.h"
|
||||
|
||||
namespace CalamaresUtils
|
||||
{
|
||||
namespace Locale
|
||||
{
|
||||
|
||||
static const char gsKey[] = "localeConf";
|
||||
|
||||
template < typename T >
|
||||
void
|
||||
insertGS( const QMap< QString, T >& values, QVariantMap& localeConf )
|
||||
{
|
||||
for ( auto it = values.constBegin(); it != values.constEnd(); ++it )
|
||||
{
|
||||
localeConf.insert( it.key(), it.value() );
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
insertGS( Calamares::GlobalStorage& gs, const QMap< QString, QString >& values, InsertMode mode )
|
||||
{
|
||||
QVariantMap localeConf = mode == InsertMode::Overwrite ? QVariantMap() : gs.value( gsKey ).toMap();
|
||||
insertGS( values, localeConf );
|
||||
gs.insert( gsKey, localeConf );
|
||||
}
|
||||
|
||||
void
|
||||
insertGS( Calamares::GlobalStorage& gs, const QVariantMap& values, InsertMode mode )
|
||||
{
|
||||
QVariantMap localeConf = mode == InsertMode::Overwrite ? QVariantMap() : gs.value( gsKey ).toMap();
|
||||
insertGS( values, localeConf );
|
||||
gs.insert( gsKey, localeConf );
|
||||
}
|
||||
|
||||
void
|
||||
insertGS( Calamares::GlobalStorage& gs, const QString& key, const QString& value )
|
||||
{
|
||||
QVariantMap localeConf = gs.value( gsKey ).toMap();
|
||||
localeConf.insert( key, value );
|
||||
gs.insert( gsKey, localeConf );
|
||||
}
|
||||
|
||||
void
|
||||
removeGS( Calamares::GlobalStorage& gs, const QString& key )
|
||||
{
|
||||
if ( gs.contains( gsKey ) )
|
||||
{
|
||||
QVariantMap localeConf = gs.value( gsKey ).toMap();
|
||||
if ( localeConf.contains( key ) )
|
||||
{
|
||||
localeConf.remove( key );
|
||||
gs.insert( gsKey, localeConf );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
clearGS( Calamares::GlobalStorage& gs )
|
||||
{
|
||||
gs.remove( gsKey );
|
||||
}
|
||||
|
||||
|
||||
} // namespace Locale
|
||||
} // namespace CalamaresUtils
|
82
src/libcalamares/locale/Global.h
Normal file
82
src/libcalamares/locale/Global.h
Normal file
@ -0,0 +1,82 @@
|
||||
/* === This file is part of Calamares - <https://calamares.io> ===
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2020 Adriaan de Groot <groot@kde.org>
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* Calamares is Free Software: see the License-Identifier above.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
/** @file GlobalStorage management for Locale settings
|
||||
*
|
||||
* The *localeConf* key in Global Storage is semi-structured,
|
||||
* and there are multiple modules that write to it (and some that
|
||||
* read from it). Functions in this file provide access to
|
||||
* that semi-structured data.
|
||||
*/
|
||||
|
||||
#ifndef LOCALE_GLOBAL_H
|
||||
#define LOCALE_GLOBAL_H
|
||||
|
||||
#include "DllMacro.h"
|
||||
|
||||
#include <QMap>
|
||||
#include <QString>
|
||||
#include <QVariantMap>
|
||||
|
||||
namespace Calamares
|
||||
{
|
||||
class GlobalStorage;
|
||||
}
|
||||
|
||||
namespace CalamaresUtils
|
||||
{
|
||||
namespace Locale
|
||||
{
|
||||
|
||||
/** @brief Selector for methods that insert multiple values.
|
||||
*
|
||||
* When inserting, use @c Overwrite to remove all keys not in the collection
|
||||
* of values being inserted; use @c Merge to preserve whatever is
|
||||
* already in Global Storage but not mentioned in the collection.
|
||||
*/
|
||||
enum class InsertMode
|
||||
{
|
||||
Overwrite,
|
||||
Merge
|
||||
};
|
||||
|
||||
/** @brief Insert the given @p values into the *localeConf* map in @p gs
|
||||
*
|
||||
* @param gs The Global Storage to write to
|
||||
* @param values The collection of keys and values to write to @p gs
|
||||
* @param mode Indicates whether the *localeConf* key is cleared first
|
||||
*
|
||||
* The keys in the collection @p values should be first-level keys
|
||||
* in *localeConf*, e.g. "LANG" or "LC_TIME". No effort is made to
|
||||
* enforce this.
|
||||
*/
|
||||
DLLEXPORT void
|
||||
insertGS( Calamares::GlobalStorage& gs, const QVariantMap& values, InsertMode mode = InsertMode::Merge );
|
||||
/** @brief Insert the given @p values into the *localeConf* map in @p gs
|
||||
*
|
||||
* Alternate way of providing the keys and values.
|
||||
*/
|
||||
DLLEXPORT void insertGS( Calamares::GlobalStorage& gs,
|
||||
const QMap< QString, QString >& values,
|
||||
InsertMode mode = InsertMode::Merge );
|
||||
/** @brief Write a single @p key and @p value to the *localeConf* map
|
||||
*/
|
||||
DLLEXPORT void insertGS( Calamares::GlobalStorage& gs, const QString& key, const QString& value );
|
||||
/** @brief Remove a single @p key from the *localeConf* map
|
||||
*/
|
||||
DLLEXPORT void removeGS( Calamares::GlobalStorage& gs, const QString& key );
|
||||
/** @brief Remove the *localeConf* map from Global Storage
|
||||
*/
|
||||
DLLEXPORT void clearGS( Calamares::GlobalStorage& gs );
|
||||
|
||||
} // namespace Locale
|
||||
} // namespace CalamaresUtils
|
||||
|
||||
#endif
|
@ -8,11 +8,13 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "locale/Global.h"
|
||||
#include "locale/LabelModel.h"
|
||||
#include "locale/TimeZone.h"
|
||||
#include "locale/TranslatableConfiguration.h"
|
||||
|
||||
#include "CalamaresVersion.h"
|
||||
#include "GlobalStorage.h"
|
||||
#include "utils/Logger.h"
|
||||
|
||||
#include <QtTest/QtTest>
|
||||
@ -45,6 +47,9 @@ private Q_SLOTS:
|
||||
void testLocationLookup_data();
|
||||
void testLocationLookup();
|
||||
void testLocationLookup2();
|
||||
|
||||
// Global Storage updates
|
||||
void testGSUpdates();
|
||||
};
|
||||
|
||||
LocaleTests::LocaleTests() {}
|
||||
@ -446,6 +451,72 @@ LocaleTests::testLocationLookup2()
|
||||
QCOMPARE( trunc( altzone->latitude() * 1000.0 ), -29466 );
|
||||
}
|
||||
|
||||
void
|
||||
LocaleTests::testGSUpdates()
|
||||
{
|
||||
Calamares::GlobalStorage gs;
|
||||
|
||||
const QString gsKey( "localeConf" );
|
||||
|
||||
QCOMPARE( gs.value( gsKey ), QVariant() );
|
||||
|
||||
// Insert one
|
||||
{
|
||||
CalamaresUtils::Locale::insertGS( gs, "LANG", "en_US" );
|
||||
auto map = gs.value( gsKey ).toMap();
|
||||
QCOMPARE( map.count(), 1 );
|
||||
QCOMPARE( map.value( "LANG" ).toString(), QString( "en_US" ) );
|
||||
}
|
||||
|
||||
// Overwrite one
|
||||
{
|
||||
CalamaresUtils::Locale::insertGS( gs, "LANG", "nl_BE" );
|
||||
auto map = gs.value( gsKey ).toMap();
|
||||
QCOMPARE( map.count(), 1 );
|
||||
QCOMPARE( map.value( "LANG" ).toString(), QString( "nl_BE" ) );
|
||||
}
|
||||
|
||||
// Insert a second value
|
||||
{
|
||||
CalamaresUtils::Locale::insertGS( gs, "LC_TIME", "UTC" );
|
||||
auto map = gs.value( gsKey ).toMap();
|
||||
QCOMPARE( map.count(), 2 );
|
||||
QCOMPARE( map.value( "LANG" ).toString(), QString( "nl_BE" ) );
|
||||
QCOMPARE( map.value( "LC_TIME" ).toString(), QString( "UTC" ) );
|
||||
}
|
||||
|
||||
// Overwrite parts
|
||||
{
|
||||
QMap< QString, QString > kv;
|
||||
kv.insert( "LANG", "en_SU" );
|
||||
kv.insert( "LC_CURRENCY", "rbl" );
|
||||
|
||||
// Overwrite one, add one
|
||||
CalamaresUtils::Locale::insertGS( gs, kv, CalamaresUtils::Locale::InsertMode::Merge );
|
||||
auto map = gs.value( gsKey ).toMap();
|
||||
QCOMPARE( map.count(), 3 );
|
||||
QCOMPARE( map.value( "LANG" ).toString(), QString( "en_SU" ) );
|
||||
QCOMPARE( map.value( "LC_TIME" ).toString(), QString( "UTC" ) ); // unchanged
|
||||
QCOMPARE( map.value( "LC_CURRENCY" ).toString(), QString( "rbl" ) );
|
||||
}
|
||||
|
||||
// Overwrite with clear
|
||||
{
|
||||
QMap< QString, QString > kv;
|
||||
kv.insert( "LANG", "en_US" );
|
||||
kv.insert( "LC_CURRENCY", "peso" );
|
||||
|
||||
// Overwrite one, add one
|
||||
CalamaresUtils::Locale::insertGS( gs, kv, CalamaresUtils::Locale::InsertMode::Overwrite );
|
||||
auto map = gs.value( gsKey ).toMap();
|
||||
QCOMPARE( map.count(), 2 ); // the rest were cleared
|
||||
QCOMPARE( map.value( "LANG" ).toString(), QString( "en_US" ) );
|
||||
QVERIFY( !map.contains( "LC_TIME" ) );
|
||||
QCOMPARE( map.value( "LC_TIME" ).toString(), QString() ); // removed
|
||||
QCOMPARE( map.value( "LC_CURRENCY" ).toString(), QString( "peso" ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
QTEST_GUILESS_MAIN( LocaleTests )
|
||||
|
||||
|
@ -117,11 +117,8 @@ SlideshowQML::loadQmlV2Complete()
|
||||
{
|
||||
// We're alreay visible! Must have been slow QML loading, and we
|
||||
// passed onActivate already. changeSlideShowState() locks
|
||||
// the same mutex: we could set up a workaround to call
|
||||
// changeSlideShowState() later after destruction of l.
|
||||
//
|
||||
l.unlock();
|
||||
changeSlideShowState( Slideshow::Start );
|
||||
// the same mutex: call changeSlideShowState() after l is dead.
|
||||
QTimer::singleShot( 0, this, &SlideshowQML::startSlideShow );
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -142,6 +139,13 @@ SlideshowQML::loadQmlV2Complete()
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
SlideshowQML::startSlideShow()
|
||||
{
|
||||
changeSlideShowState( Slideshow::Start );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Applies V1 and V2 QML activation / deactivation:
|
||||
* - V1 loads the QML in @p widget on activation. Sets root object property
|
||||
|
@ -100,6 +100,9 @@ public slots:
|
||||
void loadQmlV2Complete();
|
||||
void loadQmlV2(); ///< Loads the slideshow QML (from branding) for API version 2
|
||||
|
||||
/// Implementation detail
|
||||
void startSlideShow();
|
||||
|
||||
private:
|
||||
QQuickWidget* m_qmlShow;
|
||||
QQmlComponent* m_qmlComponent;
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include "GlobalStorage.h"
|
||||
#include "JobQueue.h"
|
||||
#include "Settings.h"
|
||||
#include "locale/Global.h"
|
||||
#include "locale/Label.h"
|
||||
#include "modulesystem/ModuleManager.h"
|
||||
#include "network/Manager.h"
|
||||
@ -167,13 +168,7 @@ updateGSLocation( Calamares::GlobalStorage* gs, const CalamaresUtils::Locale::Ti
|
||||
static void
|
||||
updateGSLocale( Calamares::GlobalStorage* gs, const LocaleConfiguration& locale )
|
||||
{
|
||||
auto map = locale.toMap();
|
||||
QVariantMap vm;
|
||||
for ( auto it = map.constBegin(); it != map.constEnd(); ++it )
|
||||
{
|
||||
vm.insert( it.key(), it.value() );
|
||||
}
|
||||
gs->insert( "localeConf", vm );
|
||||
CalamaresUtils::Locale::insertGS( *gs, locale.toMap(), CalamaresUtils::Locale::InsertMode::Overwrite );
|
||||
}
|
||||
|
||||
Config::Config( QObject* parent )
|
||||
|
@ -10,8 +10,11 @@
|
||||
#include "Config.h"
|
||||
|
||||
#include "Branding.h"
|
||||
#include "GlobalStorage.h"
|
||||
#include "JobQueue.h"
|
||||
#include "Settings.h"
|
||||
#include "geoip/Handler.h"
|
||||
#include "locale/Global.h"
|
||||
#include "locale/Lookup.h"
|
||||
#include "modulesystem/ModuleManager.h"
|
||||
#include "utils/Logger.h"
|
||||
@ -186,7 +189,12 @@ Config::setLocaleIndex( int index )
|
||||
|
||||
QLocale::setDefault( selectedLocale );
|
||||
CalamaresUtils::installTranslator( selectedLocale, Calamares::Branding::instance()->translationsDirectory() );
|
||||
|
||||
if ( Calamares::JobQueue::instance() && Calamares::JobQueue::instance()->globalStorage() )
|
||||
{
|
||||
CalamaresUtils::Locale::insertGS( *Calamares::JobQueue::instance()->globalStorage(),
|
||||
QStringLiteral( "LANG" ),
|
||||
CalamaresUtils::translatorLocaleName() );
|
||||
}
|
||||
emit localeIndexChanged( m_localeIndex );
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user