~simon-kersey/bzr-explorer/add-tool-exec

« back to all changes in this revision

Viewing changes to lib/tool_dialogs.py

  • Committer: Ian Clatworthy
  • Date: 2010-01-10 16:39:42 UTC
  • mfrom: (351.1.9 smart-wt-browser)
  • Revision ID: ian.clatworthy@canonical.com-20100110163942-sckzhy624lj1gqam
Smarter working tree browser

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
from PyQt4 import QtCore, QtGui
18
18
 
19
19
from bzrlib.plugins.explorer.lib import kinds, tools
 
20
from bzrlib.plugins.explorer.lib.helpers import build_combo_with_labels
20
21
from bzrlib.plugins.explorer.lib.i18n import gettext, N_
21
22
 
22
23
 
30
31
    def _build_layout(self):
31
32
        # Build the form
32
33
        self.title_field = QtGui.QLineEdit()
33
 
        self.type_field = self._build_combo_with_labels([
 
34
        self.type_field = build_combo_with_labels([
34
35
            ('bzr', gettext("Bazaar Command")),
35
36
            ('link', gettext("Web Link")),
36
37
            ('application', gettext("Local Application")),
58
59
        layout.addWidget(buttons)
59
60
        return layout
60
61
 
61
 
    def _build_combo_with_labels(self, data_label_tuples):
62
 
        combo = QtGui.QComboBox()
63
 
        for data, label in data_label_tuples:
64
 
            combo.addItem(label, QtCore.QVariant(data))
65
 
        return combo
66
 
 
67
62
    def _build_icon_selector(self):
68
63
        combo = QtGui.QComboBox()
69
64
        combo.addItem('')