comparison cagou/plugins/plugin_wid_settings.py @ 372:1481f09c9175

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.
author Goffi <goffi@goffi.org>
date Mon, 27 Jan 2020 21:17:08 +0100
parents 080b6cc17f53
children 4d660b252487
comparison
equal deleted inserted replaced
371:080b6cc17f53 372:1481f09c9175
17 # You should have received a copy of the GNU Affero General Public License 17 # You should have received a copy of the GNU Affero General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. 18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 19
20 20
21 from sat.core import log as logging 21 from sat.core import log as logging
22 log = logging.getLogger(__name__)
23 from sat.core.i18n import _ 22 from sat.core.i18n import _
24 from sat.core.constants import Const as C 23 from sat.core.constants import Const as C
24 from sat.tools.common import data_format
25 from sat_frontends.quick_frontend import quick_widgets 25 from sat_frontends.quick_frontend import quick_widgets
26 from kivy.uix.label import Label 26 from kivy.uix.label import Label
27 from kivy.uix.widget import Widget 27 from kivy.uix.widget import Widget
28 from cagou.core import cagou_widget 28 from cagou.core import cagou_widget
29 from cagou import G 29 from cagou import G
30
31
32 log = logging.getLogger(__name__)
30 33
31 34
32 PLUGIN_INFO = { 35 PLUGIN_INFO = {
33 "name": _("settings"), 36 "name": _("settings"),
34 "main": "CagouSettings", 37 "main": "CagouSettings",
46 cagou_widget.CagouWidget.__init__(self) 49 cagou_widget.CagouWidget.__init__(self)
47 # the Widget() avoid CagouWidget header to be down at the beginning 50 # the Widget() avoid CagouWidget header to be down at the beginning
48 # then up when the UI is loaded 51 # then up when the UI is loaded
49 self.loading_widget = Widget() 52 self.loading_widget = Widget()
50 self.add_widget(self.loading_widget) 53 self.add_widget(self.loading_widget)
51 G.host.bridge.getParamsUI(-1, C.APP_NAME, self.profile, callback=self.getParamsUICb, errback=self.getParamsUIEb) 54 extra = {}
55 G.local_platform.updateParamsExtra(extra)
56 G.host.bridge.getParamsUI(
57 -1, C.APP_NAME, data_format.serialise(extra), self.profile,
58 callback=self.getParamsUICb,
59 errback=self.getParamsUIEb)
52 60
53 def changeWidget(self, widget): 61 def changeWidget(self, widget):
54 self.clear_widgets([self.loading_widget]) 62 self.clear_widgets([self.loading_widget])
55 del self.loading_widget 63 del self.loading_widget
56 self.add_widget(widget) 64 self.add_widget(widget)