/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to revisionview.py

  • Committer: Daniel Schierbeck
  • Date: 2008-04-02 08:28:59 UTC
  • mto: (450.1.16 trunk)
  • mto: This revision was merged to the branch mainline in revision 458.
  • Revision ID: daniel.schierbeck@gmail.com-20080402082859-p473giuvltz6p9bb
Added comparison with revision committer.

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
 
63
63
    def __init__(self, repository):
64
64
        self.key = None
 
65
        self.revision = None
65
66
        self.repository = repository
66
67
 
67
68
        super(SignatureTab, self).__init__(False, 6)
145
146
    def show_signature(self, crypttext):
146
147
        key = crypt.verify(crypttext)
147
148
 
148
 
        if not key.is_available():
 
149
        if key.is_available():
 
150
            if key.is_trusted():
 
151
                if key.get_display_name() == self.revision.committer:
 
152
                    self.signature_image.set_from_file(icon_path("sign-ok.png"))
 
153
                    self.signature_label.set_markup("<b>Authenticity confirmed</b>\n" +
 
154
                                                    "This revision has been signed with " +
 
155
                                                    "a trusted key.")
 
156
                else:
 
157
                    self.signature_image.set_from_file(icon_path("sign-bad.png"))
 
158
                    self.signature_label.set_markup("<b>Authenticity cannot be confirmed</b>\n" +
 
159
                                                    "Revision committer is not the same as signer.")
 
160
            else:
 
161
                self.signature_image.set_from_file(icon_path("sign-bad.png"))
 
162
                self.signature_label.set_markup("<b>Authenticity cannot be confirmed</b>\n" +
 
163
                                                "This revision has been signed, but the " +
 
164
                                                "key is not trusted.")
 
165
        else:
149
166
            self.show_no_signature()
150
167
            self.signature_image.set_from_file(icon_path("sign-bad.png"))
151
168
            self.signature_label.set_markup("<b>Authenticity cannot be confirmed</b>\n" +
152
169
                                            "Signature key not available.")
153
170
            return
154
171
 
155
 
        if key.is_trusted():
156
 
            self.signature_image.set_from_file(icon_path("sign-ok.png"))
157
 
            self.signature_label.set_markup("<b>Authenticity confirmed</b>\n" +
158
 
                                            "This revision has been signed with " +
159
 
                                            "a trusted key.")
160
 
        else:
161
 
            self.signature_image.set_from_file(icon_path("sign-bad.png"))
162
 
            self.signature_label.set_markup("<b>Authenticity cannot be confirmed</b>\n" +
163
 
                                            "This revision has been signed, but the " +
164
 
                                            "key is not trusted.")
165
 
 
166
172
        trust = key.get_trust()
167
173
 
168
174
        if trust <= crypt.TRUST_NEVER: