@@ -356,21 +356,29 @@ function store.get_formspec()
356
356
cur_page = 1
357
357
end
358
358
359
- local formspec = {
360
- " size[12,7;true]" ,
361
- " position[0.5,0.55]" ,
362
- " field[0.2,0.1;7.8,1;search_string;;" , core .formspec_escape (search_string ), " ]" ,
363
- " field_close_on_enter[search_string;false]" ,
364
- " button[7.7,-0.2;2,1;search;" , fgettext (" Search" ), " ]" ,
365
- " dropdown[9.7,-0.1;2.4;type;" ,
366
- table.concat (filter_types_titles , " ," ),
367
- " ;" ,
368
- filter_type ,
369
- " ]" ,
370
- -- "textlist[0,1;2.4,5.6;a;",
371
- -- table.concat(taglist, ","),
372
- -- "]"
373
- }
359
+ local formspec
360
+ if # store .packages ~= 0 then
361
+ formspec = {
362
+ " size[12,7;true]" ,
363
+ " position[0.5,0.55]" ,
364
+ " field[0.2,0.1;7.8,1;search_string;;" ,
365
+ core .formspec_escape (search_string ), " ]" ,
366
+ " field_close_on_enter[search_string;false]" ,
367
+ " button[7.7,-0.2;2,1;search;" ,
368
+ fgettext (" Search" ), " ]" ,
369
+ " dropdown[9.7,-0.1;2.4;type;" ,
370
+ table.concat (filter_types_titles , " ," ),
371
+ " ;" , filter_type , " ]" ,
372
+ -- "textlist[0,1;2.4,5.6;a;",
373
+ -- table.concat(taglist, ","), "]",
374
+ }
375
+ else
376
+ formspec = {
377
+ " size[12,7;true]" ,
378
+ " position[0.5,0.55]" ,
379
+ " label[4,3;No packages could be retrieved]" ,
380
+ }
381
+ end
374
382
375
383
local start_idx = (cur_page - 1 ) * num_per_page + 1
376
384
for i = start_idx , math.min (# store .packages , start_idx + num_per_page - 1 ) do
@@ -381,7 +389,7 @@ function store.get_formspec()
381
389
382
390
-- image
383
391
formspec [# formspec + 1 ] = " image[-0.4,0;1.5,1;"
384
- formspec [# formspec + 1 ] = get_screenshot (package )
392
+ formspec [# formspec + 1 ] = core . formspec_escape ( get_screenshot (package ) )
385
393
formspec [# formspec + 1 ] = " ]"
386
394
387
395
-- title
@@ -404,7 +412,7 @@ function store.get_formspec()
404
412
formspec [# formspec + 1 ] = fgettext (" Install" )
405
413
formspec [# formspec + 1 ] = " ]"
406
414
elseif package .installed_release < package .release then
407
- formspec [# formspec + 1 ] = " button[8.4,0;1.5,1;install_ "
415
+ formspec [# formspec + 1 ] = " button[8.4,0;1.5,1;update_ "
408
416
formspec [# formspec + 1 ] = tostring (i )
409
417
formspec [# formspec + 1 ] = " ;"
410
418
formspec [# formspec + 1 ] = fgettext (" Update" )
0 commit comments