[rkward/releases/0.6.4] packages/rkwarddev: removed some frames from the author optionset (and minor changes)

m.eik michalke meik.michalke at uni-duesseldorf.de
Sun Dec 6 17:31:50 UTC 2015


Git commit 653c3e3568db2d61568fb6ad7b4ed2e5ac1e120f by m.eik michalke.
Committed on 06/12/2015 at 17:27.
Pushed by meikm into branch 'releases/0.6.4'.

removed some frames from the author optionset (and minor changes)

  - also added the "bug_reports" option to the i18n part of the script
  - the dialog now informs you that it isn't meant to be actually submitted
  - it is also labeled as creating plugin scripts instead of skeletons

M  +1    -0    packages/rkwarddev/ChangeLog
M  +1    -1    packages/rkwarddev/R/R.comment.R
M  +57   -43   packages/rkwarddev/demo/skeleton_dialog.R
R  +11   -11   packages/rkwarddev/inst/rkward/RKWardPluginScript.pluginmap [from: packages/rkwarddev/inst/rkward/RKWardPluginSkeleton.pluginmap - 063% similarity]
R  +1    -1    packages/rkwarddev/inst/rkward/plugins/CreateRKWardpluginscript.js [from: packages/rkwarddev/inst/rkward/plugins/CreateRKWardpluginskeleton.js - 097% similarity]
R  +3    -5    packages/rkwarddev/inst/rkward/plugins/CreateRKWardpluginscript.rkh [from: packages/rkwarddev/inst/rkward/plugins/CreateRKWardpluginskeleton.rkh - 096% similarity]
R  +27   -29   packages/rkwarddev/inst/rkward/plugins/CreateRKWardpluginscript.xml [from: packages/rkwarddev/inst/rkward/plugins/CreateRKWardpluginskeleton.xml - 082% similarity]
M  +4    -4    packages/rkwarddev/inst/rkward/rkwarddev.pluginmap

http://commits.kde.org/rkward/653c3e3568db2d61568fb6ad7b4ed2e5ac1e120f

diff --git a/packages/rkwarddev/ChangeLog b/packages/rkwarddev/ChangeLog
index 5076d5e..d6128ab 100644
--- a/packages/rkwarddev/ChangeLog
+++ b/packages/rkwarddev/ChangeLog
@@ -18,6 +18,7 @@ fixed:
     lines
   - the "i18n" attribute in lists e.g. for rk.XML.radio() didn't really work
   - improved indetation for rk.JS.oset objects
+  - R.comment() didn't correctly paste indentation levels > 2
 added:
   - new methods plugin2script() to try to translate raw plugin XML into
     working rkwarddev script calls
