AbstractSettingsApplication.st
changeset 19508 2490ab8b3297
parent 19507 e7213639d5eb
child 19509 1d06f6d24022
--- a/AbstractSettingsApplication.st	Sat Feb 22 00:43:00 2020 +0100
+++ b/AbstractSettingsApplication.st	Sat Feb 22 00:55:35 2020 +0100
@@ -13520,50 +13520,51 @@
 !AbstractSettingsApplication::RDoItServerSettingsAppl methodsFor:'actions'!
 
 basicReadSettings
-    |rDoitsEnabled rDoitLogging rDoitErrorLogging rDoitErrorDebugging rDoitServerPortOrPath
-     rDoitEnabledOnlyViaLocalConnection
-     scriptingEnabled scriptingEnabledOnlyViaLocalConnection scriptingLogging
-     scriptingErrorLogging scriptingErrorDebugging|
-
-    rDoitsEnabled := false.
-    rDoitLogging := false.
-    rDoitErrorLogging := false.
-    rDoitErrorDebugging := false.
-    rDoitServerPortOrPath := ''.
-    rDoitEnabledOnlyViaLocalConnection := true.
-
-    scriptingEnabled := false.
-    scriptingEnabledOnlyViaLocalConnection := true.
+    |rDoitsEnabledNew rDoitLoggingNew rDoitErrorLoggingNew rDoitErrorDebuggingNew rDoitServerPortOrPathNew
+     rDoitEnabledOnlyViaLocalConnectionNew
+     scriptingEnabledNew scriptingEnabledOnlyViaLocalConnectionNew scriptingLoggingNew
+     scriptingErrorLoggingNew scriptingErrorDebuggingNew|
+
+    rDoitsEnabledNew := false.
+    rDoitLoggingNew := false.
+    rDoitErrorLoggingNew := false.
+    rDoitErrorDebuggingNew := false.
+    rDoitServerPortOrPathNew := ''.
+    rDoitEnabledOnlyViaLocalConnectionNew := true.
+
+    scriptingEnabledNew := false.
+    scriptingEnabledOnlyViaLocalConnectionNew := true.
 
     (self hasRDoitServer) ifTrue:[
-        rDoitsEnabled := RDoItServer serverRunning.
-        rDoitEnabledOnlyViaLocalConnection := RDoItServer localConnectionsOnly.
-        rDoitLogging := RDoItServer isLogging.
-        rDoitErrorLogging := RDoItServer isErrorLogging.
-        rDoitErrorDebugging := RDoItServer isErrorCatching not.
-        rDoitServerPortOrPath := RDoItServer defaultPortNumberOrPath asString.
+        rDoitsEnabledNew := RDoItServer serverRunning.
+        rDoitEnabledOnlyViaLocalConnectionNew := RDoItServer localConnectionsOnly.
+        rDoitLoggingNew := RDoItServer isLogging.
+        rDoitErrorLoggingNew := RDoItServer isErrorLogging.
+        rDoitErrorDebuggingNew := RDoItServer isErrorCatching not.
+        rDoitServerPortOrPathNew := RDoItServer defaultPortNumberOrPath asString.
     ].
 
     (STXScriptingServer notNil
     and:[ STXScriptingServer isLoaded ]) ifTrue:[
-        scriptingEnabled := STXScriptingServer serverRunning.
-        scriptingEnabledOnlyViaLocalConnection := STXScriptingServer localConnectionsOnly.
-        scriptingLogging := STXScriptingServer isLogging.
-        scriptingErrorLogging := STXScriptingServer isErrorLogging.
-        scriptingErrorDebugging := STXScriptingServer isErrorDebugging.
-    ].
-
-    self rDoitsEnabled value:rDoitsEnabled.
-    self rDoitLogging value:rDoitLogging.
-    self rDoitErrorLogging value:rDoitErrorLogging.
-    self rDoitErrorDebugging value:rDoitErrorDebugging.
-    self rDoitServerPortOrPath value:rDoitServerPortOrPath.
-
-    self scriptingEnabled value:scriptingEnabled.
-    self scriptingEnabledOnlyViaLocalConnection value:scriptingEnabledOnlyViaLocalConnection.
-    self scriptingLogging value:scriptingLogging.
-    self scriptingErrorLogging value:scriptingErrorLogging.
-    self scriptingErrorDebugging value:scriptingErrorDebugging.
+        scriptingEnabledNew := STXScriptingServer serverRunning.
+        scriptingEnabledOnlyViaLocalConnectionNew := STXScriptingServer localConnectionsOnly.
+        scriptingLoggingNew := STXScriptingServer isLogging.
+        scriptingErrorLoggingNew := STXScriptingServer isErrorLogging.
+        scriptingErrorDebuggingNew := STXScriptingServer isErrorDebugging.
+    ].
+
+    rDoitsEnabled value:rDoitsEnabledNew.
+    rDoitLogging value:rDoitLoggingNew.
+    rDoitErrorLogging value:rDoitErrorLoggingNew.
+    rDoitErrorDebugging value:rDoitErrorDebuggingNew.
+    rDoitServerPortOrPath value:rDoitServerPortOrPathNew.
+    rDoitOnlyViaLocalConnection value:rDoitEnabledOnlyViaLocalConnectionNew.
+
+    scriptingEnabled value:scriptingEnabledNew.
+    scriptingEnabledOnlyViaLocalConnection value:scriptingEnabledOnlyViaLocalConnectionNew.
+    scriptingLogging value:scriptingLoggingNew.
+    scriptingErrorLogging value:scriptingErrorLoggingNew.
+    scriptingErrorDebugging value:scriptingErrorDebuggingNew.
 
     "Modified: / 20-05-2010 / 14:49:50 / cg"
 !
