MCPcopy Create free account
hub / github.com/audacity/audacity / ShowModal

Method ShowModal

src/prefs/PrefsDialog.cpp:603–624  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

601}
602
603int PrefsDialog::ShowModal()
604{
605 if (mCategories) {
606 /* long is signed, size_t is unsigned. On some platforms they are different
607 * lengths as well. So we must check that the stored category is both > 0
608 * and within the possible range of categories, making the first check on the
609 * _signed_ value to avoid issues when converting an unsigned one.
610 */
611 long selected = GetPreferredPage();
612 if (selected < 0 || size_t(selected) >= mCategories->GetPageCount())
613 selected = 0; // clamp to available range of tabs
614 mCategories->SetSelection(selected);
615 }
616 else if (mUniquePage) {
617 auto Temp = mTitlePrefix;
618 Temp.Join( Verbatim( mUniquePage->GetLabel() ), wxT(" ") );
619 SetTitle(Temp);
620 SetName(Temp);
621 }
622
623 return wxDialogWrapper::ShowModal();
624}
625
626void PrefsDialog::OnCancel(wxCommandEvent & WXUNUSED(event))
627{

Callers 4

OnBrowseClickedMethod · 0.45
PopulateOrExchangeMethod · 0.45
OnTempBrowseMethod · 0.45
OnBrowseMethod · 0.45

Calls 4

VerbatimFunction · 0.85
SetSelectionMethod · 0.45
JoinMethod · 0.45
GetLabelMethod · 0.45

Tested by

no test coverage detected