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

svn at pcbsd.org svn at pcbsd.org
Tue Oct 2 19:42:29 PDT 2012


Author: kenmoore
Date: 2012-10-03 02:42:29 +0000 (Wed, 03 Oct 2012)
New Revision: 19584

Modified:
   users/ken/EasyPBI2/Makefile
   users/ken/EasyPBI2/mainGUI.cpp
   users/ken/EasyPBI2/mainGUI.h
   users/ken/EasyPBI2/mainGUI.ui
Log:
Make a number of update mechanisms to EasyPBI2 so that the UI items will now actively appear/dissappear as necessary



Modified: users/ken/EasyPBI2/Makefile
===================================================================
--- users/ken/EasyPBI2/Makefile	2012-10-02 22:57:13 UTC (rev 19583)
+++ users/ken/EasyPBI2/Makefile	2012-10-03 02:42:29 UTC (rev 19584)
@@ -1,6 +1,6 @@
 #############################################################################
 # Makefile for building: EasyPBI
-# Generated by qmake (2.01a) (Qt 4.8.2) on: Tue Oct 2 14:58:32 2012
+# Generated by qmake (2.01a) (Qt 4.8.2) on: Tue Oct 2 22:28:12 2012
 # Project:  EasyPBI.pro
 # Template: app
 # Command: /usr/local/bin/qmake-qt4 -o Makefile EasyPBI.pro

Modified: users/ken/EasyPBI2/mainGUI.cpp
===================================================================
--- users/ken/EasyPBI2/mainGUI.cpp	2012-10-02 22:57:13 UTC (rev 19583)
+++ users/ken/EasyPBI2/mainGUI.cpp	2012-10-03 02:42:29 UTC (rev 19584)
@@ -31,6 +31,7 @@
 	ui->toolBar->addWidget(radio_module_local);
 	//Setup Module Editor
 	// -- pbi.conf tab --
+	ui->push_change_progdir->setIcon(Backend::icon("load"));
 	ui->push_change_makeport->setIcon(Backend::icon("file"));
 	ui->push_addmakeopt->setIcon(Backend::icon("left"));
 	menuList[0] = new QMenu();
@@ -59,13 +60,12 @@
 	menuList[2]->addAction("nocrash");
 	ui->push_el_filetype->setMenu(menuList[2]);
 	//Setup PBI Builder
-	ui->push_build_start->setIcon(Backend::icon("start"));
-	ui->push_build_stop->setIcon(Backend::icon("stop"));
+	ui->push_build_stop->setIcon(Backend::icon("clear"));
 	ui->push_build_save->setIcon(Backend::icon("save"));
 	
-      SetupDefaults();
-      //Deactivate the PBI Build tab if the proper external utilities not found
-      qDebug() << "At end of setup";
+      SetupDefaults(); //load program defaults
+      refreshGUI("all"); //make items visible/invisible as necessary
+      
 }
 
 MainGUI::~MainGUI()
@@ -159,3 +159,109 @@
   PBI_BUILDING_NOW.clear();
   PBI_BUILD_TERMINATED=FALSE;
 }
