Skip to content

feat: export the app's service selection as a profile file - #68

Open
Interlap01 wants to merge 1 commit into
mainfrom
feat/export-app-profile
Open

Interlap01 wants to merge 1 commit into
mainfrom
feat/export-app-profile

Conversation

@Interlap01

Copy link
Copy Markdown
Contributor

Fixes #31.

The CLI can write a profile with the simslim profile wizard, but the macOS app had no way to save its selection. The Services to keep header now has an Export… button next to Full Slim. It opens a save panel and writes the selection that Apply would use as a profile file for simslim on, verify, and watch --profile.

  • Kept categories go in except, and individually kept daemons go in keep, both sorted.
  • A daemon that a kept category already covers is not listed again in keep, matching enable --save.
  • An empty selection writes {}, which is the default profile.
  • Each export is logged in the activity panel, and a failed write shows an error.
  • The README mentions it in the app feature list and in the Profile files section.

The file uses Foundation's pretty-printed JSON style ("except" : [). The CLI accepts it, though files the CLI writes look slightly different.

Testing

  • make check and make app pass.
  • I ran the app's AppModel (with the bundled CLI) in a harness on four selections: nothing kept; search and store; a daemon store already covers, kept again through icloud, plus one siri daemon; and every mdm daemon kept one by one. I loaded each exported file with LoadSlimProfile and compared Desired() to the daemons the app disables. All four match (173, 154, 153, and 150 disabled). The covered daemon is left out of keep, and mdm turns into an except entry. No simulators were booted or changed.
  • I haven't clicked the button in the running app. The save panel code compiles, but I haven't opened it by hand.

The Services to keep header gets an Export… button that saves the
selection Apply would use as a profile file for `simslim on --profile`.
A daemon a kept category already covers is not repeated in "keep", and
an empty selection writes {}, the default profile.

Fixes #31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SimSlim can't export the current macOS app selection into a profile file

1 participant