Skip to content

Commit 46bce14

Browse files
authored
Merge branch 'main' into fix/shell-settings-off-switches
2 parents dfb6575 + 06d382c commit 46bce14

5 files changed

Lines changed: 27 additions & 23 deletions

File tree

‎frontend-qt/nspb_qt/localization.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@
216216
'settings.note': ('游戏文件夹、构建工具和应用更新,都在这里。', 'Library location, build tools and updates.', 'Biblioteksplats, byggverktyg och uppdateringar.', 'Speicherort der Bibliothek, Build-Werkzeuge und Updates.', 'Emplacement de la bibliothèque, outils de compilation et mises à jour.'),
217217
'shellCache.row': ('缓存文件', 'Cache files', 'Cachefiler', 'Cachedateien', 'Fichiers de cache'),
218218
'shellCache.open': ('打开目录', 'Open folder', 'Öppna mapp', 'Ordner öffnen', 'Ouvrir le dossier'),
219-
'shellCache.note': ('壳的 framework 镜像、shell.json 和横幅缓存。删除后:下次安装时每个游戏要从构建文件夹重新提供 framework。构建文件夹也删了的游戏需要重新构建。', "The shell's mirrored frameworks, its library file (shell.json) and the banner cache. Deleting it means every game's framework must come from its build folder again at the next install. A game whose build folder is also gone must be rebuilt.", 'Skalns speglade frameworks, shell.json och banner-cachen. Radering betyder att varje spels framework kommer igen från dess byggmapp vid nästa installation. Är den också borta måste spelet byggas om.', 'Gespiegelte Frameworks, shell.json und der Banner-Cache. Löschen bedeutet: das Framework jedes Spiels kommt bei der nächsten Installation wieder aus dessen Build-Ordner. Ist der auch weg, muss das Spiel neu gebaut werden.', 'Les frameworks en miroir de la coque, shell.json et le cache des bannières. Les supprimer signifie que le framework de chaque jeu reviendra de son dossier de compilation à la prochaine installation. Un jeu dont le dossier a aussi disparu doit être recompilé.'),
219+
'shellCache.note': ('iPhone 端 Framework 缓存,多游戏安装需保留。删除缓存后,安装新游戏,老游戏会消失。', 'The cache of the iPhone frameworks, kept so several games can be installed. Delete it and installing a new game removes the older games from the shell.', 'iPhone-framework-cachen, bevarad för installation av flera spel. Raderar du den tar installationen av ett nytt spel bort äldre spel från skalet.', 'Der iPhone-Frameworks-Cache, aufbewahrt für die Installation mehrerer Spiele. Beim Löschen entfernt die Installation eines neuen Spiels die älteren Spiele aus der Shell.', 'Le cache des frameworks iPhone, conservé pour installer plusieurs jeux. Le supprimer fait qu’installer un nouveau jeu retire les jeux plus anciens de la coque.'),
220220
'settings.appNote': ('为 Apple 设备构建游戏', 'Build your games for Apple devices', 'Bygg dina spel för Apple-enheter', 'Baue deine Spiele für Apple-Geräte', 'Compilez vos jeux pour les appareils Apple'),
221221
'build.compatibility': ('兼容性选项', 'Older iPhone support', 'Stöd för äldre iPhone-modeller', 'Unterstützung für ältere iPhones', 'Prise en charge des anciens iPhone'),
222222
'build.macNote': ('在这台 Mac 上直接运行。', 'Play directly on this Mac.', 'Spela direkt på den här Mac-datorn.', 'Direkt auf diesem Mac spielen.', 'Jouez directement sur ce Mac.'),

