Set the Open dialog to default to the embedded Examples directory the first time it comes up.

This commit is contained in:
Jeremy Wright 2014-12-08 20:56:07 -05:00
parent 37420537d3
commit b4df535e07

View File

@ -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)"))