Commit Graph

7165 Commits

Author SHA1 Message Date
Adriaan de Groot
8d71e67a75 Add Q_OBJECT macro where it's missing
- Transifex tools complain about missing Q_OBJECT (which makes
  some sense -- you end up with a different context for calls
  to tr(), of the base class).
2021-09-08 13:23:20 +02:00
Adriaan de Groot
3380da638e
Merge pull request #1774 from demmm/calamares
[keyboardq] add interactive keyboard preview
2021-09-08 11:58:36 +02:00
Adriaan de Groot
87eb5300d2 Merge branch 'load-qtbase' into calamares
FIXES #1688
2021-09-08 11:29:15 +02:00
Adriaan de Groot
e47dc4aa78 [partition] Fix build with translated buttons 2021-09-08 11:28:38 +02:00
Adriaan de Groot
4a6753c867 [packagechooser] Restore (renamed) include that is needed after all 2021-09-08 11:26:21 +02:00
Adriaan de Groot
226419f794 [partition] Translate button texts in warning boxes 2021-09-08 11:15:12 +02:00
Adriaan de Groot
6e0a8d8ca1 [libcalamaresui] Translate button texts for paste-message 2021-09-08 11:15:12 +02:00
Adriaan de Groot
7516740bbf [interactiveterminal] Fix up standard buttons 2021-09-08 11:15:12 +02:00
Adriaan de Groot
dcfbb766dc [libcalamaresui] Use fixed standard-buttons labels
Move some of the texts to the new TranslationFix, from ViewManager,
and use them. Keep them in ViewManager, too, so that the translations
with context ViewManager are not removed just now.
2021-09-08 11:14:46 +02:00
Adriaan de Groot
8c84ae9ff6 [license] Remove unused header 2021-09-08 11:14:46 +02:00
Adriaan de Groot
683bad19fc i18n: introduce a "TranslationFix"
This is intended to apply translations to some common Qt UI components.

Example: a QMessageBox with standard buttons OK and Cancel; the text
for that is determined at startup using the system locale, and later
changes to the current locale or the current translation catalog,
do not affect OK and Cancel. It might be possible to load a catalog
with the right translation strings, except that there is no way to
know what the context or catalog **is** for the strings that are
used to label standard buttons: they can come from Qt base, or
the platform, or the theme. Merely loading the Qt Base translations
for the correct language does not help, because those translations
do not contain an "OK" string with the context used for standard
buttons.

Do the translation by hand; then we have all of the Calamares
languages covered, too, which is more than the Qt translations do.
2021-09-08 11:14:46 +02:00
Adriaan de Groot
438302fcf5 i18n: Shuffle the build so that all the bits are in lang/
Move the CMake code responsible for building the translations from
the src/calamares directory (yeah, yeah, the translations need to
link into the executable) into lang/ (which is where the source
and other infrastructure lives).
2021-09-08 11:14:46 +02:00
Adriaan de Groot
06d12fc924 [packagechooser] Remove unneeded include 2021-09-08 11:04:35 +02:00
Adriaan de Groot
24162cb162 i18n: repair language names for Chinese
Prompted by Linlinger, I've reconsidered the names of languages
in the drop-down in the welcome page. We already have the
infrastructure for assigning specific names / locales to
"Calamares locale names" (which match Transifex names, not
necessarily Qt names). Use that to put exactly two Chinese-
language translations in the drop-down:
- Simplified Chinese (code zh_CN)
- Traditional Chinese (code zh_TW)
Drop zh (which is a peculiar locale name anyway) and zh_HK
(which is Traditional Chinese, but using the geographic
boundary is a bit weird; we're going to ignore the
minor orthographic differences with Traditional Chinese
written elsewhere for now).

Note that this makes the drop-down show "Chinese"
in the English column, twice; the difference is visible
only in the native-language representation.

SEE #1741
2021-09-07 15:47:30 +02:00
Adriaan de Groot
4e60f8af13 [libcalamares] Use strong types for locale Ids
Change the API to force strong type for more methods.
This cascades to a couple of consumers.
2021-09-07 12:51:57 +02:00
Adriaan de Groot
3ff5896dc6 [libcalamares] Remove unused method 2021-09-07 12:35:47 +02:00
Adriaan de Groot
5f4e65bc77 [libcalamares] Code-format Retranslator, hide internal symbols 2021-09-07 12:35:37 +02:00
Adriaan de Groot
ad1a4b6479 [libcalamares] APIdox on Translation 2021-09-07 11:42:32 +02:00
Adriaan de Groot
73bfc6ca32 [libcalamares] Use structured bindings to unpack a std::pair 2021-09-07 11:38:54 +02:00
demmm
79cc616de2 [keyboardq] add interactive keyboard preview
rewrite of keyboardq.qml, reduce stackview to 2, use a combobox for
keyboard models list
colors set to configurable
.xml files used for keyboard layouts, about a dozen added now
builds, runs, actions record as intended, GS filled correctly
2021-09-06 19:25:16 +02:00
Adriaan de Groot
5e7746668e Merge branch 'calamares' into refactor-translation 2021-09-06 15:38:42 +02:00
Adriaan de Groot
0aa2603a23 [libcalamares] Fix network-connectivity check on old Qt
With old Qt, Calamares could only run one check on a thread,
because the NAM would be switched to NotAccessible --
subsequent checks would fail because the NAM is already
hard-set to NotAccessible, so it could never be turned back
on by Calamares code.

Reset the accessible flag for the NAM while checking if
the internet is there.
2021-09-06 14:44:52 +02:00
Adriaan de Groot
0851a8a6a4 Merge branch 'issue-1769' into calamares
FIXES #1769
2021-09-06 13:23:59 +02:00
Adriaan de Groot
44e66c1318 [keyboard] Fix mapping for India + English
- India (when in English) should use the English variant, not Hindi
- While here, fix up minor items in code:
  - Typo in comment
  - Asturian doesn't need a special case (which didn't match, anyway)
  - Don't debug-log a country-name that might be entirely wrong
    (the layout is English, variant "in" but "in" interpreted as
    a country is Indonesia, and the actually-desired name is eng_in
    which isn't a QLocale name at all -- just like the Hausa and Igbo
    special cases)
