Commit Graph

5143 Commits

Author SHA1 Message Date
Adriaan de Groot
538779991e [netinstall] Add some "standard" sidebar labels for the module 2020-02-19 14:37:47 +01:00
Adriaan de Groot
81752b6f7c [libcalamares] Document how TranslatedString context works
- Support re-using class-specific tr() calls in a standard way
- Document this in the netinstall.conf which uses it
2020-02-19 14:23:34 +01:00
Adriaan de Groot
a03394f177 [netinstall] Use tr() infrastructure for config-translations 2020-02-19 14:09:04 +01:00
Adriaan de Groot
0ef28f6a50 [libcalamares] Translatable config strings use tr()-infrastructure
- Allow TranslatedString to get a context parameter; if it has
  one, it will try to use the regular tr()-infrastructure
  **as fallback** for the translations from the config file itself.
- This makes it possible to offer -- and translate -- some "standard"
  phrases in the module, while allowing the config file the knob
  to change strings. Using one of the standard strings gets translations
  for "free", while introducing something entirely new means sourcing
  translations for it as well.
2020-02-19 14:04:35 +01:00
Adriaan de Groot
25e3f91754 [welcome] Remove the QML testing bits
- The welcomeq module has actual QML support
2020-02-19 13:39:24 +01:00
Adriaan de Groot
bff07ded25 Merge remote-tracking branch 'origin/welcome-q'
- Updates QmlViewStep with slightly neater API
- Introduces Config object for QML pages
- Updates notesqml and welcomeq to use that API
2020-02-19 12:56:04 +01:00
Adriaan de Groot
c20f7ee534 [netinstall] Rip out derpy translations of PackageModel
- The model always has two columns, and the column names are always
  the same. We don't need to specially set headers for that.
- Use QCoreApplication::translation() to re-use the existing
  translations and avoid creating "new" strings (in a new context).
2020-02-19 12:51:01 +01:00
Adriaan de Groot
f6d8ed85e4 [netinstall] Allow a title above the netinstall tree
- Supports translation via the config file. This is useful
  (like label:sidebar) when displaying more than one netinstall page.
2020-02-19 09:29:23 +01:00
Adriaan de Groot
5b67ca315a [netinstall] It should be easier to get the number 2 2020-02-19 01:24:24 +01:00
Adriaan de Groot
497ecda14d [netinstall] Move translation of widget headers
Editorial: I really don't like plain CALAMARES_RETRANSLATE() thrown
into the middle of code.
2020-02-18 23:17:18 +01:00
Adriaan de Groot
45c15de623 [netinstall] Configurable name in the sidebar 2020-02-18 17:59:34 +01:00
Adriaan de Groot
be567dc508 [netinstall] Remove unused m_prettyStatus 2020-02-18 17:50:39 +01:00
Adriaan de Groot
4ae484dbca [netinstall] Initial work for configurable sidebar label
- Now that multiple netinstall pages may be supported, it's annoying
  that they all have the same name. Copy the approach from other
  modules (e.g. notesQML) of having the sidebar and other labels
  configured in the config file.
2020-02-18 17:46:56 +01:00
Adriaan de Groot
0877a994f1 [netinstall] Update copyright 2020-02-18 17:40:15 +01:00
Adriaan de Groot
d909b8119e [netinstall] Code-style 2020-02-18 17:37:58 +01:00
Adriaan de Groot
bc5aa1f837 [netinstall] Pretend to clean up resources 2020-02-18 17:37:16 +01:00
Adriaan de Groot
5f1bd4396e [netinstall] Avoid duplicate operations
- Since operations are added each time you leave this page,
   the existing operations (from a previous visit) need to be
   cleaned up. With the old setup of only **one** possible
   set of operations, this wasn't a problem. Now, merging
   in operations is necessary. Implement that by looking for
   the *source* property in an operation.

FIXES #1303
2020-02-18 14:46:00 +01:00
Adriaan de Groot
74169c166a [netinstall] Mark operations with source-module
- This will allow us to find the operations later, by looking for
  the same source-module.
- While here, tidy up types
2020-02-18 14:19:48 +01:00
Adriaan de Groot
7cadfb8ddd [packages] Log unfamiliar package operations
- unknown operations get a warning
 - "source" will be added from netinstall shortly
