1 """This module provides utility controllers.
3 from PyQt4
import QtGui
5 from cola
import qtutils
6 from cola
.views
import itemlist
7 from cola
.views
import combo
8 from cola
.qobserver
import QObserver
11 def choose_from_combo(title
, items
):
12 """Quickly choose an item from a list using a combo box"""
13 parent
= QtGui
.QApplication
.instance().activeWindow()
14 return combo
.ComboView(parent
,
16 items
=items
).selected()
19 def choose_from_list(title
, items
=None, dblclick
=None):
20 """Quickly choose an item from a list using a list widget"""
21 parent
= QtGui
.QApplication
.instance().activeWindow()
22 return itemlist
.ListView(parent
,
25 dblclick
=dblclick
).selected()