Browse Source

Fix "plugin" function

Add "copyfile" function
master
boisso 7 years ago
parent
commit
1c0d52f5d0
  1. 18
      k-meleon/macros2/functions.h

18
k-meleon/macros2/functions.h

@ -66,6 +66,7 @@
bool checkTrust(FunctionData* data)
{
return true; // TODO: to enable later
return data->c.mf->trusted && (!data->c.origmf || data->c.origmf->trusted);
}
@ -486,6 +487,7 @@
Value exec(FunctionData* data)
{
NEEDTRUST(data);
checkArgs(__FUNCTION__, data, 1, 2);
STARTUPINFO si = {0};
PROCESS_INFORMATION pi = {0};
@ -522,11 +524,8 @@
checkArgs(__FUNCTION__, data, 2);
MString plugin = data->getstr(1);
MString param = data->getstr(2);
int cmd;
kPlugin.kFuncs->SendMessage(plugin, PLUGIN_NAME, "DoAccel", (long)(const char*)param, (long)&cmd);
SendMessage(data->c.hWnd, WM_COMMAND, MAKELONG(cmd, 1), NULL);
return "";
plugin = plugin + "(" + param + ")";
return kPlugin.kFuncs->RunCommand(data->c.hWnd, plugin);
}
Value statusbar(FunctionData* data)
@ -1113,6 +1112,14 @@
return res == 0;
}
Value copyfile(FunctionData* data)
{
NEEDTRUST(data);
checkArgs(__FUNCTION__, data, 2);
BOOL res = CopyFile(data->getstr(1).utf16(), data->getstr(2).utf16(), TRUE);
return res == TRUE;
}
Value deletefile(FunctionData* data)
{
//NEEDTRUST(data);
@ -1838,6 +1845,7 @@ void InitFunctions(Mac* m)
MACROSFUNC_ADD(renamefile);
MACROSFUNC_ADD(deletefile);
MACROSFUNC_ADD(appendfile);
MACROSFUNC_ADD(copyfile);
MACROSFUNC_ADD(logmsg);
MACROSFUNC_ADD(popupmenu);
MACROSFUNC_ADD(time);

Loading…
Cancel
Save