2020-02-18 12:02:16 +01:00
Adriaan de Groot
056b0d7548 [netinstall] Refactor variant-from-ItemData 2020-02-18 11:40:43 +01:00
Adriaan de Groot
d5675508fa [netinstall] More coding-style
The tools don't always pick up all the style changes in one go
(I think astyle has trouble parsing some Calamares code)
2020-02-18 11:39:54 +01:00
Adriaan de Groot
8286bff95f [netinstall] Shuffle code around a bit
- introduce char const for key name (consistency, it's used lots)
 - polish debugging a bit
 - add some inline code-docs
2020-02-18 11:28:42 +01:00
Adriaan de Groot
17eb3f5e33 [netinstall] Apply coding style 2020-02-18 11:02:53 +01:00
Adriaan de Groot
1b80cf82de [fstab] Don't add swap that wasn't made new for us 2020-02-18 10:44:54 +01:00
Adriaan de Groot
158e11de1e [partition] Indicate that a filesystem is new in GS 2020-02-18 10:44:54 +01:00
Adriaan de Groot
7c2a196568 [users] Document new knobs
- while here, update copyright notice

FIXES #1140
2020-02-18 10:38:31 +01:00
Adriaan de Groot
f7e8488edf [users] Correct DBus return from hostnamed calls 2020-02-18 10:35:47 +01:00
Adriaan de Groot
094c213baa [users] Also test hostname-setting via hostnamed
SEE #1140
2020-02-18 10:16:19 +01:00
Adriaan de Groot
f1435452ea [users] Polish up tests
- Don't remove test artifacts on failure
 - Coding style
2020-02-17 18:21:44 +01:00
Adriaan de Groot
c5b45c37fc [users] Add tests of the file-writing components 2020-02-17 18:10:46 +01:00
Adriaan de Groot
371fe267b1 Merge branch 'better-hostname' 2020-02-17 17:10:21 +01:00
Adriaan de Groot
94f5b13db0 [libcalamaresui] Restore previous DLLEXPORT names
- Different libraries should have different EXPORTs, so that
   you can IMPORT one while building the other. Reported (and
   kindly explained) by Kevin Kofler.
 - Stick to one header file, though.

While here, update copyright on file.
2020-02-17 16:55:17 +01:00
Adriaan de Groot
49eb8212e3 [users] Imporove enum-naming 2020-02-17 16:46:06 +01:00
Adriaan de Groot
e74831fcb4 [users] Add .conf entries for hostname settings
- Set hostname not-at-all, or via one of two mechanisms
 - Write /etc/hosts or not
2020-02-17 16:40:09 +01:00
Adriaan de Groot
61d096c9ec [users] Prep-work for configurable actions
- tidy include style
 - add setting to UsersViewStep for hostname action
2020-02-17 16:27:53 +01:00
Adriaan de Groot
33b3321698 [users] Simplify reading configuration 2020-02-17 16:05:55 +01:00
Adriaan de Groot
dbba0c9b03 [users] Move Job creation from the widget to the ViewStep
- Having the widget do creation ties the step heavily to that UI;
   start moving towards a state where we have a Config object (not
   here yet; it still queries the UI part) that moves data around
   between UI and ViewStep.
2020-02-17 15:56:41 +01:00
Adriaan de Groot
2471e74aab [users] Provide some accessors to the UI-page data 2020-02-17 15:50:22 +01:00
Adriaan de Groot
ef4bb5e13b [users] Make SetHostName job actions configurable 2020-02-17 15:24:44 +01:00
Adriaan de Groot
6719a41aef [libcalamares] Switch tests to calamares_add_test() 2020-02-17 15:05:00 +01:00
Adriaan de Groot
51e135cfbd CMake: chase introduction of IMPORTED yamlcpp 2020-02-17 15:01:05 +01:00
Adriaan de Groot
6f996d8eed CMake: give yamlcpp a proper imported target
- This makes linking easier,
 - Adds the right includes (needed on FreeBSD),
 - Lets us drop silly GUI setting for non-GUI tests (I think this was
   a side-effect of compiling on FreeBSD, where UI would pull in
   /usr/local/include).
2020-02-17 14:55:12 +01:00
Adriaan de Groot
4495a4c739 CMake: Allow extra libraries in calamares_add_test
- Extra libraries specified via LIBRARIES part of CMake function
 - Convert all the other module tests
2020-02-17 14:36:52 +01:00
Adriaan de Groot
637a57d534 [machineid] Change to calamares_add_test
- The test-macro handles cases without ECM or testing transparently.
 - Adds compile defines for STATICTEST.
2020-02-17 12:04:18 +01:00
Adriaan de Groot
6bdc4a55de CMake: new convenience module CalamaresAddTest 2020-02-17 12:02:53 +01:00
Adriaan de Groot
b42520b0ef [machineid] Apply new STATICTEST specifier, hide implementation details 2020-02-17 11:51:56 +01:00
Adriaan de Groot
92260e7d0b [libcalamares] Document DllMacro.h and add STATICTEST
- document the export macros
 - introduce a "static" that is switched off when re-building code
   for tests.
2020-02-17 11:43:20 +01:00
Adriaan de Groot
b044549013 [libcalamares] Merge PluginDllMacro.h into DllMacro.h
- Let's just have one header definining export- and visibility-
   macros for Calamares. They are still selected based on the
   export flags (*_PRO), just defined in one header instead of two.
2020-02-17 11:37:35 +01:00
Adriaan de Groot
aaa6f6bd55 [libcalamaresui] Drop UiDllMacro.h
- The scattering of DLL export macro's is kind of useless;
   there are several headers, and then the export macro isn't
   even applied consistently. Just drop the one for UI exports,
   which was only used in libcalamaresui.
2020-02-17 11:32:28 +01:00
Adriaan de Groot
44bf0a5d6d [users] Add method for using hostnamed
SEE #1140
2020-02-17 10:57:41 +01:00
Adriaan de Groot
9a7465bfd5 [users] Refactor writing-hostname and writing-hosts
- Move to separate functions, as prep-work for making the actions
   configurable (and optional).
2020-02-17 10:42:54 +01:00
Adriaan de Groot
214f9a308e Merge branch 'improve-tests' 2020-02-16 20:29:24 +01:00
Adriaan de Groot
d5f3e2e7d4
Merge pull request #1318 from yurchor/patch-2
[partition] Fix typo: partitons -> partitions
2020-02-16 20:26:43 +01:00
Yuri Chornoivan
ea82a26dae
Fix typo:; partitons -> partitions
Many thanks in advance for reviewing.
2020-02-16 14:12:48 +02:00
Yuri Chornoivan
b582c27bf4
Fix minor typo
Many thanks in advance for reviewing.
2020-02-16 14:09:30 +02:00
Adriaan de Groot
90f79b0692 [users] Restore error-checking to set-hostname code
- Use the new CreationResult code for compact results
2020-02-14 13:27:49 +01:00
Adriaan de Groot
781322ab41 [libcalamares] Use more descriptive variable name
- If the test failed, you'd get a cryptic message like
	FAIL!  : NetworkTests::testPing() 'r' returned FALSE. ()
   So rename the variable so the failure mode is more obvious.
   (Could have used QVERIFY2() instead, this is simpler)
2020-02-14 13:23:19 +01:00
Adriaan de Groot
f6526f7d9f [libcalamares] Add some tests for CreationResult
- More important is the compiler warning that will show up
   if we add more failure states.
2020-02-14 13:21:16 +01:00
Adriaan de Groot
274115c727 [libcalamares] Update tests to reflect changed API 2020-02-14 13:07:29 +01:00
Adriaan de Groot
2d7398161d [libcalamares] More detail for createTargetFile()
- Return a result-object with statrus information and the path
   which was previously used (empty for "failures").
2020-02-14 13:03:51 +01:00
Adriaan de Groot
695b88b8a7 [users] Tidy up hostname creation
- Use the createTargetFile() convenience functions to do the
   actual work.
 - This probably involves more copying around of buffers, since it's
   creating one big QString and sending that off, rather than writing
   little chunks to a file, but I feel this is worth the code simplification.
 - Drops all the error checking for creation, though, because the API for
   createTargetFile() lousy.
2020-02-14 12:31:53 +01:00
Adriaan de Groot
b337a6b3f5 [user] Apply coding style 2020-02-14 11:46:35 +01:00
Adriaan de Groot
2bb4dd8e22 [users] Refactor hostname-guessing 2020-02-14 11:45:45 +01:00
Gabriel Craciunescu
7c323bdcdc [users] Try to guess suggested hostname from dmi
- nothing compicated for now, just try to get something
  from /sys/devices/virtual/dmi/id/product_name and fallback
  to -pc thingy if we can't
2020-02-14 11:36:53 +01:00
Adriaan de Groot
7f295d9565 [partition] Apply coding style to core/ subdir
Because this is a giant code change, with no functional effect,
I've been saving this until the end of the kpmcore-manager branch.
2020-02-14 11:15:57 +01:00
Adriaan de Groot
2bc296b468 [unpackfs] Fix typo's introduced in june 2020-02-13 16:23:49 +01:00
Adriaan de Groot
45a31a3022 [partition] Tidy includes
- sort includes a little
 - remove superfluous includes
 - update copyright
2020-02-13 13:54:04 +01:00
Adriaan de Groot
d931b146e3 [partition] Shuffle new conveniences into partition service
- the general stuff from KPMHelpers ends up in the partition
   service; that only gets compiled when KPMCore is available anyway.
2020-02-13 13:48:12 +01:00
Adriaan de Groot
e72ecaafd3 Merge branch 'kpmcore-manager'
Introduces a "partitioning service" into libcalamares,
shuffles a bunch of things into it, tries to help out
with settling the system between partitioning actions.
2020-02-13 13:41:53 +01:00
Adriaan de Groot
5a50a3a40c [partition] Consistent FS name usage
- explicit use of user-visible names in EditExistingPartitionDialog
 - consistent conversion of config-values to FS names (user-visible).
   The GS value comes from the ViewStep, and should always match
   something -- it's already converted to the canonical un-translated
   so the type should be good.
2020-02-13 13:24:53 +01:00
Adriaan de Groot
57b608083e [partition] Fix build - missing ) 2020-02-13 13:24:09 +01:00
Adriaan de Groot
ca67534cd2 [partition] Improve logging of bad configs 2020-02-13 13:15:06 +01:00
Adriaan de Groot
472ec32617 [partition] Be explicit about user-visible FS names, ReplaceWidget 2020-02-13 11:49:20 +01:00
Adriaan de Groot
05dfc24af6 [partition] Be explicit about user-visible FS names, CreatePartitionDialog 2020-02-13 11:45:04 +01:00
Adriaan de Groot
88cff387c3 [partition] Be explicit about user-visible FS names, FormatPartitionJob 2020-02-13 11:33:40 +01:00
Adriaan de Groot
bacca04695 [partition] Be explicit about what's user visible in SetPartitionFlagsJob 2020-02-13 11:29:45 +01:00
Adriaan de Groot
29894cec6a [partition] Convenience userVisibleFS()
- Mark uses of filesystem-name where it's intentional that they
   are user-visible, with a new convenience function.
