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 18:38:42 +0100
ack
On Thu, Nov 3, 2011 at 6:35 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 | 64 +++++++++++++++++++++++++++++++------------------------
> 1 files changed, 36 insertions(+), 28 deletions(-)
>
> diff --git a/src/wizard.vala b/src/wizard.vala
> index 6bae45c..03c5faa 100644
> --- a/src/wizard.vala
> +++ b/src/wizard.vala
> @@ -35,34 +35,38 @@ private class Boxes.Wizard: Boxes.UI {
> private WizardPage page {
> get { return _page; }
> set {
> - switch (value) {
> - case WizardPage.INTRODUCTION:
> - next_button.sensitive = true;
> - break;
> + var forwards = value > page;
>
> - case WizardPage.SOURCE:
> - // reset page to notify deeply widgets states
> - wizard_source.page = wizard_source.page;
> - break;
> + if (forwards) {
> + switch (value) {
> + case WizardPage.INTRODUCTION:
> + next_button.sensitive = true;
> + break;
>
> - case WizardPage.PREPARATION:
> - try {
> - prepare ();
> - } catch (GLib.Error error) {
> - warning ("Fixme: %s".printf (error.message));
> - return;
> - }
> - break;
> + case WizardPage.SOURCE:
> + // reset page to notify deeply widgets states
> + wizard_source.page = wizard_source.page;
> + break;
>
> - case WizardPage.REVIEW:
> - review ();
> - break;
> + case WizardPage.PREPARATION:
> + try {
> + prepare ();
> + } catch (GLib.Error error) {
> + warning ("Fixme: %s".printf (error.message));
> + return;
> + }
> + break;
>
> - case WizardPage.LAST:
> - if (!create ())
> - return;
> - app.ui_state = UIState.COLLECTION;
> - break;
> + case WizardPage.REVIEW:
> + review ();
> + break;
> +
> + case WizardPage.LAST:
> + if (!create ())
> + return;
> + app.ui_state = UIState.COLLECTION;
> + break;
> + }
> }
>
> if (skip_page (value)) {
> @@ -249,10 +253,14 @@ private class Boxes.Wizard: Boxes.UI {
> }
>
> private bool skip_page (Boxes.WizardPage page) {
> - // remote-display case
> - if (page > Boxes.WizardPage.SOURCE &&
> - page < Boxes.WizardPage.REVIEW &&
> - this.source != null)
> + var backwards = page < this.page;
> +
> + if (backwards) {
> + if (page == Boxes.WizardPage.PREPARATION)
> + return true;
> + } else if (this.source != null && // remote-display case
> + page > Boxes.WizardPage.SOURCE &&
> + page < Boxes.WizardPage.REVIEW)
> return true;
>
> // FIXME: other cases here
> --
> 1.7.7
>
> _______________________________________________
> gnome-boxes-list mailing list
> gnome-boxes-list gnome org
> http://mail.gnome.org/mailman/listinfo/gnome-boxes-list
>
--
Marc-André Lureau
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]