@@ -89,12 +89,21 @@ def _warnBrowsableMessageNotAvailableOnSecureScreens(title: Optional[str]) -> No
8989 )
9090
9191
92- def browseableMessage (message : str , title : Optional [str ] = None , isHtml : bool = False ) -> None :
92+ def browseableMessage (
93+ message : str ,
94+ title : Optional [str ] = None ,
95+ isHtml : bool = False ,
96+ closeButtonText : Optional [str ] = None ,
97+ copyButtonText : Optional [str ] = None
98+ ) -> None :
9399 """Present a message to the user that can be read in browse mode.
94100 The message will be presented in an HTML document.
95- @param message: The message in either html or text.
96- @param title: The title for the message.
97- @param isHtml: Whether the message is html
101+ :param message: The message in either html or text.
102+ :param title: The title for the message, defaults to "NVDA Message".
103+ :param isHtml: Whether the message is html, defaults to False.
104+ :param closeButtonText: Text to use as label for a "close" button, defaults to None, meaning no close button.
105+ :param copyButtonText: Text to use as label for a "copy" (to clipboard) button, defaults to None,
106+ meaning no copy button.
98107 """
99108 if isRunningOnSecureDesktop ():
100109 import wx # Late import to prevent circular dependency.
@@ -106,7 +115,7 @@ def browseableMessage(message: str, title: Optional[str] = None, isHtml: bool =
106115 raise LookupError (htmlFileName )
107116 moniker = POINTER (IUnknown )()
108117 windll .urlmon .CreateURLMonikerEx (0 , htmlFileName , byref (moniker ), URL_MK_UNIFORM )
109- if not title :
118+ if title is None :
110119 # Translators: The title for the dialog used to present general NVDA messages in browse mode.
111120 title = _ ("NVDA Message" )
112121 if not isHtml :
@@ -120,6 +129,10 @@ def browseableMessage(message: str, title: Optional[str] = None, isHtml: bool =
120129 return
121130 d .add ("title" , title )
122131 d .add ("message" , message )
132+ if closeButtonText is not None :
133+ d .add ("closeButtonText" , closeButtonText )
134+ if copyButtonText is not None :
135+ d .add ("copyButtonText" , copyButtonText )
123136 dialogArgsVar = automation .VARIANT (d )
124137 gui .mainFrame .prePopup ()
125138 windll .mshtml .ShowHTMLDialogEx (
0 commit comments