changed: GroupItem plugin has been renamed to Group
it's nearly finished now we are using three levels from Space (ConfParser) - group set - group - values git-svn-id: svn://ttmath.org/publicrep/winix/trunk@773 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
76
plugins/group/init.cpp
Executable file
76
plugins/group/init.cpp
Executable file
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* 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"
|
||||
#include "groupinfo.h"
|
||||
|
||||
|
||||
|
||||
extern "C" void Init(PluginInfo &);
|
||||
|
||||
|
||||
|
||||
|
||||
namespace GroupItem
|
||||
{
|
||||
const wchar_t plugin_name[] = L"group";
|
||||
GroupInfo group_info;
|
||||
|
||||
|
||||
|
||||
|
||||
void AddMountPar(PluginInfo & info)
|
||||
{
|
||||
group_info.mount_par_group_conf = info.system->mounts.AddMountPar(L"group_conf");
|
||||
}
|
||||
|
||||
|
||||
void FstabChanged(PluginInfo & info)
|
||||
{
|
||||
group_info.ReadGroupsConfigs(true);
|
||||
}
|
||||
|
||||
|
||||
void ProcessRequest(PluginInfo & info)
|
||||
{
|
||||
if( info.cur->request->function == &info.functions->fun_reload )
|
||||
{
|
||||
if( info.cur->request->IsParam(L"group") )
|
||||
group_info.ReadGroupsConfigs(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void AddEzcFunctions(PluginInfo & info);
|
||||
|
||||
} // namespace
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void Init(PluginInfo & info)
|
||||
{
|
||||
using namespace GroupItem;
|
||||
|
||||
plugin.Assign(WINIX_TEMPLATES_CREATEFUNCTIONS, AddEzcFunctions);
|
||||
plugin.Assign(WINIX_ADD_MOUNTS, AddMountPar);
|
||||
plugin.Assign(WINIX_FSTAB_CHANGED, FstabChanged);
|
||||
plugin.Assign(WINIX_PROCESS_REQUEST, ProcessRequest);
|
||||
|
||||
group_info.SetSystem(info.system);
|
||||
group_info.SetConfig(info.config);
|
||||
|
||||
info.p1 = (void*)(plugin_name);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user