Bug 46193 - Let the user copy error message from error dialog
Summary: Let the user copy error message from error dialog
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
Master old -3.6
Hardware: Other All
: medium normal
Assignee: Tamás Zolnai
URL:
Whiteboard: target:3.7.0
Keywords:
: 43331 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-02-16 12:20 UTC by Andras Timar
Modified: 2015-08-11 03:29 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Error message in a WarningBox (76.88 KB, image/png)
2012-02-16 12:20 UTC, Andras Timar
Details
Error dialogs created when a macro or extension fails are now contain selectable text (6.34 KB, patch)
2012-02-28 09:47 UTC, Szabolcs Dézsi
Details
Added 'Copy to Clipboard' button to error message dialogs (MessBox class) (4.16 KB, patch)
2012-03-01 10:18 UTC, Szabolcs Dézsi
Details
Screenshot of the button (115.30 KB, image/jpeg)
2012-03-01 10:21 UTC, Szabolcs Dézsi
Details
MessBox was made copyable (795.72 KB, patch)
2012-08-06 10:56 UTC, Tamás Zolnai
Details
Shorter and clearer form of previous attachment. (120.09 KB, patch)
2012-08-06 19:38 UTC, Tamás Zolnai
Details
DB with form which produces error dialog (12.01 KB, application/vnd.oasis.opendocument.database)
2015-07-25 15:17 UTC, senya
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andras Timar 2012-02-16 12:20:48 UTC
Created attachment 57175 [details]
Error message in a WarningBox

Currently when something goes wrong with an extension, LibreOffice displays the error message in a WarningBox. This not very useful, because it is impossible to copy the error message from the WarningBox. User only can make a screenshot. 

Error message should be either in a read-only edit control (thus copyable), or there should be a Copy to Clipboard button. For example Help - About LibreOffice uses read-only edit control. 

Code pointer: SvxScriptErrorDialog in cui/source/dialogs/scriptdlg.cxx
Comment 1 Andras Timar 2012-02-24 01:20:28 UTC
*** Bug 43331 has been marked as a duplicate of this bug. ***
Comment 2 Szabolcs Dézsi 2012-02-28 09:47:49 UTC
Created attachment 57774 [details]
Error dialogs created when a macro or extension fails are now contain selectable text

Hello!

I created a new class in cui/. : CopyableWarningBox (copywarnbox.hxx and copywarnbox.cxx). This class gets instantiated in cui/source/dialogs/scriptdlg.cxx (last method).

I couldn't manage to do the sizing dynamically, so it creates a fix (500*300) dialog.

To test the dialog run ./soffice. Tools/Macros/Run Macro...
Expand LibreOffice Macros/Gimmicks/GetTexts and run GetCellTexts.

Szabolcs
Comment 3 Szabolcs Dézsi 2012-03-01 10:18:21 UTC
Created attachment 57870 [details]
Added 'Copy to Clipboard' button to error message dialogs (MessBox class)

Hi there!

This is another solution using a Button to copy the error message, rather than selectable MultiLineEdit control.

Szabolcs
Comment 4 Szabolcs Dézsi 2012-03-01 10:21:32 UTC
Created attachment 57871 [details]
Screenshot of the button
Comment 5 Cameron Paul 2012-03-01 18:00:39 UTC
The "Copy to Clipboard" button is also showing up in other dialogs such as the one that asks if you want to save a file when closing. I don't know if this was an intended side effect or not, but I thought I should mention it in case no one noticed.
Comment 6 Michael Meeks 2012-05-08 13:16:51 UTC
The patch got reverted due to the button intruding into ~all dialogs.

I quite liked using the MultiLineEdit instead - to make the text copy-able - was there a reason not to do that to the implementation of 'WarningBox' itself in VCL ?

If we made that selectable, I don't think we need to have the button.

Thanks !
Comment 7 Andras Timar 2012-05-08 21:31:00 UTC
MultiLineEdit is implemented in svtools, not in vcl, therefore it is not useable in low level messagebox code.
Comment 8 Caolán McNamara 2012-06-28 08:39:35 UTC
well, someone could try and move it down into vcl and solve it that way :-)
Comment 9 Tamás Zolnai 2012-08-06 10:56:27 UTC
Created attachment 65167 [details]
MessBox was made copyable

Part of MultiLineEdit was moved down from stvools to vcl with name VCLMultiLineEdit. MessBox uses it to display the message in read-only mode. Some of svtools' classes - which are necessary to implement VCLMultiLineEdit - were moved to vcl as a whole.

Note: ExtTextView and ExtTextEngine classes(xtextedt.hxx) would be leaved in svtools if VCLMultiLineEdit can be defined as a template class, but two macros: IMPL_LINK end IMPL_LINK_NOARG make it impossible to use template syntax.
Comment 10 Tamás Zolnai 2012-08-06 19:38:22 UTC
Created attachment 65203 [details]
Shorter and clearer form of previous attachment.
Comment 11 Andras Timar 2012-08-07 10:32:17 UTC
commit 2854d8b17cb873a5d61e06f9570ac344f054d666
Author: Zolnai Tamás <zolniatamas@caesar.elte.hu>
Date:   Mon Aug 6 20:52:37 2012 +0200

    fdo#46193 MessBox was made copyable
    
    Part of MultiLineEdit was moved down from stvools to vcl
    with name VCLMultiLineEdit. MessBox uses it to display the
    message in read-only mode. Some of svtools' classes - which
    are necessary to implement VCLMultiLineEdit - were moved to
    vcl as a whole, and their includes are rewrite.
    Note: ExtTextView and ExtTextEngine classes would be leaved in svtools
    if VCLMultiLineEdit is a template class, but two macros: IMPL_LINK
    end IMPL_LINK_NOARG make it impossible to use template syntax.
    
    Change-Id: I26543868d8081c225c7125404d23369de3c3afcd
Comment 12 senya 2015-07-25 14:40:41 UTC
This seems to be an issue again.
Comment 13 senya 2015-07-25 15:17:47 UTC
Created attachment 117433 [details]
DB with form which produces error dialog

There is a form in the DB. When you try to open it, LO shows an error dialog box. The dialog box's content is impossible to select and copy. (Ubuntu 14.04 LO 4.2.8.2, Windows 8)
Comment 14 Tamás Zolnai 2015-08-11 03:29:32 UTC
(In reply to senya from comment #12)
> This seems to be an issue again.

Please do not reopen such an old bug, it's better to make a new one.
It was a general problem that message boxes were not copyable and this was fixed, by adding the functionality to the message box class. If you find an error box somewhere in LO which does not work like that it must be an other kind of bug, I guess not the appropriate error box is used there.
Please open a new report for the bug you find. It makes easier to the developers to find a solution for that. You can add this bug report to the 'See also' field of the new report.

Thanks,
Tamás