Patch for P5: Pressing OK in Preferences removes action text in Undo Menu

15 messages Options
Embed this post
Permalink
Vidyashankar Vellal

Patch for P5: Pressing OK in Preferences removes action text in Undo Menu

Reply Threaded More More options
Print post
Permalink
Hi

I have attached a small patch for this. Though the checklist didn't mention it, the problem is present with Redo also. Both have been corrected.

Description of patch: When building menus, check if an undo is available. If yes, add its description to the menu item. Similarly with redo.

Though this is not a priority for 2.0, I was just going through the checklist and thought this could be solved quickly. Whenever someone gets time, please check the patch and commit it.

Thanks

Vidyashankar

[PrefUndoDescription.patch]

? PrefUndoDescription.patch
Index: src/Menus.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/Menus.cpp,v
retrieving revision 1.530
diff -u -r1.530 Menus.cpp
--- src/Menus.cpp 18 Oct 2009 19:58:17 -0000 1.530
+++ src/Menus.cpp 19 Oct 2009 12:21:45 -0000
@@ -330,7 +330,14 @@
    c->SetDefaultFlags(AudioIONotBusyFlag | TimeSelectedFlag | TracksSelectedFlag,
                       AudioIONotBusyFlag | TimeSelectedFlag | TracksSelectedFlag);
 
