[PC-BSD Commits] r17338 - pcbsd/current/src-qt4/EasyPBI

svn at pcbsd.org svn at pcbsd.org
Wed Jun 20 06:49:07 PDT 2012


Author: kenmoore
Date: 2012-06-20 13:49:07 +0000 (Wed, 20 Jun 2012)
New Revision: 17338

Modified:
   pcbsd/current/src-qt4/EasyPBI/mainwindow.cpp
   pcbsd/current/src-qt4/EasyPBI/modBuild.cpp
Log:
Update EasyPBI to 1.3 - This includes the ability to read the new OptionsNG format for ports, fixing up some translation strings, and updating the EasyPBI docs from the menu tab, in addition to other misc fixes.



Modified: pcbsd/current/src-qt4/EasyPBI/mainwindow.cpp
===================================================================
--- pcbsd/current/src-qt4/EasyPBI/mainwindow.cpp	2012-06-20 13:44:09 UTC (rev 17337)
+++ pcbsd/current/src-qt4/EasyPBI/mainwindow.cpp	2012-06-20 13:49:07 UTC (rev 17338)
@@ -52,7 +52,7 @@
       exit(0);
     }
 
-  PROGVERSION = "1.2";
+  PROGVERSION = "1.3";
   PROG_DIR = QDir::homePath() + "/EasyPBI";
   PBIOUT_DIR= PROG_DIR + "/PBI";
   MODOUT_DIR= PROG_DIR + "/Modules";  
@@ -139,11 +139,11 @@
 
 void MainWindow::on_actionAbout_EasyPBI_triggered()
 {
-    QMessageBox::about(this, tr("About EasyPBI"), tr("EasyPBI ")+PROGVERSION+tr("\nCreate PBI modules quickly and easily.\nhttp://makeapbi.sourceforge.net\nWritten by Jesse Smith and Ken Moore"));
+    QMessageBox::about(this, tr("About EasyPBI"), tr("EasyPBI")+" "+PROGVERSION+"\n"+tr("Create PBI's quickly and easily.")+"\nhttp://makeapbi.sourceforge.net\n"+tr("Written by Jesse Smith and Ken Moore"));
 }
 
 void MainWindow::on_actionAppCafe_Integration_triggered(){
-  QString instructions = tr("Steps to integrate your PBI modules with the official PC-BSD Repository:\n\n  1) Ensure the module works by building and testing the PBI with EasyPBI, making adjustments to the module as needed.\n  2) Check that the module does not already exist in the PC-BSD repository at: http://trac.pcbsd.org/browser/pbi/modules\n  3) E-mail the compressed module file to: pbi-dev at lists.pcbsd.org\nThe module will require re-compression (tar czf 'new-filename.tar.gz' 'module-directory') if modifications were made to the module.\n\nTo place the module into an alternate PBI repository, please contact the maintainer of that repository for instructions.");
+  QString instructions = tr("Steps to integrate your PBI modules with the official PC-BSD Repository")+":\n\n  1) "+tr("Ensure the module works by building and testing the PBI with EasyPBI, making adjustments to the module as needed.")+"\n  2) "+tr("Check that the module does not already exist in the PC-BSD repository at")+": http://trac.pcbsd.org/browser/pbi/modules\n  3) "+tr("E-mail the packaged module file to")+": pbi-dev at lists.pcbsd.org\n\n"+tr("To place the module into an alternate PBI repository, please contact the maintainer of that repository for instructions.");
   QMessageBox::about(this, tr("EasyPBI: AppCafe Integration"), instructions);
 }
 
@@ -229,7 +229,7 @@
     } //noModulePath check
     QString result;
     if(success){ 
-      result = tr("Done. Your module is located in the EasyPBI folder.\nPlease view the 'AppCafe Integration' page for further instructions"); 
+      result = tr("Done. Your module is located in the EasyPBI folder.")+"\n"+tr("Please view the 'AppCafe Integration' page for further instructions"); 
       qDebug() << "Finished building Module";
     }
     else{ 
@@ -268,7 +268,7 @@
     }
     //No ports tree detected - Display warning
     if (show_warning)
