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

svn at pcbsd.org svn at pcbsd.org
Sun Nov 7 13:20:37 PST 2010


Author: kris
Date: 2010-11-07 13:20:37 -0800 (Sun, 07 Nov 2010)
New Revision: 8000

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

Updated pc-softwaremanager, cleanup how it loads Proxy / Mirror information,
also cleanup config tool, added placehold for future way to register new
PBI repos



Modified: pcbsd/current/src-qt4/pc-softwaremanager/pc-softwaremanager.pro
===================================================================
--- pcbsd/current/src-qt4/pc-softwaremanager/pc-softwaremanager.pro	2010-11-07 20:55:49 UTC (rev 7999)
+++ pcbsd/current/src-qt4/pc-softwaremanager/pc-softwaremanager.pro	2010-11-07 21:20:37 UTC (rev 8000)
@@ -3,6 +3,8 @@
 
 CONFIG	+= qt warn_on release
 
+LIBS	+= -L/usr/local/lib -lpcbsd
+
 HEADERS	+= softmanager-main.h softconfigwidget.h
 
 SOURCES	+= main.cpp softmanager-main.cpp softmanager-webview.cpp \

Modified: pcbsd/current/src-qt4/pc-softwaremanager/softconfigwidget.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-softwaremanager/softconfigwidget.cpp	2010-11-07 20:55:49 UTC (rev 7999)
+++ pcbsd/current/src-qt4/pc-softwaremanager/softconfigwidget.cpp	2010-11-07 21:20:37 UTC (rev 8000)
@@ -20,22 +20,12 @@
 #include "softmanager-main.h"
 #include "ui_softconfigwidget.h"
 
-
-
-
 void softwareConfigWidget::programInit()
 {
   // Our buttons / slots
   connect( pushSave, SIGNAL( clicked() ), this, SLOT( slotSaveClicked() ) );
   connect( pushCancel, SIGNAL( clicked() ), this, SLOT( slotCancelClicked() ) );
-  connect( pushRefreshList, SIGNAL( clicked() ), this, SLOT( slotUpdateMirrorList() ) );
-  connect( checkProxy, SIGNAL( clicked() ), this, SLOT( slotProxyChecked() ) );
-  connect( checkProxyUser, SIGNAL( clicked() ), this, SLOT( slotProxyUserChecked() ) );
 
-  // Connect the mirror radio buttons, so we can enable / disable objects based on status
-  connect( radioSelectMirror, SIGNAL( clicked() ), this, SLOT( slotCheckMirrorRadio() ) );
-  connect( radioCustomMirror, SIGNAL( clicked() ), this, SLOT( slotCheckMirrorRadio() ) );
-
   // Load up the settings
   loadSettings();
 }
@@ -47,15 +37,6 @@
 
 bool softwareConfigWidget::sanityCheckSettings()
 {
-  if (radioCustomMirror->isChecked() ) {
-    if( lineCustomMirror->text().indexOf("http://") != 0 && lineCustomMirror->text().indexOf("ftp://") != 0 )
-    {
-      tabConfigWidget->setCurrentIndex(0);
-      QMessageBox::critical( 0, tr("Config Error"), tr("Error: Your custom mirror needs to begin with ftp:// or http://"), QMessageBox::Ok );
-      return false; 
-    }
-  }
-
   return true;
 }
 
