X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2FfrmMain.cpp;h=8b2624bf119ec6cff9e2ce0d99142be15ec897d4;hb=bac054ea5eda94fe663d8b1a7c680ae80de8075c;hp=63f0015035476b7526ca342c36a5a41497394e21;hpb=d1663f3d3931bb05c791ef2c86926a22932c6014;p=xestiaab%2F.git diff --git a/source/frmMain.cpp b/source/frmMain.cpp index 63f0015..8b2624b 100644 --- a/source/frmMain.cpp +++ b/source/frmMain.cpp @@ -477,6 +477,13 @@ void frmMain::ShowAboutWindow( wxCommandEvent& event ) void frmMain::OpenPreferences( wxCommandEvent& event) { + // Close all windows first. + + if (CloseAllWindows() == false) + { + return; + } + // Open the preferences window. ReloadAccounts = FALSE; @@ -3172,7 +3179,10 @@ void frmMain::ShowContactMenu( wxMouseEvent& event ){ bool EnableRefresh = FALSE; - if (!ActiveAccount.IsEmpty() && (ActiveAccountType == "CardDAV" || ActiveAccountType == "carddav")){ + if (!ActiveAccount.IsEmpty() && (ActiveAccountType == "CardDAV" || + ActiveAccountType == "carddav" || + ActiveAccountType == "Local" || + ActiveAccountType == "local")){ EnableRefresh = TRUE; @@ -3192,4 +3202,29 @@ void frmMain::ResetContactInfo(){ htmContactData->SetPage(EmptyPage); AccCtrl->SetValue(""); -} \ No newline at end of file +} + +bool frmMain::CloseAllWindows() +{ + // Attempt to close all windows. + + if (WindowListPointersMenu.size() == 0) + { + return true; + } + + if (wxMessageBox(_("Before preforming the action, all windows that are open will need to close. Do you wish to continue?"), _("Close All Windowss"), wxYES_NO) == wxYES) + { + for(std::map::iterator windowIter = WindowListPointers.begin(); + windowIter != WindowListPointers.end(); windowIter++) + { + wxWindow *windowPointer = static_cast(windowIter->second); + windowPointer->Close(); + } + return true; + } + else + { + return false; + } +}