Looking for developer feedback (GUIDialogKaiToast.cpp MODELESS --> MODAL)
#1
Hi,

First I want to say that I'm not a c++ developer, I just need some feedback about a possible solution I came up with ...

Problem:
I want to save notification messages to a skin string, to do that I have added the following line to DialogNotification.xml:
Code:
<onload>Skin.SetString(messagetest,$INFO[Control.GetLabel(401)])</onload>
I have tested a lot of different combinations (onload, onunload, button on focus, ...) but the skin string was always empty. I got curious because this should actually work fine ...
After some digging, I noticed that GUIDialogKaiToast.cpp is set to "DialogModalityType::MODELESS" while other dialogs which work with <onload, Control.GetLabel> stuff  are set to "DialogModalityType::MODAL", so I changed GUIDialogKaiToast.cpp to MODAL and <onload> is working fine now ..

The question is now, is that a reasonable change? Are there any drawbacks?

GIT diff:
Code:
diff --git a/xbmc/dialogs/GUIDialogKaiToast.cpp b/xbmc/dialogs/GUIDialogKaiToast.cpp
index 95221a7..46245f8 100644
--- a/xbmc/dialogs/GUIDialogKaiToast.cpp
+++ b/xbmc/dialogs/GUIDialogKaiToast.cpp
@@ -21,7 +21,7 @@ CGUIDialogKaiToast::TOASTQUEUE CGUIDialogKaiToast::m_notifications;
 CCriticalSection CGUIDialogKaiToast::m_critical;

 CGUIDialogKaiToast::CGUIDialogKaiToast(void)
-  : CGUIDialog(WINDOW_DIALOG_KAI_TOAST, "DialogNotification.xml", DialogModalityType::MODELESS)
+  : CGUIDialog(WINDOW_DIALOG_KAI_TOAST, "DialogNotification.xml", DialogModalityType::MODAL)
 {
   m_loadType = LOAD_ON_GUI_INIT;
   m_timer = 0;
Reply
#2
All right, seems like this isn't a reasonable change because now the notification dialog is getting full focus and you can't navigate the skin while the notification dialog is active.
Is there any other way to get a KODI notification (header, message, icon) into a skin string?

Any help would be greatly appreciated ...
Reply
#3
Maybe a service add-on that uses xbmc.Monitor.onNotification and sets a skin string? Not sure if guinotifications are forwarded to python though.
Reply
#4
I really want to avoid using a service/python addon for that, I feel like this should be a core feature. KODI Notifications are already there and working fine, all that is needed is to give skin developers access to this information, there is so much stuff you could do with that functionality:

e.g. Built a complete notification center, Notification Widget, Home Automation Triggers (e.g. dim lights on certain notifications), Show phone notifications (sms, mail, whatsapp, ..) directly in the GUI, and much more ...

I already built a complete interactive notification solution into my skin using my awful "hack" above but of course it would be much better if an actual KODI developer could make a proper fix and merge it into master. I would happily demonstrate how powerful and useful such a feature would be for KODI. Thanks!
Reply
 
Thread Rating:
  • 0 Vote(s) - 0 Average



Logout Mark Read Team Forum Stats Members Help
Looking for developer feedback (GUIDialogKaiToast.cpp MODELESS --> MODAL)00