Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Commit

Permalink
Remove Wizard(Action).done (#1879)
Browse files Browse the repository at this point in the history
It was used to finish the telemetry report and write it on the disk but
that approach didn't work because Subiquity copies it to /target when it
finishes installing and it's too late to write anything from the GUI
when it gets closed. Also, writing any telemetry data from early exits
is irrelevant because it doesn't end up stored anywhere anyway.
  • Loading branch information
jpnurmi authored Apr 27, 2023
1 parent d7c2358 commit 5b471f0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ class InstallationCompletePage extends StatelessWidget {
child: ElevatedButton(
onPressed: () async {
final window = YaruWindow.of(context);
await Wizard.of(context).done();
model.reboot().then((_) => window.close());
},
child: Text(lang.restartNow),
Expand All @@ -67,11 +66,7 @@ class InstallationCompletePage extends StatelessWidget {
const SizedBox(width: kContentSpacing),
Expanded(
child: OutlinedButton(
onPressed: () async {
final window = YaruWindow.of(context);
await Wizard.of(context).done();
window.close();
},
onPressed: YaruWindow.of(context).close,
child: Text(lang.continueTesting),
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,7 @@ class NotEnoughDiskSpacePage extends StatelessWidget {
const SizedBox(height: kContentSpacing),
FilledButton(
onPressed: () async {
await Wizard.of(context).done();
if (context.mounted) {
YaruWindow.of(context).close();
}
YaruWindow.of(context).close();
// TODO: tell subiquity to quit?
},
child: Text(lang.quitButtonText)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,10 @@ class TryOrInstallPageState extends State<TryOrInstallPage> {
bottomBar: WizardBar(
leading: WizardAction.back(context),
trailing: [
WizardAction.done(
context,
WizardAction(
label: UbuntuLocalizations.of(context).nextLabel,
visible: model.option == Option.tryUbuntu,
onDone: YaruWindow.of(context).close,
execute: YaruWindow.of(context).close,
),
WizardAction.next(
context,
Expand Down
23 changes: 0 additions & 23 deletions packages/ubuntu_wizard/lib/src/widgets/wizard_action.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,29 +70,6 @@ class WizardAction {
);
}

/// An action that finishes the wizard.
factory WizardAction.done(
BuildContext context, {
String? label,
bool? visible,
bool? enabled,
bool? flat,
bool? highlighted,
Object? result,
WizardCallback? onDone,
bool root = false,
}) {
return WizardAction(
label: label,
visible: visible,
enabled: enabled,
flat: flat,
highlighted: highlighted,
onActivated: onDone,
execute: () => Wizard.maybeOf(context, root: root)?.done(result: result),
);
}

/// Text label of the back button.
final String? label;

Expand Down

0 comments on commit 5b471f0

Please sign in to comment.