2021-09-06 13:18:12 +02:00
Adriaan de Groot
b237c73a04 [shellprocess] Fix test
The test was loading the config file (for testing) either from the
build directory or possibly the source directory; if the config
in the build-dir was edited (for other testing purposes) then
the test would fail. Load only the source-dir version of the file.
2021-09-06 12:49:49 +02:00
Adriaan de Groot
6017420dde [welcome] Fix up and expand tests
- improve logging
- fix failing tests -- the observed and expected behavior is
  to fill in a fallback check-URL, not change to an empty list,
- **except** if there's no requirements key in the config
  at all; this is a bit weird, but let's make the tests
  document existing behavior so we can notice if it changes.
2021-09-06 12:35:24 +02:00
Adriaan de Groot
4948f634ed [keyboard] Code tidy
- complain just once (globally) if ckbcomp is not found, rather than
  at every update to the layout.
- tighten up QStringList constructor.
2021-09-06 12:06:11 +02:00
Adriaan de Groot
42bc197f67 Merge branch 'fix-pckq' into calamares 2021-09-06 11:27:09 +02:00
Adriaan de Groot
5a6e033e82 [bootloader] Flags for root-on-BTRFS
This is directly derived from Anke Boersma's KaOS code in module
*bootldr*, which adds the same kernel parameter via a slightly
different route.
2021-09-05 13:34:38 +02:00
Adriaan de Groot
e311d7a893 [packagechooser] Remove 'id' configuration setting
- Setting 'id' (which changes the Global Storage key that
  gets used) is a kludge when the existing module-instance
  name can be used instead -- and **was** already used, as
  a fallback when 'id' is not set. There's no point in having
  two places to set a particular name.
- Rip out the docs for 'id' as well.
- Add documentation on the difference between single-selection
  (the QML implementation) and model-selection (what the Widgets
  version does).
2021-09-03 23:59:11 +02:00
Adriaan de Groot
6def41fab4 [packagechooserq] Remove debug-output in QML 2021-09-03 22:57:17 +02:00
Adriaan de Groot
33e7e8da58 [packagechooser] Massage API
- use updateGlobalStorage() for both single-selection and
  model-based approaches, although the model-based one
  needs extra parameters.
- complain about inconsistent settings and API calls (e.g.
  setting a model and single-selection at the same time)
2021-09-03 22:41:13 +02:00
Adriaan de Groot
8a49fde016 [packagechooserq] Apply renaming also to distro-visible code
- The distro-visible key is renamed *pkgc* to *packageChoice*
- Read *packageChoice* only if there are no items to use
2021-09-03 21:21:44 +02:00
Adriaan de Groot
8b703ba6a3 [packagechooserq] More docs for the config file 2021-09-03 21:21:44 +02:00
Adriaan de Groot
c367731c42 [packagechooser] Rename internals
- pkgc -> packageChoice and similar for methods, variables
- document that this is the convenience value for one-selection
  QML modules, not a full model
- use std::optional to keep track of which one is being used.
2021-09-03 21:21:44 +02:00
Adriaan de Groot
47c504df5d [welcome] add SPDX-tags to test-data 2021-09-03 21:21:44 +02:00
Adriaan de Groot
1a1009a2a9 [summaryq] add SPDX-tags 2021-09-03 21:21:44 +02:00
dr460nf1r3
35156574b8
Dont set fsck check for BTRFS in fstab 2021-09-03 20:49:08 +02:00
Adriaan de Groot
2f88ba0d3f [partition] Coding style 2021-08-31 14:03:04 +02:00
Adriaan de Groot
09491e4cbb [partition] expect failures when kpm can't read the disk 2021-08-31 13:58:23 +02:00
Adriaan de Groot
1554c3a07c [partition] Create KPM backend at start of test 2021-08-31 13:54:23 +02:00
Adriaan de Groot
3d0709c779 [partition] Avoid crash when there is no KPM backend 2021-08-31 13:46:25 +02:00
Adriaan de Groot
ede19c8a61 [partition] Fix build of devices test 2021-08-31 13:45:15 +02:00
Adriaan de Groot
854eb845d2 [partition] Fix build of layoutstest
This test needs UI because the devicemodel uses GUI parts.
2021-08-05 15:49:29 +02:00
Adriaan de Groot
22ba21f937 [partition] Stub of a test of scandevice 2021-08-31 13:16:45 +02:00
Adriaan de Groot
e294221a2d [partition] Rename test executables
- all partition tests are now named partition<thing>test
2021-08-31 13:08:54 +02:00
Adriaan de Groot
3519697d0e [libcalamares] Slightly more memory-safe
Use unique_ptr to ensure Private is always deleted.

SEE #1758
2021-08-31 12:54:51 +02:00
Adriaan de Groot
0899eefde7 [packagechooserq] Fix build on Debian, openSUSE with AppStream 2021-08-31 11:33:05 +02:00
Adriaan de Groot
d7767afe1b Merge branch 'extra_qml' into calamares 2021-08-30 23:17:36 +02:00
Adriaan de Groot
6f16d3db83 Merge remote-tracking branch 'origin/issue-1761' into calamares
FIXES #1761
2021-08-30 22:33:03 +02:00
Adriaan de Groot
b9a1d090ec
Merge pull request #1762 from demmm/calamares
[localeq] redo i18n.qml
2021-08-30 13:57:17 +02:00
waneon
4bf3afac48 [partition] Fix invalid variable name 2021-08-27 19:18:09 -04:00
Adriaan de Groot
da49becac3 [partition] Tailor warning message about ESP
- tell the user all the things that are wrong with the
  (proposed) ESP; a missing one gets all the suggestions.
2021-08-27 17:28:07 +02:00
Adriaan de Groot
6324fa3eb9 [partition] Disentangle questions of suitability of ESP
- split into size, type, flags so the warning message can
  be tailored to what is wrong.
