| 45 | * where there are fewer special modes, and they don't persist. |
| 46 | */ |
| 47 | class QuickFixDialog : public wxDialogWrapper |
| 48 | { |
| 49 | public: |
| 50 | using PrefSetter = std::function< void() > ; |
| 51 | |
| 52 | QuickFixDialog(wxWindow * pParent, AudacityProject &project); |
| 53 | void Populate(); |
| 54 | void PopulateOrExchange(ShuttleGui & S); |
| 55 | void AddStuck( ShuttleGui & S, bool & bBool, |
| 56 | const PrefSetter &prefSetter, |
| 57 | const TranslatableString &Prompt, const ManualPageID &Help ); |
| 58 | |
| 59 | void OnOk(wxCommandEvent &event); |
| 60 | void OnCancel(wxCommandEvent &event); |
| 61 | void OnHelp(const ManualPageID &Str); |
| 62 | void OnFix(const PrefSetter &setter, wxWindowID id); |
| 63 | |
| 64 | AudacityProject &mProject; |
| 65 | |
| 66 | int mItem; |
| 67 | bool mbSyncLocked; |
| 68 | bool mbInSnapTo; |
| 69 | bool mbSoundActivated; |
| 70 | DECLARE_EVENT_TABLE() |
| 71 | }; |
| 72 | |
| 73 | |
| 74 | #define FixButtonID 7001 |
| 75 | #define HelpButtonID 7011 |
| 76 | |
| 77 | BEGIN_EVENT_TABLE(QuickFixDialog, wxDialogWrapper) |
| 78 | EVT_BUTTON(wxID_OK, QuickFixDialog::OnOk) |
| 79 | EVT_BUTTON(wxID_CANCEL, QuickFixDialog::OnCancel) |
| 80 | END_EVENT_TABLE(); |
| 81 | |
| 82 | QuickFixDialog::QuickFixDialog(wxWindow * pParent, AudacityProject &project) : |
| 83 | wxDialogWrapper(pParent, wxID_ANY, XO("Do you have these problems?"), |
| 84 | wxDefaultPosition, wxDefaultSize, |
| 85 | wxDEFAULT_DIALOG_STYLE ) |
| 86 | , mProject{ project } |
| 87 | { |
| 88 | mbSyncLocked = SyncLockTracks.Read(); |
| 89 | mbInSnapTo = ProjectSnap(project).GetSnapMode() != SnapMode::SNAP_OFF; gPrefs->Read(wxT("/SnapTo")); |
| 90 | mbSoundActivated = SoundActivatedRecord.Read(); |
| 91 | |
| 92 | ShuttleGui S(this, eIsCreating); |
| 93 | PopulateOrExchange(S); |
| 94 | |
| 95 | Fit(); |
| 96 | auto sz = GetSize(); |
| 97 | SetMinSize( sz ); |
| 98 | SetMaxSize( sz ); |
| 99 | |
| 100 | // The close button has the cancel id and acts exactly the same as cancel. |
| 101 | wxButton * pWin = (wxButton*)FindWindowById( wxID_CANCEL ); |
| 102 | if( pWin ) |
| 103 | pWin->SetFocus( ); |
| 104 | Center(); |
nothing calls this directly
no test coverage detected