Files

63 lines
2.4 KiB
Swift

//
// PreferenceWindowModuleBuilder.swift
// Cyberlock
//
// Created by Jura on 9/13/19.
// Copyright © 2019 Omicronmedia. All rights reserved.
//
import Foundation
struct PreferenceWindowIdentifiers {
static let options = PreferencePane.Identifier(rawValue: "VPN")
static let `protocol` = PreferencePane.Identifier(rawValue: "VPN Protocols")
static let interface = PreferencePane.Identifier(rawValue: "Application")
static let account = PreferencePane.Identifier(rawValue: "Account")
static let logs = PreferencePane.Identifier(rawValue: "Support")
static func title(for identifier: PreferencePane.Identifier) -> String {
switch identifier {
case PreferenceWindowIdentifiers.account:
return NSLocalizedString("preference.identifier.account", comment: "")
case PreferenceWindowIdentifiers.options:
return NSLocalizedString("preference.identifier.options", comment: "")
case PreferenceWindowIdentifiers.interface:
return NSLocalizedString("preference.identifier.interface", comment: "")
case PreferenceWindowIdentifiers.protocol:
return NSLocalizedString("preference.identifier.protocols", comment: "")
case PreferenceWindowIdentifiers.logs:
return NSLocalizedString("preference.identifier.logs", comment: "")
default:
return ""
}
}
}
final class PreferenceWindowModuleBuilder {
static func buildWindow(output: PreferenceOutputProtocol) -> WindowController {
let panes = [OptionsPreferencesModuleBuilder.build(),
ProtocolPreferencesModuleBuilder.build(),
InterfaceApplicationSettingsBuilder.build(),
AccountPreferencesModuleBuilder.build(),
SupportPreferencesModuleBuilder.build()]
let controller = PreferencesBuilder.build(output: output)
return WindowController(panes: panes, output: output, controller: controller)
}
}
/*
# Окно настроек
## Табы
- Options
- Основные настройки приложения, автозапуск и прочее.
- Protocol
- Выбор протокола и - возможно - его конфигурация
- Information (информация о сессии, емейл, кнопка logout, информация о системе, логи приложения)
- Update
*/