gitcmd: Add a git_path() method for finding .git-relative paths
[git-cola.git] / cola / controllers / util.py
blobc09847731c71c8ab98854e817aaba6a472aa4498
1 """This module provides utility controllers.
2 """
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,
15 title=title,
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,
23 title=title,
24 items=items,
25 dblclick=dblclick).selected()