2020-02-13 11:22:09 +01:00
Adriaan de Groot
dac5516b2c [partition] Update copyright, coding style 2020-02-13 11:12:22 +01:00
Adriaan de Groot
a0449abab9 [partition] Do not translate filesystem names
- Move contents of FSName to KPMHelpers
 - Use the new functions from FillGlobalStorage

Needs more use in the rest of the partition module.
2020-02-13 11:06:53 +01:00
Adriaan de Groot
f410a4bb68 [libcalamares] Convenience function for FS names
Because getting the untranslated name of a FileSystem is something
that needs doing consistently, add some functions for that;
it makes it easier to spot places where that isn't done.

Probably doesn't compile, and needs extra documentation.
2020-02-13 10:12:02 +01:00
Adriaan de Groot
c055e1da49 [partition] Use untranslated name of filesystem
- Patch from Gabriel Craciunescu
2020-02-13 09:32:06 +01:00
Adriaan de Groot
aa0a799492 [welcomeq] QML warnings--
The config bits are all constant, so avoid NOTIFY warnings.
2020-02-12 22:47:11 +01:00
Adriaan de Groot
f094cb543b [libcalamaresui] Set config object earlier
- The config context object should be set earlier, otherwise
   QML code will try binding to a non-existent config already
 - Document that QMLViewStep::setConfigurationMap() parent implementation
   should be called **last**, at the end of the subclass implementation.
