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

svn at pcbsd.org svn at pcbsd.org
Tue Jan 8 19:38:15 PST 2013


Author: kenmoore
Date: 2013-01-09 03:38:15 +0000 (Wed, 09 Jan 2013)
New Revision: 20899

Modified:
   pcbsd/current/src-qt4/EasyPBI/mainGUI.cpp
   pcbsd/current/src-qt4/EasyPBI/mainGUI.h
   pcbsd/current/src-qt4/EasyPBI/mainGUI.ui
Log:
Change over the widget used in the external-links tab to something better suited for multiple fields



Modified: pcbsd/current/src-qt4/EasyPBI/mainGUI.cpp
===================================================================
--- pcbsd/current/src-qt4/EasyPBI/mainGUI.cpp	2013-01-08 20:03:05 UTC (rev 20898)
+++ pcbsd/current/src-qt4/EasyPBI/mainGUI.cpp	2013-01-09 03:38:15 UTC (rev 20899)
@@ -283,8 +283,13 @@
   if( doall || doeditor || (item == "external-links")){
     //nothing to make visible/invisible here
     //Load the external-links file
-    ui->list_el_view->clear();
-    ui->list_el_view->addItems( currentModule->externalLinks() );
+    ui->tree_el_view->clear();
+    QStringList cLinks = currentModule->externalLinks();
+    QStringList labels; labels << tr("File") << tr("Link To") << tr("File Type");
+    for( int i=0; i<cLinks.length(); i++ ){
+      QStringList link = cLinks[i].split("\t");
+      ui->tree_el_view->addTopLevelItem(new QTreeWidgetItem(link));
+    }
     //Clear the input boxes
     ui->line_el_file->clear();
     ui->line_el_linkto->clear();
@@ -1167,11 +1172,10 @@
 
 void MainGUI::on_push_el_remove_clicked(){
   //Get the currently selected link
-  int row = ui->list_el_view->currentRow();
-  if(row == -1){ return; }
-  QString line = ui->list_el_view->currentItem()->text();
-  QString file = line.section("\t",0,0,QString::SectionSkipEmpty);
-  QString linkto = line.section("\t",1,1,QString::SectionSkipEmpty);
+  QTreeWidgetItem *line = ui->tree_el_view->currentItem();
+  if(line->columnCount() != 3){ return; }
+  QString file = line->text(0);
+  QString linkto = line->text(1);
   //Remove the link
   currentModule->removeExternalLink(file,linkto);
   //Save the file

Modified: pcbsd/current/src-qt4/EasyPBI/mainGUI.h
===================================================================
--- pcbsd/current/src-qt4/EasyPBI/mainGUI.h	2013-01-08 20:03:05 UTC (rev 20898)
+++ pcbsd/current/src-qt4/EasyPBI/mainGUI.h	2013-01-09 03:38:15 UTC (rev 20899)
@@ -13,7 +13,8 @@
 #include <QRadioButton>
 #include <QMenu>
 #include <QFileDialog>
-#include <QDesktopServices>
+#include <QTreeWidget>
+#include <QTreeWidgetItem>
 
 #include "modBuild.h"
 #include "backend.h"

Modified: pcbsd/current/src-qt4/EasyPBI/mainGUI.ui
===================================================================
(Binary files differ)



More information about the Commits mailing list