unrealircd

- supernets unrealircd source & configuration
git clone git://git.acid.vegas/unrealircd.git
Log | Files | Refs | Archive | README | LICENSE

ConfigurationModel.swift (1078B)

      1 //
      2 //  ConfigurationModel.swift
      3 //  UnrealIRCd
      4 //
      5 //  Created by Travis McArthur on 7/18/15.
      6 //  Copyright (c) 2015 UnrealIRCd Team. All rights reserved.
      7 //
      8 
      9 import Foundation
     10 class ConfigurationModel : ChangeNotifier {
     11 
     12     let defaults = NSUserDefaults.standardUserDefaults()
     13     static let autoStartDaemonKey = "IRCD_AUTOSTART"
     14     static let autoStartAgentKey = "AGENT_AUTOSTART"
     15     
     16     var shouldAutoStartAgent : Bool {
     17         set(value)
     18         {
     19             defaults.setBool(value, forKey: ConfigurationModel.autoStartAgentKey)
     20             defaults.synchronize()
     21             notifyListeners();
     22         }
     23         get
     24         {
     25             return defaults.boolForKey(ConfigurationModel.autoStartAgentKey)
     26         }
     27     }
     28     
     29     var shouldAutoStartDaemon : Bool {
     30         set(value)
     31         {
     32             defaults.setBool(value, forKey: ConfigurationModel.autoStartDaemonKey)
     33             defaults.synchronize()
     34             notifyListeners();
     35         }
     36         get
     37         {
     38             return defaults.boolForKey(ConfigurationModel.autoStartDaemonKey)
     39         }
     40     }
     41 }