Exemplo n.º 1
0
        void SettingOverrides_PageLeave(object sender, System.Windows.Forms.Wizard.PageChangedArgs args)
        {
            if (args.Direction == System.Windows.Forms.Wizard.PageChangedDirection.Back)
            {
                return;
            }

            if (!OptionGrid.Unsupported)
            {
                m_wrapper.Overrides = OptionGrid.GetConfiguration();
            }

            if (m_wrapper.PrimayAction == WizardSettingsWrapper.MainAction.Restore)
            {
                m_wrapper.UpdateSchedule(m_wrapper.DataConnection.GetObjectById <Datamodel.Schedule>(m_wrapper.ScheduleID));
                args.NextPage = new Restore.SelectBackupVersion();
            }
            else if (m_wrapper.PrimayAction == WizardSettingsWrapper.MainAction.RestoreSetup)
            {
                args.NextPage = new RestoreSetup.FinishedRestoreSetup();
            }
            else
            {
                //Don't set args.NextPage, it runs on a list
            }
        }
Exemplo n.º 2
0
        void ThrottleOptions_PageLeave(object sender, System.Windows.Forms.Wizard.PageChangedArgs args)
        {
            if (args.Direction == System.Windows.Forms.Wizard.PageChangedDirection.Back)
            {
                return;
            }

            m_wrapper.UploadSpeedLimit =
                Bandwidth.UploadLimitEnabled ?
                Bandwidth.UploadLimit :
                "";

            m_wrapper.DownloadSpeedLimit =
                Bandwidth.DownloadLimitEnabled ?
                Bandwidth.DownloadLimit :
                "";

            m_wrapper.BackupSizeLimit =
                BackupLimitEnabled.Checked ?
                BackupLimit.CurrentSize :
                "";

            m_wrapper.VolumeSize     = VolumeSize.CurrentSize;
            m_wrapper.AsyncTransfer  = AsyncEnabled.Checked;
            m_wrapper.ThreadPriority =
                ThreadPriorityPicker.SelectedPriority == null ?
                "" :
                ThreadPriorityPicker.SelectedPriority.Value.ToString();

            //Don't set args.NextPage, it runs on a list
        }
Exemplo n.º 3
0
 void ThrottleOptions_PageDisplay(object sender, System.Windows.Forms.Wizard.PageChangedArgs args)
 {
     //Reload due to annoying bug with the numerics
     if (m_valuesAutoLoaded)
     {
         base.LoadDialogSettings();
     }
 }
Exemplo n.º 4
0
        void FilterEditor_PageEnter(object sender, System.Windows.Forms.Wizard.PageChangedArgs args)
        {
            m_wrapper = new WizardSettingsWrapper(m_settings);

            filterEditor1.FilterXml = m_wrapper.EncodedFilterXml;

            List <KeyValuePair <bool, string> > lst = new List <KeyValuePair <bool, string> >();

            filterEditor1.BasePath      = DynamicSetupHelper.GetSourceFolders(m_wrapper, new ApplicationSettings(m_wrapper.DataConnection ?? Program.DataConnection), lst);
            filterEditor1.DynamicFilter = Library.Utility.FilenameFilter.EncodeAsFilter(lst);
        }
Exemplo n.º 5
0
        void FilterEditor_PageLeave(object sender, System.Windows.Forms.Wizard.PageChangedArgs args)
        {
            if (args.Direction == System.Windows.Forms.Wizard.PageChangedDirection.Back)
            {
                return;
            }

            m_wrapper.EncodedFilterXml = filterEditor1.FilterXml;

            //Don't set args.NextPage, it runs on a list
        }