2020-02-12 22:33:49 +01:00
Adriaan de Groot
7e0cc7af41 [welcomeq] Add configuration file
- copy the buttons-config part from welcome.conf
 - create buttons in the QML part
2020-02-12 18:24:07 +01:00
Adriaan de Groot
85b873a1a2 [libcalamaresui] Log QML error message
- When loading fails, log a useful error message from the QML
   engine (to help debug the QML)
2020-02-12 17:58:21 +01:00
Adriaan de Groot
49ed97cb77 [libcalamares] Allow QML ViewSteps to expose a config object 2020-02-12 17:51:10 +01:00
Adriaan de Groot
f0134aab71 [welcomeq] Add more fields to Config
- getters as slots, for later access from QML
2020-02-12 17:37:06 +01:00
Adriaan de Groot
86bf9287ab [notesqml] Use Branding strings 2020-02-12 16:23:34 +01:00
Adriaan de Groot
ae35256177 [welcomeq] Add top-text
- Fix QML indentation to the canonical 4-spaces
 - Add a header at the top of the page
 - Force the image to load from the filesystem
2020-02-12 16:20:53 +01:00
Adriaan de Groot
18942f835f [libcalamares] Remove confusing name-qualifiers
- Using Branding::ImageEntry, when ImageEntry is an enum class
   defined *in* Branding, is superfluous, and it also confuses
   moc; the enum type isn't recognized from QML.
2020-02-12 15:35:11 +01:00
Camilo Higuita
15d8503726 [libcalamaresui] Expose the branding strings & urls to qml 2020-02-12 15:18:24 +01:00
Adriaan de Groot
152c3352c2 [welcomeq] Compile the QML into the module
- Default implementation is in the QRC
 - Register Branding for QML modules (just once)
2020-02-12 15:08:18 +01:00
Camilo Higuita
b5e17b7ea5 [welcomeq] Add full-featured QML for welcome page
This is a merge of several commits by Camilo.
2020-02-12 14:31:15 +01:00
Adriaan de Groot
7bf0fded1b [welcomeq] Port to newer QmlViewStep 2020-02-12 14:25:30 +01:00
Adriaan de Groot
adb312bdd2 [welcomeq] Coding style
- a R/W property isn't CONSTANT
 - apply calamaresstyle
2020-02-12 14:19:33 +01:00
Adriaan de Groot
c7780db07a Merge branch 'model-q'
- Make models of some things previously held as lists, as
   prep-work for QML modules.
2020-02-12 14:08:07 +01:00
Camilo Higuita
1f2f1a657e [libcalamaresui] Expose Branding strings to QML 2020-02-12 13:57:26 +01:00
Adriaan de Groot
ca13d1670e [libcalamares] Merge more from Camilo
- Complete the model for locales
2020-02-12 13:40:59 +01:00
Adriaan de Groot
59ddda6225 Merge branch 'wrangle-boost' 2020-02-12 12:44:09 +01:00
Adriaan de Groot
9408601074 [libcalamares] Move Python wrapper
- Take the Python wrapper for GlobalStorage out of the GlobalStorage.h
   header and add it to PythonHelper instead, saving some work in
   all the cases that only GS is interesting, not the Python bits.
