Storing some comments along with the composition.

classic Classic list List threaded Threaded
23 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Storing some comments along with the composition.

Yves Guillemot

I always needed a place in RG where I can write some comments (in RG, notes is
a bit ambiguous) about the current composition.
A long time ago I tried to use the supplementary headers of the document, but
that was not really satisfactory.

Since rev. 14403, a new tab "Notes" in Document Properties give acces to an
editor for adding any unformated text to the RG file.

Thanks to report any problem or possible improvment about it.

Yves


------------------------------------------------------------------------------
_______________________________________________
Rosegarden-devel mailing list
[hidden email] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel
Reply | Threaded
Open this post in threaded view
|

Re: Storing some comments along with the composition.

D. Michael McIntyre-3
On 12/14/2015 04:58 PM, Yves Guillemot wrote:

> Since rev. 14403, a new tab "Notes" in Document Properties give acces to an
> editor for adding any unformated text to the RG file.
>
> Thanks to report any problem or possible improvment about it.

This made me smile.

This is one of those ideas I tossed around for years, but never quite
found the motivation to get it done.  I will have a look shortly, and I
may have a couple of ideas of my own to add with this.

--
D. Michael McIntyre

------------------------------------------------------------------------------
_______________________________________________
Rosegarden-devel mailing list
[hidden email] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel
Reply | Threaded
Open this post in threaded view
|

Re: Storing some comments along with the composition.

D. Michael McIntyre-3
In reply to this post by Yves Guillemot
On 12/14/2015 04:58 PM, Yves Guillemot wrote:

> Thanks to report any problem or possible improvment about it.

It's pretty easy to hit the clear button by accident, and you can't undo
if you wipe out the text you typed.  It could have an "are you sure"
dialog or it would be just as good to push some command onto the undo
stack.  Either one of those is just enough trouble to be more than I'm
going to code today.  The undo stack is probably the superior choice,
although I imagine it could get complicated, so the dialog is more
attractive, just because I'm really lazy these days.

I'm thinking about a checkbox under those buttons that says something
like "[x] Show notes when loading document."

Rig the document load code to look for this, and pop up this editor
window after loading is complete.  It isn't immediately obvious how to
implement that, since this is on a tab inside the overall document
properties editor.  I think there are precedents for that elsewhere in
the code.  Make the editor a widget, and the widget can belong to that
page or to a separate, dedicated dialog.

I'm really interested in the ability to show notes upon loading a
document.  I considered doing that for years, and never got around to
it.  Put information in the example files to explain what the thing is
for when the user loads it.  Some files focus on MIDI, some on notation,
some on DSSI plugins, etc., and it would be cool to be able to just tell
the user that stuff in a pop-up dialog they could easily silence.

My interest in this checkbox/pop up dialog is high enough that it's
something I would code myself, but I want to get your opinion before I
hijack your new feature.  (Also, I have practically no time, and if you
should happen to love the idea and go code it yourself, I would not
object in the slightest to being deprived of the opportunity to fire up
my text editor.  This is not remotely the same as asking you to write it
for me, however.)

--
D. Michael McIntyre

------------------------------------------------------------------------------
_______________________________________________
Rosegarden-devel mailing list
[hidden email] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel
Reply | Threaded
Open this post in threaded view
|

Re: Storing some comments along with the composition.

David Faure
On Tuesday 15 December 2015 04:47:16 D. Michael McIntyre wrote:
> It's pretty easy to hit the clear button by accident, and you can't undo
> if you wipe out the text you typed.  It could have an "are you sure"
> dialog or it would be just as good to push some command onto the undo
> stack.  Either one of those is just enough trouble to be more than I'm
> going to code today.  The undo stack is probably the superior choice,
> although I imagine it could get complicated,

QTextEdit has builtin undo/redo support... is this not a QTextEdit?

--
David Faure, [hidden email], http://www.davidfaure.fr
Working on KDE Frameworks 5


------------------------------------------------------------------------------
_______________________________________________
Rosegarden-devel mailing list
[hidden email] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel
Reply | Threaded
Open this post in threaded view
|

Re: Storing some comments along with the composition.

Yves Guillemot
Le mardi 15 décembre 2015, 10:53:23 David Faure a écrit :
> On Tuesday 15 December 2015 04:47:16 D. Michael McIntyre wrote:
> > It's pretty easy to hit the clear button by accident, and you can't undo
> > if you wipe out the text you typed.  It could have an "are you sure"
> > dialog or it would be just as good to push some command onto the undo
> > stack.  Either one of those is just enough trouble to be more than I'm
> > going to code today.  The undo stack is probably the superior choice,
> > although I imagine it could get complicated,
>
> QTextEdit has builtin undo/redo support... is this not a QTextEdit?

