open project seems to be funcional

This commit is contained in:
Bachir Soussi Chiadmi
2017-05-30 21:12:05 +02:00
parent 767809146a
commit 4ee18726f0
5 changed files with 98 additions and 30 deletions
+22
View File
@@ -110,6 +110,28 @@ class MainWindow(QMainWindow):
def openprojectdialogue(self):
print("open")
dialog = QFileDialog()
dialog.setFileMode(QFileDialog.Directory)
dialog.setAcceptMode(QFileDialog.AcceptOpen)
options = QFileDialog.DontResolveSymlinks | QFileDialog.ShowDirsOnly
folder = dialog.getExistingDirectory(
self,
'Open Project',
self.core.dialog_path,
options
)
try:
head, tail = os.path.split(folder)
self.core.dialog_path = head
# TODO: check if is cascade folder
print(folder)
if os.path.isdir(folder):
self.core.openproject(folder)
else:
print("folder doesn't exists")
except Exception as e:
print('Exception', e)
pass
def newprojectdialogue(self):
dialog = QFileDialog()