2020-02-12 12:37:43 +01:00
Adriaan de Groot
ad725b671e [hostinfo] Warnings--
- Physical memory can't be negative, so it is reported as
   an unsigned long, but the bytes-to-MiB functions do accept
   negative amounts. As long as no machine has more than 2**62
   bytes of memory, we're good though.
2020-02-12 12:26:55 +01:00
Adriaan de Groot
a11280b427 [libcalamares] Expand tests for printable entropy 2020-02-12 12:22:02 +01:00
Adriaan de Groot
090716ba4f [libcalamares] Warnings-- in Entropy
- reading a file yields a qint64
 - need to mash the unsigned data from twister to signed char data.
2020-02-12 12:15:13 +01:00
Adriaan de Groot
7efed8226c [libcalamares] Warnings--, update copyright 2020-02-12 12:10:58 +01:00
Adriaan de Groot
c1151cbcfa [libcalamares] Update copyright info 2020-02-12 12:08:46 +01:00
Adriaan de Groot
8181808bec [libcalamares] Fix build
- drop now-obsolete boost-warnings.h
 - add missing namespace alias to GlobalStorage.h (removed accidentally
   in previous commit)
2020-02-12 11:25:10 +01:00
Adriaan de Groot
3b35ca7bb9 [libcalamares] Simplify includes
- PythonHelper.h already pulls in all the Python machinery
2020-02-12 11:04:15 +01:00
Adriaan de Groot
95722541d0 [libcalamares] Untangle Python includes
- Use BoostPython.h to manage overall includes
 - Remove local home-grown variations
2020-02-12 11:02:38 +01:00
Adriaan de Groot
f8998834cf [libcalamares] Simplify includes (no Python used in JobQueue) 2020-02-12 10:55:36 +01:00
Adriaan de Groot
d42e757576 [libcalamares] Simplify includes
- CalamaresVersion used by the job, not the API presented to Python.
 - Untangle Qt includes from there.
2020-02-12 10:48:19 +01:00
Adriaan de Groot
f3e7fe5eb4 [libcalamares] Use more specific include 2020-02-12 10:32:10 +01:00
Adriaan de Groot
96580e5c40 [libcalamares] Convenience header for Boost and its warnings 2020-02-12 10:28:48 +01:00
Adriaan de Groot
6432b7f42a [libcalamares] Hit Boost warnings with a hammer
- Tons of warnings from Clang 9 in Boost::Python code, so
   turn of most of those warnings in the Boost-support code.
2020-02-11 16:46:44 +01:00
Adriaan de Groot
684c5f477c [libcalamares] Moc warnings--
- don't have a NOTIFY CONSTANT property
 - the data is constant, so drop NOTIFY
 - remove redundant signals
 - remove setLabels() now it's only needed from one constructor
2020-02-11 16:40:36 +01:00
Adriaan de Groot
b4b1bf5de2 [libcalamares] Call delegated constructor 2020-02-11 16:39:39 +01:00
Adriaan de Groot
df5a0d25bc [libcalamares] Handle empty locale names quickly 2020-02-11 16:37:49 +01:00
Adriaan de Groot
27bc64e63f [libcalamares] C++ style, warnings-- 2020-02-11 15:36:30 +01:00
Adriaan de Groot
241cb04f06 [libcalamares] Coding style 2020-02-11 15:25:28 +01:00
Camilo Higuita
1b3d32ca79 make label item from LabelModel qobject based and expose properties 2020-02-11 15:24:29 +01:00
Adriaan de Groot
6c0fecd40d [notesqml] Don't use a fixed width 2020-02-11 12:55:26 +01:00
Adriaan de Groot
c3c845e9d7 [notesqml] Add some more module documentation 2020-02-11 12:29:18 +01:00
Adriaan de Groot
4f60a6340e [dummyqml] Drop module; it makes more sense to just be notesqml 2020-02-11 12:20:39 +01:00
demmm
c0e1ebb72a adding notesqml, copy of dummyqml
included in settings.conf, commented out
2020-02-09 01:03:52 +01:00
Adriaan de Groot
39a5453904 [libcalamaresui] Add QML onActivate() and onLeave() calls.
- This comes from the ExecutionViewStep, V2 loading, which
   notifies the QML that the QML is now active.
2020-02-07 22:18:23 +01:00
Adriaan de Groot
1f34c2834e [libcalamaresui] Move definitions inside namespace {}
- Remove the extra Calamares:: namespace specifier from half the
   definitions.
