Re: [gnome-boxes 1/2] Skip 'Preparation' & 'Setup' when going backwards
- From: Marc-André Lureau <marcandre lureau gmail com>
- To: "Zeeshan Ali (Khattak)" <zeeshanak gnome org>
- Cc: gnome-boxes-list gnome org
- Subject: Re: [gnome-boxes 1/2] Skip 'Preparation' & 'Setup' when going backwards
- Date: Thu, 3 Nov 2011 17:38:03 +0100
hi
On Thu, Nov 3, 2011 at 5:25 PM, Zeeshan Ali (Khattak)
<zeeshanak gnome org> wrote:
> From: "Zeeshan Ali (Khattak)" <zeeshanak gnome org>
>
> Skip 'Preparation' and 'Setup' pages when going backwards in the wizard.
> ---
> src/wizard.vala | 10 ++++++++--
> 1 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/src/wizard.vala b/src/wizard.vala
> index 6bae45c..8ceb21d 100644
> --- a/src/wizard.vala
> +++ b/src/wizard.vala
> @@ -47,7 +47,8 @@ private class Boxes.Wizard: Boxes.UI {
>
> case WizardPage.PREPARATION:
> try {
> - prepare ();
> + if (value > page)
> + prepare ();
that's hard to read. perhaps it should be placed on top the function
to skip also other cases.
and use a variable backward = value <= page; for readibility.
> } catch (GLib.Error error) {
> warning ("Fixme: %s".printf (error.message));
> return;
> @@ -250,10 +251,15 @@ private class Boxes.Wizard: Boxes.UI {
>
> private bool skip_page (Boxes.WizardPage page) {
> // remote-display case
> - if (page > Boxes.WizardPage.SOURCE &&
> + if (page > this.page &&
> + page > Boxes.WizardPage.SOURCE &&
> page < Boxes.WizardPage.REVIEW &&
> this.source != null)
> return true;
That condition was pretty clear to me, skip that range if we have a
new source already:
if (Boxes.WizardPage.SOURCE < page < Boxes.WizardPage.REVIEW &&
this.source != null)
return true;
you added page > this.page which means going forward, correct? it also
needs to apply backward in this case (for source URI).
> + else if (page < this.page &&
> + page == Boxes.WizardPage.PREPARATION ||
> + page == Boxes.WizardPage.SETUP)
> + return true;
Which I translate to if going backward, always skip preparation &
setup. This doesn't seem to be correct, as you may want to change your
username in the Setup step.
--
Marc-André Lureau
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]