1 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2 // Copyright (C) 2009 - DIGITEO - Vincent COUVERT
3 // Copyright (C) 2010 - DIGITEO - Pierre MARECHAL
4 // Copyright (C) 2012 - DIGITEO - Allan CORNET
5 // Copyright (C) 2014 - Scilab Enterprises - Antoine ELIAS
7 // Copyright (C) 2012 - 2016 - Scilab Enterprises
9 // This file is hereby licensed under the terms of the GNU GPL v2.0,
10 // pursuant to article 5.3.4 of the CeCILL v.2.1.
11 // This file was originally licensed under the terms of the CeCILL v2.1,
12 // and continues to be available under such terms.
13 // For more information, see the COPYING file which you should have received
14 // along with this program.
24 "dockable", "off" , ...
25 "infobar_visible", "off", ...
26 "toolbar_visible", "off", ...
27 "toolbar", "none", ...
28 "menubar_visible", "on", ...
29 "menubar", "none", ...
30 "default_axes", "off", ...
31 "tag", "atomsFigure", ...
33 "icon", "software-update-notinstalled", ...
34 "position", [0 0 figwidth figheight], ...
41 // Menu File:Installed Modules
44 "callback", "cbAtomsGui", ...
47 // Menu File:Update List of Packages
50 "callback", "xinfo(_(''Updating the list of packages. Please wait... until Done.''));" + ...
51 "atomsSystemUpdate();" + ...
52 "xinfo(_(''Update done.''));" , ...
53 "tag", "updatePackages");
58 "callback", "cbAtomsGui", ...
66 // Menu ?:Atoms Help...
69 "callback", "cbAtomsGui", ...
72 MainFrame = uicontrol(f, ...
74 "background", [1 1 1], ...
76 MainFrame.layout_options = createLayoutOptions("border", [5, 5]);
77 MainFrame.layout = "border";
79 //Left frame + listbox
80 LeftFrame = uicontrol(MainFrame, ...
82 "background", [1 1 1], ...
83 "border", createBorder("titled", createBorder("line", "black", 1), ""), ...
84 "constraints", createConstraints("border", "left", [300 0]), ...
86 LeftFrame.layout = "border";
89 LeftListbox = uicontrol(LeftFrame, ...
90 "Style" , "listbox", ...
91 "FontSize", defaultFontSize, ...
93 "Callback", "cbAtomsGui", ...
94 "Tag", "LeftListbox");
97 LayerFrame = uicontrol(MainFrame, ...
99 "constraints", createConstraints("border", "center"), ...
100 "tag", "LayerFrame");
102 //1st layer, description module
103 DescFrame = uicontrol(LayerFrame, ...
104 "style", "frame", ...
105 "background", [1 1 1], ...
106 "border", createBorder("titled", createBorder("line", "black", 1), "", "", "", createBorderFont("", 14, "normal")), ...
107 "layout", "border", ...
110 Desc = uicontrol(DescFrame, ...
112 "background", [1 1 1], ...
113 "FontSize", defaultFontSize, ...
119 ButtonFrame = uicontrol(DescFrame, ...
120 "style", "frame", ...
121 "backgroundcolor", [1 1 1], ...
122 "constraints", createConstraints("border", "bottom"));
123 ButtonFrame.layout_options = createLayoutOptions("grid", [1 4], [20, 0]);
124 ButtonFrame.layout = "grid";
126 backButton = uicontrol(ButtonFrame, ...
127 "Style" , "pushbutton", ...
128 "Callback", "cbAtomsGui", ...
130 "Tag", "backButton");
132 removeButton = uicontrol(ButtonFrame, ...
133 "Style" , "pushbutton", ...
134 "Callback", "cbAtomsGui", ...
136 "Tag", "removeButton");
138 installButton = uicontrol(ButtonFrame, ...
139 "Style" , "pushbutton", ...
140 "Callback", "cbAtomsGui", ...
142 "Tag", "installButton");
144 autoloadCheck = uicontrol(ButtonFrame, ...
145 "Style" , "checkbox", ...
146 "background", [1 1 1], ...
147 "Callback", "cbAtomsGui", ...
149 "Tag", "autoloadCheck");
151 //2nd layer, installed modules
152 HomeFrame = uicontrol(LayerFrame, ...
153 "style", "frame", ...
154 "background", [1 1 1], ...
155 "border", createBorder("titled", createBorder("line", "black", 1), ""), ...
156 "layout", "border", ...
159 HomeListbox = uicontrol(HomeFrame,..
160 "Style", "listbox",..
161 "Background", [1 1 1],..
162 "FontSize", defaultFontSize,..
163 "Callback", "cbAtomsGui", ..
164 "Tag", "HomeListbox");
167 msgFrame = uicontrol(MainFrame, ...
168 "style", "frame", ...
169 "Background", [1 1 1], ...
170 "layout", "border", ...
171 "border", createBorder("titled", createBorder("line", "black", 1), ""), ...
172 "constraints", createConstraints("border", "bottom", [0, 40]), ...
173 "margins", [5 5 5 5], ...
176 msgText = uicontrol(msgFrame, ...
178 "HorizontalAlignment", "center", ...
179 "VerticalAlignment", "middle", ...
180 "FontSize", defaultFontSize, ...
181 "Background", [1 1 1], ...
184 saveGui(f, SCI + "/modules/atoms/gui/atomsGui.xml");
188 if ~isempty(get("atomsFigure")) then
189 // Get focus on the GUI
190 fig = get("atomsFigure");
195 if ~ exists("atomsinternalslib") then
196 load("SCI/modules/atoms/macros/atoms_internals/lib");
201 errStatus = execstr("allModules = atomsDESCRIPTIONget();", "errcatch");
203 if errStatus<>0 | size(allModules, "*") == 0 then
204 if size(atomsRepositoryList(),"*") > 0 then
205 messagebox(gettext("No ATOMS module is available. Please, check your Internet connection or make sure that your OS is compatible with ATOMS."), gettext("ATOMS error"), "error");
207 messagebox(gettext("No ATOMS module is available: your repository list is empty."), gettext("ATOMS error"), "error");
212 atomsfig = loadGui(SCI + "/modules/atoms/gui/atomsGui.xml");
213 set("atomsFigure", "userdata", allModules);
215 // Build the module list (listbox on the left)
216 LeftElements = atomsGetLeftListboxElts("filter:main");
218 //localized title/menu
221 set("home", "label", _("File"));
222 set("homeMenu", "label", _("Installed modules"));
223 set("updatePackages", "label", _("Update List of Packages"));
224 set("closeMenu", "label", _("Close"));
225 set("help", "label", _("?"));
226 set("helpMenu", "label", _("Atoms Help..."));
228 set("LeftFrame", "UserData", "filter:main");
230 set("atomsFigure", "figure_name", LeftElements("title")+" - ATOMS");
232 set("LeftListbox", "string", LeftElements("items_str"));
233 set("LeftListbox", "userdata", LeftElements("items_mat"));
235 set("backButton", "String", _("Back"));
236 set("removeButton", "String", _("Remove"));
237 set("installButton", "String", _("Install"));
238 set("autoloadCheck", "String", _("Autoload"), "TooltipString", _("Autoload"));
241 homeFrame = get("HomeFrame");
242 homFrame.border.title = _("List of installed modules");
244 // Build the installed module list
245 HomeElements = atomsGetHomeListboxElts();
247 //Update Installed Toolbox Listbox
248 set("HomeListbox", "String", HomeElements("items_str"));
249 set("HomeListbox", "UserData", HomeElements("items_mat"));
250 set("atomsFigure", "visible", "on");
251 set("atomsFigure", "resizefcn", "atomsResize");