AddMenuEntry - the API

Everything about the new development branch of mms

Moderator: Moderator

User avatar
magicamun
master
Posts: 688
Joined: Thu Feb 28, 2008 7:42 am
Location: Germany

AddMenuEntry - the API

Postby magicamun » Sat Oct 02, 2010 9:30 am

Lorenzo requested a discription of it:

Code: Select all

void AddMenuEntry(const std::string& module, const std::string& id, const std::string& sm,
            const std::string& n, const std::string& ns,
            const std::string& ic, const std::string& ics,
            bool a);


module : Name of the module that registers the MenuEntry - put the plugins' name here
id: this must be a (unique) id to the Menu-Entry
sm: Submenu's Name - this is used for the default - grouping of the plugins in the menu
n: menuitem's name unselected
ns menuitem's name when selected
ic: menuitem's icon unselected
ics menuitem's icon when selected
a: Active / Inactive

Example for audio (graphical_audio.cpp):

Code: Select all

  MainMenu *mainmenu = S_MainMenu::get_instance();
  mainmenu->AddMenuEntry("audio", "audio_hd", "audio",
          dgettext("mms-audio", "Audio"),
          dgettext("mms-audio", "Play audio from harddrive"), themes->startmenu_music_dir, "", true);

  if (conf->p_media())
    mainmenu->AddMenuEntry("audio", "audio_disc", "audio",
            dgettext("mms-audio", "Audio"),
            dgettext("mms-audio", "Play an audio cd"),themes->startmenu_music_cd, "", true);

  if (radio_conf->p_radio())
    mainmenu->AddMenuEntry("audio", "audio_radio", "audio",
            dgettext("mms-audio", "Audio"),
            dgettext("mms-audio", "Play Internet Radio"),themes->startmenu_radio, "", true);


EDIT: @lorenzo

i'd need a macro for the plugin getting its name pls. I tried - but failed :-(

Return to “1.2.x”

Who is online

Users browsing this forum: No registered users and 1 guest