Yes, it is a a QtextEdit and yes, undo is working (Ctrl-Z).
I don't know exactly what the redo shortcut is but I presume it should exist.

That said, the clear button is probably not very useful as Ctrl-A Ctrl-X does
the same job.

Yves


------------------------------------------------------------------------------
_______________________________________________
Rosegarden-devel mailing list
[hidden email] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel
Reply | Threaded
Open this post in threaded view
|

Re: Storing some comments along with the composition.

David Faure
On Tuesday 15 December 2015 11:05:24 Yves Guillemot wrote:

> Le mardi 15 décembre 2015, 10:53:23 David Faure a écrit :
> > On Tuesday 15 December 2015 04:47:16 D. Michael McIntyre wrote:
> > > It's pretty easy to hit the clear button by accident, and you can't undo
> > > if you wipe out the text you typed.  It could have an "are you sure"
> > > dialog or it would be just as good to push some command onto the undo
> > > stack.  Either one of those is just enough trouble to be more than I'm
> > > going to code today.  The undo stack is probably the superior choice,
> > > although I imagine it could get complicated,
> >
> > QTextEdit has builtin undo/redo support... is this not a QTextEdit?
>
> Yes, it is a a QtextEdit and yes, undo is working (Ctrl-Z).
> I don't know exactly what the redo shortcut is but I presume it should exist.

Should be Ctrl+Shift+Z on the usual platforms.

> That said, the clear button is probably not very useful as Ctrl-A Ctrl-X does
> the same job.

Ah so it's just clear() that doesn't lead to an undo command, I see.
Maybe setPlainText(QString()) does? Untested.

--
David Faure, [hidden email], http://www.davidfaure.fr
Working on KDE Frameworks 5


------------------------------------------------------------------------------
_______________________________________________
Rosegarden-devel mailing list
[hidden email] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel
Reply | Threaded
Open this post in threaded view
|

Re: Storing some comments along with the composition.

Yves Guillemot
In reply to this post by D. Michael McIntyre-3
Le mardi 15 décembre 2015, 04:47:16 D. Michael McIntyre a écrit :
>
> I'm thinking about a checkbox under those buttons that says something
> like "[x] Show notes when loading document."
>
> Rig the document load code to look for this, and pop up this editor
> window after loading is complete.

Sounds like an interesting idea. I'll think about it.
>
>
> I'm really interested in the ability to show notes upon loading a
> document.  I considered doing that for years, and never got around to
> it.  Put information in the example files to explain what the thing is
> for when the user loads it.  Some files focus on MIDI, some on notation,
> some on DSSI plugins, etc., and it would be cool to be able to just tell
> the user that stuff in a pop-up dialog they could easily silence.
>

My own motivation was coming from the numerous old .rg files I find on my system
containing unfinished works about which I forgot.
But I plainly understand the interest of such a feature applied to the example
files.

Yves


------------------------------------------------------------------------------
_______________________________________________
Rosegarden-devel mailing list
[hidden email] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel
Reply | Threaded
Open this post in threaded view
|

Re: Storing some comments along with the composition.

Yves Guillemot
In reply to this post by David Faure
Le mardi 15 décembre 2015, 11:10:06 David Faure a écrit :

> Ah so it's just clear() that doesn't lead to an undo command, I see.
> Maybe setPlainText(QString()) does? Untested.

It's probably a bit more complex, nevertheless it should not be very difficult
to add an "undo last clear" button.

Yves


------------------------------------------------------------------------------
_______________________________________________
Rosegarden-devel mailing list
[hidden email] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel
Reply | Threaded
Open this post in threaded view
|

Re: Storing some comments along with the composition.

D. Michael McIntyre-3
In reply to this post by Yves Guillemot
On 12/15/2015 05:20 AM, Yves Guillemot wrote:
> Le mardi 15 décembre 2015, 04:47:16 D. Michael McIntyre a écrit :

> My own motivation was coming from the numerous old .rg files I find on my system
> containing unfinished works about which I forgot.

I'll use the notes to help manage that problem too, believe me!  This
was a great idea.
--
D. Michael McIntyre

------------------------------------------------------------------------------
_______________________________________________
Rosegarden-devel mailing list
[hidden email] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel
Reply | Threaded
Open this post in threaded view
|

Re: Storing some comments along with the composition.

D. Michael McIntyre-3
In reply to this post by Yves Guillemot
On 12/15/2015 05:45 AM, Yves Guillemot wrote:
> Le mardi 15 décembre 2015, 11:10:06 David Faure a écrit :

