~ubuntu-branches/ubuntu/precise/apport/precise

« back to all changes in this revision

Viewing changes to gtk/apport-gtk

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2012-03-07 14:47:31 UTC
  • mfrom: (148.1.55)
  • Revision ID: package-import@ubuntu.com-20120307144731-vnoff16v0fwhxh0h
Tags: 1.94.1-0ubuntu1
* New upstream bug fix release. Changes since our previous snapshot:
  - apport-cli: Consistently handle unicode vs. byte arrays. (LP: #946207)
  - report.py, anonymize(): Fix crash when the hostname or user name contain
    non-ASCII characters. (LP: #945230)
  - packaging-apt-dpkg.py: Fix UnicodeDecodeError on unexpected md5sum output.
    (LP: #921037)
  - apport-gtk: Fix handling of non-ASCII strings in message dialogs.
    (LP: #620579)

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
        self.w('details_treeview').append_column(column)
56
56
        self.spinner = self.add_spinner_over_treeview(self.w('details_treeview'))
57
57
 
 
58
        self.md = None
 
59
 
58
60
    #
59
61
    # ui_* implementation of abstract UserInterface classes
60
62
    #
270
272
 
271
273
    def _ui_message_dialog(self, title, text, _type,
272
274
            buttons=Gtk.ButtonsType.CLOSE):
273
 
        md = Gtk.MessageDialog(message_type=_type, buttons=buttons)
 
275
        self.md = Gtk.MessageDialog(message_type=_type, buttons=buttons)
274
276
        if 'http://' in text or 'https://' in text:
 
277
            if type(text) != type(b''):
 
278
                text = text.encode('UTF-8')
275
279
            text = GLib.markup_escape_text(text)
276
280
            text = re.sub(r'(https?://[a-zA-Z0-9._-]+(?:[a-zA-Z0-9_#?%/-])*)',
277
281
                    r'<a href="\1">\1</a>', text)
278
282
            # turn URLs into links
279
 
            md.set_markup(text)
 
283
            self.md.set_markup(text)
280
284
        else:
281
285
            # work around gnome #620579
282
 
            md.set_property('text', text.encode('UTF-8'))
283
 
        md.set_title(title)
284
 
        result = md.run()
285
 
        md.hide()
 
286
            self.md.set_property('text', text)
 
287
        self.md.set_title(title)
 
288
        result = self.md.run()
 
289
        self.md.hide()
286
290
        while Gtk.events_pending():
287
291
            Gtk.main_iteration_do(False)
 
292
        self.md = None
288
293
        return result
289
294
 
290
295
    def ui_info_message(self, title, text):