# HG changeset patch # User Goffi # Date 1580156228 -3600 # Node ID 1481f09c917577dec3403d7871b5bfee394c9a69 # Parent 080b6cc17f5369744e06c891d860ef2d3aed7868 settings (android): don't expose autoconnect parameters: autoconnection parameters are used on Android to reconnect automatically any profile connected, so we use the new `extra` parameter to ignore them, avoiding an accidental change by the user which would be confusing. diff -r 080b6cc17f53 -r 1481f09c9175 cagou/core/platform_/android.py --- a/cagou/core/platform_/android.py Mon Jan 27 21:17:08 2020 +0100 +++ b/cagou/core/platform_/android.py Mon Jan 27 21:17:08 2020 +0100 @@ -134,6 +134,19 @@ PythonActivity.moveTaskToBack(True) return True + def updateParamsExtra(self, extra): + # on Android, we handle autoconnection automatically, + # user must not modify those parameters + extra.update( + { + "ignore": [ + ["Connection", "autoconnect_backend"], + ["Connection", "autoconnect"], + ["Connection", "autodisconnect"], + ], + } + ) + def getPathFromUri(self, uri): cursor = mActivity.getContentResolver().query(uri, None, None, None, None) if cursor is None: diff -r 080b6cc17f53 -r 1481f09c9175 cagou/core/platform_/base.py --- a/cagou/core/platform_/base.py Mon Jan 27 21:17:08 2020 +0100 +++ b/cagou/core/platform_/base.py Mon Jan 27 21:17:08 2020 +0100 @@ -69,6 +69,9 @@ share_widget.close() return True + def updateParamsExtra(self, extra): + pass + def open_url(self, url, wid=None): """Open an URL in the way appropriate for the platform diff -r 080b6cc17f53 -r 1481f09c9175 cagou/plugins/plugin_wid_settings.py --- a/cagou/plugins/plugin_wid_settings.py Mon Jan 27 21:17:08 2020 +0100 +++ b/cagou/plugins/plugin_wid_settings.py Mon Jan 27 21:17:08 2020 +0100 @@ -19,9 +19,9 @@ from sat.core import log as logging -log = logging.getLogger(__name__) from sat.core.i18n import _ from sat.core.constants import Const as C +from sat.tools.common import data_format from sat_frontends.quick_frontend import quick_widgets from kivy.uix.label import Label from kivy.uix.widget import Widget @@ -29,6 +29,9 @@ from cagou import G +log = logging.getLogger(__name__) + + PLUGIN_INFO = { "name": _("settings"), "main": "CagouSettings", @@ -48,7 +51,12 @@ # then up when the UI is loaded self.loading_widget = Widget() self.add_widget(self.loading_widget) - G.host.bridge.getParamsUI(-1, C.APP_NAME, self.profile, callback=self.getParamsUICb, errback=self.getParamsUIEb) + extra = {} + G.local_platform.updateParamsExtra(extra) + G.host.bridge.getParamsUI( + -1, C.APP_NAME, data_format.serialise(extra), self.profile, + callback=self.getParamsUICb, + errback=self.getParamsUIEb) def changeWidget(self, widget): self.clear_widgets([self.loading_widget])