2020-02-07 21:33:34 +01:00
Adriaan de Groot
12675be516 [libcalamaresui] Factor out "simple" QML method calls 2020-02-07 21:25:55 +01:00
Adriaan de Groot
bf675d971b Merge branch 'qml' 2020-02-07 21:08:29 +01:00
Adriaan de Groot
faa88afc88 Merge branch 'issue-1314'
FIXES #1314
2020-02-07 20:33:05 +01:00
Adriaan de Groot
229d09927e Changes: for 2020, new fake Linux distro name 2020-02-07 20:32:20 +01:00
Adriaan de Groot
3e2908ea16 [machineid] Follow Manjaro flags
- add -f to ln(1) flags
2020-02-07 20:31:15 +01:00
Adriaan de Groot
110a84344b [machineid] Test job function
- Create a job and ask it to create dbus files -- either directly,
   or as a symlink. Since the target chroot isn't viable, this will
   fail but we can at least see that directories are created, etc.
2020-02-07 20:29:42 +01:00
Adriaan de Groot
4cdcb48de6 [machineid] Functionality moved to libcalamares 2020-02-07 16:12:17 +01:00
Adriaan de Groot
b62004aae9 [machineid] Create the DBus data directory
- before running dbus-uuidgen or linking to systemd's UUID,
   create /var/lib/dbus; some distro's don't create that
   beforehand.

FIXES #1314
2020-02-07 16:10:13 +01:00
Adriaan de Groot
240fe2a564 [libcalamares] Add convenience createTargetParentDirs() 2020-02-07 16:09:02 +01:00
Adriaan de Groot
6ede9f2c7c [libcalamares] Test QFileInfo::dir() for completeness 2020-02-07 16:08:38 +01:00
Adriaan de Groot
e65969d587 [libcalamares] Re-do createTargetDirs()
- Drop the basedirs idea, replace return with just bool
 - Use QDir::mkpath, with some extra validation
 - Test it a bit
2020-02-07 15:51:46 +01:00
Adriaan de Groot
8b8ecf7b7b [libcalamars] Improve test init and cleanup
- Test createTargetFile and removeTargetFile
 - Clean up afterwards
 - Ensure /tmp is the RMP for each test
2020-02-07 15:23:02 +01:00
Adriaan de Groot
b502d78984 [libcalamares] Fix warning message
- "create" was when this function was used elsewhere
2020-02-07 13:58:44 +01:00
Adriaan de Groot
394eee3954 [libcalamares] Test more targetPath() scenario's 2020-02-07 13:57:14 +01:00
Adriaan de Groot
8d23e665ea [libcalamares] Fix targetPath() tests
- there is less simplification done than you might think
2020-02-07 13:53:49 +01:00
Adriaan de Groot
daa5b804b3 [libcalamares] Split paths-tests into own test executable
- Since these tests all want a system object, and a GS
   with a sensible setup, give them one with its own initTestCase().

This could have been done with one executable, running tests from
multiple classes, but there's not much overall benefit there.
2020-02-07 13:49:06 +01:00
Adriaan de Groot
31878dd43b [libcalamares] Avoid double / between root and path in targetPath() 2020-02-07 13:29:35 +01:00
Adriaan de Groot
15bca702c1 [libcalamares] Add tests for path functions (part 1) 2020-02-07 11:51:13 +01:00
Adriaan de Groot
95936549e2 [libcalamares] Add a createTargetBasedirs()
- Used to ensure that the directories leading up to a given path
   exist. Implementation is incomplete and broken for now.
 - While here, avoid removing an empty pathname in removeTargetFile()
   (the empty pathname indicates a broken configuration).
2020-02-07 11:30:37 +01:00
Adriaan de Groot
4af68365c9 [machineid] Remove obsolete implementation 2020-02-07 11:16:40 +01:00
Adriaan de Groot
bf882cec1d [machineid] Migrate removeFile() to libcalamares
- Becomes removeTargetFile()
2020-02-07 11:16:01 +01:00
Adriaan de Groot
9ef04192db [libcalamares] Simplify returns in targetPath() 2020-02-07 11:03:40 +01:00
Philip Müller
97ddd30af4
[machineid] folder needs to be created when not exists
- See #1314
2020-02-07 10:46:26 +01:00
Philip Müller
72d742e2f4
[machineid] Use same approach as we do in Manjaro
- See also https://gitlab.manjaro.org/applications/calamares/commit/da8f45ae
- Fixes #1314
2020-02-07 10:34:01 +01:00
Philip Müller
c766a0f10f
[machineid] create dbus var-lib folder when not existing
See also #1314
2020-02-07 10:26:36 +01:00
Adriaan de Groot
53b6113c75 [welcome] Fix QML tests 2020-02-05 18:38:46 +01:00
Adriaan de Groot
eaea262449 Merge branch 'master' into qml 2020-02-05 18:03:31 +01:00
Adriaan de Groot
4b3f7eb209 [calamares] Local translations can be a separate setting
- Don't stick this in Settings, though, it becomes overly complicated.
2020-02-05 17:48:39 +01:00
Adriaan de Groot
24c2c435a0 [libcalamares] Try repairing tests
- Fail on FreeBSD with an instant timeout
2020-02-05 17:08:47 +01:00
Adriaan de Groot
4525060c26 [calamares] Refactor Settings initialization
- add a Settings::init() to do actual work
 - remove the same kind of code from CalamaresApplication
 - make constructor of Settings private
 - initialize settings before the application
