From 4bc6b978583a5d7bdf00b276349358d49363eb72 Mon Sep 17 00:00:00 2001 From: dbr Date: Mon, 9 Jan 2012 22:13:59 +1030 Subject: [PATCH] tabtab to create previously created node works Works almost exactly like the built-in one --- tabtabtab.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tabtabtab.py b/tabtabtab.py index 97c423b..262bef8 100644 --- a/tabtabtab.py +++ b/tabtabtab.py @@ -410,15 +410,18 @@ def event(self, event): return super(TabTabTabWidget, self).event(event) def update(self, text): + """On text change, selects first item and updates filter text + """ self.things.setCurrentIndex(self.things_model.index(0)) self.things_model.set_filter(text) def show(self): - """Leaves previous user-input untouched, but selects text. + """Select all the text in the input (which persists between + show()'s) - Means "[tab][tab]" creates previously used node, not the most popular + Allows typing over previously created text, and [tab][tab] to + create previously created node (instead of the most popular) """ - self.input.selectAll() super(TabTabTabWidget, self).show() @@ -436,6 +439,10 @@ def create(self): thing = self.things_model.getorig(selected) + # Store the full UI name of the created node, so it is the + # active node on the next [tab] + self.input.setText(thing['text']) + # Get Nuke menu path of selected menupath = thing['menupath']