github.com/safing/portbase@v0.19.5/notifications/config.go (about)

     1  package notifications
     2  
     3  import (
     4  	"github.com/safing/portbase/config"
     5  )
     6  
     7  // Configuration Keys.
     8  var (
     9  	CfgUseSystemNotificationsKey = "core/useSystemNotifications"
    10  	useSystemNotifications       config.BoolOption
    11  )
    12  
    13  func registerConfig() error {
    14  	if err := config.Register(&config.Option{
    15  		Name:           "Desktop Notifications",
    16  		Key:            CfgUseSystemNotificationsKey,
    17  		Description:    "In addition to showing notifications in the Portmaster App, also send them to the Desktop. This requires the Portmaster Notifier to be running.",
    18  		OptType:        config.OptTypeBool,
    19  		ExpertiseLevel: config.ExpertiseLevelUser,
    20  		ReleaseLevel:   config.ReleaseLevelStable,
    21  		DefaultValue:   true, // TODO: turn off by default on unsupported systems
    22  		Annotations: config.Annotations{
    23  			config.DisplayOrderAnnotation: -15,
    24  			config.CategoryAnnotation:     "User Interface",
    25  		},
    26  	}); err != nil {
    27  		return err
    28  	}
    29  	useSystemNotifications = config.Concurrent.GetAsBool(CfgUseSystemNotificationsKey, true)
    30  
    31  	return nil
    32  }