require "preferenceGUI\\locals"; -- CCF Groups lua macros version 0.1 require "dialog" require "compat" local g_pref1="kmeleon.groups.name" local g_pref2="kmeleon.groups." local g_pref3="kmeleon.groups.startup" local g_pref4="kmeleon.startupgroups.enabled" local g_pref5="kmeleon.groups.last" local names="" local path = BROWSERPATH.."pref\\" local d = create_dialog({ width = 180, -- width height = 165, -- height caption = "dialog", -- caption { type = "button", -- control type style = w32dlg.BS_DEFPUSHBUTTON, x = 10, -- x position y = 130, -- y position width = 40, -- width height = 10, -- height id = "IDBUTTONOK", -- ID caption = _GOPEN -- caption }, { type = "button", -- control type style = w32dlg.BS_DEFPUSHBUTTON, x = 60, -- x position y = 130, -- y position width = 40, -- width height = 10, -- height id = "IDBUTTONCANCEL", -- ID caption = _GCANCEL -- caption }, { type = "button", -- control type style = w32dlg.BS_DEFPUSHBUTTON, x = 110, -- x position y = 130, -- y position width = 60, -- width height = 10, -- height id = "IDBUTTONREMOVE", -- ID caption = _GREMOVE -- caption }, { type = "listbox", -- control type style = w32dlg.WS_BORDER + w32dlg.WS_VSCROLL + w32dlg.WS_HSCROLL + w32dlg.LBS_NOTIFY, x = 20, -- x position y = 5, -- y position width = 140, -- width height = 120, -- height id = "IDLIST", -- ID }, }) function gaddname(gname) local names=getpref(TYPE_STRING,g_pref1) names=names..gname.."\t" setpref(TYPE_STRING,g_pref1,names) end function gcreategroup() gname=prompt("Please input group name:","Group name","") if gname then gaddname(gname) --pluginmsg("utils","write",path..gname..".group","") local f = assert(io.open(path..gname..".group","w")) f:write("") f:close() end group_menu() end local function gg() local names=getpref(TYPE_STRING,g_pref1) local len=string.len(names) local i=1 local groups={} local j=1 while (i0 then local i=1 local groups,j=read(groups[idx]) while (i<=j) do --alert(groups.url[i]) -- NavigateTo(groups.url[i],OPEN_BACKGROUNDTAB) NavigateTo(groups.url[i],OPEN_NEWTAB) i=i+1 end end end local function loadgroup(gname) local i=1 local groups,j=read(gname) while (i<=j) do NavigateTo(groups.url[i],OPEN_BACKGROUNDTAB) i=i+1 end end local function groupnames() local names=getpref(TYPE_STRING,g_pref1) local len=string.len(names) local i=1 local groups={} local j=1 while (i2 then loadgroup(groups[2]) end end function gl3() local groups,j=groupnames() if j>3 then loadgroup(groups[3]) end end function gl4() local groups,j=groupnames() if j>4 then loadgroup(groups[4]) end end function gl5() local groups,j=groupnames() if j>5 then loadgroup(groups[5]) end end function gl6() local groups,j=groupnames() if j>6 then loadgroup(groups[6]) end end function gl7() local groups,j=groupnames() if j>7 then loadgroup(groups[7]) end end function gl8() local groups,j=groupnames() if j>8 then loadgroup(groups[8]) end end function gl9() local groups,j=groupnames() if j>9 then loadgroup(groups[9]) end end function group_menu() local names=getpref(TYPE_STRING,g_pref1) local len=string.len(names) local i=1 local groups={} local j=1 while (i