From 55e011cff712005598adac6889aa63939355b209 Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Tue, 27 Sep 2016 12:55:52 -0300 Subject: [PATCH] Added FlachyJoe's fix - fixes #168 --- PartsLibrary.FCMacro | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/PartsLibrary.FCMacro b/PartsLibrary.FCMacro index 253f73bc..ffce4b47 100644 --- a/PartsLibrary.FCMacro +++ b/PartsLibrary.FCMacro @@ -417,18 +417,19 @@ class ConfigDialog(QtGui.QDialog): librarypath = FreeCAD.ParamGet('User parameter:Plugins/parts_library').GetString('destination','') np = QtGui.QFileDialog.getExistingDirectory(self,"Location of your existing Parts library",librarypath) if np: - self.lineEdit_3.setText(librarypath) - + self.lineEdit_3.setText(np) + def accept(self): - cw = repo.remote().config_writer - if self.lineEdit.text(): - cw.set("url", str(self.lineEdit.text())) - if self.lineEdit_2.text(): - cw.set("pushurl", str(self.lineEdit_2.text())) - if hasattr(cw,"release"): - cw.release() + if repo: + cw = repo.remote().config_writer + if self.lineEdit.text(): + cw.set("url", str(self.lineEdit.text())) + if self.lineEdit_2.text(): + cw.set("pushurl", str(self.lineEdit_2.text())) + if hasattr(cw,"release"): + cw.release() if self.lineEdit_3.text(): - FreeCAD.ParamGet('User parameter:Plugins/parts_library').SetString('destination',np) + FreeCAD.ParamGet('User parameter:Plugins/parts_library').SetString('destination',self.lineEdit_3.text()) QtGui.QDialog.accept(self) if QtCore.QDir(LIBRARYPATH).exists():