From 9158e0b29ea4a793d3aa102303d339fed5c85abe Mon Sep 17 00:00:00 2001 From: osy <50960678+osy@users.noreply.github.com> Date: Sat, 7 May 2022 14:21:00 -0700 Subject: [PATCH] ui: various tweaks to be more consistent Resolves #3984 --- Platform/Shared/VMRemovableDrivesView.swift | 4 ++-- Platform/Shared/VMWizardOSLinuxView.swift | 16 ++++++++-------- Platform/Shared/VMWizardOSMacView.swift | 2 +- Platform/Shared/VMWizardOSOtherView.swift | 2 +- Platform/Shared/VMWizardOSWindowsView.swift | 2 +- Platform/Shared/VMWizardSharingView.swift | 6 +++--- .../Legacy/VMConfigDrivePickerViewController.m | 2 +- .../iOS/Legacy/VMConfigSharingViewController.m | 2 +- Platform/iOS/VMWizardView.swift | 4 ++-- Platform/ko.lproj/Localizable.strings | 4 ++-- Platform/macOS/VMAppleRemovableDrivesView.swift | 4 ++-- Platform/macOS/VMConfigAppleBootView.swift | 6 +++--- Platform/macOS/VMConfigDrivesButtons.swift | 6 +++--- Platform/macOS/VMWizardView.swift | 14 ++++++++++---- Platform/zh-Hans.lproj/Localizable.strings | 10 +++++----- Platform/zh-Hant.lproj/Localizable.strings | 10 +++++----- 16 files changed, 50 insertions(+), 44 deletions(-) diff --git a/Platform/Shared/VMRemovableDrivesView.swift b/Platform/Shared/VMRemovableDrivesView.swift index 20e9685b..c984ff9f 100644 --- a/Platform/Shared/VMRemovableDrivesView.swift +++ b/Platform/Shared/VMRemovableDrivesView.swift @@ -36,7 +36,7 @@ struct VMRemovableDrivesView: View { @ViewBuilder private var shareMenuActions: some View { Button(action: { shareDirectoryFileImportPresented.toggle() }) { - Label("Browse", systemImage: "doc.badge.plus") + Label("Browse…", systemImage: "doc.badge.plus") } if hasSharedDir { Button(action: clearShareDirectory) { @@ -92,7 +92,7 @@ struct VMRemovableDrivesView: View { diskImageFileImportPresented = true } }, label: { - Label("Browse", systemImage: "doc.badge.plus") + Label("Browse…", systemImage: "doc.badge.plus") }) .onChange(of: workaroundFileImporterBug) { doWorkaround in /// Explanation see "SwiftUI FileImporter modal bug" above diff --git a/Platform/Shared/VMWizardOSLinuxView.swift b/Platform/Shared/VMWizardOSLinuxView.swift index 8bc123c8..3ad12281 100644 --- a/Platform/Shared/VMWizardOSLinuxView.swift +++ b/Platform/Shared/VMWizardOSLinuxView.swift @@ -69,7 +69,7 @@ struct VMWizardOSLinuxView: View { selectImage = .kernel isFileImporterPresented.toggle() } label: { - Text("Browse") + Text("Browse…") } .padding(.leading, 1) } header: { @@ -85,7 +85,7 @@ struct VMWizardOSLinuxView: View { selectImage = .initialRamdisk isFileImporterPresented.toggle() } label: { - Text("Browse") + Text("Browse…") } .disabled(wizardState.isBusy) .padding(.leading, 1) @@ -101,7 +101,7 @@ struct VMWizardOSLinuxView: View { selectImage = .initialRamdisk isFileImporterPresented.toggle() } label: { - Text("Browse") + Text("Browse…") } .disabled(wizardState.isBusy) .padding(.leading, 1) @@ -126,7 +126,7 @@ struct VMWizardOSLinuxView: View { selectImage = .rootImage isFileImporterPresented.toggle() } label: { - Text("Browse") + Text("Browse…") } Button { wizardState.linuxRootImageURL = nil @@ -139,7 +139,7 @@ struct VMWizardOSLinuxView: View { selectImage = .rootImage isFileImporterPresented.toggle() } label: { - Text("Browse") + Text("Browse…") } Button { wizardState.linuxRootImageURL = nil @@ -161,7 +161,7 @@ struct VMWizardOSLinuxView: View { selectImage = .bootImage isFileImporterPresented.toggle() } label: { - Text("Browse") + Text("Browse…") } .disabled(wizardState.isBusy) .padding(.leading, 1) @@ -179,7 +179,7 @@ struct VMWizardOSLinuxView: View { selectImage = .bootImage isFileImporterPresented.toggle() } label: { - Text("Browse") + Text("Browse…") } .disabled(wizardState.isBusy) .padding(.leading, 1) @@ -211,7 +211,7 @@ struct VMWizardOSLinuxView: View { selectImage = .bootImage isFileImporterPresented.toggle() } label: { - Text("Browse") + Text("Browse…") }.disabled(wizardState.isBusy) } header: { Text("File Imported") diff --git a/Platform/Shared/VMWizardOSMacView.swift b/Platform/Shared/VMWizardOSMacView.swift index 022c1081..272d59d2 100644 --- a/Platform/Shared/VMWizardOSMacView.swift +++ b/Platform/Shared/VMWizardOSMacView.swift @@ -40,7 +40,7 @@ struct VMWizardOSMacView: View { Button { isFileImporterPresented.toggle() } label: { - Text("Browse") + Text("Browse…") } Button { wizardState.macRecoveryIpswURL = nil diff --git a/Platform/Shared/VMWizardOSOtherView.swift b/Platform/Shared/VMWizardOSOtherView.swift index 60222149..0a3e1264 100644 --- a/Platform/Shared/VMWizardOSOtherView.swift +++ b/Platform/Shared/VMWizardOSOtherView.swift @@ -35,7 +35,7 @@ struct VMWizardOSOtherView: View { Button { isFileImporterPresented.toggle() } label: { - Text("Browse") + Text("Browse…") } .disabled(wizardState.isBusy) .padding(.leading, 1) diff --git a/Platform/Shared/VMWizardOSWindowsView.swift b/Platform/Shared/VMWizardOSWindowsView.swift index 4d5c61e0..fe26cdfe 100644 --- a/Platform/Shared/VMWizardOSWindowsView.swift +++ b/Platform/Shared/VMWizardOSWindowsView.swift @@ -67,7 +67,7 @@ struct VMWizardOSWindowsView: View { Button { isFileImporterPresented.toggle() } label: { - Text("Browse") + Text("Browse…") } .disabled(wizardState.isBusy) .padding(.leading, 1) diff --git a/Platform/Shared/VMWizardSharingView.swift b/Platform/Shared/VMWizardSharingView.swift index e6cabbcf..9207216b 100644 --- a/Platform/Shared/VMWizardSharingView.swift +++ b/Platform/Shared/VMWizardSharingView.swift @@ -35,7 +35,7 @@ struct VMWizardSharingView: View { .font(.caption) } if !wizardState.useAppleVirtualization { - Toggle("Read only share?", isOn: $wizardState.sharingReadOnly) + Toggle("Share is read only", isOn: $wizardState.sharingReadOnly) } } header: { Text("Directory Selected") @@ -46,7 +46,7 @@ struct VMWizardSharingView: View { Button { isFileImporterPresented.toggle() } label: { - Text("Browse") + Text("Browse…") } .disabled(wizardState.isBusy) Button { @@ -61,7 +61,7 @@ struct VMWizardSharingView: View { Button { isFileImporterPresented.toggle() } label: { - Text("Browse") + Text("Browse…") } .disabled(wizardState.isBusy) Button { diff --git a/Platform/iOS/Legacy/VMConfigDrivePickerViewController.m b/Platform/iOS/Legacy/VMConfigDrivePickerViewController.m index acc77dcf..e5b92ee1 100644 --- a/Platform/iOS/Legacy/VMConfigDrivePickerViewController.m +++ b/Platform/iOS/Legacy/VMConfigDrivePickerViewController.m @@ -195,7 +195,7 @@ - (IBAction)addButton:(UIBarButtonItem *)sender { UIAlertController *alert = [UIAlertController alertControllerWithTitle:nil message:NSLocalizedString(@"Would you like to import an existing disk image or create a new one?", @"VMConfigDrivePickerViewController") preferredStyle:UIAlertControllerStyleActionSheet]; - UIAlertAction *import = [UIAlertAction actionWithTitle:NSLocalizedString(@"Import", @"Import button") style:UIAlertActionStyleDefault handler:^(UIAlertAction *action){ + UIAlertAction *import = [UIAlertAction actionWithTitle:NSLocalizedString(@"Import…", @"Import button") style:UIAlertActionStyleDefault handler:^(UIAlertAction *action){ UIDocumentPickerViewController *picker = [[UIDocumentPickerViewController alloc] initWithDocumentTypes:@[@"public.item"] inMode:UIDocumentPickerModeImport]; picker.delegate = self; picker.modalPresentationStyle = UIModalPresentationFormSheet; diff --git a/Platform/iOS/Legacy/VMConfigSharingViewController.m b/Platform/iOS/Legacy/VMConfigSharingViewController.m index 0d97097f..4a34524a 100644 --- a/Platform/iOS/Legacy/VMConfigSharingViewController.m +++ b/Platform/iOS/Legacy/VMConfigSharingViewController.m @@ -42,7 +42,7 @@ - (void)showShareDirectoryOptions:(BOOL)visible animated:(BOOL)animated { [self cells:self.directorySharingCells setHidden:!visible]; if (self.configuration.shareDirectoryName.length == 0) { - self.selectDirectoryCell.detailTextLabel.text = NSLocalizedString(@"Browse...", @"VMConfigSharingViewController"); + self.selectDirectoryCell.detailTextLabel.text = NSLocalizedString(@"Browse…", @"VMConfigSharingViewController"); } [self reloadDataAnimated:animated]; } diff --git a/Platform/iOS/VMWizardView.swift b/Platform/iOS/VMWizardView.swift index 16741070..0cfa6c7d 100644 --- a/Platform/iOS/VMWizardView.swift +++ b/Platform/iOS/VMWizardView.swift @@ -80,14 +80,14 @@ fileprivate struct WizardWrapper: View { .toolbar { ToolbarItem(placement: .navigationBarLeading) { if wizardState.currentPage == .start { - Button("Close") { + Button("Cancel") { onDismiss() } } } ToolbarItem(placement: .navigationBarTrailing) { if wizardState.hasNextButton { - Button("Next") { + Button("Continue") { wizardState.next() } } else if wizardState.currentPage == .summary { diff --git a/Platform/ko.lproj/Localizable.strings b/Platform/ko.lproj/Localizable.strings index 6781d626..16b356fd 100644 --- a/Platform/ko.lproj/Localizable.strings +++ b/Platform/ko.lproj/Localizable.strings @@ -59,7 +59,7 @@ "Browse" = "선택"; /* VMConfigSharingViewController */ -"Browse..." = "탐색..."; +"Browse…" = "탐색"; /* Cancel button VMConfigDirectoryPickerViewController @@ -314,7 +314,7 @@ "Image Type" = "이미지 종류"; /* Import button */ -"Import" = "추가"; +"Import…" = "추가"; /* Save VM overlay */ "Importing %@..." = "%@ 추가중..."; diff --git a/Platform/macOS/VMAppleRemovableDrivesView.swift b/Platform/macOS/VMAppleRemovableDrivesView.swift index 49d0b9f0..5537c631 100644 --- a/Platform/macOS/VMAppleRemovableDrivesView.swift +++ b/Platform/macOS/VMAppleRemovableDrivesView.swift @@ -46,7 +46,7 @@ struct VMAppleRemovableDrivesView: View { selectedSharedDirectoryBinding = $sharedDirectory showFileImporter() }, label: { - Label("Browse", systemImage: "doc.badge.plus") + Label("Browse…", systemImage: "doc.badge.plus") }) if hasSharedDir { // Clear button @@ -75,7 +75,7 @@ struct VMAppleRemovableDrivesView: View { selectedDiskImageBinding = $diskImage showFileImporter() }, label: { - Label("Browse", systemImage: "doc.badge.plus") + Label("Browse…", systemImage: "doc.badge.plus") }) // Eject button if diskImage.isExternal && diskImage.imageURL != nil { diff --git a/Platform/macOS/VMConfigAppleBootView.swift b/Platform/macOS/VMConfigAppleBootView.swift index d1791a9a..8e893d90 100644 --- a/Platform/macOS/VMConfigAppleBootView.swift +++ b/Platform/macOS/VMConfigAppleBootView.swift @@ -96,7 +96,7 @@ struct VMConfigAppleBootView: View { HStack { TextField("Kernel Image", text: .constant(config.bootLoader?.linuxKernelURL?.lastPathComponent ?? "")) .disabled(true) - Button("Browse") { + Button("Browse…") { importBootloaderSelection = .kernel importFileShown = true } @@ -107,7 +107,7 @@ struct VMConfigAppleBootView: View { Button("Clear") { config.bootLoader?.linuxInitialRamdiskURL = nil } - Button("Browse") { + Button("Browse…") { importBootloaderSelection = .ramdisk importFileShown = true } @@ -123,7 +123,7 @@ struct VMConfigAppleBootView: View { Button("Clear") { config.macRecoveryIpswURL = nil } - Button("Browse") { + Button("Browse…") { importBootloaderSelection = .ipsw importFileShown = true } diff --git a/Platform/macOS/VMConfigDrivesButtons.swift b/Platform/macOS/VMConfigDrivesButtons.swift index cf6fd0e5..138b45bf 100644 --- a/Platform/macOS/VMConfigDrivesButtons.swift +++ b/Platform/macOS/VMConfigDrivesButtons.swift @@ -54,12 +54,12 @@ struct VMConfigNewDriveButton: View Button(action: { importDrivePresented.toggle() }, label: { if let _ = config as? UTMQemuConfiguration { if newQemuDrive.removable { - Text("Browse") + Text("Browse…") } else { - Text("Import") + Text("Import…") } } else { - Text("Import") + Text("Import…") } }).help("Select an existing disk image.") Button(action: { addNewDrive(newQemuDrive) }, label: { diff --git a/Platform/macOS/VMWizardView.swift b/Platform/macOS/VMWizardView.swift index 2b57a8f4..a338f887 100644 --- a/Platform/macOS/VMWizardView.swift +++ b/Platform/macOS/VMWizardView.swift @@ -63,20 +63,26 @@ struct VMWizardView: View { .frame(width: 450, height: 450) .toolbar { ToolbarItem(placement: .automatic) { - Button("Close") { - presentationMode.wrappedValue.dismiss() + if wizardState.currentPage != .start { + Button("Cancel") { + presentationMode.wrappedValue.dismiss() + } } } ToolbarItem(placement: .cancellationAction) { if wizardState.currentPage != .start { - Button("Back") { + Button("Go Back") { wizardState.back() } + } else { + Button("Cancel") { + presentationMode.wrappedValue.dismiss() + } } } ToolbarItem(placement: .confirmationAction) { if wizardState.hasNextButton { - Button("Next") { + Button("Continue") { wizardState.next() } } else if wizardState.currentPage == .summary { diff --git a/Platform/zh-Hans.lproj/Localizable.strings b/Platform/zh-Hans.lproj/Localizable.strings index bf85e08d..0da537c2 100644 --- a/Platform/zh-Hans.lproj/Localizable.strings +++ b/Platform/zh-Hans.lproj/Localizable.strings @@ -77,7 +77,7 @@ "Bridged Interface" = "桥接接口"; /* VMConfigSharingViewController */ -"Browse..." = "浏览"; +"Browse…" = "浏览"; /* No comment provided by engineer. */ "Cancel" = "取消"; @@ -356,7 +356,7 @@ "Image Type" = "格式"; /* Import button */ -"Import" = "导入"; +"Import…" = "导入"; /* No comment provided by engineer. */ "Import Virtual Machine..." = "导入虚拟机..."; @@ -885,7 +885,7 @@ "Slower, but can run other CPU architectures." = "速度较慢,但虚拟机的CPU架构不受限制"; "Download prebuilt from UTM Gallery..." = "从UTM库下载预配置文件(可能需要手动导入安装镜像)"; "Close" = "关闭"; -"Next" = "下一步"; +"Continue" = "下一步"; "Generate Windows Installer ISO" = "获取 Windows 安装光盘"; "Boot ISO Image:" = "启动光盘镜像:"; "Boot VHDX Image:" = "启动 VHDX 磁盘镜像:"; @@ -925,7 +925,7 @@ //Share Directory "Optionally select a directory to make accessible inside the VM. Note that support for shared directories varies by the guest operating system and may require additional guest drivers to be installed. See UTM support pages for more details." = "(可选)选择一个路径,以便在虚拟机内部访问。 请注意,对文件共享的支持因操作系统而异,并且可能需要安装额外的驱动程序。 有关更多详细信息,请参阅 UTM 支持页面"; -"Read only share?" = "只读"; +"Share is read only" = "只读"; //Summary "Summary" = "总结"; @@ -1034,7 +1034,7 @@ "Preparing…" = "准备..."; //MacOS View -"Back" = "返回"; +"Go Back" = "返回"; "New Drive" = "新建硬盘"; "Delete Drive" = "删除硬盘"; "IDE Drive" = "IDE 硬盘"; diff --git a/Platform/zh-Hant.lproj/Localizable.strings b/Platform/zh-Hant.lproj/Localizable.strings index ae5f98d8..c129717c 100644 --- a/Platform/zh-Hant.lproj/Localizable.strings +++ b/Platform/zh-Hant.lproj/Localizable.strings @@ -119,7 +119,7 @@ "Browse UTM Gallery" = "瀏覽 UTM 資源庫"; /* VMConfigSharingViewController */ -"Browse..." = "瀏覽⋯"; +"Browse…" = "瀏覽⋯"; /* Cancel button VMConfigDirectoryPickerViewController @@ -518,7 +518,7 @@ "Image Type" = "映像檔類型"; /* Import button */ -"Import" = "匯入"; +"Import…" = "匯入⋯"; /* No comment provided by engineer. */ "Import Drive" = "匯入磁碟機"; @@ -698,7 +698,7 @@ "New..." = "新增⋯"; /* No comment provided by engineer. */ -"Next" = "下一步"; +"Continue" = "下一步"; /* No button VMDisplayViewController @@ -806,7 +806,7 @@ "Read Only" = "唯讀"; /* No comment provided by engineer. */ -"Read only share?" = "是否要唯讀共享?"; +"Share is read only" = "是否要唯讀共享?"; /* No comment provided by engineer. */ "Removable" = "可卸除式"; @@ -1087,7 +1087,7 @@ "Zoom" = "縮放"; /* Manually added: Common > Button */ -"Back" = "返回"; +"Go Back" = "返回"; /* Manually added: Create a New Virtual Machine > macOS */ "To install macOS, you need to download a recovery IPSW. If you do not select an existing IPSW, the latest macOS IPSW will be downloaded from Apple." = "要安裝 macOS,您需要下載復原 IPSW。如果您這裡沒有選擇 IPSW,UTM 將會從 Apple 下載最新的 macOS IPSW。";