# HG changeset patch # User Goffi # Date 1467877161 -7200 # Node ID 440a743b58eeb57ba38361b6e59ccb098474bbfb # Parent accbc3c18762efe9748f1c533e2fd4b5f498a78b Profile manager: Connect button is disabled when no profile is selected diff -r accbc3c18762 -r 440a743b58ee src/profile_manager.kv --- a/src/profile_manager.kv Thu Jul 07 09:39:21 2016 +0200 +++ b/src/profile_manager.kv Thu Jul 07 09:39:21 2016 +0200 @@ -154,6 +154,7 @@ : text: "Connect" size_hint: 1, 0.1 + disabled: not self.ps.list_adapter.selection : diff -r accbc3c18762 -r 440a743b58ee src/profile_manager.py --- a/src/profile_manager.py Thu Jul 07 09:39:21 2016 +0200 +++ b/src/profile_manager.py Thu Jul 07 09:39:21 2016 +0200 @@ -64,7 +64,10 @@ class ConnectButton(Button): - pass + + def __init__(self, ps): + self.ps = ps + super(ConnectButton, self).__init__() class NewProfileScreen(Screen): @@ -140,7 +143,7 @@ ) super(ProfilesScreen, self).__init__(name=u'profiles') self.layout.add_widget(listview.ListView(adapter=self.list_adapter)) - connect_btn = ConnectButton() + connect_btn = ConnectButton(self) self.layout.add_widget(connect_btn) def reload(self):