Update of /cvsroot/audacity/audacity-src/src/commands
In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv32454/src/commands
Modified Files:
CommandManager.cpp CommandManager.h
Log Message:
-Checklist fixes
Index: CommandManager.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/commands/CommandManager.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- CommandManager.h 18 Jun 2007 16:10:54 -0000 1.17
+++ CommandManager.h 24 Jul 2007 10:45:40 -0000 1.18
@@ -135,7 +135,7 @@
bool HandleMenuID(int id, wxUint32 flags, wxUint32 mask);
bool HandleKey(wxKeyEvent &evt, wxUint32 flags, wxUint32 mask);
bool HandleTextualCommand(wxString & Str, wxUint32 flags, wxUint32 mask);
-
+ void TellUserWhyDisallowed( wxUint32 flagsGot, wxUint32 flagsRequired );
//
// Accessing
//
Index: CommandManager.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/commands/CommandManager.cpp,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- CommandManager.cpp 3 Jul 2007 09:32:19 -0000 1.41
+++ CommandManager.cpp 24 Jul 2007 10:45:40 -0000 1.42
@@ -396,7 +396,7 @@
for(i=0; i<effLen; i++) {
int ID = NewIdentifier(name, labels[i], CurrentMenu(), callback,
true, i, effLen);
-
+
CurrentMenu()->Append(ID, labels[i]);
if(((i+1) % MAX_SUBMENU_LEN) == 0 && i != (effLen - 1)) {
@@ -485,7 +485,7 @@
tmpEntry->flags = mDefaultFlags;
tmpEntry->mask = mDefaultMask;
tmpEntry->enabled = true;
-
+
// Key from preferences overridse the default key given
gPrefs->SetPath(wxT("/NewKeys"));
if (gPrefs->HasEntry(name)) {
@@ -550,12 +550,12 @@
if (multiEntry) {
wxMenuItem *item = multiEntry->menu->FindItem(ID);
- if (item) {
- item->Enable(enabled);
- } else {
- wxLogDebug(wxT("Warning: Menu entry with id %i in %s not
found"),
- ID, (const wxChar*)entry->name);
- }
+ if (item) {
+ item->Enable(enabled);
+ } else {
+ wxLogDebug(wxT("Warning: Menu entry with id %i in %s not found"),
+ ID, (const wxChar*)entry->name);
+ }
} else {
wxLogDebug(wxT("Warning: Menu entry with id %i not in hash"), ID);
}
@@ -583,7 +583,7 @@
CommandListEntry *entry = mCommandList[i];
if (entry->multi && entry->index != 0)
continue;
-
+
wxUint32 combinedMask = (mask & entry->mask);
if (combinedMask) {
bool enable = ((flags & combinedMask) ==
@@ -711,7 +711,26 @@
return;
}
-
+
+void CommandManager::TellUserWhyDisallowed( wxUint32 flagsGot, wxUint32
flagsRequired )
+{
+ // The default string for 'reason' is a catch all. I hope it won't ever be
seen
+ // and that we will get something more specific.
+ wxString reason = _("Disallowed for some reason. Try selecting some Audio
first?");
+
+ wxUint32 missingFlags = flagsRequired & (~flagsGot );
+ if( missingFlags & AudioIONotBusyFlag )
+ reason= _("You can only do this when playing and recording are\n
stopped. [Pausing is not sufficient.]");
+ else if( missingFlags & StereoRequiredFlag )
+ reason = _("You must first select some stereo audio for this\n to use.
[You can't use this with mono.]");
+ else if( missingFlags & TimeSelectedFlag )
+ reason = _("You must first select some audio for this to use.");
+ else if( missingFlags & WaveTracksSelectedFlag)
+ reason = _("You must first select some audio for this\n to use.
[Selecting other kinds of track won't work.]");
+
+ wxMessageBox(reason, _("Message"), wxICON_WARNING | wxOK );
+}
+
/// HandleCommandEntry() takes a CommandListEntry and executes it
/// returning true iff successful. If you pass any flags,
///the command won't be executed unless the flags are compatible
@@ -726,7 +745,11 @@
bool allowed = ((flags & combinedMask) ==
(entry->flags & combinedMask));
if (!allowed)
+ {
+ TellUserWhyDisallowed(
+ flags & combinedMask, entry->flags & combinedMask);
return false;
+ }
}
(*(entry->callback))(entry->index);
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs