2019-01-16, 20:33
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:
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:
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>
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;