Kodi Community Forum

Full Version: How to create WindowXMLDialog as Info-Popup without focus?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a DialogXML, which opens show(), and hide by close().
But the problem is, all actions are prensent on the dialog.
Is there a way to show the dialog as popup like mutebug or a workaround to forward the actions to current window?

Code:
class MFLDialog(xbmcgui.WindowXMLDialog):

    def __init__(self, xmlFilename, scriptPath, defaultSkin, defaultRes):
        log("Initializing MFL Dialog...")

MFL = MFLDialog("DialogMFL.xml", __addonpath__, 'Default', '720p')
MFL.show()
....
MFL.close()

Code:
<?xml version="1.0" encoding="utf-8"?>
<window type="dialog">
  <defaultcontrol>-</defaultcontrol>
  <allowoverlay>yes</allowoverlay>
  <coordinates>
    <system>0</system>
    <posx>0</posx>
    <posy>0</posy>
  </coordinates>
  <controls>
    <control type="group">
      <posx>390</posx>
      <posy>-10</posy>
      <animation effect="slide" end="0,-120" time="300" tween="quadratic" easing="out">WindowClose</animation>
      <animation effect="slide" start="0,-120" time="300" tween="quadratic" easing="out">WindowOpen</animation>
      <control type="image">
        <posx>0</posx>
        <posy>-30</posy>
        <width>130</width>
        <height>150</height>
        <texture flipx="false" border="5,5,5,5">OverlayDialogBackground.png</texture>
      </control>
      <control type="image">
        <posx>25</posx>
        <posy>20</posy>
        <width>80</width>
        <height>80</height>
        <aspectratio>keep</aspectratio>
        <texture>icon-mfl.png</texture>
      </control>
    </control>
  </controls>
</window>
That's my workaround. Would be cool, if someone has a better solution.

Code:
class MFLDialog(xbmcgui.WindowXMLDialog):
    def __init__(self, xmlFilename, scriptPath, defaultSkin, defaultRes):
        log("Initializing MFL Dialog...")
        self.Action = {
                        1: 'Left',
                        2: 'Right',
                        3: 'Up',
                        4: 'Down',
                        7: 'Select',
                        92: 'Back',
                        117: 'ContextMenu'
                    }


    def onAction(self, action):
        curWinID = xbmcgui.getCurrentWindowId()
        xbmc.executebuiltin('Action(%s,%s)' % (self.Action[action.getId()],curWinID))

https://www.youtube.com/watch?v=-7nvt2ttIFs
it's bad, the workaround don't always works well.
sometime when a dialog is open, the action are forwarded to the background window.