Inheritance: System.Xml.XmlDocument
Esempio n. 1
0
        public void FinishPageCompleted ()
        {
            SelectedPreset  = Presets [0];
            PreviousUrl     = "";
            PreviousAddress = "";
            PreviousPath    = "";

            this.fetch_prior_history = false;
            this.saved_address     = "";
            this.saved_remote_path = "";
            this.current_page = PageType.None;

            WindowIsOpen = false;
            HideWindowEvent ();
        }
Esempio n. 2
0
        public void PageCancelled ()
        {
            PendingInvite   = null;
            SelectedPreset  = Presets [0];

            PreviousAddress = "";
            PreviousPath    = "";
            PreviousUrl     = "";

            this.saved_address     = "";
            this.saved_remote_path = "";
            this.fetch_prior_history = false;

            WindowIsOpen = false;
            HideWindowEvent ();
        }
Esempio n. 3
0
        public void SelectedPresetChanged (int preset_index)
        {
            SelectedPreset = Presets [preset_index];

            if (SelectedPreset.Address != null) {
                ChangeAddressFieldEvent (SelectedPreset.Address, "", FieldState.Disabled);

            } else if (SelectedPreset.AddressExample != null) {
                ChangeAddressFieldEvent (this.saved_address, SelectedPreset.AddressExample, FieldState.Enabled);

            } else {
                ChangeAddressFieldEvent (this.saved_address, "", FieldState.Enabled);
            }

            if (SelectedPreset.Path != null) {
                ChangePathFieldEvent (SelectedPreset.Path, "", FieldState.Disabled);

            } else if (SelectedPreset.PathExample != null) {
                ChangePathFieldEvent (this.saved_remote_path, SelectedPreset.PathExample, FieldState.Enabled);

            } else {
                ChangePathFieldEvent (this.saved_remote_path, "", FieldState.Enabled);
            }
        }
Esempio n. 4
0
        public SetupController ()
        {
            ChangePageEvent += delegate (PageType page_type, string [] warnings) {
                this.current_page = page_type;
            };

            PreviousAddress    = "";
            PreviousPath       = "";
            PreviousUrl        = "";
            SyncingFolder      = "";

            string local_presets_path = Preset.LocalPresetsPath;
            int local_presets_count   = 0;

            // Import all of the presets
            if (Directory.Exists (local_presets_path))
                // Local presets go first...
                foreach (string xml_file_path in Directory.GetFiles (local_presets_path, "*.xml")) {
                    Presets.Add (new Preset (xml_file_path));
                    local_presets_count++;
                }

            // ...system presets after that...
            if (Directory.Exists (SparkleShare.Controller.PresetsPath)) {
                foreach (string xml_file_path in Directory.GetFiles (SparkleShare.Controller.PresetsPath, "*.xml")) {
                    // ...and "Own server" at the very top
                    if (xml_file_path.EndsWith ("own-server.xml"))
                        Presets.Insert (0, new Preset (xml_file_path));
                    else
                        Presets.Add (new Preset (xml_file_path));
                }
            }

            SelectedPreset = Presets [0];

            SparkleShare.Controller.InviteReceived += delegate (SparkleInvite invite) {
                PendingInvite = invite;

                ChangePageEvent (PageType.Invite, null);
                ShowWindowEvent ();
            };

            SparkleShare.Controller.ShowSetupWindowEvent += delegate (PageType page_type) {
                if (page_type == PageType.StorageSetup ||
                    page_type == PageType.CryptoSetup ||
                    page_type == PageType.CryptoPassword) {

                    ChangePageEvent (page_type, null);
                    return;
                }

                if (PendingInvite != null) {
                    WindowIsOpen = true;
                    ShowWindowEvent ();
                    return;
                }

                if (this.current_page == PageType.Syncing ||
                    this.current_page == PageType.Finished ||
                    this.current_page == PageType.CryptoSetup ||
                    this.current_page == PageType.CryptoPassword) {

                    ShowWindowEvent ();
                    return;
                }

                if (page_type == PageType.Add) {
                    if (WindowIsOpen) {
                        if (this.current_page == PageType.Error ||
                            this.current_page == PageType.Finished ||
                            this.current_page == PageType.None) {

                            ChangePageEvent (PageType.Add, null);
                        }

                    } else if (!SparkleShare.Controller.FirstRun) {
                        WindowIsOpen = true;
                        ChangePageEvent (PageType.Add, null);
                    }

                    ShowWindowEvent ();
                    return;
                }

                WindowIsOpen = true;
                ChangePageEvent (page_type, null);
                ShowWindowEvent ();
            };
        }