Use 'Discard Changes and Exit' instead of 'Forget it...'
authorStefan Vogel <sv@exept.de>
Thu, 04 Dec 2003 12:50:44 +0100
changeset 1772 e33aee13defe
parent 1771 1bb15bba99ee
child 1773 658685da5502
Use 'Discard Changes and Exit' instead of 'Forget it...' when trying to close an application with pending changes
UIHelpTool.st
UIPainter.st
--- a/UIHelpTool.st	Wed Dec 03 12:32:03 2003 +0100
+++ b/UIHelpTool.st	Thu Dec 04 12:50:44 2003 +0100
@@ -12,9 +12,9 @@
 
 "{ Package: 'stx:libtool2' }"
 
-ToolApplicationModel subclass:#UIHelpTool
-	instanceVariableNames:'specClass specSelector classItemList classItemModel keyItemModel
-		helpTextView modifiedHolder contentsModifiedChannel editModel'
+ResourceSpecEditor subclass:#UIHelpTool
+	instanceVariableNames:'classItemList classItemModel keyItemModel helpTextView
+		modifiedHolder contentsModifiedChannel editModel'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'Interface-UIPainter'
@@ -103,6 +103,14 @@
     ^'Help'
 ! !
 
+!UIHelpTool class methodsFor:'defaults'!
+
+resourceType
+    "get the type of the resource of the method generated by the UIHelpTool"
+
+    ^ #help
+! !
+
 !UIHelpTool class methodsFor:'help specs'!
 
 helpSpec
@@ -859,25 +867,6 @@
 
 !UIHelpTool methodsFor:'private'!
 
-askForModification
-    "asks for modification; launch a dialog if something is modified;
-     returns true if the modifications are accepted by user otherwise
-     false.
-    "
-    |dialog|
-
-    self modified ifTrue:[
-	dialog := YesNoBox title:(resources string:'List was modified !!')
-			 yesText:(resources string:'Forget it and proceed')
-			  noText:(resources string:'Cancel').
-
-	dialog showAtPointer.
-	dialog accepted ifFalse:[^ false].
-	self modified:false.
-    ].
-    ^ true
-!
-
 extractResourceFrom:aString
     "extracts class and selector from a resource string. On success
      an association with the key a class and the selector as value
@@ -998,10 +987,10 @@
 !UIHelpTool methodsFor:'startup & release'!
 
 closeRequest
-    "asks for permission before closing
-    "
-    (masterApplication isNil and:[self askForModification]) ifTrue:[
-	super closeRequest.
+    "asks for permission before closing"
+
+    masterApplication isNil ifTrue:[
+        super closeRequest.
     ].
 !
 
--- a/UIPainter.st	Wed Dec 03 12:32:03 2003 +0100
+++ b/UIPainter.st	Thu Dec 04 12:50:44 2003 +0100
@@ -2563,9 +2563,9 @@
 
     (modified or: [painter isModified or: [self helpTool modified]])
     ifTrue:[
-        ((YesNoBox title:(resources string:'Window Spec was modified !!'))        
+        ((YesNoBox title:(resources string:'Window spec was modified. Exit anyway?'))        
             noText:(resources string:'Cancel');
-            yesText:(resources string:'Forget it and proceed');
+            yesText:(resources string:'Discard Changes and Exit');
             showAtPointer;
             accepted) ifFalse: [^false].
         modified := false.