Skip to content

Commit

Permalink
Merge branch '9000' of github.com:akoyabio/phenoptrReports into 9000
Browse files Browse the repository at this point in the history
  • Loading branch information
AB-Kent committed Apr 12, 2019
2 parents ce7e201 + 7cb95bb commit d3eb1cf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
15 changes: 8 additions & 7 deletions R/utilities.R
Original file line number Diff line number Diff line change
Expand Up @@ -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.')
}

Expand All @@ -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.')
}

Expand Down
2 changes: 1 addition & 1 deletion inst/analysis_app/files_module.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d3eb1cf

Please sign in to comment.