Exemplo n.º 6
0
        void FirstLaunch_PageLeave(object sender, System.Windows.Forms.Wizard.PageChangedArgs args)
        {
            WizardSettingsWrapper wrapper = new WizardSettingsWrapper(m_settings);

            if (CreateNew.Checked)
            {
                //If there are no existing backups, the mainpage just selects add, and sets the defaults
                args.NextPage          = new MainPage();
                wrapper.DataConnection = Program.DataConnection;
                wrapper.PrimayAction   = WizardSettingsWrapper.MainAction.Add;
            }
            else if (RestoreSetup.Checked)
            {
                DialogResult res = MessageBox.Show(this, Strings.FirstLaunch.ShowAdvancedQuestion, Application.ProductName, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
                if (res == DialogResult.Cancel)
                {
                    args.Cancel = true;
                    return;
                }
                wrapper.SetupDefaults();
                wrapper.ShowAdvancedRestoreOptions = res == DialogResult.Yes;
                args.NextPage          = new Add_backup.PasswordSettings();
                wrapper.DataConnection = Program.DataConnection;
                wrapper.PrimayAction   = WizardSettingsWrapper.MainAction.RestoreSetup;
            }
            else if (RestoreFiles.Checked)
            {
                wrapper.SetupDefaults();
                wrapper.DataConnection = new System.Data.LightDatamodel.DataFetcherNested(Program.DataConnection);

                Datamodel.Schedule s = new Datamodel.Schedule();
                Datamodel.Task     t = new Datamodel.Task();

                wrapper.DataConnection.Add(s);
                wrapper.DataConnection.Add(t);

                s.Task = t;

                wrapper.ScheduleID   = s.ID;
                args.NextPage        = new Add_backup.PasswordSettings();
                wrapper.PrimayAction = WizardSettingsWrapper.MainAction.Restore;
            }
            else
            {
                MessageBox.Show(this, Strings.FirstLaunch.NoActionSelection, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
                args.Cancel   = true;
                args.NextPage = null;
                return;
            }
        }
Exemplo n.º 7
0
        void SettingOverrides_PageEnter(object sender, System.Windows.Forms.Wizard.PageChangedArgs args)
        {
            if (!OptionGrid.Unsupported)
            {
                m_wrapper = new WizardSettingsWrapper(m_settings);

                if (!m_settings.ContainsKey("Overrides:Table"))
                {
                    IList <Library.Interface.ICommandLineArgument> primary   = new Library.Main.Options(new Dictionary <string, string>()).SupportedCommands;
                    IList <Library.Interface.ICommandLineArgument> secondary = GetModuleOptions(m_wrapper, this);

                    OptionGrid.Setup(primary, secondary, m_wrapper.Overrides);

                    m_settings["Overrides:Table"]            = OptionGrid.DataSet;
                    m_settings["Overrides:DataElementCache"] = OptionGrid.DataElementCache;
                }
                else
                {
                    OptionGrid.DataSet          = (DataSet)m_settings["Overrides:Table"];
                    OptionGrid.DataElementCache = (Dictionary <string, Library.Interface.ICommandLineArgument>)m_settings["Overrides:DataElementCache"];
                }
            }
        }
Exemplo n.º 8
0
        void ThrottleOptions_PageEnter(object sender, System.Windows.Forms.Wizard.PageChangedArgs args)
        {
            m_wrapper = new WizardSettingsWrapper(m_settings);
            if (!m_valuesAutoLoaded)
            {
                Bandwidth.UploadLimit   = m_wrapper.UploadSpeedLimit;
                Bandwidth.DownloadLimit = m_wrapper.DownloadSpeedLimit;

                if (string.IsNullOrEmpty(m_wrapper.BackupSizeLimit) || Library.Utility.Sizeparser.ParseSize(m_wrapper.BackupSizeLimit) == 0)
                {
                    BackupLimitEnabled.Checked = false;
                }
                else
                {
                    BackupLimitEnabled.Checked = true;
                    BackupLimit.CurrentSize    = m_wrapper.BackupSizeLimit;
                }

                VolumeSize.CurrentSize = m_wrapper.VolumeSize;

                AsyncEnabled.Checked = m_wrapper.AsyncTransfer;
                ThreadPriorityPicker.SelectedPriority = string.IsNullOrEmpty(m_wrapper.ThreadPriority) ? null : (System.Threading.ThreadPriority?)Library.Utility.Utility.ParsePriority(m_wrapper.ThreadPriority);
            }
        }
Exemplo n.º 9
0
 void FirstLaunch_PageEnter(object sender, System.Windows.Forms.Wizard.PageChangedArgs args)
 {
     UpdateButtonState();
     args.TreatAsLast = false;
 }