2021-08-27 17:27:26 +02:00
Adriaan de Groot
7d08770806 [partition] Apply code style 2021-08-27 17:26:50 +02:00
Adriaan de Groot
52a82ea1e6 [partition] Improve warning message in log 2021-08-26 17:39:06 +02:00
Adriaan de Groot
46ca4d93e7 [partition] Improve constness, naming 2021-08-26 17:30:55 +02:00
Adriaan de Groot
ad9306d7bb
Merge pull request #1749 from LordTermor/calamares
[partition] Disable delete button for extended partition
2021-08-26 17:18:09 +02:00
Adriaan de Groot
51c18baedb Merge branch 'issue-1669' into calamares 2021-08-26 17:15:03 +02:00
Adriaan de Groot
f376b42c31 [welcome] Add a handful of tests for different URL configs 2021-08-26 16:58:46 +02:00
Adriaan de Groot
ad76a2cbe8 [welcome] [welcomeq] Move requirements to Config
The Config object can hold all of the configuration information,
including also the requirements-checking parts. Move requirements-
checking configuration there, so it is shared and consistent
across welcome and welcomeq, regardless.

This repairs the test that expects the Config object to handle
**all** of the configuration, too.
2021-08-26 16:39:55 +02:00
Adriaan de Groot
67d2b5568d [welcome] Fix test, check that the internet check URLs are loaded 2021-08-26 14:40:52 +02:00
Adriaan de Groot
0538881447 [libcalamares] Handle multiple invalid URLs at once
- expand tests with example where more than one URL is invalid
- fix the call to the wrong overload of QVector::erase()
2021-08-26 14:32:57 +02:00
Adriaan de Groot
653359d815 [libcalamares] Fix up multiple URLs for checkinternet
- was filtering out the wrong URLs
- was not actually removing the invalid URLs
- extend API to make it possible to count / confirm the settings
- extend tests to demonstrate that API and the issues
2021-08-26 12:57:40 +02:00
demmm
7bfb769288 [localeq] redo i18n.qml
set colors as vars, mostly kirigami colors, to make it work for boths dark & light themes
highlights now full width and on hover
currentindex still at -1, not implemented in cofig.cpp/h, possible to use js, or is
https://github.com/calamares/calamares/blob/calamares/src/modules/locale/LCLocaleDialog.cpp#L43 accessible to QML?
2021-08-26 12:05:38 +02:00
Adriaan de Groot
d5e6e1075d [welcome] Expand stub tests to check that crashes are gone 2021-08-24 13:37:02 +02:00
Adriaan de Groot
e0ee2d9514 [welcome] Handle nullptrs nicely in Config
- Branding, Settings, and ModuleManager may all be nullptr,
  in which case the corresponding code shouldn't call methods
  of those instances -- this is demonstrated by just creating
  a Config object
2021-08-24 12:50:03 +02:00
Adriaan de Groot
1e05e7996b [libcalamares] Avoid cError + SubEntry
The combination of Error and SubEntry loses the indentation.
2021-08-24 12:32:48 +02:00
Adriaan de Groot
14c26d01af [libcalamares] Warnings for nullptr Settings 2021-08-24 12:30:44 +02:00
Adriaan de Groot
e9a98f35ad [welcome] Avoid crash when no Branding available
- don't install translators twice -- do it in setLocaleIndex only
- avoid crash if the branding instance is nullptr
2021-08-24 11:58:24 +02:00
Adriaan de Groot
38c65e80f3 [libcalamaresui] Warn when asking for nonexistent Branding instance 2021-08-24 11:57:37 +02:00
Adriaan de Groot
f1a47a9f0a [welcome] Add (stub) test for the Config object
This crashes because there's no translations object yet,
but that is an internal issue.
2021-08-24 10:24:11 +02:00
Adriaan de Groot
c79fc2e6d9 [libcalamares] Add urls only if valid, add tests to check that 2021-08-24 10:00:42 +02:00
demmm
805fed559c [networkcfg] use os.getlogin()
cala running as root returns root for live_user otherwise
2021-08-16 20:17:07 +02:00
demmm
8913317a44 [networkcfg] add setting the correct target user in copied file
see https://github.com/calamares/calamares/issues/1753
2021-08-16 14:06:13 +02:00
Artem Grinev
74a3a2da78 [partition] Fix Delete button for extended
Extended partition can't be removed when contains children. This commit
adds missing check.
2021-08-12 02:13:16 +04:00
Adriaan de Groot
b7a3f58df4 [partition] Update waiting widget only if it (still) exists 2021-08-05 14:51:31 +02:00
Adriaan de Groot
a1690ac2d6 [partition] Set up swap-choice texts correctly 2021-08-04 01:47:55 +02:00
Adriaan de Groot
0be4c38a87 [partition] Remove useless parameter
- previously, updateSwapChoicesTr() wanted to be a static free function,
  but it needs QObject::tr() ; drop the unnecessary parameter (since it
  is a member function).
2021-08-04 01:45:22 +02:00
Adriaan de Groot
390acd41b2 [partition] Factor out manual partitioning translation
- needs to be called when the button is created, too
2021-08-04 01:42:00 +02:00
Adriaan de Groot
c5fa6383d7 [welcome] Remove annoying debug message 2021-08-05 14:25:20 +02:00
Adriaan de Groot
2820316d16 Partition: don't set text if button doesn't exist 2021-08-05 14:23:11 +02:00
Adriaan de Groot
1452b74740 [welcome] Load potentially a list of URLs to check 2021-08-01 23:52:27 +02:00
Adriaan de Groot
2f3062f4c2 [libcalamares] Fix typo in comment 2021-08-01 23:49:33 +02:00
Adriaan de Groot
81fe8b1488 [libcalamares] Expand API for setting URLs to check 2021-08-01 22:37:13 +02:00
Adriaan de Groot
b8583a1e59 [libcalamares] Expand the number of URLs to check for connectivity
- introduce a list of URLs instead of just one
- ping each of them, in turn, until one responds
2021-08-01 22:07:51 +02:00
Adriaan de Groot
559c53b09c [libcalamares]: stronger type for translation name
QString -> Id for translations in the external API, to avoid
accidentally converting a QLocale name (e.g. ca_ES) into a
Calamares translation name. This preserves special-cases
like ca@valencia and sr@latin.
2021-07-28 14:22:28 +02:00
Adriaan de Groot
bc9d8fb13a [libcalamares] Rename files Label -> Translation 2021-07-28 14:22:28 +02:00
Adriaan de Groot
bf9f1c95bc [libcalamares] Rename classes describing Translations
- the name 'Label' was a relic of the class being UI-centered
2021-07-28 14:22:28 +02:00
Adriaan de Groot
d6825c4986 [libcalamares] Fix linking with renamed targets 2021-07-28 13:20:35 +02:00
Adriaan de Groot
3596b48c7a [libcalamares] Factor out common string in Python logging
- enforce consistent [PYTHON JOB]
- use CDebug() constructor, because the convenience macro's
  introduce the function name -- that's the C++ function, so
  it isn't useful for logging.