-   c->AddItem(wxT("Undo"), _("&Undo"), FN(OnUndo), wxT("Ctrl+Z"),
+   UndoManager *undoMgr = GetUndoManager();
+   wxString undoDescription = _("");
+   if(undoMgr->UndoAvailable())
+   {
+      unsigned int state = undoMgr->GetCurrentState();
+      undoMgr->GetShortDescription(state, &undoDescription);
+   }
+   c->AddItem(wxT("Undo"), _("&Undo " + undoDescription), FN(OnUndo), wxT("Ctrl+Z"),
               AudioIONotBusyFlag | UndoAvailableFlag,
               AudioIONotBusyFlag | UndoAvailableFlag);
 
@@ -342,7 +349,13 @@
       wxT("Ctrl+Shift+Z");
 #endif
 
-   c->AddItem(wxT("Redo"), _("&Redo"), FN(OnRedo), key,
+   wxString redoDescription = _("");
+   if(undoMgr->RedoAvailable())
+   {
+      unsigned int state = undoMgr->GetCurrentState();
+      undoMgr->GetShortDescription(state + 1, &redoDescription); // redo state is current state + 1
+   }
+   c->AddItem(wxT("Redo"), _("&Redo " + redoDescription), FN(OnRedo), key,
               AudioIONotBusyFlag | RedoAvailableFlag,
               AudioIONotBusyFlag | RedoAvailableFlag);
 


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Gale (Audacity Team)

Re: Patch for P5: Pressing OK in Preferences removes action text in Undo Menu

Reply Threaded More More options
Print post
Permalink

| From Vidyashankar Vellal <[hidden email]>
| Mon, 19 Oct 2009 18:00:32 +0530
| Subject: [Audacity-devel] Patch for P5: Pressing OK in Preferences removes action text in Undo Menu

> I have attached a small patch for this. Though the checklist didn't
> mention it, the problem is present with Redo also. Both have been
> corrected.
>
> Description of patch: When building menus, check if an undo is available.
> If yes, add its description to the menu item. Similarly with redo.
>
> Though this is not a priority for 2.0, I was just going through the checklist
> and thought this could be solved quickly. Whenever someone gets time,
> please check the patch and commit it.


Thanks, Vidyashankar. I had one small query before committing it.

If I launch a project,  generate a DTMF tone (so get "Undo DTMF Tones"
in the Edit menu),  open Preferences then OK, "Undo DTMF Tones"
remains, but the greyed out "Can't Redo" has changed to greyed
out "Redo".  If I click "Undo DTMF Tones" and open Preferences and
OK, greyed out "Can't Undo" changes to "greyed out "Undo". Which
is what I'd expect from your description, and is as before. Worth
addressing?  

 

Gale

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Vidyashankar Vellal

Re: Patch for P5: Pressing OK in Preferences removes action text in Undo Menu

Reply Threaded More More options
Print post
Permalink

On Tue, Oct 20, 2009 at 3:22 PM, Gale Andrews <[hidden email]> wrote:

Thanks, Vidyashankar. I had one small query before committing it.

If I launch a project,  generate a DTMF tone (so get "Undo DTMF Tones"
in the Edit menu),  open Preferences then OK, "Undo DTMF Tones"
remains, but the greyed out "Can't Redo" has changed to greyed
out "Redo".  If I click "Undo DTMF Tones" and open Preferences and
OK, greyed out "Can't Undo" changes to "greyed out "Undo". Which
is what I'd expect from your description, and is as before. Worth
addressing?

I have attached a new patch. Greyed-out "Undo" changed to greyed-out "Can't Undo". Same with Redo

Vidyashankar
 
 
Gale

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel


[PrefUndoDescription2.patch]

? PrefUndoDescription2.patch
Index: src/Menus.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/Menus.cpp,v
retrieving revision 1.530
diff -u -r1.530 Menus.cpp
--- src/Menus.cpp 18 Oct 2009 19:58:17 -0000 1.530
+++ src/Menus.cpp 20 Oct 2009 13:22:38 -0000
@@ -330,7 +330,18 @@
    c->SetDefaultFlags(AudioIONotBusyFlag | TimeSelectedFlag | TracksSelectedFlag,
                       AudioIONotBusyFlag | TimeSelectedFlag | TracksSelectedFlag);
 
-   c->AddItem(wxT("Undo"), _("&Undo"), FN(OnUndo), wxT("Ctrl+Z"),
+   wxString undoStr = _("");
+   UndoManager *undoMgr = GetUndoManager();
+   if(undoMgr->UndoAvailable())
+   {
+      wxString undoDescription = _("");
+      unsigned int state = undoMgr->GetCurrentState();
+      undoMgr->GetShortDescription(state, &undoDescription);
+      undoStr = _("&Undo " + undoDescription);
+   }
+   else
+      undoStr = _("Can't Undo");
+   c->AddItem(wxT("Undo"), undoStr, FN(OnUndo), wxT("Ctrl+Z"),
               AudioIONotBusyFlag | UndoAvailableFlag,
               AudioIONotBusyFlag | UndoAvailableFlag);
 
@@ -342,7 +353,17 @@
       wxT("Ctrl+Shift+Z");
 #endif
 
-   c->AddItem(wxT("Redo"), _("&Redo"), FN(OnRedo), key,
+   wxString redoStr = _("");
+   if(undoMgr->RedoAvailable())
+   {
+      wxString redoDescription = _("");
+      unsigned int state = undoMgr->GetCurrentState();
+      undoMgr->GetShortDescription(state + 1, &redoDescription); // redo state is current state + 1
+      redoStr = _("&Redo " + redoDescription);
+   }
+   else
+      redoStr = _("Can't Redo");
+   c->AddItem(wxT("Redo"), redoStr, FN(OnRedo), key,
               AudioIONotBusyFlag | RedoAvailableFlag,
               AudioIONotBusyFlag | RedoAvailableFlag);
 


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Vaughan Johnson

Re: Patch for P5: Pressing OK in Preferences removes action text in Undo Menu

Reply Threaded More More options
Print post
Permalink
Vidyashankar Vellal wrote:

>
> On Tue, Oct 20, 2009 at 3:22 PM, Gale Andrews <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>
>     Thanks, Vidyashankar. I had one small query before committing it.
>
>     If I launch a project,  generate a DTMF tone (so get "Undo DTMF Tones"
>     in the Edit menu),  open Preferences then OK, "Undo DTMF Tones"
>     remains, but the greyed out "Can't Redo" has changed to greyed
>     out "Redo".  If I click "Undo DTMF Tones" and open Preferences and
>     OK, greyed out "Can't Undo" changes to "greyed out "Undo". Which
>     is what I'd expect from your description, and is as before. Worth
>     addressing?
>
>
> I have attached a new patch. Greyed-out "Undo" changed to greyed-out
> "Can't Undo". Same with Redo
>

I haven't been following this, but I don't like "Can't Undo". A
grayed-out (disabled) menu item is necessarily "can't". Yes, I see
Microsoft does "Can't Undo" in Excel and probably elsewhere, but I think
they're the worst example to follow (and they *don't* do it in Visual
Studio). I think it's pointless, so undesirable (and generates more work
for translators). Ever since the first Mac, grayed out means disabled.

And would we then prefix "Can't " on every command when it's disabled?
"Can't Amplify", etc? Obviously a bad idea, but then why should undo and
redo be inconsistent with all other commands?

-1.


- Vaughan


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Ed Musgrove-2

Re: Patch for P5: Pressing OK in Preferences removes action text in Undo Menu

Reply Threaded More More options
Print post
Permalink
-1 from me too, what Vaughan said is "right"

--Ed


> -----Original Message-----
> From: Vaughan Johnson [mailto:[hidden email]]
> Sent: Tuesday, October 20, 2009 3:57 PM
> To: [hidden email]
> Subject: Re: [Audacity-devel] Patch for P5: Pressing OK in Preferences
> removes action text in Undo Menu
>
> Vidyashankar Vellal wrote:
> >
> > On Tue, Oct 20, 2009 at 3:22 PM, Gale Andrews <[hidden email]
> > <mailto:[hidden email]>> wrote:
> >
> >
> >     Thanks, Vidyashankar. I had one small query before committing it.
> >
> >     If I launch a project,  generate a DTMF tone (so get "Undo DTMF
Tones"

> >     in the Edit menu),  open Preferences then OK, "Undo DTMF Tones"
> >     remains, but the greyed out "Can't Redo" has changed to greyed
> >     out "Redo".  If I click "Undo DTMF Tones" and open Preferences and
> >     OK, greyed out "Can't Undo" changes to "greyed out "Undo". Which
> >     is what I'd expect from your description, and is as before. Worth
> >     addressing?
> >
> >
> > I have attached a new patch. Greyed-out "Undo" changed to greyed-out
> > "Can't Undo". Same with Redo
> >
>
> I haven't been following this, but I don't like "Can't Undo". A grayed-out
> (disabled) menu item is necessarily "can't". Yes, I see Microsoft does
"Can't

> Undo" in Excel and probably elsewhere, but I think they're the worst
> example to follow (and they *don't* do it in Visual Studio). I think it's
> pointless, so undesirable (and generates more work for translators). Ever
> since the first Mac, grayed out means disabled.
>
> And would we then prefix "Can't " on every command when it's disabled?
> "Can't Amplify", etc? Obviously a bad idea, but then why should undo and
> redo be inconsistent with all other commands?
>
> -1.
>
>
> - Vaughan
>
>
>
----------------------------------------------------------------------------
--
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA is
the
> only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> audacity-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/audacity-devel



------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Gale (Audacity Team)

Re: Patch for P5: Pressing OK in Preferences removes action text in Undo Menu

Reply Threaded More More options
Print post
Permalink
In reply to this post by Vaughan Johnson

| From Vaughan Johnson <[hidden email]>
| Tue, 20 Oct 2009 15:56:58 -0700
| Subject: [Audacity-devel] Patch for P5: Pressing OK in Preferences removes action text in Undo Menu

> Vidyashankar Vellal wrote:
> >
> > On Tue, Oct 20, 2009 at 3:22 PM, Gale Andrews <[hidden email]
> > <mailto:[hidden email]>> wrote:
> >
> >
> >     Thanks, Vidyashankar. I had one small query before committing it.
> >
> >     If I launch a project,  generate a DTMF tone (so get "Undo DTMF Tones"
> >     in the Edit menu),  open Preferences then OK, "Undo DTMF Tones"
> >     remains, but the greyed out "Can't Redo" has changed to greyed
> >     out "Redo".  If I click "Undo DTMF Tones" and open Preferences and
> >     OK, greyed out "Can't Undo" changes to "greyed out "Undo". Which
> >     is what I'd expect from your description, and is as before. Worth
> >     addressing?
> >
> >
> > I have attached a new patch. Greyed-out "Undo" changed to greyed-out
> > "Can't Undo". Same with Redo
> >
> I haven't been following this, but I don't like "Can't Undo". A
> grayed-out (disabled) menu item is necessarily "can't". Yes, I see
> Microsoft does "Can't Undo" in Excel and probably elsewhere, but I think
> they're the worst example to follow (and they *don't* do it in Visual
> Studio). I think it's pointless, so undesirable (and generates more work
> for translators). Ever since the first Mac, grayed out means disabled.
>
> And would we then prefix "Can't " on every command when it's disabled?
> "Can't Amplify", etc? Obviously a bad idea, but then why should undo and
> redo be inconsistent with all other commands?
>
>
> -1.

I just applied the patch including that change before reading this.

The point of the suggestion was that before that modification to the
patch, clicking OK in Preferences resulted in "Can't Undo" and "Can't
Redo" being renamed to "Undo" and "Redo".  When you use the
Undo/Redo items again, they rename themselves to "Can't Undo" and
"Can't Redo" (speaking of how it looks to the user).  

In other words, although you don't like it, Audacity already uses "Can't"
for the greyed out Undo/Redo items. Given that, the renaming that goes
on when you use Preferences looked very odd to me, and definitely
worth asking.    

I still have the previous version of the patch that permits Preferences
to rename the "Can't Undo"/"Can't Redo".  Are you sure you really
prefer that?




Gale


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Martyn Shaw-2

Re: Patch for P5: Pressing OK in Preferences removes action text in Undo Menu

Reply Threaded More More options
Print post
Permalink
Hi

Gale Andrews wrote:

> | From Vaughan Johnson <[hidden email]>
> | Tue, 20 Oct 2009 15:56:58 -0700
> | Subject: [Audacity-devel] Patch for P5: Pressing OK in Preferences removes action text in Undo Menu
>> Vidyashankar Vellal wrote:
>>> On Tue, Oct 20, 2009 at 3:22 PM, Gale Andrews <[hidden email]
>>> <mailto:[hidden email]>> wrote:
>>>
>>>
>>>     Thanks, Vidyashankar. I had one small query before committing it.
>>>
>>>     If I launch a project,  generate a DTMF tone (so get "Undo DTMF Tones"
>>>     in the Edit menu),  open Preferences then OK, "Undo DTMF Tones"
>>>     remains, but the greyed out "Can't Redo" has changed to greyed
>>>     out "Redo".  If I click "Undo DTMF Tones" and open Preferences and
>>>     OK, greyed out "Can't Undo" changes to "greyed out "Undo". Which
>>>     is what I'd expect from your description, and is as before. Worth
>>>     addressing?
>>>
>>>
>>> I have attached a new patch. Greyed-out "Undo" changed to greyed-out
>>> "Can't Undo". Same with Redo
>>>
>> I haven't been following this, but I don't like "Can't Undo". A
>> grayed-out (disabled) menu item is necessarily "can't". Yes, I see
>> Microsoft does "Can't Undo" in Excel and probably elsewhere, but I think
>> they're the worst example to follow (and they *don't* do it in Visual
>> Studio). I think it's pointless, so undesirable (and generates more work
>> for translators). Ever since the first Mac, grayed out means disabled.
>>
>> And would we then prefix "Can't " on every command when it's disabled?
>> "Can't Amplify", etc? Obviously a bad idea, but then why should undo and
>> redo be inconsistent with all other commands?
>>
>>
>> -1.
>
> I just applied the patch including that change before reading this.