diff --git a/packages/rkwarddev/R/R.comment.R b/packages/rkwarddev/R/R.comment.R
index 4892176..f33bf4c 100644
--- a/packages/rkwarddev/R/R.comment.R
+++ b/packages/rkwarddev/R/R.comment.R
@@ -30,7 +30,7 @@
 R.comment <- function(..., indent.by=rk.get.indent(escape=TRUE), level=2, newline=""){
   message <- paste0(list(...), collapse=" ")
   if(level > 1){
-    indentation <- paste0(", \"", rep(indent.by, level-1), "\"")
+    indentation <- paste0(", \"", paste0(rep(indent.by, level-1), collapse=""), "\"")
   } else {
     indentation <- ""
   }
diff --git a/packages/rkwarddev/demo/skeleton_dialog.R b/packages/rkwarddev/demo/skeleton_dialog.R
index 57257a5..a9c06d7 100644
--- a/packages/rkwarddev/demo/skeleton_dialog.R
+++ b/packages/rkwarddev/demo/skeleton_dialog.R
@@ -10,24 +10,24 @@ overwrite <- TRUE
 rk.set.indent(by="  ")
 rk.set.empty.e(TRUE)
 update.translations <- TRUE
-# the script generates a folder called "RKWardPluginSkeleton", set the
+# the script generates a folder called "RKWardPluginScript", set the
 # following to FALSE if you want to translate plugin files in the
 # rkwarddev package sources instead
 standalonePlugin <- TRUE
 
 about.info <- rk.XML.about(
-  name="RKWard Plugin Skeleton",
+  name="RKWard Plugin Script",
   author=c(
     person(given="Meik", family="Michalke",
       email="meik.michalke at hhu.de", role=c("aut","cre"))),
-  about=list(desc="GUI interface to create RKWard plugin skeletons",
+  about=list(desc="GUI interface to create RKWard plugin skeletons via rkwarddev scripts",
     # the version number should be in line with rkwarddev
     # to reflect when the script code was changed
     version="0.08-1", url="http://rkward.kde.org")
   )
 dependencies.info <- rk.XML.dependencies(dependencies=list(rkward.min="0.6.0"))
 
-rk.set.comp("Create RKWard plugin skeleton")
+rk.set.comp("Create RKWard plugin script")
 
 # tab1: information on the thing
 aboutPlugin <- rk.XML.frame(
@@ -72,31 +72,27 @@ aboutPlugin <- rk.XML.frame(
 aboutContact <- rk.XML.frame(
   rk.XML.row(
     optionsetAuthors <- rk.XML.optionset(
-      content=rk.XML.frame(rk.XML.stretch(before=list(
-        rk.XML.row(
-        aboutContactFrame <- rk.XML.frame(
-          rk.XML.row(
-            rk.XML.col(
-              authorGivenName <- rk.XML.input("Given name", required=TRUE, id.name="authorGivenName",
-                help="First name of the package author."),
-              authorFamiliyName <- rk.XML.input("Family name", required=TRUE, id.name="authorFamiliyName",
-                help="Family name of the package author."),
-              authorMail <- rk.XML.input("E-mail", required=FALSE, id.name="authorMail",
-                help="The authors e-mail address, important for bug reports and receiving a myriad of thank yous..."),
-              rk.XML.stretch()),
-            rk.XML.col(rk.XML.frame(
-              authorAut <- rk.XML.cbox("Author", chk=TRUE, id.name="authorAut",
-                help="Check this if this person is the author of the plugin code."),
-              authorCre <- rk.XML.cbox("Maintainer", chk=TRUE, id.name="authorCre",
-                help="Check this if this person maintains the plugin package."),
-              authorCtb <- rk.XML.cbox("Contributor", chk=FALSE, id.name="authorCtb",
-                help="Check this if this person is a contributor to the plugin code (e.g., translations)."),
-              rk.XML.stretch(), label="Roles"))),
-            label="Package author",
-            id.name="aboutContactFrame"
-          )
+      content=rk.XML.row(
+        aboutContactRow <- rk.XML.row(
+          rk.XML.col(
+            authorGivenName <- rk.XML.input("Given name", required=TRUE, id.name="authorGivenName",
+              help="First name of the package author."),
+            authorFamiliyName <- rk.XML.input("Family name", required=TRUE, id.name="authorFamiliyName",
+              help="Family name of the package author."),
+            authorMail <- rk.XML.input("E-mail", required=FALSE, id.name="authorMail",
+              help="The authors e-mail address, important for bug reports and receiving a myriad of thank yous..."),
+            rk.XML.stretch()),
+          rk.XML.col(rk.XML.frame(
+            authorAut <- rk.XML.cbox("Author", chk=TRUE, id.name="authorAut",
+              help="Check this if this person is the author of the plugin code."),
+            authorCre <- rk.XML.cbox("Maintainer", chk=TRUE, id.name="authorCre",
+              help="Check this if this person maintains the plugin package."),
+            authorCtb <- rk.XML.cbox("Contributor", chk=FALSE, id.name="authorCtb",
+              help="Check this if this person is a contributor to the plugin code (e.g., translations)."),
+            rk.XML.stretch(), label="Roles")),
+          id.name="aboutContactFrame"
         )
-      )), label="Package authors"),
+      ),
       optioncolumn=list(
         optcolAuthorGivenName <- rk.XML.optioncolumn(connect=authorGivenName, modifier="text", id.name="optcolAuthorGivenName"),
         optcolAuthorFamiliyName <- rk.XML.optioncolumn(connect=authorFamiliyName, modifier="text", id.name="optcolAuthorFamiliyName"),
@@ -112,12 +108,20 @@ aboutContact <- rk.XML.frame(
       id.name="optionsetAuthors"
     )
   ),
-  label="Plugin author",
+  label="Plugin authors",
   id.name="aboutContact"
 )
 
+doNotSubmitWarning <- rk.XML.text(
+  "NOTE: You should not hit the submit button, but copy the generated code to a script file for further work on your plugin!",
+  type="warning"
+)
 
-tab1.about <- rk.XML.col(aboutPlugin, aboutContact)
+tab1.about <- rk.XML.col(
+  doNotSubmitWarning,
+  aboutPlugin,
+  aboutContact
+)
 
 # tab2: create options
 createOptionsFrame <- rk.XML.frame(
@@ -234,7 +238,10 @@ dependencyFrame <- rk.XML.frame(
   id.name="dependencyFrame"
 )
 
-tab2.create <- rk.XML.col(createOptionsFrame, dependencyFrame)
+tab2.create <- rk.XML.col(
+  createOptionsFrame,
+  dependencyFrame
+)
 
 # # tab3: varslot to select the actual content
 # children.text <- rk.XML.text("If you already created XML content for the plugin, select the main dialog object here (probably a tabbook?)")
@@ -266,18 +273,20 @@ helpText <- rk.XML.frame(
   id.name="helpText"
 )
   
-tab3.help <- rk.XML.col(helpText)
+tab3.help <- rk.XML.col(
+  helpText
+)
 
 ## glue all of the above together in one tabbook
 # sklt.tabbook <- rk.XML.dialog(rk.XML.tabbook("Plugin Skeleton",
 #   tab.labels=c("About the plugin", "Create options", "XML content"),
 #   children=list(tab1.about, tab2.create, tab3.children)), label="RKWard Plugin Skeleton")
-sklt.tabbook <- rk.XML.dialog(rk.XML.tabbook("Plugin Skeleton",
+sklt.tabbook <- rk.XML.dialog(rk.XML.tabbook("Plugin Script",
   tabs=list(
     "About the plugin"=tab1.about,
     "Create options"=tab2.create,
     "Help page"=tab3.help)),
-  label="RKWard Plugin Skeleton")
+  label="RKWard Plugin Script")
 
 ## some logic
 logic.section <- rk.XML.logic(
@@ -567,20 +576,25 @@ JS.calculate <- rk.paste.JS(
   echo(js.opt.skeleton),
   echo("\n)\n\n"),
   echo(
-    "\t# you can make your plugin translatable, see top of script",
-    "\n\tif(isTRUE(update.translations)){",
-    "\n\t\trk.updatePluginMessages(file.path(output.dir,\"", pluginName, "\",\"inst\",\"rkward\",\"", pluginName, ".pluginmap\"))",
-    "\n\t} else {}\n\n"
+    "# you can make your plugin translatable, see top of script",
+    "\nif(isTRUE(update.translations)){",
+    "\n\trk.updatePluginMessages(",
+    "\n\t\tfile.path(output.dir,\"", pluginName, "\",\"inst\",\"rkward\",\"", pluginName, ".pluginmap\"),",
+    "\n\t\t# where should translation bug reports go?",
+    "\n\t\tbug_reports=\"https://mail.kde.org/mailman/listinfo/kde-i18n-doc\"",
+    "\n\t)",
+    "\n} else {}\n\n"
   ),
-  level=2)
+  level=2
+)
 
 ############
 ## help file
 
-rkh.summary <- rk.rkh.summary("Generate a plugin skeleton for RKWard.")
+rkh.summary <- rk.rkh.summary("Generate a plugin skeleton for RKWard via rkwarddev scripts.")
 
 rkh.usage <- rk.rkh.usage("This plugin is both, an example for a plugin written with the rkwarddev package,
- and a quick way to get a skeleton for new plugins.")
+ and a quick way to get an rkwarddev script for new plugins.")
 
 #############
 ## the main call
@@ -605,7 +619,7 @@ rk.plugin.skeleton(
     summary=rkh.summary,
     usage=rkh.usage
   ),
-  pluginmap=list(name="Create RKWard plugin skeleton", hierarchy=list("file", "export")),
+  pluginmap=list(name="Create RKWard plugin script", hierarchy=list("file", "export")),
   overwrite=TRUE,
   create=c("pmap","xml","js","desc", "rkh"),
   dependencies=dependencies.info,
@@ -618,7 +632,7 @@ rk.plugin.skeleton(
   
   if(isTRUE(update.translations)){
     if(isTRUE(standalonePlugin)){
-      rk.updatePluginMessages(file.path(output.dir,"RKWardPluginSkeleton","inst","rkward","RKWardPluginSkeleton.pluginmap"))
+      rk.updatePluginMessages(file.path(output.dir,"RKWardPluginScript","inst","rkward","RKWardPluginScript.pluginmap"))
     } else {
       rk.updatePluginMessages(file.path(output.dir,"rkwarddev","inst","rkward","rkwarddev.pluginmap"))
     }
diff --git a/packages/rkwarddev/inst/rkward/RKWardPluginSkeleton.pluginmap b/packages/rkwarddev/inst/rkward/RKWardPluginScript.pluginmap
similarity index 63%
rename from packages/rkwarddev/inst/rkward/RKWardPluginSkeleton.pluginmap
rename to packages/rkwarddev/inst/rkward/RKWardPluginScript.pluginmap
index fc8c569..d584ab8 100644
--- a/packages/rkwarddev/inst/rkward/RKWardPluginSkeleton.pluginmap
+++ b/packages/rkwarddev/inst/rkward/RKWardPluginScript.pluginmap
@@ -1,9 +1,9 @@
 <!DOCTYPE rkpluginmap >
 <document 
   base_prefix=""
-  namespace="CreateRKWardpluginskeleton"
-  id="CreateRKWardpluginskeleton_rkward"
-  po_id="CreateRKWardpluginskeleton_rkward"
+  namespace="CreateRKWardpluginscript"
+  id="CreateRKWardpluginscript_rkward"
+  po_id="CreateRKWardpluginscript_rkward"
   priority="medium"
 >
   <!-- 
@@ -15,11 +15,11 @@
   <dependencies rkward_min_version="0.6.0">
   </dependencies>
   <about 
-    name="RKWard Plugin Skeleton"
-    shortinfo="GUI interface to create RKWard plugin skeletons"
-    longinfo="GUI interface to create RKWard plugin skeletons"
+    name="RKWard Plugin Script"
+    shortinfo="GUI interface to create RKWard plugin skeletons via rkwarddev scripts"
+    longinfo="GUI interface to create RKWard plugin skeletons via rkwarddev scripts"
     version="0.08-1"
-    releasedate="2015-12-05"
+    releasedate="2015-12-06"
     url="http://rkward.kde.org"
     license="GPL (>= 3)"
   >
@@ -38,10 +38,10 @@
    />
   <components>
     <component 
-      id="cmp_CrtRKWrdplgnskltnCrtRKWrd"
-      label="Create RKWard plugin skeleton"
+      id="cmp_CrtRKWrdplgnscrptCrtRKWrd"
+      label="Create RKWard plugin script"
       type="standard"
-      file="plugins/CreateRKWardpluginskeleton.xml"
+      file="plugins/CreateRKWardpluginscript.xml"
     >
     </component>
   </components>
@@ -54,7 +54,7 @@
         id="export"
         label="export"
       >
-        <entry component="cmp_CrtRKWrdplgnskltnCrtRKWrd" />
+        <entry component="cmp_CrtRKWrdplgnscrptCrtRKWrd" />
       </menu>
     </menu>
   </hierarchy>
diff --git a/packages/rkwarddev/inst/rkward/plugins/CreateRKWardpluginskeleton.js b/packages/rkwarddev/inst/rkward/plugins/CreateRKWardpluginscript.js
similarity index 97%
rename from packages/rkwarddev/inst/rkward/plugins/CreateRKWardpluginskeleton.js
rename to packages/rkwarddev/inst/rkward/plugins/CreateRKWardpluginscript.js
index 5408c14..33f2a39 100644
--- a/packages/rkwarddev/inst/rkward/plugins/CreateRKWardpluginskeleton.js
+++ b/packages/rkwarddev/inst/rkward/plugins/CreateRKWardpluginscript.js
@@ -350,7 +350,7 @@ function calculate(){
   echo("\n\t#components=list(),");
   echo(optSkeleton);
   echo("\n)\n\n");
-  echo("\t# you can make your plugin translatable, see top of script" + "\n\tif(isTRUE(update.translations)){" + "\n\t\trk.updatePluginMessages(file.path(output.dir,\"" + pluginName + "\",\"inst\",\"rkward\",\"" + pluginName + ".pluginmap\"))" + "\n\t} else {}\n\n");
+  echo("# you can make your plugin translatable, see top of script" + "\nif(isTRUE(update.translations)){" + "\n\trk.updatePluginMessages(" + "\n\t\tfile.path(output.dir,\"" + pluginName + "\",\"inst\",\"rkward\",\"" + pluginName + ".pluginmap\")," + "\n\t\t# where should translation bug reports go?" + "\n\t\tbug_reports=\"https://mail.kde.org/mailman/listinfo/kde-i18n-doc\"" + "\n\t)" + "\n} else {}\n\n");
 }
 
 function printout(){
diff --git a/packages/rkwarddev/inst/rkward/plugins/CreateRKWardpluginskeleton.rkh b/packages/rkwarddev/inst/rkward/plugins/CreateRKWardpluginscript.rkh
similarity index 96%
rename from packages/rkwarddev/inst/rkward/plugins/CreateRKWardpluginskeleton.rkh
rename to packages/rkwarddev/inst/rkward/plugins/CreateRKWardpluginscript.rkh
index 87514e1..758eef2 100644
--- a/packages/rkwarddev/inst/rkward/plugins/CreateRKWardpluginskeleton.rkh
+++ b/packages/rkwarddev/inst/rkward/plugins/CreateRKWardpluginscript.rkh
@@ -5,14 +5,14 @@
     
     look for a file called: $SRC/demo/skeleton_dialog.R -->
   <title>
-    Create RKWard plugin skeleton
+    Create RKWard plugin script
   </title>
   <summary>
-    Generate a plugin skeleton for RKWard.
+    Generate a plugin skeleton for RKWard via rkwarddev scripts.
   </summary>
   <usage>
     This plugin is both, an example for a plugin written with the rkwarddev package,
-   and a quick way to get a skeleton for new plugins.
+   and a quick way to get an rkwarddev script for new plugins.
   </usage>
   <!-- <section id="sct_EDITORDE" title="EDIT OR DELETE ME">
         EDIT OR DELETE ME
@@ -42,8 +42,6 @@
       A category for your plugin. This infromation is currently ignored by RKWard.
     </setting>
     <caption id="aboutContact" />
-    <caption id="frm_Pckgthrs" />
-    <caption id="aboutContactFrame" />
     <setting id="authorGivenName">
       First name of the package author.
     </setting>
diff --git a/packages/rkwarddev/inst/rkward/plugins/CreateRKWardpluginskeleton.xml b/packages/rkwarddev/inst/rkward/plugins/CreateRKWardpluginscript.xml
similarity index 82%
rename from packages/rkwarddev/inst/rkward/plugins/CreateRKWardpluginskeleton.xml
rename to packages/rkwarddev/inst/rkward/plugins/CreateRKWardpluginscript.xml
index 28884e2..8677332 100644
--- a/packages/rkwarddev/inst/rkward/plugins/CreateRKWardpluginskeleton.xml
+++ b/packages/rkwarddev/inst/rkward/plugins/CreateRKWardpluginscript.xml
@@ -4,18 +4,21 @@
     perhaps don't make changes here, but in the rkwarddev script instead!
     
     look for a file called: $SRC/demo/skeleton_dialog.R -->
-  <code file="CreateRKWardpluginskeleton.js" />
-  <help file="CreateRKWardpluginskeleton.rkh" />
+  <code file="CreateRKWardpluginscript.js" />
+  <help file="CreateRKWardpluginscript.rkh" />
   <!-- <dependencies>
       </dependencies> -->
   <logic>
     <connect governor="dependencyFrame.checked" client="RKFrame.enabled" />
     <connect governor="dependencyFrame.checked" client="RFrame.enabled" />
   </logic>
-  <dialog label="RKWard Plugin Skeleton">
-    <tabbook id="tbbk_PlgnSklt" label="Plugin Skeleton">
+  <dialog label="RKWard Plugin Script">
+    <tabbook id="tbbk_PlgnScrp" label="Plugin Script">
       <tab label="About the plugin" id="tab_Abtthplg">
-        <column id="clm_fAPPNLLGPL">
+        <column id="clm_tNOTEYNOTE">
+          <text id="txt_NOTEYshl" type="warning">
+            NOTE: You should not hit the submit button, but copy the generated code to a script file for further work on your plugin!
+          </text>
           <frame label="About the plugin" id="aboutPlugin">
             <row id="row_inPNLLGPL3">
               <input label="Plugin name" id="pluginName" size="small" required="true" />
@@ -33,37 +36,32 @@
               <input label="Category" id="pluginCategory" />
             </row>
           </frame>
-          <frame label="Plugin author" id="aboutContact">
-            <row id="row_oA1CMPPPCF">
+          <frame label="Plugin authors" id="aboutContact">
+            <row id="row_oA1CMCFGGN">
               <optionset id="optionsetAuthors" min_rows="1">
                 <logic>
                   <connect governor="authorCre.state" client="authorMail.required" />
                 </logic>
                 <content>
                   <optiondisplay />
-                  <frame label="Package authors" id="frm_Pckgthrs">
-                    <row id="row_fPCFGGNFFN">
-                      <frame label="Package author" id="aboutContactFrame">
-                        <row id="row_cGGNFFNEMG">
-                          <column id="clm_inGGNFFNEM">
-                            <input label="Given name" id="authorGivenName" required="true" />
-                            <input label="Family name" id="authorFamiliyName" required="true" />
-                            <input label="E-mail" id="authorMail" />
-                            <stretch />
-                          </column>
-                          <column id="clm_frRRAACMCC">
-                            <frame label="Roles" id="frm_Roles">
-                              <checkbox id="authorAut" label="Author" value="true" checked="true" />
-                              <checkbox id="authorCre" label="Maintainer" value="true" checked="true" />
-                              <checkbox id="authorCtb" label="Contributor" value="true" />
-                              <stretch />
-                            </frame>
-                          </column>
-                        </row>
-                      </frame>
+                  <row id="row_rCFGGNFFNE">
+                    <row id="aboutContactFrame">
+                      <column id="clm_inGGNFFNEM">
+                        <input label="Given name" id="authorGivenName" required="true" />
+                        <input label="Family name" id="authorFamiliyName" required="true" />
+                        <input label="E-mail" id="authorMail" />
+                        <stretch />
+                      </column>
+                      <column id="clm_frRRAACMCC">
+                        <frame label="Roles" id="frm_Roles">
+                          <checkbox id="authorAut" label="Author" value="true" checked="true" />
+                          <checkbox id="authorCre" label="Maintainer" value="true" checked="true" />
+                          <checkbox id="authorCtb" label="Contributor" value="true" />
+                          <stretch />
+                        </frame>
+                      </column>
                     </row>
-                    <stretch />
-                  </frame>
+                  </row>
                 </content>
                 <optioncolumn id="optcolAuthorGivenName" connect="authorGivenName.text" label="Given name" />
                 <optioncolumn id="optcolAuthorFamiliyName" connect="authorFamiliyName.text" label="Family name" />
diff --git a/packages/rkwarddev/inst/rkward/rkwarddev.pluginmap b/packages/rkwarddev/inst/rkward/rkwarddev.pluginmap
index 3f01929..0e5b2df 100644
--- a/packages/rkwarddev/inst/rkward/rkwarddev.pluginmap
+++ b/packages/rkwarddev/inst/rkward/rkwarddev.pluginmap
@@ -2,10 +2,10 @@
 
 <document 
   base_prefix=""
-  namespace="CreateRKWardpluginskeleton"
-  id="CreateRKWardpluginskeleton_rkward"
-  po_id="CreateRKWardpluginskeleton_rkward"
+  namespace="CreateRKWardpluginscript"
+  id="CreateRKWardpluginscript_rkward"
+  po_id="CreateRKWardpluginscript_rkward"
   priority="medium"
 >
-	<include file="RKWardPluginSkeleton.pluginmap" />
+	<include file="RKWardPluginScript.pluginmap" />
 </document>



More information about the rkward-tracker mailing list