Commit Graph

5315 Commits

Author SHA1 Message Date
Camilo Higuita
2d09557297 update wlecome to latest 2020-03-24 09:26:24 -05:00
Adriaan de Groot
71b55995ee [dummypython] Fix up progress reporting
- It's annoying to have 100% progress reported (from the processing
  of list items) and then have another 3 seconds delay.

Unrelated to the issue-at-hand, but spotted in testing.
2020-03-24 15:23:40 +01:00
Adriaan de Groot
1d30c99d89 [libcalamaresui] The ExecutionViewStep is done when the queue is
- While the queue is running, pretend that the EVS is not at the
  last page.

FIXES #1351
2020-03-24 15:19:45 +01:00
Adriaan de Groot
184462a875 [libcalamares] Make status of JobQueue queryable
- while the queue is executing (the thread is running jobs) the
  isRunning() method returns true.
- re-work some internals to reset isRunning() before emitting
  finished() signal.
2020-03-24 15:14:38 +01:00
Adriaan de Groot
112895fddc [libcalamares] Keep jobIndex in-sync with the jobs
- Never skip updating the jobIndex, because it is used in emitProgress()
  to find which job to ask for status.
2020-03-24 15:06:34 +01:00
Adriaan de Groot
1ec7251275 [libcalamares] Make isAtVeryEnd() internal 2020-03-24 14:57:36 +01:00
Adriaan de Groot
1eec1a9fe7 [libcalamares] Fix typo in API
- "asynchronouse" is not a thing
2020-03-24 13:43:19 +01:00
Adriaan de Groot
f5b4e5d5e1 [netinstall] Add data-loading to the Config object
- Mostly copied from NetInstallPage
2020-03-24 13:13:18 +01:00
Adriaan de Groot
938536c0c3 [netinstall] Allow post-creation loading of model data
- Instead of loading all in the constructor, provide a public
  setupModelData().
- This allows creating the model and setting it for UI, before
  the load completes.
2020-03-24 12:36:31 +01:00
Adriaan de Groot
5e03df723c [netinstall] Add a (stub) Config object
- Add initial definition of Config object, which will extract the model-
  setting and loading code from the page, and which is also prep-work
  for a QML version of this module.
