Compare commits

..

8 Commits

22
debian/changelog vendored

@ -1,3 +1,25 @@
lubuntu-installer-prompt (1.1.1-0ubuntu2) noble; urgency=medium
* Ensure C is not the default locale, to the user.
-- Simon Quigley <tsimonq2@ubuntu.com> Sat, 23 Dec 2023 18:03:34 -0600
lubuntu-installer-prompt (1.1.1-0ubuntu1) noble; urgency=medium
* New upstream release (LP: #2046099).
-- Simon Quigley <tsimonq2@ubuntu.com> Sat, 23 Dec 2023 17:06:34 -0600
lubuntu-installer-prompt (1.0.1-0ubuntu1) noble; urgency=medium
* New upstream release.
* Update Standards-version to 4.6.2, no changes needed.
* Update Vcs-*.
* Update build dependencies.
* Update Lintian overrides.
-- Simon Quigley <tsimonq2@ubuntu.com> Sat, 09 Dec 2023 15:07:07 -0600
lubuntu-installer-prompt (0.2.0-0ubuntu1) kinetic; urgency=medium lubuntu-installer-prompt (0.2.0-0ubuntu1) kinetic; urgency=medium
* Initial release. * Initial release.

19
debian/control vendored

@ -4,19 +4,22 @@ Uploaders: Simon Quigley <tsimonq2@ubuntu.com>,
Aaron Rainbolt <arraybolt3@gmail.com> Aaron Rainbolt <arraybolt3@gmail.com>
Section: misc Section: misc
Priority: optional Priority: optional
Build-Depends: cmake, debhelper-compat (= 13), qt6-base-dev, qt6-tools-dev Build-Depends: cmake,
Standards-Version: 4.6.1 debhelper-compat (= 13),
Vcs-Browser: https://github.com/lubuntu-team/installer-prompt/ extra-cmake-modules,
Vcs-Git: https://github.com/lubuntu-team/installer-prompt.git libkf5networkmanagerqt-dev,
libkf5widgetsaddons-dev,
qtbase5-dev,
qttools5-dev
Standards-Version: 4.6.2
Vcs-Browser: https://git.lubuntu.me/Lubuntu/installer-prompt-packaging
Vcs-Git: https://git.lubuntu.me/Lubuntu/installer-prompt-packaging.git
Homepage: https://lubuntu.me Homepage: https://lubuntu.me
Rules-Requires-Root: no Rules-Requires-Root: no
Package: lubuntu-installer-prompt Package: lubuntu-installer-prompt
Architecture: any Architecture: any
Depends: calamares-settings-lubuntu, Depends: calamares-settings-lubuntu, ${misc:Depends}, ${shlibs:Depends}
qt6-qpa-plugins,
${misc:Depends},
${shlibs:Depends}
Pre-Depends: ${misc:Pre-Depends} Pre-Depends: ${misc:Pre-Depends}
Description: Live ISO prompt for trying or installing Lubuntu Description: Live ISO prompt for trying or installing Lubuntu
This application displays a screen allowing the user to either try or This application displays a screen allowing the user to either try or

1
debian/files vendored

@ -0,0 +1 @@
lubuntu-installer-prompt_1.1.1-0ubuntu2_source.buildinfo misc optional

@ -1,3 +1,8 @@
# No CLI interface, and one of these is an internal component of the package. lubuntu-installer-prompt: no-manual-page [usr/bin/lubuntu-installer-prompt]
lubuntu-installer-prompt: no-manual-page usr/bin/lubuntu-installer lubuntu-installer-prompt: no-manual-page [usr/libexec/start-lubuntu-live-env]
lubuntu-installer-prompt: no-manual-page usr/bin/lubuntu-installer-prompt lubuntu-installer-prompt: no-manual-page [usr/libexec/change-system-language]
lubuntu-installer-prompt: no-manual-page [usr/libexec/lubuntu-installer]
lubuntu-installer-prompt: desktop-entry-lacks-icon-entry [usr/share/xsessions/lubuntu-live-environment.desktop]
lubuntu-installer-prompt: desktop-entry-lacks-keywords-entry [usr/share/xsessions/lubuntu-live-environment.desktop]
lubuntu-installer-prompt: spelling-error-in-binary CyMK CMYK [usr/bin/lubuntu-installer-prompt]
lubuntu-installer-prompt: spelling-error-in-binary NAm Name [usr/bin/lubuntu-installer-prompt]

@ -0,0 +1,72 @@
commit 7ac27098cf9c03fa02d9bac4536f7d6ee3159e42
Author: Simon Quigley <simon@tsimonq2.net>
Date: Sat Dec 23 17:53:11 2023 -0600
Don't default to C, and be somewhat reasonable about locales, to start.
diff --git a/src/installerprompt.cpp b/src/installerprompt.cpp
index 04bc415..87a20c3 100644
--- a/src/installerprompt.cpp
+++ b/src/installerprompt.cpp
@@ -376,10 +376,15 @@ QString InstallerPrompt::getDisplayNameForLocale(const QLocale &locale) {
return s;
};
+ QLocale currentAppLocale = QLocale::system();
QString nativeName = locale.nativeLanguageName();
QString nativeCountryName = sanitize(locale.nativeCountryName());
- QString englishLanguageName = QLocale::languageToString(locale.language());
- QString englishCountryName = sanitize(QLocale::countryToString(locale.country()));
+ QString englishLanguageName = currentAppLocale.languageToString(locale.language());
+ QString englishCountryName = sanitize(currentAppLocale.countryToString(locale.country()));
+
+ if (nativeName.isEmpty() || nativeCountryName.isEmpty()) {
+ return QString();
+ }
// Rename "American English" to "English"
if (locale.language() == QLocale::English) {
@@ -419,31 +424,29 @@ void InstallerPrompt::initLanguageComboBox() {
}
QStringList InstallerPrompt::getAvailableLanguages() {
- QMap<QString, QString> languageMap; // Default sorting by QString is case-sensitive
-
- for (int language = QLocale::C; language <= QLocale::LastLanguage; ++language) {
- foreach (int country, QLocale::countriesForLanguage(static_cast<QLocale::Language>(language))) {
- QLocale locale(static_cast<QLocale::Language>(language), static_cast<QLocale::Country>(country));
+ QMap<QString, QString> language_map; // Default sorting by QString is case-sensitive
- QString displayName = getDisplayNameForLocale(locale);
- if (displayName.isEmpty()) continue;
+ QList<QLocale> all_locales = QLocale::matchingLocales(QLocale::AnyLanguage, QLocale::AnyScript, QLocale::AnyCountry);
+ for (const QLocale &locale : all_locales) {
+ QString display_name = getDisplayNameForLocale(locale);
+ if (display_name.isEmpty()) continue;
- languageMap.insert(displayName, locale.name());
- }
+ language_map.insert(display_name, locale.name());
}
+
// Sort the language display names
- QStringList sortedLanguages = languageMap.keys();
- std::sort(sortedLanguages.begin(), sortedLanguages.end(), [](const QString &a, const QString &b) {
+ QStringList sorted_languages = language_map.keys();
+ std::sort(sorted_languages.begin(), sorted_languages.end(), [](const QString &a, const QString &b) {
return a.compare(b, Qt::CaseInsensitive) < 0;
});
// Clear the existing languageLocaleMap and repopulate it based on sortedLanguages
languageLocaleMap.clear();
- for (const QString &languageName : sortedLanguages) {
- languageLocaleMap.insert(languageName, languageMap[languageName]);
+ for (const QString &language_name : sorted_languages) {
+ languageLocaleMap.insert(language_name, language_map[language_name]);
}
- return sortedLanguages;
+ return sorted_languages;
}
void InstallerPrompt::onLanguageChanged(int index) {

@ -0,0 +1 @@
c-fixes.patch
Loading…
Cancel
Save