コード例 #1
0
        private void OnRestoreDefaults()
        {
            GUIDialogYesNo dlgYesNo = (GUIDialogYesNo)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_YES_NO);

            if (dlgYesNo != null)
            {
                dlgYesNo.Reset();
                dlgYesNo.SetHeading(927);
                dlgYesNo.SetLine(1, Utility.GetLocalizedText(TextId.RestoreDefaults));
                dlgYesNo.SetLine(2, Utility.GetLocalizedText(TextId.AreYouSure));
                dlgYesNo.SetLine(3, string.Empty);
                dlgYesNo.SetDefaultToYes(false);
                dlgYesNo.DoModal(GetID);

                if (dlgYesNo.IsConfirmed)
                {
                    ConfigurationServiceAgent.SetBooleanValue(ConfigurationModule.Scheduler, ConfigurationKey.Scheduler.CreateVideoThumbnails, null);
                    ConfigurationServiceAgent.SetBooleanValue(ConfigurationModule.Scheduler, ConfigurationKey.Scheduler.AlwaysCreateMetadataFiles, null);
                    ConfigurationServiceAgent.SetStringValue(ConfigurationModule.Scheduler, ConfigurationKey.Scheduler.PreferredGuideSource, null);
                    ConfigurationServiceAgent.SetIntValue(ConfigurationModule.Scheduler, ConfigurationKey.Scheduler.PreRecordsSeconds, null);
                    ConfigurationServiceAgent.SetIntValue(ConfigurationModule.Scheduler, ConfigurationKey.Scheduler.PostRecordsSeconds, null);
                    ConfigurationServiceAgent.SetStringValue(ConfigurationModule.Scheduler, ConfigurationKey.Scheduler.DefaultKeepUntilMode, null);
                    ConfigurationServiceAgent.SetIntValue(ConfigurationModule.Scheduler, ConfigurationKey.Scheduler.DefaultKeepUntilValue, null);
                    ConfigurationServiceAgent.SetIntValue(ConfigurationModule.Scheduler, ConfigurationKey.Scheduler.FreeDiskSpaceInMB, null);
                    ConfigurationServiceAgent.SetIntValue(ConfigurationModule.Scheduler, ConfigurationKey.Scheduler.MinimumFreeDiskSpaceInMB, null);
                }
            }
        }
コード例 #2
0
 private void SaveSettings()
 {
     Log.Debug("ServerSettingsBase: SaveSettings()");
     if (_autoCreateThumbsButton.IsEnabled)
     {
         ConfigurationServiceAgent.SetBooleanValue(ConfigurationModule.Scheduler, ConfigurationKey.Scheduler.CreateVideoThumbnails, _autoCreateThumbsButton.Selected);
     }
     if (_metaDataForRecsButton.IsEnabled)
     {
         ConfigurationServiceAgent.SetBooleanValue(ConfigurationModule.Scheduler, ConfigurationKey.Scheduler.AlwaysCreateMetadataFiles, _metaDataForRecsButton.Selected);
     }
     if (_guideSourceButton.IsEnabled)
     {
         ConfigurationServiceAgent.SetStringValue(ConfigurationModule.Scheduler, ConfigurationKey.Scheduler.PreferredGuideSource, _currentGuideSource.ToString());
     }
     if (_preRecordButton.IsEnabled)
     {
         ConfigurationServiceAgent.SetIntValue(ConfigurationModule.Scheduler, ConfigurationKey.Scheduler.PreRecordsSeconds, Int32.Parse(_preRecordButton.SpinLabel) * 60);
     }
     if (_postRecordButton.IsEnabled)
     {
         ConfigurationServiceAgent.SetIntValue(ConfigurationModule.Scheduler, ConfigurationKey.Scheduler.PostRecordsSeconds, Int32.Parse(_postRecordButton.SpinLabel) * 60);
     }
     if (_keepUntilModeButton.IsEnabled)
     {
         ConfigurationServiceAgent.SetStringValue(ConfigurationModule.Scheduler, ConfigurationKey.Scheduler.DefaultKeepUntilMode, _currentKeepUntilMode.ToString());
     }
     if (_keepUntilValueButton.IsEnabled)
     {
         ConfigurationServiceAgent.SetIntValue(ConfigurationModule.Scheduler, ConfigurationKey.Scheduler.DefaultKeepUntilValue, _currentKeepUntilValue);
     }
     if (_freeDiskSpaceSpinButton.IsEnabled)
     {
         ConfigurationServiceAgent.SetIntValue(ConfigurationModule.Scheduler, ConfigurationKey.Scheduler.FreeDiskSpaceInMB, Int32.Parse(_freeDiskSpaceSpinButton.SpinLabel) * 1000);
     }
     if (_minFreeDiskSpaceSpinButton.IsEnabled)
     {
         ConfigurationServiceAgent.SetIntValue(ConfigurationModule.Scheduler, ConfigurationKey.Scheduler.MinimumFreeDiskSpaceInMB, Int32.Parse(_minFreeDiskSpaceSpinButton.SpinLabel) * 1000);
     }
 }