Skip to content

Commit

Permalink
tabtab to create previously created node works
Browse files Browse the repository at this point in the history
Works almost exactly like the built-in one
  • Loading branch information
dbr committed Jan 9, 2012
1 parent 021420e commit 4bc6b97
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions tabtabtab.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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']

Expand Down

0 comments on commit 4bc6b97

Please sign in to comment.