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

Class QuickFixDialog

src/menus/HelpMenus.cpp:47–240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45 * where there are fewer special modes, and they don't persist.
46 */
47class QuickFixDialog : public wxDialogWrapper
48{
49public:
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
77BEGIN_EVENT_TABLE(QuickFixDialog, wxDialogWrapper)
78 EVT_BUTTON(wxID_OK, QuickFixDialog::OnOk)
79 EVT_BUTTON(wxID_CANCEL, QuickFixDialog::OnCancel)
80END_EVENT_TABLE();
81
82QuickFixDialog::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();

Callers

nothing calls this directly

Calls 15

DoReloadPreferencesFunction · 0.85
GetFunction · 0.85
AddFixedTextMethod · 0.80
BindMethod · 0.80
AddWindowMethod · 0.80
StartStaticMethod · 0.80
SetSnapModeMethod · 0.80
EndStaticMethod · 0.80
wxBitmapButtonClass · 0.50
PopulateOrExchangeFunction · 0.50
AddButtonMethod · 0.45
GetParentMethod · 0.45

Tested by

no test coverage detected