Probabile Fix finestra di dialogo Titolo-ID

This commit is contained in:
Alhaziel01
2020-11-24 12:27:48 +01:00
parent 123d540bc6
commit 43a7cbb227
2 changed files with 89 additions and 92 deletions
+26 -18
View File
@@ -1419,7 +1419,7 @@ class TitleOrIDWindow(xbmcgui.WindowXMLDialog):
self.title = item.contentTitle if item.contentType == 'movie' else item.contentSerieName self.title = item.contentTitle if item.contentType == 'movie' else item.contentSerieName
self.id = item.infoLabels.get('tmdb_id','') if scraper == 'tmdb' else item.infoLabels.get('tvdb_id','') self.id = item.infoLabels.get('tmdb_id','') if scraper == 'tmdb' else item.infoLabels.get('tvdb_id','')
self.scraper = scraper self.scraper = scraper
self.label = 'TMDB ID:' if scraper == 'tmdb' else 'TVDB ID:' self.idtitle = 'TMDB ID' if scraper == 'tmdb' else 'TVDB ID'
self.doModal() self.doModal()
return self.item return self.item
@@ -1427,29 +1427,37 @@ class TitleOrIDWindow(xbmcgui.WindowXMLDialog):
#### Kodi 18 compatibility #### #### Kodi 18 compatibility ####
if config.get_platform(True)['num_version'] < 18: if config.get_platform(True)['num_version'] < 18:
self.setCoordinateResolution(2) self.setCoordinateResolution(2)
self.getControl(10000).setText(config.get_localized_string(60228) % self.title) self.HEADER = self.getControl(100)
self.getControl(10001).setText(self.title) self.TITLE = self.getControl(101)
self.getControl(10002).setLabel(self.label) self.ID = self.getControl(102)
self.getControl(10002).setText(self.id) self.EXIT = self.getControl(103)
self.getControl(10002).setType(1, self.label) self.EXIT2 = self.getControl(104)
self.setFocusId(10001)
self.HEADER.setText(config.get_localized_string(60228) % self.title)
self.TITLE.setLabel('[UPPERCASE]' + config.get_localized_string(60230).replace(':','') + '[/UPPERCASE]')
self.ID.setLabel('[UPPERCASE]' + self.scraper + 'id [/UPPERCASE]')
self.setFocusId(101)
def onClick(self, control): def onClick(self, control):
if control in [10003]: if control in [101]:
if self.getControl(10001).getText(): result = dialog_input(self.title)
if self.item.contentType == 'movie': self.item.contentTitle = self.getControl(10001).getText() if result:
else: self.item.contentSerieName = self.getControl(10001).getText() if self.item.contentType == 'movie': self.item.contentTitle = result
if self.scraper == 'tmdb' and self.getControl(10002).getText(): else: self.item.contentSerieName = result
self.item.infoLabels['tmdb_id'] = self.getControl(10002).getText() self.close()
elif self.scraper == 'tvdb' and self.getControl(10002).getText(): elif control in [102]:
self.item.infoLabels['tvdb_id'] = self.getControl(10002).getText() result = dialog_numeric(0, self.idtitle, self.id)
self.close() if result:
if self.scraper == 'tmdb': self.item.infoLabels['tmdb_id'] = result
elif self.scraper == 'tvdb': self.item.infoLabels['tvdb_id'] = result
self.close()
elif control in [10004, 10005]: elif control in [103, 104]:
self.item.exit = True self.item.exit = True
self.close() self.close()
def onAction(self, action): def onAction(self, action):
if (action in [92] and self.getFocusId() not in [10001, 10002]) or action in [10]: action = action.getId()
if action in [92, 10]:
self.item.exit = True self.item.exit = True
self.close() self.close()
@@ -8,7 +8,8 @@
<effect type="fade" start="100" end="0" time="300" /> <effect type="fade" start="100" end="0" time="300" />
</animation> </animation>
<controls> <controls>
<control type="button" id="10005"> <control type="button" id="104">
<description>CLOSE</description>
<top>0</top> <top>0</top>
<left>0</left> <left>0</left>
<height>100%</height> <height>100%</height>
@@ -16,92 +17,80 @@
<texturefocus colordiffuse="80232323">white.png</texturefocus> <texturefocus colordiffuse="80232323">white.png</texturefocus>
<texturenofocus colordiffuse="80232323">white.png</texturenofocus> <texturenofocus colordiffuse="80232323">white.png</texturenofocus>
</control> </control>
<control type="textbox" id="100">
<description>Not Found</description>
<top>150</top>
<left>40</left>
<height>40</height>
<width>1200</width>
<font>font30_title</font>
<textcolor>CCFFFFFF</textcolor>
<aligny>center</aligny>
<align>center</align>
<label/>
</control>
<control type="group"> <control type="group">
<top>210</top> <top>260</top>
<left>175</left> <left>400</left>
<height>300</height> <height>200</height>
<width>930</width> <width>480</width>
<!-- Beckground -->
<control type="image"> <control type="image">
<description>Background</description>
<height>100%</height> <height>100%</height>
<width>100%</width> <width>100%</width>
<texture colordiffuse="FF232323">white.png</texture> <texture colordiffuse="FF232323">white.png</texture>
</control> </control>
<!-- Header --> <control type="textbox">
<control type="textbox" id="10000"> <description>Modify</description>
<top>40</top> <top>40</top>
<left>40</left> <left>40</left>
<height>40</height> <height>40</height>
<width>850</width> <width>100</width>
<font>font30_title</font> <font>font30_title</font>
<textcolor>FFFFFFFF</textcolor> <textcolor>FFFFFFFF</textcolor>
<label></label> <label>$ADDON[plugin.video.kod 70714]</label>
<aligny>center</aligny>
<align>left</align>
<label/>
</control> </control>
<!-- divisor --> <control type="button" id="103">
<control type="image"> <description>CLOSE</description>
<top>90</top> <top>40</top>
<right>40</right>
<height>40</height>
<width>40</width>
<texturefocus colordiffuse="FFFFFFFF">close.png</texturefocus>
<texturenofocus colordiffuse="88FFFFFF">close.png</texturenofocus>
<ondown>101</ondown>
</control>
<control type="grouplist">
<bottom>40</bottom>
<left>40</left> <left>40</left>
<height>1</height> <height>40</height>
<width>850</width> <width>400</width>
<texture colordiffuse="FFFFFFFF">white.png</texture> <orientation>horizontal</orientation>
</control> <itemgap>40</itemgap>
<!-- titolo --> <onup>103</onup>
<control type="edit" id="10001"> <control type="button" id="101">
<top>120</top> <description>Title</description>
<left>40</left> <height>40</height>
<height>60</height> <width>180</width>
<width>630</width> <textcolor>FFFFFFFF</textcolor>
<textcolor>FFFFFFFF</textcolor> <aligny>center</aligny>
<texturefocus colordiffuse="FF0082C2">white.png</texturefocus> <align>center</align>
<texturenofocus colordiffuse="FF232323">white.png</texturenofocus> <texturefocus border="10" colordiffuse="22FFFFFF">white.png</texturefocus>
<aligny>center</aligny> <texturenofocus border="10"></texturenofocus>
<label>$ADDON[plugin.video.kod 60230]</label> </control>
<ondown>10002</ondown> <control type="button" id="102">
<onright>10003</onright> <description>ID</description>
</control> <height>40</height>
<!-- id --> <width>180</width>
<control type="edit" id="10002"> <textcolor>FFFFFFFF</textcolor>
<top>200</top> <aligny>center</aligny>
<left>40</left> <align>center</align>
<height>60</height> <texturefocus border="10" colordiffuse="22FFFFFF">white.png</texturefocus>
<width>630</width> <texturenofocus border="10"></texturenofocus>
<textcolor>FFFFFFFF</textcolor> </control>
<texturefocus colordiffuse="FF0082C2">white.png</texturefocus>
<texturenofocus colordiffuse="FF232323">white.png</texturenofocus>
<aligny>center</aligny>
<label></label>
<onup>10001</onup>
<onright>10003</onright>
</control>
<!-- ok -->
<control type="button" id="10003">
<top>120</top>
<left>690</left>
<label>$ADDON[plugin.video.kod 70001]</label>
<height>60</height>
<width>200</width>
<textcolor>FFFFFFFF</textcolor>
<aligny>center</aligny>
<align>center</align>
<texturefocus border="10" colordiffuse="FF0082C2">white.png</texturefocus>
<texturenofocus border="10" colordiffuse="FF232323">white.png</texturenofocus>
<ondown>10004</ondown>
<onleft>10001</onleft>
</control>
<!-- annulla -->
<control type="button" id="10004">
<top>200</top>
<left>690</left>
<label>$ADDON[plugin.video.kod 70002]</label>
<height>60</height>
<width>200</width>
<textcolor>FFFFFFFF</textcolor>
<aligny>center</aligny>
<align>center</align>
<texturefocus border="10" colordiffuse="FF0082C2">white.png</texturefocus>
<texturenofocus border="10" colordiffuse="FF232323">white.png</texturenofocus>
<onup>10003</onup>
<onleft>10001</onleft>
</control> </control>
</control> </control>
</controls> </controls>