Skip to content

armgit / peel

Public Imported from GitHub
0

Uninstall Mac apps with every file they leave behind, and see why each belongs. Free up space, fine-tune macOS, and set up Terminal.

Offer Stop for a background job that waits for its schedule

Țugui Dragoș59c4f4c9ba1c
diff --git a/Localization/Peel/Localizable.xcstrings b/Localization/Peel/Localizable.xcstrings
index 723fc84b..52032a9c 100644
--- a/Localization/Peel/Localizable.xcstrings
+++ b/Localization/Peel/Localizable.xcstrings
@@ -186679,6 +186679,112 @@
}
}
},
+ "Takes it out of launchd until the next login or restart. Its file stays where it is." : {
+ "localizations" : {
+ "cs" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Odebere úlohu z launchd do příštího přihlášení nebo restartu. Její soubor zůstane, kde je."
+ }
+ },
+ "de" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Entfernt es bis zur nächsten Anmeldung oder zum nächsten Neustart aus launchd. Seine Datei bleibt, wo sie ist."
+ }
+ },
+ "es" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Lo quita de launchd hasta el próximo inicio de sesión o reinicio. Su archivo se queda donde está."
+ }
+ },
+ "fr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Retire cet élément de launchd jusqu’à la prochaine ouverture de session ou au prochain redémarrage. Son fichier reste là où il est."
+ }
+ },
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Lo toglie da launchd fino al prossimo login o riavvio. Il suo file resta dov’è."
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "次回のログインまたは再起動まで、launchdから取り除きます。ファイルはそのまま残ります。"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "다음 로그인 또는 재시동까지 launchd에서 이 항목을 제거합니다. 파일은 그대로 남습니다."
+ }
+ },
+ "nl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Haalt het uit launchd tot je weer inlogt of de Mac opnieuw opstart. Het bestand ervan blijft staan waar het staat."
+ }
+ },
+ "pl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Usuwa tę rzecz z launchd do następnego logowania lub ponownego uruchomienia. Jej plik pozostaje na miejscu."
+ }
+ },
+ "pt" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Retira o item do launchd até o próximo início de sessão ou a próxima reinicialização. O arquivo dele fica onde está."
+ }
+ },
+ "ro" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Îl scoate din launchd până la următorul login sau la următoarea repornire. Fișierul său rămâne unde se află."
+ }
+ },
+ "ru" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Убирает его из launchd до следующего входа в систему или перезагрузки. Его файл остается на месте."
+ }
+ },
+ "sv" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Tar bort det ur launchd till nästa inloggning eller omstart. Filen ligger kvar där den är."
+ }
+ },
+ "tr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Bir sonraki oturum açılışına veya yeniden başlatmaya kadar onu launchd’den çıkarır. Dosyası olduğu yerde kalır."
+ }
+ },
+ "uk" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Вилучає його з launchd до наступного входу в систему або перезапуску. Його файл лишається на місці."
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "将此任务从launchd中移除,直到下次登录或重新启动。它的文件会留在原处。"
+ }
+ },
+ "zh-Hant" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "將它從launchd中移除,直到下次登入或重新開機為止。它的檔案會留在原處。"
+ }
+ }
+ }
+ },
"Takes it out of launchd. Its file stays where it is, and it runs again only if something loads it again." : {
"localizations" : {
"cs" : {
diff --git a/Peel/Views/BackgroundItems/BackgroundItemDetailView.swift b/Peel/Views/BackgroundItems/BackgroundItemDetailView.swift
index 86d2b960..0d51bb5b 100644
--- a/Peel/Views/BackgroundItems/BackgroundItemDetailView.swift
+++ b/Peel/Views/BackgroundItems/BackgroundItemDetailView.swift
@@ -443,10 +443,19 @@ struct BackgroundItemDetailView: View {
// and Peel could not start it again. For an app's job, System Settings also offers only a switch.
if !item.isSeenOnlyWhileLoaded {
let isRunning = if case .running = item.state { true } else { false }
- Button(isRunning ? "Stop" : "Start", systemImage: isRunning ? "stop.fill" : "play.fill") {
- Task { await backgroundItems.perform(isRunning ? .stop : .start, on: item) }
+ if !isRunning {
+ Button("Start", systemImage: "play.fill") {
+ Task { await backgroundItems.perform(.start, on: item) }
+ }
+ .help(startHelp)
+ }
+ // A job that waits for its schedule is loaded too, and only this takes it out for now.
+ if item.state != .notLoaded {
+ Button("Stop", systemImage: "stop.fill") {
+ Task { await backgroundItems.perform(.stop, on: item) }
+ }
+ .help(Text("Takes it out of launchd until the next login or restart. Its file stays where it is."))
}
- .help(isRunning ? Text(verbatim: "") : startHelp)
}
if item.isDisabled || item.mayBeDisabled {
Button(item.isDisabled ? "Enable" : "Disable", systemImage: item.isDisabled ? "checkmark.circle" : "minus.circle") {