[PC-BSD Commits] r16423 - pcbsd/current/src-qt4/pc-softwaremanager

svn at pcbsd.org svn at pcbsd.org
Sun Apr 15 15:34:12 PDT 2012


Author: kris
Date: 2012-04-15 22:34:12 +0000 (Sun, 15 Apr 2012)
New Revision: 16423

Added:
   pcbsd/current/src-qt4/pc-softwaremanager/dialogPreferences.cpp
   pcbsd/current/src-qt4/pc-softwaremanager/dialogPreferences.h
   pcbsd/current/src-qt4/pc-softwaremanager/dialogPreferences.ui
Modified:
   pcbsd/current/src-qt4/pc-softwaremanager/pc-softwaremanager.pro
   pcbsd/current/src-qt4/pc-softwaremanager/softmanager-main.cpp
   pcbsd/current/src-qt4/pc-softwaremanager/softmanager-main.h
   pcbsd/current/src-qt4/pc-softwaremanager/softmanager-main.ui
   pcbsd/current/src-qt4/pc-softwaremanager/softmanager-pbiupdate.cpp
Log:

Add new preferences panel, let user disable desktop / menus icon creation



Index: pcbsd/current/src-qt4/pc-softwaremanager/dialogPreferences.ui
===================================================================
--- pcbsd/current/src-qt4/pc-softwaremanager/dialogPreferences.ui	2012-04-15 20:26:54 UTC (rev 16422)
+++ pcbsd/current/src-qt4/pc-softwaremanager/dialogPreferences.ui	2012-04-15 22:34:12 UTC (rev 16423)

Property changes on: pcbsd/current/src-qt4/pc-softwaremanager/dialogPreferences.ui
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/xml
Modified: pcbsd/current/src-qt4/pc-softwaremanager/pc-softwaremanager.pro
===================================================================
--- pcbsd/current/src-qt4/pc-softwaremanager/pc-softwaremanager.pro	2012-04-15 20:26:54 UTC (rev 16422)
+++ pcbsd/current/src-qt4/pc-softwaremanager/pc-softwaremanager.pro	2012-04-15 22:34:12 UTC (rev 16423)
@@ -5,15 +5,16 @@
 
 LIBS	+= -L../libpcbsd -L/usr/local/lib -lpcbsd -lQtSolutions_SingleApplication-head
 
-HEADERS	+= softmanager-main.h softconfigwidget.h clickedWidget.h
+HEADERS	+= softmanager-main.h softconfigwidget.h clickedWidget.h dialogPreferences.h
 
 SOURCES	+= main.cpp classes.cpp clickedWidget.cpp softmanager-main.cpp \
-	softmanager-pbibrowser.cpp \
+	softmanager-pbibrowser.cpp dialogPreferences.cpp \
         softmanager-pbiupdate.cpp pbi.cpp softconfigwidget.cpp
 
 RESOURCES += SoftwareManager.qrc
 
 FORMS	= softmanager-main.ui \
+	dialogPreferences.ui \
 	softconfigwidget.ui
 
 TARGET  = pc-softwaremanager

Modified: pcbsd/current/src-qt4/pc-softwaremanager/softmanager-main.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-softwaremanager/softmanager-main.cpp	2012-04-15 20:26:54 UTC (rev 16422)
+++ pcbsd/current/src-qt4/pc-softwaremanager/softmanager-main.cpp	2012-04-15 22:34:12 UTC (rev 16423)
@@ -38,6 +38,7 @@
 #include <pcbsd-utils.h>
 #include "pbi.h"
 #include "clickedWidget.h"
+#include "dialogPreferences.h"
 #include "../config.h"
 
 
@@ -45,6 +46,9 @@
 { 
    qDebug("Application starting...");
 
+   // Load preferences
+   slotLoadPref();
+
    // Set our default status
    pbistatus = PBI_UPDATED;
    isWorkingOnPBI = false;
@@ -66,6 +70,7 @@
    connect(lineSearch, SIGNAL( returnPressed() ), this, SLOT(slotSearchClicked() ) );
    connect(lineSearch, SIGNAL( textChanged(const QString &) ), this, SLOT(slotSearchAsTyped() ) );
    connect(action_Quit, SIGNAL( triggered() ), this, SLOT(slotQuitButtonClicked()) );
+   connect(actionPreferences, SIGNAL( triggered() ), this, SLOT(slotPrefButtonClicked()) );
    connect(tabPBM, SIGNAL( currentChanged(int) ), this, SLOT(slotTabChanged(int)) );
 
    // Connect the SoftwareListBox with signals
@@ -151,6 +156,22 @@
    close();  
 }
 
