diff --git a/source/SnapDump-Client/SnapDump.extension.st b/source/SnapDump-Client/SnapDump.extension.st index 3dd7176..30ee9c5 100644 --- a/source/SnapDump-Client/SnapDump.extension.st +++ b/source/SnapDump-Client/SnapDump.extension.st @@ -3,13 +3,13 @@ Extension { #name : #SnapDump } { #category : #'*SnapDump-Client' } SnapDump class >> client [ ^ SDClient new - store: self current store; + store: self store; yourself ] { #category : #'*SnapDump-Client' } SnapDump class >> uri: aUri [ - ^ self current + ^ self store: (SDHTTPStore new uri: aUri asZnUrl); yourself ] diff --git a/source/SnapDump-Core/SnapDump.class.st b/source/SnapDump-Core/SnapDump.class.st index f434252..ccbbb03 100644 --- a/source/SnapDump-Core/SnapDump.class.st +++ b/source/SnapDump-Core/SnapDump.class.st @@ -5,7 +5,8 @@ Class { 'store' ], #classInstVars : [ - 'current' + 'current', + 'handler' ], #category : #'SnapDump-Core-Base' } @@ -18,7 +19,7 @@ SnapDump class >> applyConfiguration: aConfig [ { #category : #'as yet unclassified' } SnapDump class >> beOfType: aSymbol [ - current := (self withType: aSymbol) new + self deprecated: 'beOfType: is unnecessary now. Just remove calls to this method' ] { #category : #'as yet unclassified' } @@ -31,51 +32,43 @@ SnapDump class >> configuration [ { #category : #accessing } SnapDump class >> current [ - ^ current ifNil: [ - current := SDHandler new ] + ^ current ] -{ #category : #'as yet unclassified' } -SnapDump class >> hackUIManager [ - UIManager compile: 'logError: anError - SnapDump current handleException: anError. - super logError: anError' +{ #category : #accessing } +SnapDump class >> path: aPathString [ + ^ self + store: (SDFilesystemStore new path: aPathString asFileReference); + yourself ] -{ #category : #public } -SnapDump class >> handleException: exception [ - ^ self current handleException: exception +{ #category : #initialization } +SnapDump class >> reset [ + current := nil ] { #category : #'as yet unclassified' } -SnapDump class >> handleSnapshot: aSnapshot [ - ^ self current handleSnapshot: aSnapshot +SnapDump class >> setCurrent: anObject [ + current := anObject ] { #category : #accessing } -SnapDump class >> path: aPathString [ - ^ self current - store: (SDFilesystemStore new path: aPathString asFileReference); - yourself +SnapDump class >> store [ + ^ self current store ] -{ #category : #initialization } -SnapDump class >> reset [ - current := nil +{ #category : #accessing } +SnapDump class >> store: aStore [ + self current store: aStore ] { #category : #'as yet unclassified' } SnapDump class >> uri: aUri username: aUsername password: aPassword [ - ^ self current store + ^ self store uri: aUri asZnUrl; username: aUsername password: aPassword ] -{ #category : #'accessing structure variables' } -SnapDump class >> withType: aSymbol [ - ^ self allSubclasses detect: [ :each | each type = aSymbol ] -] - { #category : #initialization } SnapDump >> applyConfiguration: aConfig [ store := (SDStore withName: aConfig store) new. diff --git a/source/SnapDump-Handler/SnapDump.extension.st b/source/SnapDump-Handler/SnapDump.extension.st index be732e6..92fb20e 100644 --- a/source/SnapDump-Handler/SnapDump.extension.st +++ b/source/SnapDump-Handler/SnapDump.extension.st @@ -2,21 +2,30 @@ Extension { #name : #SnapDump } { #category : #'*SnapDump-Handler' } SnapDump class >> beHandler [ - | handler | - handler := SDHandler new. - self setCurrent: handler. - ^ handler + self deprecated: 'handlers are always present now. This call is not necessary anymore' +] +{ #category : #'*SnapDump-Handler' } +SnapDump class >> hackUIManager [ + UIManager compile: 'logError: anError + SnapDump current handleException: anError. + super logError: anError' ] { #category : #'*SnapDump-Handler' } -SnapDump class >> handler [ - ^ SDHandler new - store: self current store; - yourself +SnapDump class >> handleException: exception [ + ^ self handler handleException: exception ] { #category : #'*SnapDump-Handler' } -SnapDump class >> setCurrent: anObject [ - current := anObject +SnapDump class >> handleSnapshot: aSnapshot [ + ^ self handler handleSnapshot: aSnapshot +] + +{ #category : #'*SnapDump-Handler' } +SnapDump class >> handler [ + ^ handler ifNil: [ + handler := SDHandler new + store: self store; + yourself ] ] diff --git a/source/SnapDump-UI/SnapDump.extension.st b/source/SnapDump-UI/SnapDump.extension.st index 77ffb24..00da073 100644 --- a/source/SnapDump-UI/SnapDump.extension.st +++ b/source/SnapDump-UI/SnapDump.extension.st @@ -3,6 +3,6 @@ Extension { #name : #SnapDump } { #category : #'*SnapDump-UI' } SnapDump class >> ui [ ^ SnapDumpUI new - snapDump: (SDClient new store: self current store); + snapDump: self client; openWithSpec ] diff --git a/source/SnapDump-UI/SnapDumpUI.class.st b/source/SnapDump-UI/SnapDumpUI.class.st index e12439a..394825d 100644 --- a/source/SnapDump-UI/SnapDumpUI.class.st +++ b/source/SnapDump-UI/SnapDumpUI.class.st @@ -174,7 +174,7 @@ SnapDumpUI >> subMenu [ ^ MenuPresenter new addGroup: [ :group | - SnapDump current projects do: [ :project | + client projects do: [ :project | group addItem: [ :item | item name: project name;