-        QMessageBox::warning(this, tr("Ports Not Installed"),tr("The FreeBSD ports tree is not installed for this system or user.\nPlease Install the ports tree as root to make it available for all users, or push 'File'->'Get Ports' to retrieve the ports tree for this user ONLY"));
+        QMessageBox::warning(this, tr("Ports Not Installed"),tr("The FreeBSD ports tree is not installed for this system or user.")+"\n"+tr("Please Install the ports tree as root to make it available for all users, or push 'File'->'Get Ports' to retrieve the ports tree for this user ONLY"));
     return FALSE;
 }
 
@@ -345,7 +345,7 @@
   QFile file(PROG_DIR+"/ports.tar.gz");  
   file.remove();
   //Let the user know that the ports tree was successfully added
-  ui->status_bar->setText(tr("The FreeBSD ports tree has been successfully added to the EasyPBI directory.\nPlease select 'New Module' from the file menu to continue."));
+  ui->status_bar->setText(tr("The FreeBSD ports tree has been successfully added to the EasyPBI directory."));
   return;
 }
 
@@ -369,7 +369,7 @@
 
 void MainWindow::on_pushChangeSigFile_clicked(){
   QString outDir_path;
-  outDir_path = QFileDialog::getOpenFileName(this, tr("Select Digital Signiture File"), PROG_DIR,tr("Signature Files (*)"));
+  outDir_path = QFileDialog::getOpenFileName(this, tr("Select Digital Signiture File"), PROG_DIR,tr("Signature Files")+" (*)");
   if(outDir_path.isEmpty()){return;} //action cancelled or closed
   PBIOUT_DIR = outDir_path;
   ui->linePBIDigSigFile->setText(outDir_path);
@@ -501,7 +501,7 @@
       //The user killed the process - No Message
     }
   }else{
-    QMessageBox::warning(this,tr("PBI Build Failure"),tr("The PBI failed to build.\nPlease check the build log to find the cause of the failure and adjust the module accordingly"));
+    QMessageBox::warning(this,tr("PBI Build Failure"),tr("The PBI failed to build.")+"\n"+tr("Please check the build log to find the cause of the failure and adjust the module accordingly"));
   }
   ui->pushBuildPBI->setEnabled(TRUE);
   ui->pushSaveLog->setEnabled(TRUE);