2021-07-28 13:13:39 +02:00
Adriaan de Groot
fc2286117d [packages] Move package-list-logic into PM base class 2021-07-28 13:13:39 +02:00
Adriaan de Groot
2b485a5e59 [keyboard] Only guess layouts until the user picks one
- when activating the page, the "guess" functions do their
  work and afterwards the config is left in a "guessable"
  state, but if the user makes a specific choice, then
  the config leaves the "guessable" state and the user's
  explicit choice is preserved.

FIXES #1744
2021-07-31 00:24:10 +02:00
Adriaan de Groot
a65723d4da [libcalamares] Extend cPointerSetter with initial-value
This is a convenience for "set <some variable> to <some value>
at end of scope".
2021-07-31 00:20:27 +02:00
Adriaan de Groot
12b23db286 [keyboard] Re-phrase API
- expose only intended API, guessLayout() becomes internal and static
- rename onActivate() since it was *called* for activation, but does
  something totally different.
2021-07-30 22:17:26 +02:00
Adriaan de Groot
f38b518e86 [keyboard] Factor out lambdas to regular slots
- Long and complicated, nested, lambdas are not convenient for reasoning.
- The debug messages from the innermost lambda have a totally useless
  function name, which makes debugging harder.
2021-07-30 13:22:40 +02:00
Adriaan de Groot
e8cb5c621a [partition] Fix build 2021-07-26 20:54:43 +02:00
Adriaan de Groot
616f3d4fd7 [partition] Simplify retranslation of swap choices and manual partitioning 2021-07-26 16:18:31 +02:00
Adriaan de Groot
e0b8942242 [partition] Introduce retranslate slot for ChoicePage, code style 2021-07-26 16:12:41 +02:00
Adriaan de Groot
954e8ee3f8 [libcalamares] warnings-- with a deduction guide 2021-07-26 15:18:21 +02:00
Adriaan de Groot
4114a2bbe8 CMake: chase renamed YAMLCPP 2021-07-26 15:08:29 +02:00
Adriaan de Groot
03e621f4a2 Modules: clean up linking
- do not link (explicitly) to Calamares libraries, the CMake
  functions do that automatically.
- while here, tidy and remove commented-out-bits
- while here, remove unneeded includes
2021-07-26 15:04:43 +02:00
Adriaan de Groot
cbb1a5ef36 CMake: within Calamares repo, use the (eventual) imported names of libraries 2021-07-26 14:22:28 +02:00
Adriaan de Groot
a1fb83bdc4 i18n: fix typo and code-style 2021-07-26 11:16:26 +02:00
Adriaan de Groot
53fb16437f i18n: factor out special cases
- allow special Locale or special Name for a translation (or both)
2021-07-25 23:38:09 +02:00
Adriaan de Groot
0e977a7e42 i18n: introduce special case for ca@valencia 2021-07-25 23:18:05 +02:00
Adriaan de Groot
740f1e7fe5 i18n: simplify Label handling of sr@latin 2021-07-25 23:13:44 +02:00
Adriaan de Groot
85a1eb95ee [welcome] Some translation / label fixes
- the message had been arbitrarily changed; change it back
- update (warning) message when there is progress in checking the
  model, so it doesn't stay at "unchecked" until you change language
- minor clean-ups
2021-07-25 00:08:47 +02:00
Adriaan de Groot
243c4e6b02 Merge branch 'fix-retranslate' into calamares
Improve the Retranslator framework so it also affects Config objects.
2021-07-24 23:27:18 +02:00
Adriaan de Groot
59f11e9b67 i18n: make retranslator more consistent
- Improve naming.
- Both lambda and slot versions call the code immediately.
2021-07-24 23:26:02 +02:00
Adriaan de Groot
613d076a60 i18n: re-do the whole Retranslator infrastructure
Just have **one** Retranslator object, and install it as event-filter
(this needs to be done manually on a top-level widget) and use
signals / slots to do the actual work, rather than filtering
in multiple places and doing our own mediocre version of binding-
signal-to-lambda.
2021-07-24 23:18:03 +02:00
Adriaan de Groot
51c5c9ba26 [welcome] Switch to using the message from the Config object
- The Config object owns the requirements model, and has messages /
  strings describing the state of the model. Use that message,
  dropping the duplicate message from the requirements widget.
- Re-jig to pass the Config object around rather than the model
  that it owns.
