Pop-up windows by a Process Plugin (1 Viewer)

xmp

Portal Member
October 20, 2011
7
0
Home Country
Spain Spain
Hello All,

I’m new developing Mediaportal plugins so any help or advice is highly welcome.

I've already developed a Plugin that checks the status of certain home automation devices (this requires a backgroung(process) task that will be listening status updates and alarms). I’m developing another plugin that will show the state of all the available elements.

I would like to know if it’s possible to show notifications(pop-ups) inside Mediaportal even if you are watching TV, Weather or if you are in any available plugin. For instance, suppose I get a water leakage event, I would like to show a pop-up showing alarm information and location. Is there any API in the Skin or Plugin to achieve this?

Thanks in advance.
 

SilentException

Retired Team Member
  • Premium Supporter
  • October 27, 2008
    2,617
    1,130
    Rijeka, Croatia
    Home Country
    Croatia Croatia
    You can check active window ID. There is also event in GUIWindowManager which fires when active window changes. For TV, I'm sure there is a method or property in TVPlugin which can tell you whether TV/radio is playing. Maybe even in g_player class.

    To show notifications you can use any of available dialogs but I think GUIDialogNotify is the best for the purpose. Since you'll be doing this from background thread you need to invoke showing of dialog, something like GUIUtils.cs - subcentral - Download & manage subtitles - plugin for MediaPortal HTPC application - Google Project Hosting, you can also take complete GUIUtils class to work with (Few plugins took this class already ;))
     

    Edalex

    Community Plugin Dev
  • Premium Supporter
  • January 3, 2008
    2,955
    1,264
    Saratov
    Home Country
    Russian Federation Russian Federation
    Thanks. Don't know that global notification are posible. I will definitely use GUIUtils :)
     

    xmp

    Portal Member
    October 20, 2011
    7
    0
    Home Country
    Spain Spain
    That was definively what I was looking for. Adding this code in the process plugin I'm able to show notifications in the current window.

    GUIDialogNotify dlgNotify = (GUIDialogNotify)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_NOTIFY);
    if (null != dlgNotify)
    {
    dlgNotify.SetHeading("HEADING");
    dlgNotify.SetText("TEXT");
    dlgNotify.SetImage(@"Warning_Green.png");
    dlgNotify.SetImageDimensions(new System.Drawing.Size(150, 150), true, true);
    dlgNotify.DoModal(GUIWindowManager.ActiveWindow);
    }

    Thanks.
     

    Scrounger

    Retired Team Member
  • Premium Supporter
  • January 21, 2009
    1,032
    514
    Stuttgart
    Home Country
    Germany Germany
    AW: Pop-up windows by a Process Plugin

    I have nearly the same question.
    But i develop a plugin for the TvServer.

    I would like to show a message on all MPClients, if a process starts / ends.
    And i would like to use only the TvServer classes / libaries, because of supporting a stand alone Sever installation.

    I am grateful for every suggestion.
     

    Edalex

    Community Plugin Dev
  • Premium Supporter
  • January 3, 2008
    2,955
    1,264
    Saratov
    Home Country
    Russian Federation Russian Federation
    Is it possible to invoke Notify dialog from windows plugin in other windows plugin?
     

    xmp

    Portal Member
    October 20, 2011
    7
    0
    Home Country
    Spain Spain
    Edalex I'm not sure if ti's possible from a Windows Plugin, but I've tried with a process plugin and notification Dialog is shown on the current screen/plugin. I think it'll probably work also from another Windows Plugin.
     

    SilentException

    Retired Team Member
  • Premium Supporter
  • October 27, 2008
    2,617
    1,130
    Rijeka, Croatia
    Home Country
    Croatia Croatia
    Yes ofcourse it's possible. That's why dialogs exist. However, only one dialog at a time is possible so you cannot stack them. Opening new dialog while old is still showing will close old one.
     

    Edalex

    Community Plugin Dev
  • Premium Supporter
  • January 3, 2008
    2,955
    1,264
    Saratov
    Home Country
    Russian Federation Russian Federation
    So it's strange that I can see notification only in native windows. :) I will dig deeper in tvplugin code. I remembered that "tvs erver lost connection" is visible in every plugin.
     

    Users who are viewing this thread

    Top Bottom