Skip to content

Commit

Permalink
+ INTERNAL: Don't activate ProcessPlugins, if no entry is found in Me…
Browse files Browse the repository at this point in the history
…diaPortal.xml (cause Configuration.exe did not run)
  • Loading branch information
waeberd committed Jul 29, 2005
1 parent db87428 commit 89feff5
Showing 1 changed file with 31 additions and 17 deletions.
48 changes: 31 additions & 17 deletions mediaportal/Core/guilib/PluginManager.cs
Expand Up @@ -186,12 +186,17 @@ static void LoadPlugin(string strFile)
if (newObj==null)
newObj=(object)Activator.CreateInstance(t);
ISetupForm setup=(ISetupForm)newObj;

if (IsPluginNameEnabled(setup.PluginName()))
{
_SetupForms.Add(setup);
_NonGUIPlugins.Add(plugin);
}
// waeberd:
// don't activate plugins that have NO entry at all in
// MediaPortal.xml
if (PluginEntryExists(setup.PluginName()))
{
if (IsPluginNameEnabled(setup.PluginName()))
{
_SetupForms.Add(setup);
_NonGUIPlugins.Add(plugin);
}
}
}
}
catch( Exception iSetupFormException )
Expand All @@ -209,7 +214,7 @@ static void LoadPlugin(string strFile)
if (newObj==null)
newObj=(object)Activator.CreateInstance(t);
IWakeable setup=(IWakeable)newObj;
if (IsPluginNameEnabled(setup.PluginName()))
if (IsPluginNameEnabled(setup.PluginName()))
{
_Wakeables.Add(setup);
}
Expand Down Expand Up @@ -294,7 +299,7 @@ static public void LoadWindowPlugin(string strFile)
if (newObj==null)
newObj=(object)Activator.CreateInstance(t);
ISetupForm setup=(ISetupForm)newObj;
if (IsPluginNameEnabled(setup.PluginName()))
if (IsPluginNameEnabled(setup.PluginName()))
{
_SetupForms.Add(setup);
}
Expand All @@ -316,7 +321,7 @@ static public void LoadWindowPlugin(string strFile)
if (newObj==null)
newObj=(object)Activator.CreateInstance(t);
IWakeable setup=(IWakeable)newObj;
if (IsPluginNameEnabled(setup.PluginName()))
if (IsPluginNameEnabled(setup.PluginName()))
{
_Wakeables.Add(setup);
}
Expand Down Expand Up @@ -373,16 +378,25 @@ static public bool IsWindowPlugInEnabled(string strType)

}
}
static public bool IsPluginNameEnabled(string strPluginName)
{
static public bool IsPluginNameEnabled(string strPluginName)
{

using (MediaPortal.Profile.Xml xmlreader=new MediaPortal.Profile.Xml("MediaPortal.xml"))
{
bool bEnabled=xmlreader.GetValueAsBool("plugins",strPluginName,true);
return bEnabled;
using (MediaPortal.Profile.Xml xmlreader=new MediaPortal.Profile.Xml("MediaPortal.xml"))
{
bool bEnabled=xmlreader.GetValueAsBool("plugins",strPluginName,true);
return bEnabled;

}
}
}
}

static public bool PluginEntryExists(string strPluginName)
{
using (MediaPortal.Profile.Xml xmlreader=new MediaPortal.Profile.Xml("MediaPortal.xml"))
{
string val = xmlreader.GetValueAsString("plugins", strPluginName, "");
return (val != "");
}
}

static public void WndProc(ref System.Windows.Forms.Message msg) // Receive window messages from core / added by mPod/waeberd
{
Expand Down

0 comments on commit 89feff5

Please sign in to comment.