diff options
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | inst/GUI/gmkin.R | 32 |
2 files changed, 20 insertions, 14 deletions
@@ -61,7 +61,5 @@ save(FOCUS_2006_Z_gmkin, file = "FOCUS_2006_gmkin_Z.RData") yourself. - Please check the [issues](https://github.com/jranke/gmkin/issues) reported on github - Starting the GUI takes some time. Once it is started, it is reasonably responsive. -- Do not delete the last dataset or the last model from the respective lists, - this is not supported. - The fit list was not always updated when using Firefox version 28 on Windows. This works with Firefox starting from version 29 and with Chrome. diff --git a/inst/GUI/gmkin.R b/inst/GUI/gmkin.R index c85d660..5932f37 100644 --- a/inst/GUI/gmkin.R +++ b/inst/GUI/gmkin.R @@ -311,12 +311,16 @@ copy_dataset_handler <- function(h, ...) { }
delete_dataset_handler <- function(h, ...) {
- ds[[ds.cur]] <<- NULL
- names(ds) <<- as.character(1:length(ds))
- ds.cur <<- names(ds)[[1]]
- update_ds.df()
- ds.gtable[,] <- ds.df
- update_ds_editor()
+ if (length(ds) > 1) {
+ ds[[ds.cur]] <<- NULL
+ names(ds) <<- as.character(1:length(ds))
+ ds.cur <<- names(ds)[[1]]
+ update_ds.df()
+ ds.gtable[,] <- ds.df
+ update_ds_editor()
+ } else {
+ galert("Deleting the last dataset is not supported", parent = w)
+ }
}
new_dataset_handler <- function(h, ...) {
@@ -540,12 +544,16 @@ copy_model_handler <- function(h, ...) { }
delete_model_handler <- function(h, ...) {
- m[[m.cur]] <<- NULL
- names(m) <<- as.character(1:length(m))
- m.cur <<- "1"
- update_m.df()
- m.gtable[,] <- m.df
- update_m_editor()
+ if (length(m) > 1) {
+ m[[m.cur]] <<- NULL
+ names(m) <<- as.character(1:length(m))
+ m.cur <<- "1"
+ update_m.df()
+ m.gtable[,] <- m.df
+ update_m_editor()
+ } else {
+ galert("Deleting the last model is not supported", parent = w)
+ }
}
add_observed_handler <- function(h, ...) {
|