Latest Media Handler v2.4.X.000 (2 Viewers)

azzuro

Test Group
  • Team MediaPortal
  • May 10, 2007
    9,984
    5,663
    France - IDF
    Home Country
    France France
    Like plugin.isenabled(112011)? So is it possible?
    i think not
    • skin.setfocus(windowId,controlId) - Sets the focus to the specified control id in the specified window. Useful in <onclick> control attributes (e.g., button onclick).
    • plugin.isenabled(pluginName) - Returns true if the specified plugin name is enabled. Useful in skin expressions.

    but, update this one, can be benefit for like you, user with non latin characters.

    @arion_p : hard to enhance this feature ?

    plugin.isenabled(pluginName or ID) - Returns true if the specified plugin name or ID is enabled. Useful in skin expressions.( ID support is better for plugin with different name depending of language)
     

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    16,039
    11,112
    Kyiv
    Home Country
    Ukraine Ukraine
    can be benefit for like you, user with non latin characters.
    It looks like working like this (plugin.isenabled(#mvCentral.Settings.HomeScreenName)), you have installed this plugin? When check the log file to let me, I'll see how the function worked.
     

    Attachments

    • LatestMediaHandler.dll.zip
      231.3 KB

    catavolt

    Design Group Manager
  • Team MediaPortal
  • August 13, 2007
    14,597
    10,589
    Königstein (Taunus)
    Home Country
    Germany Germany
    plugin.isenabled(pluginName or ID) - Returns true if the specified plugin name or ID is enabled. Useful in skin expressions.( ID support is better for plugin with different name depending of language)
    That would be the best way to identify installed plugins independendly from their name in different languages ;)
     

    azzuro

    Test Group
  • Team MediaPortal
  • May 10, 2007
    9,984
    5,663
    France - IDF
    Home Country
    France France
    https://github.com/MediaPortal/Medi...ediaportal/Core/guilib/Functions.cs#L863-L868
    Code:
        [XMLSkinFunction("plugin.isenabled")]
        public static bool PluginIsEnabled(string name)
        {
          int condition = GUIInfoManager.TranslateString("plugin.isenabled(" + name + ")");
          return GUIInfoManager.GetBool(condition, 0);
        }

    https://github.com/MediaPortal/Medi...tal/Core/guilib/GUIInfoManager.cs#L1458-L1475

    Code:
            if (strTest.Substring(0, 17) == "plugin.isenabled(")
            {
              // use original condition, because plugin Name is case sensitive
              string pluginName = strCondition;
              pluginName = pluginName.TrimStart(new char[] {' '});
              pluginName = pluginName.TrimEnd(new char[] {' '});
              if (bNegate)
              {
                pluginName = pluginName.Remove(0, 1);
              }
    
              pluginName = pluginName.Substring(17, strTest.Length - 18);
    
              if (pluginName != string.Empty)
              {
                return AddMultiInfo(new GUIInfo(bNegate ? -PLUGIN_IS_ENABLED : PLUGIN_IS_ENABLED, pluginName));
              }
            }
     

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    16,039
    11,112
    Kyiv
    Home Country
    Ukraine Ukraine
    return GUIInfoManager.GetBool(condition, 0);
    I did not understand how to calculate it, the plugin is enabled or not.
    That's what it looks like but not sure.
    https://github.com/MediaPortal/Medi...diaportal/Core/guilib/GUIInfoManager.cs#L2486
    Code:
        /// \brief Examines the multi information sent and returns true or false accordingly.
        private static bool GetMultiInfoBool(GUIInfo info, int dwContextWindow)
        {
          bool bReturn = false;
    ...
            case PLUGIN_IS_ENABLED:
              bReturn = PluginManager.IsPluginNameEnabled2(info.m_stringData);
              break;
     

    Users who are viewing this thread

    Top Bottom