From noreply at r-forge.r-project.org Fri Oct 3 13:46:42 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Fri, 3 Oct 2014 13:46:42 +0200 (CEST) Subject: [Sciviews-commits] r554 - in pkg: SciViews/R svDialogs svDialogs/R svDialogs/inst svDialogs/man svMisc/R Message-ID: <20141003114643.1196E186948@r-forge.r-project.org> Author: phgrosjean Date: 2014-10-03 13:46:42 +0200 (Fri, 03 Oct 2014) New Revision: 554 Modified: pkg/SciViews/R/misc.R pkg/svDialogs/DESCRIPTION pkg/svDialogs/NEWS pkg/svDialogs/R/dlgDir.R pkg/svDialogs/R/dlgInput.R pkg/svDialogs/R/dlgMessage.R pkg/svDialogs/R/dlgOpen.R pkg/svDialogs/R/dlgSave.R pkg/svDialogs/inst/NEWS.Rd pkg/svDialogs/man/svDialogs-package.Rd pkg/svMisc/R/isMac.R Log: Correction in Mac native dialog boxes calls for Mac OS X 10.5 (Leopard) and above Modified: pkg/SciViews/R/misc.R =================================================================== --- pkg/SciViews/R/misc.R 2014-03-09 09:28:16 UTC (rev 553) +++ pkg/SciViews/R/misc.R 2014-10-03 11:46:42 UTC (rev 554) @@ -77,6 +77,7 @@ enum <- function (x) seq_along(x) ## Defines only increasing integer sequences +## TODO: rethink this to make a more flexible sequencer + x:step:y? + rep()? `%:%` <- function (lower, upper) if (lower > upper) integer(0) else seq.int(from = as.integer(lower), to = as.integer(upper), by = 1L) @@ -118,6 +119,7 @@ ## Constants (must start with an uppercase letter) ## => redefine Pi instead of pi +## TODO: only uppercase for constants => PI??? Pi <- base::pi ## Useful for apply() familly: Rows <- 1 @@ -126,6 +128,7 @@ ## I don't like isTRUE, because if there is an attribute attached to TRUE, ## it returns FALSE! => define asTRUE which is more permissive! +## TODO: rethink all this! asTRUE <- function (x) identical(TRUE, as.logical(x)) isFALSE <- function (x) identical(FALSE, x) asFALSE <- function (x) identical(FALSE, as.logical(x)) Modified: pkg/svDialogs/DESCRIPTION =================================================================== --- pkg/svDialogs/DESCRIPTION 2014-03-09 09:28:16 UTC (rev 553) +++ pkg/svDialogs/DESCRIPTION 2014-10-03 11:46:42 UTC (rev 554) @@ -1,7 +1,7 @@ Package: svDialogs Type: Package -Version: 0.9-55 -Date: 2014-03-02 +Version: 0.9-56 +Date: 2014-10-03 Title: SciViews GUI API - Dialog boxes Author: Philippe Grosjean [aut, cre] Authors at R: c(person("Philippe", "Grosjean", role = c("aut", "cre"), Modified: pkg/svDialogs/NEWS =================================================================== --- pkg/svDialogs/NEWS 2014-03-09 09:28:16 UTC (rev 553) +++ pkg/svDialogs/NEWS 2014-10-03 11:46:42 UTC (rev 554) @@ -1,11 +1,18 @@ = svDialogs News -== Changes in scDialogs 0.9-55 +== Changes in svDialogs 0.9-56 +* The native Mac dialogs did not work any more, solved for 10.5 Leopard and + above by querying the name of the application by its id (Rgui). + + +== Changes in svDialogs 0.9-55 + * Rework of Author and Authors at R fileds in the DESCRIPTION file. -== Changes in scDialogs 0.9-54 +== Changes in svDialogs 0.9-54 + * Dependencies to tcltk and svMisc are eliminated. Consequently, all functions that depend on Tcl/Tk are eliminated too. It concerns guiDlg(), guiDlgFunction() and other associated methods or functions. The new dlgForm() Modified: pkg/svDialogs/R/dlgDir.R =================================================================== --- pkg/svDialogs/R/dlgDir.R 2014-03-09 09:28:16 UTC (rev 553) +++ pkg/svDialogs/R/dlgDir.R 2014-10-03 11:46:42 UTC (rev 554) @@ -106,7 +106,9 @@ .macDlgDir <- function (default = getwd(), title = "") { ## Display a modal directory selector with native Mac dialog box - if (.Platform$GUI == "AQUA") app <- "(name of application \"R\")" else + #if (.Platform$GUI == "AQUA") app <- "(name of application \"R\")" else + ## This works from Mac OS X 10.5 Leopard: + if (.Platform$GUI == "AQUA") app <- "(name of application id \"Rgui\")" else if (.isJGR()) app <- "\"JGR\"" else app <- "\"Terminal\"" ## Avoid displaying warning message when the user clicks on 'Cancel' owarn <- getOption("warn") Modified: pkg/svDialogs/R/dlgInput.R =================================================================== --- pkg/svDialogs/R/dlgInput.R 2014-03-09 09:28:16 UTC (rev 553) +++ pkg/svDialogs/R/dlgInput.R 2014-10-03 11:46:42 UTC (rev 554) @@ -73,7 +73,9 @@ .macDlgInput <- function (message, default) { ## Display a modal message with native Mac dialog box - if (.Platform$GUI == "AQUA") app <- "(name of application \"R\")" else + #if (.Platform$GUI == "AQUA") app <- "(name of application \"R\")" else + ## This works from Mac OS X 10.5 Leopard: + if (.Platform$GUI == "AQUA") app <- "(name of application id \"Rgui\")" else if (.isJGR()) app <- "\"JGR\"" else app <- "\"Terminal\"" ## Avoid displaying warning message when the user clicks on 'Cancel' owarn <- getOption("warn") Modified: pkg/svDialogs/R/dlgMessage.R =================================================================== --- pkg/svDialogs/R/dlgMessage.R 2014-03-09 09:28:16 UTC (rev 553) +++ pkg/svDialogs/R/dlgMessage.R 2014-10-03 11:46:42 UTC (rev 554) @@ -101,7 +101,9 @@ "yesnocancel")) { ## Display a modal message with native Mac dialog box - if (.Platform$GUI == "AQUA") app <- "(name of application \"R\")" else + #if (.Platform$GUI == "AQUA") app <- "(name of application \"R\")" else + ## This works from Mac OS X 10.5 Leopard: + if (.Platform$GUI == "AQUA") app <- "(name of application id \"Rgui\")" else if (.isJGR()) app <- "\"JGR\"" else app <- "\"Terminal\"" type <- match.arg(type) buttons <- switch(type, Modified: pkg/svDialogs/R/dlgOpen.R =================================================================== --- pkg/svDialogs/R/dlgOpen.R 2014-03-09 09:28:16 UTC (rev 553) +++ pkg/svDialogs/R/dlgOpen.R 2014-10-03 11:46:42 UTC (rev 554) @@ -173,7 +173,9 @@ ## TODO: filters are implemented differently on the Mac => how to do this??? if (!is.matrix(filters)) filters <- matrix(filters, ncol = 2, byrow = TRUE) ## Display a modal file open selector with native Mac dialog box - if (.Platform$GUI == "AQUA") app <- "(name of application \"R\")" else + #if (.Platform$GUI == "AQUA") app <- "(name of application \"R\")" else + ## This works from Mac OS X 10.5 Leopard: + if (.Platform$GUI == "AQUA") app <- "(name of application id \"Rgui\")" else if (.isJGR()) app <- "\"JGR\"" else app <- "\"Terminal\"" ## Avoid displaying warning message when the user clicks on 'Cancel' owarn <- getOption("warn") Modified: pkg/svDialogs/R/dlgSave.R =================================================================== --- pkg/svDialogs/R/dlgSave.R 2014-03-09 09:28:16 UTC (rev 553) +++ pkg/svDialogs/R/dlgSave.R 2014-10-03 11:46:42 UTC (rev 554) @@ -139,7 +139,9 @@ ## TODO: filters are implemented differently on the Mac => how to do this??? if (!is.matrix(filters)) filters <- matrix(filters, ncol = 2, byrow = TRUE) ## Display a modal file save selector with native Mac dialog box - if (.Platform$GUI == "AQUA") app <- "(name of application \"R\")" else + #if (.Platform$GUI == "AQUA") app <- "(name of application \"R\")" else + ## This works from Mac OS X 10.5 Leopard: + if (.Platform$GUI == "AQUA") app <- "(name of application id \"Rgui\")" else if (.isJGR()) app <- "\"JGR\"" else app <- "\"Terminal\"" ## Avoid displaying warning message when the user clicks on 'Cancel' owarn <- getOption("warn") Modified: pkg/svDialogs/inst/NEWS.Rd =================================================================== --- pkg/svDialogs/inst/NEWS.Rd 2014-03-09 09:28:16 UTC (rev 553) +++ pkg/svDialogs/inst/NEWS.Rd 2014-10-03 11:46:42 UTC (rev 554) @@ -1,6 +1,20 @@ \name{NEWS} \title{NEWS file for the svDialogs package} +\section{Changes in version 0.9-56}{ + \itemize{ + \item{ The native Mac dialogs did not work any more, solved for 10.5 + Leopard and above by querying the name of the application by its id + (Rgui). } + } +} + +\section{Changes in version 0.9-55}{ + \itemize{ + \item{ Rework of Author and Authors at R fileds in the DESCRIPTION file. } + } +} + \section{Changes in version 0.9-54}{ \itemize{ \item{ Dependencies to tcltk and svMisc are eliminated. Modified: pkg/svDialogs/man/svDialogs-package.Rd =================================================================== --- pkg/svDialogs/man/svDialogs-package.Rd 2014-03-09 09:28:16 UTC (rev 553) +++ pkg/svDialogs/man/svDialogs-package.Rd 2014-10-03 11:46:42 UTC (rev 554) @@ -12,8 +12,8 @@ \tabular{ll}{ Package: \tab svDialogs\cr Type: \tab Package\cr - Version: \tab 0.9-55\cr - Date: \tab 2014-03-02\cr + Version: \tab 0.9-56\cr + Date: \tab 2014-10-03\cr License: \tab GPL 2 or above, at your convenience\cr } % TODO: add description of main functions here. Also add examples Modified: pkg/svMisc/R/isMac.R =================================================================== --- pkg/svMisc/R/isMac.R 2014-03-09 09:28:16 UTC (rev 553) +++ pkg/svMisc/R/isMac.R 2014-10-03 11:46:42 UTC (rev 554) @@ -1,2 +1,3 @@ isMac <- function () - (grepl("^mac", .Platform$pkgType)) + grepl("darwin", R.version$os) # According to what's done in R sources + #(grepl("^mac", .Platform$pkgType))