ChangesBrowser.st
changeset 1848 61054ff3d470
parent 1833 c9b1a30b326d
child 1996 e229ecc9f839
--- a/ChangesBrowser.st	Fri Aug 21 21:02:45 1998 +0200
+++ b/ChangesBrowser.st	Mon Aug 24 14:35:47 1998 +0200
@@ -307,6 +307,9 @@
                               ('search selector'              findSelector                        )
                               ('next with this selector'      findNextForSelector     #FindNext   )
                               ('previous with this selector'  findPreviousForSelector #FindPrev   )
+                              ('-'                                                                )
+                              ('next snapshot'                findNextSnapshot                    )
+                              ('previous snapshot'            findPreviousSnapshot                )
                      ).
         ] ifFalse:[
             items := #(
@@ -317,6 +320,9 @@
                               ('search selector'              findSelector                        )
                               ('next with this selector'      findNextForSelector                 )
                               ('previous with this selector'  findPreviousForSelector             )
+                              ('-'                                                                )
+                              ('next snapshot'                findNextSnapshot                    )
+                              ('previous snapshot'            findPreviousSnapshot                )
                      ).
         ].
         ^ PopUpMenu itemList:items resources:resources.
@@ -403,7 +409,7 @@
     ^ m
 
     "Modified: / 6.9.1995 / 17:14:22 / claus"
-    "Modified: / 14.8.1998 / 18:03:08 / cg"
+    "Modified: / 22.8.1998 / 15:50:17 / cg"
 !
 
 compare:aBoolean
@@ -2690,6 +2696,53 @@
     "Modified: / 18.6.1998 / 22:29:33 / cg"
 !
 
+findNextSnapshot
+    |savedCursor|
+
+    changeNrShown isNil ifTrue:[^ self].
+
+    self withCursor:Cursor questionMark do:[
+        |cls nr lastNr words chunk|
+
+        Object userInterruptSignal handle:[:ex |
+            self beep.
+            ^ self
+        ] do:[
+            lastNr := self numberOfChanges.
+            nr := changeNrShown + 1.
+            [nr <= lastNr] whileTrue:[
+                "
+                 get the chunk
+                "
+                chunk := changeChunks at:nr.
+                chunk isNil ifTrue:[^ nil].       "mhmh - empty"
+
+                (chunk startsWith:'''---') ifTrue:[
+                    words := chunk asCollectionOfWords.
+                    words size > 2 ifTrue:[
+                        (words at:2) = 'snapshot' ifTrue:[
+                            changeListView setSelection:nr .
+                            self changeSelection:nr.
+                            ^ self
+                        ].
+                    ].
+                ].
+                nr := nr + 1.
+            ].
+        ]
+    ].
+    self beep.
+
+    savedCursor := cursor.
+    self cursor:(Cursor cross).
+    Delay waitForMilliseconds:300.
+    self cursor:savedCursor
+
+    "Modified: / 18.4.1997 / 12:48:41 / stefan"
+    "Created: / 22.8.1998 / 15:58:49 / cg"
+    "Modified: / 22.8.1998 / 15:59:38 / cg"
+!
+
 findPrevious
     lastSearchType == #selector ifTrue:[
         ^ self findPreviousForSelector
@@ -2780,6 +2833,52 @@
     "Modified: / 18.6.1998 / 22:29:29 / cg"
 !
 
+findPreviousSnapshot
+    |savedCursor|
+
+    changeNrShown isNil ifTrue:[^ self].
+
+    self withCursor:Cursor questionMark do:[
+        |cls nr words chunk|
+
+        Object userInterruptSignal handle:[:ex |
+            self beep.
+            ^ self
+        ] do:[
+            nr := changeNrShown - 1.
+            [nr >= 1] whileTrue:[
+                "
+                 get the chunk
+                "
+                chunk := changeChunks at:nr.
+                chunk isNil ifTrue:[^ nil].       "mhmh - empty"
+
+                (chunk startsWith:'''---') ifTrue:[
+                    words := chunk asCollectionOfWords.
+                    words size > 2 ifTrue:[
+                        (words at:2) = 'snapshot' ifTrue:[
+                            changeListView setSelection:nr .
+                            self changeSelection:nr.
+                            ^ self
+                        ].
+                    ].
+                ].
+                nr := nr - 1.
+            ].
+        ]
+    ].
+    self beep.
+
+    savedCursor := cursor.
+    self cursor:(Cursor cross).
+    Delay waitForMilliseconds:300.
+    self cursor:savedCursor
+
+    "Modified: / 18.4.1997 / 12:48:41 / stefan"
+    "Modified: / 18.6.1998 / 22:29:44 / cg"
+    "Created: / 22.8.1998 / 15:57:34 / cg"
+!
+
 findSelector
     |sel current savedCursor search|
 
@@ -2873,5 +2972,5 @@
 !ChangesBrowser class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/ChangesBrowser.st,v 1.145 1998-08-14 16:04:01 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/ChangesBrowser.st,v 1.146 1998-08-24 12:35:47 cg Exp $'
 ! !