Exemplo n.º 1
0
bool ProjectCentral::save()
{
  QString InputDir = QString(openfluid::base::ProjectManager::instance()->getInputDir().c_str());

  openfluid::base::ProjectManager::instance()->save();

  QDir InputPath(InputDir);

  // remove all fluidx files
  QStringList FluidXFileToRemove;
  FluidXFileToRemove = InputPath.entryList(QStringList("*.fluidx"),QDir::Files | QDir::NoDotAndDotDot);

  for (int i=0;i<FluidXFileToRemove.size();++i)
     InputPath.remove(FluidXFileToRemove[i]);

  // save all fluidx files
  mp_FXDesc->writeToManyFiles(InputDir.toStdString());

  return true;
}
Exemplo n.º 2
0
Arquivo: slm.c Projeto: mingpen/OpenNT
/*
**  void Install(void)
*/
void Install(void)
{
    SCREEN *      pscrT;
    union list ** rgplT;
    BOOL fDOS=0,fOS2=0,fNT=0;
    char **rgszList;
    int iSel,fDone=0;



      /* Welcome screen */
    ScrnoDisplay(N_SWELCOME);
    EnterOrCtrlx();

    rgszList = RgszFromMenu(pHdScreen[N_SMAINMENU]->pMenu, &iSel);
    while(!fDone)
    {

        ScrDisplay(pHdScreen[N_SMAINMENU]);
        iSel=Listbox(rgszList,iSel,InRect(pHdScreen[N_SMAINMENU]));

        switch(iSel)
            {
          case 0:
            if(rgszList[iSel][0]=='*')
                rgszList[iSel][0]=' ';
                else
                    rgszList[iSel][0]='*';
            break;
          case 1:
            if(rgszList[iSel][0]=='*')
                rgszList[iSel][0]=' ';
                else
                    rgszList[iSel][0]='*';
            break;
/*        case 2:
 *          if(rgszList[iSel][0]=='*')
 *              rgszList[iSel][0]=' ';
 *              else
 *                  rgszList[iSel][0]='*';
 *          break;
 */
          default:
            if ((' ' == rgszList[0][0]) && (' ' == rgszList[1][0]))
                {
                ScrnoDisplay(N_SNOSELERROR);
                EnterOrCtrlx();
                }
            else
                fDone=1;
            break;

            }
    }
    if(rgszList[0][0]=='*')
        fDOS=1;
    if(rgszList[1][0]=='*')
        fOS2=1;
    if(rgszList[2][0]=='*')
        fNT=1;


      /* get destination default */
    if(fDOS)
    {
       /* get default path */
       strcpy(rgchDosDestPath, SzGetMacroSz("DOSDEFAULTDEST"));

       while(1)
       {
           /* get path from user */
           pscrT = pHdScreen[N_SDIRECTORY];
           PutTempMacro("DOS");
           ScrDisplay(pscrT);
           InputPath(rgchDosDestPath, rgchDosDestPath, 60, 0, TRUE, InRect3(pscrT));
           if(CheckEnlisted(rgchDosDestPath))
                      continue;
           break;
       }
    }

    if(fOS2)
    {
       strcpy(rgchOs2DestPath, SzGetMacroSz("OS2DEFAULTDEST"));
       while(1)
       {
           pscrT = pHdScreen[N_SDIRECTORY];
           PutTempMacro("OS/2");
           ScrDisplay(pscrT);
           InputPath(rgchOs2DestPath, rgchOs2DestPath, 60, 0, TRUE, InRect3(pscrT));
           if(CheckEnlisted(rgchOs2DestPath))
              continue;
           if(fDOS)
              if(!_strcmpi(rgchOs2DestPath,rgchDosDestPath))
              {
                    /* error, same dest path as other module */
                    DestPathError(rgchOs2DestPath);
                    continue;
              }
           break;
       }
    }

    if(fNT)
    {
       strcpy(rgchNtDestPath, SzGetMacroSz("NTDEFAULTDEST"));
       while(1)
       {
           pscrT = pHdScreen[N_SDIRECTORY];
           PutTempMacro("NT");
           ScrDisplay(pscrT);
           InputPath(rgchNtDestPath, rgchNtDestPath, 60, 0, TRUE, InRect3(pscrT));

           if(CheckEnlisted(rgchNtDestPath))
              continue;

           if(fDOS)
              if(!_strcmpi(rgchNtDestPath,rgchDosDestPath))
              {
                    DestPathError(rgchNtDestPath);
                    continue;
              }
           if(fOS2)
              if(!_strcmpi(rgchNtDestPath,rgchOs2DestPath))
              {
                    DestPathError(rgchNtDestPath);
                    continue;
              }
           break;
       }
    }


      /* copy files */
    if(fDOS)
    {
        MakePath(rgchDosDestPath, 1, FALSE);
        strcpy(rgchDestPath,rgchDosDestPath);
        rgplT = RgplFromPl(pHdList[N_LDOSFILESTOCOPY]);
        PutTempMacro("DOS");
        ScrnoDisplay(N_SINSTALL);
        CopyRgplFiles(rgplT);
        free(rgplT);
    }
    if(fOS2)
    {
        MakePath(rgchOs2DestPath, 1, FALSE);
        strcpy(rgchDestPath,rgchOs2DestPath);
        rgplT = RgplFromPl(pHdList[N_LOS2FILESTOCOPY]);
        PutTempMacro("OS/2");
        ScrnoDisplay(N_SINSTALL);
        CopyRgplFiles(rgplT);
        free(rgplT);
    }
    if(fNT)
    {
        MakePath(rgchNtDestPath, 1, FALSE);
        strcpy(rgchDestPath,rgchNtDestPath);
        rgplT = RgplFromPl(pHdList[N_LNTFILESTOCOPY]);
        PutTempMacro("NT");
        ScrnoDisplay(N_SINSTALL);
        CopyRgplFiles(rgplT);
        free(rgplT);
    }


      /* Finished screen */
    ScrnoDisplay(N_SFINISHED);
}