[PC-BSD Commits] r15830 - pcbsd-projects/EasyPBI

svn at pcbsd.org svn at pcbsd.org
Fri Mar 16 06:57:21 PDT 2012


Author: kenmoore
Date: 2012-03-16 13:57:21 +0000 (Fri, 16 Mar 2012)
New Revision: 15830

Modified:
   pcbsd-projects/EasyPBI/mainwindow.cpp
   pcbsd-projects/EasyPBI/mainwindow.ui
   pcbsd-projects/EasyPBI/modBuild.cpp
Log:
Finish up the desktop/menu editing and external-links editing



Modified: pcbsd-projects/EasyPBI/mainwindow.cpp
===================================================================
--- pcbsd-projects/EasyPBI/mainwindow.cpp	2012-03-16 10:19:00 UTC (rev 15829)
+++ pcbsd-projects/EasyPBI/mainwindow.cpp	2012-03-16 13:57:21 UTC (rev 15830)
@@ -863,15 +863,19 @@
   //Scan the xdg-desktop directory for all the files inside
   QDir dir(ui->label_module_selected->text()+"/xdg-desktop");
   QFileInfoList fileList = dir.entryInfoList(QStringList("*.desktop"));
-  for(int i=0; i<fileList.length(); i++){
-      ui->listDesktopEntries->addItem(fileList[i].fileName()); //show icon here at a later date
+  for(int i=0; i<fileList.length(); i++){ 
+      QString icon = ui->label_module_selected->text()+"/resources/"+ModBuild::getDesktopEntryValue(fileList[i].absoluteFilePath(),"icon");
+      QListWidgetItem *item = new QListWidgetItem( QIcon(icon),fileList[i].fileName() );
+      ui->listDesktopEntries->addItem(item);
   }
   //Scan the xdg-menu directory for all the files inside
   dir.cd(ui->label_module_selected->text()+"/xdg-menu");
   fileList.clear();
   fileList = dir.entryInfoList(QStringList("*.desktop"));
   for(int i=0; i<fileList.length(); i++){
-      ui->listMenuEntries->addItem(fileList[i].fileName()); //show icon here at a later date
+      QString icon = ui->label_module_selected->text()+"/resources/"+ModBuild::getMenuEntryValue(fileList[i].absoluteFilePath(),"icon");
+      QListWidgetItem *item = new QListWidgetItem( QIcon(icon),fileList[i].fileName() );
+      ui->listMenuEntries->addItem(item);
   }
 }
 
@@ -994,10 +998,16 @@
 
 void MainWindow::refreshCurrentLinks(){
   //Read external-links file
-
+  QString filePath = ui->label_module_selected->text() + "/external-links";
+  QStringList bins = ModBuild::getExternalLinksValues(filePath,"Target");
+  QStringList types = ModBuild::getExternalLinksValues(filePath,"Action");
   //display info in GUI
   ui->listCurrentLinks->clear();
   //Make sure each line is displayed in the format [(bin) : (types)]
+  for(int i=0; i<bins.length(); i++){
+    QString entry = bins[i] + "  :  " + types[i];
+    ui->listCurrentLinks->addItem(entry);
+  }
 
 }
 
@@ -1084,4 +1094,5 @@
 void MainWindow::on_listLinkBins_currentIndexChanged(int index){
   if(index == 0){ ui->lineLinkBin->setVisible(TRUE); }
   else{ ui->lineLinkBin->setVisible(FALSE); }
-}
\ No newline at end of file
+}
+

Modified: pcbsd-projects/EasyPBI/mainwindow.ui
===================================================================
--- pcbsd-projects/EasyPBI/mainwindow.ui	2012-03-16 10:19:00 UTC (rev 15829)
+++ pcbsd-projects/EasyPBI/mainwindow.ui	2012-03-16 13:57:21 UTC (rev 15830)
@@ -1103,7 +1103,7 @@
               <item row="0" column="1">
                <widget class="QLabel" name="label_25">
                 <property name="text">
-                 <string>Link Type</string>
+                 <string>Action</string>
                 </property>
                 <property name="alignment">
                  <set>Qt::AlignCenter</set>

Modified: pcbsd-projects/EasyPBI/modBuild.cpp
===================================================================
--- pcbsd-projects/EasyPBI/modBuild.cpp	2012-03-16 10:19:00 UTC (rev 15829)
+++ pcbsd-projects/EasyPBI/modBuild.cpp	2012-03-16 13:57:21 UTC (rev 15830)
@@ -550,13 +550,13 @@
 
   //Return the values saved in the menu structure
   if(value.toLower()=="name"){
-    return menuStruct[0];
+    return desktopStruct[0];
   }else if(value.toLower()=="genericname"){
-    return menuStruct[1];
+    return desktopStruct[1];
   }else if(value.toLower()=="exec"){
-    return menuStruct[2];
+    return desktopStruct[2];
   }else if(value.toLower()=="icon"){
-    return menuStruct[3];
+    return desktopStruct[3];
   }else{
     qDebug() << "Error: Invalid desktop entry variable";
     return "";



More information about the Commits mailing list