Skip to content

Commit

Permalink
Add move asset button
Browse files Browse the repository at this point in the history
  • Loading branch information
MariusDoe committed Nov 21, 2023
1 parent c584389 commit 5be994d
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 6 deletions.
11 changes: 11 additions & 0 deletions src/Squot.package/SquotAssetBrowser.class/instance/actionMove.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
actions
actionMove
| newPath |
self selectedMapper ifNil: [^ self inform: 'Please select an asset first.'].
newPath := (self activeWorkingCopy
requestUnmappedPathWithTitle:
('New path for asset ''{1}'':' format: {self selectedMapper printStringWithoutPath})
initialAnswer: (SquotPathUtilities asString: self selectedMapper path))
ifNil: [^ self].
self selectedMapper moveTo: newPath in: self activeWorkingCopy.
self changed: #selectedAsset. "path changed"
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ buildButtons: builder
self buildImportDirectoryButton: builder.
self buildImportUnmappedFilesButton: builder.
self buildAddButton: builder.
self buildMoveButton: builder.
self buildRemoveButton: builder.
} with: builder
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
toolbuilder
buildMoveButton: builder
^ builder pluggableActionButtonSpec new
model: self;
action: #actionMove;
label: 'Move asset';
yourself
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
importing
chooseFromMappers: aCollection title: aString
^ UIManager default
chooseFrom: (aCollection collect: [:each |
String streamContents: [:stream | each printWithoutPathOn: stream]])
chooseFrom: (aCollection collect: #printStringWithoutPath)
values: aCollection
title: aString
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"actionImportDirectory" : "mad 10/19/2023 16:51",
"actionImportFile" : "mad 10/19/2023 16:51",
"actionImportUnmappedFiles" : "mad 10/21/2023 23:59",
"actionMove" : "mad 11/21/2023 16:46",
"actionRemove" : "mad 10/19/2023 15:29",
"activeWorkingCopy" : "mad 9/20/2023 15:20",
"activeWorkingCopy:" : "mad 9/20/2023 16:42",
Expand All @@ -22,13 +23,14 @@
"buildAssetPanel:" : "mad 9/20/2023 21:10",
"buildAssetPanelLayout:" : "mad 9/20/2023 21:11",
"buildAssetSelectionPanel:" : "mad 9/20/2023 20:24",
"buildButtons:" : "mad 10/23/2023 14:34",
"buildButtons:" : "mad 11/21/2023 16:43",
"buildDynamicAssetPanel:" : "mad 9/20/2023 20:28",
"buildImportDirectoryButton:" : "mad 10/24/2023 16:37",
"buildImportFileButton:" : "mad 10/24/2023 16:37",
"buildImportUnmappedFilesButton:" : "mad 10/24/2023 16:36",
"buildLayout:" : "mad 9/20/2023 19:07",
"buildMainLayout:" : "mad 9/20/2023 20:23",
"buildMoveButton:" : "mad 11/21/2023 16:43",
"buildNoAssetSelected:" : "mad 9/20/2023 17:23",
"buildProjectList:" : "mad 9/20/2023 15:50",
"buildRemoveButton:" : "mad 10/24/2023 16:37",
Expand All @@ -37,7 +39,7 @@
"buildWith:" : "mad 9/20/2023 15:09",
"buildWorkspace:" : "mad 9/20/2023 21:03",
"chooseCompatibleMapper:" : "mad 10/23/2023 14:27",
"chooseFromMappers:title:" : "mad 10/21/2023 22:44",
"chooseFromMappers:title:" : "mad 11/21/2023 16:42",
"commonPathPrefix" : "mad 10/1/2023 17:54",
"defaultFileNameFor:" : "mad 10/21/2023 23:08",
"defaultPath" : "mad 10/19/2023 12:08",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
printing
printStringWithoutPath
^ String streamContents: [:stream | self printWithoutPathOn: stream]
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ uncheckedMoveTo: aPath in: aWorkingCopy
self
materialize: nil in: aWorkingCopy;
path: aPath;
materialize: version in: aWorkingCopy.
materialize: version in: aWorkingCopy.
aWorkingCopy changed: #mappers.
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,13 @@
"printAtPathOn:" : "mad 11/6/2023 13:17",
"printEncodedUsingOn:" : "mad 11/6/2023 13:17",
"printOn:" : "mad 11/7/2023 12:51",
"printStringWithoutPath" : "mad 11/21/2023 16:44",
"printWithoutEncodingOn:" : "mad 11/7/2023 12:51",
"printWithoutPathOn:" : "mad 11/7/2023 12:51",
"readVersionFrom:" : "mad 9/20/2023 14:18",
"space:" : "mad 11/7/2023 12:52",
"transformVersion:ifFail:" : "mad 10/17/2023 12:30",
"uncheckedMoveTo:in:" : "mad 11/21/2023 16:33",
"uncheckedMoveTo:in:" : "mad 11/21/2023 16:45",
"versionAsMorph:" : "mad 9/20/2023 14:19",
"versionOrNilAsMorph:" : "mad 9/20/2023 17:36",
"versionOrNilTypeName" : "mad 10/21/2023 21:52",
Expand Down

0 comments on commit 5be994d

Please sign in to comment.