@@ -13575,11 +13576,11 @@
 
     self hasRDoitServerClass ifTrue:[
         RDoItServer defaultPortNumberOrPath:portOrPath.
-        RDoItServer logging:self rDoitLogging value.
-        RDoItServer errorLogging:self rDoitErrorLogging value.
-        RDoItServer errorCatching:(self rDoitErrorDebugging value not).
-        RDoItServer localConnectionsOnly:(self rDoitEnabledOnlyViaLocalConnection value).
-        shouldRun := self rDoitsEnabled value.
+        RDoItServer logging:rDoitLogging value.
+        RDoItServer errorLogging:rDoitErrorLogging value.
+        RDoItServer errorCatching:(rDoitErrorDebugging value not).
+        RDoItServer localConnectionsOnly:(rDoitEnabledOnlyViaLocalConnection value).
+        shouldRun := rDoitsEnabled value.
         shouldRun ~~ RDoItServer serverRunning ifTrue:[
             shouldRun ifFalse:[
                 RDoItServer stop
@@ -13596,11 +13597,11 @@
     ].
 
     self hasScriptingServerClass ifTrue:[
-        STXScriptingServer logging:self scriptingLogging value.
-        STXScriptingServer errorLogging:self scriptingErrorLogging value.
-        STXScriptingServer errorDebugging:(self scriptingErrorDebugging value).
-        STXScriptingServer localConnectionsOnly:(self scriptingEnabledOnlyViaLocalConnection value).
-        shouldRun := self scriptingEnabled value.
+        STXScriptingServer logging:scriptingLogging value.
+        STXScriptingServer errorLogging:scriptingErrorLogging value.
+        STXScriptingServer errorDebugging:(scriptingErrorDebugging value).
+        STXScriptingServer localConnectionsOnly:(scriptingEnabledOnlyViaLocalConnection value).
+        shouldRun := scriptingEnabled value.
         shouldRun ~~ STXScriptingServer serverRunning ifTrue:[
             shouldRun ifFalse:[
                 STXScriptingServer stop
@@ -13622,7 +13623,7 @@
 getPortNumberOrPath
     |portOrPath nrOrNil|
 
-    portOrPath := self rDoitServerPortOrPath value.
+    portOrPath := rDoitServerPortOrPath value.
     portOrPath isNumber ifFalse:[
         "a numeric string means it is a TCP port number"
         nrOrNil := Integer readFrom:portOrPath onError:nil.
@@ -13636,113 +13637,58 @@
 !AbstractSettingsApplication::RDoItServerSettingsAppl methodsFor:'aspects'!
 
 rDoitEnabledOnlyViaLocalConnection
-    rDoitEnabledOnlyViaLocalConnection isNil ifTrue:[
-        rDoitEnabledOnlyViaLocalConnection := true asValue.
-        rDoitEnabledOnlyViaLocalConnection onChangeSend:#updateModifiedChannel to:self
-    ].
     ^ rDoitEnabledOnlyViaLocalConnection.
 
     "Created: / 20-05-2010 / 12:15:12 / cg"
 !
 
 rDoitErrorDebugging
-    rDoitErrorDebugging isNil ifTrue:[
-        rDoitErrorDebugging := true asValue.
-        rDoitErrorDebugging onChangeSend:#updateModifiedChannel to:self
-    ].
     ^ rDoitErrorDebugging.
 !
 
 rDoitErrorLogging
-    rDoitErrorLogging isNil ifTrue:[
-        rDoitErrorLogging := true asValue.
-        rDoitErrorLogging onChangeSend:#updateModifiedChannel to:self
-    ].
     ^ rDoitErrorLogging.
 !
 
 rDoitLogging
-    rDoitLogging isNil ifTrue:[
-        rDoitLogging := true asValue.
-        rDoitLogging onChangeSend:#updateModifiedChannel to:self
-    ].
     ^ rDoitLogging.
 !
 
 rDoitOnlyViaLocalConnection
-    rDoitOnlyViaLocalConnection isNil ifTrue:[
-        rDoitOnlyViaLocalConnection := true asValue.
-        rDoitOnlyViaLocalConnection onChangeSend:#updateModifiedChannel to:self
-    ].
     ^ rDoitOnlyViaLocalConnection.
 
     "Created: / 20-05-2010 / 12:14:50 / cg"
 !
 
 rDoitServerPortOrPath
-    rDoitServerPortOrPath isNil ifTrue:[
-        rDoitServerPortOrPath := nil asValue.
-        rDoitServerPortOrPath onChangeSend:#updateModifiedChannel to:self
-    ].
     ^ rDoitServerPortOrPath.
 !
 
 rDoitsEnabled
-    rDoitsEnabled isNil ifTrue:[
-        rDoitsEnabled := true asValue.
-        rDoitsEnabled onChangeSend:#rDoitsEnabledChanged to:self
-    ].
     ^ rDoitsEnabled.
 !
 
 scriptingEnabled
-    scriptingEnabled isNil ifTrue:[
-        scriptingEnabled := false asValue.
-        scriptingEnabled onChangeSend:#updateModifiedChannel to:self
-    ].
     ^ scriptingEnabled.
 !
 
 scriptingEnabledOnlyViaLocalConnection
-    scriptingEnabledOnlyViaLocalConnection isNil ifTrue:[
-        scriptingEnabledOnlyViaLocalConnection := true asValue.
-        scriptingEnabledOnlyViaLocalConnection onChangeSend:#updateModifiedChannel to:self
-    ].
     ^ scriptingEnabledOnlyViaLocalConnection.
 !
 
 scriptingErrorDebugging
-    scriptingErrorDebugging isNil ifTrue:[
-        scriptingErrorDebugging := true asValue.
-        scriptingErrorDebugging onChangeSend:#updateModifiedChannel to:self
-    ].
     ^ scriptingErrorDebugging.
 !
 
 scriptingErrorLogging
-    scriptingErrorLogging isNil ifTrue:[
-        scriptingErrorLogging := true asValue.
-        scriptingErrorLogging onChangeSend:#updateModifiedChannel to:self
-    ].
     ^ scriptingErrorLogging.
 !
 
 scriptingLogging
-    scriptingLogging isNil ifTrue:[
-        scriptingLogging := true asValue.
-        scriptingLogging onChangeSend:#updateModifiedChannel to:self
-    ].
     ^ scriptingLogging.
 !
 
 scriptingServerPortOrPath
-    <resource: #uiAspect>
-
-    scriptingServerPortOrPath isNil ifTrue:[
-        STXScriptingServer notNil ifTrue:[
-            scriptingServerPortOrPath := STXScriptingServer defaultPortNumber asValue.
-        ].
-    ].
     ^ scriptingServerPortOrPath.
 ! !
 
@@ -13750,7 +13696,7 @@
 
 rDoitsEnabledChanged
     self updateModifiedChannel.
-    self rDoitsEnabled value ifTrue:[
+    rDoitsEnabled value ifTrue:[
         RDoItServer autoload.
         rDoitServerPortOrPath value isEmptyOrNil ifTrue:[
             rDoitServerPortOrPath value:(RDoItServer defaultPortNumberOrPath asString)
@@ -13781,6 +13727,52 @@
     ^ super helpTextForKey:usedKey.
 ! !
 
+!AbstractSettingsApplication::RDoItServerSettingsAppl methodsFor:'initialization'!
+
+initialize
+    super initialize.
+
+    rDoitEnabledOnlyViaLocalConnection := true asValue.
+    rDoitEnabledOnlyViaLocalConnection onChangeSend:#updateModifiedChannel to:self.
+
+    rDoitErrorDebugging := true asValue.
+    rDoitErrorDebugging onChangeSend:#updateModifiedChannel to:self.
+
+    rDoitErrorLogging := true asValue.
+    rDoitErrorLogging onChangeSend:#updateModifiedChannel to:self.
+
+    rDoitLogging := true asValue.
+    rDoitLogging onChangeSend:#updateModifiedChannel to:self.
+
+    rDoitOnlyViaLocalConnection := true asValue.
+    rDoitOnlyViaLocalConnection onChangeSend:#updateModifiedChannel to:self.
+
+    rDoitServerPortOrPath := nil asValue.
+    rDoitServerPortOrPath onChangeSend:#updateModifiedChannel to:self.
+
+    rDoitsEnabled := true asValue.
+    rDoitsEnabled onChangeSend:#rDoitsEnabledChanged to:self.
+
+    scriptingEnabled := false asValue.
+    scriptingEnabled onChangeSend:#updateModifiedChannel to:self.
+
+    scriptingEnabledOnlyViaLocalConnection := true asValue.
+    scriptingEnabledOnlyViaLocalConnection onChangeSend:#updateModifiedChannel to:self.
+
+    scriptingErrorDebugging := true asValue.
+    scriptingErrorDebugging onChangeSend:#updateModifiedChannel to:self.
+
+    scriptingErrorLogging := true asValue.
+    scriptingErrorLogging onChangeSend:#updateModifiedChannel to:self.
+
+    scriptingLogging := true asValue.
+    scriptingLogging onChangeSend:#updateModifiedChannel to:self.
+
+    STXScriptingServer notNil ifTrue:[
+        scriptingServerPortOrPath := STXScriptingServer defaultPortNumber asValue.
+    ].
+! !
+
 !AbstractSettingsApplication::RDoItServerSettingsAppl methodsFor:'queries'!
 
 hasRDoitServer
@@ -13801,22 +13793,22 @@
 
 hasUnsavedChanges
     (self hasRDoitServer) ifTrue:[
-        self rDoitsEnabled value ~= RDoItServer serverRunning ifTrue:[^ true].
+        rDoitsEnabled value ~= RDoItServer serverRunning ifTrue:[^ true].
         RDoItServer serverRunning ifTrue:[
-            self rDoitLogging value ~= RDoItServer isLogging ifTrue:[^ true].
-            self rDoitErrorLogging value ~= RDoItServer isErrorLogging ifTrue:[^ true].
-            self rDoitErrorDebugging value ~= RDoItServer isErrorCatching not ifTrue:[^ true].
+            rDoitLogging value ~= RDoItServer isLogging ifTrue:[^ true].
+            rDoitErrorLogging value ~= RDoItServer isErrorLogging ifTrue:[^ true].
+            rDoitErrorDebugging value ~= RDoItServer isErrorCatching not ifTrue:[^ true].
             self getPortNumberOrPath ~= RDoItServer defaultPortNumberOrPath ifTrue:[^ true].
-            self rDoitEnabledOnlyViaLocalConnection value ~= RDoItServer localConnectionsOnly ifTrue:[^ true].
+            rDoitEnabledOnlyViaLocalConnection value ~= RDoItServer localConnectionsOnly ifTrue:[^ true].
         ]
     ].
     (self hasScriptingServer and:[STXScriptingServer isLoaded]) ifTrue:[
-        self scriptingEnabled value ~= STXScriptingServer serverRunning ifTrue:[^ true].
+        scriptingEnabled value ~= STXScriptingServer serverRunning ifTrue:[^ true].
         STXScriptingServer serverRunning ifTrue:[
-            self scriptingLogging value ~= STXScriptingServer isLogging ifTrue:[^ true].
-            self scriptingErrorLogging value ~= STXScriptingServer isErrorLogging ifTrue:[^ true].
-            self scriptingErrorDebugging value ~= STXScriptingServer isErrorDebugging ifTrue:[^ true].
-            self scriptingEnabledOnlyViaLocalConnection value ~= STXScriptingServer localConnectionsOnly ifTrue:[^ true].
+            scriptingLogging value ~= STXScriptingServer isLogging ifTrue:[^ true].
+            scriptingErrorLogging value ~= STXScriptingServer isErrorLogging ifTrue:[^ true].
+            scriptingErrorDebugging value ~= STXScriptingServer isErrorDebugging ifTrue:[^ true].
+            scriptingEnabledOnlyViaLocalConnection value ~= STXScriptingServer localConnectionsOnly ifTrue:[^ true].
         ]
     ].
     ^ false