Wording aside, I note that we have AudacityProject::ModifyUndoMenus
which is presumably the place for such code?  Anybody looked there,
rather than spread stuff out?

Martyn

> The point of the suggestion was that before that modification to the
> patch, clicking OK in Preferences resulted in "Can't Undo" and "Can't
> Redo" being renamed to "Undo" and "Redo".  When you use the
> Undo/Redo items again, they rename themselves to "Can't Undo" and
> "Can't Redo" (speaking of how it looks to the user).  
>
> In other words, although you don't like it, Audacity already uses "Can't"
> for the greyed out Undo/Redo items. Given that, the renaming that goes
> on when you use Preferences looked very odd to me, and definitely
> worth asking.    
>
> I still have the previous version of the patch that permits Preferences
> to rename the "Can't Undo"/"Can't Redo".  Are you sure you really
> prefer that?
>
>
>
>
> Gale
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> audacity-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/audacity-devel
>

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Vaughan Johnson

Re: Patch for P5: Pressing OK in Preferences removes action text in Undo Menu

Reply Threaded More More options
Print post
Permalink
In reply to this post by Gale (Audacity Team)
Gale Andrews wrote:
> | From Vaughan Johnson <[hidden email]>
> | ...
>>>
>> I haven't been following this, but I don't like "Can't Undo". ...

