DialogNotify not displaying (1 Viewer)

charli181

Retired Team Member
  • Premium Supporter
  • August 3, 2007
    800
    111
    Sydney
    Home Country
    Australia Australia
    I am trying to write a plugin that just monitors a pop3 account and displays a notification on the screen. In the log files I can see that it is trying to display. This all run on RC2 with svn from 13/9/07. Tried Blue2 normal and wide still with same results.

    2007-09-25 11:01:51.023392 [Info.][13]: WindowManager:route MediaPortal.GUI.Music.GUIMusicFiles:501->MediaPortal.Dialogs.GUIDialogNotify:2016
    2007-09-25 11:01:54.738734 [Info.][13]: window:MediaPortal.Dialogs.GUIDialogNotify init

    And Mediaportal when not in fullscreen shows "Notifications" in Title Bar, but nothing shows on the screen. What am I missing or is something broken.

    Can someone check if I am missing something in the code. for displaying the the screen.

    dialogNotify = (GUIDialogNotify)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_NOTIFY);

    private static void ShowMessage(string theName)
    {
    string notifyText = "";
    string notifyImage = "";
    if (dialogNotify != null)
    {
    if (!string.IsNullOrEmpty(theName))
    {
    notifyText = theName + "\n\n";
    //notifyImage = Thumbs.Yac + @"\text-message.jpg";
    }
    else
    {
    notifyText = theName + "\n\n" ;
    //notifyImage = Thumbs.Yac + @"\text-message.jpg";
    }

    dialogNotify.SetHeading("Voicemail Alert");
    dialogNotify.SetText(notifyText);
    //dialogNotify.SetImage(notifyImage);

    GUIWindow m_pParentWindow = GUIWindowManager.GetWindow(GUIWindowManager.ActiveWindow);
    if (null == m_pParentWindow) { return; }
    GUIWindowManager.IsSwitchingToNewWindow = true;
    GUIWindowManager.RouteToWindow(dialogNotify.GetID);
    GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_WINDOW_INIT, dialogNotify.GetID, 0, 0, -1, 0, null);
    dialogNotify.OnMessage(msg);
    GUIWindowManager.IsSwitchingToNewWindow = false;
    }
    }
     

    and-81

    Retired Team Member
  • Premium Supporter
  • March 7, 2005
    2,257
    183
    Melbourne
    Home Country
    Australia Australia
    Here's the code I use in my plugins for showing a popup message.

    static void ShowNotifyDialog(string heading, string text, int timeout)
    {
    GUIDialogNotify dlgNotify = (GUIDialogNotify)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_NOTIFY);
    if (dlgNotify == null)
    return;

    dlgNotify.Reset();
    dlgNotify.ClearAll();
    dlgNotify.SetHeading(heading);
    dlgNotify.SetText(text);
    dlgNotify.TimeOut = timeout;
    dlgNotify.DoModal(GUIWindowManager.ActiveWindow);
    }

    I don't use the feature myself, but I haven't had any complaints... let me know if doesn't work for you.

    Cheers,
     

    Users who are viewing this thread

    Top Bottom