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

svn at pcbsd.org svn at pcbsd.org
Wed Mar 21 13:18:55 PDT 2012


Author: kenmoore
Date: 2012-03-21 20:18:55 +0000 (Wed, 21 Mar 2012)
New Revision: 15891

Modified:
   pcbsd/current/src-qt4/EasyPBI/defaulticon.png
   pcbsd/current/src-qt4/EasyPBI/mainwindow.cpp
   pcbsd/current/src-qt4/EasyPBI/mainwindow.h
   pcbsd/current/src-qt4/EasyPBI/mainwindow.ui
Log:
Change the EasyPBI default icon, and how it is utilized in the program. Also fix a few minor display issues



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

Modified: pcbsd/current/src-qt4/EasyPBI/mainwindow.cpp
===================================================================
--- pcbsd/current/src-qt4/EasyPBI/mainwindow.cpp	2012-03-21 20:12:09 UTC (rev 15890)
+++ pcbsd/current/src-qt4/EasyPBI/mainwindow.cpp	2012-03-21 20:18:55 UTC (rev 15891)
@@ -60,6 +60,7 @@
   PBIOUT_DIR= PROG_DIR + "/PBI";
   MODOUT_DIR= PROG_DIR + "/Modules";  
   PBISETTINGS_FILE= PROG_DIR + "/.savedPBISettings.conf";
+  DEFAULTICON_FILE= PROG_DIR + "/defaulticon.png";
   PORTS_DIR = "";
   PORT_SELECTED = "";
 
@@ -94,6 +95,14 @@
   }  
   //Check for the ports Directory and Set the internal variable 'PORTS_DIR'
   if(!Check_For_Ports(true)){ return; }
+
+  //Check for the defaulticons.png file
+  if( !QFile(DEFAULTICON_FILE).exists() ){
+    //file does not exist, copy the included resource to the file
+    qDebug() << "Copying the default icon to the EasyPBI directory";
+    QFile::copy(":/png/defaulticon.png",DEFAULTICON_FILE);
+  }
+
   //Load the defaults for the PBI build settings
   if( QFile(PBISETTINGS_FILE).exists() ){
     qDebug() << "PBI Settings file detected at:"<< PBISETTINGS_FILE;
@@ -181,7 +190,7 @@
     }
     // Detect port's name, icon, website, author, and category
     Get_Name(pbi_data);
-    Get_Icon(pbi_data);
+    //Get_Icon(pbi_data);
     Get_Category(pbi_data);
     Get_Website(pbi_data);
     Get_Author(pbi_data);
@@ -189,7 +198,7 @@
     ui->author->setText(pbi_data->author_name);
     ui->port_category->setText(pbi_data->category);
     ui->port_selected->setText(PORT_SELECTED);
-    if (pbi_data->icon_name){ui->icon_path->setText(pbi_data->icon_name);}
+    ui->icon_path->setText(DEFAULTICON_FILE);
 
     ui->port_name->setText(pbi_data->port_name);
     ui->website->setText(pbi_data->web_site);
@@ -208,7 +217,6 @@
 void MainWindow::on_create_button_clicked()
 {
     char *home_dir;
-    BIN_FILE *current_exe;
     char original_dir[PATH_MAX];
 
     if (! pbi_data)
@@ -866,7 +874,7 @@
   QDir dir(ui->label_module_selected->text()+"/xdg-desktop");
   QFileInfoList fileList = dir.entryInfoList(QStringList("*.desktop"));
   for(int i=0; i<fileList.length(); i++){ 
-      QString icon = ui->label_module_selected->text()+"/resources/"+ModBuild::getDesktopEntryValue(fileList[i].absoluteFilePath(),"icon");
+      QString icon = ui->label_module_selected->text()+"/resources/"+ModBuild::getDesktopEntryValue(fileList[i].absoluteFilePath(),"icon",TRUE);
       QListWidgetItem *item = new QListWidgetItem( QIcon(icon),fileList[i].fileName() );
       ui->listDesktopEntries->addItem(item);
   }
@@ -875,7 +883,7 @@
   fileList.clear();
   fileList = dir.entryInfoList(QStringList("*.desktop"));
   for(int i=0; i<fileList.length(); i++){
-      QString icon = ui->label_module_selected->text()+"/resources/"+ModBuild::getMenuEntryValue(fileList[i].absoluteFilePath(),"icon");
+      QString icon = ui->label_module_selected->text()+"/resources/"+ModBuild::getMenuEntryValue(fileList[i].absoluteFilePath(),"icon",TRUE);
       QListWidgetItem *item = new QListWidgetItem( QIcon(icon),fileList[i].fileName() );
       ui->listMenuEntries->addItem(item);
   }

Modified: pcbsd/current/src-qt4/EasyPBI/mainwindow.h
===================================================================
--- pcbsd/current/src-qt4/EasyPBI/mainwindow.h	2012-03-21 20:12:09 UTC (rev 15890)
+++ pcbsd/current/src-qt4/EasyPBI/mainwindow.h	2012-03-21 20:18:55 UTC (rev 15891)
@@ -96,7 +96,7 @@
     void SetupDefaults();
     void loadPBISettings();
     QStringList getPortBinaries(QString);
-    QString PROG_DIR, PORTS_DIR, PORT_SELECTED, PBIOUT_DIR, MODOUT_DIR, PROGVERSION, PBISETTINGS_FILE;
+    QString PROG_DIR, PORTS_DIR, PORT_SELECTED, PBIOUT_DIR, MODOUT_DIR, PROGVERSION, PBISETTINGS_FILE, DEFAULTICON_FILE;
     QProcess *p;
     PBI_Struct *pbi_data;
 };

