]> git.stg.codes - stg.git/blobdiff - projects/stargazer/settings_impl.cpp
ReconnectOnTariffChange added to the settings
[stg.git] / projects / stargazer / settings_impl.cpp
index 33b3e840c2ac7437de49bbe81b048848d2fdc768..f9135a1ae8f959b1a362ca85e22bc8b524406083 100644 (file)
@@ -64,6 +64,7 @@ SETTINGS_IMPL::SETTINGS_IMPL()
       showFeeInCash(true),
       messageTimeout(0),
       feeChargeType(0),
+      reconnectOnTariffChange(false),
       modulesSettings(),
       storeModuleSettings(),
       logger(GetStgLogger())
@@ -95,6 +96,7 @@ SETTINGS_IMPL::SETTINGS_IMPL(const std::string & cd)
       showFeeInCash(true),
       messageTimeout(0),
       feeChargeType(0),
+      reconnectOnTariffChange(false),
       modulesSettings(),
       storeModuleSettings(),
       logger(GetStgLogger())
@@ -126,6 +128,7 @@ SETTINGS_IMPL::SETTINGS_IMPL(const SETTINGS_IMPL & rval)
       showFeeInCash(rval.showFeeInCash),
       messageTimeout(rval.messageTimeout),
       feeChargeType(rval.feeChargeType),
+      reconnectOnTariffChange(rval.reconnectOnTariffChange),
       modulesSettings(rval.modulesSettings),
       storeModuleSettings(rval.storeModuleSettings),
       logger(GetStgLogger())
@@ -441,6 +444,15 @@ while (node)
             }
         }
 
+    if (strcasecmp(node->getName(), "ReconnectOnTariffChange") == 0)
+        {
+        if (ParseYesNo(node->getValue(0), &reconnectOnTariffChange) != 0)
+            {
+            strError = "Incorrect ReconnectOnTariffChange value: \'" + string(node->getValue(0)) + "\'";
+            return -1;
+            }
+        }
+
     if (strcasecmp(node->getName(), "DirNames") == 0)
         {
         const DOTCONFDocumentNode * child = node->getChildNode();