Menu

#581 Overwrite not work

Undefined
fixed
wxSmith (61)
Bug_Report
2021-05-06
2017-12-11
Li Minggang
No

An overwrite query dialog will present if there were source files with the same name while creating the resouce.
However, it would stay there although I chosen "Yes" to overwrite the files.

Discussion

  • Teodor Petrov

    Teodor Petrov - 2017-12-12

    Please post the exact steps needed to reproduce the problem.

     
    • Li Minggang

      Li Minggang - 2017-12-12

      Steps to reproduce:
      1. Create a new resouce, eg, wxDialog, in your project with the default name or rename it, NewDialog. then press OK.
      2. Remove the resource but not delete the source files
      3. repeate step 1 with the same name, eg, NewDialog.
      4. Press OK and a new dialog "File exists" would popup to ask you to overwrite with "Yes", "No" and "Cancel".
      5. Choose "Yes".

      However, the "New wxDialog resource" dialog is still there. If you click OK, You will be back to step 3 again. No way out if you don't want to cancel.

       
  • bluehazzard

    bluehazzard - 2017-12-17

    On step 2 remove what? The resource from the project? the wxs file? the rc file?
    Please provide exact steps. Describing every click. Thank you!

     
  • bluehazzard

    bluehazzard - 2017-12-17

    Ok, i can reproduce it now

     
  • bluehazzard

    bluehazzard - 2017-12-17

    plugins\contrib\wxSmith\wxwidgets\wxsnewwindowdlg.cpp:431

        if ( wxFileName::FileExists(ProjectPrefix+Params.Hdr) )
        {
            switch ( wxMessageBox(wxString::Format(
                _("File '%s' already exists. Overwrite it ?"),Params.Hdr.c_str()),
                _("File exists"),
                wxYES_NO|wxCANCEL|wxICON_ERROR) )
            {
                case wxCANCEL: return;
                case wxNO: Params.GenHdr = false; break;
                default: return; // Should never come here
            }
        }
    
        Params.GenSrc = true;
        if ( wxFileName::FileExists(ProjectPrefix+Params.Src) )
        {
            switch ( wxMessageBox(wxString::Format(
                _("File '%s' already exists. Overwrite it ?"),Params.Src.c_str()),
                _("File exists"),wxYES_NO|wxCANCEL|wxICON_ERROR) )
            {
                case wxCANCEL: return;
                case wxNO: Params.GenSrc = false; break;
                default: return; // Should never come here
            }
        }
    

    The case wxYES is obviously missing in both cases
    fix attached

     
  • Teodor Petrov

    Teodor Petrov - 2021-05-06
    • assigned_to: bluehazzard
     
  • bluehazzard

    bluehazzard - 2021-05-06
    • labels: --> wxSmith
    • status: open --> fixed
     
  • bluehazzard

    bluehazzard - 2021-05-06

    Fixed in r12325

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.