+
+void MainGUI::refreshGUI(QString item){
+  //Enable/disable the interface appropriately
+  
+  //Stupid check to make sure that a module is actually loaded
+  if( line_module->text().isEmpty() ){ ui->toolBox->setEnabled(FALSE); }
+  else{ ui->toolBox->setEnabled(TRUE); }
+  //Figure out the type of module that is loaded
+  bool isport = radio_module_port->isChecked();
+  //See if we should refresh everything (default)  
+  bool doall = ( (item == "all") || item.isEmpty() );
+  bool doeditor = (item == "editor"); //also add a flag to just refresh the editor
+  //Refresh the desired tab(s)
+  if( doall || doeditor || (item == "pbiconf")){
+    if(isport){
+	ui->line_progversion->setVisible(FALSE); ui->label_progversion->setVisible(FALSE);
+	ui->line_progdir->setVisible(FALSE); ui->push_change_progdir->setVisible(FALSE); ui->label_progdir->setVisible(FALSE);
+	ui->line_makeport->setVisible(TRUE); ui->push_change_makeport->setVisible(TRUE); ui->label_makeport->setVisible(TRUE);
+	ui->line_makeopts->setVisible(TRUE); ui->push_addmakeopt->setVisible(TRUE); ui->label_makeopts->setVisible(TRUE);
+	ui->list_portbefore->setVisible(TRUE); ui->push_addportbefore->setVisible(TRUE); ui->push_rmportbefore->setVisible(TRUE);ui->label_portbefore->setVisible(TRUE);
+	ui->list_portafter->setVisible(TRUE); ui->push_addportafter->setVisible(TRUE); ui->push_rmportafter->setVisible(TRUE); ui->label_portafter->setVisible(TRUE);
+    }else{
+	ui->line_progversion->setVisible(TRUE); ui->label_progversion->setVisible(TRUE);
+	ui->line_progdir->setVisible(TRUE); ui->push_change_progdir->setVisible(TRUE); ui->label_progdir->setVisible(TRUE);
+	ui->line_makeport->setVisible(FALSE); ui->push_change_makeport->setVisible(FALSE); ui->label_makeport->setVisible(FALSE);
+	ui->line_makeopts->setVisible(FALSE); ui->push_addmakeopt->setVisible(FALSE); ui->label_makeopts->setVisible(FALSE);
+	ui->list_portbefore->setVisible(FALSE); ui->push_addportbefore->setVisible(FALSE); ui->push_rmportbefore->setVisible(FALSE);ui->label_portbefore->setVisible(FALSE);
+	ui->list_portafter->setVisible(FALSE); ui->push_addportafter->setVisible(FALSE); ui->push_rmportafter->setVisible(FALSE); ui->label_portafter->setVisible(FALSE);
+    }
+  }
+  if( doall || doeditor || (item == "resources")){
+    
+  }
+  if( doall || doeditor || (item == "xdg")){
+    bool isDesktop = ui->radio_xdg_desktop->isChecked();
+    bool isMenu = ui->radio_xdg_menu->isChecked();
+    if(isDesktop){
+	//xdg-desktop entry
+	//Current file
+	ui->label_xdg_name->setVisible(TRUE); ui->line_xdg_name->setVisible(TRUE);
+	ui->label_xdg_exec->setVisible(TRUE); ui->line_xdg_exec->setVisible(TRUE);
+	ui->label_xdg_icon->setVisible(TRUE); ui->list_xdg_icon->setVisible(TRUE);
+	ui->label_xdg_menu->setVisible(FALSE); ui->list_xdg_menu->setVisible(FALSE);
+	ui->check_xdg_terminal->setVisible(TRUE);
+	ui->label_xdg_mimetype->setVisible(FALSE); ui->line_xdg_mimetype->setVisible(FALSE);
+	ui->label_xdg_mimepatterns->setVisible(FALSE); ui->line_xdg_mimepatterns->setVisible(FALSE);
+	//New file
+	ui->label_xdg_namenew->setVisible(TRUE); ui->line_xdg_namenew->setVisible(TRUE);
+	ui->label_xdg_execnew->setVisible(TRUE); ui->line_xdg_execnew->setVisible(TRUE);
+	ui->label_xdg_iconnew->setVisible(TRUE); ui->list_xdg_iconnew->setVisible(TRUE);
+	ui->label_xdg_menunew->setVisible(FALSE); ui->list_xdg_menunew->setVisible(FALSE);
+	ui->check_xdg_terminalnew->setVisible(TRUE);
+	ui->label_xdg_mimetypenew->setVisible(FALSE); ui->line_xdg_mimetypenew->setVisible(FALSE);
+	ui->label_xdg_mimepatternsnew->setVisible(FALSE); ui->line_xdg_mimepatternsnew->setVisible(FALSE);
+    }else if(isMenu){
+	//xdg-menu entry
+	//Current file
+	ui->label_xdg_name->setVisible(TRUE); ui->line_xdg_name->setVisible(TRUE);
+	ui->label_xdg_exec->setVisible(TRUE); ui->line_xdg_exec->setVisible(TRUE);
+	ui->label_xdg_icon->setVisible(TRUE); ui->list_xdg_icon->setVisible(TRUE);
+	ui->label_xdg_menu->setVisible(TRUE); ui->list_xdg_menu->setVisible(TRUE);
+	ui->check_xdg_terminal->setVisible(TRUE);
+	ui->label_xdg_mimetype->setVisible(FALSE); ui->line_xdg_mimetype->setVisible(FALSE);
+	ui->label_xdg_mimepatterns->setVisible(FALSE); ui->line_xdg_mimepatterns->setVisible(FALSE);
+	//New file
+	ui->label_xdg_namenew->setVisible(TRUE); ui->line_xdg_namenew->setVisible(TRUE);
+	ui->label_xdg_execnew->setVisible(TRUE); ui->line_xdg_execnew->setVisible(TRUE);
+	ui->label_xdg_iconnew->setVisible(TRUE); ui->list_xdg_iconnew->setVisible(TRUE);
+	ui->label_xdg_menunew->setVisible(TRUE); ui->list_xdg_menunew->setVisible(TRUE);
+	ui->check_xdg_terminalnew->setVisible(TRUE);
+	ui->label_xdg_mimetypenew->setVisible(FALSE); ui->line_xdg_mimetypenew->setVisible(FALSE);
+	ui->label_xdg_mimepatternsnew->setVisible(FALSE); ui->line_xdg_mimepatternsnew->setVisible(FALSE);
+    }else{
+	//xdg-mime entry
+	//Current file
+	ui->label_xdg_name->setVisible(FALSE); ui->line_xdg_name->setVisible(FALSE);
+	ui->label_xdg_exec->setVisible(FALSE); ui->line_xdg_exec->setVisible(FALSE);
+	ui->label_xdg_icon->setVisible(FALSE); ui->list_xdg_icon->setVisible(FALSE);
+	ui->label_xdg_menu->setVisible(FALSE); ui->list_xdg_menu->setVisible(FALSE);
+	ui->check_xdg_terminal->setVisible(FALSE);
+	ui->label_xdg_mimetype->setVisible(TRUE); ui->line_xdg_mimetype->setVisible(TRUE);
+	ui->label_xdg_mimepatterns->setVisible(TRUE); ui->line_xdg_mimepatterns->setVisible(TRUE);
+	//New file
+	ui->label_xdg_namenew->setVisible(FALSE); ui->line_xdg_namenew->setVisible(FALSE);
+	ui->label_xdg_execnew->setVisible(FALSE); ui->line_xdg_execnew->setVisible(FALSE);
+	ui->label_xdg_iconnew->setVisible(FALSE); ui->list_xdg_iconnew->setVisible(FALSE);
+	ui->label_xdg_menunew->setVisible(FALSE); ui->list_xdg_menunew->setVisible(FALSE);
+	ui->check_xdg_terminalnew->setVisible(FALSE);
+	ui->label_xdg_mimetypenew->setVisible(TRUE); ui->line_xdg_mimetypenew->setVisible(TRUE);
+	ui->label_xdg_mimepatternsnew->setVisible(TRUE); ui->line_xdg_mimepatternsnew->setVisible(TRUE);
+    }
+  }
+  if( doall || doeditor || (item == "scripts")){
+    //nothing to make visible/invisible here
+  }
+  if( doall || doeditor || (item == "external-links")){
+    //nothing to make visible/invisible here
+  }
+  if( doall || doeditor || (item == "freenas")){
+    //nothing to make visible/invisible here
+  }
+  if( doall || (item == "pbibuild")){
+	  
+  }
+  
+}

Modified: users/ken/EasyPBI2/mainGUI.h
===================================================================
--- users/ken/EasyPBI2/mainGUI.h	2012-10-02 22:57:13 UTC (rev 19583)
+++ users/ken/EasyPBI2/mainGUI.h	2012-10-03 02:42:29 UTC (rev 19584)
@@ -35,6 +35,7 @@
 
 private slots:
     void slotSingleInstance();
+    void refreshGUI(QString);
 
 private:
     Ui::MainGUI *ui;

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



More information about the Commits mailing list