> In other words, although you don't like it, Audacity already uses "Can't"
> for the greyed out Undo/Redo items. Given that, the renaming that goes
> on when you use Preferences looked very odd to me, and definitely
> worth asking.    
Yes, that's obviously a bug if you have any "can'ts". I think there
should never have been any "Can'ts".


>
> I still have the previous version of the patch that permits Preferences
> to rename the "Can't Undo"/"Can't Redo".  Are you sure you really
> prefer that?
>
No, of course not. As I wrote, I'd prefer they always be only Undo and
Redo.

Down with the negativity of "Can'ts"! And all this renaming code that is
apparently such a problem. ;-)

- Vaughan



------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Ed Musgrove-2

Re: Patch for P5: Pressing OK in Preferences removes action text in Undo Menu

Reply Threaded More More options
Print post
Permalink
> -----Original Message-----
> From: Vaughan Johnson [mailto:[hidden email]]
> Sent: Wednesday, October 21, 2009 2:10 PM
> To: [hidden email]
> Subject: Re: [Audacity-devel] Patch for P5: Pressing OK in Preferences
> removes action text in Undo Menu
>
> Gale Andrews wrote:
> > | From Vaughan Johnson <[hidden email]> ...
> >>>
> >> I haven't been following this, but I don't like "Can't Undo". ...
>
> > In other words, although you don't like it, Audacity already uses
"Can't"
> > for the greyed out Undo/Redo items. Given that, the renaming that goes
> > on when you use Preferences looked very odd to me, and definitely
> > worth asking.
> Yes, that's obviously a bug if you have any "can'ts". I think there should
never

