Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add keymap preference #178

Merged
merged 8 commits into from
Aug 7, 2020
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
structureKeymap: aString

structureKeymap := aString
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
instance creation
accessing
structureKeymap
"adjust this to your keyboard layout"
^ '!@#$%^&*()'
<preference: 'Structure keyboard shortcuts'
category: #SquidWord
description: 'Represents the keys to use with CTRL+SHIFT to toggle structures. Character at position 1 represents toggling structure 1. Leave as is if you use an american keyboard layout, otherwise change e.g. to pressing shift and all numbers 1 to 0 on your keyboard. Be aware that not all shortcuts might work as they might already be reserved by Squeak.'
type: #String>

^ structureKeymap ifNil: ['!@#$%^&*()']
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
"class" : {
"initialize" : "AG 7/25/2019 13:10",
"initializeCmdKeyShortcuts" : "OS 5/6/2020 20:40",
"initializeShiftCmdKeyShortcuts" : "tok 5/18/2020 10:19",
"initializeShiftCmdKeyShortcuts" : "tok 8/7/2020 11:14",
"initializeShiftedYellowButtonMenu" : "AG 5/29/2019 18:39",
"initializeYellowButtonMenu" : "AG 5/29/2019 18:39",
"structureKeymap" : "tok 5/18/2020 10:18" },
"structureKeymap" : "tok 8/7/2020 11:13",
"structureKeymap:" : "frc 8/6/2020 19:39" },
"instance" : {
"URLRegex" : "kh 6/15/2020 10:42",
"clipboardContainsURL" : "kh 6/15/2020 13:32",
Expand All @@ -15,7 +16,7 @@
"isCtrlA:" : "lh 7/24/2019 16:59",
"isNewCharacter:" : "tok 6/13/2020 12:03",
"isSpecialCharacter:" : "OS 6/12/2020 12:03",
"isStructureShortcut:" : "OS 6/12/2020 12:09",
"isStructureShortcut:" : "tok 8/7/2020 11:14",
"isValidCharacter:" : "tok 6/13/2020 12:04",
"keyStroke:" : "OS 6/12/2020 12:09",
"makeTextURLFrom:" : "frc 7/16/2020 14:05",
Expand All @@ -27,5 +28,5 @@
"specialCharacters" : "tok 6/13/2020 12:14",
"storeSelectionInParagraph" : "lh 7/24/2019 21:51",
"textSize" : "lh 6/26/2019 22:16",
"toggleStructureSelectionAt:" : "tok 5/18/2020 13:40",
"toggleStructureSelectionAt:" : "tok 8/7/2020 11:14",
"wouldPasteURL" : "kh 6/15/2020 10:42" } }
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"category" : "RichTextEditing-Core",
"classinstvars" : [
],
"structureKeymap" ],
"classvars" : [
],
"commentStamp" : "ls 7/25/2019 13:49",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"exampleExportContent" : "tok 7/9/2020 22:41",
"exampleExportFilePath" : "tok 7/8/2020 20:43",
"exampleImportFilePath" : "tok 7/9/2020 21:16",
"exportOptionExists:" : " 8/6/2020 19:49:02",
"exportOptionExists:" : "8/6/2020 19:49:02",
"exportVariantExists:" : "kh 8/6/2020 09:50",
"exportedFileContent" : "tok 7/9/2020 22:41",
"exportedFileExists" : "tok 7/9/2020 21:44",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"boldTextStructure" : "frc 7/13/2020 12:18",
"buttonWithLabelExists:" : "AG 5/29/2019 22:21",
"closeAllMenus" : "frc 6/16/2020 20:46",
"ctrlShiftButtonCode" : "tok 8/3/2020 14:49",
"closeWindowsWithLabel:" : "frc 7/30/2020 10:28",
"ctrlShiftButtonCode" : "tok 8/3/2020 14:49",
"doMenuActionByLabel:" : "frc 6/18/2020 19:00",
"document" : "frc 7/13/2020 12:12",
"documentMenu" : "frc 6/25/2020 16:24",
Expand All @@ -23,8 +23,8 @@
"enterString:inBackwardsCompatibleDialog:withAlternativeNumber:" : "tok 7/9/2020 21:57",
"enterStringInSaveDialog:" : "tok 7/9/2020 21:57",
"enterStringOntoTextField:" : "MB 7/24/2019 18:55",
"flattenTextAttributes:" : "tok 8/4/2020 16:33",
"exampleTextStructure" : "frc 7/16/2020 16:50",
"flattenTextAttributes:" : "tok 8/4/2020 16:33",
"italicTextStructure" : "frc 7/13/2020 12:19",
"menuActionByLabel:" : "frc 6/18/2020 19:04",
"menuItemWithLabelExists:" : "frc 6/25/2020 16:25",
Expand All @@ -34,7 +34,7 @@
"selectOptionBold" : "tok 8/3/2020 14:48",
"setUp" : "MB 6/12/2019 18:01",
"simulateKeyboardEventWithButtons:andKeyValue:" : "frc 7/16/2020 12:55",
"simulateKeyboardShortcutForStructure1" : "tok 8/3/2020 14:49",
"simulateKeyboardShortcutForStructure1" : "tok 8/7/2020 11:20",
"tearDown" : "JEH 5/31/2020 12:45",
"textEditor" : "MB 5/22/2019 17:55",
"textHasNoStyle" : "tok 8/3/2020 14:56",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
utilities
changeStructureKeymap

self textEditor class structureKeymap: self newStructureKeymap
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
utilities
editorStructureKeymap

^ self textEditor class structureKeymap
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
constants
newStructureKeymap

