2011-03-23 18:54:53 +01:00
|
|
|
/*
|
|
|
|
* This file is a part of Winix
|
|
|
|
* and is not publicly distributed
|
|
|
|
*
|
|
|
|
* Copyright (c) 2011, Tomasz Sowa
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "core/log.h"
|
|
|
|
#include "core/plugin.h"
|
2011-08-26 01:53:49 +02:00
|
|
|
#include "groupinfo.h"
|
2011-03-23 18:54:53 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern "C" void Init(PluginInfo &);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-08-26 01:53:49 +02:00
|
|
|
namespace GroupItem
|
2011-03-23 18:54:53 +01:00
|
|
|
{
|
2011-10-16 23:33:45 +02:00
|
|
|
const wchar_t plugin_name[] = L"group";
|
2011-08-26 01:53:49 +02:00
|
|
|
GroupInfo group_info;
|
2011-03-23 18:54:53 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-08-26 01:53:49 +02:00
|
|
|
void AddMountPar(PluginInfo & info)
|
|
|
|
{
|
2011-10-16 23:33:45 +02:00
|
|
|
group_info.mount_par_group_conf = info.system->mounts.AddMountPar(L"group_conf");
|
2011-08-26 01:53:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void FstabChanged(PluginInfo & info)
|
|
|
|
{
|
|
|
|
group_info.ReadGroupsConfigs(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void ProcessRequest(PluginInfo & info)
|
|
|
|
{
|
|
|
|
if( info.cur->request->function == &info.functions->fun_reload )
|
|
|
|
{
|
2011-10-16 23:33:45 +02:00
|
|
|
if( info.cur->request->IsParam(L"group") )
|
2011-08-26 01:53:49 +02:00
|
|
|
group_info.ReadGroupsConfigs(false);
|
|
|
|
}
|
|
|
|
}
|
2011-03-23 18:54:53 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void AddEzcFunctions(PluginInfo & info);
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Init(PluginInfo & info)
|
|
|
|
{
|
2011-08-26 01:53:49 +02:00
|
|
|
using namespace GroupItem;
|
2011-03-23 18:54:53 +01:00
|
|
|
|
2011-08-26 01:53:49 +02:00
|
|
|
plugin.Assign(WINIX_TEMPLATES_CREATEFUNCTIONS, AddEzcFunctions);
|
|
|
|
plugin.Assign(WINIX_ADD_MOUNTS, AddMountPar);
|
|
|
|
plugin.Assign(WINIX_FSTAB_CHANGED, FstabChanged);
|
|
|
|
plugin.Assign(WINIX_PROCESS_REQUEST, ProcessRequest);
|
2011-03-23 18:54:53 +01:00
|
|
|
|
2011-08-26 01:53:49 +02:00
|
|
|
group_info.SetSystem(info.system);
|
2011-10-16 23:33:45 +02:00
|
|
|
group_info.SetConfig(info.config);
|
2011-03-23 18:54:53 +01:00
|
|
|
|
|
|
|
info.p1 = (void*)(plugin_name);
|
|
|
|
}
|
|
|
|
|
|
|
|
|