@@ -523,7 +523,7 @@
 
 void MainWindow::on_pushSaveLog_clicked(){
   //Have user select a filename/location to save the log
-  QString filename = QFileDialog::getSaveFileName(this,tr("Save Log"),PROG_DIR+"/build.log",tr("Log Files (*.log *.txt)"));
+  QString filename = QFileDialog::getSaveFileName(this,tr("Save Log"),PROG_DIR+"/build.log",tr("Log Files")+" (*.log *.txt)");
   if(filename.isEmpty()){return;} //User cancelled the process
   //Open the file (as new)
   QFile *file = new QFile(filename);

Modified: pcbsd/current/src-qt4/EasyPBI/modBuild.cpp
===================================================================
--- pcbsd/current/src-qt4/EasyPBI/modBuild.cpp	2012-06-20 13:44:09 UTC (rev 17337)
+++ pcbsd/current/src-qt4/EasyPBI/modBuild.cpp	2012-06-20 13:49:07 UTC (rev 17338)
@@ -699,21 +699,49 @@
     QTextStream mkin(&mkfile);
     while( !mkin.atEnd() ){
       QString line = mkin.readLine().simplified();
+      // ---- Program Name -----
       if( line.startsWith("PORTNAME") ){
         portStruct[0] = line.replace("\t"," ").section(" ",1,1,QString::SectionSkipEmpty);
 	qDebug() << " - Found portname:" << portStruct[0];
+      // ---- Port Maintainer -----
       }else if( line.startsWith("MAINTAINER") ){
         portStruct[1] = line.replace("\t"," ").section(" ",1,1,QString::SectionSkipEmpty);
 	qDebug() << " - Found maintainer:"<< portStruct[1];
-      }else if( line.startsWith("OPTIONS") ){
+      // ---- OptionsNG Framework --------
+      }else if( line.startsWith("OPTIONS_DEFINE") || line.startsWith("OPTIONS_SINGLE_") || line.startsWith("OPTIONS_MULTI_") ){
+	listopts << line.replace("\t"," ").section("=",1,50,QString::SectionSkipEmpty).simplified().split(" ");	
+	while( line.simplified().endsWith("\\")){
+	  line = mkin.readLine().replace("\t"," ");
+	  listopts << line.split(" ");
+	}
+      }else if( line.startsWith("OPTIONS_DEFAULT") ){
+	QStringList defaults = line.replace("\t"," ").section("=",1,50,QString::SectionSkipEmpty).simplified().split(" ");	
+	for(int i=0; i<listopts.length(); i++){
+          if(defaults.contains(listopts[i].simplified()) ){ 
+            actualopts << "WITHOUT_"+listopts[i].simplified();
+          }else{
+            actualopts << "WITH_"+listopts[i].simplified();
+          }
+        }
+      // ---- Legacy Options Framework -------
+      }else if( line.startsWith("OPTIONS") && !line.startsWith("OPTIONS_") ){
 	listopts << line.replace("\t"," ").section(" ",1,1,QString::SectionSkipEmpty);	
 	while( line.simplified().endsWith("\\")){
 	  line = mkin.readLine().replace("\t"," ");
 	  listopts << line.section(" ",0,0,QString::SectionSkipEmpty).simplified();
 	}
+      }else if( line.startsWith(".if defined(") || line.startsWith(".if !defined(") ){
+        //Get the variable used (we need WITH_* or WITHOUT_*)
+        QString var = line.section("(",1,1).section(")",0,0).simplified();
+	//qDebug() << line << var << var.section("_",1,1);
+	if( var.startsWith("WITH") && listopts.contains( var.section("_",1,1) ) ){
+	  actualopts << var;
+	}
+      // ---- Program Website -----
       }else if( line.startsWith("WWW") ){
           portStruct[2] = line.section(" ",1,1,QString::SectionSkipEmpty);
 	  qDebug() << " - Found website:"<< portStruct[2];
+      // ---- Program Binaries/Files ----
       }else if( line.startsWith("PLIST_FILES") ){ //catch PLIST_FILES= and PLIST_FILES+=
 	QStringList tmpL = line.section(" ",1,60).split(" ",QString::SkipEmptyParts);
 	while( line.simplified().endsWith("\\") ){
@@ -727,13 +755,6 @@
 	    if(tmpL[i].contains("$")){ variableBinFound=TRUE; }
 	  }  
 	}
-      }else if( line.startsWith(".if defined(") ){
-        //Get the variable used (we need WITH_* or WITHOUT_*)
-        QString var = line.section("(",1,1).section(")",0,0).simplified();
-	//qDebug() << line << var << var.section("_",1,1);
-	if( var.startsWith("WITH") && listopts.contains( var.section("_",1,1) ) ){
-	  actualopts << var;
-	}
       }else{
 	//do nothing - skip this line
       }
@@ -750,9 +771,11 @@
       QTextStream desin(&desfile);
       while( !desin.atEnd() ){
         QString line = desin.readLine().simplified();
+        // ---- Program Website -----
         if( line.startsWith("WWW:") ){
           portStruct[2] = line.replace("\t"," ").section(" ",1,1,QString::SectionSkipEmpty);
 	  qDebug() << " - Found website:" << portStruct[2];
+        // ---- Program Author -----
         }else if(line.startsWith("Author:") ){
 	  portStruct[1] = line.replace("\t"," ").section(" ",1,4,QString::SectionSkipEmpty);
 	  qDebug() << " - Found author:" << portStruct[1];



More information about the Commits mailing list