mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-14 00:31:27 +00:00
Merge branch 'develop' into libappindicator
This commit is contained in:
29
.github/release.yml
vendored
Normal file
29
.github/release.yml
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
# .github/release.yml
|
||||
# see https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes#configuring-automatically-generated-release-notes
|
||||
|
||||
changelog:
|
||||
exclude:
|
||||
authors:
|
||||
- cryptobot
|
||||
- dependabot
|
||||
- github-actions
|
||||
categories:
|
||||
- title: What's New 🎉
|
||||
labels:
|
||||
- type:feature-request
|
||||
- type:enhancement
|
||||
- title: Bugfixes 🐛
|
||||
labels:
|
||||
- type:security-issue
|
||||
- type:bug
|
||||
- type:minor-bug
|
||||
- title: Other Changes 📎
|
||||
labels:
|
||||
- "*"
|
||||
exclude:
|
||||
labels:
|
||||
- type:feature-request
|
||||
- type:enhancement
|
||||
- type:security-issue
|
||||
- type:bug
|
||||
- type:minor-bug
|
||||
2
.github/workflows/appimage.yml
vendored
2
.github/workflows/appimage.yml
vendored
@@ -10,7 +10,7 @@ on:
|
||||
required: false
|
||||
|
||||
env:
|
||||
JAVA_VERSION: 19
|
||||
JAVA_VERSION: 20
|
||||
|
||||
jobs:
|
||||
get-version:
|
||||
|
||||
6
.github/workflows/build.yml
vendored
6
.github/workflows/build.yml
vendored
@@ -6,7 +6,7 @@ on:
|
||||
types: [labeled]
|
||||
|
||||
env:
|
||||
JAVA_VERSION: 19
|
||||
JAVA_VERSION: 20
|
||||
|
||||
defaults:
|
||||
run:
|
||||
@@ -53,4 +53,8 @@ jobs:
|
||||
body: |-
|
||||
:construction: Work in Progress
|
||||
|
||||
Please be patient, the builds are still running. We will publish new versions of Cryptomator here in a few moments.
|
||||
|
||||
As usual, the GPG signatures can be checked using [our public key `5811 7AFA 1F85 B3EE C154 677D 615D 449F E6E6 A235`](https://gist.github.com/cryptobot/211111cf092037490275f39d408f461a).
|
||||
---
|
||||
<!-- Don't forget to include the 💾 SHA-256 checksums of release artifacts: -->
|
||||
8
.github/workflows/debian.yml
vendored
8
.github/workflows/debian.yml
vendored
@@ -19,9 +19,9 @@ on:
|
||||
type: boolean
|
||||
|
||||
env:
|
||||
JAVA_VERSION: 19
|
||||
OPENJFX_JMODS_AMD64: 'https://download2.gluonhq.com/openjfx/19.0.2.1/openjfx-19.0.2.1_linux-x64_bin-jmods.zip'
|
||||
OPENJFX_JMODS_AARCH64: 'https://download2.gluonhq.com/openjfx/19.0.2.1/openjfx-19.0.2.1_linux-aarch64_bin-jmods.zip'
|
||||
JAVA_VERSION: 20
|
||||
OPENJFX_JMODS_AMD64: 'https://download2.gluonhq.com/openjfx/20.0.1/openjfx-20.0.1_linux-x64_bin-jmods.zip'
|
||||
OPENJFX_JMODS_AARCH64: 'https://download2.gluonhq.com/openjfx/20.0.1/openjfx-20.0.1_linux-aarch64_bin-jmods.zip'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -45,7 +45,7 @@ jobs:
|
||||
run: |
|
||||
sudo add-apt-repository ppa:coffeelibs/openjdk
|
||||
sudo apt-get update
|
||||
sudo apt-get install debhelper devscripts dput coffeelibs-jdk-19 libgtk2.0-0
|
||||
sudo apt-get install debhelper devscripts dput coffeelibs-jdk-${{ env.JAVA_VERSION }} libgtk2.0-0
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
|
||||
2
.github/workflows/get-version.yml
vendored
2
.github/workflows/get-version.yml
vendored
@@ -22,7 +22,7 @@ on:
|
||||
value: ${{ jobs.determine-version.outputs.type }}
|
||||
|
||||
env:
|
||||
JAVA_VERSION: 19
|
||||
JAVA_VERSION: 20
|
||||
JAVA_DIST: 'temurin'
|
||||
JAVA_CACHE: 'maven'
|
||||
|
||||
|
||||
2
.github/workflows/mac-dmg.yml
vendored
2
.github/workflows/mac-dmg.yml
vendored
@@ -10,7 +10,7 @@ on:
|
||||
required: false
|
||||
|
||||
env:
|
||||
JAVA_VERSION: 19
|
||||
JAVA_VERSION: 20
|
||||
|
||||
jobs:
|
||||
get-version:
|
||||
|
||||
2
.github/workflows/pullrequest.yml
vendored
2
.github/workflows/pullrequest.yml
vendored
@@ -4,7 +4,7 @@ on:
|
||||
pull_request:
|
||||
|
||||
env:
|
||||
JAVA_VERSION: 19
|
||||
JAVA_VERSION: 20
|
||||
|
||||
defaults:
|
||||
run:
|
||||
|
||||
2
.github/workflows/release-check.yml
vendored
2
.github/workflows/release-check.yml
vendored
@@ -7,7 +7,7 @@ on:
|
||||
- 'hotfix/**'
|
||||
|
||||
env:
|
||||
JAVA_VERSION: 19
|
||||
JAVA_VERSION: 20
|
||||
|
||||
defaults:
|
||||
run:
|
||||
|
||||
8
.github/workflows/win-exe.yml
vendored
8
.github/workflows/win-exe.yml
vendored
@@ -14,11 +14,11 @@ on:
|
||||
|
||||
|
||||
env:
|
||||
JAVA_VERSION: 19
|
||||
JAVA_VERSION: 20
|
||||
JAVA_DIST: 'temurin'
|
||||
JAVA_CACHE: 'maven'
|
||||
JFX_JMODS_URL: 'https://download2.gluonhq.com/openjfx/19.0.2.1/openjfx-19.0.2.1_windows-x64_bin-jmods.zip'
|
||||
JFX_JMODS_HASH: 'B7CF2CAD2468842B3B78D99F6C0555771499A36FA1F1EE3DD1B9A4597F1FAB86'
|
||||
JFX_JMODS_URL: 'https://download2.gluonhq.com/openjfx/20.0.1/openjfx-20.0.1_windows-x64_bin-jmods.zip'
|
||||
JFX_JMODS_HASH: 'D00767334C43B8832B5CF10267D34CA8F563D187C4655B73EB6020DD79C054B5'
|
||||
|
||||
defaults:
|
||||
run:
|
||||
@@ -51,7 +51,7 @@ jobs:
|
||||
run: |
|
||||
curl --output jfxjmods.zip -L "${{ env.JFX_JMODS_URL }}"
|
||||
if(!(Get-FileHash -Path jfxjmods.zip -Algorithm SHA256).Hash.equals("${{ env.JFX_JMODS_HASH }}")) {
|
||||
exit 1;
|
||||
throw "Wrong checksum of JMOD archive downloaded from ${{ env.JFX_JMODS_URL }}.";
|
||||
}
|
||||
Expand-Archive -Path jfxjmods.zip -DestinationPath jfxjmods
|
||||
Get-ChildItem -Path jfxjmods -Recurse -Filter "*.jmod" | ForEach-Object { Move-Item -Path $_ -Destination $_.Directory.Parent}
|
||||
|
||||
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -8,7 +8,7 @@
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_19" default="true" project-jdk-name="19" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_20_PREVIEW" project-jdk-name="20" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
||||
2
dist/linux/debian/control
vendored
2
dist/linux/debian/control
vendored
@@ -2,7 +2,7 @@ Source: cryptomator
|
||||
Maintainer: Cryptobot <releases@cryptomator.org>
|
||||
Section: utils
|
||||
Priority: optional
|
||||
Build-Depends: debhelper (>=10), coffeelibs-jdk-19, libgtk2.0-0, libgtk-3-0, libxxf86vm1, libgl1
|
||||
Build-Depends: debhelper (>=10), coffeelibs-jdk-20, libgtk2.0-0, libgtk-3-0, libxxf86vm1, libgl1
|
||||
Standards-Version: 4.5.0
|
||||
Homepage: https://cryptomator.org
|
||||
Vcs-Git: https://github.com/cryptomator/cryptomator.git
|
||||
|
||||
2
dist/linux/debian/rules
vendored
2
dist/linux/debian/rules
vendored
@@ -4,7 +4,7 @@
|
||||
# Uncomment this to turn on verbose mode.
|
||||
#export DH_VERBOSE=1
|
||||
|
||||
JAVA_HOME = /usr/lib/jvm/java-19-coffeelibs
|
||||
JAVA_HOME = /usr/lib/jvm/java-20-coffeelibs
|
||||
DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
|
||||
ifeq ($(DEB_BUILD_ARCH),amd64)
|
||||
JMODS_PATH = jmods/amd64:${JAVA_HOME}/jmods
|
||||
|
||||
12
dist/win/resources/main.wxs
vendored
12
dist/win/resources/main.wxs
vendored
@@ -70,6 +70,9 @@
|
||||
<CustomAction Id="JpDisallowDowngrade" Error="!(loc.DowngradeErrorMessage)" />
|
||||
<?endif?>
|
||||
|
||||
<Binary Id="JpCaDll" SourceFile="wixhelper.dll"/>
|
||||
<CustomAction Id="JpFindRelatedProducts" BinaryKey="JpCaDll" DllEntry="FindRelatedProductsEx" />
|
||||
|
||||
<?ifndef SkipCryptomatorLegacyCheck ?>
|
||||
<!-- Block installation if innosetup entry of Cryptomator is found -->
|
||||
<Property Id="OLDEXEINSTALLER">
|
||||
@@ -172,11 +175,12 @@
|
||||
<?endif?>
|
||||
|
||||
<?ifndef JpAllowUpgrades ?>
|
||||
<Custom Action="JpDisallowUpgrade" After="FindRelatedProducts">JP_UPGRADABLE_FOUND</Custom>
|
||||
<Custom Action="JpDisallowUpgrade" After="JpFindRelatedProducts">JP_UPGRADABLE_FOUND</Custom>
|
||||
<?endif?>
|
||||
<?ifndef JpAllowDowngrades ?>
|
||||
<Custom Action="JpDisallowDowngrade" After="FindRelatedProducts">JP_DOWNGRADABLE_FOUND</Custom>
|
||||
<Custom Action="JpDisallowDowngrade" After="JpFindRelatedProducts">JP_DOWNGRADABLE_FOUND</Custom>
|
||||
<?endif?>
|
||||
<Custom Action="JpFindRelatedProducts" After="FindRelatedProducts"/>
|
||||
|
||||
<!-- Check and fail if Cryptomator is running -->
|
||||
<Custom Action="WixCloseApplications" Before="InstallValidate"></Custom>
|
||||
@@ -188,6 +192,10 @@
|
||||
<Custom Action="V170MigrateSettings" After="InstallFiles">NOT Installed OR REINSTALL</Custom>
|
||||
</InstallExecuteSequence>
|
||||
|
||||
<InstallUISequence>
|
||||
<Custom Action="JpFindRelatedProducts" After="FindRelatedProducts"/>
|
||||
</InstallUISequence>
|
||||
|
||||
<WixVariable Id="WixUIBannerBmp" Value="$(env.JP_WIXWIZARD_RESOURCES)\banner.bmp" />
|
||||
<WixVariable Id="WixUIDialogBmp" Value="$(env.JP_WIXWIZARD_RESOURCES)\background.bmp" />
|
||||
</Product>
|
||||
|
||||
13
pom.xml
13
pom.xml
@@ -26,7 +26,7 @@
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.jdk.version>19</project.jdk.version>
|
||||
<project.jdk.version>20</project.jdk.version>
|
||||
|
||||
<!-- Group IDs of jars that need to stay on the class path for now -->
|
||||
<!-- Once hypfvieh, swiesend, purejava and integrations-linux have module-info, remove them-->
|
||||
@@ -37,8 +37,8 @@
|
||||
<cryptomator.integrations.version>1.3.0-beta1</cryptomator.integrations.version>
|
||||
<cryptomator.integrations.win.version>1.2.0</cryptomator.integrations.win.version>
|
||||
<cryptomator.integrations.mac.version>1.2.0</cryptomator.integrations.mac.version>
|
||||
<cryptomator.integrations.linux.version>2.0.0-alpha1</cryptomator.integrations.linux.version>
|
||||
<cryptomator.fuse.version>2.0.5</cryptomator.fuse.version>
|
||||
<cryptomator.integrations.linux.version>1.3.0-beta1</cryptomator.integrations.linux.version>
|
||||
<cryptomator.fuse.version>3.0.0</cryptomator.fuse.version>
|
||||
<cryptomator.dokany.version>2.0.0</cryptomator.dokany.version>
|
||||
<cryptomator.webdav.version>2.0.2</cryptomator.webdav.version>
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
<easybind.version>2.2</easybind.version>
|
||||
<guava.version>31.1-jre</guava.version>
|
||||
<gson.version>2.10.1</gson.version>
|
||||
<javafx.version>19.0.2.1</javafx.version>
|
||||
<javafx.version>20.0.1</javafx.version>
|
||||
<jwt.version>4.3.0</jwt.version>
|
||||
<nimbus-jose.version>9.31</nimbus-jose.version>
|
||||
<logback.version>1.4.5</logback.version>
|
||||
@@ -64,7 +64,7 @@
|
||||
<!-- build-time dependencies -->
|
||||
<jetbrains.annotations.version>23.0.0</jetbrains.annotations.version>
|
||||
<dependency-check.version>8.1.0</dependency-check.version>
|
||||
<jacoco.version>0.8.8</jacoco.version>
|
||||
<jacoco.version>0.8.9</jacoco.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
@@ -332,6 +332,9 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<configuration>
|
||||
<argLine>--enable-preview</argLine>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
|
||||
@@ -10,7 +10,7 @@ import java.util.List;
|
||||
*/
|
||||
public enum LocationPreset {
|
||||
|
||||
DROPBOX("Dropbox", "~/Dropbox"),
|
||||
DROPBOX("Dropbox", "~/Library/CloudStorage/Dropbox", "~/Dropbox"),
|
||||
ICLOUDDRIVE("iCloud Drive", "~/Library/Mobile Documents/com~apple~CloudDocs", "~/iCloudDrive"),
|
||||
GDRIVE("Google Drive", "~/Google Drive/My Drive", "~/Google Drive"),
|
||||
MEGA("MEGA", "~/MEGA"),
|
||||
|
||||
@@ -9,8 +9,8 @@ import java.nio.channels.ReadableByteChannel;
|
||||
import java.nio.channels.WritableByteChannel;
|
||||
import java.util.function.Function;
|
||||
|
||||
// TODO make sealed, remove enum
|
||||
interface IpcMessage {
|
||||
//TODO can the enum be removed?
|
||||
sealed interface IpcMessage permits HandleLaunchArgsMessage, RevealRunningAppMessage {
|
||||
|
||||
enum MessageType {
|
||||
REVEAL_RUNNING_APP(RevealRunningAppMessage::decode),
|
||||
|
||||
@@ -5,10 +5,9 @@ import java.util.List;
|
||||
public interface IpcMessageListener {
|
||||
|
||||
default void handleMessage(IpcMessage message) {
|
||||
if (message instanceof RevealRunningAppMessage) {
|
||||
revealRunningApp();
|
||||
} else if (message instanceof HandleLaunchArgsMessage m) {
|
||||
handleLaunchArgs(m.args());
|
||||
switch (message) {
|
||||
case RevealRunningAppMessage m -> revealRunningApp(); // TODO: rename to _ with JEP 443
|
||||
case HandleLaunchArgsMessage m -> handleLaunchArgs(m.args());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
package org.cryptomator.launcher;
|
||||
|
||||
import org.cryptomator.common.settings.Settings;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
import java.text.Collator;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
@@ -14,26 +16,39 @@ import java.util.Locale;
|
||||
public class SupportedLanguages {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(SupportedLanguages.class);
|
||||
// these are BCP 47 language codes, not ISO. Note the "-" instead of the "_":
|
||||
public static final List<String> LANGUAGAE_TAGS = List.of("en", "ar", "be", "bn", "bs", "ca", "cs", "da", "de", "el", "es", "fil", "fa", "fr", "gl", "he", //
|
||||
"hi", "hr", "hu", "id", "it", "ja", "ko", "lv", "mk", "nb", "nl", "nn", "no", "pa", "pl", "pt", "pt-BR", "ro", "ru", "si", "sk", "sr", "sr-Latn", "sv", "sw", //
|
||||
"ta", "te", "th", "tr", "uk", "vi", "zh", "zh-HK", "zh-TW");
|
||||
// these are BCP 47 language codes, not ISO. Note the "-" instead of the "_".
|
||||
// "en" is not part of this list - it is always inserted at the top.
|
||||
public static final List<String> LANGUAGE_TAGS = List.of("ar", "be", "bn", "bs", "ca", "cs", "da", "de", "el", "es", "fr", "gl", "he", //
|
||||
"hi", "hr", "hu", "id", "it", "ja", "ko", "lv", "nb", "nl", "nn", "pa", "pl", "pt", "pt-BR", "ro", "ru", "sk", "sr", "sr-Latn", "sv", "sw", //
|
||||
"ta", "th", "tr", "uk", "vi", "zh", "zh-HK", "zh-TW");
|
||||
public static final String ENGLISH = "en";
|
||||
|
||||
@Nullable
|
||||
private final String preferredLanguage;
|
||||
private final List<String> sortedLanguageTags;
|
||||
|
||||
private final Locale preferredLocale;
|
||||
|
||||
@Inject
|
||||
public SupportedLanguages(Settings settings) {
|
||||
this.preferredLanguage = settings.languageProperty().get();
|
||||
var preferredLanguage = settings.languageProperty().get();
|
||||
preferredLocale = preferredLanguage == null ? Locale.getDefault() : Locale.forLanguageTag(preferredLanguage);
|
||||
var collator = Collator.getInstance(preferredLocale);
|
||||
collator.setStrength(Collator.PRIMARY);
|
||||
var sorted = new ArrayList<String>();
|
||||
sorted.add(0, Settings.DEFAULT_LANGUAGE);
|
||||
sorted.add(1, ENGLISH);
|
||||
LANGUAGE_TAGS.stream() //
|
||||
.sorted((a, b) -> collator.compare(Locale.forLanguageTag(a).getDisplayName(), Locale.forLanguageTag(b).getDisplayName())) //
|
||||
.forEach(sorted::add);
|
||||
sortedLanguageTags = Collections.unmodifiableList(sorted);
|
||||
}
|
||||
|
||||
public void applyPreferred() {
|
||||
if (preferredLanguage == null) {
|
||||
LOG.debug("Using system locale");
|
||||
return;
|
||||
}
|
||||
var preferredLocale = Locale.forLanguageTag(preferredLanguage);
|
||||
LOG.debug("Applying preferred locale {}", preferredLocale.getDisplayName(Locale.ENGLISH));
|
||||
LOG.debug("Using locale {}", preferredLocale);
|
||||
Locale.setDefault(preferredLocale);
|
||||
}
|
||||
|
||||
public List<String> getLanguageTags() {
|
||||
return sortedLanguageTags;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -102,14 +102,16 @@ public class StartController implements FxController {
|
||||
}
|
||||
|
||||
private void loadingKeyFailed(Throwable e) {
|
||||
if (e instanceof UnlockCancelledException) {
|
||||
// ok
|
||||
} else if (e instanceof VaultKeyInvalidException) {
|
||||
LOG.error("Invalid key"); //TODO: specific error screen
|
||||
appWindows.showErrorWindow(e, window, null);
|
||||
} else {
|
||||
LOG.error("Failed to load key.", e);
|
||||
appWindows.showErrorWindow(e, window, null);
|
||||
switch (e) {
|
||||
case UnlockCancelledException uce -> {} //ok
|
||||
case VaultKeyInvalidException vkie -> {
|
||||
LOG.error("Invalid key"); //TODO: specific error screen
|
||||
appWindows.showErrorWindow(e, window, null);
|
||||
}
|
||||
default -> {
|
||||
LOG.error("Failed to load key.", e);
|
||||
appWindows.showErrorWindow(e, window, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package org.cryptomator.ui.preferences;
|
||||
|
||||
import com.google.common.base.Strings;
|
||||
import org.cryptomator.common.LicenseHolder;
|
||||
import org.cryptomator.common.settings.Settings;
|
||||
import org.cryptomator.common.settings.UiTheme;
|
||||
@@ -35,6 +34,7 @@ public class InterfacePreferencesController implements FxController {
|
||||
private final ObjectProperty<SelectedPreferencesTab> selectedTabProperty;
|
||||
private final LicenseHolder licenseHolder;
|
||||
private final ResourceBundle resourceBundle;
|
||||
private final SupportedLanguages supportedLanguages;
|
||||
public ChoiceBox<UiTheme> themeChoiceBox;
|
||||
public CheckBox showMinimizeButtonCheckbox;
|
||||
public CheckBox showTrayIconCheckbox;
|
||||
@@ -44,13 +44,14 @@ public class InterfacePreferencesController implements FxController {
|
||||
public RadioButton nodeOrientationRtl;
|
||||
|
||||
@Inject
|
||||
InterfacePreferencesController(Settings settings, TrayMenuComponent trayMenu, ObjectProperty<SelectedPreferencesTab> selectedTabProperty, LicenseHolder licenseHolder, ResourceBundle resourceBundle) {
|
||||
InterfacePreferencesController(Settings settings, SupportedLanguages supportedLanguages, TrayMenuComponent trayMenu, ObjectProperty<SelectedPreferencesTab> selectedTabProperty, LicenseHolder licenseHolder, ResourceBundle resourceBundle) {
|
||||
this.settings = settings;
|
||||
this.trayMenuInitialized = trayMenu.isInitialized();
|
||||
this.trayMenuSupported = trayMenu.isSupported();
|
||||
this.selectedTabProperty = selectedTabProperty;
|
||||
this.licenseHolder = licenseHolder;
|
||||
this.resourceBundle = resourceBundle;
|
||||
this.supportedLanguages = supportedLanguages;
|
||||
}
|
||||
|
||||
@FXML
|
||||
@@ -66,8 +67,7 @@ public class InterfacePreferencesController implements FxController {
|
||||
|
||||
showTrayIconCheckbox.selectedProperty().bindBidirectional(settings.showTrayIcon());
|
||||
|
||||
preferredLanguageChoiceBox.getItems().add(null);
|
||||
preferredLanguageChoiceBox.getItems().addAll(SupportedLanguages.LANGUAGAE_TAGS);
|
||||
preferredLanguageChoiceBox.getItems().addAll(supportedLanguages.getLanguageTags());
|
||||
preferredLanguageChoiceBox.valueProperty().bindBidirectional(settings.languageProperty());
|
||||
preferredLanguageChoiceBox.setConverter(new LanguageTagConverter(resourceBundle));
|
||||
|
||||
@@ -141,9 +141,7 @@ public class InterfacePreferencesController implements FxController {
|
||||
return resourceBundle.getString("preferences.interface.language.auto");
|
||||
} else {
|
||||
var locale = Locale.forLanguageTag(tag);
|
||||
var lang = locale.getDisplayLanguage(locale);
|
||||
var region = locale.getDisplayCountry(locale);
|
||||
return lang + (Strings.isNullOrEmpty(region) ? "" : " (" + region + ")");
|
||||
return locale.getDisplayName();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ public class AwtTrayMenuController implements TrayMenuController {
|
||||
menuItem.setEnabled(a.enabled());
|
||||
menu.add(menuItem);
|
||||
}
|
||||
case SeparatorItem s -> menu.addSeparator(); // TODO: rename pattern variable with JEP 443
|
||||
case SeparatorItem s -> menu.addSeparator(); // TODO: rename to _ with JEP 443
|
||||
case SubMenuItem s -> {
|
||||
var submenu = new Menu(s.title());
|
||||
addChildren(submenu, s.items());
|
||||
|
||||
@@ -38,12 +38,11 @@ public class UnlockInvalidMountPointController implements FxController {
|
||||
@FXML
|
||||
public void initialize() {
|
||||
var e = unlockException.get();
|
||||
String translationKey = "unlock.error.customPath.description.generic";
|
||||
if (e instanceof MountPointNotSupportedException) {
|
||||
translationKey = "unlock.error.customPath.description.notSupported";
|
||||
} else if (e instanceof MountPointNotExistsException) {
|
||||
translationKey = "unlock.error.customPath.description.notExists";
|
||||
}
|
||||
var translationKey = switch (e) {
|
||||
case MountPointNotSupportedException x -> "unlock.error.customPath.description.notSupported";
|
||||
case MountPointNotExistsException x -> "unlock.error.customPath.description.notExists";
|
||||
default -> "unlock.error.customPath.description.generic";
|
||||
};
|
||||
dialogDescription.setFormat(resourceBundle.getString(translationKey));
|
||||
dialogDescription.setArg1(e.getMessage());
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ public class SupportedLanguagesTest {
|
||||
}
|
||||
|
||||
public static Stream<String> languageTags() {
|
||||
return SupportedLanguages.LANGUAGAE_TAGS.stream() //
|
||||
return SupportedLanguages.LANGUAGE_TAGS.stream() //
|
||||
.filter(tag -> !"en".equals(tag)); // english uses the default bundle
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user