2020-02-05 16:48:49 +01:00
Adriaan de Groot
68e8b0695d [calamares] Make declaration order match calling order 2020-02-05 16:14:56 +01:00
Adriaan de Groot
db80a34aca [calamares] Remove intermediate debug-settings
- There's a multi-stage setup for debug-mode, where the application
   object also knows that debugging is set. Remove it.
 - Break debug mode (because now the settings don't get debug-mode set).
 - Refactor so that parameter handing is only done if this Calamares
   is the unique (first) Calamares.
2020-02-05 16:10:41 +01:00
Adriaan de Groot
50b6801d35 [calamares] Install translator after loading settings
- means that also the *initial* translation can take settings
   into account, like -d loading local translations.
2020-02-05 14:33:42 +01:00
Adriaan de Groot
f233cac7a1 [calamares] Refactor debug-logging settings 2020-02-05 14:23:55 +01:00
Adriaan de Groot
ea8adc3de7 [calamares] Simplify return from main 2020-02-05 14:04:52 +01:00
Adriaan de Groot
af862336a8 [calamares] Initialize settings before QML 2020-02-05 13:50:18 +01:00
Adriaan de Groot
91625c8ba8 [libcalamares] Tidy up boolean options in Settings
- The const getters for a single boolean value have moved
   to the header, for inlining.
 - Document the getters and what their settings mean.
2020-02-05 13:35:26 +01:00
Calamares CI
8c0ef5798d i18n: [dummypythonqt] Automatic merge of Transifex translations 2020-02-04 22:19:48 +01:00
Adriaan de Groot
d956c79291 [libcalamares] Load translations from more places
- To support translation testing, without needing to recompile
   Calamares, load files from the local directory when debugging,
   or from /usr/share/calamares/lang/ in general.
 - This allows updating translations and testing them with just
   lrelease (a translation build tool) installed, without rebuilding
   Calamares.
 - This allows distro's to ship updated or modified translations without
   rebuilding Calamares.
2020-01-30 19:06:33 +01:00
Adriaan de Groot
02e5e0de5e [users] Use entropy service.
FIXES #1254
2020-01-30 10:32:34 +01:00
Adriaan de Groot
5b987d4f33 [machineid] Use entropy service
- Most of the code was error-checking, just replace the open-read
   with a call to the service instead.
 - It's not an error if /dev/urandom doesn't exist in the source system
   (there may be other good random sources, and otherwise we have the
   low-quality random fallback).
2020-01-30 10:32:27 +01:00
Adriaan de Groot
c971127b17 [machineid] Fix entropy-file return
- If the file was created and written, it would drop out of the
   if() and return an error anyway.
2020-01-30 10:08:55 +01:00
Adriaan de Groot
e56948cefa [libcalamares] Fix tests (cell is the lower unicode byte) 2020-01-29 16:41:17 +01:00
Adriaan de Groot
be0831ee11 [libcalamares] Add printable-entropy (e.g. for password salt) 2020-01-29 16:39:25 +01:00
Adriaan de Groot
8947f9c00c [libcalamares] Test the Entropy service 2020-01-29 16:16:12 +01:00
Adriaan de Groot
a574b43eb8 [libcalamares] Also report empty buffer as no-entropy 2020-01-29 16:08:33 +01:00
Adriaan de Groot
842a90e026 [libcalamares] Add an Entropy service for getting random data
- Tries to get the "best" random data
 - Reports the quality of the random data it got
2020-01-29 16:03:50 +01:00
Adriaan de Groot
94083edf9c Merge branch 'master' into kpmcore-manager 2020-01-29 12:55:46 +01:00
Adriaan de Groot
252ce70203 i18n: updated (English) source files 2020-01-29 11:42:04 +01:00
Adriaan de Groot
b38ae75bef Merge branch 'translate-checks' 2020-01-29 11:11:32 +01:00
Adriaan de Groot
8f581ca861 [welcome] Coding style
- apply coding style, add {}
 - remove unneeded includes (moved to the widgets)
 - update copyright
2020-01-29 11:10:30 +01:00
Adriaan de Groot
a09593e4a2 [locale] Tighten up language-matching
- Drop plain startsWith() matching, since we now have "as" and "ast"
   as supported languages, where one name is a prefix of the other.
2020-01-28 17:35:54 +01:00
Adriaan de Groot
49690fc681 [locale] Remove superfluous code
- the list is already filtered for UTF-8, so this is redundant
 - this *incidentally* fixes the problem with Assamese and Asturian,
   since Assamese (as_IN) was having its only entry removed,
   after which it would match Asturian (ast_ES)
2020-01-28 16:41:15 +01:00
Adriaan de Groot
97f622e094 [locale] Use standard algorithms 2020-01-28 15:50:08 +01:00
Adriaan de Groot
6b77d5db4a [welcome] Add detail messages for root and screen checks
- these were empty, so the widgets were hidden in the details
   dialog of the requirements check; which looks really strange
   if the reason the check fails is because root is required,
   and you can't see that in the details.

This commit is on a branch because it changes strings, and I want
to do a release Real Soon and not annoy the translators.
2020-01-28 15:24:29 +01:00
Adriaan de Groot
ad4ac1d25c [welcome] Update copyrights 2020-01-28 14:23:38 +01:00
Adriaan de Groot
9d69d0a893 [welcome] Remove unused variables 2020-01-28 14:21:02 +01:00
Adriaan de Groot
1ac4786365 [welcome] Move all the translation work to the slot
- this needs to (re)check the satisfaction states to figure out the
   message, but that's useful if the state of the checks changes
   (e.g. in #1106)
2020-01-28 14:15:57 +01:00
Adriaan de Groot
221a79b64c [welcome] Simplify logic
- \not mandatorySatisfied \implies \not requirementsSatisfied,
   so the ifs can be combined and simplified
2020-01-28 13:58:08 +01:00
Adriaan de Groot
28d91979c3 [welcome] Make resultWidgets less error-prone
- instead of counting and needing to keep track of the predicate
   applied while creating the widgets, push nullptrs to the widget
   list instead reflecting "this entry did not satisfy the predicate
   for widget creation".
2020-01-28 13:50:23 +01:00
Adriaan de Groot
39534325e6 [welcome] Re-use widget creation code
- for the list, the code can be the same as for the dialog,
   only the predicate is different.
 - while here, implement retranslate() since there's no text on
   the list widgets otherwise.
2020-01-28 13:39:27 +01:00
Adriaan de Groot
38d58e5b16 [welcome] Hoist explanatory-label code
- Create the label once, and it's ok for it to respond to links
   even if there's none in the code.
 - Turn into a member variable in preparation for retranslation-refactor.
2020-01-28 13:32:53 +01:00
Adriaan de Groot
b476e4b386 [welcome] Refactor link-clicking
- remove intermediate lambda
 - rename dialog slot to one handling links in general (which now
   **only** does the dialog link)
2020-01-28 13:24:01 +01:00
Adriaan de Groot
ecc7719abd [welcome] Hoist checking for requirements-satisfied
- lift it out of the loop that creates the widgets
 - some lambda-wankery, but the compiler hammers this down to
   simple loops and you can read the resulting code as

	none_of  [the list]  isUnSatisfied
	none_of  [the list]  isMandatoryAndUnSatisfied
2020-01-28 13:13:09 +01:00
Adriaan de Groot
f5c0e57f17 [welcome] Improve variable naming
- these two are about whether all the checkEntries are satisfied
   (in general, and the mandatory ones) so make the names reflect that.
2020-01-28 13:02:39 +01:00
Adriaan de Groot
5795801be5 [welcome] Remove unneeded member variables.
- local to the constructor, only needed to be members because
   of the weird split between constructor and init()
2020-01-28 13:00:21 +01:00
Adriaan de Groot
5aae736ced [welcome] Create ResultWidget in separate method 2020-01-28 12:53:19 +01:00
Adriaan de Groot
bede280f91 [welcome] Refactor ResultsListWidget
- no point in having init() called immediately after the constructor,
   if it only makes sense to have one call to init() ever to create
   the widget.
 - while here, give it the same kind of structure as the dialog,
   holding on to a reference to the list.
2020-01-28 12:41:36 +01:00
Adriaan de Groot
320dcac946 [welcome] Drop unneeded member variable 2020-01-28 12:23:53 +01:00
Adriaan de Groot
ed1b3b576f [welcome] Refactor ResultsListDialog
- drop useless debugging
 - add documentation
 - move to its own spot in the file (not mixed in with ResultsListWidget)
2020-01-28 12:21:22 +01:00
Adriaan de Groot
41ac21bdcd [welcome] Refactor results-details dialog
- Factor out the "details" dialog into a separate class
   with a translation slot. This resolves the crash reported in #1307.
2020-01-27 19:35:41 +01:00
Calamares CI
a017451607 i18n: [dummypythonqt] Automatic merge of Transifex translations 2020-01-27 16:40:04 +01:00
Calamares CI
ae2536a9c3 i18n: [dummypythonqt] Automatic merge of Transifex translations 2020-01-25 23:26:40 +01:00
Adriaan de Groot
39cc13cb25 [shellprocess] Tidy code
- resolve TODO, use a unique_ptr to hang onto the command-list
 - sort the #includes, use correct quoting
2020-01-25 15:23:10 +01:00
Adriaan de Groot
71a73ee1a1 [libcalamares] PythonJob created with InstanceKey 2020-01-25 15:15:32 +01:00