mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-27 07:43:50 +01:00
Bug2224: Should have error message trying to cut without selection...
... I got bitten by problems of static variable initialization order
This commit is contained in:
@@ -71,7 +71,8 @@ bool TimeSelectedPred( const AudacityProject &project )
|
||||
return !ViewInfo::Get( project ).selectedRegion.isPoint();
|
||||
};
|
||||
|
||||
const CommandFlagOptions cutCopyOptions{
|
||||
const CommandFlagOptions &cutCopyOptions() {
|
||||
static CommandFlagOptions result{
|
||||
// In reporting the issue with cut or copy, we don't tell the user they could also select some text in a label.
|
||||
[]( const TranslatableString &Name ) {
|
||||
// PRL: These strings have hard-coded mention of a certain shortcut key,
|
||||
@@ -101,6 +102,8 @@ const CommandFlagOptions cutCopyOptions{
|
||||
"Selecting_Audio_-_the_basics",
|
||||
XO("No Audio Selected")
|
||||
};
|
||||
return result;
|
||||
}
|
||||
|
||||
// Noise Reduction has a custom error message, when nothing selected.
|
||||
const CommandFlagOptions noiseReductionOptions{
|
||||
@@ -153,7 +156,7 @@ const ReservedCommandFlag
|
||||
},
|
||||
TimeSelectedFlag{
|
||||
TimeSelectedPred,
|
||||
cutCopyOptions
|
||||
cutCopyOptions()
|
||||
},
|
||||
WaveTracksSelectedFlag{
|
||||
[](const AudacityProject &project){
|
||||
|
||||
@@ -18,7 +18,7 @@ Paul Licameli split from Menus.cpp
|
||||
bool TracksSelectedPred( const AudacityProject &project );
|
||||
bool AudioIOBusyPred( const AudacityProject &project );
|
||||
bool TimeSelectedPred( const AudacityProject &project );
|
||||
extern const CommandFlagOptions cutCopyOptions;
|
||||
extern const CommandFlagOptions &cutCopyOptions();
|
||||
|
||||
extern AUDACITY_DLL_API const ReservedCommandFlag
|
||||
AudioIONotBusyFlag,
|
||||
|
||||
@@ -1025,7 +1025,7 @@ const ReservedCommandFlag
|
||||
|
||||
return false;
|
||||
},
|
||||
cutCopyOptions
|
||||
cutCopyOptions()
|
||||
};
|
||||
|
||||
MenuTable::BaseItemPtr EditMenu( AudacityProject & )
|
||||
|
||||
Reference in New Issue
Block a user