[Greater-commits] r240 - trunk/Administration

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Jun 22 15:10:33 CEST 2011


Author: bricks
Date: 2011-06-22 15:10:28 +0200 (Wed, 22 Jun 2011)
New Revision: 240

Modified:
   trunk/Administration/PanelUser.cpp
Log:
Use correct user name to delete
all info messageboxes must have PanelUser as parent


Modified: trunk/Administration/PanelUser.cpp
===================================================================
--- trunk/Administration/PanelUser.cpp	2011-06-22 11:22:24 UTC (rev 239)
+++ trunk/Administration/PanelUser.cpp	2011-06-22 13:10:28 UTC (rev 240)
@@ -265,7 +265,7 @@
   {
     //Inform user, that no data is existing to delete
     wxMessageBox(wxT("No user data loaded to delete.\nDelete not possible!"),
-                 wxT("Delete not possible"), wxOK | wxICON_INFORMATION);
+                 wxT("Delete not possible"), wxOK | wxICON_INFORMATION, this);
     return;
   }
   
@@ -274,17 +274,12 @@
   int column = 0;
   userName = userGrid->GetCellValue(row, column);
 
-   //Convert values to const char*
-
-  //Copy from const char* to char[]
-  strcpy(p_userid, activeUser.mb_str());
-
   //User has to confirm or cancel, before user data is deleted
   message = message.Format(wxT("The user will be deleted including all user spcific data.\nDo you really want to delete the selected user \"%s\" ?"),
                              userName.c_str());
 
   result = wxMessageBox(message, wxT("Confirm deletion"),
-                        wxYES_NO|wxNO_DEFAULT | wxICON_QUESTION);
+                        wxYES_NO|wxNO_DEFAULT | wxICON_QUESTION, this);
 
   //Delete user
   if (result == wxYES)
@@ -299,11 +294,14 @@
     {
       //Inform user, that this is not allowed
       wxMessageBox(wxT("It is not possible to delete the current user"), wxT("Info"),
-                   wxOK | wxICON_INFORMATION);
+                   wxOK | wxICON_INFORMATION, this);
     }
     else
     {
 
+      //Copy from const char* to char[]
+      strcpy(p_userid, userName.mb_str());
+
       //Signal user, that the application is busy
       wxBeginBusyCursor();
 
@@ -331,7 +329,7 @@
         {  
           //Inform user, that user was deleted
           message = message.Format(wxT("User \"%s\" was deleted"), userName.c_str());
-          wxMessageBox(message, wxT("Info"), wxOK | wxICON_INFORMATION);
+          wxMessageBox(message, wxT("Info"), wxOK | wxICON_INFORMATION, this);
 
           //Reload data from database to refresh grid
           OnButtonReload(event);



More information about the Greater-commits mailing list