> It's probably a bit more complex, nevertheless it should not be very difficult
> to add an "undo last clear" button.

That seems like more trouble than the hypothetical problem is worth.

--
D. Michael McIntyre

------------------------------------------------------------------------------
_______________________________________________
Rosegarden-devel mailing list
[hidden email] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel
Reply | Threaded
Open this post in threaded view
|

Re: Storing some comments along with the composition.

Yves Guillemot
Le mardi 15 décembre 2015, 06:42:53 D. Michael McIntyre a écrit :
> On 12/15/2015 05:45 AM, Yves Guillemot wrote:
> > It's probably a bit more complex, nevertheless it should not be very
> > difficult to add an "undo last clear" button.
>
> That seems like more trouble than the hypothetical problem is worth.

It was quite simple: Done in rev. 14409.

Of course, there is only one level of undo, but it should be sufficient to fix an
accidental press on a button.

--
Yves

------------------------------------------------------------------------------
_______________________________________________
Rosegarden-devel mailing list
[hidden email] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel
Reply | Threaded
Open this post in threaded view
|

Re: Storing some comments along with the composition.

David Faure
On Tuesday 15 December 2015 17:47:12 Yves Guillemot wrote:
> Le mardi 15 décembre 2015, 06:42:53 D. Michael McIntyre a écrit :
> > On 12/15/2015 05:45 AM, Yves Guillemot wrote:
> > > It's probably a bit more complex, nevertheless it should not be very
> > > difficult to add an "undo last clear" button.
> >
> > That seems like more trouble than the hypothetical problem is worth.
>
> It was quite simple: Done in rev. 14409.

In that commit there are a number of calls to tr() in the initialization
of global QStrings, like:

+static const QString clearLabel(QObject::tr("Clear", "Button label"));

That is not going to work, it's going to try and translate the string before
even main() starts, so the choice of language didn't happen yet
and the translations are not loaded.

You need to call tr() from functions, or use the QT_TR_NOOP indirection
(which allows static strings translated later on at runtime, but still
marked for translation so that lupdate picks them up).

In this case a bunch of private method should do the job,
although of course they don't have to just return a QString,
they can set it onto the right button directly, i.e. one method
could do m_reloadButton->setText(tr(...)) + m_reloadButton->setToolTip(tr(...))

Also note that QObject::tr loses the class context, while tr() in a qobject
subclass will use that classname as context.

--
David Faure, [hidden email], http://www.davidfaure.fr
Working on KDE Frameworks 5


------------------------------------------------------------------------------
_______________________________________________
Rosegarden-devel mailing list
[hidden email] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel
Reply | Threaded
Open this post in threaded view
|

Re: Storing some comments along with the composition.

Yves Guillemot
Le mardi 15 décembre 2015, 18:04:41 David Faure a écrit :

> On Tuesday 15 December 2015 17:47:12 Yves Guillemot wrote:
> > Le mardi 15 décembre 2015, 06:42:53 D. Michael McIntyre a écrit :
> > > On 12/15/2015 05:45 AM, Yves Guillemot wrote:
> > > > It's probably a bit more complex, nevertheless it should not be very
> > > > difficult to add an "undo last clear" button.
> > >
> > > That seems like more trouble than the hypothetical problem is worth.
> >
> > It was quite simple: Done in rev. 14409.
>
> In that commit there are a number of calls to tr() in the initialization
> of global QStrings, like:

That was an attempt to limit the translators work as some strings are used in
two different places. But yes, I don't think too much at this and I don't try
to get the translation working.
 
> In this case a bunch of private method should do the job,
> although of course they don't have to just return a QString,
> they can set it onto the right button directly, i.e. one method
> could do m_reloadButton->setText(tr(...)) +
> m_reloadButton->setToolTip(tr(...))
>
Thanks David, I'm going to modify the code in that way.

Yves


------------------------------------------------------------------------------
_______________________________________________
Rosegarden-devel mailing list
[hidden email] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel
Reply | Threaded
Open this post in threaded view
|

Re: Storing some comments along with the composition.

David Faure
On Tuesday 15 December 2015 19:56:16 Yves Guillemot wrote:
>
> That was an attempt to limit the translators work as some strings are used in
> two different places.

Hehe but lupdate groups together duplicated strings in the same context,
so translators don't get duplicates ;-)

(however I agree that duplication is always bad anyway, for other reasons like maintenance)

--
David Faure, [hidden email], http://www.davidfaure.fr
Working on KDE Frameworks 5


------------------------------------------------------------------------------
_______________________________________________
Rosegarden-devel mailing list
[hidden email] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel
Reply | Threaded
Open this post in threaded view
|

