Exemplo n.º 1
0
def FileSaveDialog(initialFile=None):
    dlg = SaveFileDialog()
    dlg.DefaultExt = ".txt"; # Default file extension
    dlg.Filter = "Text files (*.txt)|*.txt|All files (*.*)|*.*";
    if initialFile:
        dlg.InitialDirectory = System.IO.Path.GetDirectoryName(initialFile)
        dlg.FileName = System.IO.Path.GetFileName(initialFile)
    if dlg.ShowDialog() == True:
        return dlg.FileNames 
Exemplo n.º 2
0
def saveFile(config):
    dialog = SaveFileDialog()
    dialog.Title = config['title'] if 'title' in config else 'Pick file'
    dialog.FileName = config['name']
    if 'defaultExtension' in config:
        dialog.DefaultExt = ".txt"