From f3f87460d1bbd000a3d774bdde4348a9d2931be7 Mon Sep 17 00:00:00 2001 From: "Crom (Thibaut CHARLES)" Date: Thu, 12 Mar 2015 17:22:53 +0100 Subject: [PATCH] Open in the same dir last file opened --- source/app.d | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/app.d b/source/app.d index 1ea9361..6a77b8c 100755 --- a/source/app.d +++ b/source/app.d @@ -2,6 +2,7 @@ import std.stdio; import std.file; import std.string; import std.conv : to; +import std.path; import gtk.Main; @@ -37,7 +38,7 @@ void main(string[] args) //Window window = new MainWindow("2DA-Edit"); - window.getSettings.setLongProperty("gtk-application-prefer-dark-theme", 1, ""); + window.getSettings.setLongProperty("gtk-application-prefer-dark-theme", 0, ""); // auto accel = new AccelGroup(); @@ -126,6 +127,9 @@ void main(string[] args) import gtk.FileChooserDialog; auto fc = new FileChooserDialog("Save 2DA as", window, FileChooserAction.SAVE); + fc.setDoOverwriteConfirmation(true); + fc.setCreateFolders(true); + fc.setCurrentFolder(openedFile!=""? dirName(openedFile) : getcwd()); auto res = fc.run(); if(res==GtkResponseType.OK){ string filename = fc.getFilename(); @@ -139,6 +143,8 @@ void main(string[] args) import gtk.FileChooserDialog; auto fc = new FileChooserDialog("Open 2DA", window, FileChooserAction.OPEN); + fc.setSelectMultiple(false); + fc.setCurrentFolder(openedFile!=""? dirName(openedFile) : getcwd()); auto res = fc.run(); if(res==GtkResponseType.OK){ string filename = fc.getFilename();