Re: Storing some comments along with the composition.

Yves Guillemot
Le mardi 15 décembre 2015, 21:48:06 David Faure a écrit :
>
> Hehe but lupdate groups together duplicated strings in the same context,
> so translators don't get duplicates ;-)
>
That's a good news and probably I never noticed it because I don't look too
much at that context when doing translation.

> (however I agree that duplication is always bad anyway, for other reasons
> like maintenance)
BTW the method you suggested allows to gather some lines and makes the code
cleaner.


Yves


------------------------------------------------------------------------------
_______________________________________________
Rosegarden-devel mailing list
[hidden email] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel
Reply | Threaded
Open this post in threaded view
|

Re: Storing some comments along with the composition.

D. Michael McIntyre-3
On 12/15/2015 04:08 PM, Yves Guillemot wrote:

> That's a good news and probably I never noticed it because I don't look too
> much at that context when doing translation.

I'm not sure I even see the context as a real advantage most of the
time.  This creates tons of duplication.

> BTW the method you suggested allows to gather some lines and makes the code
> cleaner.

All of that worked out quite well, and I like the result.  Changing the
text and using the same buttons was an elegant design decision.
--
D. Michael McIntyre

------------------------------------------------------------------------------
_______________________________________________
Rosegarden-devel mailing list
[hidden email] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel
Reply | Threaded
Open this post in threaded view
|

Re: Storing some comments along with the composition.

David Faure
On Tuesday 15 December 2015 18:06:24 D. Michael McIntyre wrote:
> On 12/15/2015 04:08 PM, Yves Guillemot wrote:
>
> > That's a good news and probably I never noticed it because I don't look too
> > much at that context when doing translation.
>
> I'm not sure I even see the context as a real advantage most of the
> time.  This creates tons of duplication.

That's true. This is one of the reasons why I consider gettext superior to tr() :-)

(KDE uses gettext)

--
David Faure, [hidden email], http://www.davidfaure.fr
Working on KDE Frameworks 5


------------------------------------------------------------------------------
_______________________________________________
Rosegarden-devel mailing list
[hidden email] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel
Reply | Threaded
Open this post in threaded view
|

Re: Storing some comments along with the composition.

D. Michael McIntyre-3
On 12/16/2015 02:39 AM, David Faure wrote:

> That's true. This is one of the reasons why I consider gettext superior to tr() :-)
>
> (KDE uses gettext)

I completely agree.  I miss i18n().
--
D. Michael McIntyre

------------------------------------------------------------------------------
_______________________________________________
Rosegarden-devel mailing list
[hidden email] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel
Reply | Threaded
Open this post in threaded view
|

Re: Storing some comments along with the composition.

Yves Guillemot
In reply to this post by D. Michael McIntyre-3
Le mardi 15 décembre 2015, 04:47:16 D. Michael McIntyre a écrit :
>
> I'm thinking about a checkbox under those buttons that says something
> like "[x] Show notes when loading document."
>
> Rig the document load code to look for this, and pop up this editor
> window after loading is complete.

This sould be done in rev. 14417.

An example of such a comment is added to lilypond-alternative-endings_new-
way.rg
(I know the poor quality of my English, so thanks to any native speaker who
will be kind enough to fix it.)

The next step will be to add a way to store translations along with the
reference text and to display what is matching the locale...

Yves


------------------------------------------------------------------------------
_______________________________________________
Rosegarden-devel mailing list
[hidden email] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel
Reply | Threaded
Open this post in threaded view
|

Re: Storing some comments along with the composition.

D. Michael McIntyre-3
On 12/27/2015 05:11 PM, Yves Guillemot wrote:

> This sould be done in rev. 14417.

I'll check it out soon.

> (I know the poor quality of my English, so thanks to any native speaker who
> will be kind enough to fix it.)

If you feel bad about your English, you should try to remember the last
time you saw me speaking French.  I have a university degree in French,
and have likely read as much obscure literature in your language as you
have, if not more.  It's depressing that my French is so bad.

> The next step will be to add a way to store translations along with the
> reference text and to display what is matching the locale...

That sounds cool!  On the subject of translations, I mean to go through
the reworked translation tools and make sure everything is working
properly before I release 12.12.  I want to get it out before the end of
the year, and I am running out of time.

There is at least one very bad Qt5 bug I do not have time to solve, so
I'm going to make a note that Qt5 is for testing purposes only, and
production builds should use Qt4.
--
D. Michael McIntyre

------------------------------------------------------------------------------
_______________________________________________
Rosegarden-devel mailing list
[hidden email] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel
12