From cf00e8661d5f64f629450728528620498ad87324 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20D=C3=B6rbandt?= Date: Tue, 26 Sep 2023 17:16:42 +0200 Subject: [PATCH] Add keyboard shortcut for excluding/including changes --- .../SquotChange.class/instance/addMenuItemsTo..st | 2 +- .../SquotChange.class/instance/keyStroke..st | 3 +++ .../SquotChange.class/methodProperties.json | 3 ++- .../instance/buildChangesTree..st | 1 + .../instance/changesTreeKeyStroke..st | 4 ++++ .../SquotChangesDialog.class/methodProperties.json | 3 ++- .../SquotChangesTree.class/instance/addMenuItemsTo..st | 10 +++++++--- .../SquotChangesTree.class/instance/keyStroke..st | 3 +++ .../instance/toggleExcludedAll.st | 5 +++++ .../{toggleExcluded.st => toggleExcludedIndividual.st} | 2 +- .../SquotChangesTree.class/methodProperties.json | 6 ++++-- 11 files changed, 33 insertions(+), 9 deletions(-) create mode 100644 src/Squot.package/SquotChange.class/instance/keyStroke..st create mode 100644 src/Squot.package/SquotChangesDialog.class/instance/changesTreeKeyStroke..st create mode 100644 src/Squot.package/SquotChangesTree.class/instance/keyStroke..st create mode 100644 src/Squot.package/SquotChangesTree.class/instance/toggleExcludedAll.st rename src/Squot.package/SquotChangesTree.class/instance/{toggleExcluded.st => toggleExcludedIndividual.st} (68%) diff --git a/src/Squot.package/SquotChange.class/instance/addMenuItemsTo..st b/src/Squot.package/SquotChange.class/instance/addMenuItemsTo..st index 06bfad4c4..eb90ecf3b 100644 --- a/src/Squot.package/SquotChange.class/instance/addMenuItemsTo..st +++ b/src/Squot.package/SquotChange.class/instance/addMenuItemsTo..st @@ -2,4 +2,4 @@ menu addMenuItemsTo: aMenu aMenu target: self; - add: (self isExcluded ifTrue: ['include'] ifFalse: ['exclude']) action: #toggleExcluded. \ No newline at end of file + add: (self isExcluded ifTrue: ['include'] ifFalse: ['exclude']), ' (x)' action: #toggleExcluded. \ No newline at end of file diff --git a/src/Squot.package/SquotChange.class/instance/keyStroke..st b/src/Squot.package/SquotChange.class/instance/keyStroke..st new file mode 100644 index 000000000..173904aa5 --- /dev/null +++ b/src/Squot.package/SquotChange.class/instance/keyStroke..st @@ -0,0 +1,3 @@ +ui +keyStroke: aCharacter + aCharacter = $x ifTrue: [self toggleExcluded]. \ No newline at end of file diff --git a/src/Squot.package/SquotChange.class/methodProperties.json b/src/Squot.package/SquotChange.class/methodProperties.json index b342f7ea0..10ccb7cdb 100644 --- a/src/Squot.package/SquotChange.class/methodProperties.json +++ b/src/Squot.package/SquotChange.class/methodProperties.json @@ -2,7 +2,7 @@ "class" : { "withChangeSet:" : "mad 9/6/2023 12:37" }, "instance" : { - "addMenuItemsTo:" : "mad 9/11/2023 14:21", + "addMenuItemsTo:" : "mad 9/26/2023 17:13", "buildWith:" : "mad 9/5/2023 22:49", "changeSet" : "mad 9/5/2023 22:45", "changeSet:" : "mad 9/6/2023 18:51", @@ -13,6 +13,7 @@ "isExcluded" : "mad 9/7/2023 15:28", "isIncluded" : "mad 9/10/2023 14:33", "isTree" : "mad 9/2/2023 18:39", + "keyStroke:" : "mad 9/26/2023 17:06", "label" : "mad 9/10/2023 19:21", "mapper" : "mad 9/5/2023 22:45", "path" : "mad 9/5/2023 22:48", diff --git a/src/Squot.package/SquotChangesDialog.class/instance/buildChangesTree..st b/src/Squot.package/SquotChangesDialog.class/instance/buildChangesTree..st index fe8d45ca0..4b7e60715 100644 --- a/src/Squot.package/SquotChangesDialog.class/instance/buildChangesTree..st +++ b/src/Squot.package/SquotChangesDialog.class/instance/buildChangesTree..st @@ -8,5 +8,6 @@ buildChangesTree: builder getSelected: #selectedChange; setSelected: #selectedChange:; menu: #changesTreeMenu:; + keyPress: #changesTreeKeyStroke:; label: #nodeLabel:; yourself \ No newline at end of file diff --git a/src/Squot.package/SquotChangesDialog.class/instance/changesTreeKeyStroke..st b/src/Squot.package/SquotChangesDialog.class/instance/changesTreeKeyStroke..st new file mode 100644 index 000000000..0ff7c45ec --- /dev/null +++ b/src/Squot.package/SquotChangesDialog.class/instance/changesTreeKeyStroke..st @@ -0,0 +1,4 @@ +ui +changesTreeKeyStroke: aCharacter + (self selectedChange ifNil: [^ self]) + keyStroke: aCharacter. \ No newline at end of file diff --git a/src/Squot.package/SquotChangesDialog.class/methodProperties.json b/src/Squot.package/SquotChangesDialog.class/methodProperties.json index 039935062..3d6ffef16 100644 --- a/src/Squot.package/SquotChangesDialog.class/methodProperties.json +++ b/src/Squot.package/SquotChangesDialog.class/methodProperties.json @@ -9,7 +9,7 @@ "buildButtons:" : "mad 9/17/2023 17:55", "buildChange:" : "mad 9/6/2023 12:53", "buildChangesLayout:" : "mad 9/14/2023 13:41", - "buildChangesTree:" : "mad 9/15/2023 16:06", + "buildChangesTree:" : "mad 9/26/2023 17:12", "buildDynamicChangePanel:" : "mad 9/20/2023 17:14", "buildLayout:" : "mad 9/15/2023 12:35", "buildMainLayout:" : "mad 9/15/2023 12:34", @@ -24,6 +24,7 @@ "changes:" : "mad 9/11/2023 14:37", "changesTree" : "mad 9/3/2023 12:12", "changesTree:" : "mad 9/6/2023 19:35", + "changesTreeKeyStroke:" : "mad 9/26/2023 17:05", "changesTreeMenu:" : "mad 9/11/2023 14:23", "close" : "mad 9/7/2023 14:57", "computeChanges" : "mad 9/6/2023 19:34", diff --git a/src/Squot.package/SquotChangesTree.class/instance/addMenuItemsTo..st b/src/Squot.package/SquotChangesTree.class/instance/addMenuItemsTo..st index 0a296a29e..7768fe1b5 100644 --- a/src/Squot.package/SquotChangesTree.class/instance/addMenuItemsTo..st +++ b/src/Squot.package/SquotChangesTree.class/instance/addMenuItemsTo..st @@ -1,6 +1,10 @@ menu addMenuItemsTo: aMenu + | allIncluded allExcluded | + allIncluded := self allIncluded. + allExcluded := self allExcluded. aMenu target: self. - self allIncluded ifFalse: [aMenu add: 'include all' action: #includeAll]. - self allExcluded ifFalse: [aMenu add: 'exclude all' action: #excludeAll]. - aMenu add: 'toggle excluded' action: #toggleExcluded. \ No newline at end of file + allIncluded ifFalse: [ + aMenu add: 'include all', (allExcluded ifTrue: [' (x)'] ifFalse: ['']) action: #includeAll]. + allExcluded ifFalse: [aMenu add: 'exclude all (x)' action: #excludeAll]. + aMenu add: 'toggle excluded' action: #toggleExcludedIndividual. \ No newline at end of file diff --git a/src/Squot.package/SquotChangesTree.class/instance/keyStroke..st b/src/Squot.package/SquotChangesTree.class/instance/keyStroke..st new file mode 100644 index 000000000..3c032937b --- /dev/null +++ b/src/Squot.package/SquotChangesTree.class/instance/keyStroke..st @@ -0,0 +1,3 @@ +ui +keyStroke: aCharacter + aCharacter = $x ifTrue: [self toggleExcludedAll] \ No newline at end of file diff --git a/src/Squot.package/SquotChangesTree.class/instance/toggleExcludedAll.st b/src/Squot.package/SquotChangesTree.class/instance/toggleExcludedAll.st new file mode 100644 index 000000000..ce984e05b --- /dev/null +++ b/src/Squot.package/SquotChangesTree.class/instance/toggleExcludedAll.st @@ -0,0 +1,5 @@ +excluding +toggleExcludedAll + self allExcluded + ifTrue: [self includeAll] + ifFalse: [self excludeAll]. \ No newline at end of file diff --git a/src/Squot.package/SquotChangesTree.class/instance/toggleExcluded.st b/src/Squot.package/SquotChangesTree.class/instance/toggleExcludedIndividual.st similarity index 68% rename from src/Squot.package/SquotChangesTree.class/instance/toggleExcluded.st rename to src/Squot.package/SquotChangesTree.class/instance/toggleExcludedIndividual.st index 74307e59f..8d6cb4b55 100644 --- a/src/Squot.package/SquotChangesTree.class/instance/toggleExcluded.st +++ b/src/Squot.package/SquotChangesTree.class/instance/toggleExcludedIndividual.st @@ -1,3 +1,3 @@ excluding -toggleExcluded +toggleExcludedIndividual ^ self recursiveChildrenDo: #toggleExcluded \ No newline at end of file diff --git a/src/Squot.package/SquotChangesTree.class/methodProperties.json b/src/Squot.package/SquotChangesTree.class/methodProperties.json index 41a0cc4e6..03c212503 100644 --- a/src/Squot.package/SquotChangesTree.class/methodProperties.json +++ b/src/Squot.package/SquotChangesTree.class/methodProperties.json @@ -4,7 +4,7 @@ "instance" : { "add:" : "mad 9/6/2023 12:57", "addAll:" : "mad 9/3/2023 12:12", - "addMenuItemsTo:" : "mad 9/11/2023 14:27", + "addMenuItemsTo:" : "mad 9/26/2023 17:11", "allExcluded" : "mad 9/11/2023 14:28", "allIncluded" : "mad 9/11/2023 14:28", "atPath:" : "mad 9/5/2023 22:49", @@ -24,10 +24,12 @@ "isChange" : "mad 9/6/2023 12:58", "isExcluded" : "mad 9/11/2023 14:33", "isTree" : "mad 9/2/2023 18:39", + "keyStroke:" : "mad 9/26/2023 17:10", "label" : "mad 9/10/2023 19:25", "label:" : "mad 9/10/2023 19:26", "minimumChildHeight:" : "mad 9/6/2023 18:40", "printOn:" : "mad 9/10/2023 19:23", "recursiveChildrenDo:" : "mad 9/3/2023 18:12", - "toggleExcluded" : "mad 9/11/2023 14:29", + "toggleExcludedAll" : "mad 9/26/2023 17:10", + "toggleExcludedIndividual" : "mad 9/26/2023 17:10", "treeAt:" : "mad 9/10/2023 19:26" } }