- While here, remove superfluous code
2020-03-24 12:05:48 +01:00
Adriaan de Groot
cf59e2884a [welcome] Reduce warnings from moc-generated code 2020-03-24 12:04:26 +01:00
Adriaan de Groot
1a5c916923 [netinstall] Implement local loading of packages
- For a static list of selectable packages (e.g. what you might otherwise
  use file:/// for with a static file on the ISO) you can now stick the
  list in the config file itself, simplifying some setups.
- Also saves faffing about with network.

SEE #1319
2020-03-24 11:35:58 +01:00
Adriaan de Groot
f59cae2dbb [netinstall] Document local URL
- `local` is supposed to read from the config-file, rather than
  externally; this simplifies examples, makes it easier to have
  multiple netinstalls, and condenses the documentation.
2020-03-23 17:20:14 +01:00
Adriaan de Groot
fa28788f78 [netinstall] Build the model from QVariantList always 2020-03-23 17:20:14 +01:00
Adriaan de Groot
ebc1db6a7b [netinstall] Test loading of a whole (example) file 2020-03-23 17:20:14 +01:00
Adriaan de Groot
f592a3f373 [netinstall] Expand tests to include group-checking
- Check groups
- Check whole treemodels recursively (this is not in PackageTreeItem,
  because that explicitly ignores the tree structure).
- Also a stub of checking example files (from the src dir)
2020-03-23 17:19:32 +01:00
Adriaan de Groot
025ab8b524 [netinstall] Be explicit about checkedness-to-bool conversions 2020-03-23 17:19:32 +01:00
Adriaan de Groot
0e2b3986b9 [netinstall] Use explicit accessor for the type-of-item 2020-03-23 17:19:32 +01:00
Adriaan de Groot
f7191ac29e [netinstall] Compare two PackageTreeItems
- Packages and groups check different fields for equality.
- Selected-state is **not** part of equality.
- Also operator !=
2020-03-23 17:19:15 +01:00
Adriaan de Groot
52d3f4417f [netinstall] Add explicit isGroup()
- Previously you would either need to know where in the tree a
  PackageTreeItem was, or guess that an empty packageName() means that
  it's a group.
2020-03-23 17:19:14 +01:00
Adriaan de Groot
bca316299e [netinstall] Add tests
- Just some simple tests for the Items
- Test creation of package group from variant
- This needs Qt5::Gui to link because QStandardItem is a GUI class,
  although we can run the tests without a GUI.
2020-03-23 17:19:00 +01:00
Adriaan de Groot
dc403237f2 [netinstall] Build model from QVariantList
- As an alternative to the YAML-wranging, build the model from
  a QVariantList instead.
- Expose this as a constructor, too.
2020-03-23 17:18:44 +01:00
Adriaan de Groot
4143ad67af [netinstall] Remove superfluous code
- The constructor for PackageTreeItem now takes over the selected
  state from the parent.
2020-03-23 17:18:44 +01:00
Adriaan de Groot
c7b646315a [netinstall] Add immutable to groups settings 2020-03-23 17:18:44 +01:00
Adriaan de Groot
4cb2ed9552 [netinstall] Chase removal of ItemData
- Simplify creation of PackageTreeItems by interpreting the
  YAML directly (instead of via ItemData),
- Simplify list types,
- Drop superfluous API.
2020-03-23 17:18:44 +01:00
Adriaan de Groot
c66ef5a201 [netinstall] Refactor: kill ItemData
- This doesn't compile right now.
- The nested class ItemData doesn't do anything useful or
  meaningful that having model items with the right data wouldn't.
2020-03-23 17:18:44 +01:00
Adriaan de Groot
8825c9c995 [netinstall] Apply coding style 2020-03-23 17:18:44 +01:00
Adriaan de Groot
1718f7a8a8
Merge branch 'master' into partition-type 2020-03-23 17:09:44 +01:00
Adriaan de Groot
377a78a405
Merge pull request #1347 from gportay/partition-name
[partition] Name partition using filesystem label
2020-03-23 16:59:01 +01:00
Adriaan de Groot
74aaccda15
Merge pull request #1341 from gportay/filesystem-features
[partition] Add support for filesystem-specific features (KPMCore 4.2.0 required)
2020-03-23 16:57:22 +01:00
Adriaan de Groot
54356a22ba [fsresizer] Chase API change in tests
- Missed this earlier because the module is not enabled in FreeBSD.
2020-03-23 16:54:23 +01:00
Gaël PORTAY
15cce29a51 [partition] Add support for filesystem-specific features 2020-03-22 09:25:26 -04:00
Gaël PORTAY
c5ebe13aeb [partition] Add support for partition type 2020-03-22 09:05:32 -04:00
Gaël PORTAY
cba4d2e93b [partition] Name partition using filesystem label 2020-03-21 23:46:20 -04:00
Adriaan de Groot
3b0c0435bc [libcalamaresui] Chase API change in Yaml
- We can drop a bunch of calls to toMap() now.
2020-03-20 21:55:03 +01:00
Adriaan de Groot
1678a03cb3 [libcalamares] Tighten up types
- If we're converting a YAML map to a QVariant (Map), may as well
  express that in the types. This makes the return from, say,
  `yamlMapToVariant()` cheaper, but incurs conversion in
  `yamlToVariant()` .. previously the place for costs was
  swapped around.
- For those cases that want-and-expect a Map, or List, this makes
  the calls slightly cheaper. For the generic case, the costs move
  around internally.
2020-03-20 21:25:42 +01:00
Adriaan de Groot
2eb84e2de1 [partition] [tracking] [welcome] Missing Q_OBJECT
- These aren't strictly necessary for the code, but they
  help with translations.
2020-03-19 00:37:37 +01:00
Adriaan de Groot
d65e0fb4c8 [libcalamares] Fix build with GCC
- <memory> isn't implicitly-included for std::unique_ptr
2020-03-19 00:08:20 +01:00
Adriaan de Groot
9fe679dca8 Merge commit 'afc0c78b4c01ac734b9877b11ae94597c685d804'
Pull in the instance-weight changes and type-improvements,
but not the part where special-casing of unsquash is dropped:
weights are still per-job, not per-module.
2020-03-18 23:58:00 +01:00
Calamares CI
2eff1f0e78 i18n: [dummypythonqt] Automatic merge of Transifex translations 2020-03-18 23:41:19 +01:00
Gabriel Craciunescu
47c167dc04 [bootloader] Resume from outer swap partition
- These fixes are similar to the other swap-from-LUKS changes,
  and just needed to be applied to a different module.
2020-03-18 17:21:20 +01:00
Gabriel Craciunescu
65a989d3cd [grubcfg] With LUKS, resume from the correct swap name
FIXES #1208
2020-03-18 17:12:33 +01:00
Adriaan de Groot
489fd0b272 [welcomeq] Fix QML import
- Now using the properly-namespaced QML import for Calamares things
2020-03-18 11:12:15 +01:00
Adriaan de Groot
cd7884a0e5 [welcomeq] Fix build with clang
- can't convert lambda-with-captures to a function pointer (Clang 9)
- instead, use a context property .. QmlViewStep already sets a
  "config" property with the Config object, but WelcomeQ wants it
  as another name as well.
- this avoids registering the Welcome object across all QML pages,
  as well.

NOTE: needs to have the QML adjusted for this change.
2020-03-18 11:02:35 +01:00
Adriaan de Groot
c4324fd3ea [libcalamaresui] Provide convenience method for context properties 2020-03-18 11:02:16 +01:00
Adriaan de Groot
3f87cc214a [calamares] Warnings--
- Set the width of the QML sidebar explicitly
- Handle all sidebar-flavor enum values explicitly
2020-03-18 10:39:16 +01:00
Adriaan de Groot
afc0c78b4c [libcalamares] Refactor job-weight computations
- only check index-vs-length once
2020-03-16 17:25:27 +01:00
Adriaan de Groot
07da6e3905 [libcalamares] Expand instance with weight 2020-03-13 02:59:09 +01:00
Adriaan de Groot
e37809a126 [libcalamares] Detailed InstanceDescription type 2020-03-13 02:55:38 +01:00
Adriaan de Groot
0e68013bb3 [libcalamares] Start making InstanceDescription a stronger type
- Replace a map-of-strings with a class type.
- For now, doesn't compile.
- Intention is to construct from a YAML / QVariant from the
  *instances* list in `settings.conf`.
2020-03-13 02:41:42 +01:00
Adriaan de Groot
3897bd54df Changes: write some of the QML docs
- Fix references; I decided to put it in Qml.h, which is
  the header for the code that does the work.
2020-03-12 17:37:39 +01:00
Adriaan de Groot
4576cb4fa0 [notesqml] Fix up documentation pointers 2020-03-12 17:30:08 +01:00
Adriaan de Groot
aeffda945f [calamares] Use the ViewManager model to show steps 2020-03-12 15:38:49 +01:00
Adriaan de Groot
b5a09d2f83 [branding] Don't hide the sidebar by default 2020-03-12 05:00:03 +01:00
Adriaan de Groot
cec406e402 [calamares] Add a sample QML-sidebar
- The built-in one is loaded if no branding file is found.
- This sidebar is just the most basic of QML examples.
2020-03-12 04:59:01 +01:00
Adriaan de Groot
cc3b0b2859 [calamares] Remove cruft from CMakeLists.txt 2020-03-12 04:48:07 +01:00
Adriaan de Groot
32ebb08788 [calamares] Search for sidebar QML file
- change name to "calamares-sidebar" so it's clear that
  it is a core component.
2020-03-12 04:21:03 +01:00
Adriaan de Groot
8d6e3e547c [libcalamaresui] Add qmlSearch for non-modules
- Refactor into a support method and two API points
- Use std::transform for doing-things-to-a-list
- Add searchQmlFile that only takes a name, for
  non-modules to use.
2020-03-12 04:17:48 +01:00
Adriaan de Groot
0fd7fec25e [libcalamaresui] Move registration into Qml-service
- Registration of QML modules may need to be done
  for more parts of Calamares. Move into the library,
  out of the model.
- Register for QML when using the QML sidebar.
2020-03-12 03:45:14 +01:00
Adriaan de Groot
c628192163 Merge branch 'progress-model' 2020-03-11 19:39:58 +01:00
Adriaan de Groot
a0b4d58000 [calamares] The very simplest of QML sidebars 2020-03-11 19:39:28 +01:00
Adriaan de Groot
a834d67283 [notesqml] Adjust to new name for Branding 2020-03-11 17:42:19 +01:00
Adriaan de Groot
28c2da12ae [libcalamaresui] Register in io.calamares namespace
- Register both Branding and ViewManager for QML
- Note that this changes the name of Branding
- Add code-docs about object ownership
2020-03-11 17:40:03 +01:00
Adriaan de Groot
7a8eb09cdb [libcalamaresui] Move QML-searching
- This is utility code, so it can be in the QML "service"
  from Calamares, rather than in the QmlViewStep itself.
  That makes it usable for other QML bits as well.
2020-03-11 17:12:02 +01:00
Adriaan de Groot
7d99ad3177 [welcomeq] Adjust to Config-API that QmlViewStep expects 2020-03-11 16:49:07 +01:00
Adriaan de Groot
862b05221d [libcalamaresui] Drop 'name' parameter in QmlViewStep
- The name is just the module identifier, and now we
  search for *m@i* and also *m* from that identifier,
  the name becomes much less important -- and it
  can be set from the config key *qmlFilename* as well.
2020-03-11 15:57:08 +01:00
Adriaan de Groot
8f1ab99190 [libcalamaresui] Search module name as well
- When searching for QML file, obey module name
  (full instance, module-only) and then others.
2020-03-11 15:53:01 +01:00
Adriaan de Groot
165bcfd75d [libcalamaresui] "namespace" QML settings
- To avoid name-collisions in otherwise well-behaved
  modules and configurations, make the QML settings
  more specific:
    search -> qmlSearch
    filename -> qmlFilename
2020-03-11 15:36:42 +01:00
Adriaan de Groot
0f50dc8d33 [welcomeq] Include the QML search mode 2020-03-11 15:23:37 +01:00
Adriaan de Groot
8302f2182b [welcomeq] The QML file name still has a q 2020-03-11 15:21:46 +01:00
Camilo Higuita
d26fa63ccd [welcomeq] initial work for welcomeview in qml 2020-03-11 14:48:14 +01:00
Camilo Higuita
d7f7c16958 [welcome] using config for both qcc2 or qwidgets 2020-03-11 14:48:06 +01:00
Adriaan de Groot
4ab5b4a5e6 [calamares] Progress"tree" is a list
- No need for a TreeView when it's just a one-dimensional
  list of items.
2020-03-11 05:02:06 +01:00
Adriaan de Groot
99c03f7fbb [libcalamaresui] Behave better as a model 2020-03-11 05:01:39 +01:00
Adriaan de Groot
8f0a6d3065 [calamares] The ViewManager is its own model
- Having a ProgressTreeModel that does nothing but
  proxy to ViewManager methods is kind of useless.
- Move the relevant code from ProgressTreeModel to
  ViewManager.
- Remove now-unused ProgressTreeModel.
2020-03-11 04:49:38 +01:00
Adriaan de Groot
b209668d33 [calamares] Fix singleton-ness of the progress view
- Create the ViewManager earlier,
- Create a ProgressTreeModel here for the view,
- Do not weirdly set the model much later.
2020-03-11 04:37:10 +01:00
Adriaan de Groot
290a708e56 [calamares] No need for progresstreeview to be singleton 2020-03-10 21:26:05 -05:00
Adriaan de Groot
e9965d37e3 [calamares] Don't create sidebar if we don't want it 2020-03-10 18:05:24 -05:00
Adriaan de Groot
80f49bed1d [libcalamaresui] Add a sidebar flavor setting 2020-03-10 17:59:06 -05:00
Adriaan de Groot
9a63d63d5b [calamares] Factor out the creation of the sidebar 2020-03-10 17:13:19 -05:00
Adriaan de Groot
04cb5f14f7 [calamares] Role names for progress model 2020-03-10 16:56:22 -05:00
Adriaan de Groot
ba4b42b4ee [calamares] Introduce a "completed" role
- This is for future support of a QML progress view
2020-03-10 16:52:34 -05:00
Adriaan de Groot
d3f55af51e [calamares] Clean up progress tree model
- It's still not a real tree
- Remove unused classes / files
- Apply coding style
2020-03-10 14:13:18 -05:00
Adriaan de Groot
76144fb3dc [calamares] Remove superfluous ViewStepItem
- The model is a simple list, not a tree (it may have been in the
  distant past).
- All the information needed comes from the ViewSteps held by the
  ViewManager.
- The delegate and fake-step handling was never used.
2020-03-10 14:06:35 -05:00
Adriaan de Groot
5a59eb1963 [calamares] Remove unused method from progresstreemodel 2020-03-10 13:43:04 -05:00
Adriaan de Groot
7ec6dff352 [calamares] Apply coding style to progresstree 2020-03-10 13:30:43 -05:00
Adriaan de Groot
e2d9ce737c [netinstall] Implement pre-expanded groups
- Return relevant data
- Document code
- Add to README.md documentation about new key
2020-03-10 12:59:41 -05:00
Adriaan de Groot
b9b48cfbb1 [netinstall] Apply coding style
- Some missing {} were not noticed by astyle
2020-03-10 12:49:12 -05:00
Adriaan de Groot
4f216b0394 [netinstall] Refactor model-data setting
- Introduce convenience methods getString(), getBool() to pick
  out an entry from item definitions in YAML format.
- Apply coding style.
- Pick up the "expanded" property as well.
2020-03-10 12:46:49 -05:00
Adriaan de Groot
0f7f5216ee [netinstall] isHidden is const after construction 2020-03-10 12:39:35 -05:00
Adriaan de Groot
b074696ac1 [netinstall] isCritical is const after construction 2020-03-10 12:38:11 -05:00
Adriaan de Groot
09006a936d [netinstall] Expand groups if requested 2020-03-10 12:37:57 -05:00
Adriaan de Groot
4f22a70b08 [netinstall] Restructure model-method data() 2020-03-10 12:30:33 -05:00
Adriaan de Groot
df86972ea7 [netinstall] Introduce constexpr names for columns and roles 2020-03-10 12:22:56 -05:00
Adriaan de Groot
3d68c74a19 [netinstall] Sanitize PackageTreeItem::data()
- Use of != nullptr for QString just a bad idea
- Massage code so structure for packages resembles that of groups
2020-03-09 22:46:59 -05:00
Adriaan de Groot
201c5ddfe1 [netinstall] Add some debug-logging
- Also, prepare for a start-expanded setting
2020-03-09 22:44:16 -05:00
Adriaan de Groot
4cf3ec8663 [netinstall] Resolve TODO (changes translations) 2020-03-09 22:01:39 -05:00
Adriaan de Groot
3302fe319b [netinstall] Fix typo's in README 2020-03-09 21:58:30 -05:00
Adriaan de Groot
220fd31226 [partition] Improve EncryptionWidget
- Use normal translation framework. The EncryptWidget was the one place
  not using the "usual" translation framework, but rolled its own.
- Emphasize that the checkbox-state (checked-ness) is the parameter,
  not a state of the EncryptWidget.
- All other instances of UI classes from Designer use a pointer-to-UI,
  not multiple inheritance.
- Convenience method for setting the pixmap in response to
  changes in the passphrase
- Tighten up types: enum -> enum class
- Reduce the scope for int-confusion by using an enum-class for
  the encryption state of the widget
- Include UI implementation header only in .cpp
- Apply coding style
- Update copyright
2020-03-09 21:43:14 -05:00
Adriaan de Groot
1299c64415 [interactiveterminal] Tidy up includes
- The KF5/ part of the path isn't necessary, and some of the KF5
  includes can be found with a shorter name (with modern ECM and
  imported targets)
2020-03-09 21:13:19 -05:00
Adriaan de Groot
350627172d [partition] Tidy up includes 2020-03-09 21:09:24 -05:00
Adriaan de Groot
c5b038587e [welcome] Tidy up includes 2020-03-09 21:07:12 -05:00
Adriaan de Groot
ebb3f319cc [modules] Be more consistent in include punctuation
- Use <> for Qt, system, externals
 - Use double-quotes for Calamares headers
2020-03-09 21:05:15 -05:00
Adriaan de Groot
841ea9ff48 [libcalamares] Tidy up includes
- Remove commented-out includes
- Consistent punctuation
2020-03-09 21:05:15 -05:00
Adriaan de Groot
c4bfad9399 [packages] Provide status feedback
- The status message should be updated; the name is constant.

FIXES #1330
2020-03-09 15:41:17 -05:00
Adriaan de Groot
ef249043f9 [libcalamares] call Python method only from Python thread 2020-03-09 15:39:35 -05:00
Adriaan de Groot
b4aaf85ccf [libcalamares] Call Python function if available for status 2020-03-09 15:13:40 -05:00
Adriaan de Groot
252089e372 [libcalamares] Refactor pretty_name() call
- Split out a general method-that-returns-string caller.
2020-03-09 15:01:07 -05:00
Adriaan de Groot
ed4cdbeacc [dummypython] Provide status 2020-03-09 14:53:22 -05:00
Adriaan de Groot
aa62ca639b [libcalamares] Start getting prettyDescription from Python 2020-03-09 10:34:57 -05:00
Adriaan de Groot
9b5a391c86 [libcalamares] Factor out Python helper
- the strange construction of Helper and treating it as a singleton
  can be factored out into a separate singleton-handling instance()
  function. The Helper should never be destroyed.
2020-03-09 10:05:01 -05:00
Adriaan de Groot
3025c5383b [libcalamares] Document the pretty*() functions for Jobs 2020-03-05 08:54:42 -05:00
Adriaan de Groot
6d29c19e3e [libcalamares] Progress is float 2020-03-04 21:40:40 -05:00
Adriaan de Groot
d3828a82fc [packages] Make dummy backend slower
- insert sleeps to make it slower (easier when testing)
- improve debug logging clarity by noting where the messages
  are coming from
2020-03-04 21:31:47 -05:00
Adriaan de Groot
0abde6f1a7 [libcalamares] Don't print funcinfo in continuations
- when a single function does more logging, it generally marks
  those as subsequent debug-messages (with Continuation, or SubEntry)
  and we don't need to print funcinfo for those, since it was already
  printed the first time.
2020-03-03 17:00:57 +01:00
Adriaan de Groot
5248a37eb3 [libcalamares] Add FUNC_INFO into all debug messages
- This is needlessly verbose
- Chase CreatePartitionTableJob which needs to bind to a temporary
2020-03-03 17:00:57 +01:00
Adriaan de Groot
3ddee8090c [libcalamares] Drop intermediate CLog class
- All the real work is done in CDebug, so remove the base class.
2020-03-03 17:00:57 +01:00
Adriaan de Groot
ae633c7e7b [removeuser] Remove superfluous formatting around logging 2020-03-03 14:35:15 +01:00
Adriaan de Groot
623a8c2d43 [removeuser] Port to C++
No changes in functionality; add a little description in the .conf file.
2020-03-03 14:28:28 +01:00
Adriaan de Groot
bfe45aea18 [netinstall] Warnings--, unused parameter 2020-02-27 23:19:55 +01:00
Adriaan de Groot
3df0878e43 [initramfs] Warnings--
Initializing the JobQuene (and hence Global Storage) and
the System instance is a bit odd, avoid unused-variable
warning with an ugly cast instead.
2020-02-27 23:18:28 +01:00
Adriaan de Groot
0793971d01 [libcalamares] Warnings--, unused variable 2020-02-27 23:18:13 +01:00
Adriaan de Groot
72dcf886bf [contextualprocess] Improve tests, fix off-by-one
- there's no string representation for a QVariantMap, so it
  won't be converted; in *debug* output it looks like there's a
  string there.
- off-by-one when diving into compound selectors, spotted by
  test, now fixed.
2020-02-27 22:44:49 +01:00
Adriaan de Groot
28bf4082b3 [contextualprocess] Tests for new lookup behavior 2020-02-27 22:34:46 +01:00
Adriaan de Groot
bdb208c079 [contextualprocess] Split API
In order to test some of the internals, split them into Binding.h.
This makes the interface visible for tests. The implementation
still lives in the same place.

While here, adjust the test to the changed **example** which
now lists an additional variable.
2020-02-27 18:40:17 +01:00
Adriaan de Groot
4a5b3e7bc8 [contextualprocess] Document new behavior for compound keys 2020-02-27 18:22:07 +01:00
Adriaan de Groot
d114a3dc21 [contextualprocess] Allow selection from GS with "var1.var2.var3" 2020-02-27 17:14:41 +01:00
Adriaan de Groot
f5522425f6
Merge pull request #1331 from PureTryOut/apk-support
[packages] Add apk (Alpine Linux package manager) support
2020-02-27 16:22:36 +01:00
Adriaan de Groot
54a4644893 [partition] Store filesystem types
- Write a new GS key filesystems_use, which is a map of filesystems
  in use on the target system.
2020-02-27 14:29:54 +01:00
Adriaan de Groot
d4b26bbaf0 [partition] Tighten up the types of internal methods 2020-02-27 13:49:02 +01:00
Calamares CI
29ba5c961d i18n: [dummypythonqt] Automatic merge of Transifex translations 2020-02-27 13:36:21 +01:00
Adriaan de Groot
b0abb99ee1 [libcalamares] Don't log useless FUNC_INFO for Python
- When a Python module calls utils.debug(), there's no point
  in logging the C++ funcinfo that passes the parameters on;
  don't use cDebug() with its attendant magic.
2020-02-27 13:24:23 +01:00
Adriaan de Groot
f818d4b446 [libcalamares] Log Q_FUNC_INFO as part of debug
- Warnings, errors, don't get funcinfo, but regular cDebug()
  calls do. Other special-cases, like calling Logger::CDebug()
  constructor explicitly, don't get funcinfo either.

FIXES #1328
2020-02-27 13:20:19 +01:00
Bart Ribbers
136d22188e
[packages] Add apk (Alpine Linux package manager) support 2020-02-27 12:58:53 +01:00
Adriaan de Groot
3456aabfce [libcalamares] Expand utility of list-logging
- Allow logging any QList type (needs explicit call in usage).
- Add a DebugList inheriting from DebugListT to keep existing
  code that logs QStringLists.
- For Calamares 3.3, consider using C++17 and class template deduction.
2020-02-27 11:59:24 +01:00
Adriaan de Groot
8f060a741f [calamares] Default to log-level 1 (not 8)
- This bug has been here since f233cac7a1,
  where a check for isSet() (of the -D option) was dropped. So since then,
  Calamares has always been running with full logging (-D8) on.
- The recently-added "easter egg" of showing the debug-button when
  log-level is 8 (to allow debugging-in-production) trips over the
  default-log-level of 8, so the debug-button is always visible.

So, minor bugs in the debugging-setup, combine to show a debug-button
when there shouldn't be one.

FIXES #1329
2020-02-27 11:38:50 +01:00
Adriaan de Groot
2db3b413f4 [libcalamares] Unmount with mount point, not device
- The manpage for umount says that -R can only be used with
  a mount point (e.g. /usr/local) and not a device name;
  this makes sense because a device might be mounted in multiple
  locations, but the mountpoint (and things mounted under it) lives
  in the filesystem tree.
- Existing code tried to unmount -R the device, not the mount point,
  and so always failed; leaving things mounted that shouldn't.
2020-02-24 20:58:02 +01:00
Philip Müller
0c8257df3d [initcpio] Don't claim other swap
From downstream ee99e34e25
2020-02-24 18:23:32 +01:00
Matti Hyttinen
717b8947d5
Update main.py
Unset GRUB_SAVEDEFAULT if / or /boot is in btrfs or f2fs partition. This avoids the error "sparse file not allowed" at boot time. Btrfs and f2fs do not support saving default entry in grub.
2020-02-24 17:49:56 +02:00
Adriaan de Groot
c20ac0836e [users] Take setRootPassword into account when hiding fields 2020-02-24 16:11:14 +01:00
Adriaan de Groot
7752cf31b3 [users] Improve documentation of setRootPassword 2020-02-24 15:59:52 +01:00
Adriaan de Groot
14979b1630 [libcalamares] TemporaryMount with backwards logic
- because mount() returns an exit code, and 0 is "success",
  the if (!code) was backwards: when mounting succeeded, the
  TemporaryMount object thought it failed.
- This leads to temp-mounts being left *all over* the place
  from os-prober and fstab-handling.
2020-02-24 15:21:31 +01:00
Adriaan de Groot
a865620f90 [calamares] Easter egg: running -D8 will show the Debug Information button 2020-02-24 14:47:10 +01:00
Adriaan de Groot
ee52e37b36 [libcalamares] Don't hard-code full paths
- See editorial in the code-comment. Still need to test that
   chroot(8) doesn't need a full path, otherwise this will
   go to /usr/bin/env udevadm to force lookup (redundantly
   if not in a chroot)
2020-02-24 13:15:13 +01:00
Adriaan de Groot
8c527ab592 [users] Overwrite host(s|name) files in target 2020-02-24 12:48:01 +01:00
Adriaan de Groot
4621937477 [users] Use right check on writing hostname
- !failed() also means "didn't write the file because it already
  exists", which is sometimes acceptable -- but not here.
  Use the more-strict bool() conversion, which is only when
  the file was actually written.
2020-02-24 12:44:50 +01:00
Adriaan de Groot
862b7e34df [libcalamares] Add tests for file-overwrite 2020-02-24 12:38:08 +01:00
Adriaan de Groot
f89951716e [libcalamares] Add mode to createTargetFile()
- Unconditionally **not** overwriting the target file isn't an option:
  writing hostname, for instance, expects that to be done even
  if `/etc/hostname` already exists on the target filesystem.
2020-02-24 12:14:50 +01:00
Adriaan de Groot
6a02f2cfec [machineid] Fix tests
- Make tests more resilient: do them in a temp-dir, and clean it
  up after successful tests. This was prompted by tests failing
  because of things hanging around in /tmp.
2020-02-21 19:21:58 +01:00
Adriaan de Groot
adf81c0ab5 [locale][packagechooser] Fix tests, QCOMPARE again 2020-02-21 18:24:39 +01:00
Adriaan de Groot
6352b50ed0 [initramfs] Fix more tests 2020-02-21 18:13:51 +01:00
Adriaan de Groot
e49fb74847 [libcalamares] Fix more tests 2020-02-21 17:58:55 +01:00
Adriaan de Groot
39cc43f26b [libcalamares] Fix tests
- QCOMPARE() is sensitive to differing types in actual and expected,
  and uchar and int (and mode_t and int) are different.
2020-02-21 17:53:43 +01:00
Adriaan de Groot
a78556b56a [unpackfs] Revert text mode
- Follow original patch from Gabriel Craciunescu: just drop
  the *bufsize* parameter and stick to binary reads.

Text mode was associated in my testing with multiple hangs,
which didn't show up during binary-reads.
2020-02-21 16:37:58 +01:00
Adriaan de Groot
248776144e [unpackfs] Now it's text, it's not encoded anymore 2020-02-21 12:39:26 +01:00
Calamares CI
aec6058dc5 i18n: [dummypythonqt] Automatic merge of Transifex translations 2020-02-20 22:59:17 +01:00
Adriaan de Groot
61ca6384cc [partition] Fix tests
- One of the files listed in the test has moved (to libcalamares),
- Don't bother with an extra intermediate SRCS variable.
2020-02-20 22:51:24 +01:00
Adriaan de Groot
6d0f5e4111 Merge branch 'kpmcore-manager' 2020-02-20 22:03:45 +01:00
Adriaan de Groot
a2d245ef92 Merge branch 'issue-swaps' 2020-02-20 22:00:52 +01:00
Adriaan de Groot
327c1c0e7b [unpackfs] Reading from the pipe is line-oriented
- Using bufsize=1 causes warnings, since we never bothered
  to explicitly set text mode.
2020-02-20 21:40:33 +01:00
Adriaan de Groot
7c7af28a0d [unpackfs] Make clear that the FS is unsupported by *this* kernel
Patch from Gabriel Craciunescu. FS support is determined be
the kernel, not by Calamares, so make that clearer in the message.
2020-02-20 21:17:33 +01:00
Adriaan de Groot
50161cdab9 [grubcfg] Use own swap
- In situations where there are more swap partitions, only use
  partitions this install "owns".
2020-02-20 16:59:05 +01:00
Adriaan de Groot
5247c13f98 [partition] Follow 'claimed' settings for claiming swap
- By the time the GS is actually written, new (for partition state)
  is always false. So "new" is the wrong thing to track. It should
  have had a better name anyway,
- We store custom properties on the partition objects to indicate
  what happens to them; use those properties (instead of state,
  as done originally), call it "claimed" to indicate that the partition
  is part of this installation.

For now, only new (as in, formatted, created-by-us) partitions are
claimed.

- The effect here is that only "new" swap will be added to the system,
  so in erase-disk installations, or manual partitioning.
- Install-alongside and replace will now **not** claim the swap already
  on the disk; I think we'll need another UI knob for that one.

FIXES #1316
2020-02-20 16:38:40 +01:00
Adriaan de Groot
35a2db064b [partition] Make debug-logging match the functionality
- `createPartitionList()` is called for the summary widget (via
  `prettyDescription()`), and from `exec()`. Only the latter
  actually *writes* to Global Storage, so it's misleading to
  think that the pretty-printed version ends up in GS.
- This makes the "new" key useless, since by the time `exec()` is called
  the partitoons are no longer new.
2020-02-20 11:59:48 +01:00
Adriaan de Groot
f9d9cd2df4 [fstab] Document the remapping of fs names
- Shuffle the code a little so it's clear where the remapping
  happens, and explain why we look for "swap" in fstab and
  "linuxswap" elsewhere.
2020-02-20 11:33:02 +01:00
Adriaan de Groot
8ecb364f8c [initramfs] Fix up tests
- These tests don't actually test anything in this specific module,
  they do test CalamaresUtils::System.
- Wrangling System and JobQueue and GlobalStorage instances is fraught
2020-02-19 22:42:46 +01:00
Adriaan de Groot
fba1bf7072 CMake: add DEFINITIONS option to calamares_add_test
- There's a handful of tests that need this, it's possible
  there will be more, so just add it to the infrastructure.
2020-02-19 22:26:55 +01:00
Adriaan de Groot
1bb43e06e2 Merge branch 'master' into kpmcore-manager 2020-02-19 18:34:44 +01:00
Adriaan de Groot
7cbc43616e [netinstall] Some more "standard" alternative labels
- Hide the labels from the compiler to avoid warnings
- Add some more labels proposed by ArcoLinux
2020-02-19 17:21:12 +01:00
Adriaan de Groot
5dac67b710 [notesqml] Cut down the example text to be translated. 2020-02-19 17:16:51 +01:00
Adriaan de Groot
2d754dac6d [notesqml] Rename example file to save translators 2020-02-19 17:15:40 +01:00
Adriaan de Groot
51ad7df31c [netinstall] Don't give the translators a bogus string 2020-02-19 17:13:01 +01:00
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