@@ -73,138 +54,13 @@
 {
   // Save the user preferences for the System Updater
   QSettings settings("PCBSD");
-  QString curMirror;
 
-  if (radioCustomMirror->isChecked() ) {
-     settings.setValue("/PC-BSD/SoftwareManager/mirrorType", CUSTOMMIRROR);
-     curMirror = lineCustomMirror->text();
-  }
-
   qlonglong frequency = spinBoxUpdateFrequency->value() * 1000 * 60 * 60;
   settings.setValue("/PC-BSD/SystemUpdater/checkUpdateFrequency", frequency);
 
   // Save if we are auto-updating software
   settings.setValue("/PC-BSD/SoftwareManager/autoUpdateSoftware", checkAutoUpdateSoftware->isChecked());
 
-  // Save if we are set to automatically download / install updates as system shutdown
-  settings.setValue("/PC-BSD/SoftwareManager/autoDownloadUpdates", checkAutoDownloadSysUpdates->isChecked());
-
-  // Check if we have a mirror selected and save it
-  if ( radioSelectMirror->isChecked() )
-  {
-     settings.setValue("/PC-BSD/SoftwareManager/mirrorType", SELECTMIRROR);
-
-     int i = 0;
-     while ( !mirrorNames[i].isEmpty() )
-     {
-       if ( comboMirrorList->currentText() == mirrorNames[i])
-         curMirror = mirrorURLs[i];
-       i++;
-     }
-  }
-
-  QStringList pbiConf;
-
-  // Read PBI_ETCCONF into memory
-  bool wroteMirror = false, wroteProxy = false, wroteProxyPort = false, savedLine = false;
-  bool wroteProxyUser = false, wroteProxyPass = false, wroteProxyType = false;
-  QFile confFile(PBI_ETCCONF);
-  if ( confFile.open( QIODevice::ReadOnly ) ) {
-        QTextStream stream( &confFile );
-        QString line;
-        while ( !stream.atEnd() ) {
-	    savedLine = false;
-            line = stream.readLine();
-
-	    // Check Mirror Tag
-	    if ( line.indexOf("PBI_MIRROR: ") == 0 ) {
-	      pbiConf << "PBI_MIRROR: " + curMirror;
-	      wroteMirror = true;
-	      savedLine = true;
-	    }
-
-	    if ( line.indexOf("PBI_PROXYURL: ") == 0 ) {
-	      if ( checkProxy->isChecked() ) {
-	        pbiConf << "PBI_PROXYURL: " + lineProxyAddress->text();
-	        wroteProxy = true;
-              }
-	      savedLine = true;
-	    }
-	    if ( line.indexOf("PBI_PROXYTYPE: ") == 0 ) {
-	      if ( checkProxy->isChecked() ) {
-	        if ( radioHTTPProxy->isChecked()) 
-	          pbiConf << "PBI_PROXYTYPE: HTTP";
-		else
-	          pbiConf << "PBI_PROXYTYPE: SOCKS5";
-	        wroteProxyType = true;
-              }
-	      savedLine = true;
-	    }
-	    if ( line.indexOf("PBI_PROXYUSER: ") == 0 ) {
-	      if ( checkProxy->isChecked() && checkProxyUser->isChecked() ) {
-	          pbiConf << "PBI_PROXYUSER: " + lineProxyUser->text();
-	        wroteProxyType = true;
-              }
-	      savedLine = true;
-	    }
-	    if ( line.indexOf("PBI_PROXYPASS: ") == 0 ) {
-	      if ( checkProxy->isChecked() && checkProxyUser->isChecked() ) {
-	          pbiConf << "PBI_PROXYPASS: " + lineProxyPass->text();
-	        wroteProxyType = true;
-              }
-	      savedLine = true;
-	    }
-	    if ( line.indexOf("PBI_PROXYPORT: ") == 0 ) {
-	      if ( checkProxy->isChecked() ) {
-	        pbiConf << "PBI_PROXYPORT: " + QString::number(spinProxyPort->value());
-	        wroteProxyPort = true;
-              }
-	      savedLine = true;
-	    }
-
-
-	    if (!savedLine )
-	      pbiConf << line;
-	   
-        }
-	if ( !wroteMirror)
-  	  pbiConf << "PBI_MIRROR: " + curMirror;
-	if ( !wroteProxy && checkProxy->isChecked())
-  	  pbiConf << "PBI_PROXYURL: " + lineProxyAddress->text();
-	if ( !wroteProxyPort && checkProxy->isChecked())
-	  pbiConf << "PBI_PROXYPORT: " + QString::number(spinProxyPort->value());
-	if ( !wroteProxyUser && checkProxy->isChecked() && checkProxyUser->isChecked())
-  	  pbiConf << "PBI_PROXYUSER: " + lineProxyUser->text();
-	if ( !wroteProxyPass && checkProxy->isChecked() && checkProxyUser->isChecked())
-  	  pbiConf << "PBI_PROXYPASS: " + lineProxyPass->text();
-	if ( !wroteProxyType && checkProxy->isChecked() ) {
-	  if ( radioHTTPProxy->isChecked()) 
-	     pbiConf << "PBI_PROXYTYPE: HTTP";
-	  else
-	     pbiConf << "PBI_PROXYTYPE: SOCKS5";
-        }
-   confFile.close();
-  }
-
-  if ( confFile.open( QIODevice::WriteOnly ) ) {
-        QTextStream stream( &confFile );
-	for (int i = 0; i < pbiConf.count(); ++i)
-		stream << pbiConf.at(i) << "\n";
-  }
-
-  // Save the update frequency
-  // Write our Mirrors array
-  settings.beginWriteArray("/PC-BSD/SoftwareManager/mirrorList");
-  int i = 0;
-  while ( !mirrorNames[i].isEmpty() )
-  {
-     settings.setArrayIndex(i);
-     settings.setValue("MirrorName", mirrorNames[i]);
-     settings.setValue("MirrorURL", mirrorURLs[i].simplified());
-     i++;
-  }
-  settings.endArray();
-
 }
 
 
@@ -221,197 +77,6 @@
 
   // Load our settings for auto-updating sys and PBI
   checkAutoUpdateSoftware->setChecked(settings.value("/PC-BSD/SoftwareManager/autoUpdateSoftware", false).toBool());
-  checkAutoDownloadSysUpdates->setChecked(settings.value("/PC-BSD/SoftwareManager/autoDownloadUpdates", false).toBool());
-  
-  // Get the currently selected mirror
-  //currentMirror = settings.value("/PC-BSD/SoftwareManager/currentMirror", "").toString();
 
-  // Load from PBI_ETCCONF the default mirror
-  QFile confFile(PBI_ETCCONF);
-  if ( confFile.open( QIODevice::ReadOnly ) ) {
-        QTextStream stream( &confFile );
-        stream.setCodec("UTF-8");
-        QString line;
-        while ( !stream.atEnd() ) {
-            line = stream.readLine();
-	    if ( line.indexOf("PBI_MIRROR: ") == 0 ) {
-		currentMirror = line.replace("PBI_MIRROR: ", "");
-	    }
-
-	    if ( line.indexOf("PBI_PROXYURL: ") == 0 ) {
-		lineProxyAddress->setText(line.replace("PBI_PROXYURL: ", ""));
-		checkProxy->setChecked(true);
-	    }
-
-	    if ( line.indexOf("PBI_PROXYUSER: ") == 0 ) {
-		lineProxyUser->setText(line.replace("PBI_PROXYUSER: ", ""));
-		checkProxyUser->setChecked(true);
-	    }
-
-	    if ( line.indexOf("PBI_PROXYPASS: ") == 0 )
-		lineProxyPass->setText(line.replace("PBI_PROXYPASS: ", ""));
-
-	    if ( line.indexOf("PBI_PROXYTYPE: ") == 0 ) {
-		tmp = line.replace("PBI_PROXYTYPE: ", "");
-		if ( tmp == "SOCKS5" )
-		  radioSOCKSProxy->setChecked(true);
-		else
-		  radioHTTPProxy->setChecked(true);
-            }
-
-	    if ( line.indexOf("PBI_PROXYPORT: ") == 0 ) {
-		bool ok;
-		int pPort = line.replace("PBI_PROXYPORT: ", "").toInt(&ok);
-		if (ok)
-	          spinProxyPort->setValue(pPort);
-	    }
-        }
-   confFile.close();
-  }
-
-  // Load our array of mirrors
-  comboMirrorList->clear();
-  bool foundMirror = false;
-  bool usingMirrorList = false;
-  QString MirrorName, MirrorURL;
-  int size = settings.beginReadArray("/PC-BSD/SoftwareManager/mirrorList");
-  for (int i = 0; i < size; ++i) {
-     foundMirror = true;
-     settings.setArrayIndex(i);
-     MirrorName = settings.value("MirrorName").toString();
-     MirrorURL = settings.value("MirrorURL").toString();
-     comboMirrorList->addItem( MirrorName );
-     mirrorNames[i] = MirrorName;
-     mirrorURLs[i] = MirrorURL;
-     if ( currentMirror == MirrorURL ) {
-       comboMirrorList->setCurrentIndex(i);
-       radioSelectMirror->setChecked(true);
-       usingMirrorList = true;
-     }
-     
-  }
-
-  settings.endArray();  
-   
-  // Check the status of the mirror radio buttons
-  slotCheckMirrorRadio();
-
-  // If our mirror list is empty, start a refresh of it now
-  if ( !foundMirror)
-    slotUpdateMirrorList();
-
-  // Check if we found a mirror in the PC-BSD list, otherwise default to custom mirror
-  if (!usingMirrorList) {
-      radioCustomMirror->setChecked(true);
-      lineCustomMirror->setText(currentMirror);
-  }
-
-  // Enable / disable proxy settings
-  slotProxyChecked();
 }
 