+void PBM::slotPrefButtonClicked()
+{
+  dialogPref = new dialogPreferences();
+  dialogPref->programInit();
+  dialogPref->setModal(true);
+  connect( dialogPref, SIGNAL( saved() ), this, SLOT( slotLoadPref() ) );
+  dialogPref->show(); 
+}
+
+void PBM::slotLoadPref()
+{
+  QSettings settings("PCBSD", "AppCafe");
+  doMenuIcons = settings.value("menuIcons", true).toBool();
+  doDeskIcons = settings.value("deskIcons", true).toBool();
+}
+
 void PBM::slotQuitButtonClicked()
 {
   // Check if we are working right now

Modified: pcbsd/current/src-qt4/pc-softwaremanager/softmanager-main.h
===================================================================
--- pcbsd/current/src-qt4/pc-softwaremanager/softmanager-main.h	2012-04-15 20:26:54 UTC (rev 16422)
+++ pcbsd/current/src-qt4/pc-softwaremanager/softmanager-main.h	2012-04-15 22:34:12 UTC (rev 16423)
@@ -26,6 +26,7 @@
 /* Local Includes */
 #include "classes.h"
 #include "pbi.h"
+#include "dialogPreferences.h"
 #include "softconfigwidget.h"
 #include "ui_softmanager-main.h"
 #include "ui_softconfigwidget.h"
@@ -110,6 +111,8 @@
     void slotSearchForKeyword(bool);
     void slotSearchAsTyped();
     void slotSearchClicked();
+    void slotPrefButtonClicked();
+    void slotLoadPref();
 
 private:
     void checkGroupOperator();
@@ -208,6 +211,10 @@
     bool autoUpdateSoftware;
     QList<QStringList> transCats;
     QList<QStringList> transApps;
+
+    dialogPreferences *dialogPref;
+    bool doMenuIcons;
+    bool doDeskIcons;
     
 signals:
     

Modified: pcbsd/current/src-qt4/pc-softwaremanager/softmanager-main.ui
===================================================================
--- pcbsd/current/src-qt4/pc-softwaremanager/softmanager-main.ui	2012-04-15 20:26:54 UTC (rev 16422)
+++ pcbsd/current/src-qt4/pc-softwaremanager/softmanager-main.ui	2012-04-15 22:34:12 UTC (rev 16423)
@@ -304,13 +304,15 @@
      <x>0</x>
      <y>0</y>
      <width>675</width>
-     <height>19</height>
+     <height>23</height>
     </rect>
    </property>
    <widget class="QMenu" name="menu_File">
     <property name="title">
      <string>&File</string>
     </property>
+    <addaction name="actionPreferences"/>
+    <addaction name="separator"/>
     <addaction name="action_Quit"/>
    </widget>
    <addaction name="menu_File"/>
@@ -320,6 +322,11 @@
     <string>&Quit</string>
    </property>
   </action>
+  <action name="actionPreferences">
+   <property name="text">
+    <string>Preferences</string>
+   </property>
+  </action>
  </widget>
  <resources>
   <include location="SoftwareManager.qrc"/>

Modified: pcbsd/current/src-qt4/pc-softwaremanager/softmanager-pbiupdate.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-softwaremanager/softmanager-pbiupdate.cpp	2012-04-15 20:26:54 UTC (rev 16422)
+++ pcbsd/current/src-qt4/pc-softwaremanager/softmanager-pbiupdate.cpp	2012-04-15 22:34:12 UTC (rev 16423)
@@ -349,7 +349,7 @@
   } else {
 
      // If this is a new install, also add the desktop icon
-     if ( item->getWorkingStatus() == PBINEWDOWNLOAD && ! item->doDelete())
+     if ( item->getWorkingStatus() == PBINEWDOWNLOAD && ! item->doDelete() && doDeskIcons)
 	installDesktopIcon(item);
 
      // Update the status on the previous download to finished



More information about the Commits mailing list