Example #1
0
void QuitAudacity()
{
    // Try to close each open window.  If the user hits Cancel
    // in a Save Changes dialog, don't continue.
    int len = gAudacityProjects.Count();
    for (int i = 0; i < len; i++) {
        if (!gAudacityProjects[i]->Close())
            return;
    }


    if (gFreqWindow)
        gFreqWindow->Destroy();


    if (gParentFrame)
        gParentFrame->Destroy();

    gFreqWindow = NULL;
    gParentFrame = NULL;



    if (gControlToolBarStub) {
        delete gControlToolBarStub;
        gControlToolBarStub = NULL;
    }

    if (gEditToolBarStub) {
        delete gEditToolBarStub;
        gEditToolBarStub = NULL;
    }


    QuitHelp();

    FinishPreferences();
}
Example #2
0
void QuitAudacity(bool bForce)
{
   if (gIsQuitting)
      return;

   gIsQuitting = true;

   if(bForce)
   {
      wxMessageBox(_("WARNING: You may be prompted to save your work. Clicking cancel will have the same effect as clicking no."));
   }

   // Try to close each open window.  If the user hits Cancel
   // in a Save Changes dialog, don't continue.
   // BG: unless force is true

   SaveWindowSize();

   // BG: Are there any projects open?
   if(!gAudacityProjects.IsEmpty())
   {
      size_t len = gAudacityProjects.Count();
      for (size_t i = 0; i < len; i++) {
         if(bForce)
         {
            gAudacityProjects[i]->Close(true);
         }
         else
         {
	   if (!gAudacityProjects[i]->Close()){
	       gIsQuitting = false;
               return;
         }
      }
   }
   }

   if (gFreqWindow)
      gFreqWindow->Destroy();


   if (gParentFrame)
      gParentFrame->Destroy();

   gFreqWindow = NULL;
   gParentFrame = NULL;

   // Delete all the toolbars...
   for(int i=0;i<nToolBars;i++)
   {
      if( *gToolBarStubArray[i] )
      {
         delete *gToolBarStubArray[i];
         *gToolBarStubArray[i]=NULL;
      }
   }

   //Delete the clipboard
   AudacityProject::DeleteClipboard();

   QuitHelp();

   if(bForce)
   {
      wxExit();
   }
}