Changes in / [8534088:6810bbb]


Ignore:
Location:
src-qt4/EasyPBI
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/EasyPBI/mainGUI.cpp

    r9bdcc26 rcc7dbf3  
    163163} 
    164164 
    165 bool MainGUI::isValidPort(QString pPath){ 
     165bool MainGUI::isValidPort(QString pPath, bool allowOverride){ 
    166166  bool ok = FALSE; 
    167167  if( QFile::exists(pPath) && QFile::exists(pPath+"/Makefile") && QFile::exists(pPath+"/distinfo") ){ 
    168168    ok = TRUE; 
     169  } 
     170  //Display a warning message 
     171  if(allowOverride){ 
     172    ok = (QMessageBox::Apply == QMessageBox::warning(this,tr("EasyPBI: Invalid Port"), tr("The directory selected does not appear to be a valid FreeBSD port. \n\n Do you wish to continue using it anyway?"), QMessageBox::Apply | QMessageBox::Cancel, QMessageBox::Cancel) );  
     173  }else{ 
     174    QMessageBox::warning(this,tr("EasyPBI: Invalid Port"), tr("The directory selected is not a valid FreeBSD port. Please select a port directory which contains the appropriate Makefile and distinfo.")); 
    169175  } 
    170176  return ok; 
     
    545551  //Check if the port is valid 
    546552  if( !isValidPort(portSel) ){ 
    547     QMessageBox::warning(this,tr("EasyPBI: Invalid Port"), tr("The directory selected is not a valid FreeBSD port. Please select a port directory which contains the appropriate Makefile and distinfo.")); 
    548553    return; 
    549554  } 
     
    622627  if(portSel.isEmpty()){return;} //action cancelled or closed    
    623628  //Check if the port is valid 
    624   if( !isValidPort(portSel) ){ 
    625     QMessageBox::warning(this,tr("EasyPBI: Invalid Port"), tr("The directory selected is not a valid FreeBSD port. Please select a port directory which contains the appropriate Makefile and distinfo files.")); 
     629  if( !isValidPort(portSel,TRUE) ){ 
    626630    return; 
    627631  } 
     
    649653  if(portSel.isEmpty()){return;} //action cancelled or closed    
    650654  //Check if the port is valid 
    651   if( !isValidPort(portSel) ){ 
    652     QMessageBox::warning(this,tr("EasyPBI: Invalid Port"), tr("The directory selected is not a valid FreeBSD port. Please select a port directory which contains the appropriate Makefile and distinfo files.")); 
     655  if( !isValidPort(portSel,TRUE) ){ 
    653656    return; 
    654657  } 
     
    12341237  QStringList contents = ui->text_scripts_edit->toPlainText().split("\n"); 
    12351238  //get the current file 
    1236   QString filename = currentModule->path() + "/scripts/"+ui->list_scripts_file->currentText(); 
     1239  QString dir = currentModule->path() + "/scripts/"; 
     1240  bool ok = ModBuild::createDir(dir); //make sure the scripts directory exists 
     1241  QString filename = ui->list_scripts_file->currentText(); 
    12371242  //Save the file 
    1238   bool ok = ModBuild::createFile(filename,contents); 
     1243  ok = ModBuild::createFile(dir+filename,contents); 
    12391244  //display a warning if error 
    12401245  if(!ok){ 
  • src-qt4/EasyPBI/mainGUI.h

    re177abf rcc7dbf3  
    111111 
    112112    void SetupDefaults(); 
    113     bool isValidPort(QString); 
     113    bool isValidPort(QString, bool allowOverride = FALSE); 
    114114    void checkMime(); 
    115115 
Note: See TracChangeset for help on using the changeset viewer.