Пример #1
0
def ask_user_for_loadfile(title=None):
    from pyface.api import FileDialog, OK
    dialog = FileDialog(action='open')
    if title is not None:
        dialog.title = title
    dialog.open()
    if dialog.return_code != OK:
        return

    return os.path.join( dialog.directory, dialog.filename )
Пример #2
0
def ask_user_for_loadfile(title=None):
    from pyface.api import FileDialog, OK
    dialog = FileDialog(action='open')
    if title is not None:
        dialog.title = title
    dialog.open()
    if dialog.return_code != OK:
        return

    return os.path.join(dialog.directory, dialog.filename)
Пример #3
0
def ask_user_for_savefile(title=None):
    #from traitsui.file_dialog import save_file
    from pyface.api import FileDialog, OK
    
    dialog = FileDialog(action='save as')
    if title is not None:
        dialog.title = title
    dialog.open()
    if dialog.return_code != OK:
        return

    return os.path.join( dialog.directory, dialog.filename )
Пример #4
0
def ask_user_for_savefile(title=None):
    #from traitsui.file_dialog import save_file
    from pyface.api import FileDialog, OK

    dialog = FileDialog(action='save as')
    if title is not None:
        dialog.title = title
    dialog.open()
    if dialog.return_code != OK:
        return

    return os.path.join(dialog.directory, dialog.filename)
Пример #5
0
    def perform(self, event):
        app = event.task.window.application
        service = app.get_service(IFileHandlingService)
        directory = service.get_recent_directory()

        dialog = FileDialog(
            wildcard=self._wildcard_string(), default_directory=directory)
        dialog.title = 'Load Table to UI Builder'
        if dialog.open() == OK:
            
            service.push_recent_file(dialog.path)

            opts = self._get_model()
            opts.path = dialog.path
            opts.application = app

            application_manager.create_app()

            view = self._get_enaml_view()
            view.options = opts
            view.show()