> have been any "Can'ts".
>
>
> >
> > I still have the previous version of the patch that permits Preferences
> > to rename the "Can't Undo"/"Can't Redo".  Are you sure you really
> > prefer that?
> >
> No, of course not. As I wrote, I'd prefer they always be only Undo and
> Redo.
>
> Down with the negativity of "Can'ts"! And all this renaming code that is
> apparently such a problem. ;-)
>
> - Vaughan
[Ed:]
I am with Vaughan on this issue. Remember, with language localization that
simple "Can't" can become a much more complicated sentence structure --
especially, longer. Since the item is physically impossible to select and
there is a visual cue (grayed out) it is superfluous.

>
>
>
>
----------------------------------------------------------------------------
--
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> audacity-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/audacity-devel

--Ed



------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Gale (Audacity Team)

Re: Patch for P5: Pressing OK in Preferences removes action text in Undo Menu

Reply Threaded More More options
Print post
Permalink
In reply to this post by Vaughan Johnson

| From Vaughan Johnson <[hidden email]>
| Wed, 21 Oct 2009 14:10:21 -0700
| Subject: [Audacity-devel] Patch for P5: Pressing OK in Preferences removes action text in Undo Menu

> Gale Andrews wrote:
> > | From Vaughan Johnson <[hidden email]>
> > | ...
> >>>
> >> I haven't been following this, but I don't like "Can't Undo". ...
>
> > In other words, although you don't like it, Audacity already uses "Can't"
> > for the greyed out Undo/Redo items. Given that, the renaming that goes
> > on when you use Preferences looked very odd to me, and definitely
> > worth asking.    
> Yes, that's obviously a bug if you have any "can'ts". I think there
> should never have been any "Can'ts".
> >
> > I still have the previous version of the patch that permits Preferences
> > to rename the "Can't Undo"/"Can't Redo".  Are you sure you really
> > prefer that?
> >
> No, of course not. As I wrote, I'd prefer they always be only Undo and
> Redo.

