Add setting to confirm all deletions

This commit is contained in:
crschnick
2024-09-18 10:33:16 +00:00
parent c18a159504
commit 13edc5cac6
26 changed files with 57 additions and 3 deletions
@@ -2,6 +2,7 @@ package io.xpipe.app.browser.file;
import io.xpipe.app.core.AppI18n;
import io.xpipe.app.core.window.AppWindowHelper;
import io.xpipe.app.prefs.AppPrefs;
import io.xpipe.core.store.FileEntry;
import io.xpipe.core.store.FileKind;
import io.xpipe.core.store.FilePath;
@@ -62,7 +63,7 @@ public class BrowserAlerts {
}
public static boolean showDeleteAlert(List<FileEntry> source) {
if (source.stream().noneMatch(entry -> entry.getKind() == FileKind.DIRECTORY)) {
if (!AppPrefs.get().confirmDeletions().get() && source.stream().noneMatch(entry -> entry.getKind() == FileKind.DIRECTORY)) {
return true;
}
@@ -105,6 +105,8 @@ public class AppPrefs {
map(new SimpleBooleanProperty(true), "openConnectionSearchWindowOnConnectionCreation", Boolean.class);
final ObjectProperty<Path> storageDirectory =
map(new SimpleObjectProperty<>(DEFAULT_STORAGE_DIR), "storageDirectory", Path.class);
final BooleanProperty confirmAllDeletions =
map(new SimpleBooleanProperty(false), "confirmAllDeletions", Boolean.class);
final BooleanProperty developerMode = map(new SimpleBooleanProperty(false), "developerMode", Boolean.class);
final BooleanProperty developerDisableUpdateVersionCheck =
map(new SimpleBooleanProperty(false), "developerDisableUpdateVersionCheck", Boolean.class);
@@ -14,7 +14,7 @@ public class WorkflowCategory extends AppPrefsCategory {
protected Comp<?> create() {
var prefs = AppPrefs.get();
return new OptionsBuilder()
.addTitle("workflow")
.addTitle("connections")
.sub(new OptionsBuilder()
.nameAndDescription("condenseConnectionDisplay")
.addToggle(prefs.condenseConnectionDisplay)
@@ -24,6 +24,10 @@ public class WorkflowCategory extends AppPrefsCategory {
.addToggle(prefs.openConnectionSearchWindowOnConnectionCreation)
.nameAndDescription("requireDoubleClickForConnections")
.addToggle(prefs.requireDoubleClickForConnections))
.addTitle("fileBrowser")
.sub(new OptionsBuilder()
.nameAndDescription("confirmAllDeletions")
.addToggle(prefs.confirmAllDeletions))
.buildComp();
}
}
@@ -514,3 +514,6 @@ enableHttpApiDescription=Aktiverer API'en, så eksterne programmer kan kalde XPi
chooseCustomIcon=Vælg et brugerdefineret ikon
clear=Rydde
gitVault=Git-hvælving
fileBrowser=Fil-browser
confirmAllDeletions=Bekræft alle sletninger
confirmAllDeletionsDescription=Om der skal vises en bekræftelsesdialog for alle sletteoperationer. Som standard er det kun mapper, der kræver en bekræftelse.
@@ -508,3 +508,6 @@ enableHttpApiDescription=Aktiviert die API, damit externe Programme den XPipe-Da
chooseCustomIcon=Benutzerdefiniertes Symbol auswählen
clear=Löschen
gitVault=Git-Tresor
fileBrowser=Dateibrowser
confirmAllDeletions=Bestätige alle Löschungen
confirmAllDeletionsDescription=Ob ein Bestätigungsdialog für alle Löschvorgänge angezeigt werden soll. Standardmäßig benötigen nur Verzeichnisse eine Bestätigung.
+4 -1
View File
@@ -512,4 +512,7 @@ enableHttpApiDescription=Enables the API, allowing external programs to call the
chooseCustomIcon=Choose custom icon
#context: verb, to delete
clear=Clear
gitVault=Git vault
gitVault=Git vault
fileBrowser=File browser
confirmAllDeletions=Confirm all deletions
confirmAllDeletionsDescription=Whether to show a confirmation dialog for all delete operations. By default, only directories require a confirmation.
@@ -495,3 +495,6 @@ enableHttpApiDescription=Habilita la API, permitiendo que programas externos lla
chooseCustomIcon=Elegir icono personalizado
clear=Borrar
gitVault=Bóveda Git
fileBrowser=Navegador de archivos
confirmAllDeletions=Confirmar todos los borrados
confirmAllDeletionsDescription=Si mostrar un diálogo de confirmación para todas las operaciones de borrado. Por defecto, sólo los directorios requieren una confirmación.
@@ -495,3 +495,6 @@ enableHttpApiDescription=Active l'API, ce qui permet aux programmes externes d'a
chooseCustomIcon=Choisis une icône personnalisée
clear=Effacer
gitVault=Coffre-fort Git
fileBrowser=Navigateur de fichiers
confirmAllDeletions=Confirme toutes les suppressions
confirmAllDeletionsDescription=Affichage ou non d'une boîte de dialogue de confirmation pour toutes les opérations de suppression. Par défaut, seuls les répertoires nécessitent une confirmation.
@@ -495,3 +495,6 @@ enableHttpApiDescription=Abilita l'API, consentendo ai programmi esterni di chia
chooseCustomIcon=Scegli un'icona personalizzata
clear=Cancellare
gitVault=Git vault
fileBrowser=Browser di file
confirmAllDeletions=Conferma tutte le eliminazioni
confirmAllDeletionsDescription=Se mostrare una finestra di conferma per tutte le operazioni di cancellazione. Per impostazione predefinita, solo le directory richiedono una conferma.
@@ -495,3 +495,6 @@ enableHttpApiDescription=APIを有効にし、外部プログラムからXPipe
chooseCustomIcon=カスタムアイコンを選ぶ
clear=消去する
gitVault=Git保管庫
fileBrowser=ファイルブラウザ
confirmAllDeletions=すべての削除を確認する
confirmAllDeletionsDescription=すべての削除操作に対して確認ダイアログを表示するかどうか。デフォルトでは、確認が必要なのはディレクトリだけである。
@@ -495,3 +495,6 @@ enableHttpApiDescription=Schakelt de API in, waardoor externe programma's de XPi
chooseCustomIcon=Aangepast pictogram kiezen
clear=Wis
gitVault=Git kluis
fileBrowser=Bestandsbrowser
confirmAllDeletions=Alle verwijderingen bevestigen
confirmAllDeletionsDescription=Of een bevestigingsvenster moet worden weergegeven voor alle verwijderbewerkingen. Standaard vereisen alleen mappen een bevestiging.
@@ -495,3 +495,6 @@ enableHttpApiDescription=Habilita a API, permitindo que programas externos chame
chooseCustomIcon=Escolhe um ícone personalizado
clear=Limpar
gitVault=Cofre do Git
fileBrowser=Navegador de ficheiros
confirmAllDeletions=Confirma todas as eliminações
confirmAllDeletionsDescription=Mostra ou não uma caixa de diálogo de confirmação para todas as operações de eliminação. Por predefinição, apenas as diretorias requerem uma confirmação.
@@ -495,3 +495,6 @@ enableHttpApiDescription=Включает API, позволяя внешним
chooseCustomIcon=Выберите пользовательскую иконку
clear=Очистить
gitVault=Git vault
fileBrowser=Браузер файлов
confirmAllDeletions=Подтвердите все удаления
confirmAllDeletionsDescription=Показывать ли диалог подтверждения для всех операций удаления. По умолчанию подтверждение требуется только для каталогов.
@@ -496,3 +496,6 @@ enableHttpApiDescription=API'yi etkinleştirerek harici programların yönetilen
chooseCustomIcon=Özel simge seçin
clear=Temiz
gitVault=Git kasası
fileBrowser=Dosya tarayıcısı
confirmAllDeletions=Tüm silme işlemlerini onaylayın
confirmAllDeletionsDescription=Tüm silme işlemleri için bir onay iletişim kutusu gösterilip gösterilmeyeceği. Varsayılan olarak, yalnızca dizinler onay gerektirir.
@@ -495,3 +495,6 @@ enableHttpApiDescription=启用 API,允许外部程序调用 XPipe 守护进
chooseCustomIcon=选择自定义图标
clear=清除
gitVault=Git 数据库
fileBrowser=文件浏览器
confirmAllDeletions=确认所有删除
confirmAllDeletionsDescription=是否为所有删除操作显示确认对话框。默认情况下,只有目录需要确认。
@@ -173,3 +173,4 @@ hasService=$COUNT$ tilgængelig tjeneste
openHttp=Åben HTTP-tjeneste
openHttps=Åben HTTPS-tjeneste
noScriptsAvailable=Ingen tilgængelige scripts
changeIcon=Skift ikon
@@ -164,3 +164,4 @@ hasService=$COUNT$ verfügbarer Dienst
openHttp=Offener HTTP-Dienst
openHttps=HTTPS-Dienst öffnen
noScriptsAvailable=Keine Skripte verfügbar
changeIcon=Symbol ändern
@@ -162,3 +162,4 @@ hasService=$COUNT$ servicio disponible
openHttp=Servicio HTTP abierto
openHttps=Abrir servicio HTTPS
noScriptsAvailable=No hay guiones disponibles
changeIcon=Cambiar icono
@@ -162,3 +162,4 @@ hasService=$COUNT$ service disponible
openHttp=Service HTTP ouvert
openHttps=Service HTTPS ouvert
noScriptsAvailable=Pas de scripts disponibles
changeIcon=Changer d'icône
@@ -162,3 +162,4 @@ hasService=$COUNT$ servizio disponibile
openHttp=Servizio HTTP aperto
openHttps=Servizio HTTPS aperto
noScriptsAvailable=Non sono disponibili script
changeIcon=Cambia icona
@@ -162,3 +162,4 @@ hasService=$COUNT$ 利用可能なサービス
openHttp=オープンHTTPサービス
openHttps=HTTPSサービスを開く
noScriptsAvailable=スクリプトはない
changeIcon=アイコンの変更
@@ -162,3 +162,4 @@ hasService=$COUNT$ beschikbare dienst
openHttp=Open HTTP service
openHttps=Open HTTPS service
noScriptsAvailable=Geen scripts beschikbaar
changeIcon=Pictogram wijzigen
@@ -162,3 +162,4 @@ hasService=$COUNT$ serviço disponível
openHttp=Abre o serviço HTTP
openHttps=Abre o serviço HTTPS
noScriptsAvailable=Não há scripts disponíveis
changeIcon=Altera o ícone
@@ -162,3 +162,4 @@ hasService=$COUNT$ доступный сервис
openHttp=Открытый HTTP-сервис
openHttps=Открытая служба HTTPS
noScriptsAvailable=Нет доступных скриптов
changeIcon=Значок изменения
@@ -162,3 +162,4 @@ hasService=$COUNT$ mevcut hizmet
openHttp=Açık HTTP hizmeti
openHttps=HTTPS hizmetini açın
noScriptsAvailable=Mevcut senaryo yok
changeIcon=Simge değiştir
@@ -162,3 +162,4 @@ hasService=$COUNT$ 可用服务
openHttp=开放式 HTTP 服务
openHttps=打开 HTTPS 服务
noScriptsAvailable=无脚本可用
changeIcon=更改图标