mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-01-11 05:17:59 +03:00
error: Set a cap on error dialog text size
Otherwise we can get some crazy sized dialogs with errors from libvirt https://bugzilla.redhat.com/show_bug.cgi?id=1786873 Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
parent
b1b9e4b688
commit
a9cbc4e583
@ -15,6 +15,11 @@ from .baseclass import vmmGObject
|
||||
|
||||
def _launch_dialog(dialog, primary_text, secondary_text, title,
|
||||
widget=None, modal=True):
|
||||
if primary_text and len(primary_text) > 512:
|
||||
primary_text = primary_text[:512] + "..."
|
||||
if secondary_text and len(secondary_text) > 512:
|
||||
secondary_text = secondary_text[:512] + "..."
|
||||
|
||||
dialog.set_property("text", primary_text)
|
||||
dialog.format_secondary_text(secondary_text or None)
|
||||
dialog.set_title(title)
|
||||
|
Loading…
Reference in New Issue
Block a user