Release - PyXBMCt: a Python framework for simple creating UI for XBMC addons

  Thread Rating:
  • 2 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Dipti Offline
Junior Member
Posts: 28
Joined: Apr 2014
Reputation: 0
Post: #91
(2014-06-12 13:17)Roman_V_M Wrote:  
(2014-06-12 12:12)Dipti Wrote:  yes I used that both method setSetting() is working, but getSetting() is not returning any value.
I checked userdata->..->setting.xml is updated using setSetting. but stored value is not getting.

Then you must be doing something wrong, because the setSetting()/getSetting() does work. Here is the example of login function:
https://github.com/romanvm/ex.ua.alterna...lt.py#L345
BTW, the login window is implemented using PyXBMCt: https://github.com/romanvm/ex.ua.alterna..._window.py
Don't mind Russian text labels - object names are self-explanatory.


Hello,
Thank you so much.
My problem is solved.

Thanks
find quote
Roman_V_M Offline
Fan
Posts: 548
Joined: Jun 2011
Reputation: 14
Location: Kyiv, Ukraine
Post: #92
(2014-06-15 13:27)el_Paraguayo Wrote:  Quick update - this is what I've managed to do with your code:
https://www.youtube.com/watch?v=SN31SAIERhs

Quite happy with this!

Thanks. Looks interesting, though I'm not a football fan myself.Smile

AMD A4-3300 + AsRock A75M-ITX
XBMC-DSplayer 13.1 (custom build) on Windows 7
find quote
Roman_V_M Offline
Fan
Posts: 548
Joined: Jun 2011
Reputation: 14
Location: Kyiv, Ukraine
Post: #93
I'm glad to announce that PyXBMCt module has been accepted to XBMC official Gotham repo. So now you can simply use:
Code:
<requires>
...
<import addon="script.module.pyxbmct" version="1.1.2"/>
...
</requires>
in your addon.xml.

AMD A4-3300 + AsRock A75M-ITX
XBMC-DSplayer 13.1 (custom build) on Windows 7
find quote
Dipti Offline
Junior Member
Posts: 28
Joined: Apr 2014
Reputation: 0
Post: #94
(2014-06-24 21:22)Roman_V_M Wrote:  I'm glad to announce that PyXBMCt module has been accepted to XBMC official Gotham repo. So now you can simply use:
Code:
<requires>
...
<import addon="script.module.pyxbmct" version="1.1.2"/>
...
</requires>
in your addon.xml.


Its good news. Hearty congratulation.

Thanks
find quote
nickr Offline
Donor
Posts: 8,097
Joined: May 2009
Reputation: 141
Location: Christchurch NZ
Post: #95
Yeah great news.

If I have helped you or increased your knowledge, click the plus button and increase my reputation :)
find quote
KenV99 Offline
Senior Member
Posts: 212
Joined: Nov 2013
Reputation: 6
Post: #96
Hi,
I'm having a hard time with modal dialogs in what is probably an unusual situation. To summarize, I'm having difficulty getting a modal window to appear in front of another modal window.
The details are that I have a python script that runs from an addon settings page using:
Code:
<setting default="" id="onStartup_test" label="32009" type="action" action="RunScript($CWD/resources/lib/tester.py, onStartup)" />

In the code from 'tester.py', if I create a normal dialog box using:
Code:
dialog = xbmcgui.Dialog()
dialog.ok(__language__(32049), msg)

It appears in front of the settings page dialog and all is well. But this dialog is too small to display the amount of text I need to show. So I first tried using xbmcgui and then pyXBMCt to create larger window dialog boxes, but when calling .domodal they remain hidden behind the settings dialog box. To test, I used the code from the first page of this thread:

Code:
from pyxbmct.addonwindow import *

class MyWindow(AddonDialogWindow):

    def __init__(self, title=''):
        # You need to call base class' constructor.
        super(MyWindow, self).__init__(title)
        # Set the window width, height and the grid resolution: 2 rows, 3 columns.
        self.setGeometry(350, 150, 2, 3)
        # Create a text label.
        label = Label('This is a PyXBMCt window.', alignment=ALIGN_CENTER)
        # Place the label on the window grid.
        self.placeControl(label, 0, 0, columnspan=3)
        # Create a button.
        button = Button('Close')
        # Place the button on the window grid.
        self.placeControl(button, 1, 1)
        # Set initial focus on the button.
        self.setFocus(button)
        # Connect the button to a function.
        self.connect(button, self.close)
        # Connect a key action to a function.
        self.connect(ACTION_NAV_BACK, self.close)


# Create a window instance.
window = MyWindow('Hello, World!')
# Show the created window.
window.doModal()

Doing this, the modal window is created and I can see using the debugger that the code runs successfully, but in the GUI, the window is behind the settings dialog.

One small note, if you try to reproduce this - the code in pyxbmct/addonwindow.py needs to have the name of the addon hardcoded [_addon = xbmcaddon.Addon('myaddon')] because it is being called from a script outside the addon extension point. This does not cause me issues and in the actual code, I import the addon's own default.py and use classes and methods from there.

If you want to see the full situation, the project on GitHub is here: https://github.com/KenV99/service.xbmc.c...llincluded I don't have the failed attempt currently in the file tester.py, but can add it if you need to see how I am calling it...

Thanks for this useful framework!
find quote
Roman_V_M Offline
Fan
Posts: 548
Joined: Jun 2011
Reputation: 14
Location: Kyiv, Ukraine
Post: #97
Unfortunately, as far as I know, there is no way to control the priority of windows based on xbmcgui Python classes. You can either try to use XML-based controls in your script and play with <zorder> property, or set the coordinates of an AddonDialorWindow instance explicitly to move it to a visible area, not covered by Settings dialog.

AMD A4-3300 + AsRock A75M-ITX
XBMC-DSplayer 13.1 (custom build) on Windows 7
find quote
KenV99 Offline
Senior Member
Posts: 212
Joined: Nov 2013
Reputation: 6
Post: #98
Thanks. Using the XML based dialog worked, but I have to say the documentation for using it from a script is horrible. Once I get a full handle on it, I'll try to revise the wiki.
find quote
luka Offline
Junior Member
Posts: 14
Joined: Apr 2014
Reputation: 0
Post: #99
Hi everyone
I want add new ControlList in window myvideonav.xml (id = 10025) with PyXBMCt but I dont know how do I do.
Is it possible?
[Image: 2014023bfbdd-ce33-49bb-9a3a-08ca3f6e5119.png]
Video is defined by skin (xml)
Categories is defined by addon (python).
thanks!
find quote
Roman_V_M Offline
Fan
Posts: 548
Joined: Jun 2011
Reputation: 14
Location: Kyiv, Ukraine
Post: #100
2 luka

I'm not sure what you are trying to do. Please provide more details along with code snippets.

AMD A4-3300 + AsRock A75M-ITX
XBMC-DSplayer 13.1 (custom build) on Windows 7
find quote
Post Reply