From 7fb0065ad16fa3588a1aa2cccd7783f52168be36 Mon Sep 17 00:00:00 2001 From: Tom Beckmann Date: Sun, 7 Jun 2020 07:21:08 +0200 Subject: [PATCH 1/2] adapt the SaveVersionDialog text field to use ctr+s for accept --- .squot | 16 ++++++++-------- .../instance/accept.st | 1 - .../instance/cancel.st | 4 ---- .../instance/message.notifying..st | 5 +++++ .../instance/widgetSpecs..st | 3 ++- .../methodProperties.json | 8 ++++---- src/Squot.package/monticello.meta/postscript.st | 14 -------------- 7 files changed, 19 insertions(+), 32 deletions(-) delete mode 100644 src/Squot.package/SquotSaveVersionDialog.class/instance/cancel.st create mode 100644 src/Squot.package/SquotSaveVersionDialog.class/instance/message.notifying..st delete mode 100644 src/Squot.package/monticello.meta/postscript.st diff --git a/.squot b/.squot index 8dfb6e351..e95ec8282 100644 --- a/.squot +++ b/.squot @@ -1,10 +1,10 @@ OrderedDictionary { - 'src\/VersionControl.package' : #SquotCypressCodeSerializer, - 'src\/Pharo-compatibility.package' : #SquotCypressCodeSerializer, - 'src\/Squot.package' : #SquotCypressCodeSerializer, - 'src\/FileSystem-Git.package' : #SquotCypressCodeSerializer, - 'src\/Squit.package' : #SquotCypressCodeSerializer, - 'src\/BaselineOfSquot.package' : #SquotCypressCodeSerializer, - 'src\/SquotTonel-Core.package' : #SquotCypressCodeSerializer, - 'src\/SquotTonel-Tests.package' : #SquotCypressCodeSerializer + 'src/VersionControl.package' : #SquotCypressCodeSerializer, + 'src/Pharo-compatibility.package' : #SquotCypressCodeSerializer, + 'src/Squot.package' : #SquotCypressCodeSerializer, + 'src/FileSystem-Git.package' : #SquotCypressCodeSerializer, + 'src/Squit.package' : #SquotCypressCodeSerializer, + 'src/BaselineOfSquot.package' : #SquotCypressCodeSerializer, + 'src/SquotTonel-Core.package' : #SquotCypressCodeSerializer, + 'src/SquotTonel-Tests.package' : #SquotCypressCodeSerializer } \ No newline at end of file diff --git a/src/Squot.package/SquotSaveVersionDialog.class/instance/accept.st b/src/Squot.package/SquotSaveVersionDialog.class/instance/accept.st index 5df495aed..ddf2b046d 100644 --- a/src/Squot.package/SquotSaveVersionDialog.class/instance/accept.st +++ b/src/Squot.package/SquotSaveVersionDialog.class/instance/accept.st @@ -1,6 +1,5 @@ actions accept - self updateMessageFromViews. ((self messageWasChanged not or: [message isEmpty]) and: [(self confirm: 'Do you really want to commit without a proper commit message?') not]) ifTrue: [^ self]. diff --git a/src/Squot.package/SquotSaveVersionDialog.class/instance/cancel.st b/src/Squot.package/SquotSaveVersionDialog.class/instance/cancel.st deleted file mode 100644 index 0096b07fe..000000000 --- a/src/Squot.package/SquotSaveVersionDialog.class/instance/cancel.st +++ /dev/null @@ -1,4 +0,0 @@ -actions -cancel - self updateMessageFromViews. - super cancel. \ No newline at end of file diff --git a/src/Squot.package/SquotSaveVersionDialog.class/instance/message.notifying..st b/src/Squot.package/SquotSaveVersionDialog.class/instance/message.notifying..st new file mode 100644 index 000000000..2d415d7bf --- /dev/null +++ b/src/Squot.package/SquotSaveVersionDialog.class/instance/message.notifying..st @@ -0,0 +1,5 @@ +accessing +message: anObject notifying: aController + + self message: anObject. + self accept \ No newline at end of file diff --git a/src/Squot.package/SquotSaveVersionDialog.class/instance/widgetSpecs..st b/src/Squot.package/SquotSaveVersionDialog.class/instance/widgetSpecs..st index eb998d7cf..749255b97 100644 --- a/src/Squot.package/SquotSaveVersionDialog.class/instance/widgetSpecs..st +++ b/src/Squot.package/SquotSaveVersionDialog.class/instance/widgetSpecs..st @@ -5,7 +5,8 @@ widgetSpecs: builder name: 'message for the new version'; model: self; getText: #message; - setText: #message:; + setText: #message:notifying:; + askBeforeDiscardingEdits: true; frame: (LayoutFrame fractions: (0@0.7 corner: 1@1) offsets: (0@0 corner: 0@(-25))); yourself. self buildButtonBar: builder} \ No newline at end of file diff --git a/src/Squot.package/SquotSaveVersionDialog.class/methodProperties.json b/src/Squot.package/SquotSaveVersionDialog.class/methodProperties.json index 780e37e55..084d7ace4 100644 --- a/src/Squot.package/SquotSaveVersionDialog.class/methodProperties.json +++ b/src/Squot.package/SquotSaveVersionDialog.class/methodProperties.json @@ -2,24 +2,24 @@ "class" : { "themeProperties" : "jr 10/14/2018 00:52" }, "instance" : { - "accept" : "jr 5/22/2020 15:51", + "accept" : "tobe 6/6/2020 16:29", "actionCommit" : "fn 4/11/2017 16:01", "activateNodeCommandLabel" : "jr 4/7/2019 22:30", "browseOtherEdition" : "jr 6/6/2020 01:04", "browseOtherEditionLabel" : "jr 6/6/2020 00:48", "buildButtonBar:" : "jr 11/18/2018 01:39", "buildDiffPane:" : "jr 11/18/2018 01:33", - "cancel" : "jr 11/18/2018 00:44", "deactivateNodeCommandLabel" : "jr 4/7/2019 22:29", "defaultMessage" : "jr 10/14/2018 01:24", "excludeMethodsThatAreAssumedUnchanged" : "jr 5/22/2020 15:49", "initialize" : "jr 11/18/2018 00:50", "inspectOriginalArtifactCommandLabel" : "jr 11/18/2018 01:05", "message" : "jr 2/17/2017 17:03", - "message:" : "jr 2/17/2017 17:03", + "message:" : "tobe 6/6/2020 09:15", + "message:notifying:" : "tobe 6/6/2020 09:23", "messageWasChanged" : "jr 11/17/2018 23:19", "parentVersions:" : "jr 2/17/2017 19:34", "rootNodes" : "jr 2/26/2020 22:57", "updateMessageFromViews" : "jr 10/14/2018 01:30", - "widgetSpecs:" : "jr 11/18/2018 01:32", + "widgetSpecs:" : "tobe 6/6/2020 09:18", "windowLabel" : "jr 11/18/2018 01:29" } } diff --git a/src/Squot.package/monticello.meta/postscript.st b/src/Squot.package/monticello.meta/postscript.st deleted file mode 100644 index 08aa2461f..000000000 --- a/src/Squot.package/monticello.meta/postscript.st +++ /dev/null @@ -1,14 +0,0 @@ -(PackageInfo named: 'Squot') postscript: '"below, add code to be run after the loading of this package" -"2017-09-19 renamed SquotLiveObject to SquotLiveArtifact" -(Smalltalk at: #OldSquotLiveObject ifPresent: [:OldSquotLiveObject | - OldSquotLiveObject allInstancesDo: [:each | SquotLiveArtifact adoptInstance: each]]). -"2017-07-16 upgrade from Dictionary storeInfo to SquotTrackedObjectMetadata" - -SquotArtifact allSubInstancesDo: [:each | each convertToCurrentVersion: nil refStream: nil]. - -SquotLiveArtifact allSubInstancesDo: [:each | each convertToCurrentVersion: nil refStream: nil]. -SquotImageStore allSubInstancesDo: [:each | each convertToCurrentVersion: nil refStream: nil]. -"2018-08-18 upgrade object containers to remember the preferred loading order of artifacts" - -"2019-06-08 Clear caches after changing how SquotPackageShadows are decorated with names in snapshots" -SquotWorkingCopy allInstancesDo: [:each | each flushPreviouslySavedArtifacts].'! From afed9a3cad187896a23f05f501ccc1809b3ae980 Mon Sep 17 00:00:00 2001 From: Tom Beckmann Date: Sun, 7 Jun 2020 20:24:05 +0200 Subject: [PATCH 2/2] ensure we persist the commit message text even when cancelling --- .../instance/acceptMessage..st | 6 ++++++ .../SquotSaveVersionDialog.class/instance/initialize.st | 1 + .../instance/message.notifying..st | 5 ----- .../instance/whileCancellingDo..st | 5 +++++ .../SquotSaveVersionDialog.class/instance/widgetSpecs..st | 4 ++-- .../instance/windowIsClosing.st | 3 +++ .../SquotSaveVersionDialog.class/methodProperties.json | 8 +++++--- .../SquotSaveVersionDialog.class/properties.json | 3 ++- 8 files changed, 24 insertions(+), 11 deletions(-) create mode 100644 src/Squot.package/SquotSaveVersionDialog.class/instance/acceptMessage..st delete mode 100644 src/Squot.package/SquotSaveVersionDialog.class/instance/message.notifying..st create mode 100644 src/Squot.package/SquotSaveVersionDialog.class/instance/whileCancellingDo..st create mode 100644 src/Squot.package/SquotSaveVersionDialog.class/instance/windowIsClosing.st diff --git a/src/Squot.package/SquotSaveVersionDialog.class/instance/acceptMessage..st b/src/Squot.package/SquotSaveVersionDialog.class/instance/acceptMessage..st new file mode 100644 index 000000000..e14739d0b --- /dev/null +++ b/src/Squot.package/SquotSaveVersionDialog.class/instance/acceptMessage..st @@ -0,0 +1,6 @@ +accessing +acceptMessage: anObject + + self message: anObject. + + cancelling ifFalse: [self accept] \ No newline at end of file diff --git a/src/Squot.package/SquotSaveVersionDialog.class/instance/initialize.st b/src/Squot.package/SquotSaveVersionDialog.class/instance/initialize.st index fb46fdc0d..ae82efcd1 100644 --- a/src/Squot.package/SquotSaveVersionDialog.class/instance/initialize.st +++ b/src/Squot.package/SquotSaveVersionDialog.class/instance/initialize.st @@ -2,3 +2,4 @@ initialize-release initialize super initialize. message := self defaultMessage. + cancelling := false. \ No newline at end of file diff --git a/src/Squot.package/SquotSaveVersionDialog.class/instance/message.notifying..st b/src/Squot.package/SquotSaveVersionDialog.class/instance/message.notifying..st deleted file mode 100644 index 2d415d7bf..000000000 --- a/src/Squot.package/SquotSaveVersionDialog.class/instance/message.notifying..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -message: anObject notifying: aController - - self message: anObject. - self accept \ No newline at end of file diff --git a/src/Squot.package/SquotSaveVersionDialog.class/instance/whileCancellingDo..st b/src/Squot.package/SquotSaveVersionDialog.class/instance/whileCancellingDo..st new file mode 100644 index 000000000..bbd5d1857 --- /dev/null +++ b/src/Squot.package/SquotSaveVersionDialog.class/instance/whileCancellingDo..st @@ -0,0 +1,5 @@ +accessing +whileCancellingDo: aBlock + + cancelling := true. + aBlock ensure: [cancelling := false] \ No newline at end of file diff --git a/src/Squot.package/SquotSaveVersionDialog.class/instance/widgetSpecs..st b/src/Squot.package/SquotSaveVersionDialog.class/instance/widgetSpecs..st index 749255b97..f48e3e128 100644 --- a/src/Squot.package/SquotSaveVersionDialog.class/instance/widgetSpecs..st +++ b/src/Squot.package/SquotSaveVersionDialog.class/instance/widgetSpecs..st @@ -5,8 +5,8 @@ widgetSpecs: builder name: 'message for the new version'; model: self; getText: #message; - setText: #message:notifying:; - askBeforeDiscardingEdits: true; + setText: #acceptMessage:; + askBeforeDiscardingEdits: false; frame: (LayoutFrame fractions: (0@0.7 corner: 1@1) offsets: (0@0 corner: 0@(-25))); yourself. self buildButtonBar: builder} \ No newline at end of file diff --git a/src/Squot.package/SquotSaveVersionDialog.class/instance/windowIsClosing.st b/src/Squot.package/SquotSaveVersionDialog.class/instance/windowIsClosing.st new file mode 100644 index 000000000..aa549ada0 --- /dev/null +++ b/src/Squot.package/SquotSaveVersionDialog.class/instance/windowIsClosing.st @@ -0,0 +1,3 @@ +ui +windowIsClosing + self whileCancellingDo: [self updateMessageFromViews]. \ No newline at end of file diff --git a/src/Squot.package/SquotSaveVersionDialog.class/methodProperties.json b/src/Squot.package/SquotSaveVersionDialog.class/methodProperties.json index 084d7ace4..7ebd155a0 100644 --- a/src/Squot.package/SquotSaveVersionDialog.class/methodProperties.json +++ b/src/Squot.package/SquotSaveVersionDialog.class/methodProperties.json @@ -3,6 +3,7 @@ "themeProperties" : "jr 10/14/2018 00:52" }, "instance" : { "accept" : "tobe 6/6/2020 16:29", + "acceptMessage:" : "tobe 6/7/2020 19:49", "actionCommit" : "fn 4/11/2017 16:01", "activateNodeCommandLabel" : "jr 4/7/2019 22:30", "browseOtherEdition" : "jr 6/6/2020 01:04", @@ -12,14 +13,15 @@ "deactivateNodeCommandLabel" : "jr 4/7/2019 22:29", "defaultMessage" : "jr 10/14/2018 01:24", "excludeMethodsThatAreAssumedUnchanged" : "jr 5/22/2020 15:49", - "initialize" : "jr 11/18/2018 00:50", + "initialize" : "tobe 6/7/2020 20:22", "inspectOriginalArtifactCommandLabel" : "jr 11/18/2018 01:05", "message" : "jr 2/17/2017 17:03", "message:" : "tobe 6/6/2020 09:15", - "message:notifying:" : "tobe 6/6/2020 09:23", "messageWasChanged" : "jr 11/17/2018 23:19", "parentVersions:" : "jr 2/17/2017 19:34", "rootNodes" : "jr 2/26/2020 22:57", "updateMessageFromViews" : "jr 10/14/2018 01:30", - "widgetSpecs:" : "tobe 6/6/2020 09:18", + "whileCancellingDo:" : "tobe 6/7/2020 19:49", + "widgetSpecs:" : "tobe 6/7/2020 20:23", + "windowIsClosing" : "tobe 6/7/2020 19:54", "windowLabel" : "jr 11/18/2018 01:29" } } diff --git a/src/Squot.package/SquotSaveVersionDialog.class/properties.json b/src/Squot.package/SquotSaveVersionDialog.class/properties.json index 7e03d5d9b..67a56b17f 100644 --- a/src/Squot.package/SquotSaveVersionDialog.class/properties.json +++ b/src/Squot.package/SquotSaveVersionDialog.class/properties.json @@ -6,7 +6,8 @@ ], "commentStamp" : "jr 3/17/2018 19:48", "instvars" : [ - "message" ], + "message", + "cancelling" ], "name" : "SquotSaveVersionDialog", "pools" : [ ],