Commit 653c3e35 authored by m.eik michalke's avatar m.eik michalke
Browse files

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
parent 228faff3
......@@ -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
......
......@@ -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 <- ""
}
......
......@@ -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@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"))
}
......
<!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 (&gt;= 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>
......
......@@ -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(){
......
......@@ -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>
......
......@@ -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" />
......
......@@ -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>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment