X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2FfrmMain.cpp;h=03f8cd97f2b67d80a4f972393828efe74e472f24;hb=7144da5e7c93db0df978e028fe79c41b7445cd10;hp=63f0015035476b7526ca342c36a5a41497394e21;hpb=d1663f3d3931bb05c791ef2c86926a22932c6014;p=xestiaab%2F.git diff --git a/source/frmMain.cpp b/source/frmMain.cpp index 63f0015..03f8cd9 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; @@ -1449,7 +1456,11 @@ void frmMain::LoadPreferences(){ ContactBackgroundColour = preferences.GetBackgroundContactColourData(); - } + } else { + + ContactBackgroundColour = wxTransparentColour; + + } treAccounts->DeleteAllItems(); @@ -3172,7 +3183,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 +3206,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; + } +}