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: Master old -3.6
Hardware: Other All
: medium normal
Assignee: Zolnai Tamás
QA Contact:
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: 2012-08-07 10:32 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


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 | Splinter Review
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 | Splinter Review
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, Zolnai Tamás
Details | Splinter Review
Shorter and clearer form of previous attachment. (120.09 KB, patch)
2012-08-06 19:38 UTC, Zolnai Tamás
Details | Splinter Review

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] [review]
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] [review]
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 Zolnai Tamás 2012-08-06 10:56:27 UTC
Created attachment 65167 [details] [review]
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 Zolnai Tamás 2012-08-06 19:38:22 UTC
Created attachment 65203 [details] [review]
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


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.