mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-14 09:03:54 +01:00
Improve sizing of apply macros file progress dialog
Previously it could come out really tiny far too easily.
This commit is contained in:
@@ -362,13 +362,15 @@ void ApplyMacroDialog::OnApplyToFiles(wxCommandEvent & WXUNUSED(event))
|
|||||||
|
|
||||||
files.Sort();
|
files.Sort();
|
||||||
|
|
||||||
wxDialogWrapper activityWin(this, wxID_ANY, Verbatim( GetTitle() ) );
|
wxDialogWrapper activityWin(this, wxID_ANY, Verbatim( GetTitle() ),
|
||||||
|
wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER
|
||||||
|
);
|
||||||
activityWin.SetName();
|
activityWin.SetName();
|
||||||
ShuttleGui S(&activityWin, eIsCreating);
|
ShuttleGui S(&activityWin, eIsCreating);
|
||||||
|
|
||||||
wxListCtrl * fileList = NULL;
|
wxListCtrl * fileList = NULL;
|
||||||
|
|
||||||
S.StartVerticalLay(false);
|
S.StartVerticalLay(1);
|
||||||
{
|
{
|
||||||
S.StartStatic(XO("Applying..."), 1);
|
S.StartStatic(XO("Applying..."), 1);
|
||||||
{
|
{
|
||||||
@@ -385,7 +387,7 @@ void ApplyMacroDialog::OnApplyToFiles(wxCommandEvent & WXUNUSED(event))
|
|||||||
}
|
}
|
||||||
S.EndStatic();
|
S.EndStatic();
|
||||||
|
|
||||||
S.StartHorizontalLay(wxCENTER, false);
|
S.StartHorizontalLay(wxCENTER, 0);
|
||||||
{
|
{
|
||||||
S.Id(wxID_CANCEL).AddButton(XXO("&Cancel"));
|
S.Id(wxID_CANCEL).AddButton(XXO("&Cancel"));
|
||||||
}
|
}
|
||||||
@@ -401,10 +403,12 @@ void ApplyMacroDialog::OnApplyToFiles(wxCommandEvent & WXUNUSED(event))
|
|||||||
// Set the column size for the files list.
|
// Set the column size for the files list.
|
||||||
fileList->SetColumnWidth(0, wxLIST_AUTOSIZE);
|
fileList->SetColumnWidth(0, wxLIST_AUTOSIZE);
|
||||||
|
|
||||||
int width = fileList->GetColumnWidth(0);
|
int width = wxMin( fileList->GetColumnWidth(0), 1000);
|
||||||
wxSize sz = fileList->GetClientSize();
|
wxSize sz = fileList->GetClientSize();
|
||||||
if (width > sz.GetWidth() && width < 500) {
|
if (sz.GetWidth() < width ) {
|
||||||
sz.SetWidth(width);
|
sz.SetWidth(width);
|
||||||
|
if (sz.GetHeight() < width *0.7)
|
||||||
|
sz.SetHeight(width * 0.7);
|
||||||
fileList->SetInitialSize(sz);
|
fileList->SetInitialSize(sz);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -424,8 +428,9 @@ void ApplyMacroDialog::OnApplyToFiles(wxCommandEvent & WXUNUSED(event))
|
|||||||
Hide();
|
Hide();
|
||||||
|
|
||||||
mMacroCommands.ReadMacro(name);
|
mMacroCommands.ReadMacro(name);
|
||||||
for (i = 0; i < (int)files.size(); i++) {
|
{
|
||||||
wxWindowDisabler wd(&activityWin);
|
wxWindowDisabler wd(&activityWin);
|
||||||
|
for (i = 0; i < (int)files.size(); i++) {
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
//Clear the arrow in previous item.
|
//Clear the arrow in previous item.
|
||||||
fileList->SetItemImage(i - 1, 0, 0);
|
fileList->SetItemImage(i - 1, 0, 0);
|
||||||
@@ -433,9 +438,9 @@ void ApplyMacroDialog::OnApplyToFiles(wxCommandEvent & WXUNUSED(event))
|
|||||||
fileList->SetItemImage(i, 1, 1);
|
fileList->SetItemImage(i, 1, 1);
|
||||||
fileList->EnsureVisible(i);
|
fileList->EnsureVisible(i);
|
||||||
|
|
||||||
auto success = GuardedCall< bool >( [&] {
|
auto success = GuardedCall< bool >([&] {
|
||||||
ProjectFileManager::Get( *project ).Import(files[i]);
|
ProjectFileManager::Get(*project).Import(files[i]);
|
||||||
ProjectWindow::Get( *project ).ZoomAfterImport(nullptr);
|
ProjectWindow::Get(*project).ZoomAfterImport(nullptr);
|
||||||
SelectUtilities::DoSelectAll(*project);
|
SelectUtilities::DoSelectAll(*project);
|
||||||
if (!mMacroCommands.ApplyMacro(mCatalog))
|
if (!mMacroCommands.ApplyMacro(mCatalog))
|
||||||
return false;
|
return false;
|
||||||
@@ -444,12 +449,13 @@ void ApplyMacroDialog::OnApplyToFiles(wxCommandEvent & WXUNUSED(event))
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} );
|
});
|
||||||
|
|
||||||
if (!success)
|
if (!success)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
ProjectManager::Get( *project ).ResetProjectToEmpty();
|
ProjectManager::Get(*project).ResetProjectToEmpty();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Show();
|
Show();
|
||||||
|
|||||||
Reference in New Issue
Block a user