/// <summary> /// Get the values from the form and update the settings /// </summary> private ACATPreferences getSettingsFromUI() { var rootWidget = _dialogCommon.GetRootWidget(); var prefs = ACATPreferences.Load(); prefs.SelectClick = Common.AppPreferences.SelectClick = WidgetUtils.GetCheckBoxWidgetState(rootWidget, pbSelectingClick.Name); prefs.HalfScanIterations = Common.AppPreferences.HalfScanIterations = WidgetUtils.GetSliderState(rootWidget, tbEveryHalf.Name, WidgetUtils.SliderUnitsOnes); prefs.RowScanIterations = Common.AppPreferences.RowScanIterations = WidgetUtils.GetSliderState(rootWidget, tbEveryRow.Name, WidgetUtils.SliderUnitsOnes); prefs.ColumnScanIterations = Common.AppPreferences.ColumnScanIterations = WidgetUtils.GetSliderState(rootWidget, tbEveryColumn.Name, WidgetUtils.SliderUnitsOnes); prefs.WordPredictionScanIterations = Common.AppPreferences.WordPredictionScanIterations = WidgetUtils.GetSliderState(rootWidget, tbWordPrediction.Name, WidgetUtils.SliderUnitsOnes); prefs.AcceptTime = Common.AppPreferences.AcceptTime = WidgetUtils.GetSliderState(rootWidget, tbAcceptTime.Name, WidgetUtils.SliderUnitsThousandths); prefs.SteppingTime = Common.AppPreferences.SteppingTime = WidgetUtils.GetSliderState(rootWidget, tbSteppingTime.Name, WidgetUtils.SliderUnitsThousandths); prefs.HesitateTime = Common.AppPreferences.HesitateTime = WidgetUtils.GetSliderState(rootWidget, tbHesitateTime.Name, WidgetUtils.SliderUnitsThousandths); prefs.WordPredictionHesitateTime = Common.AppPreferences.WordPredictionHesitateTime = WidgetUtils.GetSliderState(rootWidget, tbWordListHesitateTime.Name, WidgetUtils.SliderUnitsThousandths); prefs.TabScanTime = Common.AppPreferences.TabScanTime = WidgetUtils.GetSliderState(rootWidget, tbTabScanTime.Name, WidgetUtils.SliderUnitsThousandths); prefs.FirstRepeatTime = Common.AppPreferences.FirstRepeatTime = WidgetUtils.GetSliderState(rootWidget, tbFirstRepeatTime.Name, WidgetUtils.SliderUnitsThousandths); return(prefs); }
/// <summary> /// Get the settings with the current state of /// widgets in the form /// </summary> /// <returns>Preferences with settings from the form</returns> private ACATPreferences getAppPreferencesFromUI() { var prefs = ACATPreferences.Load(); var rootWidget = _dialogCommon.GetRootWidget(); prefs.EnableGlass = Common.AppPreferences.EnableGlass = WidgetUtils.GetCheckBoxWidgetState(rootWidget, pbShowGlass.Name); prefs.HideScannerOnIdle = Common.AppPreferences.HideScannerOnIdle = WidgetUtils.GetCheckBoxWidgetState(rootWidget, pbHideScannersOnIdle.Name); prefs.ExpandAbbreviationsOnSeparator = Common.AppPreferences.ExpandAbbreviationsOnSeparator = WidgetUtils.GetCheckBoxWidgetState(rootWidget, pbExpandAbbreviationsOnSeparator.Name); prefs.ShowTalkWindowOnStartup = Common.AppPreferences.ShowTalkWindowOnStartup = WidgetUtils.GetCheckBoxWidgetState(rootWidget, pbShowTalkWindowOnStartup.Name); prefs.RetainTalkWindowContentsOnHide = Common.AppPreferences.RetainTalkWindowContentsOnHide = WidgetUtils.GetCheckBoxWidgetState(rootWidget, pbRetainTalkWindowText.Name); prefs.DebugMessagesEnable = Common.AppPreferences.DebugMessagesEnable = WidgetUtils.GetCheckBoxWidgetState(rootWidget, pbEnableDebugTraceLogging.Name); prefs.AuditLogEnable = Common.AppPreferences.AuditLogEnable = WidgetUtils.GetCheckBoxWidgetState(rootWidget, pbEnableAuditLog.Name); prefs.AutoSaveScannerLastPosition = Common.AppPreferences.AutoSaveScannerLastPosition = WidgetUtils.GetCheckBoxWidgetState(rootWidget, pbScannerAutoSaveLastPosition.Name); if (Common.AppPreferences.AutoSaveScannerLastPosition) { prefs.ScannerPosition = Common.AppPreferences.ScannerPosition = Context.AppWindowPosition; } prefs.DebugLogMessagesToFile = Common.AppPreferences.DebugLogMessagesToFile = Common.AppPreferences.DebugMessagesEnable; return(prefs); }
/// <summary> /// Update settings based on what the user has /// set in the dialog /// </summary> private ACATPreferences updateSettingsFromUI() { var rootWidget = _dialogCommon.GetRootWidget(); var prefs = ACATPreferences.Load(); prefs.EnableWordPredictionDynamicModel = Common.AppPreferences.EnableWordPredictionDynamicModel = WidgetUtils.GetCheckBoxWidgetState(rootWidget, pbDynamicLearning.Name); prefs.EnableWordPredictionCorpusModel = Common.AppPreferences.EnableWordPredictionCorpusModel = WidgetUtils.GetCheckBoxWidgetState(rootWidget, pbUseCorpus.Name); prefs.WordPredictionCount = Common.AppPreferences.WordPredictionCount = WidgetUtils.GetSliderState(rootWidget, tbWordCount.Name, WidgetUtils.SliderUnitsOnes); return(prefs); }
/// <summary> /// Update settings based on the values set by the /// user in the form /// </summary> private ACATPreferences updateSettingsFromUI() { var prefs = ACATPreferences.Load(); Widget rootWidget = _dialogCommon.GetRootWidget(); prefs.MouseRadarRotatingSpeed = Common.AppPreferences.MouseRadarRotatingSpeed = WidgetUtils.GetSliderState(rootWidget, tbRotatingSpeed.Name, WidgetUtils.SliderUnitsOnes); prefs.MouseRadarRotatingSweeps = Common.AppPreferences.MouseRadarRotatingSweeps = WidgetUtils.GetSliderState(rootWidget, tbRotatingSweeps.Name, WidgetUtils.SliderUnitsOnes); prefs.MouseRadarRadialSpeed = Common.AppPreferences.MouseRadarRadialSpeed = WidgetUtils.GetSliderState(rootWidget, tbRadialSpeed.Name, WidgetUtils.SliderUnitsOnes); prefs.MouseRadarRadialSweeps = Common.AppPreferences.MouseRadarRadialSweeps = WidgetUtils.GetSliderState(rootWidget, tbRadialSweeps.Name, WidgetUtils.SliderUnitsOnes); prefs.MouseRadarLineWidth = Common.AppPreferences.MouseRadarLineWidth = WidgetUtils.GetSliderState(rootWidget, tbLineWidth.Name, WidgetUtils.SliderUnitsOnes); prefs.MouseRadarStartFromLastCursorPos = Common.AppPreferences.MouseRadarStartFromLastCursorPos = WidgetUtils.GetCheckBoxWidgetState(rootWidget, pbStartFromLastCursorPos.Name); return(prefs); }
/// <summary> /// Update settings based on the values set by the /// user in the form /// </summary> private ACATPreferences getSettingsFromUI() { Widget rootWidget = _dialogCommon.GetRootWidget(); var prefs = ACATPreferences.Load(); prefs.MouseGridVerticalSpeed = Common.AppPreferences.MouseGridVerticalSpeed = WidgetUtils.GetSliderState(rootWidget, tbVerticalSpeed.Name, WidgetUtils.SliderUnitsOnes); prefs.MouseGridVerticalSweeps = Common.AppPreferences.MouseGridVerticalSweeps = WidgetUtils.GetSliderState(rootWidget, tbVerticalSweeps.Name, WidgetUtils.SliderUnitsOnes); prefs.MouseGridHorizontalSpeed = Common.AppPreferences.MouseGridHorizontalSpeed = WidgetUtils.GetSliderState(rootWidget, tbHorizontalSpeed.Name, WidgetUtils.SliderUnitsOnes); prefs.MouseGridHorizontalSweeps = Common.AppPreferences.MouseGridHorizontalSweeps = WidgetUtils.GetSliderState(rootWidget, tbHorizontalSweeps.Name, WidgetUtils.SliderUnitsOnes); prefs.MouseGridLineWidth = Common.AppPreferences.MouseGridLineWidth = WidgetUtils.GetSliderState(rootWidget, tbLineWidth.Name, WidgetUtils.SliderUnitsOnes); prefs.MouseGridStartFromLastCursorPos = Common.AppPreferences.MouseGridStartFromLastCursorPos = WidgetUtils.GetCheckBoxWidgetState(rootWidget, pbStartFromLastCursorPos.Name); return(prefs); }