ApplicationWithFileHistory.st
author Stefan Vogel <sv@exept.de>
Mon, 13 Mar 2017 09:54:33 +0100
changeset 3941 dd9237d3a727
parent 3229 0ed3ebd3ab4b
child 4021 503aea13fab1
permissions -rw-r--r--
#BUGFIX by stefan class: MIMETypes application/xml -> #isXmlType
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3229
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
 COPYRIGHT (c) 2013 by Claus Gittinger
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
              All Rights Reserved
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
 This software is furnished under a license and may be used
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 hereby transferred.
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
"
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
"{ Package: 'stx:libview2' }"
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
ApplicationModel subclass:#ApplicationWithFileHistory
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
	instanceVariableNames:''
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
	classVariableNames:''
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	poolDictionaries:''
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	category:'Interface-Framework'
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
!
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
ApplicationWithFileHistory class instanceVariableNames:'fileHistory'
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
"
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
 The following class instance variables are inherited by this class:
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
	ApplicationModel - ClassResources
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
	Model - 
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
	Object - 
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
"
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
!
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
!ApplicationWithFileHistory class methodsFor:'documentation'!
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
copyright
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
"
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
 COPYRIGHT (c) 2013 by Claus Gittinger
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
              All Rights Reserved
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
 This software is furnished under a license and may be used
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
 only in accordance with the terms of that license and with the
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
 inclusion of the above copyright notice.   This software may not
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
 be provided or otherwise made available to, or used by, any
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
 other person.  No title to or ownership of the software is
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
 hereby transferred.
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
"
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
!
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
documentation
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
"
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
    Support code for applications with a persistent history of 
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
    previously opened files.
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
    [author:]
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
        Claus Gittinger
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
    [see also:]
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
        StandardSystemView
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
        WindowGroup DeviceWorkstation
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
"
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
! !
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
!ApplicationWithFileHistory class methodsFor:'file history support'!
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
addToFileHistory:aFilename
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
    |fileHistory|
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
    fileHistory := self fileHistory.
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
    fileHistory synchronized:[
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
        fileHistory addFirst:aFilename asFilename.
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
        fileHistory size > self fileHistorySize ifTrue:[
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
            fileHistory removeLast.
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
        ].
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
        self makeFileHistoryPersistent
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
    ]
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
    "Modified: / 09-11-2010 / 16:07:14 / cg"
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
!
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
directoryForFileHistory
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
    ^ Filename homeDirectory / '.smalltalk' / (self nameWithoutPrefix)
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
    "
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
     self directoryForFileHistory
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
    "
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
!
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
fetchFileHistoryFromPersistentStore
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
    |k index value dir fn|
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
    fileHistory := OrderedSet new.
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
    OperatingSystem isMSWINDOWSlike ifTrue:[
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
        k := self registryKeyForFileHistory.
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
        index := 1.
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
        [
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
            value := k valueNamed:(index printString).
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
            value notNil
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
        ] whileTrue:[
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
            fileHistory add:value asFilename.
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
            index := index + 1
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
        ].
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
    ] ifFalse:[
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
        dir := self directoryForFileHistory.
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
        dir exists ifTrue:[
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
            fn := dir / 'history'.
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
            fn exists ifTrue:[
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
                fileHistory addAll:(fn contents collect:[:s | s asFilename])
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
            ]
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
        ]
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
    ]
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
!
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   112
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   113
fileHistory
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   114
    fileHistory isNil ifTrue:[
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   115
        self initializeFileHistory
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
    ].
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
    ^ fileHistory
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
!
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
fileHistorySize
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
    "defines the number of remembered files in the history"
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
    ^ 20.
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   124
!
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
initializeFileHistory
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
    fileHistory := OrderedSet new.
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
    self fetchFileHistoryFromPersistentStore.
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
!
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
makeFileHistoryPersistent
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   132
    |k index dir fn|
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
    OperatingSystem isMSWINDOWSlike ifTrue:[
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   135
        k := self registryKeyForFileHistory.
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
        fileHistory doWithIndex:[:filePath :index |
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
            k valueNamed:(index printString) put:filePath asFilename pathName.
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
        ].
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
        "/ remove the remaining keys
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   141
        index := fileHistory size + 1.
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   142
        [
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   143
            k deleteValueNamed:(index printString)
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
        ] whileTrue:[
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
            index := index + 1
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   146
        ].
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   147
    ] ifFalse:[
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   148
        (dir := self directoryForFileHistory) exists ifFalse:[
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   149
            dir recursiveMakeDirectory
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   150
        ].
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   151
        fn := dir / 'history'.
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   152
        fn contents:(fileHistory collect:[:fn | fn pathName]).
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
    ]
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   154
!
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   155
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   156
registryKeyForApplication
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   157
    "HKEY_CURRENT_USER\Software\Exept\SmalltalkX\<appname>"
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   158
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   159
    |k_software k_exept k_stx k_app keyName|
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   160
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   161
    OperatingSystem isMSWINDOWSlike ifTrue:[
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   162
        keyName := self nameWithoutPrefix.
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   163
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   164
        k_software := Win32OperatingSystem registryEntry key:'HKEY_CURRENT_USER\Software\'.
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   165
        (k_exept := k_software subKeyNamed:'Exept') isNil ifTrue:[
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   166
            k_exept := k_software createSubKeyNamed:'Exept'
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   167
        ].
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   168
        (k_stx := k_exept subKeyNamed:'SmalltalkX') isNil ifTrue:[
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   169
            k_stx := k_exept createSubKeyNamed:'SmalltalkX'
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   170
        ].
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   171
        (k_app := k_stx subKeyNamed:keyName) isNil ifTrue:[
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   172
            k_app := k_stx createSubKeyNamed:keyName
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   173
        ].
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   174
        ^ k_app
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   175
    ].
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   176
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   177
    ^ nil
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   178
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   179
    "
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   180
     self registryKeyForApplication 
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   181
    "
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   182
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   183
    "Created: / 11-01-2011 / 19:58:26 / cg"
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   184
!
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   185
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   186
registryKeyForFileHistory
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   187
    "HKEY_CURRENT_USER\Software\Exept\SmalltalkX\<appName>\History"
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   188
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   189
    |k_app k_history|
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   190
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   191
    OperatingSystem isMSWINDOWSlike ifTrue:[
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
        k_app := self registryKeyForApplication.
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
        (k_history := k_app subKeyNamed:'History') isNil ifTrue:[
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
            k_history := k_app createSubKeyNamed:'History'
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   195
        ].
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   196
        ^ k_history
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   197
    ].
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   198
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
    ^ nil
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   200
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   201
    "
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   202
     self registryKeyForFileHistory
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   203
    "
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   204
! !
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   205
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   206
!ApplicationWithFileHistory class methodsFor:'documentation'!
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   207
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   208
version
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   209
    ^ '$Header: /cvs/stx/stx/libview2/ApplicationWithFileHistory.st,v 1.1 2013-09-05 22:23:55 cg Exp $'
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   210
!
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   211
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   212
version_CVS
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   213
    ^ '$Header: /cvs/stx/stx/libview2/ApplicationWithFileHistory.st,v 1.1 2013-09-05 22:23:55 cg Exp $'
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   214
! !
0ed3ebd3ab4b initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   215