‎frontend/Sources/NSPortBuilder/BuildNotifications.swift‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ enum BuildNotice {
2727

2828
static var hasBundleID: Bool { Bundle.main.bundleIdentifier != nil }
2929

30-
/// A stopped build was stopped by someone at the app; a build in front of someone needs no notification.
30+
/// A stopped build was stopped by someone at the app. The owner's rc8 report: a build that finishes while the
31+
/// launcher is in front must still say so — success and failure alike, only a stop stays silent.
3132
static func shouldNotify(_ outcome: Outcome, enabled: Bool, appActive: Bool, hasBundleID: Bool) -> Bool {
32-
outcome != .stopped && enabled && !appActive && hasBundleID
33+
outcome != .stopped && enabled && hasBundleID
3334
}
3435

3536
/// Title and body: the game, the target, and for a failure the reason (the build's own last word).

‎frontend/Sources/NSPortBuilder/LauncherDropdown.swift‎

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -242,14 +242,19 @@ struct LauncherDropdown: View {
242242
let rounded = style == .button
243243
let shape = RoundedRectangle(cornerRadius: rounded ? 9 : 99)
244244
let width = fill ? nil : rowWidth
245-
return HStack(spacing: 8) {
246-
if fill || width != nil { Spacer(minLength: 0) } // the words centre in the space beside the chevron:
247-
Text(current).font(.manrope(rounded ? 13 : 12.5, .semibold)).lineLimit(1) // an equal leading spacer keeps
248-
.minimumScaleFactor(width == nil ? 1 : 0.85) // their centre on the button's
245+
return HStack(spacing: 0) {
246+
Text(current).font(.manrope(rounded ? 13 : 12.5, .semibold)).lineLimit(1)
247+
.minimumScaleFactor(width == nil ? 1 : 0.85)
249248
.fixedSize(horizontal: !fill && width == nil, vertical: false)
250-
if fill || width != nil { Spacer(minLength: 0) }
251-
Image(systemName: "chevron.down").font(.system(size: 9, weight: .bold)).foregroundStyle(.secondary)
252-
.rotationEffect(.degrees(open ? 180 : 0)).frame(width: 14) // chevron reserves its width, so both spacers match
249+
.frame(maxWidth: fill || width != nil ? .infinity : nil, alignment: .center) // the words centre across the whole button
250+
.padding(.leading, fill || width != nil ? 14 : 0) // room so the chevron never crowds them
251+
if fill || width != nil {
252+
Image(systemName: "chevron.down").font(.system(size: 9, weight: .bold)).foregroundStyle(.secondary)
253+
.rotationEffect(.degrees(open ? 180 : 0)).padding(.trailing, 14)
254+
} else {
255+
Image(systemName: "chevron.down").font(.system(size: 9, weight: .bold)).foregroundStyle(.secondary)
256+
.rotationEffect(.degrees(open ? 180 : 0)).padding(.leading, 8)
257+
}
253258
}
254259
.padding(.horizontal, rounded ? 15 : 14).padding(.vertical, rounded ? 9 : 7)
255260
.frame(width: width, height: width == nil ? nil : LauncherControl.height)

‎frontend/Sources/NSPortBuilder/Localization.swift‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ enum L10n {
257257
"settings.note": ("\u{6e38}\u{620f}\u{6587}\u{4ef6}\u{5939}\u{3001}\u{6784}\u{5efa}\u{5de5}\u{5177}\u{548c}\u{5e94}\u{7528}\u{66f4}\u{65b0}\u{ff0c}\u{90fd}\u{5728}\u{8fd9}\u{91cc}\u{3002}", "Library location, build tools and updates."),
258258
"shellCache.row": ("缓存文件", "Cache files"),
259259
"shellCache.open": ("打开目录", "Open folder"),
260-
"shellCache.note": ("壳的 framework 镜像、shell.json 和横幅缓存。删除后:下次安装时每个游戏要从构建文件夹重新提供 framework。构建文件夹也删了的游戏需要重新构建。", "The shell's mirrored frameworks, its library file (shell.json) and the banner cache. Deleting it means every game's framework must come from its build folder again at the next install. A game whose build folder is also gone must be rebuilt."),
260+
"shellCache.note": ("iPhone 端 Framework 缓存,多游戏安装需保留。删除缓存后,安装新游戏,老游戏会消失。", "The cache of the iPhone frameworks, kept so several games can be installed. Delete it and installing a new game removes the older games from the shell."),
261261
"settings.appNote": ("\u{4e3a} Apple \u{8bbe}\u{5907}\u{6784}\u{5efa}\u{6e38}\u{620f}", "Build your games for Apple devices"),
262262
"build.compatibility": ("\u{517c}\u{5bb9}\u{6027}\u{9009}\u{9879}", "Older iPhone support"),
263263
"build.macNote": ("\u{5728}\u{8fd9}\u{53f0} Mac \u{4e0a}\u{76f4}\u{63a5}\u{8fd0}\u{884c}\u{3002}", "Play directly on this Mac."),
@@ -1257,7 +1257,7 @@ enum L10n {
12571257
"settings.heading": "Inställningar",
12581258
"shellCache.row": "Cachefiler",
12591259
"shellCache.open": "Öppna mapp",
1260-
"shellCache.note": "Skalns speglade frameworks, shell.json och banner-cachen. Radering betyder att varje spels framework kommer igen från dess byggmapp vid nästa installation. Är den också borta måste spelet byggas om.",
1260+
"shellCache.note": "iPhone-framework-cachen, bevarad för installation av flera spel. Raderar du den tar installationen av ett nytt spel bort äldre spel från skalet.",
12611261
"onboarding.welcome.title": "Välkommen.",
12621262
"onboarding.welcome.note": "Spela dina Switch-spel direkt på din Mac på ungefär 15 minuter.",
12631263
"onboarding.platform.title": "Var vill du spela?",
@@ -2324,7 +2324,7 @@ enum L10n {
23242324
"settings.heading": "Einstellungen",
23252325
"shellCache.row": "Cachedateien",
23262326
"shellCache.open": "Ordner öffnen",
2327-
"shellCache.note": "Gespiegelte Frameworks, shell.json und der Banner-Cache. Löschen bedeutet: das Framework jedes Spiels kommt bei der nächsten Installation wieder aus dessen Build-Ordner. Ist der auch weg, muss das Spiel neu gebaut werden.",
2327+
"shellCache.note": "Der iPhone-Frameworks-Cache, aufbewahrt für die Installation mehrerer Spiele. Beim Löschen entfernt die Installation eines neuen Spiels die älteren Spiele aus der Shell.",
23282328
"settings.note": "Speicherort der Bibliothek, Build-Werkzeuge und Updates.",
23292329
"settings.appNote": "Baue deine Spiele für Apple-Geräte",
23302330
"build.compatibility": "Unterstützung für ältere iPhones",
@@ -3376,7 +3376,7 @@ enum L10n {
33763376
"settings.heading": "Réglages",
33773377
"shellCache.row": "Fichiers de cache",
33783378
"shellCache.open": "Ouvrir le dossier",
3379-
"shellCache.note": "Les frameworks en miroir de la coque, shell.json et le cache des bannières. Les supprimer signifie que le framework de chaque jeu reviendra de son dossier de compilation à la prochaine installation. Un jeu dont le dossier a aussi disparu doit être recompilé.",
3379+
"shellCache.note": "Le cache des frameworks iPhone, conservé pour installer plusieurs jeux. Le supprimer fait qu’installer un nouveau jeu retire les jeux plus anciens de la coque.",
33803380
"settings.note": "Emplacement de la bibliothèque, outils de compilation et mises à jour.",
33813381
"settings.appNote": "Compilez vos jeux pour les appareils Apple",
33823382
"build.compatibility": "Prise en charge des anciens iPhone",

‎frontend/Tests/NSPortBuilderTests/BuildNotificationsTests.swift‎

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,14 @@ import SwiftUI
66
final class BuildNotificationsTests: XCTestCase {
77
private func en(_ key: String) -> String { L10n.string(key, .en) }
88

9-
func testOnlyAFinishedOrFailedBuildInTheBackgroundIsNotified() {
10-
let failed = BuildNotice.Outcome.failed(reason: "Build failed (exit code 1)")
11-
XCTAssertTrue(BuildNotice.shouldNotify(.finished, enabled: true, appActive: false, hasBundleID: true))
12-
XCTAssertTrue(BuildNotice.shouldNotify(failed, enabled: true, appActive: false, hasBundleID: true))
13-
XCTAssertFalse(BuildNotice.shouldNotify(.finished, enabled: true, appActive: true, hasBundleID: true), "a build someone is watching")
14-
XCTAssertFalse(BuildNotice.shouldNotify(.stopped, enabled: true, appActive: false, hasBundleID: true), "Stop was pressed at the app")
15-
XCTAssertFalse(BuildNotice.shouldNotify(failed, enabled: false, appActive: false, hasBundleID: true), "switched off in Settings")
16-
XCTAssertFalse(BuildNotice.shouldNotify(.finished, enabled: true, appActive: false, hasBundleID: false), "swift run: no bundle, no notification center")
9+
func testOnlyAFinishedOrFailedBuildIsNotified() {
10+
// The owner's rc8 report: a build that finishes in the foreground must announce itself too.
11+
XCTAssertFalse(BuildNotice.shouldNotify(.stopped, enabled: true, appActive: true, hasBundleID: true), "a stop is silent")
12+
XCTAssertTrue(BuildNotice.shouldNotify(.finished, enabled: true, appActive: true, hasBundleID: true), "success announces in the foreground")
13+
XCTAssertTrue(BuildNotice.shouldNotify(.finished, enabled: true, appActive: false, hasBundleID: true), "success announces in the background")
14+
XCTAssertFalse(BuildNotice.shouldNotify(.finished, enabled: false, appActive: false, hasBundleID: true), "disabled stays quiet")
15+
XCTAssertFalse(BuildNotice.shouldNotify(.finished, enabled: true, appActive: false, hasBundleID: false), "no bundle ID stays quiet")
1716
}
18-
1917
func testNotificationsAreOnUntilSwitchedOff() {
2018
let saved = UserDefaults.standard.object(forKey: BuildNotice.defaultsKey)
2119
defer { UserDefaults.standard.set(saved, forKey: BuildNotice.defaultsKey) }

0 commit comments

Comments
 (0)