def display_error_message(self, msg, title=None, secondary_text=None):
if solfege.splash_win and solfege.splash_win.props.visible:
solfege.splash_win.hide()
reshow_splash = True
else:
reshow_splash = False
if not isinstance(msg, unicode):
msg = msg.decode(locale.getpreferredencoding(), 'replace')
m = Gtk.MessageDialog(None, Gtk.DialogFlags.MODAL, Gtk.MessageType.ERROR,
Gtk.ButtonsType.CLOSE, None)
m.set_markup(gu.escape(msg))
if title:
m.set_title(title)
if secondary_text:
m.format_secondary_text(secondary_text)
m.run()
m.destroy()
if reshow_splash:
solfege.splash_win.show()
while Gtk.events_pending():
Gtk.main_iteration()
评论列表
文章目录