Faculty of Information Technology
Software Engineering Group

Ticket #79: HGSourceCodeManagementSettingsAppl-doSelectHGCommand.st

File HGSourceCodeManagementSettingsAppl-doSelectHGCommand.st, 1.0 KB (added by Jan Vrany, 3 years ago)
Line 
1"{ Encoding: utf8 }" !
2!HGSourceCodeManagementSettingsAppl methodsFor:'actions'!
3
4doSelectHGCommand
5    | guess executable |
6
7    guess := self hgCommand value asNilIfEmpty.
8    guess isNil ifTrue:[ guess := HGCommand hgCommand ].
9    guess notNil ifTrue:[ guess := guess asFilename ].
10    [ guess notNil and:[ guess exists not ] ] whileTrue:[
11        | p |
12
13        p := guess directory.
14        (p notNil and:[ p pathName = guess pathName ]) ifTrue:[
15            p := nil.
16        ].
17        guess := p.
18    ].
19    guess isNil ifTrue:[
20        guess := HGCommand hgCommand.
21    ].
22    executable := Dialog requestFileName:(resources string:'Select hg command') default: guess ifFail:[ ^ self ].
23    self infoPanel hide. 
24    (executable includes: Character space) ifTrue:[
25        executable := '"' , executable , '"'.
26    ].
27    self hgCommand value: executable
28
29    "Created: / 21-02-2014 / 10:13:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
30    "Modified: / 17-07-2014 / 19:39:31 / jv"
31    "Modified: / 23-05-2016 / 23:52:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
32! !
33