...
 
......@@ -46,8 +46,23 @@ tree.colors.lfg = WHITE;
tree.colors.lbg = BG_CYAN;
tree.colors.kfg = LIGHTCYAN;
function find_startup_dir(dir)
{
for (var i in xtrn_area.prog) {
if (!xtrn_area.prog[i].startup_dir)
continue;
var path = backslash(fullpath(xtrn_area.prog[i].startup_dir));
if (path == dir)
return i;
}
return false;
}
var longest = 0;
directory(system.exec_dir + '../xtrn/*', GLOB_ONLYDIR).forEach(function (e) {
var dir = backslash(fullpath(e));
if (find_startup_dir(dir) !== false)
return;
const ini = e + '/install-xtrn.ini';
if (!file_exists(ini)) return;
const f = new File(ini);
......@@ -73,6 +88,11 @@ directory(system.exec_dir + '../xtrn/*', GLOB_ONLYDIR).forEach(function (e) {
if (xtrn.Name.length > longest) longest = xtrn.Name.length;
});
if (!tree.items.length) {
alert("No installable external programs found");
exit(0);
}
tree_frame.width = longest + 1;
info_frame.x = tree_frame.width + 2;
info_frame.width = main_frame.width - tree_frame.width - 2;
......