SciViews / svDialogs

Standard Dialog Boxes for R
https://www.sciviews.org/svDialogs/
Other
8 stars 1 forks source link

Optional override for RStudio dialog preference for RStudio Desktop #2

Closed paulhibbing closed 6 years ago

paulhibbing commented 6 years ago

In RStudio Desktop, rstudioapi dialogs are currently shown by default, with no alternative. Optionally suppressing that default would be useful in certain cases.

The get_syst function expands on the original concepts that were in the .nativeGUI methods, by allowing an override (rstudio = FALSE) that will trigger the system dialog instead of the rstudioapi dialog when RStudio Desktop is in use.

By default (rstudio = TRUE) nothing changes from the current functionality. An additional file of tests/examples has been added (manual_tests_RStudio.R) and run on Windows 10 (R 3.5.0, RStudio Desktop 1.1.447) and Ubuntu 16.04.4 (R 3.4.3, RStudio Desktop 1.1.423).

codecov-io commented 6 years ago

Codecov Report

Merging #2 into master will decrease coverage by 0.01%. The diff coverage is 0%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master     #2      +/-   ##
========================================
- Coverage    1.22%   1.2%   -0.02%     
========================================
  Files           9     10       +1     
  Lines        1801   1821      +20     
========================================
  Hits           22     22              
- Misses       1779   1799      +20
Impacted Files Coverage Δ
R/dlg_message.R 0% <0%> (ø) :arrow_up:
R/dlg_save.R 0% <0%> (ø) :arrow_up:
R/dlg_list.R 0% <0%> (ø) :arrow_up:
R/dlg_dir.R 3.3% <0%> (ø) :arrow_up:
R/dlg_open.R 0% <0%> (ø) :arrow_up:
R/get_syst.R 0% <0%> (ø)
R/dlg_input.R 0% <0%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update e77a14c...967463a. Read the comment docs.

phgrosjean commented 6 years ago

OK for this solution, but there is one thing to correct in your PR: given the definition of the generics, which are dlg_xxx(<args>, ..., gui = .GUI), you cannot add rstudio = TRUE after gui = .GUI in the methods. You have to add it before the .... I am surprised that R CMD check does not catch it.

Could you make this correction before I incorporate your PR? Thanks.

paulhibbing commented 6 years ago

Done.

phgrosjean commented 6 years ago

Thanks, merged now.