1
0
Fork 0

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!
This commit is contained in:
Florent Rougon 2016-12-30 02:24:16 +01:00
parent bc42bb5d55
commit 49836f9956

View file

@ -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}));