//读取配置
procedure InitIni;
begin
  if System.Machine.Network.AvailableAdapterList.count>0 then 
    cbbList.items.text:=System.Machine.Network.AvailableAdapterList.text
  else
    cbbList.items.text:=System.Machine.Network.AdapterList.text;
  cbbList.text:=GetSetting('NetDevice',cbbList.items.strings[0]);
end;

//保存配置
procedure SaveIni;
begin
  SetSetting('NetDevice',cbbList.text);
end;

//--- Widget设置窗口初始化事件，当打开Widget设置窗口时会触发此事件 ---
procedure OnSettingInit;
begin
  Beginupdate;
  InitIni;
  Endupdate;
end;

//--- 按下设置窗口的确定按钮时，触发此事件 ---
//通过设置返回值来改变是否允许确认,当result为False时不关闭设置窗口
function OnSettingClose(iResult);
begin
  result:=true;
  if Result then
    SaveIni;
end;
