diff --git a/app-desktop/src/main/i18n/strings_de.properties b/app-desktop/src/main/i18n/strings_de.properties
index d006c514..49383661 100644
--- a/app-desktop/src/main/i18n/strings_de.properties
+++ b/app-desktop/src/main/i18n/strings_de.properties
@@ -460,7 +460,7 @@ column.score=Wertung
monitor.title=Cluster & Fremd-QSOs
monitor.dxCluster=DX-Cluster
profiles.createFailed=Das Profil konnte nicht angelegt werden. Die Profilliste konnte nicht geschrieben werden.
-profiles.createdWithoutCredentials=Das Profil „{0}" wurde ohne Rufzeichen und Passwort angelegt. Nach dem Wechsel zu diesem Profil beides im Reiter „Station" eintragen.
+profiles.createdWithoutCredentials=Das Profil „{0}" wurde ohne Rufzeichen und Passwort angelegt. Nach dem Wechsel zu diesem Profil fragt der Einrichtungsassistent beides ab.
profiles.duplicateFailed=Das Profil konnte nicht dupliziert werden.
profiles.rootNotDeletable=Das Standardprofil verwendet die Dateien der Installation selbst und kann nicht gelöscht werden.
profiles.activeNotDeletable=Das gerade benutzte Profil kann nicht gelöscht werden. Zuerst zu einem anderen Profil wechseln.
@@ -495,3 +495,95 @@ profiles.unknown=unbekannt
profiles.copyOf=Kopie von {0}
profiles.sharedDatabase=gemeinsame Stationsdatenbank
profiles.ownDatabase=eigene Datenbank
+
+wizard.title=Einrichtungsassistent
+wizard.later=Später
+wizard.back=Zurück
+wizard.next=Weiter
+wizard.finish=Fertig
+wizard.save=Speichern
+wizard.saveAndConnect=Speichern und verbinden
+wizard.change=Ändern
+wizard.saveFailed=Die Einstellungen konnten nicht geschrieben werden. Es wurde nichts geändert.
+wizard.missing=Es fehlen noch Pflichtangaben. Über „Ändern" ergänzen.
+wizard.entry.title=Woher kommen die Angaben?
+wizard.entry.lead=Für Anmeldung und Station getrennt wählen.
+wizard.entry.login=Anmeldung (Rufzeichen, Passwort)
+wizard.entry.station=Station (Locator, Bänder, Chatkategorie)
+wizard.source.loginNew=Anmeldung neu eingeben
+wizard.source.loginKeep=Anmeldung unverändert lassen ({0})
+wizard.source.stationNew=Station neu einrichten
+wizard.source.stationKeep=Station unverändert lassen (Locator {0})
+wizard.personal.title=Persönliches
+wizard.personal.lead=Gehört zum Operator.
+wizard.personal.name=Anzeigename im Chat
+wizard.personal.nameInvalid=Der Name darf kein Zeichen | enthalten.
+wizard.login.title=Anmeldung bei ON4KST
+wizard.login.lead=Die Zugangsdaten deines ON4KST-Kontos.
+wizard.login.callsignInvalid=Das sieht nicht nach einem Rufzeichen aus.
+wizard.login.passwordInvalid=Das Passwort darf nicht mit einem Leerzeichen beginnen oder enden und kein Zeichen | enthalten.
+wizard.site.title=Standort und Bänder
+wizard.site.lead=Gehört zur Station, nicht zum Operator.
+wizard.site.locatorInvalid=Sechsstelliger Maidenhead-Locator, zum Beispiel JO50AA.
+wizard.site.bands=Aktive Bänder
+wizard.site.bandsHint=Aus den Bändern wird keine Frequenz abgeleitet.
+wizard.site.categorySuggestion=Vorschlag aus den Bändern: {0}
+wizard.site.secondChat=Zweiten Chat öffnen
+wizard.summary.title=Zusammenfassung
+wizard.summary.lead=Erst „Speichern" schreibt in die Einstellungsdatei.
+wizard.summary.personal=Persönliches
+wizard.summary.login=Anmeldung
+wizard.summary.station=Station
+wizard.summary.bands=Bänder
+wizard.summary.none=keine
+wizard.summary.passwordSet=gesetzt
+
+menu.setupWizard=Einrichtungsassistent...
+alert.setupWizardTitle=Einrichtungsassistent
+alert.setupWizardQuestion=Sitzung beenden und den Einrichtungsassistenten starten?
+alert.setupWizardBody=Die ON4KST-Verbindung wird geschlossen, und alle Fenster werden nach dem Assistenten neu aufgebaut. Für einzelne Änderungen im laufenden Betrieb ist das Einstellungsfenster da.
+dialog.startSetupWizard=Assistent starten
+wizard.antenna.title=Antenne und Leistung
+wizard.antenna.lead=Freiwillig. Die Werte speisen die Pfadanalyse und den Antennensektor auf der Karte; für den Chat braucht sie niemand.
+wizard.antenna.aslHint=Standorthöhe leer lassen, dann entscheidet das Höhenmodell.
+wizard.log.title=Logprogramm
+wizard.log.lead=Woher kommen deine gearbeiteten Stationen?
+wizard.log.none=Keines, kein Abgleich
+wizard.log.wintest=Win-Test
+wizard.log.udp=UCXLog, DXLog.net, N1MM+ oder QARTEST
+wizard.log.file=Eine Logdatei
+wizard.log.qrgFollow=Eigene Frequenz aus dem Logprogramm übernehmen
+wizard.log.clusterServer=Spots über den lokalen DX-Cluster-Server an das Logprogramm geben
+wizard.log.incomplete=Die Angaben zu diesem Logprogramm sind unvollständig oder außerhalb des Bereichs.
+wizard.gear.title=Rotor und AirScout
+wizard.gear.lead=Nur was wirklich vorhanden ist.
+wizard.gear.rotator=PSTRotator wird benutzt
+wizard.gear.airScout=AirScout wird benutzt
+wizard.gear.incomplete=Die Angaben auf dieser Seite sind unvollständig oder außerhalb des Bereichs.
+wizard.switch.secondChat=Zweitchat
+wizard.switch.logWintest=Win-Test-Abgleich
+wizard.switch.logUdp=Netzwerk-Logabgleich
+wizard.switch.logFile=Logdatei-Abgleich
+wizard.switch.qrgFollow=Frequenz aus dem Logprogramm
+wizard.switch.clusterServer=DX-Cluster-Server
+wizard.switch.rotator=PSTRotator
+wizard.switch.airScout=AirScout
+wizard.summary.antenna=Antenne und Leistung
+wizard.summary.log=Logprogramm
+wizard.summary.gear=Rotor und AirScout
+wizard.summary.qrgFollow=Eigene Frequenz aus dem Logprogramm
+wizard.summary.clusterServer=DX-Cluster-Server
+wizard.summary.yes=ja
+wizard.summary.no=nein
+wizard.summary.switchedOff=Wird abgeschaltet: {0}.
+wizard.summary.logSeveral=In diesem Profil sind mehrere Logquellen eingeschaltet. Im Einstellungsfenster ändern.
+
+wizard.source.loginTake=Anmeldung von Profil „{0}" übernehmen ({1})
+wizard.source.loginTakeFrom=Anmeldung von einem anderen Profil übernehmen
+wizard.source.stationTake=Station von Profil „{0}" übernehmen (Locator {1})
+wizard.source.stationTakeFrom=Station von einem anderen Profil übernehmen
+wizard.entry.donor=Profil
+wizard.summary.takenFrom=Übernommen von Profil „{0}"
+wizard.switch.so2r=SO2R
+wizard.switch.rotator2=PSTRotator 2
+wizard.summary.fallbackBand=Ausweichband für Spots
diff --git a/app-desktop/src/main/i18n/strings_en.properties b/app-desktop/src/main/i18n/strings_en.properties
index da98bd70..8502b18b 100644
--- a/app-desktop/src/main/i18n/strings_en.properties
+++ b/app-desktop/src/main/i18n/strings_en.properties
@@ -469,7 +469,7 @@ column.score=Score
monitor.title=Cluster & QSO of the other
monitor.dxCluster=DX cluster
profiles.createFailed=The profile could not be created. The profile registry could not be written.
-profiles.createdWithoutCredentials=The profile "{0}" was created without callsign and password. Enter them on the Station tab after switching to it.
+profiles.createdWithoutCredentials=The profile "{0}" was created without callsign and password. After switching to it, the setup assistant asks for both.
profiles.duplicateFailed=The profile could not be duplicated.
profiles.rootNotDeletable=The default profile uses the files of the installation itself and cannot be deleted.
profiles.activeNotDeletable=The profile currently in use cannot be deleted. Switch to another profile first.
@@ -504,3 +504,95 @@ profiles.unknown=unknown
profiles.copyOf=Copy of {0}
profiles.sharedDatabase=common station database
profiles.ownDatabase=own database
+
+wizard.title=Setup assistant
+wizard.later=Later
+wizard.back=Back
+wizard.next=Next
+wizard.finish=Finish
+wizard.save=Save
+wizard.saveAndConnect=Save and connect
+wizard.change=Change
+wizard.saveFailed=The settings could not be written. Nothing was changed.
+wizard.missing=Some required entries are still missing. Use Change to complete them.
+wizard.entry.title=Where do the entries come from?
+wizard.entry.lead=Choose separately for login and station.
+wizard.entry.login=Login (callsign, password)
+wizard.entry.station=Station (locator, bands, chat category)
+wizard.source.loginNew=Enter a new login
+wizard.source.loginKeep=Leave the login unchanged ({0})
+wizard.source.stationNew=Set up a new station
+wizard.source.stationKeep=Leave the station unchanged (locator {0})
+wizard.personal.title=Personal
+wizard.personal.lead=Belongs to the operator.
+wizard.personal.name=Name shown in the chat
+wizard.personal.nameInvalid=The name must not contain a | character.
+wizard.login.title=ON4KST login
+wizard.login.lead=The credentials of your ON4KST account.
+wizard.login.callsignInvalid=This does not look like a callsign.
+wizard.login.passwordInvalid=The password must not begin or end with a blank and must not contain a | character.
+wizard.site.title=Location and bands
+wizard.site.lead=Belongs to the station, not to the operator.
+wizard.site.locatorInvalid=Six-character Maidenhead locator, for example JO50AA.
+wizard.site.bands=Active bands
+wizard.site.bandsHint=No frequency is derived from the bands.
+wizard.site.categorySuggestion=Suggested from the bands: {0}
+wizard.site.secondChat=Open a second chat
+wizard.summary.title=Summary
+wizard.summary.lead=Nothing is written until you save.
+wizard.summary.personal=Personal
+wizard.summary.login=Login
+wizard.summary.station=Station
+wizard.summary.bands=Bands
+wizard.summary.none=none
+wizard.summary.passwordSet=set
+
+menu.setupWizard=Setup assistant...
+alert.setupWizardTitle=Setup assistant
+alert.setupWizardQuestion=End the session and start the setup assistant?
+alert.setupWizardBody=The ON4KST connection is closed and all windows are rebuilt after the assistant. For single changes during operation use the settings window.
+dialog.startSetupWizard=Start assistant
+wizard.antenna.title=Antenna and power
+wizard.antenna.lead=Optional. These values feed the path analysis and the antenna sector on the map; the chat does not need them.
+wizard.antenna.aslHint=Leave the site elevation empty to let the elevation model decide.
+wizard.log.title=Log program
+wizard.log.lead=Where do your worked stations come from?
+wizard.log.none=None, no synchronisation
+wizard.log.wintest=Win-Test
+wizard.log.udp=UCXLog, DXLog.net, N1MM+ or QARTEST
+wizard.log.file=A log file
+wizard.log.qrgFollow=Take my own frequency from the log program
+wizard.log.clusterServer=Pass spots to the log program through the local DX cluster server
+wizard.log.incomplete=The entries for this log program are incomplete or out of range.
+wizard.gear.title=Rotator and AirScout
+wizard.gear.lead=Only what is really there.
+wizard.gear.rotator=PSTRotator is in use
+wizard.gear.airScout=AirScout is in use
+wizard.gear.incomplete=The entries on this page are incomplete or out of range.
+wizard.switch.secondChat=second chat
+wizard.switch.logWintest=Win-Test synchronisation
+wizard.switch.logUdp=network log synchronisation
+wizard.switch.logFile=log file polling
+wizard.switch.qrgFollow=frequency from the log program
+wizard.switch.clusterServer=DX cluster server
+wizard.switch.rotator=PSTRotator
+wizard.switch.airScout=AirScout
+wizard.summary.antenna=Antenna and power
+wizard.summary.log=Log program
+wizard.summary.gear=Rotator and AirScout
+wizard.summary.qrgFollow=Own frequency from the log program
+wizard.summary.clusterServer=DX cluster server
+wizard.summary.yes=yes
+wizard.summary.no=no
+wizard.summary.switchedOff=Will be switched off: {0}.
+wizard.summary.logSeveral=Several log sources are enabled in this profile. Change them in the settings window.
+
+wizard.source.loginTake=Take the login from profile "{0}" ({1})
+wizard.source.loginTakeFrom=Take the login from another profile
+wizard.source.stationTake=Take the station from profile "{0}" (locator {1})
+wizard.source.stationTakeFrom=Take the station from another profile
+wizard.entry.donor=Profile
+wizard.summary.takenFrom=Taken from profile "{0}"
+wizard.switch.so2r=SO2R
+wizard.switch.rotator2=PSTRotator 2
+wizard.summary.fallbackBand=Fallback band for spots
diff --git a/app-desktop/src/main/java/kst4contest/view/ApplicationRuntimeLauncher.java b/app-desktop/src/main/java/kst4contest/view/ApplicationRuntimeLauncher.java
index 1522473c..a5ae69f8 100644
--- a/app-desktop/src/main/java/kst4contest/view/ApplicationRuntimeLauncher.java
+++ b/app-desktop/src/main/java/kst4contest/view/ApplicationRuntimeLauncher.java
@@ -4,6 +4,7 @@ import kst4contest.controller.ActiveOperatorProfile;
import kst4contest.controller.OperatorProfilePaths;
import kst4contest.controller.OperatorProfileStore;
import kst4contest.model.OperatorProfile;
+import kst4contest.model.OperatorProfileSelection;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -24,6 +25,20 @@ public final class ApplicationRuntimeLauncher {
private static Kst4ContestApplication currentRuntime;
+ /**
+ * Whether the next runtime start shows the setup wizard although the profile is set up.
+ * Set by the menu entry and cleared by the start that honours it.
+ */
+ private static final java.util.concurrent.atomic.AtomicBoolean SETUP_WIZARD_REQUESTED =
+ new java.util.concurrent.atomic.AtomicBoolean(false);
+
+ /**
+ * Guards {@link #switchProfile(OperatorProfile)} against re-entry while window teardown
+ * inside {@link Kst4ContestApplication#shutdownRuntime()} is still pumping events.
+ */
+ private static final java.util.concurrent.atomic.AtomicBoolean SWITCH_IN_PROGRESS =
+ new java.util.concurrent.atomic.AtomicBoolean(false);
+
private ApplicationRuntimeLauncher() {
// Utility class.
}
@@ -61,14 +76,100 @@ public final class ApplicationRuntimeLauncher {
System.exit(0);
}
+ /** Asks the next runtime start to show the setup wizard. */
+ static void requestSetupWizard() {
+ SETUP_WIZARD_REQUESTED.set(true);
+ }
+
+ /**
+ * Tells a starting runtime whether the wizard was asked for, and forgets the request.
+ *
+ * @return true exactly once per request
+ */
+ static boolean consumeSetupWizardRequest() {
+ return SETUP_WIZARD_REQUESTED.getAndSet(false);
+ }
+
+ /**
+ * Marks a profile switch as in progress if none is currently running.
+ *
+ * @return true if this call obtained the mark
+ */
+ static boolean beginSwitch() {
+ return SWITCH_IN_PROGRESS.compareAndSet(false, true);
+ }
+
+ /** Clears the in-progress mark of a profile switch. */
+ static void endSwitch() {
+ SWITCH_IN_PROGRESS.set(false);
+ }
+
+ /**
+ * Rebuilds the runtime of the active profile with the setup wizard in front of it.
+ *
+ *
The running runtime is torn down first and the wizard shown afterwards, not the
+ * other way round: a runtime shutting down flushes its pending layout write, and that
+ * must not land on the file the wizard has just written.
+ *
+ * The wizard is requested only once this call owns the switch. A call refused
+ * because a switch is already under way therefore leaves that switch's request alone:
+ * clearing it would let the running switch end the session and then start without the
+ * wizard it was made for.
+ *
+ * @return true if the new runtime was built
+ */
+ public static boolean rerunSetupWizard() {
+ OperatorProfileSelection active = ActiveOperatorProfile.get();
+
+ if (active == null) {
+ return false;
+ }
+
+ if (!beginSwitch()) {
+ return false;
+ }
+
+ try {
+ requestSetupWizard();
+
+ boolean switched = false;
+ try {
+ switched = performSwitch(active.getProfile());
+ } finally {
+ if (!switched) {
+ // The request is this call's own, and no start consumed it.
+ consumeSetupWizardRequest();
+ }
+ }
+ return switched;
+ } finally {
+ endSwitch();
+ }
+ }
+
/**
* Replaces the running runtime with one bound to another operator profile.
*
* @param targetProfile profile to activate
- * @return true if the new runtime was built
+ * @return true if the new runtime was built; false also when another switch is
+ * already under way
*/
public static boolean switchProfile(final OperatorProfile targetProfile) {
+ if (!beginSwitch()) {
+ return false;
+ }
+
+ try {
+ return performSwitch(targetProfile);
+ } finally {
+ endSwitch();
+ }
+ }
+
+ /** The switch itself. The caller holds the switch-in-progress mark. */
+ private static boolean performSwitch(final OperatorProfile targetProfile) {
+
if (targetProfile == null) {
return false;
}
diff --git a/app-desktop/src/main/java/kst4contest/view/ComposeMenuActions.java b/app-desktop/src/main/java/kst4contest/view/ComposeMenuActions.java
index 505fc3f5..2833b2c1 100644
--- a/app-desktop/src/main/java/kst4contest/view/ComposeMenuActions.java
+++ b/app-desktop/src/main/java/kst4contest/view/ComposeMenuActions.java
@@ -54,6 +54,11 @@ public final class ComposeMenuActions implements MainMenuActions {
application.runOnUi(application::menuActionToggleSettingsWindow);
}
+ @Override
+ public void openSetupWizard() {
+ application.runOnUi(application::menuActionOpenSetupWizard);
+ }
+
@Override
public void toggleMonitorWindow() {
application.runOnUi(application::menuActionToggleMonitorWindow);
diff --git a/app-desktop/src/main/java/kst4contest/view/Kst4ContestApplication.java b/app-desktop/src/main/java/kst4contest/view/Kst4ContestApplication.java
index bf487561..73588381 100644
--- a/app-desktop/src/main/java/kst4contest/view/Kst4ContestApplication.java
+++ b/app-desktop/src/main/java/kst4contest/view/Kst4ContestApplication.java
@@ -42,6 +42,8 @@ import kst4contest.view.compose.SettingsWindow;
import kst4contest.controller.ScoreService;
import kst4contest.view.compose.SettingsWindow;
import kst4contest.controller.On4KstConnectionState;
+import kst4contest.view.compose.wizard.SetupWizardLauncher;
+import kst4contest.view.compose.wizard.SetupWizardOutcome;
import java.io.File;
import java.io.IOException;
@@ -2177,6 +2179,17 @@ public class Kst4ContestApplication implements StatusUpdateListener, SettingsHos
return;
}
+ /*
+ * The setup wizard, before anything of this profile's runtime exists. It writes
+ * preferences.xml and the ChatController built below reads it like any stored
+ * setting, so there is no running session to bring up to date and no reload.
+ * Blocks until the wizard is closed; see SetupWizardWindow for why that is safe on
+ * either thread this method is called from.
+ */
+ SetupWizardOutcome setupWizardOutcome = SetupWizardLauncher.runIfNeeded(
+ ActiveOperatorProfile.get().getPreferencesRelativeFileName(),
+ ApplicationRuntimeLauncher.consumeSetupWizardRequest());
+
ApplicationRuntimeLauncher.setCurrent(this);
ApplicationFileUtils.copyResourceIfRequired(ApplicationConstants.APPLICATION_NAME, STYLE_DEFAULTCSSDAY_RESOURCE, STYLE_DEFAULTCSSDAY_FILE);
@@ -2297,6 +2310,15 @@ public class Kst4ContestApplication implements StatusUpdateListener, SettingsHos
//initialize the timeline
uiDispatcher.runOnUi(this::updateTimelineVisuals);
+ /*
+ * "Save and connect" in the setup wizard. Here and not earlier: connecting needs the
+ * runtime this method has just finished building. The same path as File -> Connect,
+ * so a refused or failed connection is reported the way it is there.
+ */
+ if (setupWizardOutcome == SetupWizardOutcome.SAVED_AND_CONNECT) {
+ uiDispatcher.runOnUi(this::menuActionConnect);
+ }
+
/*
* Replaces Application.stop(), which only JavaFX ever called. This covers a SIGTERM
* and a closing terminal; the ordinary exit still goes through
@@ -4024,6 +4046,27 @@ public class Kst4ContestApplication implements StatusUpdateListener, SettingsHos
}
}
+ /**
+ * Options -> setup assistant. Rebuilds the runtime of the active profile with the wizard
+ * in front of it, which costs the running session; hence the question, and hence the
+ * settings edits are settled first, as before a profile switch.
+ */
+ void menuActionOpenSetupWizard() {
+ SettingsWindow.settleThen(() -> {
+ boolean confirmed = ComposeAlert.confirm(
+ kst4contest.view.i18n.CurrentStrings.get().getAlertSetupWizardTitle(),
+ kst4contest.view.i18n.CurrentStrings.get().getAlertSetupWizardQuestion(),
+ kst4contest.view.i18n.CurrentStrings.get().getAlertSetupWizardBody(),
+ kst4contest.view.i18n.CurrentStrings.get().getDialogStartSetupWizard(),
+ kst4contest.view.i18n.CurrentStrings.get().getDialogCancel(),
+ chatcontroller.getChatPreferences().isGUI_darkModeActive());
+
+ if (confirmed) {
+ ApplicationRuntimeLauncher.rerunSetupWizard();
+ }
+ });
+ }
+
/** Windows -> open or close the cluster / stranger-QSO monitor window. */
void menuActionToggleMonitorWindow() {
if (MonitorWindow.isOpen()) {
diff --git a/app-desktop/src/main/kotlin/kst4contest/view/compose/MainMenuBar.kt b/app-desktop/src/main/kotlin/kst4contest/view/compose/MainMenuBar.kt
index 897ddc92..e529302d 100644
--- a/app-desktop/src/main/kotlin/kst4contest/view/compose/MainMenuBar.kt
+++ b/app-desktop/src/main/kotlin/kst4contest/view/compose/MainMenuBar.kt
@@ -55,6 +55,9 @@ interface MainMenuActions {
fun setQrgAsNameInChat()
fun toggleAwayState()
fun toggleSettingsWindow()
+
+ /** Ends the session after asking and runs the setup wizard for the active profile. */
+ fun openSetupWizard()
fun toggleMonitorWindow()
fun toggleStationMap()
fun useDarkDesign()
diff --git a/app-desktop/src/main/kotlin/kst4contest/view/compose/MainMenuModel.kt b/app-desktop/src/main/kotlin/kst4contest/view/compose/MainMenuModel.kt
index eb1a5cd6..f95c6904 100644
--- a/app-desktop/src/main/kotlin/kst4contest/view/compose/MainMenuModel.kt
+++ b/app-desktop/src/main/kotlin/kst4contest/view/compose/MainMenuModel.kt
@@ -87,6 +87,11 @@ fun mainMenuModel(
enabled = true,
actions::toggleSettingsWindow,
),
+ /*
+ * Always usable, like the profile switch: it rebuilds the runtime and asks before
+ * it gives the session up.
+ */
+ MenuEntry.Item(strings.menuSetupWizard, state.canSwitchProfile, actions::openSetupWizard),
),
),
MenuSpec(
diff --git a/app-desktop/src/main/kotlin/kst4contest/view/compose/tabs/ExternalInterfaceFields.kt b/app-desktop/src/main/kotlin/kst4contest/view/compose/tabs/ExternalInterfaceFields.kt
index 5b0e728d..051f611c 100644
--- a/app-desktop/src/main/kotlin/kst4contest/view/compose/tabs/ExternalInterfaceFields.kt
+++ b/app-desktop/src/main/kotlin/kst4contest/view/compose/tabs/ExternalInterfaceFields.kt
@@ -18,10 +18,12 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
+import androidx.compose.runtime.staticCompositionLocalOf
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.AwtWindow
+import java.awt.Dialog
import java.awt.FileDialog
import java.awt.Frame
import java.io.File
@@ -125,34 +127,51 @@ internal fun FilePathRow(
}
}
-/**
- * The AWT file dialog, opened from Compose. The JavaFX chooser started in the user's
- * home directory and a cancelled choice kept the stored path — both are preserved.
- */
+/** The modal owner that keeps the native file chooser accessible when opened from the wizard. */
+val LocalFileDialogOwner = staticCompositionLocalOf