1 # ---------------------------------------------------------------------
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
9 # This software is governed by the CeCILL-B license under French law and
10 # abiding by the rules of distribution of free software. You can use,
11 # modify and/ or redistribute the software under the terms of the CeCILL-B
12 # license as circulated by CEA, CNRS and INRIA at the following URL
13 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
14 # or in the file LICENSE.txt.
16 # As a counterpart to the access to the source code and rights to copy,
17 # modify and redistribute granted by the license, users are provided only
18 # with a limited warranty and the software's author, the holder of the
19 # economic rights, and the successive licensors have only limited
22 # The fact that you are presently reading this means that you have had
23 # knowledge of the CeCILL-B license and that you accept its terms.
24 # ------------------------------------------------------------------------ */
27 description "Creates a new bbtk package file structure on disk (Graphical user interface for the shell script bbCreatePackage)."
28 author "laurent.guigues@creatis.insa-lyon.fr"
35 new DirectorySelector dir
36 set dir.Message "Select the location of your new package"
38 #-----------------------------------------------------------------------------
39 new OutputText dirOutput
40 connect dir.Out dirOutput.In
42 new OutputText windowTitle
43 set windowTitle.In "Create new package folder in :"
46 set name.Title "Name (1 word)"
47 set name.In "PACKAGE_NAME"
50 set author.Title "Author(s) "
51 set author.In "_author_"
53 new InputText description
54 set description.Title "Description (html format)"
55 set description.In "_description_"
57 #new CommandButton cancelButton
58 # set cancelButton.In "print **CANCEL**"
59 # set cancelButton.Label "Cancel"
61 new CommandButton createButton
62 set createButton.In "print $concatStr.Out$; exec command; exec Box02;"
63 set createButton.Label "Run"
66 new LayoutLine buttons
67 set buttons.Orientation Horizontal
68 # connect cancelButton.Widget buttons.Widget1
69 connect createButton.Widget buttons.Widget2
72 connect windowTitle.Widget main.Widget1
73 connect dirOutput.Widget main.Widget2
74 connect name.Widget main.Widget3
75 connect author.Widget main.Widget4
76 connect description.Widget main.Widget5
77 connect buttons.Widget main.Widget6
78 set main.WinTitle "Create new black box package"
79 # set main.WinDialog true
81 set main.WinHeight 400
83 new MultipleInputs close
84 connect close.Out main.WinClose
85 # connect cancelButton.BoxChange close.In1
86 connect createButton.BoxChange close.In2
88 #-----------------------------------------------------------------------------
89 new Configuration conf
90 # on windows : enclose paths between double quotes
91 # if system==0 (Linux) dquote=space (ascci code 32)
92 # if system==1 (Win) dquote==" (ascii code 34)
93 new StringSelect onsystem
97 connect conf.SystemType onsystem.In
98 connect onsystem.Out dquote.In
101 new ConcatStrings dirStr
103 connect dquote.Out dirStr.In2
104 connect dir.Out dirStr.In3
105 connect dquote.Out dirStr.In4
108 new ConcatStrings nameStr
110 connect name.Out nameStr.In2
113 new ConcatStrings authorStr
114 set authorStr.In1 " '"
115 connect author.Out authorStr.In2
116 set authorStr.In3 "' "
118 new ConcatStrings descriptionStr
119 set descriptionStr.In1 " '"
120 connect description.Out descriptionStr.In2
121 set descriptionStr.In3 "' "
125 new ConcatStrings concatStrCommand
126 set concatStrCommand.In1 " "
127 #EED-20-02-2012 connect dquote.Out concatStrCommand.In2
128 #EED-20-02-2012 connect conf.BinPath concatStrCommand.In3
129 #EED-20-02-2012 connect conf.FileSeparator concatStrCommand.In4
130 set concatStrCommand.In5 "bbCreatePackage"
131 #EED-20-02-2012 connect dquote.Out concatStrCommand.In6
132 set concatStrCommand.In7 " "
134 new ConcatStrings concatStr
135 #EED-20-02-2012 connect dquote.Out concatStr.In1
136 connect concatStrCommand.Out concatStr.In2
137 connect dirStr.Out concatStr.In3
138 connect nameStr.Out concatStr.In4
139 connect authorStr.Out concatStr.In5
140 connect descriptionStr.Out concatStr.In6
141 #EED-20-02-2012 connect dquote.Out concatStr.In7
143 new ExecSystemCommand command
144 connect concatStr.Out command.In
147 #new OutputText FinalMessage
148 #set FinalMessage.WinWidth 100
149 #set FinalMessage.WinHeight 100
150 #set FinalMessage.In "Done !"
154 ## ------------------------------------------------
156 set Box01.In " OK... Package created..."
157 set Box01.WinDialog true
158 set Box01.WinHeight 100
159 set Box01.WinTitle Confirmation
160 set Box01.WinWidth 400
163 set Box02.WinDialog true
164 set Box02.WinHeight 200
165 set Box02.WinTitle Confirmation
166 set Box02.WinWidth 400
167 connect Box01.Widget Box02.Widget2
170 connect Box03.Widget Box02.Widget1