From b4df535e078ac313c355df48d6f5d063ec692ffe Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Mon, 8 Dec 2014 20:56:07 -0500 Subject: [PATCH] Set the Open dialog to default to the embedded Examples directory the first time it comes up. --- CadQuery/Gui/Command.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CadQuery/Gui/Command.py b/CadQuery/Gui/Command.py index e2cdeaa..9329d17 100644 --- a/CadQuery/Gui/Command.py +++ b/CadQuery/Gui/Command.py @@ -122,7 +122,12 @@ class CadQueryOpenScript(): #Try to keep track of the previous path used to open as a convenience to the user if self.previousPath is None: - self.previousPath = "/home/" + import os, module_locator + + module_base_path = module_locator.module_path() + exs_dir_path = os.path.join(module_base_path, 'Examples') + + self.previousPath = exs_dir_path filename = QtGui.QFileDialog.getOpenFileName(mw, mw.tr("Open CadQuery Script"), self.previousPath, mw.tr("CadQuery Files (*.py)"))