예제 #1
0
 def callback_open(self, widget, data=None):
     dialog = QFileDialog(self)
     dialog.setWindowTitle(_("Open an existing gpvdm simulation"))
     dialog.setNameFilter('Simulations - gpvdm (*.gpvdm *.opvdm)')
     dialog.setFileMode(QFileDialog.ExistingFile)
     if dialog.exec_() == QDialog.Accepted:
         filename = dialog.selectedFiles()[0]
         filename = to_native_path(filename)
         self.load_sim(filename)
예제 #2
0
def save_as_gpvdm(parent):
    dialog = QFileDialog(parent, directory=QDir.homePath())
    dialog.setWindowTitle(_("Save a the simulation as"))
    dialog.setNameFilter(_("Directory"))
    dialog.setAcceptMode(QFileDialog.AcceptSave)
    dialog.setOption(QFileDialog.ShowDirsOnly, True)
    if dialog.exec_() == QDialog.Accepted:
        filename = dialog.selectedFiles()[0]
        filename = to_native_path(filename)
        return filename
    else:
        return None