Development/Tutorials/Plasma4/ContainmentAction: Difference between revisions

    From KDE TechBase
    No edit summary
    No edit summary
    Line 1: Line 1:
    You can use Plasma ContainmentAction e.g. for Context Menus on your Plasma Desktop. They will run as plugins meaning you can add and remove them after compilation. If they exist, their name will be stored in [[Development/Tutorials/Desktop_File|.desktop files]].
    You can use Plasma ContainmentAction e.g. for Context Menus on your Plasma Desktop. They will run as plugins meaning you can add and remove them after compilation. If they exist, their name will be stored in [[Development/Tutorials/Desktop_File|.desktop files]].
    = Example =
    A simple example for Plasma ContainmentAction plugins can be found at https://github.com/tstaerk/kde-contextmenu/tree/0.1. Let's look at it here:
    == kde-contextmenu.desktop ==
    [Desktop Entry]
    Name=KDE Context Menu
    Type=Service
    Icon=favorites
    Comment=Simple application launcher
    ServiceTypes=Plasma/ContainmentActions
    X-KDE-Library=kde-contextmenu
    X-KDE-PluginInfo-Author=R. Hacker
    X-KDE-PluginInfo-Name=kde-contextmenu
    X-KDE-PluginInfo-Version=pre0.1
    X-KDE-PluginInfo-Website=http://techbase.kde.org
    X-KDE-PluginInfo-EnabledByDefault=true


    = Debugging =
    = Debugging =

    Revision as of 23:10, 28 February 2013

    You can use Plasma ContainmentAction e.g. for Context Menus on your Plasma Desktop. They will run as plugins meaning you can add and remove them after compilation. If they exist, their name will be stored in .desktop files.

    Example

    A simple example for Plasma ContainmentAction plugins can be found at https://github.com/tstaerk/kde-contextmenu/tree/0.1. Let's look at it here:

    kde-contextmenu.desktop

    [Desktop Entry]
    Name=KDE Context Menu
    Type=Service
    Icon=favorites
    Comment=Simple application launcher
    
    ServiceTypes=Plasma/ContainmentActions
    
    X-KDE-Library=kde-contextmenu
    X-KDE-PluginInfo-Author=R. Hacker
    [email protected]
    X-KDE-PluginInfo-Name=kde-contextmenu
    X-KDE-PluginInfo-Version=pre0.1
    X-KDE-PluginInfo-Website=http://techbase.kde.org
    X-KDE-PluginInfo-EnabledByDefault=true
    

    Debugging

    To debug your Plasma ContainmentAction call

    kdebugdialog --fullmode
    

    search for "plasma" and direct kDebug's output to /tmp/whatever.txt