@@ -335,7 +335,9 @@ bool MainFrame::OpenHamlibRig() {
335
335
};
336
336
337
337
wxGetApp ().rigFrequencyController ->onRigConnected += [&](IRigController*) {
338
- if (wxGetApp ().rigFrequencyController && wxGetApp ().appConfiguration .rigControlConfiguration .hamlibEnableFreqModeChanges )
338
+ if (wxGetApp ().rigFrequencyController &&
339
+ wxGetApp ().appConfiguration .rigControlConfiguration .hamlibEnableFreqModeChanges &&
340
+ wxGetApp ().appConfiguration .reportingConfiguration .reportingFrequency > 0 )
339
341
{
340
342
wxGetApp ().rigFrequencyController ->setFrequency (wxGetApp ().appConfiguration .reportingConfiguration .reportingFrequency );
341
343
wxGetApp ().rigFrequencyController ->setMode (getCurrentMode_ ());
@@ -564,16 +566,37 @@ void MainFrame::OnTop(wxCommandEvent& event)
564
566
// -------------------------------------------------------------------------
565
567
void MainFrame::OnDeleteConfig (wxCommandEvent&)
566
568
{
567
- if (pConfig->DeleteAll ())
568
- {
569
- wxLogMessage (wxT (" Config file/registry key successfully deleted." ));
570
-
571
- // Resets all configuration to defaults.
572
- loadConfiguration_ ();
573
- }
574
- else
569
+ wxMessageDialog messageDialog (
570
+ this , " Would you like to restore configuration to defaults?" , wxT (" Restore Defaults" ),
571
+ wxYES_NO | wxICON_QUESTION | wxCENTRE);
572
+
573
+ auto answer = messageDialog.ShowModal ();
574
+ if (answer == wxID_YES)
575
575
{
576
- wxLogError (wxT (" Deleting config file/registry key failed." ));
576
+ if (pConfig->DeleteAll ())
577
+ {
578
+ wxLogMessage (wxT (" Config file/registry key successfully deleted." ));
579
+
580
+ if (wxGetApp ().m_sharedReporterObject )
581
+ {
582
+ wxGetApp ().m_sharedReporterObject = nullptr ;
583
+ }
584
+
585
+ if (m_reporterDialog != nullptr )
586
+ {
587
+ m_reporterDialog->setReporter (nullptr );
588
+ m_reporterDialog->Close ();
589
+ m_reporterDialog->Destroy ();
590
+ m_reporterDialog = nullptr ;
591
+ }
592
+
593
+ // Resets all configuration to defaults.
594
+ loadConfiguration_ ();
595
+ }
596
+ else
597
+ {
598
+ wxLogError (wxT (" Deleting config file/registry key failed." ));
599
+ }
577
600
}
578
601
}
579
602
0 commit comments