diff --git a/resources/lib/dialogs/servermanual.py b/resources/lib/dialogs/servermanual.py index a4518bbc..20052ac6 100644 --- a/resources/lib/dialogs/servermanual.py +++ b/resources/lib/dialogs/servermanual.py @@ -21,11 +21,14 @@ CONNECT = 200 CANCEL = 201 ERROR_TOGGLE = 202 ERROR_MSG = 203 +VERIFY_SSL = 204 ERROR = { 'Invalid': 1, 'Empty': 2 } +MEDIA = tryEncode(join(v.ADDON_PATH, 'resources', 'skins', 'default', 'media')) + ############################################################################### @@ -55,15 +58,20 @@ class ServerManual(xbmcgui.WindowXMLDialog): self.error_msg = self.getControl(ERROR_MSG) self.host_field = self._add_editcontrol(725, 325, 40, 500) self.port_field = self._add_editcontrol(725, 450, 40, 500) + # self.ssl_field = self._add_radiobutton(725, 550, 50, 50) + self.ssl_field = self.getControl(VERIFY_SSL) self.port_field.setText('32400') self.setFocus(self.host_field) + self.ssl_field.setSelected(True) self.host_field.controlUp(self.cancel_button) self.host_field.controlDown(self.port_field) self.port_field.controlUp(self.host_field) - self.port_field.controlDown(self.connect_button) - self.connect_button.controlUp(self.port_field) + self.port_field.controlDown(self.ssl_field) + self.ssl_field.controlUp(self.port_field) + self.ssl_field.controlDown(self.connect_button) + self.connect_button.controlUp(self.ssl_field) self.cancel_button.controlDown(self.host_field) def onClick(self, control): @@ -82,7 +90,6 @@ class ServerManual(xbmcgui.WindowXMLDialog): elif self._connect_to_server(server, port): self.close() - elif control == CANCEL: # Remind me later self.close() @@ -96,14 +103,30 @@ class ServerManual(xbmcgui.WindowXMLDialog): self.close() def _add_editcontrol(self, x, y, height, width): - media = tryEncode(join( - v.ADDON_PATH, 'resources', 'skins', 'default', 'media')) - control = xbmcgui.ControlEdit(0, 0, 0, 0, - label="User", - font="font10", - textColor="ffc2c2c2", - focusTexture=join(media, "button-focus.png"), - noFocusTexture=join(media, "button-focus.png")) + control = xbmcgui.ControlEdit( + 0, 0, 0, 0, + label="User", + font="font10", + textColor="ffc2c2c2", + focusTexture=join(MEDIA, "button-focus.png"), + noFocusTexture=join(MEDIA, "button-focus.png")) + control.setPosition(x, y) + control.setHeight(height) + control.setWidth(width) + + self.addControl(control) + return control + + def _add_radiobutton(self, x, y, height, width): + control = xbmcgui.ControlRadioButton( + 0, 0, 0, 0, + label="", + font="font10", + textColor="ffc2c2c2", + focusOnTexture=join(MEDIA, "radio-on.png"), + noFocusOnTexture=join(MEDIA, "radio-on.png"), + focusOffTexture=join(MEDIA, "radio-off.png"), + noFocusOffTexture=join(MEDIA, "radio-off.png")) control.setPosition(x, y) control.setHeight(height) control.setWidth(width) diff --git a/resources/lib/initialsetup.py b/resources/lib/initialsetup.py index a239d3d9..8b14337f 100644 --- a/resources/lib/initialsetup.py +++ b/resources/lib/initialsetup.py @@ -54,6 +54,7 @@ def setup(): % (connectmanager.server, connectmanager.serverid)) connectmanager.write_pms_settings(connectmanager.server, connectmanager.pms_token) + connectmanager.pick_pms(show_dialog=True) return # If not already retrieved myplex info, optionally let user sign in diff --git a/resources/skins/default/1080i/script-plex-connect-server-manual.xml b/resources/skins/default/1080i/script-plex-connect-server-manual.xml index 7c8693ac..8c0c65fe 100644 --- a/resources/skins/default/1080i/script-plex-connect-server-manual.xml +++ b/resources/skins/default/1080i/script-plex-connect-server-manual.xml @@ -1,8 +1,6 @@ 200 - 0 - dialogeffect Background fade @@ -10,146 +8,82 @@ 100% emby-bg-fade.png - - 600 - 35% - 20% + 50% + 50% + 560 + 560 + white + -20 + -20 Background box white.png 600 - 525 + 600 - - - 530 - False - - Error box - white.png - 100% - 50 - - - - Error message - white - font10 - center - center - 50 - - - Plex logo logo-white.png + 64 + 64 keep - 120 - 49 - 20 - 0 - left - left - - - 500 - 50 + + Connect to PMS + + 84 + 476 + 64 + left + center + font12 + + + Container for spacing + 80 + 0 + 480 + 560 + top + font6 - Connect to PMS - - white - font12 - top - left - 100% - 30 - 60 + 50 + 560 + PMS IP address or host name + - - - 75 - - PMS IP address or host name - - ffa6a6a6 - font10 - top - - - - separator - 102% - 0.5 - 66 - -10 - emby-separator.png - - - - Host example - - ff464646 - font10 - top - 70 - + + 50 + 560 + font4 + https://192.168.1.2, https://myserver.com - - - Port - 200 - - Port Number - - ffa6a6a6 - font10 - top - - - - separator - 102% - 0.5 - 66 - -10 - emby-separator.png - + + 50 + 560 + Port Number + - - - Buttons - 380 - - Connect - box.png - box.png - - font10 - ffa6a6a6 - white - center - 100% - 50 - 201 - - - - Cancel - box.png - box.png - - font10 - ffa6a6a6 - white - center - 100% - 50 - 55 - 200 - + + 50 + 560 + font4 + + + 560 + Verify Host SSL Certificate + + + + Connect + + 201 + + + Cancel + + 200