[PC-BSD Commits] r19613 - users/ken/EasyPBI2

svn at pcbsd.org svn at pcbsd.org
Mon Oct 8 08:50:22 PDT 2012


Author: kenmoore
Date: 2012-10-08 15:50:22 +0000 (Mon, 08 Oct 2012)
New Revision: 19613

Modified:
   users/ken/EasyPBI2/Makefile
   users/ken/EasyPBI2/main.cpp
   users/ken/EasyPBI2/mainGUI.cpp
   users/ken/EasyPBI2/mainGUI.h
   users/ken/EasyPBI2/mainGUI.ui
   users/ken/EasyPBI2/modBuild.cpp
   users/ken/EasyPBI2/modBuild.h
Log:
Save the current status of EasyPBI2 



Modified: users/ken/EasyPBI2/Makefile
===================================================================
--- users/ken/EasyPBI2/Makefile	2012-10-08 14:05:37 UTC (rev 19612)
+++ users/ken/EasyPBI2/Makefile	2012-10-08 15:50:22 UTC (rev 19613)
@@ -1,6 +1,6 @@
 #############################################################################
 # Makefile for building: EasyPBI
-# Generated by qmake (2.01a) (Qt 4.8.2) on: Tue Oct 2 22:28:12 2012
+# Generated by qmake (2.01a) (Qt 4.8.2) on: Thu Oct 4 17:40:25 2012
 # Project:  EasyPBI.pro
 # Template: app
 # Command: /usr/local/bin/qmake-qt4 -o Makefile EasyPBI.pro
@@ -196,7 +196,9 @@
 compiler_moc_header_make_all: moc_mainGUI.cpp moc_modBuild.cpp
 compiler_moc_header_clean:
 	-$(DEL_FILE) moc_mainGUI.cpp moc_modBuild.cpp
-moc_mainGUI.cpp: mainGUI.h
+moc_mainGUI.cpp: modBuild.h \
+		backend.h \
+		mainGUI.h
 	/usr/local/bin/moc-qt4 $(DEFINES) $(INCPATH) mainGUI.h -o moc_mainGUI.cpp
 
 moc_modBuild.cpp: modBuild.h
@@ -234,13 +236,15 @@
 
 ####### Compile
 
-main.o: main.cpp mainGUI.h
+main.o: main.cpp mainGUI.h \
+		modBuild.h \
+		backend.h
 	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp
 
 mainGUI.o: mainGUI.cpp mainGUI.h \
-		ui_mainGUI.h \
 		modBuild.h \
-		backend.h
+		backend.h \
+		ui_mainGUI.h
 	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o mainGUI.o mainGUI.cpp
 
 modBuild.o: modBuild.cpp modBuild.h

Modified: users/ken/EasyPBI2/main.cpp
===================================================================
--- users/ken/EasyPBI2/main.cpp	2012-10-08 14:05:37 UTC (rev 19612)
+++ users/ken/EasyPBI2/main.cpp	2012-10-08 15:50:22 UTC (rev 19613)
@@ -19,11 +19,13 @@
     translator.load( QString("EasyPBI_") + langCode, PREFIX + "/share/pcbsd/i18n/" );
     a.installTranslator( &translator );
     qDebug() << "Locale:" << langCode;
+    
 
-
     MainGUI w;
     QObject::connect(&a, SIGNAL(messageReceived(const QString&)), &w, SLOT(slotSingleInstance()) );
     w.show();
 
-    return a.exec();
+    int retCode = a.exec();
+    qDebug() << "EasyPBI closing with return code: "<<retCode;
+    return retCode;
 }

Modified: users/ken/EasyPBI2/mainGUI.cpp
===================================================================
--- users/ken/EasyPBI2/mainGUI.cpp	2012-10-08 14:05:37 UTC (rev 19612)
+++ users/ken/EasyPBI2/mainGUI.cpp	2012-10-08 15:50:22 UTC (rev 19613)
@@ -13,8 +13,11 @@
 	
        //Setup Initial state of GUI objects and connect signal/slots
        ui->setupUi(this);  //load the mainGUI.ui file
+	// Create the module class necessary
+	currentModule = new ModBuild();
 	//Setup the Menu items
-	ui->actionClose_EasyPBI->setIcon(Backend::icon(""));
+	ui->actionExit->setIcon(Backend::icon(""));
+	menuList.clear();
 	//Setup Toolbar
 	ui->actionNew_Module->setIcon(Backend::icon("new"));
 	ui->actionLoad_Module->setIcon(Backend::icon("load"));
@@ -62,7 +65,7 @@
 	menuList[2]->addAction("nocrash");
 	ui->push_el_filetype->setMenu(menuList[2]);
 	//Setup PBI Builder
-	ui->push_build_stop->setIcon(Backend::icon("clear"));
+	ui->push_build_stop->setIcon(Backend::icon("close"));
 	ui->push_build_save->setIcon(Backend::icon("save"));
 	
       SetupDefaults(); //load program defaults
