From 49836f9956d15029488c920e745ff8dbf0585567 Mon Sep 17 00:00:00 2001 From: Florent Rougon Date: Fri, 30 Dec 2016 02:24:16 +0100 Subject: [PATCH] Route manager: start in $FG_HOME for Load and Save; also show hidden files Since a typical (and suggested) allowed directory for saving flightplans from the Route Manager dialog is $FG_HOME/Export, it makes sense for the Load and Save file selection dialogs to open in at least $FG_HOME. And since $FG_HOME is a hidden dir by default on Unix systems, it is more user-friendly to display hidden files and dirs in these dialogs as well. Note: when hidden files/dirs are not displayed, it *is* possible, at least in the QtFileDialog, to type .fgfs and get inside when browsing $HOME, but that is probably not obvious to everyone! --- gui/dialogs/route-manager.xml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gui/dialogs/route-manager.xml b/gui/dialogs/route-manager.xml index c99faae34..921003588 100644 --- a/gui/dialogs/route-manager.xml +++ b/gui/dialogs/route-manager.xml @@ -100,8 +100,14 @@ command interface /autopilot/route-manager/input: gui.dialog_update("route-manager"); } - var file_selector = gui.FileSelector.new(load_route, "Load flight-plan", "Load"); - var save_selector = gui.FileSelector.new(save_route, "Save flight-plan", "Save"); + var defaultDirInFileSelector = getprop("/sim/fg-home"); + + var file_selector = gui.FileSelector.new( + callback: load_route, title: "Load flight-plan", button: "Load", + dir: defaultDirInFileSelector, dotfiles: 1); + var save_selector = gui.FileSelector.new( + callback: save_route, title: "Save flight-plan", button: "Save", + dir: defaultDirInFileSelector, dotfiles: 1); var activate_fp = func { fgcommand("activate-flightplan", props.Node.new({"activate": 1}));