mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-21 22:12:58 +02:00
move function
This commit is contained in:
@@ -1301,6 +1301,29 @@ void CommandManager::TellUserWhyDisallowed( const wxString & Name, CommandFlag f
|
||||
}
|
||||
}
|
||||
|
||||
wxString CommandManager::DescribeCommandsAndShortcuts
|
||||
(const std::vector<wxString> &commands, const wxString &separator) const
|
||||
{
|
||||
wxString result;
|
||||
auto iter = commands.begin(), end = commands.end();
|
||||
while (iter != end) {
|
||||
result += *iter++;
|
||||
if (iter != end) {
|
||||
if (!iter->empty()) {
|
||||
auto keyStr = GetKeyFromName(*iter);
|
||||
if (!keyStr.empty()){
|
||||
result += wxT(" ");
|
||||
result += Internat::Parenthesize(KeyStringDisplay(keyStr, true));
|
||||
}
|
||||
}
|
||||
++iter;
|
||||
}
|
||||
if (iter != end)
|
||||
result += separator;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
///
|
||||
|
@@ -262,6 +262,18 @@ class AUDACITY_DLL_API CommandManager final : public XMLTagHandler
|
||||
void WriteXML(XMLWriter &xmlFile) const /* not override */;
|
||||
void TellUserWhyDisallowed(const wxString & Name, CommandFlag flagsGot, CommandFlag flagsRequired);
|
||||
|
||||
///
|
||||
/// Formatting summaries that include shortcut keys
|
||||
///
|
||||
wxString DescribeCommandsAndShortcuts
|
||||
(// An array, alternating user-visible strings, and
|
||||
// non-user-visible command names. If a shortcut key is defined
|
||||
// for the command, then it is appended, parenthesized, after the
|
||||
// user-visible string.
|
||||
const std::vector<wxString> &commands,
|
||||
// If more than one pair of strings is given, then use this separator.
|
||||
const wxString &separator = wxT(" / ")) const;
|
||||
|
||||
protected:
|
||||
|
||||
//
|
||||
|
Reference in New Issue
Block a user