File tree Expand file tree Collapse file tree 2 files changed +11
-9
lines changed Expand file tree Collapse file tree 2 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -69,9 +69,10 @@ def test_failure_dialog(self):
69
69
translate ("AddonsInstaller" , "Installation Failed" ),
70
70
QtWidgets .QDialogButtonBox .Cancel ,
71
71
)
72
- self .installer_gui ._installation_failed (
73
- self .addon_to_install , "Test of installation failure"
74
- )
72
+ message = "Some addon failed to install, so here is a really long error message that explains in excruciating detail exactly what has gone wrong."
73
+ for error_line in range (100 ):
74
+ message += f"\n Error line { error_line } "
75
+ self .installer_gui ._installation_failed (self .addon_to_install , message )
75
76
self .assertTrue (dialog_watcher .dialog_found , "Failed to find the expected dialog box" )
76
77
self .assertTrue (dialog_watcher .button_found , "Failed to find the expected button" )
77
78
Original file line number Diff line number Diff line change @@ -502,14 +502,15 @@ def _installation_succeeded(self):
502
502
503
503
def _installation_failed (self , addon , message ):
504
504
"""Called if the installation failed."""
505
- QtWidgets .QMessageBox .critical (
506
- utils .get_main_am_window (),
507
- translate ("AddonsInstaller" , "Installation Failed" ),
505
+ error_dialog = QtWidgets .QMessageBox (utils .get_main_am_window ())
506
+ error_dialog .setIcon (QtWidgets .QMessageBox .Critical )
507
+ error_dialog .setWindowTitle (translate ("AddonsInstaller" , "Installation Failed" ))
508
+ error_dialog .setText (
508
509
translate ("AddonsInstaller" , "Failed to install {}" ).format (addon .name )
509
- + "\n "
510
- + message ,
511
- QtWidgets .QMessageBox .Cancel ,
512
510
)
511
+ error_dialog .setStandardButtons (QtWidgets .QMessageBox .Cancel )
512
+ error_dialog .setDetailedText (message )
513
+ error_dialog .exec ()
513
514
self .finished .emit ()
514
515
515
516
You can’t perform that action at this time.
0 commit comments