Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
frmEventEditor: Don't setup new empty event if saving failed
[xestiacalendar/.git] / source / forms / eventeditor / frmEventEditor.cpp
index dda8dd1..090f53f 100644 (file)
@@ -159,7 +159,10 @@ void frmEventEditor::SaveContact(wxCommandEvent &event){
 
 void frmEventEditor::SaveNewContact(wxCommandEvent &event){
        
-       SaveContact();
+       if (!SaveContact())
+       {
+               return;
+       }
        
        // Reset the form for a new entry.
        
@@ -180,14 +183,14 @@ void frmEventEditor::SaveNewContact(wxCommandEvent &event){
        
 }
 
-void frmEventEditor::SaveContact(){
+bool frmEventEditor::SaveContact(){
 
        // Verify that a calendar has been selected.
        
        if (cmbCalendar->GetSelection() == -1 && editMode == false){
                
                wxMessageBox("Please select a calendar for this entry.", "No calendar selected", wxOK);
-               return;
+               return false;
                
        }
        
@@ -196,7 +199,7 @@ void frmEventEditor::SaveContact(){
        if (txtEventName->GetValue().IsEmpty()){
                
                wxMessageBox("The event name cannot be left empty.", "Event name is empty", wxOK);
-               return
+               return false;
                
        }
        
@@ -357,6 +360,8 @@ void frmEventEditor::SaveContact(){
                
        }
        
+       return true;
+       
 }
 
 void frmEventEditor::CloseWindow(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