Re: [Libreoffice-ux-advise] [PATCH] fdo#34772 Word count / statistics in the status bar

2012-05-24 Thread Muhammad Haggag
Thanks for the help!

I created a followup patch that makes the strings as resources:
https://bugs.freedesktop.org/attachment.cgi?id=62063

Review:
https://bugs.freedesktop.org/page.cgi?id=splinter.htmlbug=34772attachment=62063

Regards,
--Muhammad
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice-ux-advise] [PATCH] fdo#34772 Word count / statistics in the status bar

2012-05-23 Thread Petr Mladek
Michael Meeks píše v Út 22. 05. 2012 v 17:57 +0100:
   Normally for this a pseudo-printf format would be used so use a % or $
 magic in the string to be replaced. For an example of that:
 
 String STR_RECOVER_QUERY
 {
 Text [ en-US ] = Should the file \$1\ be restored? ;
 };

You might find a working example of substitution in the commit
http://cgit.freedesktop.org/libreoffice/core/commit/?id=8c7ca43f690b12043d78a698f622eb565f305782

The important part is adding %ABOUTBOXPRODUCTVERSIONSUFFIX into
cui/source/dialogs/about.src and calling

rStr.SearchAndReplaceAllAscii( %ABOUTBOXPRODUCTVERSIONSUFFIX,
rAboutBoxVersionSuffix );

in desktop/source/app/app.cxx


Note that this only describes how to modify existing string and how to
replace the value. If you want to add new GUI element, you need to
define also an ID in the related .hrc file, call ResId() to get the
localized string, ...


Best Regards,
Petr

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice-ux-advise] [PATCH] fdo#34772 Word count / statistics in the status bar

2012-05-22 Thread Michael Meeks

On Tue, 2012-05-22 at 18:36 +0300, Muhammad Haggag wrote:
 a glance what the numbers mean. It looks like this:
 http://imgur.com/3WqVD

Wow - glad you got it working nicely :-) Thanks for that ...

 Also, I'm not sure how localizable string literals are handled in the
 code base. Does LO use something like gettext, or do I have to
 explicitly add a string resource and load it?

You get to add the string into a '.src' file, and allocate a magic
number for it in a .hrc file (hunt for a spare space in the integer
space), then load it via a ResId()

eg. aBuf.append(String(ScResId(SCSTR_EXTDOC_NOT_LOADED)));

I'd git grep for STR_ in sc/ or something to see a number of those.

Normally for this a pseudo-printf format would be used so use a % or $
magic in the string to be replaced. For an example of that:

String STR_RECOVER_QUERY
{
Text [ en-US ] = Should the file \$1\ be restored? ;
};

Or somesuch (though I can't see that used - which is annoying, I wonder
why it is in the .src file and hence compiled, translated, and
distributed when it's not used ;-).

Anyhow a quick hunt about for substituting that sort of thing would
prolly do what you want.

Nice work !

Michael.

-- 
michael.me...@suse.com  , Pseudo Engineer, itinerant idiot

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-ux-advise] [PATCH] fdo#34772 Word count / statistics in the status bar

2012-05-22 Thread Muhammad Haggag
Hello.

(Ux folks, please advise on the UX/Localization section below).

Bug:

https://bugs.freedesktop.org/show_bug.cgi?id=34772

Patch:
=
https://bugs.freedesktop.org/attachment.cgi?id=61962

Patch review:
===
https://bugs.freedesktop.org/page.cgi?id=splinter.htmlbug=34772attachment=61962

Changes (copied from patch):

This change adds a new status bar control,
SwWordCountStatusBarControl. The control shows the number of words
selected as well as the number of words in the whole document.
Double-clicking the control launches the modeless word count dialog.

Verification:
==
I tested with small documents (to the tune of 30 pages, ~3500 words).
I'd like to try it out on a large/huge document to make sure there's
no performance impact. Are there any standard large documents used
for LO performance testing?

UX/Localization:
=
Currently the status bar displays counts in the form: Words:
number-of-selected-words/total-number-of-words. It's not clear at
a glance what the numbers mean. It looks like this:
http://imgur.com/3WqVD

How do you suggest we go about displaying this information clearly,
hopefully without being overly verbose?

Also, I'm not sure how localizable string literals are handled in the
code base. Does LO use something like gettext, or do I have to
explicitly add a string resource and load it?

Open Issues/Questions:

* What's the point of viewsh.sdi? (compared to _viewsh.sdi).
_viewsh.sdi seems to be referencing the methods actually getting
invoked for word-count related logic.

* swriter.sdi: I based the entry for StateWordCount on StatePageCount.
I'm not sure what the fields mean (e.g. StatusBarConfig).

* How do I update LO help with material for the new status bar field?
I can see that other controls have their own documentation pages (e.g.
helpcontent2/source/text/swriter/02/0801.xhp documents the page
count control), but I don't know what template the files follow or
what the fields mean. This is what I have so far:
https://bugs.freedesktop.org/attachment.cgi?id=61963

Regards,
--Muhammad
___
Libreoffice-ux-advise mailing list
Libreoffice-ux-advise@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-ux-advise


Re: [Libreoffice-ux-advise] [PATCH] fdo#34772 Word count / statistics in the status bar

2012-05-22 Thread Muhammad Haggag
On Tue, May 22, 2012 at 6:13 PM, Regina Henschel
rb.hensc...@t-online.de wrote:
 Hi Muhammad,
[...]
 I don't know about standard 'large' documents for testing. You can use the
 document 'part1' of the ODF specification, which has 864 pages.
 http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.odt

Thanks! That's exactly what I had in mind.

Aside from slow loading (due to having a debug + dbgutil build),
runtime performance seems unaffected compared to a vanilla build.

Regards,
--Muhammad
___
Libreoffice-ux-advise mailing list
Libreoffice-ux-advise@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-ux-advise