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

This commit is contained in:
Philip Müller 2021-03-03 14:17:59 +01:00
commit 9e92f5d032
54 changed files with 1573 additions and 411 deletions

View File

@ -1,17 +1,26 @@
name: issues
on: issues
on:
issues:
types: [opened, reopened, closed]
jobs:
irc:
runs-on: ubuntu-latest
steps:
-
name: notify
- name: "notify: new"
uses: rectalogic/notify-irc@v1
if: github.event.issue.state == 'open'
with:
server: chat.freenode.net
nickname: cala-issues
channel: "#calamares"
nickname: gh-issues
message: |
${{ github.actor }} issue ${{ github.event.issue.title }}
message: "OPENED ${{ github.event.issue.html_url }} by ${{ github.actor }} ${{ github.event.issue.title }}"
- name: "notify: closed"
uses: rectalogic/notify-irc@v1
if: github.event.issue.state != 'open'
with:
server: chat.freenode.net
nickname: cala-issues
channel: "#calamares"
message: "CLOSED ${{ github.event.issue.html_url }} by ${{ github.actor }} ${{ github.event.issue.title }}"

100
.github/workflows/nightly-debian.yml vendored Normal file
View File

@ -0,0 +1,100 @@
name: nightly-debian-10
on:
schedule:
- cron: "12 23 * * *"
workflow_dispatch:
env:
BUILDDIR: /build
SRCDIR: ${{ github.workspace }}
CMAKE_ARGS: |
-DWEBVIEW_FORCE_WEBKIT=1
-DKDE_INSTALL_USE_QT_SYS_PATHS=ON
-DWITH_PYTHONQT=OFF"
-DCMAKE_BUILD_TYPE=Debug
jobs:
build:
runs-on: ubuntu-latest
container:
image: docker://debian:10
options: --tmpfs /build:rw --user 0:0
steps:
- name: "prepare env"
run: |
apt-get update
apt-get -y install git-core
apt-get -y install \
build-essential \
cmake \
extra-cmake-modules \
gettext \
kio-dev \
libatasmart-dev \
libboost-python-dev \
libkf5config-dev \
libkf5coreaddons-dev \
libkf5i18n-dev \
libkf5iconthemes-dev \
libkf5parts-dev \
libkf5service-dev \
libkf5solid-dev \
libparted-dev \
libpolkit-qt5-1-dev \
libqt5svg5-dev \
libqt5webkit5-dev \
libyaml-cpp-dev \
os-prober \
pkg-config \
python3-dev \
qtbase5-dev \
qtdeclarative5-dev \
qttools5-dev \
qttools5-dev-tools
# Same name as on KDE neon, different version
apt-get -y install libkpmcore-dev
# Additional dependencies
apt-get -y install \
libappstreamqt-dev \
libicu-dev \
libkf5crash-dev \
libkf5package-dev \
libkf5plasma-dev \
libpwquality-dev \
libqt5webenginewidgets5 \
qtwebengine5-dev
- name: "prepare source"
uses: actions/checkout@v2
- name: "prepare build"
id: pre_build
run: |
test -n "$BUILDDIR" || { echo "! \$BUILDDIR not set" ; exit 1 ; }
mkdir -p $BUILDDIR
test -f $SRCDIR/CMakeLists.txt || { echo "! Missing $SRCDIR/CMakeLists.txt" ; exit 1 ; }
echo "::set-output name=message::"`git log -1 --abbrev-commit --pretty=oneline --no-decorate ${{ github.event.head_commit.id }}`
- name: "Calamares: cmake"
working-directory: ${{ env.BUILDDIR }}
run: cmake $CMAKE_ARGS $SRCDIR
- name: "Calamares: make"
working-directory: ${{ env.BUILDDIR }}
run: make -j2 VERBOSE=1
- name: "Calamares: install"
working-directory: ${{ env.BUILDDIR }}
run: make install VERBOSE=1
- name: "notify: ok"
uses: rectalogic/notify-irc@v1
if: ${{ success() && github.repository == 'calamares/calamares' }}
with:
server: chat.freenode.net
nickname: cala-ci
channel: "#calamares"
message: "OK ${{ github.workflow }} in ${{ github.repository }} ${{ steps.pre_build.outputs.message }}"
- name: "notify: fail"
uses: rectalogic/notify-irc@v1
if: ${{ failure() && github.repository == 'calamares/calamares' }}
with:
server: chat.freenode.net
nickname: cala-ci
channel: "#calamares"
message: "FAIL ${{ github.workflow }} in ${{ github.repository }} ${{ steps.pre_build.outputs.message }}"

99
.github/workflows/nightly-neon.yml vendored Normal file
View File

@ -0,0 +1,99 @@
name: nightly-neon
on:
schedule:
- cron: "52 23 * * *"
workflow_dispatch:
env:
BUILDDIR: /build
SRCDIR: ${{ github.workspace }}
CMAKE_ARGS: |
-DWEBVIEW_FORCE_WEBKIT=1
-DKDE_INSTALL_USE_QT_SYS_PATHS=ON
-DWITH_PYTHONQT=OFF"
-DCMAKE_BUILD_TYPE=Debug
jobs:
build:
runs-on: ubuntu-latest
container:
image: docker://kdeneon/plasma:user
options: --tmpfs /build:rw --user 0:0
steps:
- name: "prepare env"
run: |
sudo apt-get update
sudo apt-get -y install git-core
sudo apt-get -y install \
build-essential \
cmake \
extra-cmake-modules \
gettext \
kio-dev \
libatasmart-dev \
libboost-python-dev \
libkf5config-dev \
libkf5coreaddons-dev \
libkf5i18n-dev \
libkf5iconthemes-dev \
libkf5parts-dev \
libkf5service-dev \
libkf5solid-dev \
libkpmcore-dev \
libparted-dev \
libpolkit-qt5-1-dev \
libqt5svg5-dev \
libqt5webkit5-dev \
libyaml-cpp-dev \
os-prober \
pkg-config \
python3-dev \
qtbase5-dev \
qtdeclarative5-dev \
qttools5-dev \
qttools5-dev-tools
- name: "prepare source"
uses: actions/checkout@v2
- name: "prepare build"
id: pre_build
run: |
test -n "$BUILDDIR" || { echo "! \$BUILDDIR not set" ; exit 1 ; }
mkdir -p $BUILDDIR
test -f $SRCDIR/CMakeLists.txt || { echo "! Missing $SRCDIR/CMakeLists.txt" ; exit 1 ; }
echo "::set-output name=message::"`git log -1 --abbrev-commit --pretty=oneline --no-decorate ${{ github.event.head_commit.id }}`
- name: "Calamares: cmake"
working-directory: ${{ env.BUILDDIR }}
run: cmake $CMAKE_ARGS $SRCDIR
- name: "Calamares: make"
working-directory: ${{ env.BUILDDIR }}
run: make -j2 VERBOSE=1
- name: "Calamares: install"
working-directory: ${{ env.BUILDDIR }}
run: make install VERBOSE=1 DESTDIR=${{ env.BUILDDIR }}/stage
- name: "Calamares: archive"
working-directory: ${{ env.BUILDDIR }}
run: tar czf calamares.tar.gz stage
- name: "upload"
uses: actions/upload-artifact@v2
with:
name: calamares-tarball
path: ${{ env.BUILDDIR }}/calamares.tar.gz
if-no-files-found: error
retention-days: 3
- name: "notify: ok"
uses: rectalogic/notify-irc@v1
if: ${{ success() && github.repository == 'calamares/calamares' }}
with:
server: chat.freenode.net
nickname: cala-ci
channel: "#calamares"
message: "OK ${{ github.workflow }} in ${{ github.repository }} ${{ steps.pre_build.outputs.message }}"
- name: "notify: fail"
uses: rectalogic/notify-irc@v1
if: ${{ failure() && github.repository == 'calamares/calamares' }}
with:
server: chat.freenode.net
nickname: cala-ci
channel: "#calamares"
message: "FAIL ${{ github.workflow }} in ${{ github.repository }} ${{ steps.pre_build.outputs.message }}"

98
.github/workflows/nightly-opensuse.yml vendored Normal file
View File

@ -0,0 +1,98 @@
name: nightly-opensuse
on:
schedule:
- cron: "32 23 * * *"
workflow_dispatch:
env:
BUILDDIR: /build
SRCDIR: ${{ github.workspace }}
CMAKE_ARGS: |
-DWEBVIEW_FORCE_WEBKIT=1
-DKDE_INSTALL_USE_QT_SYS_PATHS=ON
-DWITH_PYTHONQT=OFF"
-DCMAKE_BUILD_TYPE=Debug
jobs:
build:
runs-on: ubuntu-latest
container:
image: docker://opensuse/leap
options: --tmpfs /build:rw --user 0:0
steps:
- name: "prepare env"
run: |
zypper --non-interactive up
zypper --non-interactive in git-core
# From deploycala.py
zypper --non-interactive in \
"autoconf" \
"automake" \
"bison" \
"flex" \
"git" \
"libtool" \
"m4" \
"make" \
"cmake" \
"extra-cmake-modules" \
"gcc-c++" \
"libqt5-qtbase-devel" \
"libqt5-linguist-devel" \
"libqt5-qtsvg-devel" \
"libqt5-qtdeclarative-devel" \
"libqt5-qtwebengine-devel" \
"yaml-cpp-devel" \
"libpolkit-qt5-1-devel" \
"kservice-devel" \
"kpackage-devel" \
"kparts-devel" \
"kcrash-devel" \
"kpmcore-devel" \
"plasma5-workspace-devel" \
"plasma-framework-devel" \
"libpwquality-devel" \
"parted-devel" \
"python3-devel" \
"boost-devel" \
"libboost_python-py3-*-devel"
# Additional dependencies
zypper --non-interactive in \
libicu-devel \
libAppStreamQt-devel \
libatasmart-devel
- name: "prepare source"
uses: actions/checkout@v2
- name: "prepare build"
id: pre_build
run: |
test -n "$BUILDDIR" || { echo "! \$BUILDDIR not set" ; exit 1 ; }
mkdir -p $BUILDDIR
test -f $SRCDIR/CMakeLists.txt || { echo "! Missing $SRCDIR/CMakeLists.txt" ; exit 1 ; }
echo "::set-output name=message::"`git log -1 --abbrev-commit --pretty=oneline --no-decorate ${{ github.event.head_commit.id }}`
- name: "Calamares: cmake"
working-directory: ${{ env.BUILDDIR }}
run: cmake $CMAKE_ARGS $SRCDIR
- name: "Calamares: make"
working-directory: ${{ env.BUILDDIR }}
run: make -j2 VERBOSE=1
- name: "Calamares: install"
working-directory: ${{ env.BUILDDIR }}
run: make install VERBOSE=1
- name: "notify: ok"
uses: rectalogic/notify-irc@v1
if: ${{ success() && github.repository == 'calamares/calamares' }}
with:
server: chat.freenode.net
nickname: cala-ci
channel: "#calamares"
message: "OK ${{ github.workflow }} in ${{ github.repository }} ${{ steps.pre_build.outputs.message }}"
- name: "notify: fail"
uses: rectalogic/notify-irc@v1
if: ${{ failure() && github.repository == 'calamares/calamares' }}
with:
server: chat.freenode.net
nickname: cala-ci
channel: "#calamares"
message: "FAIL ${{ github.workflow }} in ${{ github.repository }} ${{ steps.pre_build.outputs.message }}"

View File

@ -1,4 +1,4 @@
name: ci
name: ci-push
on:
push:
@ -27,17 +27,10 @@ jobs:
image: docker://kdeneon/plasma:user
options: --tmpfs /build:rw --user 0:0
steps:
-
name: prepare env
- name: "prepare env"
run: |
sudo apt-get update
sudo apt-get -y install git-core
-
name: checkout
uses: actions/checkout@v2
-
name: install dependencies
run: |
sudo apt-get -y install \
build-essential \
cmake \
@ -66,31 +59,37 @@ jobs:
qtdeclarative5-dev \
qttools5-dev \
qttools5-dev-tools
-
name: prepare build
- name: "prepare source"
uses: actions/checkout@v2
- name: "prepare build"
id: pre_build
run: |
test -n "$BUILDDIR" || { echo "! \$BUILDDIR not set" ; exit 1 ; }
mkdir -p $BUILDDIR
test -f $SRCDIR/CMakeLists.txt || { echo "! Missing $SRCDIR/CMakeLists.txt" ; exit 1 ; }
-
name: cmake
echo "::set-output name=message::"`git log -1 --abbrev-commit --pretty=oneline --no-decorate ${{ github.event.head_commit.id }}`
- name: "Calamares: cmake"
working-directory: ${{ env.BUILDDIR }}
run: cmake $CMAKE_ARGS $SRCDIR
-
name: make
- name: "Calamares: make"
working-directory: ${{ env.BUILDDIR }}
run: make -j2 VERBOSE=1
-
name: install
- name: "Calamares: install"
working-directory: ${{ env.BUILDDIR }}
run: |
make install VERBOSE=1
-
name: notify
run: make install VERBOSE=1
- name: "notify: ok"
uses: rectalogic/notify-irc@v1
if: ${{ success() && github.repository == 'calamares/calamares' }}
with:
server: chat.freenode.net
nickname: cala-ci
channel: "#calamares"
nickname: gh-notify
message: |
${{ github.actor }} pushed ${{ github.event.ref }} CI ${{ steps.install.conclusion }} JOB ${{ github.job }} RUN ${{ github.run_id }}
message: "OK ${{ github.workflow }} in ${{ github.repository }} ${{ github.actor }} on ${{ github.event.ref }}\n.. ${{ steps.pre_build.outputs.message }}"
- name: "notify: fail"
uses: rectalogic/notify-irc@v1
if: ${{ failure() && github.repository == 'calamares/calamares' }}
with:
server: chat.freenode.net
nickname: cala-ci
channel: "#calamares"
message: "FAIL ${{ github.workflow }} in ${{ github.repository }} ${{ github.actor }} on ${{ github.event.ref }}\n.. ${{ steps.pre_build.outputs.message }}\n.. DIFF ${{ github.event.compare }}"

View File

@ -38,6 +38,7 @@ and moral support from (alphabetically by first name or nickname):
- Kevin Kofler
- Kyle Robertze
- Lisa Vitolo
- Neal Gompa
- n3rdopolis
- Philip Müller
- Ramon Buldó

58
CHANGES
View File

