[PC-BSD Commits] r20124 - users/ken/EasyPBI2
svn at pcbsd.org
svn at pcbsd.org
Tue Nov 6 13:16:55 PST 2012
Author: kenmoore
Date: 2012-11-06 21:16:55 +0000 (Tue, 06 Nov 2012)
New Revision: 20124
Added:
users/ken/EasyPBI2/newModuleDialog.cpp
users/ken/EasyPBI2/newModuleDialog.h
Modified:
users/ken/EasyPBI2/mainGUI.cpp
Log:
Get the first steps for the new module GUI for EasyPBI2 done.
Modified: users/ken/EasyPBI2/mainGUI.cpp
===================================================================
--- users/ken/EasyPBI2/mainGUI.cpp 2012-11-06 15:25:52 UTC (rev 20123)
+++ users/ken/EasyPBI2/mainGUI.cpp 2012-11-06 21:16:55 UTC (rev 20124)
@@ -397,6 +397,25 @@
*/
void MainGUI::on_actionNew_Module_triggered(){
qDebug() << "New Module triggered";
+ //Create and run the new dialog
+ newModuleDialog dlg(this);
+ dlg.setModal(TRUE);
+ dlg.exec();
+ //Determine if the action was cancelled
+ if( dlg.isAccepted ){
+ //Now create the new module
+ QString modPath, modType, modBase, oldIconPath;
+ dlg.getUserInput(&modType, &modBase, &oldIconPath);
+ //modPath ->full path, modType->"local"or "port", modBase->makeport or packagedir
+ bool ok = currentModule->createNewModule(modPath,modType,modBase);
+ if(!ok){
+ QMessageBox::warning(this,tr("EasyPBI: Permissions Error"), tr("Could not create PBI module. Please check the directory permissions and try again."));
+ }else{
+ currentModule->addResource(oldIconPath);
+ }
+ }
+ //Refresh the UI
+ refreshGUI("all");
}
void MainGUI::on_actionLoad_Module_triggered(){
@@ -455,7 +474,7 @@
if(portSel.isEmpty()){return;} //action cancelled or closed
//Check if the port is valid
if( !isValidPort(portSel) ){
- 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-."));
+ 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."));
return;
}
//Save the port info to the GUI
More information about the Commits
mailing list