diff --git a/R/utilities.R b/R/utilities.R index 75c2220..7a4c616 100644 --- a/R/utilities.R +++ b/R/utilities.R @@ -109,12 +109,12 @@ validate_phenotype_definitions = function(pheno, available) { choose_directory = function(caption = 'Select folder', default='') { if (function_exists('utils', 'choose.dir')) { utils::choose.dir(caption = caption, default=default) - } else if (function_exists('tcltk', 'tk_choose.dir')) { - tcltk::tk_choose.dir(caption = caption, default=default) } else if (function_exists('rstudioapi', 'isAvailable') && rstudioapi::isAvailable() && rstudioapi::getVersion() > '1.1.287') { rstudioapi::selectDirectory(caption = caption, path=default) + } else if (function_exists('tcltk', 'tk_choose.dir')) { + tcltk::tk_choose.dir(caption = caption, default=default) } else stop('No directory chooser available.') } @@ -134,14 +134,15 @@ choose_files = function(caption='Select files', default='', if (function_exists('utils', 'choose.files')) { utils::choose.files(caption = caption, default=default, multi=multi, filters=filters) - } else if (function_exists('tcltk', 'tk_choose.files')) { - tcltk::tk_choose.files(caption = caption, default=default, - multi=multi, filters=filters) - } else if (function_exists('rstudioapi', 'isAvailable') && + } else if (!multi && + function_exists('rstudioapi', 'isAvailable') && rstudioapi::isAvailable() && rstudioapi::getVersion() > '1.1.287') { rstudioapi::selectFile(caption = caption, path=default, - filter=filters[nrow(filters),2]) + filter=filters[nrow(filters),1]) + } else if (function_exists('tcltk', 'tk_choose.files')) { + tcltk::tk_choose.files(caption = caption, default=default, + multi=multi, filters=filters) } else stop('No file chooser available.') } diff --git a/inst/analysis_app/files_module.R b/inst/analysis_app/files_module.R index 984163c..9e973c0 100644 --- a/inst/analysis_app/files_module.R +++ b/inst/analysis_app/files_module.R @@ -142,7 +142,7 @@ files_module = function(input, output, session) { default=default_dir(), caption='Select an output folder' ) - + shiny::req(output_path) output_path = normalizePath(output_path, winslash='/', mustWork=FALSE) output$output_dir = shiny::renderText(output_path) output_dir(output_path)