mercurial/HGCommitDialog.st
author vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
Thu, 15 Nov 2012 10:26:04 +0000
changeset 55 30d72a8f4501
parent 54 66045198bfbc
child 57 47b14a8b7eb8
permissions -rw-r--r--
Commit support

"{ Package: 'stx:libscm/mercurial' }"

SCMAbstractCommitDialog subclass:#HGCommitDialog
	instanceVariableNames:'defaultLogo'
	classVariableNames:''
	poolDictionaries:''
	category:'SCM-Mercurial-StX-Interface'
!


!HGCommitDialog class methodsFor:'image specs'!

dialogIcon
    ^ HGIconLibrary hgLogo1

    "Created: / 14-11-2012 / 00:14:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!HGCommitDialog class methodsFor:'interface specs'!

fileListColumnSpec
    "This resource specification was automatically generated
     by the DataSetBuilder of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the DataSetBuilder may not be able to read the specification."

    "
     DataSetBuilder new openOnClass:SVN::CommitDialog2 andSelector:#fileListColumnSpec
    "

    <resource: #tableColumns>

    ^#(
      (DataSetColumnSpec
         label: ''
         activeHelpKey: ''
         activeHelpKeyForLabel: ''
         labelButtonType: None
         width: 22
         minWidth: 22
         editorType: CheckToggle
         rendererType: CheckToggle
         model: include
         menuFromApplication: false
         printSelector: include
         showRowSeparator: false
         showColSeparator: false
       )
      (DataSetColumnSpec
         label: ''
         activeHelpKey: ''
         activeHelpKeyForLabel: ''
         labelButtonType: Button
         width: 22
         minWidth: 22
         menuFromApplication: false
         printSelector: statusIcon
         canSelect: false
         showRowSeparator: false
         showColSeparator: false
       )
      (DataSetColumnSpec
         label: 'Container'
         labelAlignment: left
         activeHelpKey: ''
         activeHelpKeyForLabel: ''
         labelButtonType: Button
         menuFromApplication: false
         printSelector: pathText
         canSelect: false
         showRowSeparator: false
         showColSeparator: false
       )
    "
      (DataSetColumnSpec
         label: 'Rev'
         activeHelpKey: ''
         activeHelpKeyForLabel: ''
         labelButtonType: Button
         usePreferredWidth: true
         menuFromApplication: false
         printSelector: revision
         canSelect: false
         showRowSeparator: false
         showColSeparator: false
       )
      (DataSetColumnSpec
         label: 'Author'
         labelAlignment: left
         activeHelpKey: ''
         activeHelpKeyForLabel: ''
         labelButtonType: Button
         usePreferredWidth: true
         menuFromApplication: false
         printSelector: author
         canSelect: false
         showRowSeparator: false
         showColSeparator: false
       )
      (DataSetColumnSpec
         label: 'Date'
         activeHelpKey: ''
         activeHelpKeyForLabel: ''
         labelButtonType: Button
         usePreferredWidth: true
         menuFromApplication: false
         printSelector: date
         canSelect: false
         showRowSeparator: false
         showColSeparator: false
       )
        "
      )

    "Created: / 15-11-2012 / 09:28:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!HGCommitDialog methodsFor:'change & update'!

updateFileList
    | wcroot statuses entries showOnlyModified wcrootPathNameRelativeLen |

    showOnlyModified := fileListShowOnlyModifiedHolder value.
    "HACK..."

    wcroot := self model package root.
    wcrootPathNameRelativeLen := wcroot pathNameRelative size + 2.
    statuses := HGCommand status
                    workingDirectory: wcroot pathName;
                    execute.
    entries := OrderedCollection new: statuses size.
    statuses do:[:statusAndPath|
        (fileListShowOnlyModifiedHolder not
            or:[statusAndPath first isCleanOrIgnored not]) ifTrue:[
            | nm entry |

            nm := (statusAndPath second copyFrom:wcrootPathNameRelativeLen).
            entry := SCMAbstractCommitDialog::FileEntry application: self entry: wcroot / nm name: nm.
            entries add: entry
        ].
    ].
    self fileListHolder value: entries

    "Created: / 08-02-2012 / 18:05:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 15-11-2012 / 09:33:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!HGCommitDialog class methodsFor:'documentation'!

version_HG
    "Never, ever change this method. Ask JV or CG why"
    ^thisContext method mclass theNonMetaclass instVarNamed: #revision
!

version_SVN
    ^ '§Id::                                                                                                                        §'
! !