Added reference to help file.
"{ Package: 'stx:libscm/mercurial' }"
AbstractSourceCodeManagementSettingsAppl subclass:#HGSourceCodeManagementSettingsAppl
instanceVariableNames:'defaultLogo hgCommand hgDiff2Command hgDiff3Command hgAutopush'
classVariableNames:''
poolDictionaries:''
category:'SCM-Mercurial-StX-Interface'
!
!HGSourceCodeManagementSettingsAppl class methodsFor:'image specs'!
defaultIcon
^ self defaultIcon3
"Created: / 22-12-2011 / 13:47:11 / cg"
!
defaultIcon1
"This resource specification was automatically generated
by the ImageEditor of ST/X."
"Do not manually edit this!! If it is corrupted,
the ImageEditor may not be able to read the specification."
"
self defaultIcon1 inspect
ImageEditor openOnClass:self andSelector:#defaultIcon1
Icon flushCachedIcons
"
<resource: #image>
^Icon
constantNamed:'MercurialSourceCodeManagementSettingsAppl class defaultIcon1'
ifAbsentPut:[(Depth8Image new) width: 24; height: 24; photometric:(#palette); bitsPerSample:(#[8]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@PHCA@PEA D@@@@@@@@@@@@@@@@@@@@GA@ HB@ HB@$C
B @@@@@@@@@@@@@@@@,IB@ HB@ HB@ LA@4@@@@@@@@@@@@@C LLB@ HB@ HB@ HB@<P@@@@@@@@@@@@BPPHB@ HB@ HB@ HBADR@@@@@@@@@@@@D0$HB@ H
B@ HB@ HB@ SA@@@@@@@@@@@@APLB@ HB@ HB@ HB@ IEP@@@@@VA@LW@Q OC@ HB@ HB@ HB@ LFPD@@@DLBP\Q@@@ZF0 LB@ HB@ HB@ IF@X@@A0HA!!4^
@@@SF!!<_@@$HB@ HB@0FH@L@@BDI@AHC@@@@HP@O@BHIB@ HB@LFH0H@@@@ABQ0@@@@@@@@!!A@@DB@ HCA0OI@8@@@@@@@@@@A\@@@@@@@XDB@ HBP8%I D@
@@@@@@@BA@$D@P@@@@8IB@ LC P''C0@@@@@@@@DIB@ HBQ0@@@8LA@XA@Q<Y@0@@@@@@@@PLB@ DA@@@@@PCB" JC2T[@@@@@@@@@@PLB@PPBP@@@@P)JB$I
J!!HA@@@@@@@@@B,LBQXCKB,@A XACQP-F0L@@@@@@@@@@@(RK"T,D0@@BA,/LCD@L @@@@@@@@@@@@@@@ $!!@@@@@QTTC@ 3@@@@@@@@@@@@@@@@@@@@@@@@
@CP\L0@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@') ; colorMapFromArray:#[143 136 136 208 208 208 192 192 184 176 176 176 175 168 168 176 168 168 191 184 184 191 176 176 159 152 144 160 160 160 239 232 224 192 184 184 159 152 160 207 192 200 207 200 200 144 144 144 224 224 224 160 152 160 127 120 120 144 144 136 128 128 128 111 104 104 207 200 208 239 232 240 95 88 88 96 96 96 79 72 80 112 112 120 192 192 200 223 208 208 111 104 96 80 80 80 64 64 64 223 216 216 128 120 128 31 24 24 32 32 24 79 72 64 64 56 56 47 40 40 240 240 240 239 224 224 63 48 48 191 184 176 112 112 104 64 64 56 63 56 56 48 48 48 48 40 48 127 112 120 160 160 168 208 200 208 224 224 216]; mask:((Depth1Image new) width: 24; height: 24; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@G>@@O? @_?0@??8@??8@??<@??<O??>__?>_O?>_G?>NA?>@P_>A<_<C>_<C>_8C>_8C>?0C<? @8?@@@\@@@@@') ; yourself); yourself]
!
defaultIcon2
"This resource specification was automatically generated
by the ImageEditor of ST/X."
"Do not manually edit this!! If it is corrupted,
the ImageEditor may not be able to read the specification."
"
self defaultIcon2 inspect
ImageEditor openOnClass:self andSelector:#defaultIcon2
Icon flushCachedIcons
"
<resource: #image>
^Icon
constantNamed:'MercurialSourceCodeManagementSettingsAppl class defaultIcon2'
ifAbsentPut:[(Depth8Image new) width: 24; height: 24; photometric:(#palette); bitsPerSample:(#[8]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@PHCA@PEA D@@@@@@@@@@@@@@@@@@@@GA@ HB@ HB@$C
B @@@@@@@@@@@@@@@@,IB@ HB@ HB@ LA@4@@@@@@@@@@@@@C LLB@ HB@ HB@ HB@<P@@@@@@@@@@@@BPPHB@ HB@ HB@ HBADR@@@@@@@@@@@@D0$HB@ H
B@ HB@ HB@ SA@@@@@@@@@@@@APLB@ HB@ HB@ HB@ IEP@@@@@VA@LW@Q OC@ HB@ HB@ HB@ LFPD@@@DLBP\Q@@@ZF0 LB@ HB@ HB@ IF@X@@A0HA!!4^
@@@SF!!<_@@$HB@ HB@0FH@L@@BDI@AH:N#\7HP@O@BHIB@ HB@LFH0H@@@@ABS\:N#(:M0@!!A@@DB@ HCA0OI@8@@@@@M#(:@A\@@C\@@@XDB@ HBP8%I D@
@@@@M3 7A@$D@P@@@@8IB@ LC P''C0@@@C\7N#$:N0 HHA0@@@8LA@XA@Q<Y@0@@@@@7NS(7B@ HB@@@@PCB" JC2T[@@@@@@@@M34LBB@<OAP @@P)JB$I
J!!HA@@@@@@@@@B,LHB@YHB@ A XACQP-F0L@@@@@@@@ @@(RK"T H@@@BA,/LCD@L @@@@@@@@@@HB@ HB@ MP@@@QTTC@ 3@@@@@@@@@@@@@A$ HB@5@@@@
@CP\L0@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@') ; colorMapFromArray:#[143 136 136 208 208 208 192 192 184 176 176 176 175 168 168 176 168 168 191 184 184 191 176 176 159 152 144 160 160 160 239 232 224 192 184 184 159 152 160 207 192 200 207 200 200 144 144 144 224 224 224 160 152 160 127 120 120 144 144 136 128 128 128 111 104 104 207 200 208 239 232 240 95 88 88 96 96 96 79 72 80 112 112 120 192 192 200 223 208 208 111 104 96 80 80 80 64 64 64 223 216 216 128 120 128 31 24 24 32 32 24 79 72 64 64 56 56 47 40 40 240 240 240 239 224 224 63 48 48 191 184 176 112 112 104 64 64 56 63 56 56 48 48 48 48 40 48 127 112 120 160 160 168 208 200 208 224 224 216 0 0 0 0 64 0 32 96 32 96 192 128 32 128 64 32 160 64 32 128 32 32 32 32 32 64 32]; mask:((Depth1Image new) width: 24; height: 24; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@G>@@O? @_?0@??8@??8@??<@??<O??>__?>_O?>_??>O=?>GR_>G<_<_>_<O>_8G?_8C??0K<? G<?@C8\@@@@@') ; yourself); yourself]
!
defaultIcon3
"This resource specification was automatically generated
by the ImageEditor of ST/X."
"Do not manually edit this!! If it is corrupted,
the ImageEditor may not be able to read the specification."
"
self defaultIcon3 inspect
ImageEditor openOnClass:self andSelector:#defaultIcon3
Icon flushCachedIcons
"
<resource: #image>
^Icon
constantNamed:'HGSourceCodeManagementSettingsAppl defaultIcon3'
ifAbsentPut:[(Depth8Image new) width: 24; height: 24; photometric:(#palette); bitsPerSample:(#[8]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@PHCA@PEA D@@@@@@@@@@@@@@@@@@@@GA@ HB@ HB@$C
B @@@@@@@@@@@@@@@@,IB@ HB@ HB@ LA@4@@@@@@@@@@@@@C LLB@ HB@ HB@ HB@<N@@@@@@@@@@@@BPPHB@ HB@ HB@ HBADR@@@@@@@@@@@@D0$HB@ H
B@ HB@ HB@ SA@@@@@@@@@@@@APLB@ HB@ HB@ HB@ IEP@@@@@VA@LW@Q OC@ HB@ HB@ HB@ LFPD@@@DLBP\Q@@@ZF0 LB@ HB@ HB@ IF@X@@A0HA!!4^
@@@SF!!<_@@$HB@ HB@0FH@L@@BDI@AH:N#\7HP@O@BHIB@ HB@LFH0H@@@@ABS\:N#(:M0@!!A@@DB@ HCA0OI@8@@@@@M#(:@A\@@C\@@@XDB@ HBP8%I D@
@@@@M3 7A@$D@P@@@@8IB@ LDA@''C0@@@C\7N#$:N0 HOA0@@@8LA@XADA@Y@0@@@@@7NS(7B@ <OC0@@@PCB" JDA@[@@@@@@@@M4@LBC0?O38<@@P)DA@P
DA@PDA@@@@@@@B,LOC0=OC0<A XADA@PDA@PDA@@@@@<@@(RK"T<O@@@BA,/LCD@DA@@@@@@@@@@OC0<OC0<MP@@@QTTC@ 3DA@@@@@@@@@@@C4<OC05@@@@
@CP\L0@@DA@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@') ; colorMapFromArray:#[174 169 169 255 255 255 233 233 230 216 216 216 213 209 209 214 209 209 232 229 229 229 223 223 191 187 181 197 197 197 255 255 255 233 230 230 194 189 194 247 244 245 251 250 250 177 177 177 131 0 0 194 189 194 155 149 149 175 175 169 157 157 157 136 128 128 251 251 251 255 255 255 117 108 108 118 118 118 97 89 98 139 139 147 240 240 242 255 255 255 137 128 118 98 98 98 79 79 79 255 255 255 156 149 156 38 30 30 39 39 30 97 89 79 79 69 69 58 49 49 255 255 255 255 255 255 77 59 59 229 226 223 137 137 128 79 79 69 77 69 69 59 59 59 59 49 59 154 140 147 199 199 204 251 251 251 255 255 255 0 0 0 0 64 0 32 96 32 96 192 128 32 128 64 32 160 64 32 128 32 64 64 64 96 96 96 128 128 128 32 32 32 32 64 32]; mask:((Depth1Image new) width: 24; height: 24; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@G>@@O? @_?0@??8@??8@??<@??<O??>__?>_O?>_??>O=?>GR_>G<_<_>_<O>_8G?_>C??>K<?0G<?0C8\0@@@@') ; yourself); yourself]
!
defaultLogo
^ HGIconLibrary hgLogo2
"Created: / 04-10-2012 / 19:01:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
"Modified: / 15-11-2012 / 23:12:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!HGSourceCodeManagementSettingsAppl class methodsFor:'interface specs'!
windowSpec
"This resource specification was automatically generated
by the UIPainter of ST/X."
"Do not manually edit this!! If it is corrupted,
the UIPainter may not be able to read the specification."
"
UIPainter new openOnClass:HGSourceCodeManagementSettingsAppl andSelector:#windowSpec
HGSourceCodeManagementSettingsAppl new openInterface:#windowSpec
HGSourceCodeManagementSettingsAppl open
"
<resource: #canvas>
^
#(FullSpec
name: windowSpec
window:
(WindowSpec
label: 'SubVersion Settings'
name: 'SubVersion Settings'
min: (Point 10 10)
bounds: (Rectangle 0 0 695 627)
)
component:
(SpecCollection
collection: (
(LabelSpec
label: ' Mercurial Settings'
name: 'MercurialSettingsTitle'
layout: (LayoutFrame 0 0 0 0 0 1 66 0)
style: (FontDescription helvetica medium roman 18 #'iso10646-1')
backgroundColor: (Color 100.0 100.0 100.0)
translateLabel: true
adjust: left
)
(LabelSpec
label: 'Logo'
name: 'MercurialLogo'
layout: (LayoutFrame -71 1 -1 0 4 1 65 0)
hasCharacterOrientedLabel: false
backgroundColor: (Color 100.0 100.0 100.0)
translateLabel: true
labelChannel: defaultLogo
)
(CheckBoxSpec
label: 'Show in Menus'
name: 'CheckBox1'
layout: (LayoutFrame 0 0 73 0 0 1 95 0)
activeHelpKey: shownInBrowserMenus
model: shownInBrowserMenusHolder
translateLabel: true
)
(ViewSpec
name: 'Settings'
layout: (LayoutFrame 0 0 105 0 0 1 0 1)
component:
(SpecCollection
collection: (
(VerticalPanelViewSpec
name: 'GeneralSettingsPanel'
layout: (LayoutFrame 0 0 0 0 0 1 0 1)
horizontalLayout: fit
verticalLayout: top
horizontalSpace: 3
verticalSpace: 3
component:
(SpecCollection
collection: (
(ViewSpec
name: 'Panel1'
component:
(SpecCollection
collection: (
(LabelSpec
label: '''hg'' command:'
name: 'CommandLabel'
layout: (LayoutFrame 5 0 0 0 100 0 30 0)
translateLabel: true
adjust: left
)
(FilenameInputFieldSpec
name: 'HGCommand'
layout: (LayoutFrame 105 0 0 0 -100 1 0 1)
model: hgCommand
acceptOnPointerLeave: true
emptyFieldReplacementText: 'Autodetect'
)
(ActionButtonSpec
label: 'Test'
name: 'HGCommandTest'
layout: (LayoutFrame -100 1 0 0 -8 1 0 1)
translateLabel: true
model: doTestHGCommand
enableChannel: svnEnabled
)
)
)
extent: (Point 695 25)
)
(ViewSpec
name: 'Spacer'
extent: (Point 695 15)
)
(FramedBoxSpec
label: 'External Tools'
name: 'ToolsSettings'
initiallyInvisible: true
labelPosition: topLeft
translateLabel: true
component:
(SpecCollection
collection: (
(LabelSpec
label: 'Diff2:'
name: 'Label1'
layout: (LayoutFrame 0 0 0 0 80 0 30 0)
translateLabel: true
adjust: left
)
(FilenameInputFieldSpec
name: 'FilenameEntryField1'
layout: (LayoutFrame 80 0 3 0 0 1 28 0)
enableChannel: svnEnabled
model: hgDiff2Command
acceptOnPointerLeave: true
)
(LabelSpec
label: 'Diff3:'
name: 'Label2'
layout: (LayoutFrame 0 0 30 0 80 0 0 1.0)
translateLabel: true
adjust: left
)
(FilenameInputFieldSpec
name: 'FilenameEntryField2'
layout: (LayoutFrame 80 0 33 0 0 1 58 0)
enableChannel: svnEnabled
model: hgDiff3Command
acceptOnPointerLeave: true
)
)
)
extent: (Point 695 95)
)
(FramedBoxSpec
label: 'Debugging'
name: 'DebugSettings'
initiallyInvisible: true
labelPosition: topLeft
translateLabel: true
component:
(SpecCollection
collection: (
(VerticalPanelViewSpec
name: 'VerticalPanel1'
layout: (LayoutFrame 0 0 0 0 0 1 0 1)
horizontalLayout: fit
verticalLayout: top
horizontalSpace: 3
verticalSpace: 3
component:
(SpecCollection
collection: (
(CheckBoxSpec
label: 'Verbose (Traces svn commands to Transcript)'
name: 'Verbose'
enableChannel: svnEnabled
model: svnVerbose
translateLabel: true
useDefaultExtent: true
)
)
)
)
)
)
extent: (Point 695 70)
)
(CheckBoxSpec
label: 'Automatically push changes to upstream repository'
name: 'CheckBox2'
model: hgAutopush
translateLabel: true
extent: (Point 695 22)
)
)
)
)
)
)
)
)
)
)
! !
!HGSourceCodeManagementSettingsAppl class methodsFor:'queries'!
managerClass
"backlink to my manager class (needed by the settings app)"
^ HGSourceCodeManager
"Created: / 19-04-2011 / 12:46:52 / cg"
"Modified: / 13-11-2012 / 22:15:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!HGSourceCodeManagementSettingsAppl methodsFor:'actions'!
doTestHGCommand
self hgCommand value isEmptyOrNil ifTrue:[
self doTestHGCommand: HGCommand hgCommand
] ifFalse:[
self doTestHGCommand: self hgCommand value
]
"Created: / 19-11-2012 / 21:32:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
"Modified: / 21-01-2013 / 04:59:14 / jv"
!
doTestHGCommand: command
| version versionString |
(OperatingSystem canExecuteCommand: command) ifFalse:[
Dialog warn: 'Cannot execute hg command.\\Make sure Metcurial is installed and PATH is set up correctly' withCRs.
^self.
].
[
versionString := OperatingSystem getCommandOutputFrom:('"%1" --version' bindWith:command).
version := (HGCommandParser on: versionString) parseCommandVersion.
(HGCommand hgVersionIsSupported:version) ifTrue:[
Dialog information: ('Installed Mercurial version is OK.\\Reported version: ', versionString) withCRs.
] ifFalse:[
Dialog warn: ('Installed Mercurial is not (yet) supported.\\Reported version: ', versionString) withCRs.
].
] on: HGCommandError do:[
Dialog warn: 'Failed to read ''',command,' --version'''.
^self
].
"Created: / 19-11-2012 / 21:32:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
"Modified: / 21-01-2013 / 05:12:39 / jv"
! !
!HGSourceCodeManagementSettingsAppl methodsFor:'aspects'!
hgAutopush
hgAutopush isNil ifTrue:[
hgAutopush := self settingsAspectFor: #hgAutopush
].
^ hgAutopush
"Created: / 10-12-2012 / 02:38:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
hgCommand
hgCommand isNil ifTrue:[
hgCommand := self settingsAspectFor: #hgCommand
].
^ hgCommand
"Modified: / 19-11-2012 / 21:30:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
hgDiff2Command
hgDiff2Command isNil ifTrue:[
hgDiff2Command := self settingsAspectFor: #hgDiff2Command
].
^ hgDiff2Command
"Created: / 19-11-2012 / 21:30:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
hgDiff3Command
hgDiff3Command isNil ifTrue:[
hgDiff3Command := self settingsAspectFor: #hgDiff3Command
].
^ hgDiff3Command
"Created: / 19-11-2012 / 21:30:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
settings
^#(hgCommand hgAutopush)
"Created: / 10-12-2012 / 02:40:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!HGSourceCodeManagementSettingsAppl methodsFor:'helpers'!
settingsAspectFor: settingName
|holder|
self createBuilder.
(holder := builder bindingAt:settingName) isNil ifTrue:[
holder := (currentUserPrefs perform: settingName asSymbol) asValue.
holder onChangeSend:#updateModifiedChannel to:self.
builder aspectAt:settingName put:holder
].
^ holder.
"Created: / 25-05-2009 / 18:43:42 / Jan Vrany <vranyj1@fel.cvut.cz>"
"Modified: / 22-12-2011 / 15:13:37 / cg"
! !
!HGSourceCodeManagementSettingsAppl methodsFor:'protocol'!
basicReadSettings
self shownInBrowserMenusHolder value:HGSourceCodeManager shownInBrowserMenus.
self readAspects:self settings from:currentUserPrefs
"Modified: / 10-12-2012 / 02:41:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
basicSaveSettings
HGSourceCodeManager shownInBrowserMenus:self shownInBrowserMenusHolder value.
self writeAspects: self settings to: currentUserPrefs
"Modified: / 10-12-2012 / 02:40:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
help
|filename|
filename := self helpFilename.
filename isNil ifTrue:[
self warn:(self resources string:'Sorry - no Help available here.').
^ self.
].
self withWaitCursorDo:[
| file |
file := HTMLDocumentView helpFileFor: filename.
file isNil ifTrue:[
file := (Smalltalk getPackageDirectoryForPackage: self class package) / 'docs' / 'html' / 'ch01s02.html'.
].
file exists ifTrue:[
HTMLDocumentView openDocumentation: file.
] ifFalse:[
self warn:'Missing help file: doc/online/<language>/help/' , filename,'\\You can download missing files from "www.exept.de".' withCRs.
]
].
"Created: / 22-01-2013 / 20:39:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
helpFilename
"subclasses must return the relative name of a helpFile
in the doc/online/<language>/help directory.
Or nil, if no help is available."
^'mercurial/ch01s02.html'.
"
HGSourceCodeManagementSettingsAppl basicNew help
"
"Modified (comment): / 22-01-2013 / 20:37:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!HGSourceCodeManagementSettingsAppl methodsFor:'queries'!
hasUnsavedChanges
(HGSourceCodeManager shownInBrowserMenus ~= self shownInBrowserMenusHolder value)
ifTrue:[^ true].
^ self hasChangedAspectIn:self settings asComparedTo: currentUserPrefs
"Modified: / 10-12-2012 / 02:40:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!HGSourceCodeManagementSettingsAppl class methodsFor:'documentation'!
version_HG
^ '$Changeset: <not expanded> $'
!
version_SVN
^ '§Id:: §'
! !