Move WarningsSettingView to GeneralSettingsView.swift

This commit is contained in:
1024jp 2024-02-17 20:07:37 +09:00
parent bebca4fee6
commit 51535994ac
3 changed files with 28 additions and 67 deletions

View File

@ -467,8 +467,6 @@
2A94FC7B1BE225F000B454A8 /* cot in Copy Command-Line Tools */ = {isa = PBXBuildFile; fileRef = 2A94FC781BE2256F00B454A8 /* cot */; };
2A954B242AB28B010070FB74 /* TextFind.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = 2A954B232AB28B010070FB74 /* TextFind.xcstrings */; };
2A954B252AB28B010070FB74 /* TextFind.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = 2A954B232AB28B010070FB74 /* TextFind.xcstrings */; };
2A9710932A9C7BAE00CE9CDD /* WarningsSettingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A9710922A9C7BAE00CE9CDD /* WarningsSettingView.swift */; };
2A9710942A9C7BAE00CE9CDD /* WarningsSettingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A9710922A9C7BAE00CE9CDD /* WarningsSettingView.swift */; };
2A9AC937244849B700D05643 /* NSLayoutManager+InvisibleDrawing.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A9AC936244849B700D05643 /* NSLayoutManager+InvisibleDrawing.swift */; };
2A9AC938244849B700D05643 /* NSLayoutManager+InvisibleDrawing.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A9AC936244849B700D05643 /* NSLayoutManager+InvisibleDrawing.swift */; };
2A9B134E27E2D84E009954A4 /* NSDraggingInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A9B134D27E2D84E009954A4 /* NSDraggingInfo.swift */; };
@ -1095,7 +1093,6 @@
2A938ACE297E4D7B007FBE5F /* SettingsWindowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsWindowController.swift; sourceTree = "<group>"; };
2A94FC781BE2256F00B454A8 /* cot */ = {isa = PBXFileReference; explicitFileType = text.script.python; name = cot; path = cot/cot; sourceTree = SOURCE_ROOT; };
2A954B232AB28B010070FB74 /* TextFind.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; name = TextFind.xcstrings; path = mul.lproj/TextFind.xcstrings; sourceTree = "<group>"; };
2A9710922A9C7BAE00CE9CDD /* WarningsSettingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WarningsSettingView.swift; sourceTree = "<group>"; };
2A9AC936244849B700D05643 /* NSLayoutManager+InvisibleDrawing.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSLayoutManager+InvisibleDrawing.swift"; sourceTree = "<group>"; };
2A9B134D27E2D84E009954A4 /* NSDraggingInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NSDraggingInfo.swift; sourceTree = "<group>"; };
2A9BF3C31D382BB100E3D3E2 /* EditorTextView+Transformation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "EditorTextView+Transformation.swift"; sourceTree = "<group>"; };
@ -3001,7 +2998,6 @@
2A91C31C1D1BFE47007CF8BE /* UTType+SettingFile.swift in Sources */,
2A7FCC46280A367C0070EAB3 /* ValueRange.swift in Sources */,
2A2B086028046E3B0028D733 /* WarningInspectorView.swift in Sources */,
2A9710932A9C7BAE00CE9CDD /* WarningsSettingView.swift in Sources */,
2A78BFB11D1B168E00A583D2 /* WebDocumentWindowController.swift in Sources */,
2A17A3141D2D16F1001DD717 /* WindowContentViewController.swift in Sources */,
2A78BFA51D1B02ED00A583D2 /* WindowSettingsView.swift in Sources */,
@ -3364,7 +3360,6 @@
2A91C31B1D1BFE47007CF8BE /* UTType+SettingFile.swift in Sources */,
2A7FCC47280A367C0070EAB3 /* ValueRange.swift in Sources */,
2A2B086128046E3B0028D733 /* WarningInspectorView.swift in Sources */,
2A9710942A9C7BAE00CE9CDD /* WarningsSettingView.swift in Sources */,
2A78BFB01D1B168E00A583D2 /* WebDocumentWindowController.swift in Sources */,
2A17A3131D2D16F1001DD717 /* WindowContentViewController.swift in Sources */,
2A78BFA41D1B02ED00A583D2 /* WindowSettingsView.swift in Sources */,

View File

@ -254,6 +254,34 @@ private struct UpdaterView: View {
}
private struct WarningsSettingView: View {
@Environment(\.dismiss) private var dismiss
@AppStorage(.suppressesInconsistentLineEndingAlert) private var suppressesInconsistentLineEndingAlert: Bool
var body: some View {
VStack {
Form {
Text("Suppress following warnings:", tableName: "GeneralSettings")
Toggle(String(localized: "Inconsistent line endings", table: "GeneralSettings"), isOn: $suppressesInconsistentLineEndingAlert)
}
HStack {
HelpButton(anchor: "howto_manage_warnings")
Spacer()
Button("Done") {
self.dismiss()
}.keyboardShortcut(.defaultAction)
}.padding(.top)
}
.scenePadding()
}
}
private extension CommandLineToolManager.Status {
var imageStatus: Image.Status {

View File

@ -1,62 +0,0 @@
//
// WarningsSettingView.swift
//
// CotEditor
// https://coteditor.com
//
// Created by 1024jp on 2023-08-28.
//
// ---------------------------------------------------------------------------
//
// © 2023-2024 1024jp
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
import SwiftUI
struct WarningsSettingView: View {
@Environment(\.dismiss) private var dismiss
@AppStorage(.suppressesInconsistentLineEndingAlert) private var suppressesInconsistentLineEndingAlert: Bool
var body: some View {
VStack {
Form {
Text("Suppress following warnings:", tableName: "GeneralSettings")
Toggle(String(localized: "Inconsistent line endings", table: "GeneralSettings"), isOn: $suppressesInconsistentLineEndingAlert)
}
HStack {
HelpButton(anchor: "howto_manage_warnings")
Spacer()
Button("Done") {
self.dismiss()
}.keyboardShortcut(.defaultAction)
}.padding(.top)
}
.fixedSize()
.scenePadding()
}
}
// MARK: - Preview
#Preview {
WarningsSettingView()
}