- This does not work, because translation events do not arrive
  (and the slot isn't called automatically either).
2021-07-24 23:15:05 +02:00
Adriaan de Groot
b81bc17560 [welcome] Log when translation events arrive 2021-07-24 16:59:38 +02:00
Adriaan de Groot
f32671ebab libcalamares: remove declaration that was never implemented 2021-07-23 22:51:08 +02:00
Adriaan de Groot
4b2b74bdbd [libcalamaresui] Do not link publicly to yamlcpp 2021-07-23 17:23:30 +02:00
Adriaan de Groot
949f9e466f [summary] createContentWidget is called exactly once, refactor 2021-07-20 16:24:29 +02:00
Adriaan de Groot
d6fe30dfdb [summary] No need for widget-creation to be a method of the Page 2021-07-20 16:21:59 +02:00
Adriaan de Groot
5de99d53d2 [summary] Move title to Config object
Rather than Config asking its (owning) ViewStep what the title
is -- all existing implementations have a prettyName() for that --
move the title into Config and re-do-the ViewSteps to use it.

Rename init() to something meaningful.
2021-07-20 16:00:53 +02:00
Adriaan de Groot
4e588584d7 [summary] Hook up Config message to page
- the Page displays a simple message describing what the
  summary is all about; Config has the same message,
  use that. Needed some re-jigging to get the signals
  and slots right.
2021-07-20 15:49:03 +02:00
Adriaan de Groot
9eee00c286 [summary] Create Config object
- Create Config object, even if it's not used just yet
- Introduce onLeave() for the Page, better name than
  (re-)creating the content (!?) when leaving
2021-07-20 15:17:35 +02:00
Adriaan de Groot
aba212d700 [summary*] Move Config to the non-QML module, so it can be shared 2021-07-20 14:57:09 +02:00
Adriaan de Groot
f8c3b76367 [summary] Stylistic fixes before moving Config objects around 2021-07-20 14:49:08 +02:00
Adriaan de Groot
6c7e7a6d55 [summaryq] a handful of code-style fixes 2021-07-20 14:45:55 +02:00
demmm
c98b5d7667 [usersq] replace one more (missed) kirigami color 2021-07-16 18:19:10 +02:00
demmm
6bdc655719 [usersq] complete using names for colors
add line breaks
add negative outline color
2021-07-15 19:30:43 +02:00
Adriaan de Groot
1bf73c29c4 [usersq] Use a name instead of a magic number 2021-07-15 17:05:49 +02:00
Adriaan de Groot
56f71501cc [usersq] Back out color-scheme merge 2021-07-15 16:54:02 +02:00
Adriaan de Groot
e361f52415
Merge pull request #1738 from Nitrux/calamares
[usersq]: use system colorscheme instead of hardcoded colors
2021-07-14 16:41:35 +02:00
Adriaan de Groot
3a5334071d [packages] Fix wording problem 2021-07-14 12:54:07 +02:00
Adriaan de Groot
bc77478b2a [calamares] Expand test-mocks for Python
- the rawfs module uses more parts of the subprocess Python module
  and so needs more things mocked for testing.
2021-07-14 09:29:20 +02:00
Adriaan de Groot
235db9f961 [summaryq] No need to be a ParserStatus object
Config classes, which intend to be shared between widgets-
and QML-based view-steps, should not tie closely to internals.
None of the ParserStatus methods are used in a meaningful
way (init() can be called by the view step).
2021-07-13 22:07:06 +02:00
Adriaan de Groot
768760793a [summaryq] Hide internals of building the summary model 2021-07-13 22:04:01 +02:00
Adriaan de Groot
792ba8c0af [summaryq] Nothing uses the derived type of the model
(This assertion may be dialed back if the Config object is used
in the summary ViewStep, which will want to get at the widget
pointers, but that's for later)
2021-07-13 21:29:17 +02:00
Adriaan de Groot
a658e88575 [summaryq] Nothing in the Config is specific to this QML view-step 2021-07-13 21:25:57 +02:00
Adriaan de Groot
a316f1b40d [summaryq] Repair translatable properties
- doesn't make sense to have NOTIFY and CONSTANT
- connect to translation signals
- document the properties
2021-07-13 20:42:19 +02:00
demmm
1570105ddb [usersq] correct plural form as reported in IRC 2021-07-13 12:46:04 +02:00
Adriaan de Groot
3b7c2b2221 [summaryq] Remove memory leak
Don't use a vector of pointers, it is too easy (like when calling clear())
to leak memory.
2021-07-13 11:02:24 +02:00
Adriaan de Groot
d2e11dd5d1 [summaryq] Apply coding style 2021-07-13 10:36:05 +02:00
Adriaan de Groot
c2d0a247a3 [partition] Simplify code for overloads 2021-07-12 16:52:24 +02:00
Adriaan de Groot
b43759c6a5 [partition] Apply coding style 2021-07-12 15:42:54 +02:00
Adriaan de Groot
e8b17b9878 [partition] Factor out the descriptions per-disk 2021-07-12 15:39:45 +02:00
Adriaan de Groot
400a5751f9 [partition] Factor out description of action in status and widget 2021-07-12 15:17:34 +02:00
Adriaan de Groot
535f81ba8a [partition] Factor out gather job-descriptions
Since prettyStatus() and the summaryWidget share a lot of
strings and code, start factoring that out.
2021-07-12 15:02:24 +02:00
Adriaan de Groot
7094c7bf39 [partition] Minor stylistic bits 2021-07-12 14:56:04 +02:00
Adriaan de Groot
6b9a1530f8 [mount] Add test exercising partial-filtering 2021-07-07 13:08:11 +02:00
Adriaan de Groot
eb4ffe737e [mount] Fix logic
- filter() returns the items for which the predicate is True;
  we want to keep the subvolumes that do not have an explicit
  partition already associated.
- need list() to hammer it back into a list for appending swap subvol.
2021-07-07 12:57:08 +02:00
Adriaan de Groot
995646936f [mount] Add test exercising refactored btrfs code 2021-07-07 12:38:41 +02:00
Camilo Higuita
6ea73a8ca2 usersq: use system colorscheme instead of hardcoded colors 2021-07-06 18:56:45 -05:00
demmm
373b94b968 [packagechooser] Config files adjusted for new QML modules
function added to store selections from packagechooserq
line 103 in Config.cpp needs adjusting to restore working regular widget based packagechooser

prettyStatus added, made visible in packagechooserq only, ViewStep not altered in packagechooser for this yet
2021-07-06 19:37:28 +02:00
demmm
6ccdf79f77 [packagechooserq] adding packagechooserq
QML is not using a model as is now, pkgc option is used for setting the default state
2021-07-06 19:30:50 +02:00
demmm
6bb7df918d [summaryq] adding summaryq
initial work done by Nitrux/Camilo Higuita in 2020, reflected in license headers
C++ adjusted to make it build & work
as noted in the inline comments e80618ef1c
there are quite a few errors in the C++, but it builds, runs and shows the correct output
2021-07-06 19:09:20 +02:00
demmm
6388b41e6c [partition] adding prettyStatus
will be used in summaryq, reading from widgets not an option
section probably better suited for Config.cpp/h, since quite a bit of duplicated code from
createSummaryWidget
2021-07-06 18:59:58 +02:00
Adriaan de Groot
e800b2da2d [mount] Factor out swap-subvolume setting 2021-07-06 16:48:46 +02:00
Adriaan de Groot
cc357140e5 [mount] Factor out the subvolume-filtering for partitions 2021-07-06 16:43:56 +02:00
Adriaan de Groot
6b2088c94e [mount] Restore @home subvolume
In 942221c764 the fixed-setup
(with /@ and /@home) was replaced by the configurable btrfs
layout, but the default went away. Restore the two-subvolume
layout if nothing is configured.
2021-07-06 15:34:13 +02:00
Adriaan de Groot
3531896892 [mount] Factor out the default btrfs configuration 2021-07-06 15:31:00 +02:00
Adriaan de Groot
96c2c62470 [partition] Fix build on older KPMCore 2021-07-06 12:59:01 +02:00
Adriaan de Groot
a4fadcd9be [partition] Introduce check for EFI partition type-and-size
Re-use the existing message about partition type and size,
since I don't want to introduce another message with all the
specifics; give a works-always message instead.

The check itself is also straightforward, avoiding all of the
nuances and technically-this-might-work cases: FAT32, 300MiB+.

FIXES #607
2021-07-06 12:54:25 +02:00
Adriaan de Groot
b5c56fd579 [partition] Clarify comments on boot-flags 2021-07-05 13:33:09 +02:00
Adriaan de Groot
1a542d3afe [partition] Write out type rather than aliasing to T 2021-07-05 13:11:00 +02:00
Adriaan de Groot
7ea6768852 [partition] Pick slightly more sensible defaults for FS selection 2021-07-05 12:39:56 +02:00
Adriaan de Groot
56ecf01dea Merge branch 'pr-1667' into calamares
Allow user-selection of FS type

FIXES #1667
2021-07-05 12:31:58 +02:00
Adriaan de Groot
6a7a486b8c [partition] Document interactions between defaultFS and layout 2021-07-05 12:28:17 +02:00
demmm
8b561a29f5 [usersq] add close button to all password message fields 2021-07-03 14:23:01 +02:00
demmm
fce798dadf [users] add an OK message to password message fields
empty text box on all good status in usersq is confusing
2021-07-03 14:21:07 +02:00
demmm
a156d2e63f [usersq] working password validity check
kirigami inlinemessages adjusted for password fields
coding style, break lines in variables
add closing button for root password inline message, needed bc of
re-use root password option does not remove all messages
2021-07-03 00:10:31 +02:00
demmm
ce699d8e3d [usersq] add warnings for forbidden names
root & localhost set as forbidden in loginname & hostname
2021-06-30 22:29:32 +02:00
demmm
00b6694073 [usersq] use validator for login & hostname
pallette for colors
inline warning messages now work, password fields checks included
left to implement are password validation inline messages
2021-06-30 18:29:32 +02:00
Adriaan de Groot
453d533d2c [partition] Use default FS for layout items with type Unknown 2021-06-29 23:47:33 +02:00
demmm
70df0b0bc8 [localeq] prevent MouseArea from stealing all map interaction
bug introduced with Qt 5.15 KDE patches makes near impossible to set location
adding - 5 seems to fix, otherwise the coordinates label will have to be removed
2021-06-29 17:41:07 +02:00
Adriaan de Groot
c3528e4e40 [partition] Document that the default FS is used, also when erasing 2021-06-29 14:52:16 +02:00
Adriaan de Groot
67fafa04ac [partition] Move fs-type handling into Config
- the defaultFileSystemType interacts with availableFileSystemTypes
  so set them together.
2021-06-29 14:47:09 +02:00
Adriaan de Groot
f494440895 [partition] Don't run bool allowManualPartitioning through GS
It's a bit over-wrought to store a bool in a QVariant in GS for
consumption **only** by ChoicePage, so drop that GS key and store
it locally.
2021-06-29 13:21:46 +02:00
Adriaan de Groot
5e3a0eda73 [partition] Reduce confused naming 2021-06-29 13:01:21 +02:00
Adriaan de Groot
ebecfb9f8b [partition] Simplify config-reading (now the variant-docs are better) 2021-06-29 12:21:14 +02:00
Adriaan de Groot
88be947f6c [libcalamares] Expand tests for Variant access
- document that getStringList() also handles strings as 1-element lists
2021-06-29 12:13:37 +02:00
Adriaan de Groot
46f2d72b4c [partition] requiredPartitionTableType: improve docs 2021-06-29 11:48:53 +02:00
Adriaan de Groot
5f7cfefed7 [partition] Migrate EFI settings-setting to Config object 2021-06-29 11:43:20 +02:00
Adriaan de Groot
c3bc305bb6 [partition] Shuffle Config and ViewStep to top
Modules nearly always have a Config and either a Job or ViewStep
as their "top level" components. Everything else is implementation-
detail. The *partition* module was unusual in that those two
"top level" components were tucked away in subdirectories.

Shuffle them to the top: this makes it more clear that these
two files are there to coordinate the module.
2021-06-29 11:22:47 +02:00
Adriaan de Groot
cba5b9e4fb [partition]: restore defaultFileSystemType in config
Add the old key back, document the new key, expand schema.
2021-06-28 22:25:54 +02:00
Adriaan de Groot
015f644acf [calamares] More attributes in injected Python script
Fake a little more of the subprocess module.
2021-06-28 21:56:49 +02:00
Adriaan de Groot
5d54a08581 [calamares] Allow disabling the Python pre-script
The test-application injects a script into Python code
to render harmless functions in the subprocess module
(eg to avoid Python code from running the package manager
for real). There are cases, though, where that injection
should be skipped (eg because the whole point of test-
loading some Python is to check commands that are run).

Add a -P option to the test-application to do that.
2021-06-28 17:17:19 +02:00
Adriaan de Groot
a86ffd105a [bootloader] factor out GRUB EFI determinations 2021-06-28 17:16:53 +02:00
Adriaan de Groot
d068371e62
Merge pull request #1733 from CC2130/aarch64-support
[bootloader] add support for aarch64
2021-06-28 15:50:18 +02:00
demmm
2f7d251000 [usersq] empty length is starting color 2021-06-27 12:05:44 +02:00
demmm
989d08c70a [usersq] add inline messages, adjust layout
warning messages implemented for user & host names
move root password option box inline with password section
adjust background color according to text.length
hardcode color instead of kirigami colors
usersq is now usable, sets user, hostname & password correctly on install
warning messages & color changes not fully done yet
2021-06-26 18:14:19 +02:00
Jia Chao
3dce393dcc bootloader: add-support_for_aarch64 2021-06-25 17:42:36 +08:00
Omer I.S
e1bf7ae96f
Add Hebrew and Arabic 2021-06-24 14:13:30 +03:00
Adriaan de Groot
131352ca03 [partition] Apply coding style 2021-06-22 00:21:01 +02:00
Adriaan de Groot
e2bf717ea0 [partition] Rewrite new-partition API
The existing API required calling the one constructor with
specific pointers (nullptr for a partition-from-free-space)
followed by calling one of the initFrom*() functions. This
is fragile design.

Use tag-classes to distinguish create-from-free-space and
edit-another-freshly-created-partition cases, refactor
to merge the initFrom*() methods into the constructors
and factor out the shared UI creation.

Callers can now use the tag-class to distinguish. While
here, adjust both callers to use QPointer, avoiding some
very specific dialog-on-the-stack crash possibilities.
2021-06-22 00:17:46 +02:00
Adriaan de Groot
dbfd8bea03 [partition] Newly-created (fresh) partitions don't have flags yet
When a partition is set as "freshly created", the dialog was
passing in newFlags() as the **already-active** flags on the
partition; then the caller was setting those same flags as
"set these in the future", so that afterwards, no flags would
actually be set (because they're already active -- see the
first sentence).

Now, fresh partitions have no flags.
2021-06-22 00:11:46 +02:00
Adriaan de Groot
f06766085a [partition] Rename function, to track down consumers 2021-06-22 00:11:46 +02:00
Adriaan de Groot
acb731d823 [libcalamaresui] Provide the logFile path
This is intended for consumption by QML; the ViewManager object
acts as a proxy for a handful of global Settings values already,
so throw in global Logger values as well. A QML module that would
like to read the log file (e.g. for tailing it as part of a
slide-show) can get the path via this property.
2021-06-21 22:21:06 +02:00
Adriaan de Groot
54e66ff1c0 [calamares] Python pre-script only if Python is enabled
If Python support isn't enabled, you can include the PythonJob header,
but the symbols aren't in libcalamares so fails at link time.

FIXES #1729
2021-06-21 10:09:44 +02:00
Adriaan de Groot
60f8a7c5fb [partition] Don't offer /boot if EFI wants something else
- Don't leave /boot in the list always; EFI might be configured
  for /boot/efi on this system
- While here, apply coding style.
2021-06-18 22:20:11 +02:00
Adriaan de Groot
6936915dd6 [partition] Fix logging (type of debug stream changed) 2021-06-18 17:41:22 +02:00
Adriaan de Groot
7deb6c0e9e [partition] Improve logging in clearmounts job 2021-06-18 16:18:06 +02:00
Adriaan de Groot
432154e50a [libcalamares] Improve Once-logging
Sending a Once to a logger that isn't enabled should not "consume"
that Once; it's still available for a subsequent logger that **is**
enabled (useful if you're using more than one log-level in a function).
2021-06-18 16:10:13 +02:00
Adriaan de Groot
66f96e339c [libcalamares] Introduce cVerbose() convenience macro (like cDebug()) 2021-06-18 16:01:04 +02:00
Adriaan de Groot
17cc0470da [partition] Log names of partition flags, not just a number 2021-06-18 15:54:51 +02:00
Adriaan de Groot
bf7eed9342 [partition] Tidy debug output when creating table 2021-06-18 15:50:13 +02:00
Adriaan de Groot
fb7e6101ff [partition] Hook erase-fs-type changes to the config-object 2021-06-18 13:53:47 +02:00
Adriaan de Groot
7ce2a87644 [partition] Fix build
- fsName was a QString (a copy) so it could be modified;
- the modification isn't really necessary.
- While here, pick up new PointerSetter convenience class.
2021-06-18 13:49:39 +02:00
Adriaan de Groot
ef436ac4d7 [libcalamares] add a convenience optional-setter for use with pointers 2021-06-18 13:49:08 +02:00
Adriaan de Groot
2a0d4e5a23 [partition] Initialize pointers in declaration 2021-06-18 12:35:15 +02:00
Adriaan de Groot
26cabbb3e4 [partition] refactor config-reading from availableFileSystemTypes 2021-06-18 12:18:04 +02:00
Adriaan de Groot
cd804470b5 [partition] Canonicalize the FS choice for erase 2021-06-18 11:51:33 +02:00
Adriaan de Groot
d8a862ec82 [partition] Use Q_EMIT 2021-06-18 11:31:53 +02:00
Adriaan de Groot
4fa61249a8 [partition] Make the fs type used for erase, a config property 2021-06-18 11:29:36 +02:00
Adriaan de Groot
9fa5ab04e5 [partition] Apply coding style to core/ 2021-06-18 11:23:27 +02:00
Adriaan de Groot
f9659989b1 [partition] rename findFS
Rename findFS -> canonicalFilesystemName because that's what it actually
does. While here, apply coding style to the files that are affected.
2021-06-18 11:09:11 +02:00
Adriaan de Groot
546253d750 [partition] Apply coding style 2021-06-18 11:00:15 +02:00
Adriaan de Groot
cc0e39db56 [calamares] Inject a pre-script when testing Python modules
Co-opt the subprocess module and replace call and check_call
functions with something that logs the call and does nothing.
2021-06-15 23:56:58 +02:00
Adriaan de Groot
629fc83f21 [libcalamares] Add a pre-script for PythonJobs
This allows injecting arbitrary Python code before
the script of a module is even run. For testing
purposes, that gives us a chance to modify existing
(internal) modules before the script (e.g. to test
subprocess calls).
2021-06-15 21:50:59 +02:00
Adriaan de Groot
69cad09a00 [calamares] Tighten debug-output from module-loader test executable 2021-06-15 21:23:57 +02:00
Adriaan de Groot
7b297a0e16 [mount] Rename test file, re-jig tests for mount 2021-06-15 21:11:07 +02:00
Adriaan de Groot
846936357b [mount] If no btrfs layout at all, use something reasonable
This is related to https://invent.kde.org/neon/neon/calamares-settings/-/merge_requests/1
which adds .. the default things from the example configuration to the
configuration file KDE neon ships. The default layout doesn't add
any subvolumes at all, which seems to be non-functional.

If nothing is configured, complain and use /@ as the lone subvolume.
2021-06-15 20:43:44 +02:00
Adriaan de Groot
9ef22f4168 Merge branch 'calamares' of https://github.com/LordTermor/calamares into pr-1667 2021-06-15 11:48:33 +02:00
Adriaan de Groot
6ee0da41c8 [libcalamares] Avoid deprecation warning in network attributes 2021-06-15 11:45:29 +02:00
Adriaan de Groot
f0a25bd397 [libcalamares] Avoid warnings from deprecated country codes.
The Qt documentation does not mention @since for these values,
so we're going to let CI catch them.
2021-06-15 11:41:17 +02:00
Adriaan de Groot
dba346be7a [partition] Fix build in non-debug settings 2021-06-08 19:51:25 +02:00
Adriaan de Groot
4f70568c65 [partition] Remove unneeded includes 2021-06-08 15:05:44 +02:00
Adriaan de Groot
63c6a8bac8 [partition] Remove unneeded includes 2021-06-08 14:18:28 +02:00
Adriaan de Groot
f67c7f900c [partition] Make the expanded (pop-up) icon sizes for devices a bit smaller 2021-06-08 14:14:11 +02:00
Adriaan de Groot
df634573bf [partition] Resize combo box to show whole pop-up
The (collapsed) combo box should be wide enough to show the
entire pop-up (expanded) box data.

FIXES #1700
2021-06-08 14:09:31 +02:00
Adriaan de Groot
eb627bc055 [partition] Avoid crash when PARTITION_UNSAFE is on
PARTITION_UNSAFE is a debug mode. It is not used in
production, because it allows you to pick an install
device that would be dangerous (e.g. the current / device).

Existing code kept two copies of a list of pointers,
and deleted pointers from one of the lists and returned
the other -- which now contains dangling pointers.

Refactor by applying suitable lambdas to a single
copy of the list; this avoids copying the list so
there is no danger of dangling pointers.
2021-06-08 13:22:56 +02:00
Adriaan de Groot
a57a1fdbd8 [partition] Improve logging while collecting devices 2021-06-04 13:32:22 +02:00
Adriaan de Groot
cf341c53fa Merge branch 'calamares' into improve-partition 2021-05-25 17:37:15 +02:00
Adriaan de Groot
78af510535
Merge pull request #1708 from demmm/calamares
[localeq], working Offline.qml
2021-05-31 11:48:10 +02:00
Adriaan de Groot
b68e535131 [libcalamares] Log to file and stdout consistently
- The log **file** got every QDebug object, while stdout only
  got the ones of sufficient logging level. A CDebug object checks the
  logging level before writing anything -- so those already were
  consistent, but any qDebug() in the program (not cDebug()!) would
  reach the writing-function anyway, and so log to the file.
  Fix this weird inconsistency by checking log-level just once,
  for both writes.
2021-05-31 11:39:13 +02:00
Adriaan de Groot
716328cafb [libcalamares] Un-clog Logging
- Map QtMsgType -- used by qDebug() and qWarning() -- to levels used
  by Calamares in a consistent fashion.
- Drop unused log levels (INFO, EXTRA unused in any Calamares code).
2021-05-31 11:26:49 +02:00
Adriaan de Groot
a72d59d23b [partition] Don't mention IRC support for weird configs 2021-05-31 10:38:37 +02:00
Adriaan de Groot
2d8cf6aabf [partition] Fix build against KPMCore3 2021-05-26 16:36:28 +02:00
demmm
72f97ac163 [localeq] Offline.qml visual improvements 2021-05-26 12:38:08 +02:00
Philip Müller
2c99a8c6f8
[displaymanager] add cutefish
- more info at https://cutefishos.com/
2021-05-26 09:36:02 +02:00
demmm
ffe3209121 [localeq], working Offline.qml 2021-05-25 22:52:10 +02:00
Adriaan de Groot
01911beccc [partition] Expand debugging output
The partition path isn't set yet, so is probably 'empty'. Try logging the device, too.
2021-05-25 14:16:28 +02:00
Adriaan de Groot
252a88cb7f [partition] Check for suitable bios_grub partition. 2021-05-25 14:07:58 +02:00
Adriaan de Groot
43c172f54d [partition] Tighten up types
Don't return the generic Abstract model for bootloader, but
the subclass pointer, so that consumers can use the convenience
API on the subclass.
2021-05-25 13:23:28 +02:00
Adriaan de Groot
d0276fd25f [partition] Look up bootloader by name, method
The bootloader model knows about both rows and
devices, so we can look up both at once. The
existing implementation as a non-member was rather
sketchy and wasn't used except as support for
restoreSelectedBootLoader().
2021-05-25 13:05:45 +02:00
Adriaan de Groot
dabd895755 [partition] Use type alias consistently 2021-05-25 12:33:12 +02:00
Adriaan de Groot
d630c2aadf [partition] Introduce a check if the GPT-on-BIOS popup should be shown
The check is bogus right now, and it still always warns; but if
the `shouldWarnForGPTOnBIOS()` function is implemented, this will
fix issue 1701.
2021-05-25 12:00:35 +02:00
Adriaan de Groot
aa4569b55b [packages] Convert command-failures into readable error messages
If the pakcage manager fails in some way, convert to a readable
error message instead of leaking the exception to the caller
(which produces a traceback, which is harder to read and less
informative)
2021-05-24 23:07:11 +02:00
Adriaan de Groot
bb1df38caa [bootloader] Convert command-failures into readable error messages
Avoid leaking errors to the caller, because that gets us a
traceback and generic Python Error message, which is less-than-helpful.
2021-05-24 23:05:46 +02:00
Adriaan de Groot
e186e54434 [fstab] Don't fail with a KeyError in misconfigured installations
Use get() instead of [] to avoid KeyError when the host system
confuguration is entirely missing a setting for *mountOptions*.

FIXES #1702
2021-05-24 22:16:54 +02:00
Adriaan de Groot
d731e12456 [libcalamares] Add an extra job-failure enum value 2021-05-15 07:46:03 +02:00
Adriaan de Groot
ce5b5c6734
Merge pull request #1692 from edupals/copy_link_resolvconf
[networkcfg] copy resolvconf as link
2021-05-17 12:14:24 +02:00
Raul Rodrigo Segura
a888156deb copy resolvconf as link 2021-05-12 16:20:13 +02:00
Adriaan de Groot
27f965deb6 [summary] Name widgets for styling 2021-05-10 21:55:52 +02:00
Adriaan de Groot
5d577371e7 [welcome] Name widgets for styling
Widgets are easier to style if they have a name, and easier to spot
in the widget tree as well. Give the requirements-checker
parts meaningful names.

SEE #1685
2021-05-10 21:55:52 +02:00