mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-17 08:30:06 +02:00
AUP3: Don't prompt user if in batch mode
This commit is contained in:
parent
17b4919a2a
commit
70fd77e2dc
@ -198,6 +198,7 @@ void OnCompact(const CommandContext &context)
|
|||||||
auto &undoManager = UndoManager::Get(project);
|
auto &undoManager = UndoManager::Get(project);
|
||||||
auto &clipboard = Clipboard::Get();
|
auto &clipboard = Clipboard::Get();
|
||||||
auto &projectFileIO = ProjectFileIO::Get(project);
|
auto &projectFileIO = ProjectFileIO::Get(project);
|
||||||
|
bool isBatch = project.mBatchMode > 0;
|
||||||
|
|
||||||
// Purpose of this is to remove the -wal file.
|
// Purpose of this is to remove the -wal file.
|
||||||
projectFileIO.ReopenProject();
|
projectFileIO.ReopenProject();
|
||||||
@ -225,8 +226,7 @@ void OnCompact(const CommandContext &context)
|
|||||||
.Format(Internat::FormatSize(projectFileIO.GetFreeDiskSpace()),
|
.Format(Internat::FormatSize(projectFileIO.GetFreeDiskSpace()),
|
||||||
Internat::FormatSize(before.GetValue()),
|
Internat::FormatSize(before.GetValue()),
|
||||||
Internat::FormatSize(total - used)));
|
Internat::FormatSize(total - used)));
|
||||||
|
if (isBatch || dlg.ShowModal() == wxYES)
|
||||||
if (dlg.ShowModal() == wxYES)
|
|
||||||
{
|
{
|
||||||
// Want to do this before removing the states so that it becomes the
|
// Want to do this before removing the states so that it becomes the
|
||||||
// current state.
|
// current state.
|
||||||
@ -248,11 +248,14 @@ void OnCompact(const CommandContext &context)
|
|||||||
|
|
||||||
auto after = wxFileName::GetSize(projectFileIO.GetFileName());
|
auto after = wxFileName::GetSize(projectFileIO.GetFileName());
|
||||||
|
|
||||||
|
if (!isBatch)
|
||||||
|
{
|
||||||
AudacityMessageBox(
|
AudacityMessageBox(
|
||||||
XO("Compacting actually freed %s of disk space.")
|
XO("Compacting actually freed %s of disk space.")
|
||||||
.Format(Internat::FormatSize((before - after).GetValue())),
|
.Format(Internat::FormatSize((before - after).GetValue())),
|
||||||
XO("Compact Project"));
|
XO("Compact Project"));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
currentTracks.reset();
|
currentTracks.reset();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user