Modified: pcbsd/current/src-qt4/EasyPBI/mainwindow.ui
===================================================================
--- pcbsd/current/src-qt4/EasyPBI/mainwindow.ui	2012-03-21 20:12:09 UTC (rev 15890)
+++ pcbsd/current/src-qt4/EasyPBI/mainwindow.ui	2012-03-21 20:18:55 UTC (rev 15891)
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>543</width>
-    <height>436</height>
+    <width>560</width>
+    <height>452</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -22,7 +22,7 @@
     <item>
      <widget class="QTabWidget" name="tabWidget">
       <property name="currentIndex">
-       <number>2</number>
+       <number>0</number>
       </property>
       <widget class="QWidget" name="tabModules">
        <attribute name="title">
@@ -30,7 +30,7 @@
        </attribute>
        <layout class="QVBoxLayout" name="verticalLayout_2">
         <item>
-         <layout class="QGridLayout" name="gridLayout" columnminimumwidth="0,0,0">
+         <layout class="QGridLayout" name="gridLayout" columnminimumwidth="0,0,0,0">
           <property name="rightMargin">
            <number>1</number>
           </property>
@@ -41,54 +41,34 @@
             </property>
            </widget>
           </item>
-          <item row="2" column="1">
+          <item row="2" column="2">
            <widget class="QLineEdit" name="port_name"/>
           </item>
-          <item row="3" column="0">
+          <item row="5" column="0">
            <widget class="QLabel" name="label_2">
             <property name="text">
              <string>Menu Category</string>
             </property>
            </widget>
           </item>
-          <item row="3" column="1">
+          <item row="5" column="2">
            <widget class="QLineEdit" name="port_category"/>
           </item>
-          <item row="4" column="0">
-           <widget class="QLabel" name="label_3">
-            <property name="text">
-             <string>Port author</string>
-            </property>
-           </widget>
-          </item>
-          <item row="4" column="1">
-           <widget class="QLineEdit" name="author"/>
-          </item>
-          <item row="5" column="0">
-           <widget class="QLabel" name="label_4">
-            <property name="text">
-             <string>Port's website</string>
-            </property>
-           </widget>
-          </item>
-          <item row="5" column="1">
-           <widget class="QLineEdit" name="website"/>
-          </item>
-          <item row="6" column="0">
+          <item row="8" column="0">
            <widget class="QLabel" name="label_5">
             <property name="text">
              <string>Icon</string>
             </property>
            </widget>
           </item>
-          <item row="6" column="1">
+          <item row="8" column="2">
            <widget class="QLineEdit" name="icon_path">
             <property name="readOnly">
              <bool>true</bool>
             </property>
            </widget>
           </item>
-          <item row="6" column="2">
+          <item row="8" column="3">
            <widget class="QPushButton" name="pushFindIcon">
             <property name="text">
              <string>Choose Icon</string>
@@ -107,7 +87,7 @@
             </property>
            </widget>
           </item>
-          <item row="0" column="2">
+          <item row="0" column="3">
            <widget class="QPushButton" name="pushResetModule">
             <property name="font">
              <font>
@@ -119,7 +99,7 @@
             </property>
            </widget>
           </item>
-          <item row="7" column="2">
+          <item row="9" column="3">
            <widget class="QCheckBox" name="gui_app">
             <property name="text">
              <string>GUI App</string>
@@ -136,20 +116,40 @@
             </property>
            </widget>
           </item>
-          <item row="1" column="1">
+          <item row="1" column="2">
            <widget class="QLineEdit" name="port_selected">
             <property name="readOnly">
              <bool>true</bool>
             </property>
            </widget>
           </item>
-          <item row="1" column="2">
+          <item row="1" column="3">
            <widget class="QPushButton" name="port_info_button">
             <property name="text">
              <string>Get Port Info</string>
             </property>
            </widget>
           </item>
+          <item row="3" column="0">
+           <widget class="QLabel" name="label_4">
+            <property name="text">
+             <string>Program Website</string>
+            </property>
+           </widget>
+          </item>
+          <item row="3" column="2">
+           <widget class="QLineEdit" name="website"/>
+          </item>
+          <item row="4" column="0">
+           <widget class="QLabel" name="label_3">
+            <property name="text">
+             <string>Port Author</string>
+            </property>
+           </widget>
+          </item>
+          <item row="4" column="2">
+           <widget class="QLineEdit" name="author"/>
+          </item>
          </layout>
         </item>
         <item>
@@ -410,6 +410,9 @@
          <layout class="QHBoxLayout" name="horizontalLayout">
           <item>
            <widget class="QTextEdit" name="buildOutputArea">
+            <property name="lineWrapMode">
+             <enum>QTextEdit::NoWrap</enum>
+            </property>
             <property name="readOnly">
              <bool>true</bool>
             </property>
@@ -1270,7 +1273,7 @@
     <rect>
      <x>0</x>
      <y>0</y>
-     <width>543</width>
+     <width>560</width>
      <height>20</height>
     </rect>
    </property>



More information about the Commits mailing list