-void softwareConfigWidget::slotUpdateMirrorList() {
-  // Fetch from here http://updates.pcbsd.org/mirror-list.php
-  QString URL, LFILE;
-  URL= "http://updates.pcbsd.org/mirror-list.php";
-  LFILE = "/tmp/.smmirrorlist";
-
-  mirrorJob = new QNetworkAccessManager(this);
-     
-  QNetworkRequest netRequest;
-  netRequest.setUrl(QUrl(URL));
-  mirrorReply = mirrorJob->get(netRequest);
-    
-  connect(mirrorJob, SIGNAL(finished(QNetworkReply *)), this, SLOT(slotRefreshMirrorDone() ) );
-  connect(mirrorReply, SIGNAL(readyRead()), this, SLOT(slotGetMirrorData() ) );
-}
-
-void softwareConfigWidget::slotGetMirrorData() {
-	while (mirrorReply->canReadLine() )
-		mirrorJobBuf << mirrorReply->readLine().simplified();
-}
-
-void softwareConfigWidget::slotRefreshMirrorDone() {
-   QString MirrorName, MirrorURL, tmp;
-
-
-   if (mirrorReply->error() != QNetworkReply::NoError)
-   {
-      QMessageBox::critical( 0, tr("Refresh Mirrors"), tr("Error fetching mirror list! Check your internet connection, or try again later."), QMessageBox::Ok );
-	return;
-   } 
-
-   // Clear the combo box
-   comboMirrorList->clear();
-   int i = 0;
-
-   QString line;
-   for ( int z = 0; z < mirrorJobBuf.size(); z++ ) {
-     line = mirrorJobBuf.at(z);
-
-     tmp = line;
-     tmp.truncate(line.indexOf("=") -1 );
-     MirrorName = tmp;
-     MirrorURL = line.remove(0, line.indexOf("=") + 1); 
-     mirrorNames[i] = MirrorName;
-     mirrorURLs[i] = MirrorURL.simplified(); 
-     comboMirrorList->addItem( MirrorName );
-
-     if ( currentMirror == MirrorURL )
-        comboMirrorList->setCurrentIndex(i);
-
-     i++; 
-   }
-
-   // Close our the array
-   mirrorNames[i] = "";
-   mirrorURLs[i] = "";
-
-   QSettings settings("PCBSD");
-   settings.beginWriteArray("/PC-BSD/SoftwareManager/mirrorList");
-   i = 0;
-   while ( !mirrorNames[i].isEmpty() )
-   {
-      settings.setArrayIndex(i);
-      settings.setValue("MirrorName", mirrorNames[i]);
-      settings.setValue("MirrorURL", mirrorURLs[i].simplified());
-      i++;
-   }
-
-   settings.endArray();  
-}
-
-void softwareConfigWidget::slotCheckMirrorRadio() {
-
-    if( radioSelectMirror->isChecked() )
-    {
-      comboMirrorList->setEnabled(true);
-      pushRefreshList->setEnabled(true);
-      lineCustomMirror->setEnabled(false);
-    }
-    if( radioCustomMirror->isChecked() )
-    {
-      comboMirrorList->setEnabled(false);
-      pushRefreshList->setEnabled(false);
-      lineCustomMirror->setEnabled(true);
-    }
-}
-
-void softwareConfigWidget::slotProxyChecked() {
-  if ( checkProxy->isChecked() )
-    groupProxySettings->setEnabled(true);
-  else
-    groupProxySettings->setEnabled(false);
-
-  slotProxyUserChecked();
-}
-
-void softwareConfigWidget::slotProxyUserChecked() {
-  if ( checkProxyUser->isChecked() ) {
-    lineProxyUser->setEnabled(true);
-    lineProxyPass->setEnabled(true);
-  } else {
-    lineProxyUser->setEnabled(false);
-    lineProxyPass->setEnabled(false);
-  }
-}

