~doctormo/groundcontrol/translations

« back to all changes in this revision

Viewing changes to GroundControl/branches.py

  • Committer: Andrew Starr-Bochicchio
  • Date: 2010-01-30 04:27:50 UTC
  • mto: This revision was merged to the branch mainline in revision 128.
  • Revision ID: a.starr.b@gmail.com-20100130042750-8n0gwen7f1xvdati
Initial work on illn support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
from GroundControl.launchpad import LaunchpadProject, get_launchpad
35
35
from GroundControl.bazaar import BranchStatusApp, CheckoutStatusApp
36
36
 
 
37
import locale
 
38
locale.setlocale(locale.LC_ALL, '')
 
39
import gettext
 
40
gettext.install("groundcontrol")
 
41
 
37
42
project_icons = IconManager('project')
38
43
person_icons = IconManager('person')
39
 
wait_lp_msg = """<b><big>Logging into Launchpad...</big></b>
40
 
 
41
 
<i><b>Please Wait...</b></i>"""
42
 
wait_br_msg = """<b><big>Loading Available Branches...</big></b>
43
 
 
44
 
<i><b>Loading Branch: %s</b></i>"""
 
44
wait_lp_msg = _("""<b><big>Logging into Launchpad...</big></b>
 
45
 
 
46
<i><b>Please Wait...</b></i>""")
 
47
wait_br_msg = _("""<b><big>Loading Available Branches...</big></b>
 
48
 
 
49
<i><b>Loading Branch: %s</b></i>""")
45
50
 
46
51
class SelectionWindow(ThreadedWindow):
47
52
    """Select a branch to import."""
65
70
    def inital_thread(self):
66
71
        """Load anything outside of the gtk call"""
67
72
        name = self.launchpad.me.name
68
 
        logging.debug("Adding to the list...")
 
73
        logging.debug(_("Adding to the list..."))
69
74
        # We need to lock access to items until we're finished because
70
75
        # launchpadlib isn't thread safe and multiple requests will kill it.
71
76
        self.slist.project(self.project)
75
80
        self.slist.add( self.project.branches(self.call, 'update_status') )
76
81
        self.call('load_complete')
77
82
        # Load the me user for quicker comparison later
78
 
        logging.debug("Finished adding to list for %s..." % name)
 
83
        logging.debug(_("Finished adding to list for %s...") % name)
79
84
 
80
85
    def signals(self):
81
86
        """Add any extra gui signals"""
122
127
                label.set_markup(
123
128
                    "<span foreground='red'>*Required* %s</span>" % old)
124
129
        else:
125
 
            logging.debug("This should never happen.")
 
130
            logging.debug(_("This should never happen."))
126
131
 
127
132
    @property
128
133
    def launchpad(self):
129
134
        """Return a valid launchpad object"""
130
135
        if self._launchpad == None:
131
 
            logging.debug("Loading launchpad object...")
 
136
            logging.debug(_("Loading launchpad object..."))
132
137
            self._launchpad = get_launchpad()
133
138
        return self._launchpad
134
139
 
137
142
        """Return a project object on demand"""
138
143
        if not self._project:
139
144
            lp = self.launchpad
140
 
            logging.debug("Loading project object...")
 
145
            logging.debug(_("Loading project object..."))
141
146
            self._project = LaunchpadProject(lp.launchpad, oid=self.oid)
142
147
        return self._project
143
148
 
144
149
    def update_status(self, project=None):
145
150
        """This simply keeps the user up to date"""
146
 
        logging.debug("Updating Status to: %s" % str(project))
 
151
        logging.debug(_("Updating Status to: %s") % str(project))
147
152
        if project:
148
153
            msg = wait_br_msg % project.name
149
154
        else:
190
195
    def __init__(self, widget, **args):
191
196
        self._locked = False
192
197
        self._project = None
193
 
        args['name'] = "Project Branches" #self.project().name
 
198
        args['name'] = _("Project Branches") #self.project().name
194
199
        super(BranchView, self).__init__(widget, **args)
195
200
 
196
201
    def project(self, set_project=None):
206
211
            size = 'large'
207
212
            weight = 'normal'
208
213
            style = 'normal'
209
 
            comment = "by %s" % item.owner.name
 
214
            comment = _("by %s") % item.owner.name
210
215
            if item.develop:
211
 
                comment = "(Development Focus)"
 
216
                comment = _("(Development Focus)")
212
217
                size = 'x-large'
213
218
                weight = 'bold'
214
219
            elif item.series:
215
 
                comment = "(%s Series Focus)" % item.series.title()
 
220
                comment = _("(%s Series Focus)") % item.series.title()
216
221
                size = 'x-large'
217
222
                weight = 'bold'
218
223
                style = 'italic'
233
238
            cell.set_property("visible", True)
234
239
 
235
240
        svlist = super(BranchView, self).setup()
236
 
        column = gtk.TreeViewColumn(("%s Branches" % self._name))
 
241
        column = gtk.TreeViewColumn((_("%s Branches") % self._name))
237
242
        column.set_sizing(gtk.TREE_VIEW_COLUMN_AUTOSIZE)
238
243
        column.set_expand(True)
239
244
        # The icon