fix import state before import started

This commit is contained in:
j 2016-01-25 12:18:24 +05:30
parent 26f2a40601
commit ceffe456db
3 changed files with 16 additions and 11 deletions

View file

@ -328,8 +328,11 @@ def _import(data):
mode copy|move mode copy|move
} }
''' '''
if 'cancel' in state.activity: if os.path.exists(data['path']):
del state.activity['cancel'] state.activity = {
'activity': 'import',
'path': data['path'],
}
state.tasks.queue('import', data) state.tasks.queue('import', data)
return {} return {}
actions.register(_import, 'import', cache=False) actions.register(_import, 'import', cache=False)

View file

@ -233,6 +233,7 @@ def run_import(options=None):
remove_empty_folders(prefix, True) remove_empty_folders(prefix, True)
def import_folder(): def import_folder():
if not (state.activity and state.activity.get('activity') == 'import'):
import_path = settings.preferences['importPath'] import_path = settings.preferences['importPath']
logger.debug('scan importPath %s', import_path) logger.debug('scan importPath %s', import_path)
if os.path.exists(import_path): if os.path.exists(import_path):

View file

@ -111,6 +111,7 @@ oml.ui.importExportDialog = function() {
: renderForm('export', isActive) : renderForm('export', isActive)
); );
that.options({content: $outerPanel}); that.options({content: $outerPanel});
setButton(result.data);
}); });
}); });