@@ -72,7 +75,7 @@
 
 MainGUI::~MainGUI()
 {
-  
+  qDebug() << "Closing EasyPBI";
 }
 
 void MainGUI::slotSingleInstance(){
@@ -97,7 +100,6 @@
   PBISETTINGS_FILE= PROG_DIR + "/.savedPBISettings.conf";
   DEFAULTICON_FILE= PROG_DIR + "/defaulticon.png";
   PORTS_DIR = "";
-  PORT_SELECTED = "";
   
   //Check for EasyPBI directory structure and create it if it is not there
   if( !QDir(PROG_DIR).exists() ){
@@ -273,3 +275,27 @@
   }
   
 }
+
+void MainGUI::on_actionExit_triggered(){
+  close();
+}
+
+void MainGUI::on_actionNew_Module_triggered(){
+  qDebug() << "New Module triggered";
+}
+
+void MainGUI::on_actionLoad_Module_triggered(){
+  qDebug() << "Load Module triggered";
+  QString modSel = QFileDialog::getExistingDirectory(this, tr("Select Module"), MODOUT_DIR);
+  //QString modSel = MODOUT_DIR+"/agame";
+  qDebug() << "done with dialog";
+  if(modSel.isEmpty()){return;} //action cancelled or closed
+  bool ok = currentModule->loadModule(modSel);
+  if(ok){ 
+    line_module->setText(modSel); 
+    if(currentModule->pbiType() == "local"){ radio_module_local->toggle(); }
+    else{ radio_module_port->toggle(); }
+    refreshGUI("all");
+  }
+}
+

Modified: users/ken/EasyPBI2/mainGUI.h
===================================================================
--- users/ken/EasyPBI2/mainGUI.h	2012-10-08 14:05:37 UTC (rev 19612)
+++ users/ken/EasyPBI2/mainGUI.h	2012-10-08 15:50:22 UTC (rev 19613)
@@ -12,13 +12,10 @@
 #include <QDateTime>
 #include <QRadioButton>
 #include <QMenu>
+#include <QFileDialog>
 
-#ifndef TRUE
-#define TRUE 1
-#endif
-#ifndef FALSE
-#define FALSE 0
-#endif
+#include "modBuild.h"
+#include "backend.h"
 
 namespace Ui {
     class MainGUI;
@@ -36,15 +33,18 @@
 private slots:
     void slotSingleInstance();
     void refreshGUI(QString);
+    void on_actionExit_triggered();
+    void on_actionNew_Module_triggered();
+    void on_actionLoad_Module_triggered();
 
 private:
     Ui::MainGUI *ui;
+    ModBuild *currentModule;
     QLineEdit *line_module;
     QRadioButton *radio_module_port, *radio_module_local;
     QList<QMenu*> menuList;
-    //QMenu *menu_el_options;//, *menu_el_bins;
-    //QMenu *menu_pbi_opts;
-    QString PROG_DIR, PORTS_DIR, PORT_SELECTED, PBIOUT_DIR, MODOUT_DIR, CACHE_DIR, PROGVERSION, PBISETTINGS_FILE, DEFAULTICON_FILE;
+
+    QString PROG_DIR, PORTS_DIR, PBIOUT_DIR, MODOUT_DIR, CACHE_DIR, PROGVERSION, PBISETTINGS_FILE, DEFAULTICON_FILE;
     QString SU_CMD, PBIBUILD_CMD, PBICREATE_CMD, PBI_BUILDING_NOW;
     bool PBI_BUILD_TERMINATED;
     QProcess *p;

Modified: users/ken/EasyPBI2/mainGUI.ui
===================================================================
(Binary files differ)

Modified: users/ken/EasyPBI2/modBuild.cpp
===================================================================
--- users/ken/EasyPBI2/modBuild.cpp	2012-10-08 14:05:37 UTC (rev 19612)
+++ users/ken/EasyPBI2/modBuild.cpp	2012-10-08 15:50:22 UTC (rev 19613)
@@ -59,7 +59,7 @@
 bool ModBuild::loadModule(QString modPath){
   //verify that the module exists
   QDir dir(modPath);
-  if( !dir.exists() || !dir.exists("pbi.conf") ){
+  if( !( dir.exists() && dir.exists("pbi.conf") ) ){
     qDebug() << "Cannot load module: not a valid module directory - "+modPath;
     return FALSE;
   }
@@ -1151,3 +1151,9 @@
   //Return the result status
   return success;
 }
+
+QString ModBuild::pbiType(){
+  if(isLocalPBI){ return "local"; }
+  else if(isPortPBI){ return "port"; }
+  else{ return "unknown"; }
+}
\ No newline at end of file

Modified: users/ken/EasyPBI2/modBuild.h
===================================================================
--- users/ken/EasyPBI2/modBuild.h	2012-10-08 14:05:37 UTC (rev 19612)
+++ users/ken/EasyPBI2/modBuild.h	2012-10-08 15:50:22 UTC (rev 19613)
@@ -61,6 +61,7 @@
   QStringList filesAvailable(QString); //get the available files per category
   void compressModule();  //package the module for distribution
   bool createModuleDir();  //Create/overwrite module directory structure
+  QString pbiType(); //get the current PBI type the module creates (local, port, etc).
   
   // --Static functions--
   static bool createFile(QString,QStringList);



More information about the Commits mailing list