summaryrefslogtreecommitdiffstats
path: root/scilab/modules
diff options
context:
space:
mode:
authorPierre MARECHAL <pierre.marechal@scilab.org>2010-05-12 15:11:22 +0200
committerClément DAVID <clement.david@scilab.org>2010-05-18 15:51:03 +0200
commit51fdbcfbcd17d4b7b0ef0fb03dd2847b849945e6 (patch)
tree284838f84fc5c5a3d0d4675c0ddb47615650b1a0 /scilab/modules
parentddaeea478eb06e4e7132aa1886b900e400787152 (diff)
downloadscilab-51fdbcfbcd17d4b7b0ef0fb03dd2847b849945e6.zip
scilab-51fdbcfbcd17d4b7b0ef0fb03dd2847b849945e6.tar.gz
* ATOMS GUI: When a module is not up-to-date, a warning is displayed on the
corresponding sheet. * bug 6842 fixed - If the installed version of a module was not the most recent one, the ATOMS GUI claimed that the newest version was installed. Change-Id: Ib5174d5509abad45c2ac80ce534a5a1769a02e46
Diffstat (limited to 'scilab/modules')
-rw-r--r--scilab/modules/atoms/Makefile.am4
-rw-r--r--scilab/modules/atoms/Makefile.in4
-rwxr-xr-xscilab/modules/atoms/images/icons/notuptodate.pngbin0 -> 1181 bytes
-rw-r--r--scilab/modules/atoms/images/icons/software-update-available.pngbin0 -> 740 bytes
-rw-r--r--scilab/modules/atoms/locales/en_US/atoms.pot79
-rw-r--r--scilab/modules/atoms/locales/fr_FR/atoms.po6
-rw-r--r--scilab/modules/atoms/macros/atoms_gui/atomsGui.sci67
-rw-r--r--scilab/modules/atoms/macros/atoms_gui/cbAtomsGui.sci55
-rw-r--r--scilab/modules/atoms/tests/nonreg_tests/bug_6842.tst32
9 files changed, 189 insertions, 58 deletions
diff --git a/scilab/modules/atoms/Makefile.am b/scilab/modules/atoms/Makefile.am
index 270a852..7ca7a06 100644
--- a/scilab/modules/atoms/Makefile.am
+++ b/scilab/modules/atoms/Makefile.am
@@ -23,6 +23,8 @@ MACROSDIRSEXT = macros/atoms_internals macros/atoms_gui
23#### atoms : icons files #### 23#### atoms : icons files ####
24libsciatoms_la_iconsdir=$(mydatadir)/ 24libsciatoms_la_iconsdir=$(mydatadir)/
25nobase_libsciatoms_la_icons_DATA = images/icons/installed.png \ 25nobase_libsciatoms_la_icons_DATA = images/icons/installed.png \
26images/icons/notinstalled.png 26images/icons/notinstalled.png \
27images/icons/notuptodate.png \
28images/icons/software-update-available.png
27 29
28include $(top_srcdir)/Makefile.incl.am 30include $(top_srcdir)/Makefile.incl.am
diff --git a/scilab/modules/atoms/Makefile.in b/scilab/modules/atoms/Makefile.in
index 6714ebc..4359d01 100644
--- a/scilab/modules/atoms/Makefile.in
+++ b/scilab/modules/atoms/Makefile.in
@@ -369,7 +369,9 @@ MACROSDIRSEXT = macros/atoms_internals macros/atoms_gui
369#### atoms : icons files #### 369#### atoms : icons files ####
370libsciatoms_la_iconsdir = $(mydatadir)/ 370libsciatoms_la_iconsdir = $(mydatadir)/
371nobase_libsciatoms_la_icons_DATA = images/icons/installed.png \ 371nobase_libsciatoms_la_icons_DATA = images/icons/installed.png \
372images/icons/notinstalled.png 372images/icons/notinstalled.png \
373images/icons/notuptodate.png \
374images/icons/software-update-available.png
373 375
374 376
375# Where all the Scilab stuff is installed (macros, help, ...) 377# Where all the Scilab stuff is installed (macros, help, ...)
diff --git a/scilab/modules/atoms/images/icons/notuptodate.png b/scilab/modules/atoms/images/icons/notuptodate.png
new file mode 100755
index 0000000..7c40430
--- /dev/null
+++ b/scilab/modules/atoms/images/icons/notuptodate.png
Binary files differ
diff --git a/scilab/modules/atoms/images/icons/software-update-available.png b/scilab/modules/atoms/images/icons/software-update-available.png
new file mode 100644
index 0000000..ab8d494
--- /dev/null
+++ b/scilab/modules/atoms/images/icons/software-update-available.png
Binary files differ
diff --git a/scilab/modules/atoms/locales/en_US/atoms.pot b/scilab/modules/atoms/locales/en_US/atoms.pot
index a2e0b39..5730af5 100644
--- a/scilab/modules/atoms/locales/en_US/atoms.pot
+++ b/scilab/modules/atoms/locales/en_US/atoms.pot
@@ -14,7 +14,7 @@ msgstr ""
14"MIME-Version: 1.0\n" 14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=ISO-8859-1\n" 15"Content-Type: text/plain; charset=ISO-8859-1\n"
16"Content-Transfer-Encoding: 8bit\n" 16"Content-Transfer-Encoding: 8bit\n"
17"Revision-Date: 2010-05-18 15:11+0100\n" 17"Revision-Date: 2010-05-18 15:22+0100\n"
18 18
19# File: macros/atomsAutoloadAdd.sci, line: 168 19# File: macros/atomsAutoloadAdd.sci, line: 168
20# File: macros/atomsAutoloadAdd.sci, line: 173 20# File: macros/atomsAutoloadAdd.sci, line: 173
@@ -751,7 +751,7 @@ msgstr ""
751msgid "%s: Wrong value for input argument #%d: ''%s'' is not a valid URL.\n" 751msgid "%s: Wrong value for input argument #%d: ''%s'' is not a valid URL.\n"
752msgstr "" 752msgstr ""
753# 753#
754# File: macros/atoms_gui/cbAtomsGui.sci, line: 135 754# File: macros/atoms_gui/cbAtomsGui.sci, line: 134
755#, c-format 755#, c-format
756msgid "%s: Wrong value for input argument #%d: ''%s'' or ''%s'' expected.\n" 756msgid "%s: Wrong value for input argument #%d: ''%s'' or ''%s'' expected.\n"
757msgstr "" 757msgstr ""
@@ -974,47 +974,52 @@ msgstr ""
974msgid "%s: the package ''%s'' doesn''t exist.\n" 974msgid "%s: the package ''%s'' doesn''t exist.\n"
975msgstr "" 975msgstr ""
976# 976#
977# File: macros/atoms_gui/atomsGui.sci, line: 69 977# File: macros/atoms_gui/atomsGui.sci, line: 73
978msgid "&?" 978msgid "&?"
979msgstr "" 979msgstr ""
980# 980#
981# File: macros/atoms_gui/atomsGui.sci, line: 68 981# File: macros/atoms_gui/atomsGui.sci, line: 72
982msgid "&Edit" 982msgid "&Edit"
983msgstr "" 983msgstr ""
984# 984#
985# File: macros/atoms_gui/atomsGui.sci, line: 66 985# File: macros/atoms_gui/atomsGui.sci, line: 70
986msgid "&File" 986msgid "&File"
987msgstr "" 987msgstr ""
988# 988#
989# File: macros/atoms_gui/atomsGui.sci, line: 67 989# File: macros/atoms_gui/atomsGui.sci, line: 71
990msgid "&Tools" 990msgid "&Tools"
991msgstr "" 991msgstr ""
992# 992#
993# File: macros/atoms_gui/atomsGui.sci, line: 97 993# File: macros/atoms_gui/atomsGui.sci, line: 101
994msgid "?" 994msgid "?"
995msgstr "" 995msgstr ""
996# 996#
997# File: macros/atoms_gui/cbAtomsGui.sci, line: 62 997# File: macros/atoms_gui/cbAtomsGui.sci, line: 290
998# File: macros/atoms_gui/cbAtomsGui.sci, line: 72 998#, c-format
999# File: macros/atoms_gui/cbAtomsGui.sci, line: 82 999msgid "A new version (''%s'') of ''%s'' is available"
1000# File: macros/atoms_gui/atomsGui.sci, line: 57 1000msgstr ""
1001#
1002# File: macros/atoms_gui/cbAtomsGui.sci, line: 61
1003# File: macros/atoms_gui/cbAtomsGui.sci, line: 71
1004# File: macros/atoms_gui/cbAtomsGui.sci, line: 81
1005# File: macros/atoms_gui/atomsGui.sci, line: 61
1001msgid "Atoms" 1006msgid "Atoms"
1002msgstr "" 1007msgstr ""
1003# 1008#
1004# File: macros/atoms_gui/atomsGui.sci, line: 102 1009# File: macros/atoms_gui/atomsGui.sci, line: 106
1005msgid "Atoms Help..." 1010msgid "Atoms Help..."
1006msgstr "" 1011msgstr ""
1007# 1012#
1008# File: macros/atoms_gui/cbAtomsGui.sci, line: 60 1013# File: macros/atoms_gui/cbAtomsGui.sci, line: 59
1009# File: macros/atoms_gui/cbAtomsGui.sci, line: 70 1014# File: macros/atoms_gui/cbAtomsGui.sci, line: 69
1010# File: macros/atoms_gui/cbAtomsGui.sci, line: 80 1015# File: macros/atoms_gui/cbAtomsGui.sci, line: 79
1011# File: macros/atoms_gui/atomsGui.sci, line: 23 1016# File: macros/atoms_gui/atomsGui.sci, line: 23
1012# File: macros/atoms_gui/atomsGui.sci, line: 25 1017# File: macros/atoms_gui/atomsGui.sci, line: 25
1013msgid "Atoms error" 1018msgid "Atoms error"
1014msgstr "" 1019msgstr ""
1015# 1020#
1016# File: macros/atomsShow.sci, line: 85 1021# File: macros/atomsShow.sci, line: 85
1017# File: macros/atoms_gui/cbAtomsGui.sci, line: 222 1022# File: macros/atoms_gui/cbAtomsGui.sci, line: 234
1018msgid "Author(s)" 1023msgid "Author(s)"
1019msgstr "" 1024msgstr ""
1020# 1025#
@@ -1022,7 +1027,7 @@ msgstr ""
1022msgid "Automatically Installed" 1027msgid "Automatically Installed"
1023msgstr "" 1028msgstr ""
1024# 1029#
1025# File: macros/atoms_gui/cbAtomsGui.sci, line: 320 1030# File: macros/atoms_gui/cbAtomsGui.sci, line: 329
1026msgid "Bytes" 1031msgid "Bytes"
1027msgstr "" 1032msgstr ""
1028# 1033#
@@ -1030,7 +1035,7 @@ msgstr ""
1030msgid "Category(ies)" 1035msgid "Category(ies)"
1031msgstr "" 1036msgstr ""
1032# 1037#
1033# File: macros/atoms_gui/atomsGui.sci, line: 90 1038# File: macros/atoms_gui/atomsGui.sci, line: 94
1034msgid "Close" 1039msgid "Close"
1035msgstr "" 1040msgstr ""
1036# 1041#
@@ -1039,11 +1044,11 @@ msgid "Depend"
1039msgstr "" 1044msgstr ""
1040# 1045#
1041# File: macros/atomsShow.sci, line: 99 1046# File: macros/atomsShow.sci, line: 99
1042# File: macros/atoms_gui/cbAtomsGui.sci, line: 244 1047# File: macros/atoms_gui/cbAtomsGui.sci, line: 256
1043msgid "Description" 1048msgid "Description"
1044msgstr "" 1049msgstr ""
1045# 1050#
1046# File: macros/atoms_gui/cbAtomsGui.sci, line: 207 1051# File: macros/atoms_gui/cbAtomsGui.sci, line: 219
1047msgid "Download size" 1052msgid "Download size"
1048msgstr "" 1053msgstr ""
1049# 1054#
@@ -1051,15 +1056,15 @@ msgstr ""
1051msgid "Entity" 1056msgid "Entity"
1052msgstr "" 1057msgstr ""
1053# 1058#
1054# File: macros/atoms_gui/atomsGui.sci, line: 78 1059# File: macros/atoms_gui/atomsGui.sci, line: 82
1055msgid "File" 1060msgid "File"
1056msgstr "" 1061msgstr ""
1057# 1062#
1058# File: macros/atoms_gui/atomsGui.sci, line: 83 1063# File: macros/atoms_gui/atomsGui.sci, line: 87
1059msgid "Home" 1064msgid "Home"
1060msgstr "" 1065msgstr ""
1061# 1066#
1062# File: macros/atoms_gui/atomsGui.sci, line: 288 1067# File: macros/atoms_gui/atomsGui.sci, line: 315
1063msgid "Install" 1068msgid "Install"
1064msgstr "" 1069msgstr ""
1065# 1070#
@@ -1067,15 +1072,15 @@ msgstr ""
1067msgid "Install Directory" 1072msgid "Install Directory"
1068msgstr "" 1073msgstr ""
1069# 1074#
1070# File: macros/atoms_gui/cbAtomsGui.sci, line: 62 1075# File: macros/atoms_gui/cbAtomsGui.sci, line: 61
1071msgid "Installation done! Please restart Scilab to take changes into account." 1076msgid "Installation done! Please restart Scilab to take changes into account."
1072msgstr "" 1077msgstr ""
1073# 1078#
1074# File: macros/atoms_gui/cbAtomsGui.sci, line: 60 1079# File: macros/atoms_gui/cbAtomsGui.sci, line: 59
1075msgid "Installation failed!" 1080msgid "Installation failed!"
1076msgstr "" 1081msgstr ""
1077# 1082#
1078# File: macros/atoms_gui/cbAtomsGui.sci, line: 323 1083# File: macros/atoms_gui/cbAtomsGui.sci, line: 332
1079msgid "KB" 1084msgid "KB"
1080msgstr "" 1085msgstr ""
1081# 1086#
@@ -1083,12 +1088,12 @@ msgstr ""
1083msgid "License" 1088msgid "License"
1084msgstr "" 1089msgstr ""
1085# 1090#
1086# File: macros/atoms_gui/atomsGui.sci, line: 251 1091# File: macros/atoms_gui/atomsGui.sci, line: 278
1087# File: macros/atoms_gui/atomsGui.sci, line: 325 1092# File: macros/atoms_gui/atomsGui.sci, line: 352
1088msgid "List of installed modules" 1093msgid "List of installed modules"
1089msgstr "" 1094msgstr ""
1090# 1095#
1091# File: macros/atoms_gui/cbAtomsGui.sci, line: 326 1096# File: macros/atoms_gui/cbAtomsGui.sci, line: 335
1092msgid "MB" 1097msgid "MB"
1093msgstr "" 1098msgstr ""
1094# 1099#
@@ -1096,7 +1101,7 @@ msgstr ""
1096msgid "Maintainer(s)" 1101msgid "Maintainer(s)"
1097msgstr "" 1102msgstr ""
1098# 1103#
1099# File: macros/atoms_gui/atomsGui.sci, line: 206 1104# File: macros/atoms_gui/atomsGui.sci, line: 233
1100msgid "Modules" 1105msgid "Modules"
1101msgstr "" 1106msgstr ""
1102# 1107#
@@ -1112,15 +1117,15 @@ msgstr ""
1112msgid "Package" 1117msgid "Package"
1113msgstr "" 1118msgstr ""
1114# 1119#
1115# File: macros/atoms_gui/atomsGui.sci, line: 278 1120# File: macros/atoms_gui/atomsGui.sci, line: 305
1116msgid "Remove" 1121msgid "Remove"
1117msgstr "" 1122msgstr ""
1118# 1123#
1119# File: macros/atoms_gui/cbAtomsGui.sci, line: 72 1124# File: macros/atoms_gui/cbAtomsGui.sci, line: 71
1120msgid "Remove done! Please restart Scilab to take changes into account. " 1125msgid "Remove done! Please restart Scilab to take changes into account. "
1121msgstr "" 1126msgstr ""
1122# 1127#
1123# File: macros/atoms_gui/cbAtomsGui.sci, line: 70 1128# File: macros/atoms_gui/cbAtomsGui.sci, line: 69
1124msgid "Remove failed!" 1129msgid "Remove failed!"
1125msgstr "" 1130msgstr ""
1126# 1131#
@@ -1140,20 +1145,20 @@ msgstr ""
1140msgid "Title" 1145msgid "Title"
1141msgstr "" 1146msgstr ""
1142# 1147#
1143# File: macros/atoms_gui/atomsGui.sci, line: 298 1148# File: macros/atoms_gui/atomsGui.sci, line: 325
1144msgid "Update" 1149msgid "Update"
1145msgstr "" 1150msgstr ""
1146# 1151#
1147# File: macros/atoms_gui/cbAtomsGui.sci, line: 82 1152# File: macros/atoms_gui/cbAtomsGui.sci, line: 81
1148msgid "Update done! Please restart Scilab to take changes into account." 1153msgid "Update done! Please restart Scilab to take changes into account."
1149msgstr "" 1154msgstr ""
1150# 1155#
1151# File: macros/atoms_gui/cbAtomsGui.sci, line: 80 1156# File: macros/atoms_gui/cbAtomsGui.sci, line: 79
1152msgid "Update failed!" 1157msgid "Update failed!"
1153msgstr "" 1158msgstr ""
1154# 1159#
1155# File: macros/atomsShow.sci, line: 82 1160# File: macros/atomsShow.sci, line: 82
1156# File: macros/atoms_gui/cbAtomsGui.sci, line: 239 1161# File: macros/atoms_gui/cbAtomsGui.sci, line: 251
1157msgid "Version" 1162msgid "Version"
1158msgstr "" 1163msgstr ""
1159# 1164#
diff --git a/scilab/modules/atoms/locales/fr_FR/atoms.po b/scilab/modules/atoms/locales/fr_FR/atoms.po
index 3aa2883..51a5138 100644
--- a/scilab/modules/atoms/locales/fr_FR/atoms.po
+++ b/scilab/modules/atoms/locales/fr_FR/atoms.po
@@ -634,6 +634,12 @@ msgstr "&Outils"
634msgid "?" 634msgid "?"
635msgstr "?" 635msgstr "?"
636 636
637#
638# File: macros/atoms_gui/cbAtomsGui.sci, line: 290
639#, c-format
640msgid "A new version (''%s'') of ''%s'' is available"
641msgstr ""
642
637msgid "Atoms" 643msgid "Atoms"
638msgstr "Atoms" 644msgstr "Atoms"
639 645
diff --git a/scilab/modules/atoms/macros/atoms_gui/atomsGui.sci b/scilab/modules/atoms/macros/atoms_gui/atomsGui.sci
index 7a3be5c..1e0ec60 100644
--- a/scilab/modules/atoms/macros/atoms_gui/atomsGui.sci
+++ b/scilab/modules/atoms/macros/atoms_gui/atomsGui.sci
@@ -38,6 +38,10 @@ function atomsGui()
38 margin = 10; 38 margin = 10;
39 widgetHeight = 25; 39 widgetHeight = 25;
40 40
41 // Message Frame
42 msgWidth = figwidth -2*margin;
43 msgHeight = 30;
44
41 // Button 45 // Button
42 buttonHeight = 20; 46 buttonHeight = 20;
43 47
@@ -115,8 +119,19 @@ function atomsGui()
115 vers = getfield(1, allModules(modulesNames(k))); 119 vers = getfield(1, allModules(modulesNames(k)));
116 vers = vers(3); 120 vers = vers(3);
117 121
118 if atomsIsInstalled([modulesNames(k) vers]) then 122 if atomsIsInstalled(modulesNames(k)) then
119 icon = "installed.png"; 123
124 MRVersionAvailable = atomsGetMRVersion(modulesNames(k));
125 MRVersionInstalled = atomsVersionSort(atomsGetInstalledVers(modulesNames(k)),"DESC");
126 MRVersionInstalled = MRVersionInstalled(1);
127 if atomsVersionCompare(MRVersionInstalled,MRVersionAvailable) == -1 then
128 // Not up-to-date
129 icon = "notuptodate.png";
130 else
131 // The Most Recent Version is already installed
132 icon = "installed.png";
133 end
134
120 else 135 else
121 icon = "notinstalled.png"; 136 icon = "notinstalled.png";
122 end 137 end
@@ -151,6 +166,17 @@ function atomsGui()
151 166
152 for k=1:size(installed(:,1), "*") 167 for k=1:size(installed(:,1), "*")
153 168
169 MRVersionAvailable = atomsGetMRVersion(installed(k,1));
170 MRVersionInstalled = atomsVersionSort(atomsGetInstalledVers(installed(k,1)),"DESC");
171 MRVersionInstalled = MRVersionInstalled(1);
172 if atomsVersionCompare(MRVersionInstalled,MRVersionAvailable) == -1 then
173 // Not up-to-date
174 icon = "notuptodate.png";
175 else
176 // The Most Recent Version is already installed
177 icon = "installed.png";
178 end
179
154 if modulo(k,2) == 0 then 180 if modulo(k,2) == 0 then
155 background = "#eeeeee"; 181 background = "#eeeeee";
156 else 182 else
@@ -158,8 +184,9 @@ function atomsGui()
158 end 184 end
159 185
160 thisItem = "<html>"; 186 thisItem = "<html>";
187
161 thisItem = thisItem + "<table style=""background-color:"+background+";color:#000000;"" ><tr>"; 188 thisItem = thisItem + "<table style=""background-color:"+background+";color:#000000;"" ><tr>";
162 thisItem = thisItem + "<td><img src=""file:///"+SCI+"/modules/atoms/images/icons/installed.png"" /></td>"; 189 thisItem = thisItem + "<td><img src=""file:///"+SCI+"/modules/atoms/images/icons/"+icon+""" /></td>";
163 thisItem = thisItem + "<td>"; 190 thisItem = thisItem + "<td>";
164 thisItem = thisItem + " <div style=""width:385px;text-align:left;"">"; 191 thisItem = thisItem + " <div style=""width:385px;text-align:left;"">";
165 thisItem = thisItem + " <span style=""font-weight:bold;"">"+allModules(installed(k,1))(installed(k,2)).Title+" "+installed(k,2)+"</span><br />"; 192 thisItem = thisItem + " <span style=""font-weight:bold;"">"+allModules(installed(k,1))(installed(k,2)).Title+" "+installed(k,2)+"</span><br />";
@@ -184,7 +211,7 @@ function atomsGui()
184 listboxWidth = 200; 211 listboxWidth = 200;
185 listboxFrameWidth = listboxWidth + 2*margin; 212 listboxFrameWidth = listboxWidth + 2*margin;
186 213
187 listboxFrameHeight = figheight- 2*margin; 214 listboxFrameHeight = figheight- 3*margin - msgHeight;
188 listboxHeight = listboxFrameHeight - 3*margin; 215 listboxHeight = listboxFrameHeight - 3*margin;
189 216
190 // Frame 217 // Frame
@@ -192,7 +219,7 @@ function atomsGui()
192 "Parent" , atomsfig,.. 219 "Parent" , atomsfig,..
193 "Style" , "frame",.. 220 "Style" , "frame",..
194 "Relief" , "solid",.. 221 "Relief" , "solid",..
195 "Position" , [margin margin listboxFrameWidth listboxFrameHeight],.. 222 "Position" , [margin widgetHeight+2*margin listboxFrameWidth listboxFrameHeight],..
196 "Background" , [1 1 1],.. 223 "Background" , [1 1 1],..
197 "Tag" , "LeftFrame"); 224 "Tag" , "LeftFrame");
198 225
@@ -237,7 +264,7 @@ function atomsGui()
237 "Style" , "frame",.. 264 "Style" , "frame",..
238 "Relief" , "solid",.. 265 "Relief" , "solid",..
239 "Background" , [1 1 1],.. 266 "Background" , [1 1 1],..
240 "Position" , [listboxFrameWidth+2*margin margin descFrameWidth descFrameHeight],.. 267 "Position" , [listboxFrameWidth+2*margin widgetHeight+2*margin descFrameWidth descFrameHeight],..
241 "Tag" , "DescFrame", .. 268 "Tag" , "DescFrame", ..
242 "Visible" , "off"); 269 "Visible" , "off");
243 270
@@ -301,7 +328,7 @@ function atomsGui()
301 "Tag" , "updateButton"); 328 "Tag" , "updateButton");
302 329
303 // Home: List of installed modules 330 // Home: List of installed modules
304 // ============================================================================= 331 // =========================================================================
305 332
306 descWidth = descFrameWidth - 2*margin; 333 descWidth = descFrameWidth - 2*margin;
307 descHeight = descFrameHeight - 3*margin; 334 descHeight = descFrameHeight - 3*margin;
@@ -312,7 +339,7 @@ function atomsGui()
312 "Style" , "frame",.. 339 "Style" , "frame",..
313 "Relief" , "solid",.. 340 "Relief" , "solid",..
314 "Background" , [1 1 1],.. 341 "Background" , [1 1 1],..
315 "Position" , [listboxFrameWidth+2*margin margin descFrameWidth descFrameHeight],.. 342 "Position" , [listboxFrameWidth+2*margin widgetHeight+2*margin descFrameWidth descFrameHeight],..
316 "Tag" , "HomeFrame"); 343 "Tag" , "HomeFrame");
317 344
318 // Frame title 345 // Frame title
@@ -341,4 +368,28 @@ function atomsGui()
341 "Max" , 1, .. 368 "Max" , 1, ..
342 "Tag" , "HomeListbox"); 369 "Tag" , "HomeListbox");
343 370
371 // Message Frame
372 // =========================================================================
373
374 // Frame
375 msgFrame = uicontrol( ..
376 "Parent" , atomsfig,..
377 "Style" , "frame",..
378 "Relief" , "solid",..
379 "Background" , [1 1 1],..
380 "Position" , [margin margin msgWidth msgHeight],..
381 "Tag" , "msgFrame");
382
383 // Text
384 msgText = uicontrol( ..
385 "Parent" , msgFrame,...
386 "Style" , "text",..
387 "HorizontalAlignment", "left",..
388 "VerticalAlignment" , "middle",..
389 "String" , "", ..
390 "FontSize" , 12,..
391 "Background" , [1 1 1],..
392 "Position" , [2 2 msgWidth-10 msgHeight-4],..
393 "Tag" , "msgText");
394
344endfunction 395endfunction
diff --git a/scilab/modules/atoms/macros/atoms_gui/cbAtomsGui.sci b/scilab/modules/atoms/macros/atoms_gui/cbAtomsGui.sci
index a260bdf..322ff6ae 100644
--- a/scilab/modules/atoms/macros/atoms_gui/cbAtomsGui.sci
+++ b/scilab/modules/atoms/macros/atoms_gui/cbAtomsGui.sci
@@ -22,7 +22,6 @@ function cbAtomsGui()
22 // Get the description frame object 22 // Get the description frame object
23 DescFrame = findobj("tag","DescFrame"); 23 DescFrame = findobj("tag","DescFrame");
24 24
25
26 // Display selected module informations 25 // Display selected module informations
27 // ========================================================================= 26 // =========================================================================
28 27
@@ -189,14 +188,27 @@ function updateDescFrame()
189 allModules = get(thisFigure,"userdata"); 188 allModules = get(thisFigure,"userdata");
190 thisModuleName = get(DescFrame ,"userdata"); 189 thisModuleName = get(DescFrame ,"userdata");
191 190
191 // Reset the message frame
192 // =========================================================================
193 set(findobj("tag","msgText"),"String","");
194
192 // Get the module details 195 // Get the module details
193 // ========================================================================= 196 // =========================================================================
194 197
195 modulesNames = getfield(1, allModules); 198 modulesNames = getfield(1, allModules);
196 modulesNames (1:2) = []; 199 modulesNames (1:2) = [];
197 thisModuleStruct = allModules(thisModuleName); 200 thisModuleStruct = allModules(thisModuleName);
198 thisModuleVersions = getfield(1,thisModuleStruct); 201
199 thisModuleDetails = thisModuleStruct(thisModuleVersions(3)); 202 MRVersionAvailable = atomsGetMRVersion(thisModuleName);
203 MRVersionInstalled = "";
204
205 if atomsIsInstalled(thisModuleName) then
206 MRVersionInstalled = atomsVersionSort(atomsGetInstalledVers(thisModuleName),"DESC");
207 MRVersionInstalled = MRVersionInstalled(1);
208 thisModuleDetails = thisModuleStruct(MRVersionInstalled);
209 else
210 thisModuleDetails = thisModuleStruct(MRVersionAvailable);
211 end
200 212
201 // Manage size 213 // Manage size
202 // ========================================================================= 214 // =========================================================================
@@ -270,15 +282,12 @@ function updateDescFrame()
270 // Tests for update available 282 // Tests for update available
271 // -------------------------- 283 // --------------------------
272 284
273 moduleVersion = atomsGetMRVersion(thisModuleName); 285 canUpdate = "off";
274 installedVersions = atomsGetInstalledVers(thisModuleName);
275 canUpdate = "off";
276 286
277 for k=1:size(installedVersions,"*") 287 if atomsIsInstalled(thisModuleName) & atomsVersionCompare(MRVersionInstalled,MRVersionAvailable) == -1 then
278 if atomsVersionCompare(installedVersions(k), moduleVersion)==-1 then 288 // Not up-to-date
279 canUpdate = "on"; 289 canUpdate = "on";
280 break 290 showWarning(sprintf(gettext("A new version (''%s'') of ''%s'' is available"),MRVersionAvailable,thisModuleDetails.Title));
281 end
282 end 291 end
283 292
284 // Can be removed 293 // Can be removed
@@ -355,6 +364,9 @@ endfunction
355 364
356function showHome() 365function showHome()
357 366
367 // Reset the message frame
368 set(findobj("tag","msgText"),"String","");
369
358 // Hide the Desc frame 370 // Hide the Desc frame
359 hide("DescFrame"); 371 hide("DescFrame");
360 hide("DescTitle"); 372 hide("DescTitle");
@@ -392,3 +404,24 @@ function showDesc()
392 show("updateButton"); 404 show("updateButton");
393 405
394endfunction 406endfunction
407
408
409// =============================================================================
410// showWarning
411// + Update the string in the msg Frame
412// =============================================================================
413
414function showWarning(msg)
415
416 str = "<html>";
417 str = str + "<table><tr>";
418 str = str + "<td><img src=""file:///"+SCI+"/modules/atoms/images/icons/software-update-available.png"" /></td>";
419 str = str + "<td><div style=""color:red;font-style:italic;"">"+msg+"</div></td>";
420 str = str + "</tr></table>";
421 str = str + "</html>";
422
423 msgText = findobj("tag","msgText");
424
425 set(msgText,"String",str);
426
427endfunction
diff --git a/scilab/modules/atoms/tests/nonreg_tests/bug_6842.tst b/scilab/modules/atoms/tests/nonreg_tests/bug_6842.tst
new file mode 100644
index 0000000..4a373f9
--- /dev/null
+++ b/scilab/modules/atoms/tests/nonreg_tests/bug_6842.tst
@@ -0,0 +1,32 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2010 - DIGITEO - Pierre MARECHAL
4//
5// This file is distributed under the same license as the Scilab package.
6// =============================================================================
7
8// <-- TEST WITH ATOMS -->
9// <-- INTERACTIVE TEST -->
10//
11// <-- Non-regression test for bug 6842 -->
12//
13// <-- Bugzilla URL -->
14// http://bugzilla.scilab.org/show_bug.cgi?id=6842
15//
16// <-- Short Description -->
17// When an ATOMS module has several versions and that, e.g. the oldest is
18// installed by using atomsInstall on Scilab's command line, atomsGUI claims
19// that the newest version is installed.
20
21load("SCI/modules/atoms/macros/atoms_internals/lib");
22
23atomsRepositorySetOfl("http://scene11.test.atoms.scilab.org");
24atomsSystemUpdate();
25atomsInstall(["toolbox_4","1.0-1"]);
26if ~atomsIsInstalled("toolbox_4") then pause, end
27atomsGui();
28
29// Check if there is a warning when the description of toolbox_1 is displayed.
30
31atomsRemove("toolbox_1");
32atomsRepositorySetOfl("http://atoms.scilab.org");