70
70
def ui_present_crash(self, desktop_entry):
71
71
# adapt dialog heading and label appropriately
73
# python2+glib needs a confusing mix of UTF-8 str and unicode here :-(
74
n = desktop_entry.getName().encode('UTF-8')
75
n = GLib.markup_escape_text(n).decode('UTF-8')
76
heading = _('Sorry, %s closed unexpectedly') % n
77
elif 'ExecutablePath' in self.report:
78
heading = _('Sorry, the program "%s" closed unexpectedly') % os.path.basename(self.report['ExecutablePath'])
72
if 'Annotation' in self.report:
73
heading = self.report['Annotation']
80
heading = _('Sorry, %s closed unexpectedly') % self.cur_package
76
# python2+glib needs a confusing mix of UTF-8 str and unicode here :-(
77
n = desktop_entry.getName().encode('UTF-8')
78
n = GLib.markup_escape_text(n).decode('UTF-8')
79
heading = _('Sorry, %s closed unexpectedly') % n
80
elif 'ExecutablePath' in self.report:
81
heading = _('Sorry, the program "%s" closed unexpectedly') % os.path.basename(self.report['ExecutablePath'])
83
heading = _('Sorry, %s closed unexpectedly') % self.cur_package
82
85
if desktop_entry and 'ExecutablePath' in self.report and 'ProcCmdline' in self.report and \
83
86
os.path.dirname(self.report['ExecutablePath']) in os.environ['PATH'].split(':') and \
84
87
subprocess.call(['pgrep', '-x',
85
88
os.path.basename(self.report['ExecutablePath']),
86
89
'-u', str(os.geteuid())], stdout=subprocess.PIPE) != 0:
87
self.w('label_heading_reopen').set_markup(self.str_heading % heading)
90
self.w('label_heading_reopen').set_markup(self.str_heading_reopen % heading)
88
91
d = self.w('dialog_crash_reopen')
89
92
bl_checkbox = self.w('checkbutton_blacklist_reopen')
111
114
return {'action': 'cancel', 'blacklist': blacklist}
113
116
def ui_present_package_error(self):
114
self.w('label_heading_package_error').set_markup(
115
self.str_heading_package_error % self.report['Package'])
117
if 'Annotation' in self.report:
118
self.w('label_heading_package_error').set_markup(
119
self.report['Annotation'])
121
self.w('label_heading_package_error').set_markup(
122
self.str_heading_package_error % self.report['Package'])
116
123
response = self.w('dialog_package_error').run()
117
124
self.w('dialog_package_error').hide()
118
125
while Gtk.events_pending():