Layout launcher now responds to double-clicks and Return/Space activation

This commit is contained in:
Stephen Boddy 2013-09-02 17:21:12 +02:00
parent 7f49bcfab9
commit 4f7464b915
2 changed files with 9 additions and 0 deletions

View File

@ -28,6 +28,7 @@
<property name="model">layoutstore</property>
<property name="headers_clickable">False</property>
<property name="search_column">0</property>
<signal name="row-activated" handler="on_row_activated" swapped="no"/>
<child>
<object class="GtkTreeViewColumn" id="treeviewcolumn1">
<property name="title" translatable="yes">Layout</property>

View File

@ -82,6 +82,14 @@ class LayoutLauncher:
self.layouttreestore.prepend([layout])
def on_launchbutton_clicked(self, widget):
"""Handle button click"""
self.launch_layout()
def on_row_activated(self, widget, path, view_column):
"""Handle item double-click and return"""
self.launch_layout()
def launch_layout(self):
"""Launch the selected layout as new instance"""
dbg('We have takeoff!')
selection=self.layouttreeview.get_selection()