You mean also without the specific action included after "Undo" and
"Redo"?

There might be an argument that if you include that action, having
just "Undo" and "Redo" greyed when there is nothing to be done looks
unbalanced.  MS FrontPage has "Can't Undo" and "Can't Redo" but
includes the actions. Visual Studio is purely "Undo" and "Redo" with
no idea from the menu of what you are undoing/redoing.

But if we ever have a vote, I'm +1 on just having "Undo" and "Redo"
when greyed, and "Undo <Action>" and "Redo <Action>" when not
greyed. That's what GIMP does (on Linux, anyway).




Gale
 


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Vaughan Johnson

Re: Patch for P5: Pressing OK in Preferences removes action text in Undo Menu

Reply Threaded More More options
Print post
Permalink


Gale Andrews wrote:

> | From Vaughan Johnson <[hidden email]>
> | Wed, 21 Oct 2009 14:10:21 -0700
> | Subject: [Audacity-devel] Patch for P5: Pressing OK in Preferences removes action text in Undo Menu
>> Gale Andrews wrote:
>>> | From Vaughan Johnson <[hidden email]>
>>> | ...
>>>> I haven't been following this, but I don't like "Can't Undo". ...
>>> In other words, although you don't like it, Audacity already uses "Can't"
>>> for the greyed out Undo/Redo items. Given that, the renaming that goes
>>> on when you use Preferences looked very odd to me, and definitely
>>> worth asking.    
>> Yes, that's obviously a bug if you have any "can'ts". I think there
>> should never have been any "Can'ts".
>>> I still have the previous version of the patch that permits Preferences
>>> to rename the "Can't Undo"/"Can't Redo".  Are you sure you really
>>> prefer that?
>>>
>> No, of course not. As I wrote, I'd prefer they always be only Undo and
>> Redo.
>
> You mean also without the specific action included after "Undo" and
> "Redo"?

No, I like that. Didn't mention that because it wasn't under discussion,
but thanks for being thorough.

...
> But if we ever have a vote, I'm +1 on just having "Undo" and "Redo"
> when greyed, and "Undo <Action>" and "Redo <Action>" when not
> greyed. That's what GIMP does (on Linux, anyway).
>

Right on.

- V

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Martyn Shaw-2

Re: Patch for P5: Pressing OK in Preferences removes action text in Undo Menu

Reply Threaded More More options
Print post
Permalink


Vaughan Johnson wrote:

>
> Gale Andrews wrote:
>> | From Vaughan Johnson <[hidden email]>
>> | Wed, 21 Oct 2009 14:10:21 -0700
>> | Subject: [Audacity-devel] Patch for P5: Pressing OK in Preferences removes action text in Undo Menu
>>> Gale Andrews wrote:
>>>> | From Vaughan Johnson <[hidden email]>
>>>> | ...
>>>>> I haven't been following this, but I don't like "Can't Undo". ...
>>>> In other words, although you don't like it, Audacity already uses "Can't"
>>>> for the greyed out Undo/Redo items. Given that, the renaming that goes
>>>> on when you use Preferences looked very odd to me, and definitely
>>>> worth asking.    
>>> Yes, that's obviously a bug if you have any "can'ts". I think there
>>> should never have been any "Can'ts".
>>>> I still have the previous version of the patch that permits Preferences
>>>> to rename the "Can't Undo"/"Can't Redo".  Are you sure you really
>>>> prefer that?
>>>>
>>> No, of course not. As I wrote, I'd prefer they always be only Undo and
>>> Redo.
>> You mean also without the specific action included after "Undo" and
>> "Redo"?
>
> No, I like that. Didn't mention that because it wasn't under discussion,
> but thanks for being thorough.
>
> ...
>> But if we ever have a vote, I'm +1 on just having "Undo" and "Redo"
>> when greyed, and "Undo <Action>" and "Redo <Action>" when not
>> greyed. That's what GIMP does (on Linux, anyway).
>>
>
> Right on.

