def __init__(self):

        self.scalex = self.getWidth() / float( 100 ) 
        self.scaley = self.getHeight() / float( 100 )

        # Create windows
        self.movieWindow = None
        self.tvshowWindow = None
        self.musicWindow = None

        # Create title
	labelp = place()
	labelp.xpos = int( 30*self.scalex )
	labelp.ypos = int( 25*self.scaley )
	labelp.xsize = int( 60*self.scalex )
	labelp.ysize = int( 5*self.scaley )
        self.titleLabel = xbmcgui.ControlLabel( labelp.xpos, labelp.ypos,
                labelp.xsize, labelp.ysize, getLS(0), 'font14', '0xFFBBBBFF')
        self.addControl( self.titleLabel )

        # Create buttons
	buttonp = place()
	buttonp.xpos = int( 35*self.scalex )
	buttonp.ypos = int( 35*self.scaley )
	buttonp.xsize = int( 30*self.scalex ) 
	buttonp.ysize = int( 5*self.scaley )
	basey = 0
        self.movieButton = xbmcgui.ControlButton( buttonp.xpos, basey +
                buttonp.ypos, buttonp.xsize, buttonp.ysize, getLS(1) )
        self.addControl(self.movieButton)
	basey = int( 10*self.scaley )
        self.tvshowButton = xbmcgui.ControlButton( buttonp.xpos, basey +
                buttonp.ypos, buttonp.xsize, buttonp.ysize, getLS(2) )
        self.addControl(self.tvshowButton)
	basey = int( 20*self.scaley )
        self.musicButton = xbmcgui.ControlButton( buttonp.xpos, basey +
                buttonp.ypos, buttonp.xsize, buttonp.ysize, getLS(3) )
        self.addControl(self.musicButton)

        # Set widgets order navigation 
        self.movieButton.controlUp( self.musicButton )
        self.movieButton.controlDown( self.tvshowButton )
        self.tvshowButton.controlUp( self.movieButton )
        self.tvshowButton.controlDown( self.musicButton )
        self.musicButton.controlUp( self.tvshowButton )
        self.musicButton.controlDown( self.movieButton )

        # Set focus 
        self.setFocus( self.movieButton )
    def __init__(self, options):

        self.options = options 

        self.scalex = self.getWidth() / float( 100 ) 
        self.scaley = self.getHeight() / float( 100 )

	optionp = place()
	optionp.xpos = int( 5*self.scalex )
	optionp.ypos = int( 5*self.scaley )
	optionp.xsize = int( 60*self.scalex )
	optionp.ysize =  int( 5*self.scaley )

        basex = 0
        self.watchedRadio = xbmcgui.ControlRadioButton( basex + optionp.xpos, 
                optionp.ypos, optionp.xsize, optionp.ysize, 
                getLS(50), font='font14')
        self.watchedRadio.setSelected( options["watched"] )
        self.addControl( self.watchedRadio )

        # Set focus 
        self.setFocus( self.watchedRadio )
    def __init__(self):

        self.scalex = self.getWidth() / float(100)
        self.scaley = self.getHeight() / float(100)

        labelp = place()
        labelp.xpos = int(35 * self.scalex)
        labelp.ypos = int(5 * self.scaley)
        labelp.xsize = int(60 * self.scalex)
        labelp.ysize = int(5 * self.scaley)

        buttonp = place()
        buttonp.xpos = int(5 * self.scalex)
        buttonp.ypos = int(5 * self.scaley)
        buttonp.xsize = int(25 * self.scalex)
        buttonp.ysize = int(5 * self.scaley)

        listp = place()
        listp.xpos = int(5 * self.scalex)
        listp.ypos = int(20 * self.scaley)
        listp.xsize = int(90 * self.scalex)
        listp.ysize = int(60 * self.scaley)

        # Source widgets
        basey = 0
        self.src = self.widget()
        self.src.label = xbmcgui.ControlLabel(
            labelp.xpos, basey + labelp.ypos, labelp.xsize, labelp.ysize, getLS(16), "font14", "0xFFBBBBFF"
        )
        self.addControl(self.src.label)
        self.src.button = xbmcgui.ControlButton(
            buttonp.xpos, basey + buttonp.ypos, buttonp.xsize, buttonp.ysize, getLS(10)
        )
        self.addControl(self.src.button)
        self.src.wlist = xbmcgui.ControlList(
            listp.xpos,
            basey + listp.ypos,
            listp.xsize,
            listp.ysize,
            buttonFocusTexture="MenuItemFO.png",
            selectedColor="0xFFBBBBFF",
        )
        self.addControl(self.src.wlist)
        self.src.wlist.addItem(INIT_LIST_ITEM)

        # Destination widgets
        basey = int(5 * self.scaley)
        self.dst = self.widget()
        self.dst.label = xbmcgui.ControlLabel(
            labelp.xpos, basey + labelp.ypos, labelp.xsize, labelp.ysize, getLS(16), "font14", "0xFFBBBBFF"
        )
        self.addControl(self.dst.label)
        self.dst.button = xbmcgui.ControlButton(
            buttonp.xpos, basey + buttonp.ypos, buttonp.xsize, buttonp.ysize, getLS(11)
        )
        self.addControl(self.dst.button)
        # self.dst.wlist = xbmcgui.ControlList( basex + listp.xpos, listp.ypos,
        #        listp.xsize, listp.ysize, buttonFocusTexture="MenuItemFO.png",
        #        selectedColor='0xFFBBBBFF')
        # self.addControl(self.dst.wlist)
        # self.dst.wlist.addItem( INIT_LIST_ITEM )

        # Ok and Cancel
        okp = place()
        okp.xpos = int(85 * self.scalex)
        okp.ypos = int(85 * self.scaley)
        okp.xsize = int(10 * self.scalex)
        okp.ysize = int(10 * self.scaley)
        self.okButton = xbmcgui.ControlButton(okp.xpos, okp.ypos, okp.xsize, okp.ysize, getLS(12))
        self.addControl(self.okButton)
        cancelp = place()
        cancelp.xpos = int(70 * self.scalex)
        cancelp.ypos = int(85 * self.scaley)
        cancelp.xsize = int(10 * self.scalex)
        cancelp.ysize = int(10 * self.scaley)
        self.cancelButton = xbmcgui.ControlButton(cancelp.xpos, cancelp.ypos, cancelp.xsize, cancelp.ysize, getLS(13))
        self.addControl(self.cancelButton)

        # Options buttion
        optionp = place()
        optionp.xpos = int(5 * self.scalex)
        optionp.ypos = int(85 * self.scaley)
        optionp.xsize = int(15 * self.scalex)
        optionp.ysize = int(10 * self.scaley)
        self.optionButton = xbmcgui.ControlButton(
            optionp.xpos, optionp.ypos, optionp.xsize, optionp.ysize, getLS(14) + "..."
        )
        self.addControl(self.optionButton)

        # Set widgets order navigation
        self.src.button.controlUp(self.okButton)
        self.src.button.controlDown(self.dst.button)
        self.dst.button.controlUp(self.src.button)
        self.dst.button.controlDown(self.src.wlist)
        self.src.wlist.controlUp(self.dst.button)
        self.src.wlist.controlDown(self.okButton)
        self.src.wlist.controlLeft(self.okButton)
        self.src.wlist.controlRight(self.okButton)
        self.okButton.controlUp(self.src.wlist)
        self.okButton.controlDown(self.src.button)
        self.okButton.controlLeft(self.cancelButton)
        self.cancelButton.controlUp(self.src.wlist)
        self.cancelButton.controlDown(self.src.button)
        self.cancelButton.controlRight(self.okButton)
        self.cancelButton.controlLeft(self.optionButton)
        self.optionButton.controlUp(self.src.wlist)
        self.optionButton.controlDown(self.src.button)
        self.optionButton.controlRight(self.cancelButton)

        # Set focus
        self.setFocus(self.src.button)

        # Set default options
        self.options = OptionClass.getDefOptions()
        self.optionsWindow = OptionClass(options=self.options)

        # DB mng
        self.db = dbMng()