changeset 20:29b507826eed

header's input field is now accessible with self.header_input and call onHeaderInput() on text entered
author Goffi <goffi@goffi.org>
date Mon, 08 Aug 2016 01:02:23 +0200
parents c58b522607f4
children 57bf68eacdb9
files src/cagou/core/cagou_widget.py src/cagou/kv/cagou_widget.kv
diffstat 2 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/cagou/core/cagou_widget.py	Mon Aug 08 00:58:59 2016 +0200
+++ b/src/cagou/core/cagou_widget.py	Mon Aug 08 01:02:23 2016 +0200
@@ -23,6 +23,7 @@
 from kivy.uix.button import Button
 from kivy.uix.boxlayout import BoxLayout
 from kivy.uix.dropdown import DropDown
+from kivy import properties
 from cagou import G
 
 
@@ -41,6 +42,7 @@
 
 
 class CagouWidget(BoxLayout):
+    header_input = properties.ObjectProperty(None)
 
     def __init__(self):
         BoxLayout.__init__(self, orientation="vertical")
@@ -49,5 +51,8 @@
     def switchWidget(self, plugin_info):
         self.selector.dismiss()
         factory = plugin_info["factory"]
-        new_widget = factory(plugin_info, None, None)
+        new_widget = factory(plugin_info, None, iter(G.host.profiles))
         G.host.switchWidget(self, new_widget)
+
+    def onHeaderInput(self):
+        log.info(u"header input text entered")
--- a/src/cagou/kv/cagou_widget.kv	Mon Aug 08 00:58:59 2016 +0200
+++ b/src/cagou/kv/cagou_widget.kv	Mon Aug 08 01:02:23 2016 +0200
@@ -24,6 +24,7 @@
     auto_width: False
 
 <CagouWidget>:
+    header_input: header_input
     BoxLayout:
         size_hint: 1, None
         height: 30
@@ -33,4 +34,6 @@
             size_hint: None, 1
             width: 60
         TextInput:
+            id: header_input
             multiline: False
+            on_text_validate: root.onHeaderInput()