@ -7,17 +7,71 @@ 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.36 (unreleased) #
# 3.2.38 (unreleased) #
This release contains contributions from (alphabetically by first name):
- No external contributors yet
## Core ##
- No core changes yet
## Modules ##
- No module changes yet
# 3.2.37 (2021-02-23) #
This release contains contributions from (alphabetically by first name):
- benne-dee
## Core ##
- Calamares has a table of 'best guess' languages for each country
and when GeoIP is enabled, it will automatically select that
country's language as default -- the user can of course pick
a different one. The 'best guess' is based on Unicode / ISO
data, which is sometimes dubious. Based on some personal notes,
the 'best guess' language for Belarus has been changed to Russian.
- Calamares has a table of 'best guess' keyboard mappings,
allowing native language input. However, usernames and
passwords should be in US-ASCII (this is a limitation of
the login system -- **some** parts of the system will support
non-ASCII input, but it's better safe than sorry).
Add Greek to the list of languages that needs US-ASCII
in addition to native input.
- The CI infrastructure now builds Calamares and Calamares-extensions
on a nightly basis.
## Modules ##
- The *netinstall* module has a YAML schema, allowing packagers
to validate and verify their netinstall configurations before
shipping an ISO (or writing bug reports). Thanks benne-dee.
- The *finished* module has been heavily refactored, opening
the way to a QML-based version of the same module. This is
also preparatory work for allowing packagers (e.g. PostmarketOS)
to customize the messages on the finished page.
# 3.2.36 (2021-02-03) #
This release contains contributions from (alphabetically by first name):
- Anubhav Choudhary
- benne-dee
- Gaël PORTAY
- Jonas Strassel
- Kevin Kofler
- Matti Hyttinen
- Neal Gompa
## Core ##
- It is now possible to hide the *next* and *back* buttons during
the "exec" phase of installation. THanks Anubhav.
the "exec" phase of installation. Thanks Anubhav.
- The Calamares CI has migrated to GitHub actions. Thanks Jonas.
## Modules ##
- *bootloader* now uses the current file names for the UEFI Secure Boot
shim instead of obsolete ones.
- The *mount* module creates swap in its own subvolume, if btrfs is used.
Thanks Matti.
- *partition* includes more information about what it will do, including
GPT partition types (in human-readable format, if possible). Thanks Gaël.
- Some edge-cases with overlay filesystems have been resolved in the

View File

@ -41,7 +41,7 @@
# TODO:3.3: Require CMake 3.12
cmake_minimum_required( VERSION 3.3 FATAL_ERROR )
project( CALAMARES
VERSION 3.2.36
VERSION 3.2.38
LANGUAGES C CXX
)
@ -194,7 +194,7 @@ include( CMakeColors )
set( CMAKE_CXX_STANDARD 17 )
set( CMAKE_CXX_STANDARD_REQUIRED ON )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror=return-type" )
set( CMAKE_CXX_FLAGS_DEBUG "-g ${CMAKE_CXX_FLAGS_DEBUG}" )
set( CMAKE_CXX_FLAGS_DEBUG "-Og -g ${CMAKE_CXX_FLAGS_DEBUG}" )
set( CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG" )
set( CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG" )
set( CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g" )
@ -202,7 +202,7 @@ set( CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g" )
set( CMAKE_C_STANDARD 99 )
set( CMAKE_C_STANDARD_REQUIRED ON )
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall" )
set( CMAKE_C_FLAGS_DEBUG "-g" )
set( CMAKE_C_FLAGS_DEBUG "-Og -g" )
set( CMAKE_C_FLAGS_MINSIZEREL "-Os -DNDEBUG" )
set( CMAKE_C_FLAGS_RELEASE "-O4 -DNDEBUG" )
set( CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g" )
@ -230,6 +230,10 @@ if( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
string( APPEND CMAKE_CXX_FLAGS " ${CLANG_WARNINGS}" )
endforeach()
# The dwarf-debugging flags are slightly different, too
string( APPEND CMAKE_CXX_FLAGS_DEBUG " -gdwarf" )
string( APPEND CMAKE_C_FLAGS_DEBUG " -gdwarf" )
# Third-party code where we don't care so much about compiler warnings
# (because it's uncomfortable to patch) get different flags; use
# mark_thirdparty_code( <file> [<file>...] )
@ -686,3 +690,16 @@ feature_summary(
DESCRIPTION "The following REQUIRED packages were not found:"
QUIET_ON_EMPTY
)
### PACKAGING
#
# Note: most distro's will do distro-specific packaging rather than
# using CPack, and this duplicates information in the AppStream, too.
# TODO:3.3 With newer CMake, move HOMEPAGE_URL to the project()call
set(CPACK_PACKAGE_VENDOR calamares)
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A Linux system installer")
set(CPACK_PACKAGE_DESCRIPTION "Calamares is a Linux system installer, intended for Linux distributions to use on their ISOs and other bootable media to install the distribution to the end-user's computer. Calamares can also be used as an OEM configuration tool. It is modular, extensible and highly-configurable for Linux distributions from all five major Linux families.")
set(CPACK_PACKAGE_HOMEPAGE_URL "https://calamares.io")
set(CPACK_PACKAGE_ICON "data/images/squid.png")
include(CPack)

View File

@ -7,6 +7,8 @@
#
# Release script for Calamares
#
# NOTE: this script contains Linuxisms (in particular, expects GNU mktemp(1))
#
# This attempts to perform the different steps of the RELEASE.md
# document automatically. It's not tested on other machines or
# setups other than [ade]'s development VM.

View File

@ -145,7 +145,7 @@
<message>
<location filename="../src/libcalamares/JobQueue.cpp" line="196"/>
<source>Done</source>
<translation>בוצע</translation>
<translation>סיום</translation>
</message>
</context>
<context>
@ -495,7 +495,7 @@ The installer will quit and all changes will be lost.</source>
<message>
<location filename="../src/calamares/CalamaresWindow.cpp" line="305"/>
<source>%1 Installer</source>
<translation>תכנית התקנת %1</translation>
<translation>אשף התקנת %1</translation>
</message>
</context>
<context>
@ -539,7 +539,7 @@ The installer will quit and all changes will be lost.</source>
<message>
<location filename="../src/modules/partition/gui/ChoicePage.cpp" line="822"/>
<source>Reuse %1 as home partition for %2.</source>
<translation>להשתמש ב־%1 כמחיצת הבית (home) עבור %2.</translation>
<translation>שימוש ב־%1 כמחיצת הבית (home) עבור %2.</translation>
</message>
<message>
<location filename="../src/modules/partition/gui/ChoicePage.cpp" line="958"/>
@ -2504,7 +2504,7 @@ The installer will quit and all changes will be lost.</source>
<location filename="../src/modules/partition/core/PartitionModel.cpp" line="159"/>
<location filename="../src/modules/partition/core/PartitionModel.cpp" line="199"/>
<source>Free Space</source>
<translation>זכרון פנוי</translation>
<translation>שטח פנוי</translation>
</message>
<message>
<location filename="../src/modules/partition/core/PartitionModel.cpp" line="163"/>
@ -2931,7 +2931,7 @@ Output:
<message>
<location filename="../src/modules/partition/gui/PartitionLabelsView.cpp" line="41"/>
<source>Unpartitioned space or unknown partition table</source>
<translation>הזכרון לא מחולק למחיצות או שטבלת המחיצות אינה מוכרת</translation>
<translation>השטח לא מחולק למחיצות או שטבלת המחיצות אינה מוכרת</translation>
</message>
</context>
<context>
@ -2991,7 +2991,7 @@ Output:
<message>
<location filename="../src/modules/partition/gui/ReplaceWidget.cpp" line="157"/>
<source>%1 cannot be installed on empty space. Please select an existing partition.</source>
<translation>לא ניתן להתקין את %1 על זכרון ריק. אנא בחר מחיצה קיימת.</translation>
<translation>לא ניתן להתקין את %1 על שטח ריק. נא לבחור מחיצה קיימת.</translation>
</message>
<message>
<location filename="../src/modules/partition/gui/ReplaceWidget.cpp" line="167"/>
@ -3341,7 +3341,7 @@ Output:
<message>
<location filename="../src/modules/partition/jobs/SetPartitionFlagsJob.cpp" line="96"/>
<source>Flag new partition as &lt;strong&gt;%1&lt;/strong&gt;.</source>
<translation>סמן מחיצה חדשה כ &lt;strong&gt;%1&lt;/strong&gt;.</translation>
<translation>סימון המחיצה החדשה בתור &lt;strong&gt;%1&lt;/strong&gt;.</translation>
</message>
<message>
<location filename="../src/modules/partition/jobs/SetPartitionFlagsJob.cpp" line="108"/>
@ -4065,7 +4065,7 @@ Output:
<message>
<location filename="../src/modules/usersq/usersq.qml" line="59"/>
<source>Your Full Name</source>
<translation>שם המלא</translation>
<translation>שמך המלא</translation>
</message>
<message>
<location filename="../src/modules/usersq/usersq.qml" line="80"/>

View File

@ -11,12 +11,12 @@
<message>
<location filename="../src/modules/partition/gui/BootInfoWidget.cpp" line="72"/>
<source>This system was started with an &lt;strong&gt;EFI&lt;/strong&gt; boot environment.&lt;br&gt;&lt;br&gt;To configure startup from an EFI environment, this installer must deploy a boot loader application, like &lt;strong&gt;GRUB&lt;/strong&gt; or &lt;strong&gt;systemd-boot&lt;/strong&gt; on an &lt;strong&gt;EFI System Partition&lt;/strong&gt;. This is automatic, unless you choose manual partitioning, in which case you must choose it or create it on your own.</source>
<translation>Sistem ini telah dimulai dengan lingkungan boot &lt;strong&gt;EFI&lt;/strong&gt;.&lt;br&gt;&lt;br&gt;Untuk mengkonfigurasi startup dari lingkungan EFI, installer ini seharusnya memaparkan sebuah aplikasi boot loader, seperti &lt;strong&gt;GRUB&lt;/strong&gt; atau &lt;strong&gt;systemd-boot&lt;/strong&gt; pada sebuah &lt;strong&gt;EFI System Partition&lt;/strong&gt;. Ini adalah otomatis, kecuali kalau kamu memilih pemartisian manual, dalam beberapa kasus kamu harus memilihnya atau menciptakannya pada milikmu.</translation>
<translation>Sistem ini telah dimulai dengan lingkungan boot &lt;strong&gt;EFI&lt;/strong&gt;.&lt;br&gt;&lt;br&gt;Untuk mengkonfigurasi startup dari lingkungan EFI, installer ini seharusnya memaparkan sebuah aplikasi boot loader, seperti &lt;strong&gt;GRUB&lt;/strong&gt; atau &lt;strong&gt;systemd-boot&lt;/strong&gt; pada sebuah &lt;strong&gt;EFI System Partition&lt;/strong&gt;. Ini adalah otomatis, kecuali kalau kamu memilih pemartisian manual, dalam kasus ini kamu harus memilihnya atau menciptakannya sendiri.</translation>
</message>
<message>
<location filename="../src/modules/partition/gui/BootInfoWidget.cpp" line="84"/>
<source>This system was started with a &lt;strong&gt;BIOS&lt;/strong&gt; boot environment.&lt;br&gt;&lt;br&gt;To configure startup from a BIOS environment, this installer must install a boot loader, like &lt;strong&gt;GRUB&lt;/strong&gt;, either at the beginning of a partition or on the &lt;strong&gt;Master Boot Record&lt;/strong&gt; near the beginning of the partition table (preferred). This is automatic, unless you choose manual partitioning, in which case you must set it up on your own.</source>
<translation>Sistem ini dimulai dengan sebuah lingkungan boot &lt;strong&gt;BIOS&lt;/strong&gt;.&lt;br&gt;&lt;br&gt;Untuk mengkonfigurasi startup dari sebuah lingkungan BIOS, installer ini seharusnya memasang sebuah boot loader, seperti &lt;strong&gt;GRUB&lt;/strong&gt;, baik di awal partisi atau pada &lt;strong&gt;Master Boot Record&lt;/strong&gt; di dekat awalan tabel partisi (yang disukai). Ini adalah otomatis, kecuali kalau kamu memilih pemartisian manual, dalam beberapa kasus kamu harus menyetelnya pada milikmu.</translation>
<translation>Sistem ini dimulai dengan sebuah lingkungan boot &lt;strong&gt;BIOS&lt;/strong&gt;.&lt;br&gt;&lt;br&gt;Untuk mengkonfigurasi startup dari sebuah lingkungan BIOS, installer ini harus memasang sebuah boot loader, seperti &lt;strong&gt;GRUB&lt;/strong&gt;, baik di awal partisi atau pada &lt;strong&gt;Master Boot Record&lt;/strong&gt; di dekat awalan tabel partisi (yang disukai). Ini adalah otomatis, kecuali kalau kamu memilih pemartisian manual, dalam beberapa kasus kamu harus menyetelnya sendiri.</translation>
</message>
</context>
<context>
@ -101,7 +101,7 @@
<message>
<location filename="../src/calamares/DebugWindow.ui" line="110"/>
<source>Reload Stylesheet</source>
<translation type="unfinished"/>
<translation>Muat ulang Lembar gaya</translation>
</message>
<message>
<location filename="../src/calamares/DebugWindow.ui" line="117"/>
@ -235,8 +235,8 @@
<message numerus="yes">
<location filename="../src/libcalamares/modulesystem/RequirementsChecker.cpp" line="115"/>
<source>Waiting for %n module(s).</source>
<translation type="unfinished">
<numerusform/>
<translation>
<numerusform>Menunggu %n modul().</numerusform>
</translation>
</message>
<message numerus="yes">
@ -267,7 +267,7 @@
<message>
<location filename="../src/libcalamaresui/ViewManager.cpp" line="151"/>
<source>Would you like to paste the install log to the web?</source>
<translation>Maukah anda untuk menempelkan log pemasangan ke situs?</translation>
<translation>Maukah anda untuk menempelkan log instalasi ke situs?</translation>
</message>
<message>
<location filename="../src/libcalamaresui/ViewManager.cpp" line="164"/>
@ -324,7 +324,7 @@
<message>
<location filename="../src/libcalamaresui/ViewManager.cpp" line="327"/>
<source>Continue with installation?</source>
<translation type="unfinished"/>
<translation>Lanjutkan instalasi?</translation>
</message>
<message>
<location filename="../src/libcalamaresui/ViewManager.cpp" line="329"/>
@ -454,7 +454,8 @@ Instalasi akan ditutup dan semua perubahan akan hilang.</translation>
<location filename="../src/libcalamaresui/utils/Paste.cpp" line="25"/>
<source>Install log posted to:
%1</source>
<translation type="unfinished"/>
<translation>Log instalasi terunggah ke:
%1</translation>
</message>
</context>
<context>
@ -630,7 +631,7 @@ Instalasi akan ditutup dan semua perubahan akan hilang.</translation>
<message>
<location filename="../src/modules/partition/gui/ChoicePage.cpp" line="1598"/>
<source>No Swap</source>
<translation>Tidak perlu SWAP</translation>
<translation>Tidak pakai SWAP</translation>
</message>
<message>
<location filename="../src/modules/partition/gui/ChoicePage.cpp" line="1606"/>
@ -640,7 +641,7 @@ Instalasi akan ditutup dan semua perubahan akan hilang.</translation>
<message>
<location filename="../src/modules/partition/gui/ChoicePage.cpp" line="1609"/>
<source>Swap (no Hibernate)</source>
<translation>Swap (tidak hibernasi)</translation>
<translation>Swap (tanpa hibernasi)</translation>
</message>
<message>
<location filename="../src/modules/partition/gui/ChoicePage.cpp" line="1612"/>
@ -768,8 +769,7 @@ Instalasi akan ditutup dan semua perubahan akan hilang.</translation>
<message>
<location filename="../src/modules/welcome/Config.cpp" line="54"/>
<source>This computer does not satisfy the minimum requirements for installing %1.&lt;br/&gt;Installation cannot continue. &lt;a href="#details"&gt;Details...&lt;/a&gt;</source>
<translation>Komputer ini tidak memenuhi syarat minimum untuk memasang %1.
Installer tidak dapat dilanjutkan. &lt;a href="</translation>
<translation>Komputer ini tidak memenuhi syarat minimum untuk memasang %1.&lt;br/&gt;Instalasi tidak dapat dilanjutkan. &lt;a href="#details"&gt;Lebih rinci...&lt;/a&gt;</translation>
</message>
<message>
<location filename="../src/modules/welcome/Config.cpp" line="61"/>
@ -790,7 +790,7 @@ Instalasi dapat dilanjutkan, namun beberapa fitur akan dinonfungsikan.</translat
<message>
<location filename="../src/modules/welcome/Config.cpp" line="244"/>
<source>&lt;h1&gt;Welcome to the Calamares setup program for %1&lt;/h1&gt;</source>
<translation type="unfinished"/>
<translation>&lt;h1&gt;Selamat datang ke program Calamares untuk %1&lt;/h1&gt;</translation>
</message>
<message>
<location filename="../src/modules/welcome/Config.cpp" line="245"/>
@ -815,12 +815,12 @@ Instalasi dapat dilanjutkan, namun beberapa fitur akan dinonfungsikan.</translat
<message>
<location filename="../src/modules/users/Config.cpp" line="218"/>
<source>'%1' is not allowed as username.</source>
<translation type="unfinished"/>
<translation>'%1' tidak diperbolehkan sebagai nama pengguna.</translation>
</message>
<message>
<location filename="../src/modules/users/Config.cpp" line="225"/>
<source>Your username must start with a lowercase letter or underscore.</source>
<translation type="unfinished"/>
<translation>Nama penggunamu harus diawali dengan huruf kecil atau garis bawah.</translation>
</message>
<message>
<location filename="../src/modules/users/Config.cpp" line="229"/>
@ -840,12 +840,12 @@ Instalasi dapat dilanjutkan, namun beberapa fitur akan dinonfungsikan.</translat
<message>
<location filename="../src/modules/users/Config.cpp" line="284"/>
<source>'%1' is not allowed as hostname.</source>
<translation type="unfinished"/>
<translation>'%1' tidak diperbolehkan sebagai hostname.</translation>
</message>
<message>
<location filename="../src/modules/users/Config.cpp" line="290"/>
<source>Only letters, numbers, underscore and hyphen are allowed.</source>
<translation type="unfinished"/>
<translation>Hanya huruf, angka, garis bawah, dan tanda penghubung yang diperbolehkan.</translation>
</message>
<message>
<location filename="../src/modules/users/Config.cpp" line="527"/>

View File

@ -39,7 +39,7 @@
<message>
<location filename="../src/modules/partition/core/BootLoaderModel.cpp" line="128"/>
<source>Do not install a boot loader</source>
<translation type="unfinished"/>
<translation> install </translation>
</message>
<message>
<location filename="../src/modules/partition/core/BootLoaderModel.cpp" line="146"/>
@ -52,7 +52,7 @@
<message>
<location filename="../src/libcalamaresui/viewpages/BlankViewStep.cpp" line="61"/>
<source>Blank Page</source>
<translation type="unfinished"/>
<translation> </translation>
</message>
</context>
<context>
@ -60,7 +60,7 @@
<message>
<location filename="../src/calamares/DebugWindow.ui" line="18"/>
<source>Form</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/calamares/DebugWindow.ui" line="28"/>
@ -80,7 +80,7 @@
<message>
<location filename="../src/calamares/DebugWindow.ui" line="61"/>
<source>Type:</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/calamares/DebugWindow.ui" line="68"/>
@ -96,7 +96,7 @@
<message>
<location filename="../src/calamares/DebugWindow.ui" line="97"/>
<source>Tools</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/calamares/DebugWindow.ui" line="110"/>
@ -145,7 +145,7 @@
<message>
<location filename="../src/libcalamares/JobQueue.cpp" line="196"/>
<source>Done</source>
<translation type="unfinished"/>
<translation>ि</translation>
</message>
</context>
<context>
@ -153,7 +153,7 @@
<message>
<location filename="../src/libcalamares/JobExample.cpp" line="17"/>
<source>Example job (%1)</source>
<translation type="unfinished"/>
<translation> (%1)</translation>
</message>
</context>
<context>
@ -212,7 +212,7 @@
<message>
<location filename="../src/libcalamaresui/viewpages/QmlViewStep.cpp" line="67"/>
<source>Loading ...</source>
<translation type="unfinished"/>
<translation> ...</translation>
</message>
<message>
<location filename="../src/libcalamaresui/viewpages/QmlViewStep.cpp" line="88"/>
@ -222,7 +222,7 @@
<message>
<location filename="../src/libcalamaresui/viewpages/QmlViewStep.cpp" line="268"/>
<source>Loading failed.</source>
<translation type="unfinished"/>
<translation> </translation>
</message>
</context>
<context>
@ -366,7 +366,7 @@
<message>
<location filename="../src/libcalamaresui/ViewManager.cpp" line="394"/>
<source>Setup is complete. Close the setup program.</source>
<translation type="unfinished"/>
<translation> ि  </translation>
</message>
<message>
<location filename="../src/libcalamaresui/ViewManager.cpp" line="395"/>
@ -504,7 +504,7 @@ The installer will quit and all changes will be lost.</source>
<message>
<location filename="../src/modules/partition/gui/ChoicePage.ui" line="18"/>
<source>Form</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/modules/partition/gui/ChoicePage.cpp" line="120"/>
@ -547,7 +547,7 @@ The installer will quit and all changes will be lost.</source>
<message>
<location filename="../src/modules/partition/gui/ChoicePage.cpp" line="1031"/>
<source>Boot loader location:</source>
<translation type="unfinished"/>
<translation> </translation>
</message>
<message>
<location filename="../src/modules/partition/gui/ChoicePage.cpp" line="1083"/>
@ -631,12 +631,12 @@ The installer will quit and all changes will be lost.</source>
<message>
<location filename="../src/modules/partition/gui/ChoicePage.cpp" line="1598"/>
<source>No Swap</source>
<translation type="unfinished"/>
<translation>swap </translation>
</message>
<message>
<location filename="../src/modules/partition/gui/ChoicePage.cpp" line="1606"/>
<source>Reuse Swap</source>
<translation type="unfinished"/>
<translation>swap </translation>
</message>
<message>
<location filename="../src/modules/partition/gui/ChoicePage.cpp" line="1609"/>
@ -789,22 +789,22 @@ The installer will quit and all changes will be lost.</source>
<message>
<location filename="../src/modules/welcome/Config.cpp" line="244"/>
<source>&lt;h1&gt;Welcome to the Calamares setup program for %1&lt;/h1&gt;</source>
<translation type="unfinished"/>
<translation>%1 ि Calamares Setup Programम </translation>
</message>
<message>
<location filename="../src/modules/welcome/Config.cpp" line="245"/>
<source>&lt;h1&gt;Welcome to %1 setup&lt;/h1&gt;</source>
<translation type="unfinished"/>
<translation>%1 Setupम </translation>
</message>
<message>
<location filename="../src/modules/welcome/Config.cpp" line="250"/>
<source>&lt;h1&gt;Welcome to the Calamares installer for %1&lt;/h1&gt;</source>
<translation type="unfinished"/>
<translation>%1 ि Calamares Installerम </translation>
</message>
<message>
<location filename="../src/modules/welcome/Config.cpp" line="251"/>
<source>&lt;h1&gt;Welcome to the %1 installer&lt;/h1&gt;</source>
<translation type="unfinished"/>
<translation>%1 Installerम </translation>
</message>
<message>
<location filename="../src/modules/users/Config.cpp" line="212"/>
@ -849,7 +849,7 @@ The installer will quit and all changes will be lost.</source>
<message>
<location filename="../src/modules/users/Config.cpp" line="527"/>
<source>Your passwords do not match!</source>
<translation type="unfinished"/>
<translation> ि  </translation>
</message>
</context>
<context>
@ -1256,7 +1256,7 @@ The installer will quit and all changes will be lost.</source>
<message>
<location filename="../src/modules/partition/gui/EncryptWidget.ui" line="18"/>
<source>Form</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/modules/partition/gui/EncryptWidget.ui" line="36"/>
@ -1323,7 +1323,7 @@ The installer will quit and all changes will be lost.</source>
<message>
<location filename="../src/modules/finished/FinishedPage.ui" line="18"/>
<source>Form</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/modules/finished/FinishedPage.ui" line="102"/>
@ -1605,7 +1605,7 @@ The installer will quit and all changes will be lost.</source>
<message>
<location filename="../src/modules/license/LicensePage.ui" line="18"/>
<source>Form</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/modules/license/LicensePage.ui" line="26"/>
@ -2263,7 +2263,7 @@ The installer will quit and all changes will be lost.</source>
<message>
<location filename="../src/modules/packagechooser/page_package.ui" line="24"/>
<source>Form</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/modules/packagechooser/page_package.ui" line="44"/>
@ -2317,7 +2317,7 @@ The installer will quit and all changes will be lost.</source>
<message>
<location filename="../src/modules/keyboard/KeyboardPage.ui" line="18"/>
<source>Form</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/modules/keyboard/KeyboardPage.ui" line="74"/>
@ -2335,7 +2335,7 @@ The installer will quit and all changes will be lost.</source>
<message>
<location filename="../src/modules/users/page_usersetup.ui" line="18"/>
<source>Form</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/modules/users/page_usersetup.ui" line="40"/>
@ -2511,7 +2511,7 @@ The installer will quit and all changes will be lost.</source>
<message>
<location filename="../src/modules/partition/gui/PartitionPage.ui" line="18"/>
<source>Form</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/modules/partition/gui/PartitionPage.ui" line="26"/>
@ -2721,7 +2721,7 @@ The installer will quit and all changes will be lost.</source>
<message>
<location filename="../src/modules/plasmalnf/page_plasmalnf.ui" line="18"/>
<source>Form</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/modules/plasmalnf/PlasmaLnfPage.cpp" line="79"/>
@ -2945,7 +2945,7 @@ Output:
<message>
<location filename="../src/modules/partition/gui/ReplaceWidget.ui" line="18"/>
<source>Form</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/modules/partition/gui/ReplaceWidget.cpp" line="127"/>
@ -3588,7 +3588,7 @@ Output:
<message>
<location filename="../src/modules/tracking/page_trackingstep.ui" line="18"/>
<source>Form</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/modules/tracking/page_trackingstep.ui" line="28"/>
@ -3736,7 +3736,7 @@ Output:
<message>
<location filename="../src/modules/welcome/WelcomePage.ui" line="18"/>
<source>Form</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/modules/welcome/WelcomePage.ui" line="79"/>

View File

@ -291,7 +291,7 @@
<message>
<location filename="../src/libcalamaresui/ViewManager.cpp" line="178"/>
<source>&amp;Close</source>
<translation>Fe&amp;char</translation>
<translation>&amp;Fechar</translation>
</message>
<message>
<location filename="../src/libcalamaresui/ViewManager.cpp" line="189"/>
@ -396,7 +396,7 @@
<message>
<location filename="../src/libcalamaresui/ViewManager.cpp" line="419"/>
<source>&amp;Done</source>
<translation>Concluí&amp;do</translation>
<translation>&amp;Concluído</translation>
</message>
<message>
<location filename="../src/libcalamaresui/ViewManager.cpp" line="438"/>
@ -512,7 +512,7 @@ O instalador será fechado e todas as alterações serão perdidas.</translation
<message>
<location filename="../src/modules/partition/gui/ChoicePage.cpp" line="120"/>
<source>Select storage de&amp;vice:</source>
<translation>Selecione o dispositi&amp;vo de armazenamento:</translation>
<translation>Selecione o dispositivo de armazenamento:</translation>
</message>
<message>
<location filename="../src/modules/partition/gui/ChoicePage.cpp" line="121"/>
@ -898,7 +898,7 @@ O instalador será fechado e todas as alterações serão perdidas.</translation
<message>
<location filename="../src/modules/partition/gui/CreatePartitionDialog.ui" line="123"/>
<source>Fi&amp;le System:</source>
<translation>Sistema de &amp;Arquivos:</translation>
<translation>Sistema de Arquivos:</translation>
</message>
<message>
<location filename="../src/modules/partition/gui/CreatePartitionDialog.ui" line="155"/>
@ -908,7 +908,7 @@ O instalador será fechado e todas as alterações serão perdidas.</translation
<message>
<location filename="../src/modules/partition/gui/CreatePartitionDialog.ui" line="165"/>
<source>&amp;Mount Point:</source>
<translation>Ponto de &amp;Montagem:</translation>
<translation>Ponto de Montagem:</translation>
</message>
<message>
<location filename="../src/modules/partition/gui/CreatePartitionDialog.ui" line="192"/>

View File

@ -3845,7 +3845,7 @@ Kuruluma devam edebilirsiniz fakat bazı özellikler devre dışı kalabilir.</t
<message>
<location filename="../src/modules/welcome/WelcomePage.cpp" line="238"/>
<source>&lt;h1&gt;%1&lt;/h1&gt;&lt;br/&gt;&lt;strong&gt;%2&lt;br/&gt;for %3&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt;Copyright 2014-2017 Teo Mrnjavac &amp;lt;teo@kde.org&amp;gt;&lt;br/&gt;Copyright 2017-2020 Adriaan de Groot &amp;lt;groot@kde.org&amp;gt;&lt;br/&gt;Thanks to &lt;a href="https://calamares.io/team/"&gt;the Calamares team&lt;/a&gt; and the &lt;a href="https://www.transifex.com/calamares/calamares/"&gt;Calamares translators team&lt;/a&gt;.&lt;br/&gt;&lt;br/&gt;&lt;a href="https://calamares.io/"&gt;Calamares&lt;/a&gt; development is sponsored by &lt;br/&gt;&lt;a href="http://www.blue-systems.com/"&gt;Blue Systems&lt;/a&gt; - Liberating Software.</source>
<translation>&lt;h1&gt;%1&lt;/h1&gt;&lt;br/&gt;&lt;strong&gt;%2&lt;br/&gt;for %3&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt;Telif Hakkı 2014-2017 Teo Mrnjavac &amp;lt;teo@kde.org&amp;gt;&lt;br/&gt;Telif Hakkı 2017-2020 Adriaan de Groot &amp;lt;groot@kde.org&amp;gt;&lt;br/&gt;Teşekkrürler &lt;a href="https://calamares.io/team/"&gt;Calamares takımı&lt;/a&gt; ve &lt;a href="https://www.transifex.com/calamares/calamares/"&gt;Calamares çeviri ekibi&lt;/a&gt;.&lt;br/&gt;&lt;br/&gt;&lt;a href="https://calamares.io/"&gt;Calamares&lt;/a&gt; gelişim sponsoru &lt;br/&gt;&lt;a href="http://www.blue-systems.com/"&gt;Blue Systems&lt;/a&gt; - Özgür Yazılım</translation>
<translation>&lt;h1&gt;%1&lt;/h1&gt;&lt;br/&gt;&lt;strong&gt;%2&lt;br/&gt;for %3&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt;Telif Hakkı 2014-2017 Teo Mrnjavac &amp;lt;teo@kde.org&amp;gt;&lt;br/&gt;Telif Hakkı 2017-2020 Adriaan de Groot &amp;lt;groot@kde.org&amp;gt;&lt;br/&gt;Teşekkürler &lt;a href="https://calamares.io/team/"&gt;Calamares takımı&lt;/a&gt; ve &lt;a href="https://www.transifex.com/calamares/calamares/"&gt;Calamares çeviri ekibi&lt;/a&gt;.&lt;br/&gt;&lt;br/&gt;&lt;a href="https://calamares.io/"&gt;Calamares&lt;/a&gt; gelişim sponsoru &lt;br/&gt;&lt;a href="http://www.blue-systems.com/"&gt;Blue Systems&lt;/a&gt; - Özgür Yazılım</translation>
</message>
</context>
<context>

View File

@ -4,7 +4,7 @@
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
# Translators:
# xxmn77 <xxmn77@gmail.com>, 2020
# Xəyyam Qocayev <xxmn77@gmail.com>, 2020
#
#, fuzzy
msgid ""
@ -13,7 +13,7 @@ msgstr ""
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-12-07 17:09+0100\n"
"PO-Revision-Date: 2017-08-09 10:34+0000\n"
"Last-Translator: xxmn77 <xxmn77@gmail.com>, 2020\n"
"Last-Translator: Xəyyam Qocayev <xxmn77@gmail.com>, 2020\n"
"Language-Team: Azerbaijani (https://www.transifex.com/calamares/teams/20061/az/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"

View File

@ -4,7 +4,7 @@
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
# Translators:
# xxmn77 <xxmn77@gmail.com>, 2020
# Xəyyam Qocayev <xxmn77@gmail.com>, 2020
#
#, fuzzy
msgid ""
@ -13,7 +13,7 @@ msgstr ""
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-12-07 17:09+0100\n"
"PO-Revision-Date: 2017-08-09 10:34+0000\n"
"Last-Translator: xxmn77 <xxmn77@gmail.com>, 2020\n"
"Last-Translator: Xəyyam Qocayev <xxmn77@gmail.com>, 2020\n"
"Language-Team: Azerbaijani (Azerbaijan) (https://www.transifex.com/calamares/teams/20061/az_AZ/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"

View File

@ -5,7 +5,7 @@
#
# Translators:
# Eli Shleifer <eligator@gmail.com>, 2017
# Omeritzics Games <omeritzicschwartz@gmail.com>, 2020
# Omer I.S. <omeritzicschwartz@gmail.com>, 2020
# Yaron Shahrabani <sh.yaron@gmail.com>, 2020
#
#, fuzzy

View File

@ -219,3 +219,16 @@ slideshow: "show.qml"
slideshowAPI: 2
# These options are to customize online uploading of logs to pastebins:
# - type : Defines the kind of pastebin service to be used.Currently
# it accepts two values:
# - none : disables the pastebin functionality
# - fiche : use fiche pastebin server
# - url : Defines the address of pastebin service to be used.
# Takes string as input
# - port : Defines the port number to be used to send logs. Takes
# integer as input
uploadServer :
type : "fiche"
url : "termbin.com"
port : 9999

View File

@ -59,7 +59,7 @@ dumpWidgetTree( QDebug& deb, const QWidget* widget, int depth )
{
deb << ' ';
}
deb << widget->objectName();
deb << widget->metaObject()->className() << widget->objectName();
for ( const auto* w : widget->findChildren< QWidget* >( QString(), Qt::FindDirectChildrenOnly ) )
{

View File

@ -19,6 +19,8 @@
#include <QMutexLocker>
#include <QThread>
#include <memory>
namespace Calamares
{

View File

@ -29,7 +29,8 @@
/* MODIFICATIONS
*
* Edited anyway:
* 20191211 India changed to AnyLanguage, since Hindi doesn't make sense. #1284
* 20191211 India (IN) changed to AnyLanguage, since Hindi doesn't make sense. #1284
* 20210207 Belarus (BY) changed to Russian, as the more-common-language. #1634
*
*/
@ -77,7 +78,7 @@ static const CountryData country_data_table[] = {
{ QLocale::Language::Portuguese, QLocale::Country::Brazil, 'B', 'R' },
{ QLocale::Language::Dzongkha, QLocale::Country::Bhutan, 'B', 'T' },
{ QLocale::Language::AnyLanguage, QLocale::Country::BouvetIsland, 'B', 'V' },
{ QLocale::Language::Belarusian, QLocale::Country::Belarus, 'B', 'Y' },
{ QLocale::Language::Russian, QLocale::Country::Belarus, 'B', 'Y' },
{ QLocale::Language::Swahili, QLocale::Country::CongoKinshasa, 'C', 'D' },
{ QLocale::Language::French, QLocale::Country::CentralAfricanRepublic, 'C', 'F' },
{ QLocale::Language::French, QLocale::Country::CongoBrazzaville, 'C', 'G' },

View File

@ -12,6 +12,8 @@
#include <QtDBus>
#include <optional>
namespace CalamaresUtils
{
namespace Partition
@ -58,13 +60,21 @@ querySolidAutoMount( QDBusConnection& dbus, AutoMountInfo& info )
// Find previous setting; this **does** need to block
auto msg = kdedCall( QStringLiteral( "isModuleAutoloaded" ) );
msg.setArguments( { moduleName } );
std::optional< bool > result;
QDBusMessage r = dbus.call( msg, QDBus::Block );
if ( r.type() == QDBusMessage::ReplyMessage )
{
auto arg = r.arguments();
cDebug() << arg;
info.wasSolidModuleAutoLoaded = false;
if ( arg.length() == 1 )
{
auto v = arg.at( 0 );
if ( v.isValid() && v.type() == QVariant::Bool )
{
result = v.toBool();
}
}
}
info.wasSolidModuleAutoLoaded = result.has_value() ? result.value() : false;
}
std::shared_ptr< AutoMountInfo >
@ -79,7 +89,7 @@ automountDisable( bool disable )
void
automountRestore( std::shared_ptr< AutoMountInfo >&& t )
automountRestore( const std::shared_ptr< AutoMountInfo >& t )
{
QDBusConnection dbus = QDBusConnection::sessionBus();
enableSolidAutoMount( dbus, t->wasSolidModuleAutoLoaded );

View File

@ -43,7 +43,7 @@ DLLEXPORT std::shared_ptr< AutoMountInfo > automountDisable( bool disable = true
* Pass the value returned from automountDisable() to restore the
* previous settings.
*/
DLLEXPORT void automountRestore( std::shared_ptr< AutoMountInfo >&& t );
DLLEXPORT void automountRestore( const std::shared_ptr< AutoMountInfo >& t );
} // namespace Partition
} // namespace CalamaresUtils

View File

@ -13,10 +13,13 @@
#ifndef UTILS_LOGGER_H
#define UTILS_LOGGER_H
#include <QDebug>
#include "DllMacro.h"
#include <QDebug>
#include <QSharedPointer>
#include <memory>
namespace Logger
{
struct FuncSuppressor
@ -206,16 +209,34 @@ public:
* Pointers are printed as void-pointer, so just an address (unlike, say,
* QObject pointers which show an address and some metadata) preceded
* by an '@'. This avoids C-style (void*) casts in the code.
*
* Shared pointers are indicated by 'S@' and unique pointers by 'U@'.
*/
struct Pointer
{
public:
explicit Pointer( const void* p )
: ptr( p )
, kind( 0 )
{
}
template < typename T >
explicit Pointer( const std::shared_ptr< T >& p )
: ptr( p.get() )
, kind( 'S' )
{
}
template < typename T >
explicit Pointer( const std::unique_ptr< T >& p )
: ptr( p.get() )
, kind( 'U' )
{
}
const void* const ptr;
const char kind;
};
/** @brief output operator for DebugRow */
@ -256,7 +277,12 @@ operator<<( QDebug& s, const DebugMap& t )
inline QDebug&
operator<<( QDebug& s, const Pointer& p )
{
s << NoQuote << '@' << p.ptr << Quote;
s << NoQuote;
if ( p.kind )
{
s << p.kind;
}
s << '@' << p.ptr << Quote;
return s;
}
} // namespace Logger

View File

@ -11,11 +11,13 @@
/** @brief Support for "named" enumerations
*
* For tables which map string names to enum values, provide a NamedEnumTable
* which hangs on to an initializer_list of pairs of names and values.
* This table can be used with find() to map names to values, or
* values to names. A convenience function smash() is provided to help
* in printing integer (underlying) values of an enum.
* When a string needs to be one specific string out of a set of
* alternatives -- one "name" from an enumerated set -- then it
* is useful to have an **enum type** for the enumeration so that
* C++ code can work with the (strong) type of the enum, while
* the string can be used for human-readable interaction.
* The `NamedEnumTable<E>` template provides support for naming
* values of an enum.
*/
#ifndef UTILS_NAMEDENUM_H
@ -27,7 +29,100 @@
#include <type_traits>
#include <vector>
/** @brief Type for collecting parts of a named enum. */
/** @brief Type for collecting parts of a named enum.
*
* The `NamedEnumTable<E>` template provides support for naming
* values of an enum. It supports mapping strings to enum values
* and mapping enum values to strings.
*
* ## Example
*
* Suppose we have code where there are three alternatives; it is
* useful to have a strong type to make the alternatives visible
* in that code, so the compiler can help check:
*
* ```
* enum class MilkshakeSize { None, Small, Large };
* ```
*
* In a switch() statement, the compiler will check that all kinds
* of milkshakes are dealt with; we can pass a MilkshakeSize to
* a function and rest assured that nobody will call that function
* with a silly value, like `1`.
*
* There is no relation between the C++ identifiers used, and
* any I/O related to that enumeration. In other words,
*
* ```
* std::cout << MilkshakeSize::Small;
* ```
*
* Will **not** print out "Small", or "small", or 1. It won't even
* compile, because there is no mapping of the enum values to
* something that can be output.
*
* By making a `NamedEnumTable<MilkshakeSize>` we can define a mapping
* between strings (names) and enum values, so that we can easily
* output the human-readable name, and also take string input
* and convert it to an enum value. Suppose we have a function
* `milkshakeSizeNames()` that returns a reference to such a table,
* then we can use `find()` to map enums-to-names and names-to-enums.
*
* ```
* const auto& names = milkshakeSizeNames();
* MilkshakeSize sz{ MilkshakeSize::Large };
* std::cout << names.find(sz); // Probably "large"
*
* bool ok;
* sz = names.find( "small", ok ); // Probably MilkshakeSize::Small
* ```
*
* ## Usage
*
* It is recommended to use a static const declaration for the table;
* typical use will define a function that returns a reference to
* the table, for shared use.
*
* The constructor for a table takes an initializer_list; each element
* of the initializer_list is a **pair** consisting of a name and
* an associated enum value. The names should be QStrings. For each enum
* value that is listed, the canonical name should come **first** in the
* table, so that printing the enum values gives the canonical result.
*
* ```
* static const NamedEnumTable<MilkshakeSize>& milkshakeSizeNames()
* {
* static NamedEnumTable<MilkshakeSize> n { // Initializer list for n
* { "large", MilkshakeSize::Large }, // One pair of name-and-value
* { "small", MilkshakeSize::Small },
* { "big", MilkshakeSize::Large }
* };
* return n;
* }
* ```
*
* The function `eNames()`, above, returns a reference to a name table
* for the enum (presumably an enum class) `E`. It is possible to have
* more than one table for an enum, or to make the table locally,
* but **usually** you want one definitive table of names and values.
* The `eNames()` function gives you that definitive table. In Calamres
* code, such functions are usually named after the underlying enum.
*
* Using this particular table, looking up "large" will return `MilkshakeSize::Large`,
* looking up "big" will **also** return `MilkshakeSize::Large`, looking up "derp"
* will return `MilkshakeSize::Large` (because that is the first value in the table)
* but will set the boolean `ok` parameter to false. Conversely, looking
* up `MilkshakeSize::Large` will return "large" (never "big").
*
* Note that this particular table does **not** name MilkshakeSize::None,
* so it is probably wrong: you can't get a string for that enum
* value, and no string will map to MilkshakeSize::None either.
* In general, tables should cover all of the enum values.
*
* Passing an empty initializer_list to the constructor is supported,
* but will cause UB if the table is ever used for looking up a string.
*
*/
template < typename T >
struct NamedEnumTable
{
@ -43,7 +138,9 @@ struct NamedEnumTable
* Use braced-initialisation for NamedEnum, and remember that the
* elements of the list are **pairs**, e.g.
*
* ```
* static const NamedEnumTable<Colors> c{ {"red", Colors::Red } };
* ```
*/
NamedEnumTable( const std::initializer_list< pair_t >& v )
: table( v )
@ -55,10 +152,12 @@ struct NamedEnumTable
*
* Searches case-insensitively.
*
* If the name @p s is not found, @p ok is set to false and
* If the name @p s is not found, @p ok is set to @c false and
* the first enum value in the table is returned. Otherwise,
* @p ok is set to true and the corresponding value is returned.
*
* @p ok is set to @c true and the corresponding value is returned.
* Use the output value of @p ok to determine if the lookup was
* successful: there is otherwise no sensible way to distinguish
* found-the-name-of-the-first-item from not-found.
*/
enum_t find( const string_t& s, bool& ok ) const
{
@ -75,11 +174,17 @@ struct NamedEnumTable
return table.begin()->second;
}
/** @brief Find a value @p s in the table.
/** @brief Find a value @p s in the table and return its name.
*
* If the value @p s is not found, @p ok is set to false and
* an empty string is returned. Otherwise, @p is set to true
* and the corresponding name is returned.
* If @p s is an enum value in the table, return the corresponding
* name (the first name with that value, if there are aliases)
* and set @p ok to @c true.
*
* If the value @p s is not found, @p ok is set to @c false and
* an empty string is returned. This indicates that the table does
* not cover all of the values * in `enum_t` (and @p s is one
* of them), **or** that the passed-in value of @p s is
* not a legal value, e.g. via a static_cast<enum_t>.
*/
string_t find( enum_t s, bool& ok ) const
{
@ -98,7 +203,10 @@ struct NamedEnumTable
/** @brief Find a value @p s in the table and return its name.
*
* Returns emptry string if the value is not found.
* Returns an empty string if the value @p s is not found (this
* indicates that the table does not cover all of the values
* in `enum_t`, **or** that the passed-in value of @p s is
* not a legal value, e.g. via a static_cast<enum_t>).
*/
string_t find( enum_t s ) const
{
@ -107,7 +215,24 @@ struct NamedEnumTable
}
};
/** @brief Smashes an enum value to its underlying type. */
/** @brief Smashes an enum value to its underlying type.
*
* While an enum **class** is not an integral type, and its values can't be
* printed or treated like an integer (like an old-style enum can),
* the underlying type **is** integral. This template function
* returns the value of an enum value, in its underlying type.
* This can be useful for debugging purposes, e.g.
*
* ```
* MilkshakeSize sz{ MilkshakeSize::None };
* std::cout << milkshakeSizeNames().find( sz ) << smash( sz );
* ```
*
* This will print both the name and the underlying integer for the
* value; assuming the table from the example is used, there is
* no name for MilkshakeSize::None, so it will print an empty string,
* followed by the integral representation -- probably a 0.
*/
template < typename E >
constexpr typename std::underlying_type< E >::type
smash( const E e )

View File

@ -135,14 +135,15 @@ truncateMultiLine( const QString& string, CalamaresUtils::LinesStartEnd lines, C
return shorter;
}
const int linesInString = string.count( NEWLINE ) + ( string.endsWith( NEWLINE ) ? 0 : 1 );
if ( ( string.length() <= chars.total ) && ( linesInString <= maxLines ) )
const int physicalLinesInString = string.count( NEWLINE );
const int logicalLinesInString = physicalLinesInString + ( string.endsWith( NEWLINE ) ? 0 : 1 );
if ( ( string.length() <= chars.total ) && ( logicalLinesInString <= maxLines ) )
{
return string;
}
QString front, back;
if ( string.count( NEWLINE ) >= maxLines )
if ( physicalLinesInString >= maxLines )
{
int from = -1;
for ( int i = 0; i < lines.atStart; ++i )
@ -174,8 +175,53 @@ truncateMultiLine( const QString& string, CalamaresUtils::LinesStartEnd lines, C
back = string.right( lastNewLine );
}
}
else
{
// We have: <= maxLines and longer than chars.total, so:
// - carve out a chunk in the middle, based a little on
// how the balance of atStart and atEnd is
const int charsToChop = string.length() - chars.total;
if ( charsToChop < 1 )
{
// That's strange, again
return string;
}
const int startPortion = charsToChop * lines.atStart / maxLines;
const int endPortion = charsToChop * lines.atEnd / maxLines;
front = string.left( string.length() / 2 - startPortion );
back = string.right( string.length() / 2 - endPortion );
}
return front + back;
if ( front.length() + back.length() <= chars.total )
{
return front + back;
}
// We need to cut off some bits, preserving whether there are
// newlines present at the end of the string. Go case-by-case:
if ( !front.isEmpty() && back.isEmpty() )
{
// Truncate towards the front
bool needsNewline = front.endsWith( NEWLINE );
front.truncate( chars.total );
if ( !front.endsWith( NEWLINE ) && needsNewline )
{
front.append( NEWLINE );
}
return front;
}
if ( front.isEmpty() && !back.isEmpty() )
{
// Truncate towards the tail
return back.right( chars.total );
}
// Both are non-empty, so nibble away at both of them
front.truncate( chars.total / 2 );
if ( !front.endsWith( NEWLINE ) && physicalLinesInString > 0 )
{
front.append( NEWLINE );
}
return front + back.right( chars.total / 2 );
}

View File

@ -89,6 +89,8 @@ struct CharCount
* @p lines.atStart is zero) or end (if @p lines.atEnd is zero) or in the middle
* (if both are nonzero).
*
* Asking for 0 lines will make this behave like QString::truncate().
*
* @param string the input string.
* @param lines number of lines to preserve.
* @param chars maximum number of characters in the returned string.

View File

@ -67,6 +67,7 @@ private Q_SLOTS:
/** @brief Test smart string truncation. */
void testStringTruncation();
void testStringTruncationShorter();
void testStringTruncationDegenerate();
private:
void recursiveCompareMap( const QVariantMap& a, const QVariantMap& b, int depth );
@ -597,6 +598,8 @@ and the translations updated.)" );
QVERIFY( !longString.endsWith( NEWLINE ) );
QCOMPARE( longString.count( NEWLINE ), 2 );
QVERIFY( longString.length() > insufficientLength );
// Even the first line must be more than the insufficientLength
QVERIFY( longString.indexOf( NEWLINE ) > insufficientLength );
// Grab first line, untruncated
{
@ -626,11 +629,84 @@ and the translations updated.)" );
QVERIFY( longString.endsWith( s ) );
QVERIFY( !s.endsWith( NEWLINE ) );
QVERIFY( s.endsWith( "updated." ) );
cDebug() << "Result-line" << Logger::Quote << s;
QCOMPARE( s.count( NEWLINE ), 1 ); // Because last line doesn't end with a newline
QVERIFY( s.startsWith( "displayed in " ) );
}
// First line, truncated
{
auto s = truncateMultiLine( longString, LinesStartEnd { 1, 0 }, CharCount { insufficientLength } );
cDebug() << "Result-line" << Logger::Quote << s;
QVERIFY( s.length() > 1 );
QVERIFY( s.endsWith( NEWLINE ) );
QVERIFY( s.startsWith( "Some " ) );
// Because the first line has a newline, the truncated version does too,
// but that makes it one longer than requested.
QCOMPARE( s.length(), insufficientLength + 1 );
QVERIFY( longString.startsWith( s.left( insufficientLength ) ) );
}
// Last line, truncated; this line is quite short
{
const int quiteShort = 8;
QVERIFY( longString.lastIndexOf( NEWLINE ) < longString.length() - quiteShort );
auto s = truncateMultiLine( longString, LinesStartEnd { 0, 1 }, CharCount { quiteShort } );
cDebug() << "Result-line" << Logger::Quote << s;
QVERIFY( s.length() > 1 );
QVERIFY( !s.endsWith( NEWLINE ) ); // Because the original doesn't either
QVERIFY( s.startsWith( "upda" ) );
QCOMPARE( s.length(), quiteShort ); // No extra newlines
QVERIFY( longString.endsWith( s ) );
}
// First and last, but both truncated
{
const int quiteShort = 16;
QVERIFY( longString.indexOf( NEWLINE ) > quiteShort );
QVERIFY( longString.lastIndexOf( NEWLINE ) < longString.length() - quiteShort );
auto s = truncateMultiLine( longString, LinesStartEnd { 1, 1 }, CharCount { quiteShort } );
cDebug() << "Result-line" << Logger::Quote << s;
QVERIFY( s.length() > 1 );
QVERIFY( !s.endsWith( NEWLINE ) ); // Because the original doesn't either
QVERIFY( s.startsWith( "Some " ) );
QVERIFY( s.endsWith( "updated." ) );
QCOMPARE( s.length(), quiteShort + 1 ); // Newline between front and back part
}
}
void
LibCalamaresTests::testStringTruncationDegenerate()
{
Logger::setupLogLevel( Logger::LOGDEBUG );
using namespace CalamaresUtils;
// This is quite long, 1 line only, with no newlines
const QString longString( "The portscout new distfile checker has detected that one or more of your "
"ports appears to be out of date. Please take the opportunity to check "
"each of the ports listed below, and if possible and appropriate, "
"submit/commit an update. If any ports have already been updated, you can "
"safely ignore the entry." );
const char NEWLINE = '\n';
const int quiteShort = 16;
QVERIFY( longString.length() > quiteShort );
QVERIFY( !longString.contains( NEWLINE ) );
QVERIFY( longString.indexOf( NEWLINE ) < 0 );
{
auto s = truncateMultiLine( longString, LinesStartEnd { 1, 0 }, CharCount { quiteShort } );
cDebug() << "Result-line" << Logger::Quote << s;
QVERIFY( s.length() > 1 );
QCOMPARE( s.length(), quiteShort ); // No newline between front and back part
QVERIFY( s.startsWith( "The port" ) ); // 8, which is quiteShort / 2
QVERIFY( s.endsWith( "e entry." ) ); // also 8 chars
auto t = truncateMultiLine( longString, LinesStartEnd { 2, 2 }, CharCount { quiteShort } );
QCOMPARE( s, t );
}
}

View File

@ -4,6 +4,7 @@
* SPDX-FileCopyrightText: 2017-2019 Adriaan de Groot <groot@kde.org>
* SPDX-FileCopyrightText: 2018 Raul Rodrigo Segura (raurodse)
* SPDX-FileCopyrightText: 2019 Camilo Higuita <milo.h@aol.com>
* SPDX-FileCopyrightText: 2021 Anubhav Choudhary <ac.10edu@gmail.com>
* SPDX-License-Identifier: GPL-3.0-or-later
*
* Calamares is Free Software: see the License-Identifier above.
@ -86,6 +87,13 @@ const QStringList Branding::s_styleEntryStrings =
"sidebarTextSelect",
"sidebarTextHighlight"
};
const QStringList Branding::s_uploadServerStrings =
{
"type",
"url",
"port"
};
// clang-format on
// *INDENT-ON*
@ -218,6 +226,12 @@ Branding::Branding( const QString& brandingFilePath, QObject* parent )
return imageFi.absoluteFilePath();
} );
loadStrings( m_style, doc, "style", []( const QString& s ) -> QString { return s; } );
const QVariantMap temp = CalamaresUtils::yamlMapToVariant( doc[ "uploadServer" ] );
for ( auto it = temp.constBegin(); it != temp.constEnd(); ++it )
{
m_uploadServer.insert( it.key(), it.value().toString() );
}
}
catch ( YAML::Exception& e )
{
@ -278,6 +292,11 @@ Branding::imagePath( Branding::ImageEntry imageEntry ) const
return m_images.value( s_imageEntryStrings.value( imageEntry ) );
}
QString
Branding::uploadServer( Branding::UploadServerEntry uploadServerEntry ) const
{
return m_uploadServer.value( s_uploadServerStrings.value( uploadServerEntry ) );
}
QPixmap
Branding::image( Branding::ImageEntry imageEntry, const QSize& size ) const

View File

@ -4,6 +4,7 @@
* SPDX-FileCopyrightText: 2017-2018 Adriaan de Groot <groot@kde.org>
* SPDX-FileCopyrightText: 2018 Raul Rodrigo Segura (raurodse)
* SPDX-FileCopyrightText: 2019 Camilo Higuita <milo.h@aol.com>
* SPDX-FileCopyrightText: 2021 Anubhav Choudhary <ac.10edu@gmail.com>
* SPDX-License-Identifier: GPL-3.0-or-later
*
* Calamares is Free Software: see the License-Identifier above.
@ -22,6 +23,7 @@
#include <QPixmap>
#include <QSize>
#include <QStringList>
#include <QUrl>
namespace YAML
{
@ -42,6 +44,7 @@ public:
* e.g. *Branding::ProductName to get the string value for
* the product name.
*/
enum StringEntry
{
ProductName,
@ -80,6 +83,14 @@ public:
};
Q_ENUM( StyleEntry )
enum UploadServerEntry : short
{
Type,
URL,
Port
};
Q_ENUM( UploadServerEntry )
/** @brief Setting for how much the main window may expand. */
enum class WindowExpansion
{
@ -223,6 +234,7 @@ public slots:
QString styleString( StyleEntry styleEntry ) const;
QString imagePath( ImageEntry imageEntry ) const;
QString uploadServer( UploadServerEntry uploadServerEntry ) const;
PanelSide sidebarSide() const { return m_sidebarSide; }
PanelSide navigationSide() const { return m_navigationSide; }
@ -233,12 +245,14 @@ private:
static const QStringList s_stringEntryStrings;
static const QStringList s_imageEntryStrings;
static const QStringList s_styleEntryStrings;
static const QStringList s_uploadServerStrings;
QString m_descriptorPath; // Path to descriptor (e.g. "/etc/calamares/default/branding.desc")
QString m_componentName; // Matches last part of full path to containing directory
QMap< QString, QString > m_strings;
QMap< QString, QString > m_images;
QMap< QString, QString > m_style;
QMap< QString, QString > m_uploadServer;
/* The slideshow can be done in one of two ways:
* - as a sequence of images

View File

@ -4,6 +4,7 @@
* SPDX-FileCopyrightText: 2017-2018 Adriaan de Groot <groot@kde.org>
* SPDX-FileCopyrightText: 2019 Dominic Hayes <ferenosdev@outlook.com>
* SPDX-FileCopyrightText: 2019 Gabriel Craciunescu <crazy@frugalware.org>
* SPDX-FileCopyrightText: 2021 Anubhav Choudhary <ac.10edu@gmail.com>
* SPDX-License-Identifier: GPL-3.0-or-later
*
* Calamares is Free Software: see the License-Identifier above.
@ -141,7 +142,8 @@ ViewManager::insertViewStep( int before, ViewStep* step )
void
ViewManager::onInstallationFailed( const QString& message, const QString& details )
{
bool shouldOfferWebPaste = false; // TODO: config var
QString serverType = Calamares::Branding::instance()->uploadServer( Calamares::Branding::Type );
bool shouldOfferWebPaste = CalamaresUtils::UploadServersList.contains( serverType );
cError() << "Installation failed:" << message;
cDebug() << Logger::SubEntry << "- message:" << message;
@ -153,7 +155,10 @@ ViewManager::onInstallationFailed( const QString& message, const QString& detail
QString text = "<p>" + message + "</p>";
if ( !details.isEmpty() )
{
text += "<p>" + CalamaresUtils::truncateMultiLine( details, CalamaresUtils::LinesStartEnd { 8, 0 } ) + "</p>";
text += "<p>"
+ CalamaresUtils::truncateMultiLine( details, CalamaresUtils::LinesStartEnd { 6, 2 } )
.replace( '\n', QStringLiteral( "<br/>" ) )
+ "</p>";
}
if ( shouldOfferWebPaste )
{
@ -184,8 +189,16 @@ ViewManager::onInstallationFailed( const QString& message, const QString& detail
connect( msgBox, &QMessageBox::buttonClicked, [msgBox]( QAbstractButton* button ) {
if ( msgBox->buttonRole( button ) == QMessageBox::ButtonRole::YesRole )
{
// TODO: host and port should be configurable
QString pasteUrlMsg = CalamaresUtils::sendLogToPastebin( msgBox, QStringLiteral( "termbin.com" ), 9999 );
QString pasteUrlMsg;
QString serverType = Calamares::Branding::instance()->uploadServer( Calamares::Branding::Type );
if ( serverType == "fiche" )
{
pasteUrlMsg = CalamaresUtils::ficheLogUpload( msgBox );
}
else
{
pasteUrlMsg = QString();
}
QString pasteUrlTitle = tr( "Install Log Paste URL" );
if ( pasteUrlMsg.isEmpty() )

View File

@ -9,20 +9,35 @@
#include "Paste.h"
#include "Branding.h"
#include "utils/Logger.h"
#include <QFile>
#include <QRegularExpression>
#include <QTcpSocket>
#include <QUrl>
#include <QClipboard>
#include <QApplication>
#include <QStringList>
namespace CalamaresUtils
{
QStringList UploadServersList = {
"fiche"
// In future more serverTypes can be added as Calamares support them
// "none" serverType is explicitly not mentioned here
};
QString
sendLogToPastebin( QObject* parent, const QString& ficheHost, quint16 fichePort )
ficheLogUpload( QObject* parent )
{
QString pasteUrlFmt = parent->tr( "Install log posted to:\n%1" );
const QString& ficheHost = Calamares::Branding::instance()->uploadServer( Calamares::Branding::URL );
quint16 fichePort = Calamares::Branding::instance()->uploadServer( Calamares::Branding::Port ).toInt();
QString pasteUrlFmt = parent->tr( "Install log posted to\n\n%1\n\nLink copied to clipboard" );
QFile pasteSourceFile( Logger::logFile() );
if ( !pasteSourceFile.open( QIODevice::ReadOnly | QIODevice::Text ) )
{
@ -78,7 +93,17 @@ sendLogToPastebin( QObject* parent, const QString& ficheHost, quint16 fichePort
QRegularExpression pasteUrlRegex( "^http[s]?://" + ficheHost );
QString pasteUrlMsg = QString( pasteUrlFmt ).arg( pasteUrlStr );
if ( nBytesRead < 8 || !pasteUrl.isValid() || !pasteUrlRegex.match( pasteUrlStr ).hasMatch() )
if ( nBytesRead >= 8 && pasteUrl.isValid() && pasteUrlRegex.match( pasteUrlStr ).hasMatch() )
{
QClipboard* clipboard = QApplication::clipboard();
clipboard->setText(pasteUrlStr, QClipboard::Clipboard);
if (clipboard->supportsSelection())
{
clipboard->setText(pasteUrlStr, QClipboard::Selection);
}
}
else
{
cError() << "No data from paste server";
return QString();

View File

@ -10,7 +10,7 @@
#ifndef UTILS_PASTE_H
#define UTILS_PASTE_H
#include <qglobal.h> // for quint16
#include<QStringList>
class QObject;
class QString;
@ -22,7 +22,9 @@ namespace CalamaresUtils
*
* Returns the (string) URL that the pastebin gives us.
*/
QString sendLogToPastebin( QObject* parent, const QString& ficheHost, quint16 fichePort );
QString ficheLogUpload( QObject* parent );
extern QStringList UploadServersList;
} // namespace CalamaresUtils

View File

@ -24,7 +24,6 @@
#include "utils/CalamaresUtilsGui.h"
#include "utils/Dirs.h"
#include "utils/Logger.h"
#include "utils/Qml.h"
#include "utils/Retranslator.h"
#include <QDir>
@ -62,6 +61,10 @@ ExecutionViewStep::ExecutionViewStep( QObject* parent )
, m_label( new QLabel )
, m_slideshow( makeSlideshow( m_widget ) )
{
m_widget->setObjectName( "slideshow" );
m_progressBar->setObjectName( "exec-progress" );
m_label->setObjectName( "exec-message" );
QVBoxLayout* layout = new QVBoxLayout( m_widget );
QVBoxLayout* innerLayout = new QVBoxLayout;

View File

@ -43,6 +43,8 @@ SlideshowQML::SlideshowQML( QWidget* parent )
, m_qmlComponent( nullptr )
, m_qmlObject( nullptr )
{
m_qmlShow->setObjectName("qml");
CalamaresUtils::registerQmlModels();
m_qmlShow->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
@ -203,6 +205,8 @@ SlideshowPictures::SlideshowPictures( QWidget* parent )
, m_imageIndex( 0 )
, m_images( Branding::instance()->slideshowImages() )
{
m_label->setObjectName("image");
m_label->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
m_label->setAlignment( Qt::AlignCenter );
m_timer->setInterval( std::chrono::milliseconds( 2000 ) );

View File

@ -14,6 +14,7 @@
# SPDX-FileCopyrightText: 2017-2019 Adriaan de Groot <groot@kde.org>
# SPDX-FileCopyrightText: 2017 Gabriel Craciunescu <crazy@frugalware.org>
# SPDX-FileCopyrightText: 2017 Ben Green <Bezzy1999@hotmail.com>
# SPDX-FileCopyrightText: 2021 Neal Gompa <ngompa13@gmail.com>
# SPDX-License-Identifier: GPL-3.0-or-later
#
# Calamares is Free Software: see the License-Identifier above.
@ -372,9 +373,9 @@ def install_secureboot(efi_directory):
install_efi_directory = install_path + efi_directory
if efi_word_size() == "64":
install_efi_bin = "shim64.efi"
else:
install_efi_bin = "shim.efi"
install_efi_bin = "shimx64.efi"
elif efi_word_size() == "32":
install_efi_bin = "shimia32.efi"
# Copied, roughly, from openSUSE's install script,
# and pythonified. *disk* is something like /dev/sda,

View File

@ -11,6 +11,7 @@ calamares_add_plugin( finished
TYPE viewmodule
EXPORT_MACRO PLUGINDLLEXPORT_PRO
SOURCES
Config.cpp
FinishedViewStep.cpp
FinishedPage.cpp
UI

View File

@ -0,0 +1,201 @@
/* === This file is part of Calamares - <https://calamares.io> ===
*
* SPDX-FileCopyrightText: 2021 Adriaan de Groot <groot@kde.org>
* SPDX-License-Identifier: GPL-3.0-or-later
*
* Calamares is Free Software: see the License-Identifier above.
*
*/
#include "Config.h"
#include "Branding.h"
#include "Settings.h"
#include "utils/Logger.h"
#include "utils/Variant.h"
#include <QProcess>
#include <QtDBus/QDBusConnection>
#include <QtDBus/QDBusInterface>
#include <QtDBus/QDBusReply>
const NamedEnumTable< Config::RestartMode >&
restartModes()
{
using M = Config::RestartMode;
static const NamedEnumTable< M > table { { "never", M::Never },
{ "user-unchecked", M::UserDefaultUnchecked },
{ "unchecked", M::UserDefaultUnchecked },
{ "user-checked", M::UserDefaultChecked },
{ "checked", M::UserDefaultChecked },
{ "always", M::Always }
};
return table;
}
Config::Config( QObject* parent )
: QObject( parent )
{
}
void
Config::setRestartNowMode( Config::RestartMode m )
{
// Can only go "down" in state (Always > UserDefaultChecked > .. > Never)
if ( m > m_restartNowMode )
{
return;
}
// If changing to an unconditional mode, also set other flag
if ( m == RestartMode::Always || m == RestartMode::Never )
{
setRestartNowWanted( m == RestartMode::Always );
}
if ( m != m_restartNowMode )
{
m_restartNowMode = m;
emit restartModeChanged( m );
}
}
void
Config::setRestartNowWanted( bool w )
{
// Follow the mode which may affect @p w
if ( m_restartNowMode == RestartMode::Always )
{
w = true;
}
if ( m_restartNowMode == RestartMode::Never )
{
w = false;
}
if ( w != m_userWantsRestart )
{
m_userWantsRestart = w;
emit restartNowWantedChanged( w );
}
}
void
Config::doRestart()
{
if ( restartNowMode() != RestartMode::Never && restartNowWanted() )
{
cDebug() << "Running restart command" << m_restartNowCommand;
QProcess::execute( "/bin/sh", { "-c", m_restartNowCommand } );
}
}
void
Config::doNotify( bool hasFailed )
{
if ( !notifyOnFinished() )
{
return;
}
QDBusInterface notify(
"org.freedesktop.Notifications", "/org/freedesktop/Notifications", "org.freedesktop.Notifications" );
if ( notify.isValid() )
{
cDebug() << "Sending notification of completion. Failed?" << hasFailed;
QString title;
QString message;
if ( hasFailed )
{
title = Calamares::Settings::instance()->isSetupMode() ? tr( "Setup Failed" ) : tr( "Installation Failed" );
message = Calamares::Settings::instance()->isSetupMode()
? tr( "The setup of %1 did not complete successfully." )
: tr( "The installation of %1 did not complete successfully." );
}
else
{
title = Calamares::Settings::instance()->isSetupMode() ? tr( "Setup Complete" )
: tr( "Installation Complete" );
message = Calamares::Settings::instance()->isSetupMode() ? tr( "The setup of %1 is complete." )
: tr( "The installation of %1 is complete." );
}
const auto* branding = Calamares::Branding::instance();
QDBusReply< uint > r = notify.call( "Notify",
QString( "Calamares" ),
QVariant( 0U ),
QString( "calamares" ),
title,
message.arg( branding->versionedName() ),
QStringList(),
QVariantMap(),
QVariant( 0 ) );
if ( !r.isValid() )
{
cWarning() << "Could not call org.freedesktop.Notifications.Notify at end of installation." << r.error();
}
}
else
{
cWarning() << "Could not get dbus interface for notifications at end of installation." << notify.lastError();
}
}
void
Config::setConfigurationMap( const QVariantMap& configurationMap )
{
RestartMode mode = RestartMode::Never;
//TODO:3.3 remove deprecated restart settings
QString restartMode = CalamaresUtils::getString( configurationMap, "restartNowMode" );
if ( restartMode.isEmpty() )
{
if ( configurationMap.contains( "restartNowEnabled" ) )
{
cWarning() << "Configuring the finished module with deprecated restartNowEnabled settings";
}
bool restartNowEnabled = CalamaresUtils::getBool( configurationMap, "restartNowEnabled", false );
bool restartNowChecked = CalamaresUtils::getBool( configurationMap, "restartNowChecked", false );
if ( !restartNowEnabled )
{
mode = RestartMode::Never;
}
else
{
mode = restartNowChecked ? RestartMode::UserDefaultChecked : RestartMode::UserDefaultUnchecked;
}
}
else
{
bool ok = false;
mode = restartModes().find( restartMode, ok );
if ( !ok )
{
cWarning() << "Configuring the finished module with bad restartNowMode" << restartMode;
}
}
m_restartNowMode = mode;
m_userWantsRestart = ( mode == RestartMode::Always || mode == RestartMode::UserDefaultChecked );
emit restartModeChanged( m_restartNowMode );
emit restartNowWantedChanged( m_userWantsRestart );
if ( mode != RestartMode::Never )
{
QString restartNowCommand = CalamaresUtils::getString( configurationMap, "restartNowCommand" );
if ( restartNowCommand.isEmpty() )
{
restartNowCommand = QStringLiteral( "shutdown -r now" );
}
m_restartNowCommand = restartNowCommand;
}
m_notifyOnFinished = CalamaresUtils::getBool( configurationMap, "notifyOnFinished", false );
}

View File

@ -0,0 +1,81 @@
/* === This file is part of Calamares - <https://calamares.io> ===
*
* SPDX-FileCopyrightText: 2021 Adriaan de Groot <groot@kde.org>
* SPDX-License-Identifier: GPL-3.0-or-later
*
* Calamares is Free Software: see the License-Identifier above.
*
*/
#ifndef FINISHED_CONFIG_H
#define FINISHED_CONFIG_H
#include "utils/NamedEnum.h"
#include <QObject>
class Config : public QObject
{
Q_OBJECT
Q_PROPERTY( RestartMode restartNowMode READ restartNowMode WRITE setRestartNowMode NOTIFY restartModeChanged )
Q_PROPERTY( bool restartNowWanted READ restartNowWanted WRITE setRestartNowWanted NOTIFY restartNowWantedChanged )
Q_PROPERTY( QString restartNowCommand READ restartNowCommand CONSTANT FINAL )
Q_PROPERTY( bool notifyOnFinished READ notifyOnFinished CONSTANT FINAL )
public:
Config( QObject* parent = nullptr );
enum class RestartMode
{
Never,
UserDefaultUnchecked,
UserDefaultChecked,
Always
};
Q_ENUM( RestartMode )
RestartMode restartNowMode() const { return m_restartNowMode; }
bool restartNowWanted() const { return m_userWantsRestart; }
QString restartNowCommand() const { return m_restartNowCommand; }
bool notifyOnFinished() const { return m_notifyOnFinished; }
void setConfigurationMap( const QVariantMap& configurationMap );
public slots:
void setRestartNowMode( RestartMode m );
void setRestartNowWanted( bool w );
/** @brief Run the restart command, if desired.
*
* This should generally not be called somewhere during the
* application's execution, but only in response to QApplication::quit()
* or something like that when the user expects the system to restart.
*/
void doRestart();
/** @brief Send DBus notification, if desired.
*
* This takes notifyOnFinished() into account.
*
* At the end of installation (when the FinishedViewStep is activated),
* send a desktop notification via DBus that the install is done.
*/
void doNotify( bool hasFailed = false );
signals:
void restartModeChanged( RestartMode m );
void restartNowWantedChanged( bool w );
private:
QString m_restartNowCommand;
RestartMode m_restartNowMode = RestartMode::Never;
bool m_userWantsRestart = false;
bool m_notifyOnFinished = false;
};
const NamedEnumTable< Config::RestartMode >& restartModes();
#endif

View File

@ -11,26 +11,19 @@
#include "FinishedPage.h"
#include "CalamaresVersion.h"
#include "ViewManager.h"
#include "Config.h"
#include "ui_FinishedPage.h"
#include "utils/CalamaresUtilsGui.h"
#include "utils/Logger.h"
#include "utils/Retranslator.h"
#include <QApplication>
#include <QBoxLayout>
#include <QFocusEvent>
#include <QLabel>
#include <QProcess>
#include "Branding.h"
#include "Settings.h"
#include "utils/Retranslator.h"
FinishedPage::FinishedPage( QWidget* parent )
#include <QFocusEvent>
FinishedPage::FinishedPage( Config* config, QWidget* parent )
: QWidget( parent )
, ui( new Ui::FinishedPage )
, m_mode( FinishedViewStep::RestartMode::UserUnchecked )
{
ui->setupUi( this );
@ -38,68 +31,19 @@ FinishedPage::FinishedPage( QWidget* parent )
ui->mainText->setWordWrap( true );
ui->mainText->setOpenExternalLinks( true );
CALAMARES_RETRANSLATE(
const auto* branding = Calamares::Branding::instance(); ui->retranslateUi( this );
if ( Calamares::Settings::instance()->isSetupMode() ) {
ui->mainText->setText( tr( "<h1>All done.</h1><br/>"
"%1 has been set up on your computer.<br/>"
"You may now start using your new system." )
.arg( branding->versionedName() ) );
ui->restartCheckBox->setToolTip( tr( "<html><head/><body>"
"<p>When this box is checked, your system will "
"restart immediately when you click on "
"<span style=\"font-style:italic;\">Done</span> "
"or close the setup program.</p></body></html>" ) );
} else {
ui->mainText->setText( tr( "<h1>All done.</h1><br/>"
"%1 has been installed on your computer.<br/>"
"You may now restart into your new system, or continue "
"using the %2 Live environment." )
.arg( branding->versionedName(), branding->productName() ) );
ui->restartCheckBox->setToolTip( tr( "<html><head/><body>"
"<p>When this box is checked, your system will "
"restart immediately when you click on "
"<span style=\"font-style:italic;\">Done</span> "
"or close the installer.</p></body></html>" ) );
} )
}
connect( config, &Config::restartModeChanged, [this]( Config::RestartMode mode ) {
using Mode = Config::RestartMode;
void
FinishedPage::setRestart( FinishedViewStep::RestartMode mode )
{
using Mode = FinishedViewStep::RestartMode;
m_mode = mode;
ui->restartCheckBox->setVisible( mode != Mode::Never );
ui->restartCheckBox->setEnabled( mode != Mode::Always );
ui->restartCheckBox->setChecked( ( mode == Mode::Always ) || ( mode == Mode::UserChecked ) );
}
void
FinishedPage::setRestartNowCommand( const QString& command )
{
m_restartNowCommand = command;
}
void
FinishedPage::setUpRestart()
{
cDebug() << "FinishedPage::setUpRestart(), Quit button"
<< "setup=" << FinishedViewStep::modeName( m_mode ) << "command=" << m_restartNowCommand;
connect( qApp, &QApplication::aboutToQuit, [this]() {
if ( ui->restartCheckBox->isVisible() && ui->restartCheckBox->isChecked() )
{
cDebug() << "Running restart command" << m_restartNowCommand;
QProcess::execute( "/bin/sh", { "-c", m_restartNowCommand } );
}
ui->restartCheckBox->setVisible( mode != Mode::Never );
ui->restartCheckBox->setEnabled( mode != Mode::Always );
} );
connect( config, &Config::restartNowWantedChanged, ui->restartCheckBox, &QCheckBox::setChecked );
connect( ui->restartCheckBox, &QCheckBox::stateChanged, [config]( int state ) {
config->setRestartNowWanted( state != 0 );
} );
}
CALAMARES_RETRANSLATE_SLOT( &FinishedPage::retranslate );
}
void
FinishedPage::focusInEvent( QFocusEvent* e )
@ -110,19 +54,64 @@ FinishedPage::focusInEvent( QFocusEvent* e )
void
FinishedPage::onInstallationFailed( const QString& message, const QString& details )
{
const auto* branding = Calamares::Branding::instance();
Q_UNUSED( details )
if ( Calamares::Settings::instance()->isSetupMode() )
ui->mainText->setText( tr( "<h1>Setup Failed</h1><br/>"
"%1 has not been set up on your computer.<br/>"
"The error message was: %2." )
.arg( branding->versionedName() )
.arg( message ) );
else
ui->mainText->setText( tr( "<h1>Installation Failed</h1><br/>"
"%1 has not been installed on your computer.<br/>"
"The error message was: %2." )
.arg( branding->versionedName() )
.arg( message ) );
setRestart( FinishedViewStep::RestartMode::Never );
m_failure = !message.isEmpty() ? message : details;
retranslate();
}
void
FinishedPage::retranslate()
{
const auto* branding = Calamares::Branding::instance();
ui->retranslateUi( this );
if ( !m_failure.has_value() )
{
if ( Calamares::Settings::instance()->isSetupMode() )
{
ui->mainText->setText( tr( "<h1>All done.</h1><br/>"
"%1 has been set up on your computer.<br/>"
"You may now start using your new system." )
.arg( branding->versionedName() ) );
ui->restartCheckBox->setToolTip( tr( "<html><head/><body>"
"<p>When this box is checked, your system will "
"restart immediately when you click on "
"<span style=\"font-style:italic;\">Done</span> "
"or close the setup program.</p></body></html>" ) );
}
else
{
ui->mainText->setText( tr( "<h1>All done.</h1><br/>"
"%1 has been installed on your computer.<br/>"
"You may now restart into your new system, or continue "
"using the %2 Live environment." )
.arg( branding->versionedName(), branding->productName() ) );
ui->restartCheckBox->setToolTip( tr( "<html><head/><body>"
"<p>When this box is checked, your system will "
"restart immediately when you click on "
"<span style=\"font-style:italic;\">Done</span> "
"or close the installer.</p></body></html>" ) );
}
}
else
{
const QString message = m_failure.value();
if ( Calamares::Settings::instance()->isSetupMode() )
{
ui->mainText->setText( tr( "<h1>Setup Failed</h1><br/>"
"%1 has not been set up on your computer.<br/>"
"The error message was: %2." )
.arg( branding->versionedName() )
.arg( message ) );
}
else
{
ui->mainText->setText( tr( "<h1>Installation Failed</h1><br/>"
"%1 has not been installed on your computer.<br/>"
"The error message was: %2." )
.arg( branding->versionedName() )
.arg( message ) );
}
}
}

View File

@ -11,10 +11,12 @@
#ifndef FINISHEDPAGE_H
#define FINISHEDPAGE_H
#include <QWidget>
#include "FinishedViewStep.h"
#include <optional>
class Config;
namespace Ui
{
class FinishedPage;
@ -24,24 +26,19 @@ class FinishedPage : public QWidget
{
Q_OBJECT
public:
explicit FinishedPage( QWidget* parent = nullptr );
explicit FinishedPage( Config* config, QWidget* parent = nullptr );
void setRestart( FinishedViewStep::RestartMode mode );
void setRestartNowCommand( const QString& command );
void setUpRestart();
public slots:
void onInstallationFailed( const QString& message, const QString& details );
void retranslate();
protected:
void focusInEvent( QFocusEvent* e ) override; //choose the child widget to focus
private:
Ui::FinishedPage* ui;
FinishedViewStep::RestartMode m_mode;
QString m_restartNowCommand;
std::optional< QString > m_failure;
};
#endif // FINISHEDPAGE_H

View File

@ -10,42 +10,21 @@
*/
#include "FinishedViewStep.h"
#include "Config.h"
#include "FinishedPage.h"
#include "Branding.h"
#include "JobQueue.h"
#include "Settings.h"
#include "utils/Logger.h"
#include "utils/NamedEnum.h"
#include "utils/Variant.h"
#include <QVariantMap>
#include <QtDBus/QDBusConnection>
#include <QtDBus/QDBusInterface>
#include <QtDBus/QDBusReply>
static const NamedEnumTable< FinishedViewStep::RestartMode >&
modeNames()
{
using Mode = FinishedViewStep::RestartMode;
static const NamedEnumTable< Mode > names { { QStringLiteral( "never" ), Mode::Never },
{ QStringLiteral( "user-unchecked" ), Mode::UserUnchecked },
{ QStringLiteral( "user-checked" ), Mode::UserChecked },
{ QStringLiteral( "always" ), Mode::Always } };
return names;
}
#include <QApplication>
FinishedViewStep::FinishedViewStep( QObject* parent )
: Calamares::ViewStep( parent )
, m_widget( new FinishedPage() )
, installFailed( false )
, m_notifyOnFinished( false )
, m_config( new Config( this ) )
, m_widget( new FinishedPage( m_config ) )
, m_installFailed( false )
{
auto jq = Calamares::JobQueue::instance();
connect( jq, &Calamares::JobQueue::failed, m_widget, &FinishedPage::onInstallationFailed );
connect( jq, &Calamares::JobQueue::failed, this, &FinishedViewStep::onInstallationFailed );
emit nextStatusChanged( true );
@ -102,54 +81,12 @@ FinishedViewStep::isAtEnd() const
return true;
}
void
FinishedViewStep::sendNotification()
{
// If the installation failed, don't send notification popup;
// there's a (modal) dialog popped up with the failure notice.
if ( installFailed )
{
return;
}
QDBusInterface notify(
"org.freedesktop.Notifications", "/org/freedesktop/Notifications", "org.freedesktop.Notifications" );
if ( notify.isValid() )
{
const auto* branding = Calamares::Branding::instance();
QDBusReply< uint > r = notify.call(
"Notify",
QString( "Calamares" ),
QVariant( 0U ),
QString( "calamares" ),
Calamares::Settings::instance()->isSetupMode() ? tr( "Setup Complete" ) : tr( "Installation Complete" ),
Calamares::Settings::instance()->isSetupMode()
? tr( "The setup of %1 is complete." ).arg( branding->versionedName() )
: tr( "The installation of %1 is complete." ).arg( branding->versionedName() ),
QStringList(),
QVariantMap(),
QVariant( 0 ) );
if ( !r.isValid() )
{
cWarning() << "Could not call org.freedesktop.Notifications.Notify at end of installation." << r.error();
}
}
else
{
cWarning() << "Could not get dbus interface for notifications at end of installation." << notify.lastError();
}
}
void
FinishedViewStep::onActivate()
{
m_widget->setUpRestart();
if ( m_notifyOnFinished )
{
sendNotification();
}
m_config->doNotify( m_installFailed );
connect( qApp, &QApplication::aboutToQuit, m_config, &Config::doRestart );
}
@ -162,67 +99,15 @@ FinishedViewStep::jobs() const
void
FinishedViewStep::onInstallationFailed( const QString& message, const QString& details )
{
Q_UNUSED( message )
Q_UNUSED( details )
installFailed = true;
m_installFailed = true;
m_config->setRestartNowMode( Config::RestartMode::Never );
m_widget->onInstallationFailed( message, details );
}
void
FinishedViewStep::setConfigurationMap( const QVariantMap& configurationMap )
{
RestartMode mode = RestartMode::Never;
QString restartMode = CalamaresUtils::getString( configurationMap, "restartNowMode" );
if ( restartMode.isEmpty() )
{
if ( configurationMap.contains( "restartNowEnabled" ) )
{
cWarning() << "Configuring the finished module with deprecated restartNowEnabled settings";
}
bool restartNowEnabled = CalamaresUtils::getBool( configurationMap, "restartNowEnabled", false );
bool restartNowChecked = CalamaresUtils::getBool( configurationMap, "restartNowChecked", false );
if ( !restartNowEnabled )
{
mode = RestartMode::Never;
}
else
{
mode = restartNowChecked ? RestartMode::UserChecked : RestartMode::UserUnchecked;
}
}
else
{
bool ok = false;
mode = modeNames().find( restartMode, ok );
if ( !ok )
{
cWarning() << "Configuring the finished module with bad restartNowMode" << restartMode;
}
}
m_widget->setRestart( mode );
if ( mode != RestartMode::Never )
{
QString restartNowCommand = CalamaresUtils::getString( configurationMap, "restartNowCommand" );
if ( restartNowCommand.isEmpty() )
{
restartNowCommand = QStringLiteral( "shutdown -r now" );
}
m_widget->setRestartNowCommand( restartNowCommand );
}
m_notifyOnFinished = CalamaresUtils::getBool( configurationMap, "notifyOnFinished", false );
m_config->setConfigurationMap( configurationMap );
}
QString
FinishedViewStep::modeName( FinishedViewStep::RestartMode m )
{
bool ok = false;
return modeNames().find( m, ok ); // May be QString()
}
CALAMARES_PLUGIN_FACTORY_DEFINITION( FinishedViewStepFactory, registerPlugin< FinishedViewStep >(); )

View File

@ -11,13 +11,11 @@
#ifndef FINISHEDVIEWSTEP_H
#define FINISHEDVIEWSTEP_H
#include <QObject>
#include "DllMacro.h"
#include "utils/PluginFactory.h"
#include "viewpages/ViewStep.h"
#include "DllMacro.h"
class Config;
class FinishedPage;
class PLUGINDLLEXPORT FinishedViewStep : public Calamares::ViewStep
@ -25,16 +23,6 @@ class PLUGINDLLEXPORT FinishedViewStep : public Calamares::ViewStep
Q_OBJECT
public:
enum class RestartMode
{
Never = 0, ///< @brief Don't show button, just exit
UserUnchecked, ///< @brief Show button, starts unchecked
UserChecked, ///< @brief Show button, starts checked
Always ///< @brief Show button, can't change, checked
};
/// @brief Returns the config-name of the given restart-mode @p m
static QString modeName( RestartMode m );
explicit FinishedViewStep( QObject* parent = nullptr );
~FinishedViewStep() override;
@ -58,16 +46,9 @@ public slots:
void onInstallationFailed( const QString& message, const QString& details );
private:
Config* m_config;
FinishedPage* m_widget;
/**
* @brief At the end of installation (when this step is activated),
* send a desktop notification via DBus that the install is done.
*/
void sendNotification();
bool installFailed;
bool m_notifyOnFinished;
bool m_installFailed; // Track if onInstallationFailed() was called
};
CALAMARES_PLUGIN_FACTORY_DECLARATION( FinishedViewStepFactory )

View File

@ -6,3 +6,4 @@
#layout additional-layout additional-variant vconsole-keymap
ru us - ruwin_alt_sh-UTF-8
ua us - ua-utf
gr us - gr

View File

@ -1,18 +1,89 @@
# SPDX-FileCopyrightText: 2020 Adriaan de Groot <groot@kde.org>
# SPDX-FileContributor: benne-dee ( worked on groups schema )
# SPDX-License-Identifier: GPL-3.0-or-later
---
$schema: https://json-schema.org/schema#
$schema: https://json-schema.org/draft-07/schema#
$id: https://calamares.io/schemas/netinstall
additionalProperties: false
type: object
properties:
groupsUrl: { type: string }
required: { type: boolean, default: false }
label: # Translatable labels
definitions:
package:
$id: '#definitions/package'
oneOf:
-
type: string
description: bare package - actual package name as passed to the package manager
(e.g. `qt5-creator-dev`).
-
type: object
description: rich package - one with a package-name (for the package-manager) and
a description (for the human).
properties:
name: { type: string }
description: { type: string }
group:
$id: '#definitions/group'
type: object
additionalProperties: true
description: Longer discussion in `netinstall.conf` file under 'Groups Format'
properties:
sidebar: { type: string }
title: { type: string }
groups: { type: array } # TODO: the schema for the whole groups file
required: [ groupsUrl ]
name: { type: string }
description: { type: string }
packages:
type: array
items: { $ref: '#definitions/package' }
hidden: { type: boolean, default: false }
selected: { type: boolean }
critical: { type: boolean, default: false }
immutable: { type: boolean }
expanded: { type: boolean }
subgroups:
type: array
items: { $ref: '#definitions/group' }
pre-install:
type: string
description: an optional command to run within the new system before the group's
packages are installed. It will run before **each** package in the group
is installed.
post-install:
type: string
description: an optional command to run within the new system after the group's
packages are installed. It will run after **each** package in the group
is installed.
required: [name, description] # Always required, at any level in the subgroups hirearchy
if:
properties:
subgroups:
maxItems: 0
then:
required: [name, description, packages] # bottom-most (sub)group requires some package (otherwise, why bother?)
# This should validate `netinstall.yaml` also.
groups:
$id: '#definitions/groups'
type: array
items: { $ref: '#definitions/group' }
oneOf:
- # netinstall.conf
type: object
description: netinstall.conf schema
additionalProperties: false
properties:
groupsUrl: { type: string }
required: { type: boolean, default: false }
label: # Translatable labels
type: object
additionalProperties: true
properties:
sidebar: { type: string }
title: { type: string }
groups: { $ref: '#definitions/groups' }
required: [ groupsUrl ]
- # Groups file with top level *groups* key
type: object
description: Groups file with top level *groups* key
additionalProperties: false
properties:
groups: { $ref: '#definitions/groups' }
required: [ groups ]
- # Groups file bare
{ $ref: '#definitions/groups' }

View File

@ -79,6 +79,7 @@ if ( KPMcore_FOUND AND Qt5DBus_FOUND AND KF5CoreAddons_FOUND AND KF5Config_FOUND
gui/ScanningDialog.cpp
gui/ReplaceWidget.cpp
gui/VolumeGroupBaseDialog.cpp
jobs/AutoMountManagementJob.cpp
jobs/ClearMountsJob.cpp
jobs/ClearTempMountsJob.cpp
jobs/CreatePartitionJob.cpp

View File

@ -21,6 +21,7 @@
#include "core/PartUtils.h"
#include "core/PartitionInfo.h"
#include "core/PartitionModel.h"
#include "jobs/AutoMountManagementJob.h"
#include "jobs/ClearMountsJob.h"
#include "jobs/ClearTempMountsJob.h"
#include "jobs/CreatePartitionJob.h"
@ -576,6 +577,11 @@ PartitionCoreModule::jobs( const Config* config ) const
#endif
#endif
// The automountControl job goes in the list twice: the first
// time it runs, it disables automount and remembers the old setting
// for automount; the second time it restores that old setting.
Calamares::job_ptr automountControl( new AutoMountManagementJob( true /* disable automount */ ) );
lst << automountControl;
lst << Calamares::job_ptr( new ClearTempMountsJob() );
for ( auto info : m_deviceInfos )
@ -592,6 +598,7 @@ PartitionCoreModule::jobs( const Config* config ) const
devices << info->device.data();
}
lst << Calamares::job_ptr( new FillGlobalStorageJob( config, devices, m_bootLoaderInstallPath ) );
lst << automountControl;
return lst;
}

View File

@ -0,0 +1,40 @@
/* === This file is part of Calamares - <https://calamares.io> ===
*
* SPDX-FileCopyrightText: 2021 Adriaan de Groot <groot@kde.org>
* SPDX-License-Identifier: GPL-3.0-or-later
*
* Calamares is Free Software: see the License-Identifier above.
*
*/
#include "AutoMountManagementJob.h"
#include "utils/Logger.h"
AutoMountManagementJob::AutoMountManagementJob( bool disable )
: m_disable( disable )
{
}
QString
AutoMountManagementJob::prettyName() const
{
return tr( "Manage auto-mount settings" );
}
Calamares::JobResult
AutoMountManagementJob::exec()
{
Logger::CDebug( Logger::LOGVERBOSE ) << "this" << Logger::Pointer( this ) << "value" << Logger::Pointer( m_stored )
<< ( m_stored ? "restore" : m_disable ? "disable" : "enable" );
if ( m_stored )
{
CalamaresUtils::Partition::automountRestore( m_stored );
m_stored.reset();
}
else
{
m_stored = CalamaresUtils::Partition::automountDisable( m_disable );
}
return Calamares::JobResult::ok();
}

View File

@ -0,0 +1,42 @@
/* === This file is part of Calamares - <https://calamares.io> ===
*
* SPDX-FileCopyrightText: 2021 Adriaan de Groot <groot@kde.org>
* SPDX-License-Identifier: GPL-3.0-or-later
*
* Calamares is Free Software: see the License-Identifier above.
*
*/
#ifndef PARTITION_AUTOMOUNTMANAGEMENTJOB_H
#define PARTITION_AUTOMOUNTMANAGEMENTJOB_H
#include "Job.h"
#include "partition/AutoMount.h"
/**
* This job sets automounting to a specific value, and when run a
* second time, **re**sets to the original value. See the documentation
* for CalamaresUtils::Partition::automountDisable() for details.
* Use @c true to **disable** automounting.
*
* Effectively: queue the **same** job twice; the first time it runs
* it will set the automount behavior, and the second time it
* restores the original.
*
*/
class AutoMountManagementJob : public Calamares::Job
{
Q_OBJECT
public:
AutoMountManagementJob( bool disable = true );
QString prettyName() const override;
Calamares::JobResult exec() override;
private:
bool m_disable;
decltype( CalamaresUtils::Partition::automountDisable( true ) ) m_stored;
};
#endif /* PARTITION_AUTOMOUNTMANAGEMENTJOB_H */

View File

@ -0,0 +1,87 @@
/* === 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 "jobs/AutoMountManagementJob.h"
#include "utils/Logger.h"
#include "JobQueue.h"
#include <QObject>
#include <QtTest/QtTest>
class AutoMountJobTests : public QObject
{
Q_OBJECT
public:
AutoMountJobTests();
private Q_SLOTS:
void testRunThrice();
void testRunQueue();
};
AutoMountJobTests::AutoMountJobTests() {}
/* This doesn't really test anything, since automount management
* is supposed to be opaque: the job always returns true. What
* is interesting is the debug output, where the job informs
* about the pointer it holds.
*
* That should output 0, then non-zero, then 0 again.
*
*/
void
AutoMountJobTests::testRunThrice()
{
Logger::setupLogLevel( Logger::LOGVERBOSE );
auto original = CalamaresUtils::Partition::automountDisable( true );
cDebug() << "Got automount info" << Logger::Pointer( original );
AutoMountManagementJob j( false );
QVERIFY( j.exec() );
QVERIFY( j.exec() );
QVERIFY( j.exec() );
CalamaresUtils::Partition::automountRestore( original );
}
void AutoMountJobTests::testRunQueue()
{
Calamares::JobQueue q;
Calamares::job_ptr jp( new AutoMountManagementJob( false ) );
QSignalSpy progress( &q, &Calamares::JobQueue::progress );
QSignalSpy finish( &q, &Calamares::JobQueue::finished );
QSignalSpy fail( &q, &Calamares::JobQueue::failed );
Logger::setupLogLevel( Logger::LOGVERBOSE );
cDebug() << "Got automount job" << jp;
QVERIFY( !q.isRunning() );
q.enqueue( 2, { jp, jp } );
QVERIFY( !q.isRunning() );
QEventLoop loop;
QTimer::singleShot( std::chrono::milliseconds( 100 ), [&q](){ q.start(); } );
QTimer::singleShot( std::chrono::milliseconds( 5000 ), [&loop](){ loop.quit(); } );
connect( &q, &Calamares::JobQueue::finished, &loop, &QEventLoop::quit );
loop.exec();
QCOMPARE( fail.count(), 0 );
QCOMPARE( finish.count(), 1 );
// 5 progress: 0% and 100% for each *job* and then 100% overall
QCOMPARE( progress.count(), 5 );
}
QTEST_GUILESS_MAIN( AutoMountJobTests )
#include "utils/moc-warnings.h"
#include "AutoMountTests.moc"

View File

@ -58,3 +58,11 @@ calamares_add_test(
DEFINITIONS ${_partition_defs}
)
calamares_add_test(
automounttests
SOURCES
${PartitionModule_SOURCE_DIR}/jobs/AutoMountManagementJob.cpp
AutoMountTests.cpp
LIBRARIES
calamares
)

View File

@ -36,6 +36,8 @@ static const char TRANSLITERATOR_ID[] = "Russian-Latin/BGN;"
"Latin-ASCII";
#endif
#include <memory>
static const QRegExp USERNAME_RX( "^[a-z_][a-z0-9_-]*[$]?$" );
static constexpr const int USERNAME_MAX_LENGTH = 31;

View File

@ -64,10 +64,9 @@ GroupTests::testReadGroup()
#else
QVERIFY( groups.contains( QStringLiteral( "root" ) ) );
#endif
// openSUSE doesn't have "sys"
// QVERIFY( groups.contains( QStringLiteral( "sys" ) ) );
QVERIFY( groups.contains( QStringLiteral( "nogroup" ) ) );
QVERIFY( groups.contains( QStringLiteral( "tty" ) ) );
// openSUSE doesn't have "sys", KaOS doesn't have "nogroup"
QVERIFY( groups.contains( QStringLiteral( "sys" ) ) || groups.contains( QStringLiteral( "nogroup" ) ) );
for ( const QString& s : groups )
{

View File

@ -10,14 +10,19 @@
# can check requirements for installation.
---
# Display settings for various buttons on the welcome page.
# The URLs themselves come from branding.desc is the setting
# here is "true". If the setting is false, the button is hidden.
# The URLs themselves come from `branding.desc`. Each button
# is show if the corresponding *show<buttonname>* setting
# here is "true". If the setting is "false", the button is hidden.
# Empty or not-set is interpreted as "false".
#
# TODO:3.3 Remove the URL fallback here; URLs only in `branding.desc`
#
# The setting can also be a full URL which will then be used
# instead of the one from the branding file, or empty or not-set
# which will hide the button.
# instead of the one from the branding file.
showSupportUrl: true
showKnownIssuesUrl: true
showReleaseNotesUrl: false
# TODO:3.3 Move to branding, keep only a bool here
showDonateUrl: https://kde.org/community/donations/
# Requirements checking. These are general, generic, things
@ -26,7 +31,7 @@ showDonateUrl: https://kde.org/community/donations/
requirements:
# Amount of available disk, in GiB. Floating-point is allowed here.
# Note that this does not account for *usable* disk, so it is possible
# to pass this requirement, yet have no space to install to.
# to satisfy this requirement, yet have no space to install to.
requiredStorage: 5.5
# Amount of available RAM, in GiB. Floating-point is allowed here.
@ -34,7 +39,10 @@ requirements:
# To check for internet connectivity, Calamares does a HTTP GET
# on this URL; on success (e.g. HTTP code 200) internet is OK.
internetCheckUrl: http://google.com
# Use a privacy-respecting URL here, preferably in your distro's domain.
#
# The URL is only used if "internet" is in the *check* list below.
internetCheckUrl: http://example.com
# List conditions to check. Each listed condition will be
# probed in some way, and yields true or false according to