Modified: pcbsd/current/src-qt4/pc-softwaremanager/softconfigwidget.h
===================================================================
--- pcbsd/current/src-qt4/pc-softwaremanager/softconfigwidget.h	2010-11-07 20:55:49 UTC (rev 7999)
+++ pcbsd/current/src-qt4/pc-softwaremanager/softconfigwidget.h	2010-11-07 21:20:37 UTC (rev 8000)
@@ -8,8 +8,6 @@
 #include "ui_softconfigwidget.h"
 #include "../config.h"
 
-const QString PBI_ETCCONF( PREFIX + "/etc/pbi.conf" );
-
 class softwareConfigWidget : public QDialog, private Ui::softwareConfigWidget
 {
 	Q_OBJECT
@@ -30,25 +28,10 @@
         void slotSaveClicked();
         bool sanityCheckSettings();
         void slotCancelClicked();
-        void slotUpdateMirrorList();
-        void slotRefreshMirrorDone();
-        void slotCheckMirrorRadio();
-	void slotGetMirrorData();
-	void slotProxyChecked();
-	void slotProxyUserChecked();
 private:
         void saveSettings();
         void loadSettings();
 
-	QStringList mirrorJobBuf;
-
-        QString currentMirror;
-        QString mirrorNames[500];
-        QString mirrorURLs[500];
-
-        QNetworkAccessManager *mirrorJob;
-        QNetworkReply *mirrorReply;
-
 signals:
         void saved();
 } ;

Modified: pcbsd/current/src-qt4/pc-softwaremanager/softconfigwidget.ui
===================================================================
--- pcbsd/current/src-qt4/pc-softwaremanager/softconfigwidget.ui	2010-11-07 20:55:49 UTC (rev 7999)
+++ pcbsd/current/src-qt4/pc-softwaremanager/softconfigwidget.ui	2010-11-07 21:20:37 UTC (rev 8000)
@@ -23,98 +23,17 @@
      <property name="currentIndex">
       <number>0</number>
      </property>
-     <widget class="QWidget" name="tabMirror">
+     <widget class="QWidget" name="tabRepos">
       <attribute name="title">
-       <string>Mirrors</string>
+       <string>Repos</string>
       </attribute>
       <layout class="QGridLayout" name="gridLayout_3">
        <item row="0" column="0">
         <widget class="QGroupBox" name="groupBox">
          <property name="title">
-          <string>Mirror Configuration</string>
+          <string>Repository Manager</string>
          </property>
-         <layout class="QGridLayout" name="gridLayout_4">
-          <item row="0" column="0">
-           <widget class="QRadioButton" name="radioSelectMirror">
-            <property name="text">
-             <string>Select Mirror from list</string>
-            </property>
-           </widget>
-          </item>
-          <item row="1" column="0">
-           <layout class="QHBoxLayout" name="horizontalLayout_3">
-            <item>
-             <spacer name="horizontalSpacer_2">
-              <property name="orientation">
-               <enum>Qt::Horizontal</enum>
-              </property>
-              <property name="sizeType">
-               <enum>QSizePolicy::Fixed</enum>
-              </property>
-              <property name="sizeHint" stdset="0">
-               <size>
-                <width>20</width>
-                <height>20</height>
-               </size>
-              </property>
-             </spacer>
-            </item>
-            <item>
-             <widget class="QComboBox" name="comboMirrorList"/>
-            </item>
-            <item>
-             <widget class="QPushButton" name="pushRefreshList">
-              <property name="sizePolicy">
-               <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-                <horstretch>0</horstretch>
-                <verstretch>0</verstretch>
-               </sizepolicy>
-              </property>
-              <property name="toolTip">
-               <string>Refresh Mirror Listing</string>
-              </property>
-              <property name="text">
-               <string/>
-              </property>
-              <property name="icon">
-               <iconset resource="SoftwareManager.qrc">
-                <normaloff>:/view-refresh.png</normaloff>:/view-refresh.png</iconset>
-              </property>
-             </widget>
-            </item>
-           </layout>
-          </item>
-          <item row="2" column="0">
-           <widget class="QRadioButton" name="radioCustomMirror">
-            <property name="text">
-             <string>Specify a custom Mirror</string>
-            </property>
-           </widget>
-          </item>
-          <item row="3" column="0">
-           <layout class="QHBoxLayout" name="horizontalLayout_4">
-            <item>
-             <spacer name="horizontalSpacer_3">
-              <property name="orientation">
-               <enum>Qt::Horizontal</enum>
-              </property>
-              <property name="sizeType">
-               <enum>QSizePolicy::Fixed</enum>
-              </property>
-              <property name="sizeHint" stdset="0">
-               <size>
-                <width>20</width>
-                <height>20</height>
-               </size>
-              </property>
-             </spacer>
-            </item>
-            <item>
-             <widget class="QLineEdit" name="lineCustomMirror"/>
-            </item>
-           </layout>
-          </item>
-         </layout>
+         <layout class="QGridLayout" name="gridLayout_4"/>
         </widget>
        </item>
        <item row="1" column="0">
