Skip to content

Commit

Permalink
Clean cyclic dependencies between Keymapping packages. They are, of c…
Browse files Browse the repository at this point in the history
…ourse, still logically dependent on each other but now they do not require atomic loading
  • Loading branch information
pavel-krivanek committed Mar 24, 2020
1 parent deda42a commit 5abc99d
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 30 deletions.
6 changes: 0 additions & 6 deletions src/Keymapping-Core/KMKeymap.class.st
Expand Up @@ -83,12 +83,6 @@ KMKeymap >> description: aDescription [
description := aDescription asString
]

{ #category : #'enabling/disabling' }
KMKeymap >> disable [

self shortcut: KMNoShortcut new.
]

{ #category : #executing }
KMKeymap >> executeActionTargetting: target [
^ self action cull: target cull: target
Expand Down
5 changes: 0 additions & 5 deletions src/Keymapping-Core/KMNoKeymap.class.st
Expand Up @@ -6,8 +6,3 @@ Class {
#superclass : #Object,
#category : #'Keymapping-Core-Base'
}

{ #category : #accessing }
KMNoKeymap >> shortcut [
^ KMNoShortcut new
]
19 changes: 0 additions & 19 deletions src/Keymapping-Core/KMRepository.class.st
Expand Up @@ -18,11 +18,6 @@ Class {
#category : #'Keymapping-Core-Base'
}

{ #category : #cleanup }
KMRepository class >> cleanUp [
self reset
]

{ #category : #'instance creation' }
KMRepository class >> default [
^ Singleton ifNil: [ Singleton := self new ]
Expand All @@ -33,20 +28,6 @@ KMRepository class >> default: aDefault [
^ Singleton := aDefault
]

{ #category : #initialization }
KMRepository class >> reset [
"Do not reset KMDispatchers instances, it may make the image unusable or force the user to close all the windows."

"TODO: a better reset, allowing the KMDispatcher instances to reload all named, updated, keymaps from the resetted KMRepository."

self currentWorld setProperty: #kmDispatcher toValue: nil.
self default: self new.
KMCategory allSubclasses
select: [ :c | c isGlobalCategory ]
thenDo: [ :c | c new installAsGlobalCategory ].
KMPragmaKeymapBuilder uniqueInstance reset.
]

{ #category : #associating }
KMRepository >> addCategory: aCategory [
(self includesCategory: aCategory)
Expand Down
7 changes: 7 additions & 0 deletions src/Keymapping-KeyCombinations/KMKeymap.extension.st
@@ -0,0 +1,7 @@
Extension { #name : #KMKeymap }

{ #category : #'*Keymapping-KeyCombinations' }
KMKeymap >> disable [

self shortcut: KMNoShortcut new.
]
6 changes: 6 additions & 0 deletions src/Keymapping-KeyCombinations/KMNoKeymap.extension.st
@@ -0,0 +1,6 @@
Extension { #name : #KMNoKeymap }

{ #category : #'*Keymapping-KeyCombinations' }
KMNoKeymap >> shortcut [
^ KMNoShortcut new
]
20 changes: 20 additions & 0 deletions src/Keymapping-Pragmas/KMRepository.extension.st
@@ -0,0 +1,20 @@
Extension { #name : #KMRepository }

{ #category : #'*Keymapping-Pragmas' }
KMRepository class >> cleanUp [
self reset
]

{ #category : #'*Keymapping-Pragmas' }
KMRepository class >> reset [
"Do not reset KMDispatchers instances, it may make the image unusable or force the user to close all the windows."

"TODO: a better reset, allowing the KMDispatcher instances to reload all named, updated, keymaps from the resetted KMRepository."

self currentWorld setProperty: #kmDispatcher toValue: nil.
self default: self new.
KMCategory allSubclasses
select: [ :c | c isGlobalCategory ]
thenDo: [ :c | c new installAsGlobalCategory ].
KMPragmaKeymapBuilder uniqueInstance reset.
]

0 comments on commit 5abc99d

Please sign in to comment.