This commit is contained in:
crschnick
2025-08-15 02:13:49 +00:00
parent 1841059327
commit 6b31632ae9
23 changed files with 114 additions and 49 deletions
@@ -25,6 +25,10 @@ import java.util.UUID;
public interface DataStoreProvider {
default boolean includeInConnectionCount() {
return getUsageCategory() != DataStoreUsageCategory.GROUP;
}
default boolean canConfigure() {
var m = getClass().getDeclaredMethods();
return Arrays.stream(m).anyMatch(method -> method.getName().equals("guiDialog"));
@@ -175,7 +175,7 @@ public class StoreCategoryWrapper {
.getUuid()
.equals(storeCategoryWrapper.getCategory().getParentCategory()))
.toList());
var direct = directContainedEntries.getList().size();
var direct = directContainedEntries.getList().filtered(storeEntryWrapper -> storeEntryWrapper.includeInConnectionCount()).size();
var sub = children.getList().stream()
.mapToInt(value -> value.allContainedEntriesCount.get())
.sum();
@@ -188,7 +188,7 @@ public class StoreCategoryWrapper {
}
var directFiltered = directContainedEntries.getList().stream()
.filter(storeEntryWrapper -> storeEntryWrapper.matchesFilter(
.filter(storeEntryWrapper -> storeEntryWrapper.includeInConnectionCount() && storeEntryWrapper.matchesFilter(
StoreViewState.get().getFilterString().getValue()))
.count();
var subFiltered = children.getList().stream()
@@ -49,21 +49,17 @@ public class StoreEntryListOverviewComp extends SimpleComp {
label.textProperty().bind(name);
label.getStyleClass().add("name");
var all = StoreViewState.get()
.getAllEntries()
.filtered(
storeEntryWrapper -> {
var rootCategory =
storeEntryWrapper.getCategory().getValue().getRoot();
var inRootCategory = StoreViewState.get()
.getActiveCategory()
.getValue()
.getRoot()
.equals(rootCategory);
return inRootCategory;
},
StoreViewState.get().getActiveCategory());
var allCount = Bindings.size(all.getList());
var allCount = StoreViewState.get()
.entriesCount(storeEntryWrapper -> {
var rootCategory =
storeEntryWrapper.getCategory().getValue().getRoot();
var inRootCategory = StoreViewState.get()
.getActiveCategory()
.getValue()
.getRoot()
.equals(rootCategory);
return inRootCategory;
}, StoreViewState.get().getActiveCategory());
var count = new CountComp(allCount, allCount, Function.identity());
var c = count.createRegion();
@@ -106,6 +106,10 @@ public class StoreEntryWrapper {
});
}
public boolean includeInConnectionCount() {
return getEntry().getProvider() != null && getEntry().getProvider().includeInConnectionCount();
}
public boolean isInStorage() {
return DataStorage.get() != null && DataStorage.get().getStoreEntries().contains(entry);
}
@@ -12,8 +12,10 @@ import io.xpipe.app.util.DerivedObservableList;
import io.xpipe.app.util.PlatformThread;
import javafx.application.Platform;
import javafx.beans.Observable;
import javafx.beans.binding.Bindings;
import javafx.beans.property.*;
import javafx.beans.value.ObservableIntegerValue;
import javafx.beans.value.ObservableValue;
import javafx.collections.FXCollections;
import javafx.collections.ListChangeListener;
@@ -21,6 +23,7 @@ import javafx.collections.ListChangeListener;
import lombok.Getter;
import java.util.*;
import java.util.function.Predicate;
import java.util.stream.Collectors;
public class StoreViewState {
@@ -148,6 +151,16 @@ public class StoreViewState {
return INSTANCE;
}
public ObservableIntegerValue entriesCount(Predicate<StoreEntryWrapper> filter, Observable... observables) {
return Bindings.size(allEntries.filtered(storeEntryWrapper -> {
if (!storeEntryWrapper.includeInConnectionCount()) {
return false;
}
return filter.test(storeEntryWrapper);
}, observables).getList());
}
public boolean isBatchModeSelected(StoreEntryWrapper entry) {
return batchModeSelectionSet.contains(entry);
}
@@ -5,6 +5,7 @@ import io.xpipe.app.comp.base.TileButtonComp;
import io.xpipe.app.core.AppI18n;
import io.xpipe.app.update.AppDistributionType;
import io.xpipe.app.update.UpdateAvailableDialog;
import io.xpipe.app.update.UpdateHandler;
import io.xpipe.app.util.PlatformThread;
import io.xpipe.app.util.ThreadHelper;
@@ -14,23 +15,6 @@ import javafx.scene.layout.Region;
public class UpdateCheckComp extends SimpleComp {
private final ObservableValue<Boolean> updateReady;
private final ObservableValue<Boolean> checking;
public UpdateCheckComp() {
updateReady = PlatformThread.sync(Bindings.createBooleanBinding(
() -> {
return AppDistributionType.get()
.getUpdateHandler()
.getPreparedUpdate()
.getValue()
!= null;
},
AppDistributionType.get().getUpdateHandler().getPreparedUpdate()));
checking =
PlatformThread.sync(AppDistributionType.get().getUpdateHandler().getBusy());
}
private void showAlert() {
ThreadHelper.runFailableAsync(() -> {
AppDistributionType.get().getUpdateHandler().refreshUpdateCheckSilent(false, false);
@@ -47,20 +31,27 @@ public class UpdateCheckComp extends SimpleComp {
@Override
protected Region createSimple() {
var uh = AppDistributionType.get().getUpdateHandler();
var name = Bindings.createStringBinding(
() -> {
if (checking.getValue()) {
if (uh.getBusy().getValue()) {
var available = uh.getLastUpdateCheckResult().getValue();
if (available != null) {
return AppI18n.get("downloadingUpdate", available.getVersion());
}
return AppI18n.get("checkingForUpdates");
}
if (updateReady.getValue()) {
if (uh
.getPreparedUpdate()
.getValue() != null) {
var prefix =
!AppDistributionType.get().getUpdateHandler().supportsDirectInstallation()
!uh.supportsDirectInstallation()
? AppI18n.get("updateReadyPortable")
: AppI18n.get("updateReady");
var version = "Version "
+ AppDistributionType.get()
.getUpdateHandler()
+ uh
.getPreparedUpdate()
.getValue()
.getVersion();
@@ -70,15 +61,23 @@ public class UpdateCheckComp extends SimpleComp {
return AppI18n.get("checkForUpdates");
},
AppI18n.activeLanguage(),
updateReady,
checking);
uh.getLastUpdateCheckResult(),
uh.getPreparedUpdate(),
uh.getBusy());
var description = Bindings.createStringBinding(
() -> {
if (checking.getValue()) {
if (uh.getBusy().getValue()) {
var available = uh.getLastUpdateCheckResult().getValue();
if (available != null) {
return AppI18n.get("downloadingUpdateDescription");
}
return AppI18n.get("checkingForUpdatesDescription");
}
if (updateReady.getValue()) {
if (uh
.getPreparedUpdate()
.getValue() != null) {
return AppDistributionType.get() == AppDistributionType.PORTABLE
? AppI18n.get("updateReadyDescriptionPortable")
: AppI18n.get("updateReadyDescription");
@@ -87,20 +86,31 @@ public class UpdateCheckComp extends SimpleComp {
return AppI18n.get("checkForUpdatesDescription");
},
AppI18n.activeLanguage(),
updateReady,
checking);
uh.getLastUpdateCheckResult(),
uh.getPreparedUpdate(),
uh.getBusy());
var graphic = Bindings.createObjectBinding(
() -> {
if (updateReady.getValue()) {
if (uh
.getPreparedUpdate()
.getValue() != null) {
return "mdi2b-button-cursor";
}
if (uh.getBusy().getValue() && uh.getLastUpdateCheckResult().getValue() != null) {
return "mdi2d-download";
}
return "mdi2r-refresh";
},
updateReady);
uh.getPreparedUpdate(),
uh.getBusy(),
uh.getLastUpdateCheckResult());
return new TileButtonComp(name, description, graphic, actionEvent -> {
actionEvent.consume();
if (updateReady.getValue()) {
if (uh
.getPreparedUpdate()
.getValue() != null) {
showAlert();
return;
}
@@ -108,7 +118,7 @@ public class UpdateCheckComp extends SimpleComp {
refresh();
})
.styleClass("update-button")
.disable(checking)
.disable(uh.getBusy())
.createRegion();
}
}
+6
View File
@@ -34,6 +34,12 @@ subprojects {subproject ->
}
}
// https://docs.gradle.org/9.0.0/userguide/upgrading_major_version_9.html#reproducible_archives_by_default
tasks.withType(AbstractArchiveTask).configureEach {
reproducibleFileOrder = false
preserveFileTimestamps = true
useFileSystemPermissions()
}
def user = project.hasProperty('sonatypeUsername') ? project.property('sonatypeUsername') : System.getenv('SONATYPE_USERNAME')
def pass = project.hasProperty('sonatypePassword') ? project.property('sonatypePassword') : System.getenv('SONATYPE_PASSWORD')
+2
View File
@@ -1279,6 +1279,8 @@ developerPrintInitFiles=Udskrivning af init-fil
developerPrintInitFilesDescription=Udskriv alle shell-init-scripts, der køres, når en terminal startes.
checkingForUpdates=Tjekker for opdateringer
checkingForUpdatesDescription=Henter oplysninger om seneste udgivelse
downloadingUpdate=Hentning af udgivelse (Version $VERSION$)
downloadingUpdateDescription=Download af udgivelsespakke
updateNag=Du har ikke opdateret XPipe i et stykke tid. Du går måske glip af nye funktioner og rettelser i nyere udgivelser.
updateNagTitle=Påmindelse om opdatering
updateNagButton=Se udgivelser
+2
View File
@@ -1266,6 +1266,8 @@ developerPrintInitFiles=Ausführung der Init-Datei drucken
developerPrintInitFilesDescription=Alle Shell-Init-Skripte ausgeben, die beim Starten eines Terminals ausgeführt werden.
checkingForUpdates=Prüfen auf Updates
checkingForUpdatesDescription=Informationen über die neueste Version abrufen
downloadingUpdate=Freigabe abrufen (Version $VERSION$)
downloadingUpdateDescription=Herunterladen des Release-Pakets
updateNag=Du hast XPipe schon eine Weile nicht mehr aktualisiert. Möglicherweise verpasst du neue Funktionen und Fehlerbehebungen in neueren Versionen.
updateNagTitle=Update-Erinnerung
updateNagButton=Siehe Veröffentlichungen
+2
View File
@@ -1289,6 +1289,8 @@ developerPrintInitFiles=Print init file execution
developerPrintInitFilesDescription=Print all shell init scripts that are run when a terminal is launched.
checkingForUpdates=Checking for updates
checkingForUpdatesDescription=Fetching latest release information
downloadingUpdate=Retrieving release (Version $VERSION$)
downloadingUpdateDescription=Downloading release package
updateNag=You haven't updated XPipe in a while. You might be missing out on new features and fixes of newer releases.
updateNagTitle=Update reminder
updateNagButton=See releases
+2
View File
@@ -1235,6 +1235,8 @@ developerPrintInitFiles=Imprimir la ejecución del archivo init
developerPrintInitFilesDescription=Imprime todos los scripts init del shell que se ejecutan al iniciar un terminal.
checkingForUpdates=Comprobación de actualizaciones
checkingForUpdatesDescription=Obtención de información sobre la última versión
downloadingUpdate=Recuperación de la versión (Versión $VERSION$)
downloadingUpdateDescription=Descarga del paquete de lanzamiento
updateNag=Hace tiempo que no actualizas XPipe. Puede que te estés perdiendo nuevas funciones y correcciones de versiones más recientes.
updateNagTitle=Recordatorio de actualización
updateNagButton=Ver liberaciones
+2
View File
@@ -1273,6 +1273,8 @@ developerPrintInitFiles=Exécution d'un fichier d'initialisation d'impression
developerPrintInitFilesDescription=Imprime tous les scripts d'initialisation de l'interpréteur de commandes qui sont exécutés lorsqu'un terminal est lancé.
checkingForUpdates=Vérification des mises à jour
checkingForUpdatesDescription=Récupérer les informations sur la dernière version
downloadingUpdate=Récupération de la version (Version $VERSION$)
downloadingUpdateDescription=Téléchargement d'un paquet de versions
updateNag=Tu n'as pas mis à jour XPipe depuis un certain temps. Il se peut que tu passes à côté des nouvelles fonctionnalités et des correctifs des versions plus récentes.
updateNagTitle=Rappel de mise à jour
updateNagButton=Voir les communiqués
+2
View File
@@ -1235,6 +1235,8 @@ developerPrintInitFiles=Mencetak eksekusi file init
developerPrintInitFilesDescription=Mencetak semua skrip init shell yang dijalankan saat terminal diluncurkan.
checkingForUpdates=Memeriksa pembaruan
checkingForUpdatesDescription=Mengambil informasi rilis terbaru
downloadingUpdate=Mengambil rilis (Versi $VERSION$)
downloadingUpdateDescription=Mengunduh paket rilis
updateNag=Anda belum memperbarui XPipe dalam beberapa waktu. Anda mungkin melewatkan fitur-fitur baru dan perbaikan pada rilis yang lebih baru.
updateNagTitle=Pengingat pembaruan
updateNagButton=Lihat rilis
+2
View File
@@ -1235,6 +1235,8 @@ developerPrintInitFiles=Stampa dell'esecuzione del file init
developerPrintInitFilesDescription=Stampa tutti gli script di avvio della shell che vengono eseguiti quando viene lanciato un terminale.
checkingForUpdates=Controllo degli aggiornamenti
checkingForUpdatesDescription=Recuperare le informazioni sull'ultima release
downloadingUpdate=Recupero della release (Versione $VERSION$)
downloadingUpdateDescription=Download di un pacchetto di rilascio
updateNag=È da un po' che non aggiorni XPipe. Potresti perdere le nuove funzionalità e le correzioni delle versioni più recenti.
updateNagTitle=Promemoria di aggiornamento
updateNagButton=Vedere i comunicati
+2
View File
@@ -1235,6 +1235,8 @@ developerPrintInitFiles=印刷開始ファイルの実行
developerPrintInitFilesDescription=ターミナル起動時に実行されるすべてのシェルinitスクリプトを表示する。
checkingForUpdates=アップデートをチェックする
checkingForUpdatesDescription=最新リリース情報を取得する
downloadingUpdate=リリースの取得 (バージョン$VERSION$)
downloadingUpdateDescription=リリースパッケージをダウンロードする
updateNag=XPipeをしばらくアップデートしていない。新しいリリースの新機能や修正を見逃しているかもしれない。
updateNagTitle=更新リマインダー
updateNagButton=リリースを見る
+2
View File
@@ -1235,6 +1235,8 @@ developerPrintInitFiles=초기화 파일 실행 인쇄
developerPrintInitFilesDescription=터미널이 시작될 때 실행되는 모든 셸 초기화 스크립트를 인쇄합니다.
checkingForUpdates=업데이트 확인
checkingForUpdatesDescription=최신 릴리스 정보 가져오기
downloadingUpdate=릴리스 검색(버전 $VERSION$)
downloadingUpdateDescription=릴리스 패키지 다운로드
updateNag=XPipe를 한동안 업데이트하지 않았습니다. 최신 릴리스의 새로운 기능 및 수정 사항을 놓치고 있을 수 있습니다.
updateNagTitle=업데이트 알림
updateNagButton=릴리스 보기
+2
View File
@@ -1235,6 +1235,8 @@ developerPrintInitFiles=Uitvoering init-bestand afdrukken
developerPrintInitFilesDescription=Alle shell init scripts afdrukken die worden uitgevoerd wanneer een terminal wordt gestart.
checkingForUpdates=Controleren op updates
checkingForUpdatesDescription=Informatie over de laatste release ophalen
downloadingUpdate=Vrijgave ophalen (Versie $VERSION$)
downloadingUpdateDescription=Een release downloaden
updateNag=Je hebt XPipe al een tijdje niet bijgewerkt. Mogelijk mis je dan nieuwe functies en fixes van nieuwere releases.
updateNagTitle=Herinnering bijwerken
updateNagButton=Bekijk uitgaven
+2
View File
@@ -1236,6 +1236,8 @@ developerPrintInitFiles=Wydrukuj wykonanie pliku inicjującego
developerPrintInitFilesDescription=Wydrukuj wszystkie skrypty init powłoki, które są uruchamiane po uruchomieniu terminala.
checkingForUpdates=Sprawdzanie dostępności aktualizacji
checkingForUpdatesDescription=Pobieranie informacji o najnowszej wersji
downloadingUpdate=Pobieranie wersji (wersja $VERSION$)
downloadingUpdateDescription=Pobieranie pakietu wersji
updateNag=Nie aktualizowałeś XPipe od jakiegoś czasu. Możesz przegapić nowe funkcje i poprawki w nowszych wersjach.
updateNagTitle=Przypomnienie o aktualizacji
updateNagButton=Zobacz wydania
+2
View File
@@ -1235,6 +1235,8 @@ developerPrintInitFiles=Imprime a execução do ficheiro de inicialização
developerPrintInitFilesDescription=Imprime todos os scripts shell init que são executados quando um terminal é iniciado.
checkingForUpdates=Verificação de actualizações
checkingForUpdatesDescription=Obter informações sobre a última versão
downloadingUpdate=Recuperar a versão (Versão $VERSION$)
downloadingUpdateDescription=Descarregar o pacote de lançamento
updateNag=Não actualizas o XPipe há algum tempo. Podes estar a perder as novas funcionalidades e correcções das versões mais recentes.
updateNagTitle=Lembrete de atualização
updateNagButton=Ver lançamentos
+2
View File
@@ -1235,6 +1235,8 @@ developerPrintInitFiles=Выполнение файла Print init
developerPrintInitFilesDescription=Выведите все скрипты shell init, которые запускаются при запуске терминала.
checkingForUpdates=Проверка наличия обновлений
checkingForUpdatesDescription=Получение информации о последнем релизе
downloadingUpdate=Извлечение релиза (версия $VERSION$)
downloadingUpdateDescription=Загрузка релиз-пакета
updateNag=Ты давно не обновлял XPipe. Возможно, ты упускаешь новые возможности и исправления из новых выпусков.
updateNagTitle=Напоминание об обновлении
updateNagButton=Смотри релизы
+2
View File
@@ -1235,6 +1235,8 @@ developerPrintInitFiles=Exekvering av filen Print init
developerPrintInitFilesDescription=Skriv ut alla shell init-skript som körs när en terminal startas.
checkingForUpdates=Kontrollerar för uppdateringar
checkingForUpdatesDescription=Hämtar information om senaste utgåvan
downloadingUpdate=Hämtar release (Version $VERSION$)
downloadingUpdateDescription=Nedladdning av releasepaket
updateNag=Du har inte uppdaterat XPipe på ett tag. Du kanske missar nya funktioner och korrigeringar av nyare utgåvor.
updateNagTitle=Påminnelse om uppdatering
updateNagButton=Se releaser
+2
View File
@@ -1235,6 +1235,8 @@ developerPrintInitFiles=Init dosyası yürütmesini yazdır
developerPrintInitFilesDescription=Bir terminal başlatıldığında çalıştırılan tüm kabuk başlangıç betiklerini yazdırır.
checkingForUpdates=Güncellemeleri kontrol etme
checkingForUpdatesDescription=En son sürüm bilgilerini getirme
downloadingUpdate=Serbest bırakma alınıyor (Sürüm $VERSION$)
downloadingUpdateDescription=Sürüm paketini indirme
updateNag=XPipe'ı bir süredir güncellemediniz. Yeni sürümlerin yeni özelliklerini ve düzeltmelerini kaçırıyor olabilirsiniz.
updateNagTitle=Güncelleme hatırlatması
updateNagButton=Yayınlara bakın
+2
View File
@@ -1441,6 +1441,8 @@ developerPrintInitFilesDescription=打印启动终端时运行的所有 shell
#custom
checkingForUpdates=正在检查更新
checkingForUpdatesDescription=获取最新版本信息
downloadingUpdate=检索版本(版本$VERSION$)
downloadingUpdateDescription=下载发布包
updateNag=您有一段时间没有更新 XPipe 了。您可能会错过新版本的新功能和修复。
updateNagTitle=更新提醒
updateNagButton=参见发布