+1

Martyn

> - V
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> audacity-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/audacity-devel
>

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Vidyashankar Vellal

Re: Patch for P5: Pressing OK in Preferences removes action text in Undo Menu

Reply Threaded More More options
Print post
Permalink

On Fri, Oct 23, 2009 at 4:47 AM, Martyn Shaw <[hidden email]> wrote:


Vaughan Johnson wrote:

>
> ...
>> But if we ever have a vote, I'm +1 on just having "Undo" and "Redo"
>> when greyed, and "Undo <Action>" and "Redo <Action>" when not
>> greyed. That's what GIMP does (on Linux, anyway).
>>
>
> Right on.

+1

Martyn

> - V


I have attached a new patch made against HEAD with the following changes:
*In CreateMenusAndCommands(), after creating the undo and redo menu, we simply call the ModifyUndoMenus() function. This takes care of renaming the menu with the appropriate action text (Thanks to Martyn for bringing this function to my notice).
*In ModifyUndoMenus(), I have changed "Can't Undo" and "Can't Redo" to "&Undo" and "&Redo". So we now get greyed-out "Undo" and "Redo".

Vidyashankar

[PrefUndoDescription3.patch]

? PrefUndoDescription3.patch
Index: src/Menus.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/Menus.cpp,v
retrieving revision 1.531
diff -u -r1.531 Menus.cpp
--- src/Menus.cpp 20 Oct 2009 23:32:09 -0000 1.531
+++ src/Menus.cpp 23 Oct 2009 06:05:25 -0000
@@ -330,18 +330,7 @@
    c->SetDefaultFlags(AudioIONotBusyFlag | TimeSelectedFlag | TracksSelectedFlag,
                       AudioIONotBusyFlag | TimeSelectedFlag | TracksSelectedFlag);
 
-   wxString undoStr = _("");
-   UndoManager *undoMgr = GetUndoManager();
-   if(undoMgr->UndoAvailable())
-   {
-      wxString undoDescription = _("");
-      unsigned int state = undoMgr->GetCurrentState();
-      undoMgr->GetShortDescription(state, &undoDescription);
-      undoStr = _("&Undo " + undoDescription);
-   }
-   else
-      undoStr = _("Can't Undo");
-   c->AddItem(wxT("Undo"), undoStr, FN(OnUndo), wxT("Ctrl+Z"),
+   c->AddItem(wxT("Undo"), _("&Undo"), FN(OnUndo), wxT("Ctrl+Z"),
               AudioIONotBusyFlag | UndoAvailableFlag,
               AudioIONotBusyFlag | UndoAvailableFlag);
 
@@ -353,19 +342,11 @@
       wxT("Ctrl+Shift+Z");
 #endif
 
-   wxString redoStr = _("");
-   if(undoMgr->RedoAvailable())
-   {
-      wxString redoDescription = _("");
-      unsigned int state = undoMgr->GetCurrentState();
-      undoMgr->GetShortDescription(state + 1, &redoDescription); // redo state is current state + 1
-      redoStr = _("&Redo " + redoDescription);
-   }
-   else
-      redoStr = _("Can't Redo");
-   c->AddItem(wxT("Redo"), redoStr, FN(OnRedo), key,
+   c->AddItem(wxT("Redo"), _("&Redo"), FN(OnRedo), key,
               AudioIONotBusyFlag | RedoAvailableFlag,
               AudioIONotBusyFlag | RedoAvailableFlag);
+              
+   ModifyUndoMenus();
 
    c->AddSeparator();
 
@@ -1246,7 +1227,7 @@
    }
    else {
       mCommandManager.Modify(wxT("Undo"),
-                             wxString::Format(_("Can't Undo")));
+                             wxString::Format(_("&Undo")));
       // LL: See above
       mCommandManager.Enable(wxT("Undo"), true);
       mCommandManager.Enable(wxT("Undo"), false);
@@ -1261,7 +1242,7 @@
    }
    else {
       mCommandManager.Modify(wxT("Redo"),
-                             wxString::Format(_("Can't Redo")));
+                             wxString::Format(_("&Redo")));
       mCommandManager.Enable(wxT("Redo"), false);
    }
 }


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Gale (Audacity Team)

