diff options
author | iain holmes <iain@xamarin.com> | 2017-06-14 13:47:15 +0300 |
---|---|---|
committer | iain holmes <iain@xamarin.com> | 2017-06-14 14:17:20 +0300 |
commit | ade896664b8729880574a7753eb53f3c11b05c66 (patch) | |
tree | 7f4bf0e4709694ef903fc5bbd48dd4c87935f8bc /main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels | |
parent | 09ca7fb800aa53799ce968430b8b0e6ae895ceb1 (diff) |
[A11y] Simplify the API for adding label relationships
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels')
8 files changed, 42 insertions, 63 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/BuildMessagePanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/BuildMessagePanel.cs index 3e7bd6a856..90ae8b6f40 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/BuildMessagePanel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/BuildMessagePanel.cs @@ -90,17 +90,14 @@ namespace MonoDevelop.Ide.Gui.OptionPanels void SetupAccessibility () { - comboboxJumpToFirst.SetCommonAccessibilityAttributes ("BuildMessagePanel.jumpToFirst", null, + comboboxJumpToFirst.SetCommonAccessibilityAttributes ("BuildMessagePanel.jumpToFirst", label6, GettextCatalog.GetString ("Select which type of result to jump to after build completes")); - comboboxJumpToFirst.SetAccessibilityLabelRelationship (label6); - comboboxErrorPadAfter.SetCommonAccessibilityAttributes ("BuildMessagePanel.errorPadAfter", null, + comboboxErrorPadAfter.SetCommonAccessibilityAttributes ("BuildMessagePanel.errorPadAfter", label3, GettextCatalog.GetString ("Select when to show the Error Pad")); - comboboxErrorPadAfter.SetAccessibilityLabelRelationship (label3); - comboboxMessageBubbles.SetCommonAccessibilityAttributes ("BuildMessagePanel.messageBubbles", null, + comboboxMessageBubbles.SetCommonAccessibilityAttributes ("BuildMessagePanel.messageBubbles", label5, GettextCatalog.GetString ("Select when to show message bubbles")); - comboboxMessageBubbles.SetAccessibilityLabelRelationship (label5); } public void Store () { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/BuildPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/BuildPanel.cs index e14bf5f412..1512caa36c 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/BuildPanel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/BuildPanel.cs @@ -71,27 +71,26 @@ namespace MonoDevelop.Ide.Gui.OptionPanels void SetupAccessibility () { - buildBeforeRunCheckBox.SetCommonAccessibilityAttributes ("BuildPanel.buildBeforeRun", null, + buildBeforeRunCheckBox.SetCommonAccessibilityAttributes ("BuildPanel.buildBeforeRun", "", GettextCatalog.GetString ("Check to build the solution before running")); - runWithWarningsCheckBox.SetCommonAccessibilityAttributes ("BuildPanel.runWithWarnings", null, + runWithWarningsCheckBox.SetCommonAccessibilityAttributes ("BuildPanel.runWithWarnings", "", GettextCatalog.GetString ("Check to run the solution even if the build had warnings")); - buildBeforeTestCheckBox.SetCommonAccessibilityAttributes ("BuildPanel.buildBeforeTest", null, + buildBeforeTestCheckBox.SetCommonAccessibilityAttributes ("BuildPanel.buildBeforeTest", "", GettextCatalog.GetString ("Check to build the solution before running tests")); - buildWithMSBuildCheckBox.SetCommonAccessibilityAttributes ("BuildPanel.buildWithMSBuild", null, + buildWithMSBuildCheckBox.SetCommonAccessibilityAttributes ("BuildPanel.buildWithMSBuild", "", GettextCatalog.GetString ("Check to use MSBuild to build the solution")); - parallelBuildCheckbox.SetCommonAccessibilityAttributes ("BuildPanel.parallelBuild", null, + parallelBuildCheckbox.SetCommonAccessibilityAttributes ("BuildPanel.parallelBuild", "", GettextCatalog.GetString ("Check to enable parallel building")); - saveChangesRadioButton.SetCommonAccessibilityAttributes ("BuildPanel.saveChanges", null, + saveChangesRadioButton.SetCommonAccessibilityAttributes ("BuildPanel.saveChanges", "", GettextCatalog.GetString ("Check to save changes before building")); - noSaveRadioButton.SetCommonAccessibilityAttributes ("BuildPanel.noSave", null, + noSaveRadioButton.SetCommonAccessibilityAttributes ("BuildPanel.noSave", "", GettextCatalog.GetString ("Check to not save changes before building")); - promptChangesRadioButton.SetCommonAccessibilityAttributes ("BuildPanel.promptSave", null, + promptChangesRadioButton.SetCommonAccessibilityAttributes ("BuildPanel.promptSave", "", GettextCatalog.GetString ("Check to be prompted to save changes before building")); - verbosityCombo.SetCommonAccessibilityAttributes ("BuildPanel.verbosity", null, + verbosityCombo.SetCommonAccessibilityAttributes ("BuildPanel.verbosity", label1, GettextCatalog.GetString ("Select the verbosity level of the build")); - verbosityCombo.SetAccessibilityLabelRelationship (label1); } public void Store () diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/IDEStyleOptionsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/IDEStyleOptionsPanel.cs index f566b023c5..2f735bd848 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/IDEStyleOptionsPanel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/IDEStyleOptionsPanel.cs @@ -88,17 +88,14 @@ namespace MonoDevelop.Ide.Gui.OptionPanels this.Build(); Load (); - comboTheme.SetCommonAccessibilityAttributes ("IDEStyleOptionsPanel.Theme", null, + comboTheme.SetCommonAccessibilityAttributes ("IDEStyleOptionsPanel.Theme", labelTheme, GettextCatalog.GetString ("Select the user interface theme")); - comboTheme.SetAccessibilityLabelRelationship (labelTheme); - comboLanguage.SetCommonAccessibilityAttributes ("IDEStyleOptionsPanel.Language", null, + comboLanguage.SetCommonAccessibilityAttributes ("IDEStyleOptionsPanel.Language", label2, GettextCatalog.GetString ("Select the user interface language")); - comboLanguage.SetAccessibilityLabelRelationship (label2); - imageRestart.SetCommonAccessibilityAttributes ("IDEStyleOptionsPanel.RestartImage", null, + imageRestart.SetCommonAccessibilityAttributes ("IDEStyleOptionsPanel.RestartImage", labelRestart, GettextCatalog.GetString ("A restart is required before these changes take effect")); - imageRestart.SetAccessibilityLabelRelationship (labelRestart); } void Load () diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs index e12808581a..5d9922f901 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs @@ -168,13 +168,12 @@ namespace MonoDevelop.Ide.Gui.OptionPanels searchEntry.Entry.SetCommonAccessibilityAttributes ("KeyBindingsPanel.searchEntry", GettextCatalog.GetString ("Search"), GettextCatalog.GetString ("Enter a search term to find it in the keybindings list")); - accelEntry.SetCommonAccessibilityAttributes ("KeyBindingsPanel.accelEntry", null, + accelEntry.SetCommonAccessibilityAttributes ("KeyBindingsPanel.accelEntry", labelEditBinding, GettextCatalog.GetString ("Enter the keybinding for this command")); - accelEntry.SetAccessibilityLabelRelationship (labelEditBinding); - addButton.SetCommonAccessibilityAttributes ("KeyBindingsPanel.addButton", null, + addButton.SetCommonAccessibilityAttributes ("KeyBindingsPanel.addButton", "", GettextCatalog.GetString ("Add a new binding for this command")); - updateButton.SetCommonAccessibilityAttributes ("KeyBindingsPanel.updateButton", null, + updateButton.SetCommonAccessibilityAttributes ("KeyBindingsPanel.updateButton", "", GettextCatalog.GetString ("Update the binding for this command")); } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/LoadSavePanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/LoadSavePanel.cs index f085e369a3..ce367f5dd7 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/LoadSavePanel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/LoadSavePanel.cs @@ -88,16 +88,16 @@ namespace MonoDevelop.Ide.Gui.OptionPanels void SetupAccessibility () { - folderEntry.EntryAccessible.SetCommonAttributes ("LoadSavePanel.folderEntry", null, + folderEntry.EntryAccessible.SetCommonAttributes ("LoadSavePanel.folderEntry", "", GettextCatalog.GetString ("Enter the default path for the solution")); folderEntry.EntryAccessible.SetTitleUIElement (locationLabel.Accessible); locationLabel.Accessible.SetTitleFor (folderEntry.EntryAccessible); - loadUserDataCheckButton.SetCommonAccessibilityAttributes ("LoadSavePanel.loadUserData", null, + loadUserDataCheckButton.SetCommonAccessibilityAttributes ("LoadSavePanel.loadUserData", "", GettextCatalog.GetString ("Check to load the user specific settings with the solution")); - loadPrevProjectCheckButton.SetCommonAccessibilityAttributes ("LoadSavePanel.loadPrevious", null, + loadPrevProjectCheckButton.SetCommonAccessibilityAttributes ("LoadSavePanel.loadPrevious", "", GettextCatalog.GetString ("Check to load the previous solution when starting the application")); - createBackupCopyCheckButton.SetCommonAccessibilityAttributes ("LoadSavePanel.createBackup", null, + createBackupCopyCheckButton.SetCommonAccessibilityAttributes ("LoadSavePanel.createBackup", "", GettextCatalog.GetString ("Check to always create a backup copy")); } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/MonoRuntimePanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/MonoRuntimePanel.cs index df5f5be17e..f4a1629b2e 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/MonoRuntimePanel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/MonoRuntimePanel.cs @@ -103,11 +103,11 @@ namespace MonoDevelop.Ide.Gui.OptionPanels { tree.SetCommonAccessibilityAttributes ("MonoRuntimePanel.tree", GettextCatalog.GetString ("Available Runtimes"), GettextCatalog.GetString ("A list of available runtimes")); - buttonAdd.SetCommonAccessibilityAttributes ("MonoRuntimePanel.add", null, + buttonAdd.SetCommonAccessibilityAttributes ("MonoRuntimePanel.add", "", GettextCatalog.GetString ("Click to install a new runtime")); - buttonRemove.SetCommonAccessibilityAttributes ("MonoRuntimePanel.remove", null, + buttonRemove.SetCommonAccessibilityAttributes ("MonoRuntimePanel.remove", "", GettextCatalog.GetString ("Click to remove the currently selected runtime")); - buttonDefault.SetCommonAccessibilityAttributes ("MonoRuntimePanel.default", null, + buttonDefault.SetCommonAccessibilityAttributes ("MonoRuntimePanel.default", "", GettextCatalog.GetString ("Click to set the currently selected runtime as default")); } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/TasksOptionsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/TasksOptionsPanel.cs index a9ec460ce7..647ba462d0 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/TasksOptionsPanel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/TasksOptionsPanel.cs @@ -75,36 +75,30 @@ namespace MonoDevelop.Ide.Gui.OptionPanels void SetupAccessibility () { - comboPriority.SetCommonAccessibilityAttributes ("TasksPanel.priorityCombo", null, + comboPriority.SetCommonAccessibilityAttributes ("TasksPanel.priorityCombo", label113, GettextCatalog.GetString ("Select the priority for this token")); - comboPriority.SetAccessibilityLabelRelationship (label113); - entryToken.SetCommonAccessibilityAttributes ("TasksPanel.tokenEntry", null, + entryToken.SetCommonAccessibilityAttributes ("TasksPanel.tokenEntry", label112, GettextCatalog.GetString ("Enter a word to detect as a token")); - entryToken.SetAccessibilityLabelRelationship (label112); - tokensTreeView.SetCommonAccessibilityAttributes ("TasksPanel.tokensList", null, + tokensTreeView.SetCommonAccessibilityAttributes ("TasksPanel.tokensList", labelTokens, GettextCatalog.GetString ("A list of recognised tokens")); - tokensTreeView.SetAccessibilityLabelRelationship (labelTokens); - buttonAdd.SetCommonAccessibilityAttributes ("TasksPanel.addButton", null, + buttonAdd.SetCommonAccessibilityAttributes ("TasksPanel.addButton", "", GettextCatalog.GetString ("Add a new token")); - buttonChange.SetCommonAccessibilityAttributes ("TasksPanel.changeButton", null, + buttonChange.SetCommonAccessibilityAttributes ("TasksPanel.changeButton", "", GettextCatalog.GetString ("Edit the currently selected token")); - buttonRemove.SetCommonAccessibilityAttributes ("TasksPanel.removeButton", null, + buttonRemove.SetCommonAccessibilityAttributes ("TasksPanel.removeButton", "", GettextCatalog.GetString ("Remove the currently selected token")); - colorbuttonLowPrio.SetCommonAccessibilityAttributes ("TasksPanel.lowColor", null, + colorbuttonLowPrio.SetCommonAccessibilityAttributes ("TasksPanel.lowColor", label12, GettextCatalog.GetString ("Select the foreground color for low priority tasks")); - colorbuttonLowPrio.SetAccessibilityLabelRelationship (label12); - colorbuttonHighPrio.SetCommonAccessibilityAttributes ("TasksPanel.hiColor", null, + colorbuttonHighPrio.SetCommonAccessibilityAttributes ("TasksPanel.hiColor", label10, GettextCatalog.GetString ("Select the foreground color for the high priority tasks")); - colorbuttonHighPrio.SetAccessibilityLabelRelationship (label10); - colorbuttonNormalPrio.SetCommonAccessibilityAttributes ("TasksPanel.normalColor", null, + colorbuttonNormalPrio.SetCommonAccessibilityAttributes ("TasksPanel.normalColor", label11, GettextCatalog.GetString ("Select the foreground color for the normal priority tasks")); - colorbuttonNormalPrio.SetAccessibilityLabelRelationship (label11); } void Validate (object sender, EventArgs args) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/TextStylePolicyPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/TextStylePolicyPanel.cs index db3bd63674..bf7d6fa935 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/TextStylePolicyPanel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/TextStylePolicyPanel.cs @@ -78,33 +78,26 @@ namespace MonoDevelop.Ide.Gui.OptionPanels void SetupAccessibility () { - columnWidthSpin.SetCommonAccessibilityAttributes ("Textpolicy.WidthSpinner", - GettextCatalog.GetString ("Desired File Width"), + columnWidthSpin.SetCommonAccessibilityAttributes ("Textpolicy.WidthSpinner", label1, GettextCatalog.GetString ("The desired width of the file in columns")); - columnWidthSpin.SetAccessibilityLabelRelationship (label1); - lineEndingCombo.SetCommonAccessibilityAttributes ("Textpolicy.LineEndings", - GettextCatalog.GetString ("Line Endings"), + lineEndingCombo.SetCommonAccessibilityAttributes ("Textpolicy.LineEndings", label6, GettextCatalog.GetString ("Select the type of line endings the file should have")); - lineEndingCombo.SetAccessibilityLabelRelationship (label6); - tabWidthSpin.SetCommonAccessibilityAttributes ("Textpolicy.TabWidth", - GettextCatalog.GetString ("Tab Width"), + tabWidthSpin.SetCommonAccessibilityAttributes ("Textpolicy.TabWidth", label7, GettextCatalog.GetString ("Select the width of tab stops")); - tabWidthSpin.SetAccessibilityLabelRelationship (label7); - indentWidthSpin.SetCommonAccessibilityAttributes ("Textpolicy.IndentWidth", - GettextCatalog.GetString ("Indent Width"), + indentWidthSpin.SetCommonAccessibilityAttributes ("Textpolicy.IndentWidth", label9, GettextCatalog.GetString ("Select the width of indents")); - indentWidthSpin.SetAccessibilityLabelRelationship (label9); - tabsToSpaceCheck.SetCommonAccessibilityAttributes ("Textpolicy.TabsToSpaces", null, + tabsToSpaceCheck.SetCommonAccessibilityAttributes ("Textpolicy.TabsToSpaces", "", GettextCatalog.GetString ("Check to automatically convert tabs to spaces")); - tabsAfterNonTabsCheck.SetCommonAccessibilityAttributes ("Textpolicy.TabsAfterSpaces", null, + tabsAfterNonTabsCheck.SetCommonAccessibilityAttributes ("Textpolicy.TabsAfterSpaces", "", GettextCatalog.GetString ("Check to allow tabs after non-tabs")); - removeTrailingWhitespaceCheck.SetCommonAccessibilityAttributes ("Textpolicy.TrailingWhitespace", null, + removeTrailingWhitespaceCheck.SetCommonAccessibilityAttributes ("Textpolicy.TrailingWhitespace", "", GettextCatalog.GetString ("Check to automatically remove trailing whitespace from a line")); } + protected virtual void UpdateState (object sender, System.EventArgs e) { panel.UpdateSelectedNamedPolicy (); |