Android: Fix auto-entry of server address and port in mainmenu
authorest31 <MTest31@outlook.com>
Mon, 16 Mar 2015 16:32:30 +0000 (17:32 +0100)
committerLoic Blot <loic.blot@unix-experience.fr>
Mon, 16 Mar 2015 18:46:54 +0000 (19:46 +0100)
Fixes #2497.

builtin/mainmenu/tab_simple_main.lua

index b9a6b650fa74b57d7370824c69a1ef2890505ab6..995c72132599f93aeeb1ef20f3400cfb4184799b 100644 (file)
@@ -98,12 +98,12 @@ local function main_button_handler(tabview, fields, name, tabdata)
        end
 
        if fields["favourites"] ~= nil then
-               local event = core.explode_textlist_event(fields["favourites"])
+               local event = core.explode_table_event(fields["favourites"])
 
                if event.type == "CHG" then
-                       if event.index <= #menudata.favorites then
-                               local address = menudata.favorites[event.index].address
-                               local port = menudata.favorites[event.index].port
+                       if event.row <= #menudata.favorites then
+                               local address = menudata.favorites[event.row].address
+                               local port = menudata.favorites[event.row].port
 
                                if address ~= nil and
                                        port ~= nil then
@@ -111,7 +111,7 @@ local function main_button_handler(tabview, fields, name, tabdata)
                                        core.setting_set("remote_port",port)
                                end
 
-                               tabdata.fav_selected = event.index
+                               tabdata.fav_selected = event.row
                        end
                end
                return true