signals: Add a 'text' signal for updating the main display
[git-cola.git] / cola / signals.py
blobf5599cee2103c34643f6768b8dea8b02a42ef711
1 from PyQt4.QtCore import SIGNAL
3 _signals = dict(edit = SIGNAL('edit'),
4 checkout = SIGNAL('checkout'),
5 delete = SIGNAL('delete'),
6 diff = SIGNAL('diff'),
7 diff_staged = SIGNAL('diff_staged'),
8 diffstat = SIGNAL('diffstat'),
9 difftool = SIGNAL('difftool'),
10 mergetool = SIGNAL('mergetool'),
11 modified_summary = SIGNAL('modified_summary'),
12 redo = SIGNAL('redo'),
13 reset_mode = SIGNAL('reset_mode'),
14 show_untracked = SIGNAL('show_untracked'),
15 stage = SIGNAL('stage'),
16 stage_diffs = SIGNAL('stage_diffs'),
17 staged_summary = SIGNAL('staged_summary'),
18 text = SIGNAL('text'),
19 unmerged_summary = SIGNAL('unmerged_summary'),
20 undo = SIGNAL('undo'),
21 undo_diffs = SIGNAL('undo_diffs'),
22 unstage = SIGNAL('unstage'),
23 unstage_diffs = SIGNAL('unstage_diffs'),
24 untracked_summary = SIGNAL('untracked_summary'))
26 _signals_names = {}
27 for name, signal in _signals.iteritems():
28 _signals_names[signal] = name
30 # Bring signals into the module namespace
31 globals().update(_signals)
33 def name(signal):
34 """Return the name for a signal."""
35 return _signals_names.get(signal, 'no-name')