^ '$=)(/&%§"!'
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
resources
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to running

setUp

super setUp.
self structureKeymap: self editorStructureKeymap
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
structureKeymap: aString

structureKeymap := aString
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
structureKeymap

^ structureKeymap
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
constants
structureKeymapPreference

^ (self textEditor class asString , '>>', 'structureKeymap') asSymbol
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's that?

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
resources
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

running

tearDown

self textEditor class structureKeymap: self structureKeymap.
super tearDown
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
acceptance-tests
testUS183ChangeStructureKeymap

Preferences setFlag: self structureKeymapPreference
toValue: self newStructureKeymap
during: [self assert: self editorStructureKeymap = self newStructureKeymap]
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
acceptance-tests
testUS183ChangedStructureKeymapAllowsNewShortcuts

self
changeStructureKeymap;
enterStringOntoTextField: self text.
self textEditor selectAll.
self
simulateKeyboardShortcutForStructure1;
assert: self textIsBold
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
"addStructure" : "ls 6/12/2019 17:54",
"anotherText" : "MB 7/25/2019 11:03",
"autocompletionPreference" : "kh 5/24/2020 18:57",
"changeStructureKeymap" : "tok 8/7/2020 10:15",
"clickRedoButton" : "tok 8/3/2020 15:04",
"clickUndoButton" : "tok 8/3/2020 15:03",
"crKeyCode" : "MB 5/15/2019 20:53",
"ctrlButtonCode" : "MB 5/15/2019 21:04",
"deselectOptionBold" : "tok 8/4/2020 16:55",
"editorSavesIncludeKey:" : "MB 5/22/2019 18:01",
"editorStructureKeymap" : "tok 8/7/2020 11:17",
"enterSaveNameInDialog:" : "tok 7/9/2020 21:57",
"exportAsButtonLabel" : "tok 7/8/2020 16:28",
"footerContainsColNumber" : "JEH 6/14/2020 12:43",
Expand All @@ -22,6 +24,7 @@
"loadDocumentFromSaver" : "tok 7/8/2020 16:09",
"manageStructuresLabel" : "frc 8/1/2020 11:36",
"newButtonLabel" : "MB 6/12/2019 19:18",
"newStructureKeymap" : "tok 8/7/2020 10:55",
"noActiveButtonCode" : "MB 5/15/2019 20:54",
"pressEnter" : "MB 5/15/2019 20:55",
"pressShiftEnter" : "MB 5/15/2019 20:54",
Expand All @@ -31,20 +34,25 @@
"removeStructure" : "ls 7/24/2019 17:24",
"richTextEditorOpenCommand" : "ls 6/22/2019 10:49",
"saveName" : "MB 7/25/2019 11:02",
"setUp" : "tok 8/7/2020 11:18",
"setupBoldText" : "tok 8/4/2020 17:30",
"shiftButtonCode" : "MB 5/15/2019 21:06",
"simulateRedoShortcut" : "tok 8/4/2020 15:23",
"simulateUndoShortcut" : "tok 8/3/2020 14:59",
"structureEditorLabel" : "frc 8/1/2020 11:31",
"structureKeymap" : "tok 8/7/2020 11:07",
"structureKeymap:" : "tok 8/7/2020 11:24",
"structureKeymapPreference" : "tok 8/7/2020 10:04",
"tearDown" : "tok 8/7/2020 11:11",
"templateButtonLabel" : "frc 8/1/2020 11:55",
"testDocumentInfoContainsWordcount" : "7/16/2020 10:20:56",
"testInspectDocument" : "JEH 8/3/2020 15:03",
"testOpenStructureEditor" : "frc 8/1/2020 11:36",
"testOpenTemplateEditor" : "frc 8/1/2020 11:55",
"testRedoStructureUnapplyUnappliesStructureWith:" : "tok 8/6/2020 14:51",
"testRedoStructureWith:" : "tok 8/6/2020 14:51",
"testOpenTemplateEditor" : "frc 8/1/2020 11:55",
"testSaveTextAccessorSavesUnsavedChanges" : "frc 8/1/2020 12:04",
"testTargetDocumentSavesTextStructures" : "frc 8/1/2020 11:56",
"structureEditorLabel" : "frc 8/1/2020 11:31",
"templateButtonLabel" : "frc 8/1/2020 11:55",
"testTextSizeReturnsCorrectSize" : "6/18/2020 19:22:35",
"testUS04loadButtonExists" : "AG 5/22/2019 18:38",
"testUS04loadedTextIsInsertedIntoEditor" : "tok 7/8/2020 16:09",
Expand Down Expand Up @@ -76,6 +84,8 @@
"testUS142UndoShortcutUndoesStructure" : "tok 8/4/2020 17:04",
"testUS142UndoStructureUnapplyReappliesStructure" : "tok 8/4/2020 17:20",
"testUS142UndoUndoesStructure" : "tok 8/4/2020 17:04",
"testUS183ChangeStructureKeymap" : "tok 8/7/2020 11:07",
"testUS183ChangedStructureKeymapAllowsNewShortcuts" : "tok 8/7/2020 11:25",
"testUS19ButtonInAppsMenuExists" : "MB 5/15/2019 21:29",
"testUS19WindowsOpensWithoutFailure" : "MB 5/15/2019 21:30",
"testUS24saveAsButtonChangesLabel" : "frc 6/18/2020 19:04",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
],
"commentStamp" : "lh 7/25/2019 12:05",
"instvars" : [
],
"structureKeymap" ],
"name" : "RichTextEditorTests",
"pools" : [
],
Expand Down