Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
frmPreferences: Double clicking an account opens the account settings
[xestiaab/.git] / source / frmPreferences.cpp
index c9623e0..03bcd5e 100644 (file)
@@ -23,6 +23,7 @@
 #include "common/preferences.h"
 #include "common/dirs.h"
 #include "bitmaps.h"
+#include "bitmaps/preferences.h"
 
 #include "import/import.h"
 #include "export/export.h"
@@ -33,7 +34,6 @@
 #include <wx/msgdlg.h>
 #include <wx/fileconf.h>
 
-
 frmPreferences::frmPreferences( wxWindow* parent )
 :
 frmPreferencesADT( parent )
@@ -44,6 +44,17 @@ frmPreferencesADT( parent )
        wxMemoryInputStream astream(icons_accinet_png, sizeof(icons_accinet_png));
        wxMemoryInputStream bstream(icons_acclocal_png, sizeof(icons_acclocal_png));
        wxMemoryInputStream cstream(icons_accunsupported_png, sizeof(icons_accunsupported_png));
+       wxMemoryInputStream windowposstream(icons_windowpos_png, sizeof(icons_windowpos_png));
+       wxMemoryInputStream hideaddressbooksstream(icons_hideaddressbooks_png, sizeof(icons_hideaddressbooks_png));
+
+       wxImage icons_windowpos_png(windowposstream, wxBITMAP_TYPE_PNG);
+       wxBitmap WindowPosition(icons_windowpos_png, -1);
+
+       wxImage icons_hideaddressbooks_png(hideaddressbooksstream, wxBITMAP_TYPE_PNG);
+       wxBitmap HideAddressBooks(icons_hideaddressbooks_png, -1);
+       
+       bmpWindowPosition->SetBitmap(WindowPosition);
+       bmpLocalAddressBooks->SetBitmap(HideAddressBooks);
        
        wxImage icons_accinet_png(astream, wxBITMAP_TYPE_PNG);
        wxBitmap AccInet(icons_accinet_png, -1);
@@ -134,14 +145,22 @@ void frmPreferences::ModifyABAccount( wxCommandEvent& event )
        wxString AccName;
        wxString AccType;
     
-       wxFileConfig *cfgfile = new wxFileConfig("", "", AccFilename);
+       // Check if an account has been selected before continuing.
        
-       // Get the account name.
-    
        lstAccountsIndex = lstAccounts->GetNextItem(lstAccountsIndex,
                wxLIST_NEXT_ALL,
                wxLIST_STATE_SELECTED);
        
+       if (lstAccountsIndex == -1){
+               
+               // No account has been selected so exit this subroutine.
+               
+               return;
+               
+       }
+       
+       wxFileConfig *cfgfile = new wxFileConfig("", "", AccFilename);
+       
        // Check that the account type is a supported account type.
        
        AccType = preferences->accounts.GetAccountType((int)lstAccountsIndex);
@@ -153,6 +172,8 @@ void frmPreferences::ModifyABAccount( wxCommandEvent& event )
                return;
                        
        }
+       
+       // Get the account name.
     
        AccName = preferences->accounts.GetAccountName((int)lstAccountsIndex);
     
@@ -181,6 +202,14 @@ void frmPreferences::ModifyABAccount( wxCommandEvent& event )
     
 }
 
+void frmPreferences::ModifyABAccount( wxMouseEvent& event )
+{
+       
+       wxCommandEvent NullEvent;
+       ModifyABAccount(NullEvent);
+       
+}
+
 void frmPreferences::DeleteABAccount( wxCommandEvent& event )
 {
        // Display a confirmation dialog to confirm deletion.
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