@@ -148,16 +67,6 @@
         </widget>
        </item>
        <item row="1" column="0">
-        <widget class="QCheckBox" name="checkAutoDownloadSysUpdates">
-         <property name="toolTip">
-          <string>This will download updates in the background, and install them at shutdown.</string>
-         </property>
-         <property name="text">
-          <string>Automatically install system updates</string>
-         </property>
-        </widget>
-       </item>
-       <item row="2" column="0">
         <spacer name="verticalSpacer_2">
          <property name="orientation">
           <enum>Qt::Vertical</enum>
@@ -178,152 +87,6 @@
       </attribute>
       <layout class="QGridLayout" name="gridLayout_8">
        <item row="0" column="0">
-        <widget class="QCheckBox" name="checkProxy">
-         <property name="text">
-          <string>Use Proxy Server</string>
-         </property>
-        </widget>
-       </item>
-       <item row="1" column="0">
-        <widget class="QGroupBox" name="groupProxySettings">
-         <property name="title">
-          <string>Proxy Configuration</string>
-         </property>
-         <layout class="QGridLayout" name="gridLayout_7">
-          <item row="0" column="0">
-           <widget class="QLabel" name="label">
-            <property name="text">
-             <string>Server Address</string>
-            </property>
-           </widget>
-          </item>
-          <item row="1" column="0">
-           <widget class="QLineEdit" name="lineProxyAddress"/>
-          </item>
-          <item row="2" column="0">
-           <widget class="QLabel" name="label_4">
-            <property name="text">
-             <string>Port Number</string>
-            </property>
-           </widget>
-          </item>
-          <item row="3" column="0">
-           <layout class="QHBoxLayout" name="horizontalLayout_2">
-            <item>
-             <widget class="QSpinBox" name="spinProxyPort">
-              <property name="maximum">
-               <number>99999</number>
-              </property>
-             </widget>
-            </item>
-            <item>
-             <spacer name="horizontalSpacer_5">
-              <property name="orientation">
-               <enum>Qt::Horizontal</enum>
-              </property>
-              <property name="sizeHint" stdset="0">
-               <size>
-                <width>40</width>
-                <height>20</height>
-               </size>
-              </property>
-             </spacer>
-            </item>
-           </layout>
-          </item>
-          <item row="4" column="0">
-           <widget class="QLabel" name="label_5">
-            <property name="text">
-             <string>Proxy Type</string>
-            </property>
-           </widget>
-          </item>
-          <item row="5" column="0">
-           <layout class="QHBoxLayout" name="horizontalLayout_6">
-            <item>
-             <widget class="QRadioButton" name="radioHTTPProxy">
-              <property name="text">
-               <string>HTTP</string>
-              </property>
-              <property name="checked">
-               <bool>true</bool>
-              </property>
-             </widget>
-            </item>
-            <item>
-             <widget class="QRadioButton" name="radioSOCKSProxy">
-              <property name="text">
-               <string>SOCKS5</string>
-              </property>
-             </widget>
-            </item>
-            <item>
-             <spacer name="horizontalSpacer_6">
-              <property name="orientation">
-               <enum>Qt::Horizontal</enum>
-              </property>
-              <property name="sizeHint" stdset="0">
-               <size>
-                <width>40</width>
-                <height>20</height>
-               </size>
-              </property>
-             </spacer>
-            </item>
-           </layout>
-          </item>
-          <item row="6" column="0">
-           <widget class="QCheckBox" name="checkProxyUser">
-            <property name="text">
-             <string>Specify a Username / Password</string>
-            </property>
-           </widget>
-          </item>
-          <item row="7" column="0">
-           <layout class="QGridLayout" name="gridLayout_6">
-            <item row="0" column="0">
-             <widget class="QLabel" name="label_6">
-              <property name="text">
-               <string>Username</string>
-              </property>
-             </widget>
-            </item>
-            <item row="0" column="1" rowspan="2">
-             <spacer name="horizontalSpacer_7">
-              <property name="orientation">
-               <enum>Qt::Horizontal</enum>
-              </property>
-              <property name="sizeHint" stdset="0">
-               <size>
-                <width>13</width>
-                <height>38</height>
-               </size>
-              </property>
-             </spacer>
-            </item>
-            <item row="0" column="2">
-             <widget class="QLabel" name="label_7">
-              <property name="text">
-               <string>Password</string>
-              </property>
-             </widget>
-            </item>
-            <item row="1" column="0">
-             <widget class="QLineEdit" name="lineProxyUser"/>
-            </item>
-            <item row="1" column="2">
-             <widget class="QLineEdit" name="lineProxyPass">
-              <property name="echoMode">
-               <enum>QLineEdit::Password</enum>
-              </property>
-             </widget>
-            </item>
-           </layout>
-          </item>
-         </layout>
-        </widget>
-       </item>
-       <item row="2" column="0">
         <widget class="QGroupBox" name="groupBox_3">
          <property name="title">
           <string>Checker Frequency</string>
@@ -382,7 +145,7 @@
          </layout>
         </widget>
        </item>
-       <item row="3" column="0">
+       <item row="1" column="0">
         <spacer name="verticalSpacer">
          <property name="orientation">
           <enum>Qt::Vertical</enum>

Modified: pcbsd/current/src-qt4/pc-softwaremanager/softmanager-main.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-softwaremanager/softmanager-main.cpp	2010-11-07 20:55:49 UTC (rev 7999)
+++ pcbsd/current/src-qt4/pc-softwaremanager/softmanager-main.cpp	2010-11-07 21:20:37 UTC (rev 8000)
@@ -37,6 +37,7 @@
 /* Local includes */
 #include "ui_softmanager-main.h"
 #include "softmanager-main.h"
+#include <pcbsd-utils.h>
 #include "pbi.h"
 #include "../config.h"
 
@@ -515,42 +516,20 @@
   // Load a custom tmpdir
   customTmpDir= PATCHTMPDIR_DEFAULT;
 
-  QString ProxyUser, ProxyPass, ProxyType, ProxyAddress;
+  QString ProxyUser, ProxyPass, ProxyType, ProxyAddress, tmp;
+  bool ok;
   int ProxyPort = 0;
 
-  // Get the currently selected mirror
-  QFile confFile(PBI_ETCCONF);
-  if ( confFile.open( QIODevice::ReadOnly ) ) {
-        QTextStream stream( &confFile );
-        stream.setCodec("UTF-8");
-        QString line;
-        while ( !stream.atEnd() ) {
-            line = stream.readLine();
-	    if ( line.indexOf("PBI_MIRROR: ") == 0 )
-		mirrorURL = line.replace("PBI_MIRROR: ", "");
+  mirrorURL = Utils::getMasterMirror();
+  ProxyAddress = Utils::getProxyURL();
+  ProxyType = Utils::getProxyType();
+  ProxyUser = Utils::getProxyUser();
+  ProxyPass = Utils::getProxyPass();
+  tmp = Utils::getProxyPort();
+  tmp.toInt(&ok);
+  if ( ok ) 
+     ProxyPort = tmp.toInt(&ok);
 
-	    if ( line.indexOf("PBI_PROXYURL: ") == 0 )
-		ProxyAddress = line.replace("PBI_PROXYURL: ", "");
-
-	    if ( line.indexOf("PBI_PROXYTYPE: ") == 0 )
-		ProxyType = line.replace("PBI_PROXYTYPE: ", "");
-
-	    if ( line.indexOf("PBI_PROXYUSER: ") == 0 )
-		ProxyUser = line.replace("PBI_PROXYUSER: ", "");
-
-	    if ( line.indexOf("PBI_PROXYPASS: ") == 0 )
-		ProxyPass = line.replace("PBI_PROXYPASS: ", "");
-
-	    if ( line.indexOf("PBI_PROXYPORT: ") == 0 ) {
-		bool ok;
-		int pPort = line.replace("PBI_PROXYPORT: ", "").toInt(&ok);
-		if (ok)
-	          ProxyPort = pPort;
-	    }
-        }
-   confFile.close();
-  }
-
   // Enable / disable the proxy
   if (! ProxyAddress.isEmpty() ) 
   {



More information about the Commits mailing list