Re: Patch for P5: Pressing OK in Preferences removes action text in Undo Menu

Reply Threaded More More options
Print post
Permalink

| From Vidyashankar Vellal <[hidden email]>
| Fri, 23 Oct 2009 11:53:46 +0530
| Subject: [Audacity-devel] Patch for P5: Pressing OK in Preferences removes action text in Undo Menu

> On Fri, Oct 23, 2009 at 4:47 AM, Martyn Shaw <[hidden email]>wrote:
> > Vaughan Johnson wrote:
> >
> > >
> > > ...
> > >> But if we ever have a vote, I'm +1 on just having "Undo" and "Redo"
> > >> when greyed, and "Undo <Action>" and "Redo <Action>" when not
> > >> greyed. That's what GIMP does (on Linux, anyway).
> > >>
> > >
> > > Right on.
> >
> > +1
> >
> > Martyn
> >
> > > - V
> >
> >
> I have attached a new patch made against HEAD with the following changes:
> *In CreateMenusAndCommands(), after creating the undo and redo menu, we
> simply call the ModifyUndoMenus() function. This takes care of renaming the
> menu with the appropriate action text (Thanks to Martyn for bringing this
> function to my notice).
> *In ModifyUndoMenus(), I have changed "Can't Undo" and "Can't Redo" to
> "&Undo" and "&Redo". So we now get greyed-out "Undo" and "Redo".
>
> Vidyashankar

I applied the patch and I'm fine with it, functionally. I think we
should commit it if Martyn's happy too.



Gale  



------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Martyn Shaw-2

Re: Patch for P5: Pressing OK in Preferences removes action text in Undo Menu

Reply Threaded More More options
Print post
Permalink


Gale Andrews wrote:

> | From Vidyashankar Vellal <[hidden email]>
> | Fri, 23 Oct 2009 11:53:46 +0530
> | Subject: [Audacity-devel] Patch for P5: Pressing OK in Preferences removes action text in Undo Menu
>> On Fri, Oct 23, 2009 at 4:47 AM, Martyn Shaw <[hidden email]>wrote:
>>> Vaughan Johnson wrote:
>>>
>>>> ...
>>>>> But if we ever have a vote, I'm +1 on just having "Undo" and "Redo"
>>>>> when greyed, and "Undo <Action>" and "Redo <Action>" when not
>>>>> greyed. That's what GIMP does (on Linux, anyway).
>>>>>
>>>> Right on.
>>> +1
>>>
>>> Martyn
>>>
>>>> - V
>>>
>> I have attached a new patch made against HEAD with the following changes:
>> *In CreateMenusAndCommands(), after creating the undo and redo menu, we
>> simply call the ModifyUndoMenus() function. This takes care of renaming the
>> menu with the appropriate action text (Thanks to Martyn for bringing this
>> function to my notice).
>> *In ModifyUndoMenus(), I have changed "Can't Undo" and "Can't Redo" to
>> "&Undo" and "&Redo". So we now get greyed-out "Undo" and "Redo".
>>
>> Vidyashankar
>
> I applied the patch and I'm fine with it, functionally. I think we
> should commit it if Martyn's happy too.

Much better than before, committed.

Martyn

>
> Gale  
>
>
>

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel