Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
frmMain: Fix issue where window is reset when LoadPreferences is called
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 29 Oct 2017 19:56:10 +0000 (19:56 +0000)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 29 Oct 2017 19:56:10 +0000 (19:56 +0000)
source/frmMain.cpp
source/frmMain.h

index e9ce304..bcbad5c 100644 (file)
@@ -428,7 +428,7 @@ void frmMain::QuitApp()
     
        if (SaveWindowPos == TRUE){
         
-               wxRect frmMainPos = this->GetRect();
+               wxRect frmMainPos = GetRect();
         
                cfgfile->Write(wxT("WindowPositionX"), frmMainPos.GetX());
                cfgfile->Write(wxT("WindowPositionY"), frmMainPos.GetY());
@@ -440,7 +440,7 @@ void frmMain::QuitApp()
        delete cfgfile;
        cfgfile = NULL;
     
-       //Everything closed... exit.
+       // Everything closed... exit.
     
        std::exit(0);
     
@@ -497,7 +497,7 @@ void frmMain::OpenPreferences( wxCommandEvent& event)
                // Reload the accounts as a change has been made within
                // the application and clear the current contact information.
         
-               this->LoadPreferences();
+               this->LoadPreferences(true);
                this->ResetContactInfo();
        
        }
@@ -522,7 +522,7 @@ void frmMain::OpenNewABDialog( wxCommandEvent& event)
                // Reload the accounts as a change has been made within
                // the application.
         
-               this->LoadPreferences();
+               this->LoadPreferences(true);
 
        }
     
@@ -1426,11 +1426,11 @@ void frmMain::LoadPreferences( wxActivateEvent& event)
 
        // Load the preferences.
 
-       this->LoadPreferences();
+       this->LoadPreferences(true);
        
 }
 
-void frmMain::LoadPreferences(){
+void frmMain::LoadPreferences(bool skipWindowSizeReload){
     
        // Load the preferences.
     
@@ -1444,7 +1444,7 @@ void frmMain::LoadPreferences(){
        bool HideLocalABs = preferences.GetBoolData(wxT("HideLocalAddressBooks"));
        bool UseBackgroundContactColour = preferences.GetBoolData(wxT("UseBackgroundContactColour"));
     
-       if (SaveWindowPos == true){
+       if (SaveWindowPos == true && skipWindowSizeReload == false){
         
                this->SetSize(preferences.GetMainWindowData());
         
@@ -1830,7 +1830,7 @@ void frmMain::SetupForm(){
        ciicon_png.LoadFile(ciextstream, wxBITMAP_TYPE_PNG);
        wxMemoryFSHandler::AddFile(wxT("ciext.png"), ciicon_png, wxBITMAP_TYPE_PNG);
     
-       LoadPreferences();
+       LoadPreferences(false);
     
 }
 
@@ -1955,8 +1955,8 @@ void frmMain::RevealContact(wxCommandEvent& event){
                
                if (uc->ContactAccount == AccountAccDirList[i]){
             
-               treAccounts->SelectItem(nextChild, TRUE);
-               AccCtrl->SetText(treAccounts->GetItemText(nextChild));
+                       treAccounts->SelectItem(nextChild, TRUE);
+                       AccCtrl->SetText(treAccounts->GetItemText(nextChild));
             
                }
         
index 59b4c54..657cfc9 100644 (file)
@@ -206,7 +206,7 @@ class frmMain : public frmMainADT
                void OpenPreferences( wxCommandEvent& event );
                void OpenNewABDialog( wxCommandEvent& event );
                void LoadPreferences( wxActivateEvent& event );
-               void LoadPreferences();
+               void LoadPreferences(bool skipWindowSizeReload);
                void ShowContactInfo( wxListEvent& event );
                void OpenContactInfoList( wxListEvent& event );
                void OpenContactInfoList( wxCommandEvent& event );
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy