Changeset 2940

Show
Ignore:
Timestamp:
10/28/08 08:25:53 (17 months ago)
Author:
kris
Message:

Commited large update to the Online System Updater tool. Adds 2 new features:

  • Support for proxy servers, which is passed on to rsync / wget and used by KIO to download
  • Support for specifying custom TMPDIR, in case user needs to use larger partition to download updates

Also fixed a bug in which a PBI upgrade could silently fail, and the user be left wondering where software
had gone to. Now if anything does go wrong, the updater will notify the user properly.

Location:
pcbsd
Files:
2 added
12 modified

Legend:

Unmodified
Added
Removed
  • pcbsd/branches/7.0/SystemUpdater/SystemUpdater.cpp

    r2780 r2940  
    2424    listViewSysUpdates->hideColumn( 1 ); 
    2525 
     26    disableConfUpdates = false; 
     27 
    2628    
    2729    
     
    3638    connect( listViewSysUpdates, SIGNAL(doubleClicked ( Q3ListViewItem *, const QPoint &, int ) ), this, SLOT(slotSysDoubleClicked( Q3ListViewItem *, const QPoint &, int) ) ); 
    3739    // Connect to a right-clicked slot as well 
    38         connect( listViewSysUpdates, SIGNAL(rightButtonClicked ( Q3ListViewItem *, const QPoint &, int ) ), this, SLOT(slotSysRightClicked( Q3ListViewItem *, const QPoint &, int) ) ); 
    39      
     40    connect( listViewSysUpdates, SIGNAL(rightButtonClicked ( Q3ListViewItem *, const QPoint &, int ) ), this, SLOT(slotSysRightClicked( Q3ListViewItem *, const QPoint &, int) ) ); 
     41     
     42    // Connect the pushViewDetails button 
     43    connect( pushDetails, SIGNAL( clicked() ), this, SLOT( slotViewDetailsClicked() ) ); 
     44     
     45    // Connect the Custom Tmpdir Checkbox 
     46    connect( checkTMPDIR, SIGNAL( clicked() ), this, SLOT( slotCustomTmpClicked() ) ); 
     47    connect( checkProxy, SIGNAL( clicked() ), this, SLOT( slotProxyClicked() ) ); 
     48    connect( pushTMPDIR, SIGNAL( clicked() ), this, SLOT( slotSelectCustomTmp() ) ); 
     49    connect( pushConfigProxy, SIGNAL( clicked() ), this, SLOT( slotConfigKDEProxy() ) ); 
     50 
     51    // Connect slots to emit signal when settings change 
     52    connect( lineTMPDIR, SIGNAL( textChanged(const QString &) ), this, SLOT( slotConfigChanged() ) ); 
     53    connect( lineProxyServer, SIGNAL( textChanged(const QString &) ), this, SLOT( slotConfigChanged() ) ); 
     54    connect( spinProxyPort, SIGNAL( valueChanged(const QString &) ), this, SLOT( slotConfigChanged() ) ); 
     55     
     56} 
     57 
     58 
     59void systemUpdater::slotViewDetailsClicked() 
     60{ 
     61   if ( listViewSysUpdates->currentItem() != 0 ) 
     62   { 
     63        bool ok; 
     64        int idnum = listViewSysUpdates->currentItem()->text(1).toInt(&ok);         
     65        emit signalOpenSysDetails(idnum); 
     66   } 
    4067} 
    4168 
     
    94121void systemUpdater::slotConfigChanged() 
    95122{ 
    96   emit signalConfigChanged(); 
     123  if (! disableConfUpdates ) 
     124  { 
     125    emit signalConfigChanged(); 
     126  } 
    97127} 
    98128 
     
    405435    emit signalCheckPBIUpdatesClicked(); 
    406436} 
     437 
     438// Set if we are using a custom TmpDir 
     439void systemUpdater::setUseCustomTmp( bool enabled ) 
     440{ 
     441    checkTMPDIR->setChecked(enabled); 
     442    lineTMPDIR->setEnabled(enabled);  
     443    pushTMPDIR->setEnabled(enabled);  
     444} 
     445 
     446// Set the custom Tmpdir being used 
     447void systemUpdater::setUseCustomDirName( QString tmpdir ) 
     448{ 
     449    lineTMPDIR->setText(tmpdir); 
     450} 
     451 
     452// Set Proxy Usage 
     453void systemUpdater::setUseProxy( bool enabled ) 
     454{ 
     455    checkProxy->setChecked(enabled); 
     456    groupProxySettings->setEnabled(enabled); 
     457} 
     458 
     459// Set the Proxy being used 
     460void systemUpdater::setUseProxySettings( QString proxyURL, int portnum ) 
     461{ 
     462    lineProxyServer->setText(proxyURL); 
     463    spinProxyPort->setValue(portnum); 
     464} 
     465 
     466 
     467bool systemUpdater::getCustomTmpEnabled() 
     468{ 
     469   return checkTMPDIR->isChecked(); 
     470} 
     471 
     472 
     473QString systemUpdater::getCustomTmpDir() 
     474{ 
     475   return lineTMPDIR->text(); 
     476} 
     477 
     478bool systemUpdater::getProxyEnabled() 
     479{ 
     480   return checkProxy->isChecked(); 
     481} 
     482 
     483 
     484QString systemUpdater::getProxyUrl() 
     485{ 
     486   return lineProxyServer->text(); 
     487} 
     488 
     489int systemUpdater::getProxyPort() 
     490{ 
     491  return spinProxyPort->value(); 
     492} 
     493 
     494 
     495void systemUpdater::slotCustomTmpClicked() 
     496{ 
     497    if ( checkTMPDIR->isChecked() ) 
     498    { 
     499        lineTMPDIR->setEnabled(true);  
     500        pushTMPDIR->setEnabled(true);  
     501    } else { 
     502        lineTMPDIR->setEnabled(false);  
     503        pushTMPDIR->setEnabled(false);  
     504    } 
     505 
     506    slotConfigChanged(); 
     507} 
     508 
     509void systemUpdater::slotProxyClicked() 
     510{ 
     511    if ( checkProxy->isChecked() ) 
     512    { 
     513        groupProxySettings->setEnabled(true); 
     514    } else { 
     515        groupProxySettings->setEnabled(false); 
     516    } 
     517 
     518    slotConfigChanged(); 
     519} 
     520 
     521void systemUpdater::slotSelectCustomTmp() 
     522{ 
     523 
     524   QString newDir = QFileDialog::getExistingDirectory( 
     525                    "/", 
     526                    this, 
     527                    tr("Select Temp directory"), 
     528                    tr("Select Temp directory"), 
     529                    TRUE ); 
     530      
     531     // Check if the user just hit cancel 
     532     if ( newDir.isEmpty() ) 
     533     { 
     534        return;  
     535     } 
     536 
     537   lineTMPDIR->setText(newDir); 
     538 
     539} 
     540 
     541void systemUpdater::slotDisableConfUpdates(bool status) 
     542{ 
     543   // Set if we need to ignore updating the conf file, because a conf load is taking place 
     544   disableConfUpdates = status; 
     545} 
     546 
     547 
     548// Launches the kcmshell4 proxy command to allow the user to modify proxy settings 
     549void systemUpdater::slotConfigKDEProxy() 
     550{ 
     551   emit signalLaunchKDEProxy(); 
     552} 
  • pcbsd/branches/7.0/SystemUpdater/SystemUpdater.h

    r2780 r2940  
    3030public slots: 
    3131    void programInit(); 
     32    void slotViewDetailsClicked(); 
    3233    void slotClose(); 
    3334    void slotUserClickedCheckSysUpdates(); 
     
    5354    void clearPBIList(); 
    5455    void setRunAtStartupConfig( bool enabled ); 
     56    void setUseCustomTmp( bool enabled ); 
     57    void setUseCustomDirName( QString tmpdir ); 
     58    void setUseProxy( bool enabled ); 
     59    void setUseProxySettings( QString proxyURL, int portnum ); 
    5560    bool getStartupConfig(); 
     61    bool getCustomTmpEnabled(); 
     62    QString getCustomTmpDir(); 
     63    bool getProxyEnabled(); 
     64    QString getProxyUrl(); 
     65    int getProxyPort(); 
    5666    void slotRescanPBIUpdatesClicked(); 
    57  
    58  
     67    void slotDisableConfUpdates(bool status); 
    5968 
    6069private slots: 
     70    void slotCustomTmpClicked(); 
     71    void slotProxyClicked(); 
     72    void slotSelectCustomTmp(); 
     73    void slotConfigKDEProxy(); 
    6174 
    6275private: 
     
    6578  QString standAlone[150]; 
    6679  QString reboot[150]; 
     80  bool disableConfUpdates; 
    6781 
    6882 
     
    7589    void signalUpdatePBI(); 
    7690    void signalCheckPBIUpdatesClicked(); 
     91    void signalLaunchKDEProxy(); 
    7792} ; 
    7893#endif // SYSTEMUPDATER_H 
  • pcbsd/branches/7.0/SystemUpdater/SystemUpdater.qrc

    r2131 r2940  
    11<RCC> 
    22  <qresource> 
     3    <file>folder.png</file> 
    34    <file>sysupdater.png</file> 
    45  </qresource> 
    56</RCC> 
    6  
  • pcbsd/branches/7.0/SystemUpdater/SystemUpdater.ui

    r2131 r2940  
    66    <x>0</x> 
    77    <y>0</y> 
    8     <width>542</width> 
    9     <height>353</height> 
     8    <width>596</width> 
     9    <height>508</height> 
    1010   </rect> 
    1111  </property> 
     
    7575     </property> 
    7676     <widget class="QWidget" name="Widget8" > 
    77       <property name="geometry" > 
    78        <rect> 
    79         <x>0</x> 
    80         <y>0</y> 
    81         <width>524</width> 
    82         <height>275</height> 
    83        </rect> 
    84       </property> 
    8577      <attribute name="title" > 
    8678       <string>System Updates</string> 
     
    10799         <item> 
    108100          <layout class="QGridLayout" > 
    109            <item row="1" column="0" colspan="2" > 
     101           <item row="1" column="0" colspan="3" > 
    110102            <widget class="Q3ListView" name="listViewSysUpdates" > 
    111103             <property name="sizePolicy" > 
     
    151143            </widget> 
    152144           </item> 
    153            <item row="0" column="0" colspan="2" > 
     145           <item row="0" column="0" colspan="3" > 
    154146            <widget class="QLabel" name="textLabel6" > 
    155147             <property name="sizePolicy" > 
     
    170162            </widget> 
    171163           </item> 
    172            <item row="2" column="1" > 
     164           <item row="2" column="2" > 
    173165            <spacer name="spacer2" > 
    174166             <property name="orientation" > 
     
    190182             <property name="text" > 
    191183              <string>Select All</string> 
     184             </property> 
     185            </widget> 
     186           </item> 
     187           <item row="2" column="1" > 
     188            <widget class="QPushButton" name="pushDetails" > 
     189             <property name="text" > 
     190              <string>View Details</string> 
    192191             </property> 
    193192            </widget> 
     
    329328     </widget> 
    330329     <widget class="QWidget" name="Widget9" > 
    331       <property name="geometry" > 
    332        <rect> 
    333         <x>0</x> 
    334         <y>0</y> 
    335         <width>524</width> 
    336         <height>275</height> 
    337        </rect> 
    338       </property> 
    339330      <attribute name="title" > 
    340331       <string>PBI Updates</string> 
     
    577568     </widget> 
    578569     <widget class="QWidget" name="TabPage" > 
    579       <property name="geometry" > 
    580        <rect> 
    581         <x>0</x> 
    582         <y>0</y> 
    583         <width>524</width> 
    584         <height>275</height> 
    585        </rect> 
    586       </property> 
    587570      <attribute name="title" > 
    588571       <string>Configuration</string> 
    589572      </attribute> 
    590       <layout class="QVBoxLayout" > 
    591        <item> 
     573      <layout class="QGridLayout" name="gridLayout_2" > 
     574       <item row="0" column="0" > 
    592575        <widget class="QCheckBox" name="checkSystemUpdatesConfig" > 
    593576         <property name="text" > 
     
    596579        </widget> 
    597580       </item> 
    598        <item> 
     581       <item row="1" column="0" > 
    599582        <widget class="QCheckBox" name="checkPBIUpdatesConfig" > 
    600583         <property name="text" > 
     
    603586        </widget> 
    604587       </item> 
    605        <item> 
     588       <item row="2" column="0" > 
    606589        <widget class="QCheckBox" name="checkRunAtStartup" > 
    607590         <property name="text" > 
     
    610593        </widget> 
    611594       </item> 
    612        <item> 
     595       <item row="3" column="0" > 
     596        <layout class="QHBoxLayout" name="horizontalLayout" > 
     597         <item> 
     598          <widget class="QCheckBox" name="checkTMPDIR" > 
     599           <property name="text" > 
     600            <string>Specify custom temporary directory</string> 
     601           </property> 
     602          </widget> 
     603         </item> 
     604         <item> 
     605          <spacer name="horizontalSpacer" > 
     606           <property name="orientation" > 
     607            <enum>Qt::Horizontal</enum> 
     608           </property> 
     609           <property name="sizeType" > 
     610            <enum>QSizePolicy::Minimum</enum> 
     611           </property> 
     612           <property name="sizeHint" stdset="0" > 
     613            <size> 
     614             <width>40</width> 
     615             <height>20</height> 
     616            </size> 
     617           </property> 
     618          </spacer> 
     619         </item> 
     620         <item> 
     621          <widget class="QLineEdit" name="lineTMPDIR" > 
     622           <property name="readOnly" > 
     623            <bool>true</bool> 
     624           </property> 
     625          </widget> 
     626         </item> 
     627         <item> 
     628          <widget class="QPushButton" name="pushTMPDIR" > 
     629           <property name="sizePolicy" > 
     630            <sizepolicy vsizetype="Fixed" hsizetype="Fixed" > 
     631             <horstretch>0</horstretch> 
     632             <verstretch>0</verstretch> 
     633            </sizepolicy> 
     634           </property> 
     635           <property name="minimumSize" > 
     636            <size> 
     637             <width>28</width> 
     638             <height>28</height> 
     639            </size> 
     640           </property> 
     641           <property name="maximumSize" > 
     642            <size> 
     643             <width>28</width> 
     644             <height>28</height> 
     645            </size> 
     646           </property> 
     647           <property name="text" > 
     648            <string/> 
     649           </property> 
     650           <property name="icon" > 
     651            <iconset resource="SystemUpdater.qrc" > 
     652             <normaloff>:/folder.png</normaloff>:/folder.png</iconset> 
     653           </property> 
     654           <property name="iconSize" > 
     655            <size> 
     656             <width>20</width> 
     657             <height>20</height> 
     658            </size> 
     659           </property> 
     660          </widget> 
     661         </item> 
     662        </layout> 
     663       </item> 
     664       <item row="4" column="0" > 
     665        <widget class="QCheckBox" name="checkProxy" > 
     666         <property name="text" > 
     667          <string>Specify proxy for update check</string> 
     668         </property> 
     669        </widget> 
     670       </item> 
     671       <item row="5" column="0" > 
     672        <widget class="QGroupBox" name="groupProxySettings" > 
     673         <property name="title" > 
     674          <string>Proxy Settings</string> 
     675         </property> 
     676         <layout class="QGridLayout" name="gridLayout" > 
     677          <item row="0" column="0" > 
     678           <layout class="QHBoxLayout" name="horizontalLayout_2" > 
     679            <item> 
     680             <widget class="QLabel" name="label" > 
     681              <property name="text" > 
     682               <string>Proxy Server</string> 
     683              </property> 
     684             </widget> 
     685            </item> 
     686            <item> 
     687             <widget class="QLineEdit" name="lineProxyServer" /> 
     688            </item> 
     689            <item> 
     690             <widget class="QLabel" name="label_2" > 
     691              <property name="text" > 
     692               <string>Port</string> 
     693              </property> 
     694             </widget> 
     695            </item> 
     696            <item> 
     697             <widget class="QSpinBox" name="spinProxyPort" > 
     698              <property name="maximum" > 
     699               <number>9999</number> 
     700              </property> 
     701              <property name="value" > 
     702               <number>8080</number> 
     703              </property> 
     704             </widget> 
     705            </item> 
     706           </layout> 
     707          </item> 
     708         </layout> 
     709        </widget> 
     710       </item> 
     711       <item row="6" column="0" > 
     712        <layout class="QHBoxLayout" name="horizontalLayout_3" > 
     713         <item> 
     714          <spacer name="horizontalSpacer_2" > 
     715           <property name="orientation" > 
     716            <enum>Qt::Horizontal</enum> 
     717           </property> 
     718           <property name="sizeHint" stdset="0" > 
     719            <size> 
     720             <width>40</width> 
     721             <height>20</height> 
     722            </size> 
     723           </property> 
     724          </spacer> 
     725         </item> 
     726         <item> 
     727          <widget class="QPushButton" name="pushConfigProxy" > 
     728           <property name="text" > 
     729            <string>Configure Download Proxy</string> 
     730           </property> 
     731          </widget> 
     732         </item> 
     733         <item> 
     734          <spacer name="horizontalSpacer_3" > 
     735           <property name="orientation" > 
     736            <enum>Qt::Horizontal</enum> 
     737           </property> 
     738           <property name="sizeHint" stdset="0" > 
     739            <size> 
     740             <width>40</width> 
     741             <height>20</height> 
     742            </size> 
     743           </property> 
     744          </spacer> 
     745         </item> 
     746        </layout> 
     747       </item> 
     748       <item row="7" column="0" > 
    613749        <spacer name="spacer8" > 
    614750         <property name="orientation" > 
     
    626762        </spacer> 
    627763       </item> 
    628        <item> 
     764       <item row="8" column="0" > 
    629765        <spacer name="spacer9" > 
    630766         <property name="orientation" > 
  • pcbsd/branches/7.0/SystemUpdater/UpdaterTray.cpp

    r2908 r2940  
    3434#define  UPDATE_MSEC 1000 * 60 * 60 * 12 
    3535 
    36  
     36/* Change this to switch the default patch tmpdir */ 
     37#define  PATCHTMPDIR_DEFAULT "/usr/local/tmp" 
    3738 
    3839 
     
    137138  // If the user wants to view details about a particular update 
    138139  connect( SystemUpdaterDialog, SIGNAL(signalOpenSysDetails(int)), this, SLOT(slotOpenSysDetails(int) ) ); 
     140  connect( SystemUpdaterDialog, SIGNAL(signalLaunchKDEProxy()), this, SLOT(slotLaunchKDEProxyConfig() ) ); 
    139141 
    140142  // Signal if the user wants to start a system update 
     
    154156  
    155157 
    156 // Get the username of the person running X 
     158  // Get the username of the person running X 
    157159  username = getlogin(); 
    158  
    159160 
    160161  // Set the tray icon that we are checking for updates 
     
    247248  getUpdatesDir->addArgument( "sh"); 
    248249  getUpdatesDir->addArgument( "/PCBSD/SystemUpdater/bin/getUpdatesDir.sh"); 
     250  if ( useProxyServer ) 
     251  { 
     252     QString proxyArgPort; 
     253     proxyArgPort.setNum(proxyServerPort); 
     254 
     255     QString proxyArgUrl = proxyServerUrl; 
     256 
     257     // Check if we need to remove a http:// 
     258     if ( proxyServerUrl.indexOf("http://") == 0 ) 
     259     { 
     260        proxyArgUrl.remove(0, 7); 
     261     } 
     262 
     263     getUpdatesDir->addArgument( proxyArgUrl + ":" + proxyArgPort ); 
     264 
     265  } else { 
     266     getUpdatesDir->addArgument( "DISABLE" ); 
     267  } 
    249268 
    250269  // Connect the exited signal and start the process 
     
    252271  //connect( SetupScript, SIGNAL(readyReadStdout()), this, SLOT(readyReadScriptOutput2() ) ); 
    253272  if ( ! getUpdatesDir->start() ) { 
    254         QMessageBox::information( this->contextMenu(), tr("Error!"), tr("Error running updates1 script! "), QMessageBox::Ok ); 
     273        QMessageBox::information( 0, tr("Error!"), tr("Error running updates1 script! "), QMessageBox::Ok ); 
    255274  } 
    256275 
     
    269288  if ( getUpdatesDir->exitStatus() != 0 ) 
    270289  { 
    271         QMessageBox::warning( this->contextMenu(), tr("Update Error!"), tr("Could not contact the PC-BSD update server!"), QMessageBox::Ok ); 
     290        QMessageBox::warning( 0, tr("Update Error!"), tr("Could not contact the PC-BSD update server! Please check your internet connection or proxy settings under 'configure'"), QMessageBox::Ok ); 
    272291  }  
    273292 
     
    280299  connect( readSysUpdates, SIGNAL(processExited()), this, SLOT(slotReadSystemUpdates() ) ); 
    281300  if ( ! readSysUpdates->start() ) { 
    282         QMessageBox::information( this->contextMenu(), tr("Error!"), tr("Error running updates2 script! "), QMessageBox::Ok ); 
     301        QMessageBox::information( 0, tr("Error!"), tr("Error running updates2 script! "), QMessageBox::Ok ); 
    283302  } 
    284303 
     
    644663 
    645664 
    646  
    647   
    648  
    649  
    650  
    651665  // Check if the user wants to check for PBI updates and save it  
    652666  bool enablePBICheck = SystemUpdaterDialog->getPBIUpdateConfig(); 
     
    662676  checkPBIUpdatesFrequently = enablePBICheck; 
    663677 
    664 } 
    665  
    666  
    667  
    668  
    669  
    670  
     678 
     679  // Check if the user has enabled a custom tmpdir  
     680  useCustomTmpDir = SystemUpdaterDialog->getCustomTmpEnabled();   
     681  settings.writeEntry( "/PC-BSD/SystemUpdater/useCustomTmpDir", useCustomTmpDir ); 
     682 
     683  // Load the custom tmpdir string 
     684  customTmpDir = SystemUpdaterDialog->getCustomTmpDir(); 
     685  settings.writeEntry( "/PC-BSD/SystemUpdater/customTmpDir", customTmpDir ); 
     686 
     687  useProxyServer = SystemUpdaterDialog->getProxyEnabled(); 
     688  settings.setValue( "/PC-BSD/SystemUpdater/useProxyServer", useProxyServer ); 
     689  
     690  proxyServerUrl = SystemUpdaterDialog->getProxyUrl(); 
     691  settings.setValue( "/PC-BSD/SystemUpdater/proxyServerUrl", proxyServerUrl ); 
     692 
     693  proxyServerPort = SystemUpdaterDialog->getProxyPort(); 
     694  settings.setValue( "/PC-BSD/SystemUpdater/proxyServerPort", proxyServerPort ); 
     695 
     696 
     697} 
    671698 
    672699void UpdaterTray::loadUpdaterPrefs() { 
    673700  // Load the user preferences for the System Updater 
     701  bool ok; 
    674702  QSettings settings; 
    675   //settings.setPath( "PC-BSD", "SystemUpdater" ); 
     703   
     704  // Disable updating the conf file until we are done loading it 
     705  SystemUpdaterDialog->slotDisableConfUpdates(true); 
    676706 
    677707  bool enableSysCheck = settings.readBoolEntry( "/PC-BSD/SystemUpdater/CheckSysUpdatesConfig", TRUE ); 
     
    679709  checkSysUpdatesFrequently = enableSysCheck; 
    680710   
    681  
    682711  bool enablePBICheck = settings.readBoolEntry( "/PC-BSD/SystemUpdater/CheckPBIUpdatesConfig", TRUE ); 
    683712  SystemUpdaterDialog->setPBIUpdateConfig(enablePBICheck); 
     
    688717  contextMenu()->setItemChecked ( 6, enableStartup ); 
    689718 
    690 } 
    691  
    692  
    693  
    694  
    695  
     719  // Check if we are using a custom tmpdir 
     720  useCustomTmpDir = settings.readBoolEntry( "/PC-BSD/SystemUpdater/useCustomTmpDir", false ); 
     721  SystemUpdaterDialog->setUseCustomTmp( useCustomTmpDir ); 
     722 
     723  // Load a custom tmpdir 
     724  customTmpDir= PATCHTMPDIR_DEFAULT; 
     725  customTmpDir = settings.value("/PC-BSD/SystemUpdater/customTmpDir", customTmpDir).toString(); 
     726  SystemUpdaterDialog->setUseCustomDirName( customTmpDir ); 
     727   
     728  // Load if the user wants to use a proxy server 
     729  useProxyServer = settings.readBoolEntry( "/PC-BSD/SystemUpdater/useProxyServer", false ); 
     730  SystemUpdaterDialog->setUseProxy( useProxyServer ); 
     731   
     732  // Load Proxy Server Settings 
     733  proxyServerUrl = settings.value( "/PC-BSD/SystemUpdater/proxyServerUrl" ).toString(); 
     734 
     735  settings.value("/PC-BSD/SystemUpdater/proxyServerPort").toInt(&ok); 
     736  if ( ok ) { 
     737     proxyServerPort = settings.value( "/PC-BSD/SystemUpdater/proxyServerPort").toInt(&ok); 
     738  } else { 
     739     proxyServerPort = 8080; 
     740  } 
     741  SystemUpdaterDialog->setUseProxySettings( proxyServerUrl, proxyServerPort ); 
     742 
     743  SystemUpdaterDialog->slotDisableConfUpdates(false); 
     744 
     745} 
    696746 
    697747 
     
    700750  slotStartUpdateCheck(); 
    701751} 
    702  
    703  
    704  
    705  
    706752 
    707753 
     
    794840    bool ok; 
    795841 
     842   // Lets set the patch tmpdir variable now 
     843   if ( useCustomTmpDir ) 
     844   { 
     845     patchTmpDir = customTmpDir; 
     846   } else { 
     847     patchTmpDir = PATCHTMPDIR_DEFAULT; 
     848   } 
     849 
     850   // Make sure this tmpdir exists 
     851   system("mkdir -p '" + patchTmpDir + "' >/dev/null 2>/dev/null"); 
     852 
     853 
    796854 
    797855    // Get the output of the .df command 
    798     command = "df -m | grep -v '^devfs' | grep -v 'linprocfs' | grep -v '^Filesystem' | grep -v ' /tmp' > /PCBSD/tmp/.dfoutput"; 
     856    command = "df -m | grep -v '^devfs' | grep -v 'linprocfs' | grep -v '^Filesystem' | grep -v ' /proc' | grep -v ' /tmp' > '" + patchTmpDir + "/.dfoutput'"; 
    799857    FILE *filecmd = popen(command,"r");  
    800858    pclose(filecmd); 
     
    816874    i = 0; 
    817875    // Open our df file, and read it line-by-line 
    818     QFile file( "/PCBSD/tmp/.dfoutput" ); 
     876    QFile file( patchTmpDir + "/.dfoutput" ); 
    819877    if ( file.open( IO_ReadOnly ) ) { 
    820878        QTextStream stream( &file ); 
     
    823881             CheckDFParts[i] =  tmp.simplifyWhiteSpace(); 
    824882 
    825             //QMessageBox::critical( this->contextMenu(), tr("DF"), "Read Line:" + CheckDFParts[i], QMessageBox::Ok); 
     883            //QMessageBox::critical( 0, tr("DF"), "Read Line:" + CheckDFParts[i], QMessageBox::Ok); 
    826884            i++; 
    827885        } 
    828886        // Make sure the last in our array is empty 
    829887        CheckDFParts[i]=""; 
     888        file.close(); 
     889        file.remove(); 
    830890    } 
    831891 
    832892 
    833     installLoc = "/PCBSD/tmp"; 
     893    if ( useCustomTmpDir ) 
     894    { 
     895       installLoc = customTmpDir; 
     896    } else { 
     897       installLoc = PATCHTMPDIR_DEFAULT; 
     898    } 
    834899 
    835900    // Now determine which partition we have selected 
     
    864929        { 
    865930            // Not enough room, warn the user how much they will need 
    866             QMessageBox::critical( this->contextMenu(), tr("System Updater"), tr("Error: Not enough free disk space for these updates! You will need " + tmp.setNum(progSize) + "MB to install the selected updates"), QMessageBox::Ok ); 
     931            QMessageBox::critical( 0, tr("System Updater"), tr("Error: Not enough free disk space for these updates! You will need " + tmp.setNum(progSize) + "MB to install the selected updates. Please select a different partition or free up some space to continue."), QMessageBox::Ok ); 
    867932            return; 
    868933        } else { 
     
    872937 
    873938    } else { 
    874         QMessageBox::critical( this->contextMenu(), tr("ERROR:"), tr("Error determining remaining disk space!"), QMessageBox::Ok); 
     939        QMessageBox::critical( 0, tr("ERROR:"), tr("Error determining remaining disk space!"), QMessageBox::Ok); 
    875940    } 
    876941 
     
    890955void UpdaterTray::slotStartSystemUpdate() 
    891956{ 
    892    // The user is ready to start some system updates 
     957  // The user is ready to start some system updates 
     958   
     959 
     960  // Lets set the patch tmpdir variable now 
     961  if ( useCustomTmpDir ) 
     962  { 
     963    patchTmpDir = customTmpDir; 
     964  } else { 
     965    patchTmpDir = PATCHTMPDIR_DEFAULT; 
     966  } 
     967 
     968  // Make sure this tmpdir exists 
     969  system("mkdir -p '" + patchTmpDir + "' >/dev/null 2>/dev/null");  
    893970   
    894971  // Change the program status and update the tray icon 
     
    9451022    UpdaterStatusDialog->show(); 
    9461023 
    947     QMessageBox::warning( this->contextMenu(), tr("Online Update"), tr("One or more updates will require a reboot. You will be prompted to restart after the update is finished."), QMessageBox::Ok ); 
     1024    QMessageBox::warning( 0, tr("Online Update"), tr("One or more updates will require a reboot. You will be prompted to restart after the update is finished."), QMessageBox::Ok ); 
    9481025    requiresSysReboot = 1; 
    9491026 } 
     
    9651042void UpdaterTray::slotDownloadSysUpdate() 
    9661043{ 
    967    QString status, id, tmp; 
     1044   QString status, id, tmp, command; 
    9681045   bool startNewDownload = false, ok; 
    9691046   int getNextItem = 0; 
     
    10541131   UpdaterStatusDialog->setLabelSysUpdateStatus(status); 
    10551132 
    1056     UpdaterStatusDialog->setProgressTotalSteps(100); 
     1133   UpdaterStatusDialog->setProgressTotalSteps(100); 
     1134    
     1135   command = "rm '" + patchTmpDir + "/patch" + tmp.setNum(currentSysWorkingItem) + ".lzma'"; 
     1136   FILE *file = popen(command,"r");  
     1137   pclose(file); 
    10571138 
    10581139    // Make sure that any old patch is removed first 
    1059     QFile tmpfile("/PCBSD/tmp/patch" + tmp.setNum(currentSysWorkingItem) + ".lzma"); 
     1140    QFile tmpfile( patchTmpDir + "/patch" + tmp.setNum(currentSysWorkingItem) + ".lzma"); 
    10601141    if ( tmpfile.exists() ) 
    10611142    { 
    10621143      tmpfile.remove(); 
    10631144    } 
    1064       
    1065     copyJob = KIO::copy(SysUpdateURL[currentSysWorkingItem], "/PCBSD/tmp/patch" + tmp.setNum(currentSysWorkingItem) + ".lzma", KIO::HideProgressInfo); 
     1145 
     1146 
     1147    copyJob = KIO::copy(SysUpdateURL[currentSysWorkingItem], patchTmpDir + "/patch" + tmp.setNum(currentSysWorkingItem) + ".lzma", KIO::HideProgressInfo); 
    10661148     
    10671149    connect(copyJob, SIGNAL(totalSize(KJob*, qulonglong)), UpdaterStatusDialog, SLOT(slotJobUpdateTotalSize( KJob*, qulonglong))); 
     
    10791161    QString tmp; 
    10801162 
    1081     // This function starts the internal checksum to ensure the PBI is intact 
     1163    // This function starts the internal checksum to ensure the update is intact 
    10821164 
    10831165    tmp = tr("Checking data integrity..."); 
     
    10851167 
    10861168    // Make the checksum.sh script now 
    1087     QFile file4( "/PCBSD/tmp/.syschecksum.sh" ); 
     1169    QFile file4( patchTmpDir + "/.syschecksum.sh" ); 
    10881170    if ( file4.open( IO_WriteOnly ) ) { 
    10891171        QTextStream stream4( &file4 ); 
    1090         stream4 << "cat /PCBSD/tmp/patch" + tmp.setNum(currentSysWorkingItem) + ".lzma | md5 >&1"; 
     1172        stream4 << "cat '" + patchTmpDir + "/patch" + tmp.setNum(currentSysWorkingItem) + ".lzma' | md5 >&1"; 
    10911173        file4.close(); 
    10921174    } 
     
    10941176    checksumProc = new Q3Process( this ); 
    10951177    checksumProc->addArgument( "sh" ); 
    1096     checksumProc->addArgument( "/PCBSD/tmp/.syschecksum.sh" ); 
     1178    checksumProc->addArgument( patchTmpDir + "/.syschecksum.sh" ); 
    10971179    //connect( checksumProc, SIGNAL(processExited()), this, SLOT( slotChecksumFinished() ) ); 
    10981180    connect( checksumProc, SIGNAL(readyReadStdout()), this, SLOT(slotReadSysMD5() ) ); 
    10991181    if ( !checksumProc->start() ) { 
    1100       QMessageBox::information( this->contextMenu(), tr("Error!"), tr("Error running internal checksum Script! "), QMessageBox::Ok ); 
     1182      QMessageBox::information( 0, tr("Error!"), tr("Error running internal checksum Script! "), QMessageBox::Ok ); 
    11011183    } 
    11021184 
     
    11241206 
    11251207       // Remove the bad patch 
    1126        command = "rm /PCBSD/tmp/patch" + tmp.setNum(currentSysWorkingItem) + ".lzma "; 
     1208       command = "rm '" + patchTmpDir + "/patch" + tmp.setNum(currentSysWorkingItem) + ".lzma'"; 
    11271209       FILE *file = popen(command,"r");  
    11281210       pclose(file); 
     
    11341216           UpdaterStatusDialog->show(); 
    11351217 
    1136            QMessageBox::critical( this->contextMenu(), tr("Online Update"), tr("An error occured while downloading. Please check your connection or try again later."), QMessageBox::Ok ); 
     1218           QMessageBox::critical( 0, tr("Online Update"), tr("An error occured while downloading. Please check your connection or try again later."), QMessageBox::Ok ); 
    11371219 
    11381220           if ( UpdaterStatusDialog->isShown() ) 
     
    12161298        if ( requiresSysReboot == 1)  
    12171299        { 
    1218            QMessageBox::information( this->contextMenu(), tr("Online Update"), tr("Updates successfully installed! Your system will need to reboot to finish."), QMessageBox::Ok); 
     1300           QMessageBox::information( 0, tr("Online Update"), tr("Updates successfully installed! Your system will need to reboot to finish."), QMessageBox::Ok); 
    12191301        } else { 
    12201302           QMessageBox::information( 0, tr("Online Update"), tr("Updates successfully installed!"), QMessageBox::Ok ); 
     
    12491331 
    12501332 
    1251     // Make the checksum.sh script now 
    1252     QFile file4( "/PCBSD/tmp/.extractsys.sh" ); 
     1333    // Make the extract script now 
     1334    QFile file4( patchTmpDir + "/.extractsys.sh" ); 
    12531335    if ( file4.open( IO_WriteOnly ) ) { 
    12541336        QTextStream stream4( &file4 ); 
    12551337        stream4 << "#!/bin/sh\n"; 
    1256         stream4 << "mkdir -p /PCBSD/tmp/patch" + tmp.setNum(currentSysWorkingItem); 
    1257         stream4 << "\necho \"" + SysUpdatePatchFile[currentSysWorkingItem] + "\" > /PCBSD/tmp/patch" + tmp.setNum(currentSysWorkingItem) +"/patchFile\n"; 
    1258         stream4 << "lzma -so d /PCBSD/tmp/patch" + tmp.setNum(currentSysWorkingItem) + ".lzma | tar xvC /PCBSD/tmp/patch" + tmp.setNum(currentSysWorkingItem) + " -f - >&1"; 
     1338        stream4 << "mkdir -p '" + patchTmpDir + "/patch" + tmp.setNum(currentSysWorkingItem) + "'\n"; 
     1339        stream4 << "echo \"" + SysUpdatePatchFile[currentSysWorkingItem] + "\" > '" + patchTmpDir + "/patch" + tmp.setNum(currentSysWorkingItem) +"/patchFile'\n"; 
     1340        stream4 << "lzma -so d '" + patchTmpDir + "/patch" + tmp.setNum(currentSysWorkingItem) + ".lzma' | tar xvC '" + patchTmpDir + "/patch" + tmp.setNum(currentSysWorkingItem) + "' -f - >&1"; 
    12591341        file4.close(); 
    12601342    } 
     
    12631345    extractProc = new Q3Process( this ); 
    12641346    extractProc->addArgument( "sh" ); 
    1265     extractProc->addArgument( "/PCBSD/tmp/.extractsys.sh" ); 
     1347    extractProc->addArgument( patchTmpDir + "/.extractsys.sh" ); 
    12661348 
    12671349    connect( extractProc, SIGNAL(processExited()), this, SLOT(slotSysExtractFinished() ) ); 
     
    12711353                UpdaterStatusDialog->show(); 
    12721354 
    1273                 QMessageBox::critical( this->contextMenu(), tr("Online Update"), tr("An error occured while extracting. Please try again later."), QMessageBox::Ok ); 
     1355                QMessageBox::critical( 0, tr("Online Update"), tr("An error occured while extracting. Please try again later."), QMessageBox::Ok ); 
    12741356                if ( UpdaterStatusDialog->isShown() ) 
    12751357                { 
     
    12941376 
    12951377    // Make the checksum.sh script now 
    1296     QFile file4( "/PCBSD/tmp/.installsys.sh" ); 
     1378    QFile file4( patchTmpDir + "/.installsys.sh" ); 
    12971379    if ( file4.open( IO_WriteOnly ) ) { 
    12981380        QTextStream stream4( &file4 ); 
    12991381        stream4 << "#!/bin/sh\n"; 
    1300         stream4 << "rm /PCBSD/tmp/patch" + tmp.setNum(currentSysWorkingItem) + ".lzma\n\n"; 
    1301         stream4 << "cd /PCBSD/tmp/patch" + tmp.setNum(currentSysWorkingItem); 
    1302         stream4 << "\nPATCHDIR=\"/PCBSD/tmp/patch" + tmp.setNum(currentSysWorkingItem) + "\" ; export PATCHDIR\n"; 
    1303         stream4 << "cd $PATCHDIR\n"; 
     1382        stream4 << "rm '" + patchTmpDir + "/patch" + tmp.setNum(currentSysWorkingItem) + ".lzma'\n\n"; 
     1383        stream4 << "cd '" + patchTmpDir + "/patch" + tmp.setNum(currentSysWorkingItem) + "'\n"; 
     1384        stream4 << "PATCHDIR=\"" + patchTmpDir + "/patch" + tmp.setNum(currentSysWorkingItem) + "\" ; export PATCHDIR\n"; 
     1385        stream4 << "cd \"${PATCHDIR}\"\n"; 
    13041386        stream4 << "sh update.sh >&1 2>&1\n"; 
    13051387        stream4 << "if [ \"$?\" = \"0\" ]\n"; 
    13061388        stream4 << "then\n"; 
    13071389        stream4 << "  cp /PCBSD/SystemUpdater/system-updates/available/" + SysUpdatePatchFile[currentSysWorkingItem] + " /PCBSD/SystemUpdater/system-updates/installed/" + SysUpdatePatchFile[currentSysWorkingItem] + "\n"; 
    1308         stream4 << "  rm -rf /PCBSD/tmp/patch" + tmp.setNum(currentSysWorkingItem) + "\n"; 
    1309         stream4 << "  rm /PCBSD/tmp/.extractsys.sh\n"; 
    1310         stream4 << "  rm /PCBSD/tmp/.installsys.sh\n"; 
    1311         stream4 << "  rm /PCBSD/tmp/.syschecksum.sh\n"; 
     1390        stream4 << "  rm -rf '" + patchTmpDir + "/patch" + tmp.setNum(currentSysWorkingItem) + "'\n"; 
     1391        stream4 << "  rm '" + patchTmpDir + "/.extractsys.sh'\n"; 
     1392        stream4 << "  rm '" + patchTmpDir + "/.installsys.sh'\n"; 
     1393        stream4 << "  rm '" + patchTmpDir + "/.syschecksum.sh'\n"; 
    13121394        stream4 << "  exit 0\n"; 
    13131395        stream4 << "else\n"; 
    1314         stream4 << "  rm -rf /PCBSD/tmp/patch" + tmp.setNum(currentSysWorkingItem) + "\n"; 
    1315         stream4 << "  rm /PCBSD/tmp/.extractsys.sh\n"; 
    1316         stream4 << "  rm /PCBSD/tmp/.installsys.sh\n"; 
    1317         stream4 << "  rm /PCBSD/tmp/.syschecksum.sh\n"; 
     1396        stream4 << "  rm -rf '" + patchTmpDir + "/patch" + tmp.setNum(currentSysWorkingItem) + "'\n"; 
     1397        stream4 << "  rm '" + patchTmpDir + "/.extractsys.sh'\n"; 
     1398        stream4 << "  rm '" + patchTmpDir + "/.installsys.sh'\n"; 
     1399        stream4 << "  rm '" + patchTmpDir + "/.syschecksum.sh'\n"; 
    13181400        stream4 << "  exit 1\n"; 
    13191401        stream4 << "fi\n"; 
     
    13241406    installProc = new Q3Process( this ); 
    13251407    installProc->addArgument( "sh" ); 
    1326     installProc->addArgument( "/PCBSD/tmp/.installsys.sh" ); 
     1408    installProc->addArgument( patchTmpDir + "/.installsys.sh" ); 
    13271409 
    13281410    connect( installProc, SIGNAL(processExited()), this, SLOT(slotSysInstallFinished() ) ); 
     
    13311413     
    13321414            if ( ! installProc->start() ) { 
    1333                 QMessageBox::critical( this->contextMenu(), tr("Online Update"), tr("An error occured while installing. Please try again later."), QMessageBox::Ok ); 
     1415                QMessageBox::critical( 0, tr("Online Update"), tr("An error occured while installing. Please try again later."), QMessageBox::Ok ); 
    13341416                exit(15);        
    13351417            }  
     
    15661648  checkPBIProc->addArgument( progName ); 
    15671649  checkPBIProc->addArgument( PBIProgVer[currentWorkingPBI]  ); 
     1650 
     1651  if ( useProxyServer ) 
     1652  { 
     1653     QString proxyArgPort; 
     1654     proxyArgPort.setNum(proxyServerPort); 
     1655     
     1656     QString proxyArgUrl = proxyServerUrl; 
     1657 
     1658     // Check if we need to remove a http:// 
     1659     if ( proxyServerUrl.indexOf("http://") == 0 ) 
     1660     { 
     1661        proxyArgUrl.remove(0, 7); 
     1662     } 
     1663 
     1664     checkPBIProc->addArgument( proxyArgUrl + ":" + proxyArgPort ); 
     1665 
     1666  } else { 
     1667     checkPBIProc->addArgument( "DISABLE" ); 
     1668  } 
     1669 
    15681670 
    15691671  connect( checkPBIProc, SIGNAL(readyReadStdout()), this, SLOT(slotReadPBIStatusResults() ) ); 
     
    17011803  UpdaterStatusDialog->show(); 
    17021804 
     1805  // Lets set the patch tmpdir variable now 
     1806  if ( useCustomTmpDir ) 
     1807  { 
     1808    patchTmpDir = customTmpDir; 
     1809  } else { 
     1810    patchTmpDir = PATCHTMPDIR_DEFAULT; 
     1811  } 
     1812 
     1813  // Make sure this tmpdir exists 
     1814  system("mkdir -p '" + patchTmpDir + "' >/dev/null 2>/dev/null"); 
    17031815 
    17041816  // Get our list of PBIs ready to be updated 
     
    17651877           UpdaterStatusDialog->show(); 
    17661878           
    1767           QMessageBox::critical( this->contextMenu(), tr("Online Update"), PBIProgName[currentWorkingPBI] + ": " + tr("An error occured while downloading. Please try again later."), QMessageBox::Ok ); 
     1879          QMessageBox::critical( 0, tr("Online Update"), PBIProgName[currentWorkingPBI] + ": " + tr("An error occured while downloading. Please try again later."), QMessageBox::Ok ); 
    17681880 
    17691881          // Set the status that this failed 
     
    18651977 
    18661978    // Make sure that any old PBI is removed first 
    1867     QFile tmpfile("/PCBSD/tmp/" + tmp.setNum(currentWorkingPBI) + ".pbi"); 
     1979    system("rm '" + patchTmpDir + "/" + tmp.setNum(currentWorkingPBI) + ".pbi' >/dev/null 2>/dev/null"); 
     1980    QFile tmpfile( patchTmpDir + "/" + tmp.setNum(currentWorkingPBI) + ".pbi"); 
    18681981    if ( tmpfile.exists() ) 
    18691982    { 
    18701983      tmpfile.remove(); 
    18711984    } 
    1872       
    1873      
    1874     copyJob = KIO::copy(URL, "/PCBSD/tmp/" + tmp.setNum(currentWorkingPBI) + ".pbi", KIO::HideProgressInfo); 
     1985 
     1986    copyJob = KIO::copy(URL, patchTmpDir + "/" + tmp.setNum(currentWorkingPBI) + ".pbi", KIO::HideProgressInfo); 
    18751987     
    18761988    connect(copyJob, SIGNAL(totalSize(KJob*, qulonglong)), UpdaterStatusDialog, SLOT(slotJobUpdateTotalSize( KJob*, qulonglong))); 
     
    19212033   { 
    19222034 
    1923        if ( upgradePBIProc->exitStatus() != 0) 
     2035       if ( upgradePBIProc->exitStatus() == 255) 
    19242036       { 
    1925          QMessageBox::critical( this->contextMenu(), tr("Online Update"), tr("The updated version of " + PBIProgName[currentWorkingPBI] + " " + tr("failed the integrity check! Please try updating this PBI again later.") ), QMessageBox::Ok ); 
     2037         QMessageBox::critical( 0, tr("Online Update"), tr("The updated version of %s failed the integrity check! Please try updating this PBI again later.", PBIProgName[currentWorkingPBI] ), QMessageBox::Ok ); 
    19262038         // Update the status on the previous download to finished 
     2039         status = tr("Failed!"); 
     2040         UpdaterStatusDialog->updateStatusListBoxItem(status, id.setNum(currentWorkingPBI) ); 
     2041       } else if ( upgradePBIProc->exitStatus() == 256 ) { 
     2042          QMessageBox::critical( 0, tr("Online Update"), tr("An error occured while upgrading %s You may need to re-install this PBI manually.", PBIProgName[currentWorkingPBI]), QMessageBox::Ok ); 
    19272043         status = tr("Failed!"); 
    19282044         UpdaterStatusDialog->updateStatusListBoxItem(status, id.setNum(currentWorkingPBI) ); 
     
    19582074 
    19592075 
    1960            QMessageBox::information( this->contextMenu(), tr("Online Update"), tr("PBI Upgrades finished!"), QMessageBox::Ok ); 
     2076           QMessageBox::information( 0, tr("Online Update"), tr("PBI Upgrades finished!"), QMessageBox::Ok ); 
    19612077           if ( UpdaterStatusDialog->isShown() ) 
    19622078           { 
     
    20112127 
    20122128    // Make the checksum.sh script now 
    2013     QFile file4( "/PCBSD/tmp/.upgradepbi.sh" ); 
     2129    QFile file4( patchTmpDir + "/.upgradepbi.sh" ); 
    20142130    if ( file4.open( IO_WriteOnly ) ) { 
    20152131        QTextStream stream4( &file4 ); 
     
    20172133        stream4 << "DISPLAY="" ; export DISPLAY\n"; 
    20182134        stream4 << "\n"; 
    2019         stream4 << "MD5=\"`cat /PCBSD/tmp/" + tmp.setNum(currentWorkingPBI) + ".pbi | md5`\"\n"; 
     2135        stream4 << "MD5=\"`cat '" + patchTmpDir + "/" + tmp.setNum(currentWorkingPBI) + ".pbi' | md5`\"\n"; 
    20202136        stream4 << "if [ \"${MD5}\" != \"" + PBIProgMD5[currentWorkingPBI] + "\" ]\n"; 
    20212137        stream4 << "then\n"; 
    2022         stream4 << "  rm /PCBSD/tmp/" + tmp.setNum(currentWorkingPBI) + ".pbi\n"; 
     2138        stream4 << "  rm '" + patchTmpDir + "/" + tmp.setNum(currentWorkingPBI) + ".pbi'\n"; 
    20232139        stream4 << "  exit 255\n"; 
    20242140        stream4 << "fi\n"; 
     
    20372153        stream4 << "echo 'SETSTEPS: 2'\n"; 
    20382154        stream4 << "echo 'MSG: Installing " + NewProgDirName + "'\n"; 
    2039         stream4 << "chmod 755 /PCBSD/tmp/" + tmp.setNum(currentWorkingPBI) + ".pbi\n"; 
    2040         stream4 << "/PCBSD/tmp/" + tmp.setNum(currentWorkingPBI) + ".pbi -text -accept\n"; 
    2041         stream4 << "\n"; 
     2155        stream4 << "chmod 755 '" + patchTmpDir + "/" + tmp.setNum(currentWorkingPBI) + ".pbi'\n"; 
     2156        stream4 << "'" + patchTmpDir + "/" + tmp.setNum(currentWorkingPBI) + ".pbi' -text -accept\n"; 
     2157        stream4 << "if [ \"$?\" != \"0\" ]\n"; 
     2158        stream4 << "then\n"; 
     2159        stream4 << "  rm '" + patchTmpDir + "/" + tmp.setNum(currentWorkingPBI) + ".pbi'\n"; 
     2160        stream4 << "  rm '" + patchTmpDir + "/.upgradepbi.sh'\n"; 
     2161        stream4 << "  exit 256\n"; 
     2162        stream4 << "fi\n"; 
    20422163        stream4 << "echo 'SETSTEPS: 3'\n"; 
    20432164        stream4 << "echo 'MSG: Finished installing " + NewProgDirName + "'\n"; 
    2044         stream4 << "rm /PCBSD/tmp/" + tmp.setNum(currentWorkingPBI) + ".pbi\n"; 
     2165        stream4 << "rm '" + patchTmpDir + "/" + tmp.setNum(currentWorkingPBI) + ".pbi'\n"; 
     2166        stream4 << "rm '" + patchTmpDir + "/.upgradepbi.sh'\n"; 
     2167        stream4 << "exit 0\n"; 
    20452168        file4.close(); 
    20462169    } 
     
    20492172    upgradePBIProc = new Q3Process( this ); 
    20502173    upgradePBIProc->addArgument( "sh" ); 
    2051     upgradePBIProc->addArgument( "/PCBSD/tmp/.upgradepbi.sh" ); 
     2174    upgradePBIProc->addArgument( patchTmpDir + "/.upgradepbi.sh" ); 
    20522175 
    20532176    connect( upgradePBIProc, SIGNAL(processExited()), this, SLOT(slotStartPBIInstall() ) ); 
     
    20552178     
    20562179            if ( ! upgradePBIProc->start() ) { 
    2057                 QMessageBox::critical( this->contextMenu(), tr("Online Update"), tr("An error occured while upgrading. Please try again later."), QMessageBox::Ok ); 
     2180                QMessageBox::critical( 0, tr("Online Update"), tr("An error occured while upgrading. Please try again later."), QMessageBox::Ok ); 
    20582181                exit(15);        
    20592182            }  
    2060  
    2061  
    2062  
    20632183 
    20642184} 
     
    20762196     { 
    20772197         tmp = upgradePBIProc->readLineStdout(); 
     2198 
    20782199 
    20792200         if ( tmp.find("TOTALSTEPS:" ) == 0) 
     
    21052226 
    21062227} 
     2228 
     2229 
     2230void UpdaterTray::slotLaunchKDEProxyConfig() 
     2231{ 
     2232   QString command; 
     2233   command = "su " + username + " -c 'kcmshell4 proxy' &"; 
     2234   system(command);  
     2235} 
  • pcbsd/branches/7.0/SystemUpdater/UpdaterTray.h

    r2600 r2940  
    5454   void slotChangeRunStartup(); 
    5555   void slotTrayActivated(QSystemTrayIcon::ActivationReason reason); 
     56   void slotLaunchKDEProxyConfig(); 
    5657    
    5758protected: 
     
    6263   void loadUpdaterPrefs(); 
    6364   void loadPatchData(QString patchFile, int patchNum); 
    64  
    6565   KJob *copyJob; 
     66   bool useCustomTmpDir; 
     67   QString customTmpDir; 
     68   bool useProxyServer; 
     69   QString proxyServerUrl; 
     70   int proxyServerPort; 
     71   QString patchTmpDir; 
    6672}; 
    6773 
  • pcbsd/trunk/SystemUpdater/SystemUpdater.cpp

    r2780 r2940  
    2424    listViewSysUpdates->hideColumn( 1 ); 
    2525 
     26    disableConfUpdates = false; 
     27 
    2628    
    2729    
     
    3638    connect( listViewSysUpdates, SIGNAL(doubleClicked ( Q3ListViewItem *, const QPoint &, int ) ), this, SLOT(slotSysDoubleClicked( Q3ListViewItem *, const QPoint &, int) ) ); 
    3739    // Connect to a right-clicked slot as well 
    38         connect( listViewSysUpdates, SIGNAL(rightButtonClicked ( Q3ListViewItem *, const QPoint &, int ) ), this, SLOT(slotSysRightClicked( Q3ListViewItem *, const QPoint &, int) ) ); 
    39      
     40    connect( listViewSysUpdates, SIGNAL(rightButtonClicked ( Q3ListViewItem *, const QPoint &, int ) ), this, SLOT(slotSysRightClicked( Q3ListViewItem *, const QPoint &, int) ) ); 
     41     
     42    // Connect the pushViewDetails button 
     43    connect( pushDetails, SIGNAL( clicked() ), this, SLOT( slotViewDetailsClicked() ) ); 
     44     
     45    // Connect the Custom Tmpdir Checkbox 
     46    connect( checkTMPDIR, SIGNAL( clicked() ), this, SLOT( slotCustomTmpClicked() ) ); 
     47    connect( checkProxy, SIGNAL( clicked() ), this, SLOT( slotProxyClicked() ) ); 
     48    connect( pushTMPDIR, SIGNAL( clicked() ), this, SLOT( slotSelectCustomTmp() ) ); 
     49    connect( pushConfigProxy, SIGNAL( clicked() ), this, SLOT( slotConfigKDEProxy() ) ); 
     50 
     51    // Connect slots to emit signal when settings change 
     52    connect( lineTMPDIR, SIGNAL( textChanged(const QString &) ), this, SLOT( slotConfigChanged() ) ); 
     53    connect( lineProxyServer, SIGNAL( textChanged(const QString &) ), this, SLOT( slotConfigChanged() ) ); 
     54    connect( spinProxyPort, SIGNAL( valueChanged(const QString &) ), this, SLOT( slotConfigChanged() ) ); 
     55     
     56} 
     57 
     58 
     59void systemUpdater::slotViewDetailsClicked() 
     60{ 
     61   if ( listViewSysUpdates->currentItem() != 0 ) 
     62   { 
     63        bool ok; 
     64        int idnum = listViewSysUpdates->currentItem()->text(1).toInt(&ok);         
     65        emit signalOpenSysDetails(idnum); 
     66   } 
    4067} 
    4168 
     
    94121void systemUpdater::slotConfigChanged() 
    95122{ 
    96   emit signalConfigChanged(); 
     123  if (! disableConfUpdates ) 
     124  { 
     125    emit signalConfigChanged(); 
     126  } 
    97127} 
    98128 
     
    405435    emit signalCheckPBIUpdatesClicked(); 
    406436} 
     437 
     438// Set if we are using a custom TmpDir 
     439void systemUpdater::setUseCustomTmp( bool enabled ) 
     440{ 
     441    checkTMPDIR->setChecked(enabled); 
     442    lineTMPDIR->setEnabled(enabled);  
     443    pushTMPDIR->setEnabled(enabled);  
     444} 
     445 
     446// Set the custom Tmpdir being used 
     447void systemUpdater::setUseCustomDirName( QString tmpdir ) 
     448{ 
     449    lineTMPDIR->setText(tmpdir); 
     450} 
     451 
     452// Set Proxy Usage 
     453void systemUpdater::setUseProxy( bool enabled ) 
     454{ 
     455    checkProxy->setChecked(enabled); 
     456    groupProxySettings->setEnabled(enabled); 
     457} 
     458 
     459// Set the Proxy being used 
     460void systemUpdater::setUseProxySettings( QString proxyURL, int portnum ) 
     461{ 
     462    lineProxyServer->setText(proxyURL); 
     463    spinProxyPort->setValue(portnum); 
     464} 
     465 
     466 
     467bool systemUpdater::getCustomTmpEnabled() 
     468{ 
     469   return checkTMPDIR->isChecked(); 
     470} 
     471 
     472 
     473QString systemUpdater::getCustomTmpDir() 
     474{ 
     475   return lineTMPDIR->text(); 
     476} 
     477 
     478bool systemUpdater::getProxyEnabled() 
     479{ 
     480   return checkProxy->isChecked(); 
     481} 
     482 
     483 
     484QString systemUpdater::getProxyUrl() 
     485{ 
     486   return lineProxyServer->text(); 
     487} 
     488 
     489int systemUpdater::getProxyPort() 
     490{ 
     491  return spinProxyPort->value(); 
     492} 
     493 
     494 
     495void systemUpdater::slotCustomTmpClicked() 
     496{ 
     497    if ( checkTMPDIR->isChecked() ) 
     498    { 
     499        lineTMPDIR->setEnabled(true);  
     500        pushTMPDIR->setEnabled(true);  
     501    } else { 
     502        lineTMPDIR->setEnabled(false);  
     503        pushTMPDIR->setEnabled(false);  
     504    } 
     505 
     506    slotConfigChanged(); 
     507} 
     508 
     509void systemUpdater::slotProxyClicked() 
     510{ 
     511    if ( checkProxy->isChecked() ) 
     512    { 
     513        groupProxySettings->setEnabled(true); 
     514    } else { 
     515        groupProxySettings->setEnabled(false); 
     516    } 
     517 
     518    slotConfigChanged(); 
     519} 
     520 
     521void systemUpdater::slotSelectCustomTmp() 
     522{ 
     523 
     524   QString newDir = QFileDialog::getExistingDirectory( 
     525                    "/", 
     526                    this, 
     527                    tr("Select Temp directory"), 
     528                    tr("Select Temp directory"), 
     529                    TRUE ); 
     530      
     531     // Check if the user just hit cancel 
     532     if ( newDir.isEmpty() ) 
     533     { 
     534        return;  
     535     } 
     536 
     537   lineTMPDIR->setText(newDir); 
     538 
     539} 
     540 
     541void systemUpdater::slotDisableConfUpdates(bool status) 
     542{ 
     543   // Set if we need to ignore updating the conf file, because a conf load is taking place 
     544   disableConfUpdates = status; 
     545} 
     546 
     547 
     548// Launches the kcmshell4 proxy command to allow the user to modify proxy settings 
     549void systemUpdater::slotConfigKDEProxy() 
     550{ 
     551   emit signalLaunchKDEProxy(); 
     552} 
  • pcbsd/trunk/SystemUpdater/SystemUpdater.h

    r2780 r2940  
    3030public slots: 
    3131    void programInit(); 
     32    void slotViewDetailsClicked(); 
    3233    void slotClose(); 
    3334    void slotUserClickedCheckSysUpdates(); 
     
    5354    void clearPBIList(); 
    5455    void setRunAtStartupConfig( bool enabled ); 
     56    void setUseCustomTmp( bool enabled ); 
     57    void setUseCustomDirName( QString tmpdir ); 
     58    void setUseProxy( bool enabled ); 
     59    void setUseProxySettings( QString proxyURL, int portnum ); 
    5560    bool getStartupConfig(); 
     61    bool getCustomTmpEnabled(); 
     62    QString getCustomTmpDir(); 
     63    bool getProxyEnabled(); 
     64    QString getProxyUrl(); 
     65    int getProxyPort(); 
    5666    void slotRescanPBIUpdatesClicked(); 
    57  
    58  
     67    void slotDisableConfUpdates(bool status); 
    5968 
    6069private slots: 
     70    void slotCustomTmpClicked(); 
     71    void slotProxyClicked(); 
     72    void slotSelectCustomTmp(); 
     73    void slotConfigKDEProxy(); 
    6174 
    6275private: 
     
    6578  QString standAlone[150]; 
    6679  QString reboot[150]; 
     80  bool disableConfUpdates; 
    6781 
    6882 
     
    7589    void signalUpdatePBI(); 
    7690    void signalCheckPBIUpdatesClicked(); 
     91    void signalLaunchKDEProxy(); 
    7792} ; 
    7893#endif // SYSTEMUPDATER_H 
  • pcbsd/trunk/SystemUpdater/SystemUpdater.qrc

    r2131 r2940  
    11<RCC> 
    22  <qresource> 
     3    <file>folder.png</file> 
    34    <file>sysupdater.png</file> 
    45  </qresource> 
    56</RCC> 
    6  
  • pcbsd/trunk/SystemUpdater/SystemUpdater.ui

    r2131 r2940  
    66    <x>0</x> 
    77    <y>0</y> 
    8     <width>542</width> 
    9     <height>353</height> 
     8    <width>596</width> 
     9    <height>508</height> 
    1010   </rect> 
    1111  </property> 
     
    7575     </property> 
    7676     <widget class="QWidget" name="Widget8" > 
    77       <property name="geometry" > 
    78        <rect> 
    79         <x>0</x> 
    80         <y>0</y> 
    81         <width>524</width> 
    82         <height>275</height> 
    83        </rect> 
    84       </property> 
    8577      <attribute name="title" > 
    8678       <string>System Updates</string> 
     
    10799         <item> 
    108100          <layout class="QGridLayout" > 
    109            <item row="1" column="0" colspan="2" > 
     101           <item row="1" column="0" colspan="3" > 
    110102            <widget class="Q3ListView" name="listViewSysUpdates" > 
    111103             <property name="sizePolicy" > 
     
    151143            </widget> 
    152144           </item> 
    153            <item row="0" column="0" colspan="2" > 
     145           <item row="0" column="0" colspan="3" > 
    154146            <widget class="QLabel" name="textLabel6" > 
    155147             <property name="sizePolicy" > 
     
    170162            </widget> 
    171163           </item> 
    172            <item row="2" column="1" > 
     164           <item row="2" column="2" > 
    173165            <spacer name="spacer2" > 
    174166             <property name="orientation" > 
     
    190182             <property name="text" > 
    191183              <string>Select All</string> 
     184             </property> 
     185            </widget> 
     186           </item> 
     187           <item row="2" column="1" > 
     188            <widget class="QPushButton" name="pushDetails" > 
     189             <property name="text" > 
     190              <string>View Details</string> 
    192191             </property> 
    193192            </widget> 
     
    329328     </widget> 
    330329     <widget class="QWidget" name="Widget9" > 
    331       <property name="geometry" > 
    332        <rect> 
    333         <x>0</x> 
    334         <y>0</y> 
    335         <width>524</width> 
    336         <height>275</height> 
    337        </rect> 
    338       </property> 
    339330      <attribute name="title" > 
    340331       <string>PBI Updates</string> 
     
    577568     </widget> 
    578569     <widget class="QWidget" name="TabPage" > 
    579       <property name="geometry" > 
    580        <rect> 
    581         <x>0</x> 
    582         <y>0</y> 
    583         <width>524</width> 
    584         <height>275</height> 
    585        </rect> 
    586       </property> 
    587570      <attribute name="title" > 
    588571       <string>Configuration</string> 
    589572      </attribute> 
    590       <layout class="QVBoxLayout" > 
    591        <item> 
     573      <layout class="QGridLayout" name="gridLayout_2" > 
     574       <item row="0" column="0" > 
    592575        <widget class="QCheckBox" name="checkSystemUpdatesConfig" > 
    593576         <property name="text" > 
     
    596579        </widget> 
    597580       </item> 
    598        <item> 
     581       <item row="1" column="0" > 
    599582        <widget class="QCheckBox" name="checkPBIUpdatesConfig" > 
    600583         <property name="text" > 
     
    603586        </widget> 
    604587       </item> 
    605        <item> 
     588       <item row="2" column="0" > 
    606589        <widget class="QCheckBox" name="checkRunAtStartup" > 
    607590         <property name="text" > 
     
    610593        </widget> 
    611594       </item> 
    612        <item> 
     595       <item row="3" column="0" > 
     596        <layout class="QHBoxLayout" name="horizontalLayout" > 
     597         <item> 
     598          <widget class="QCheckBox" name="checkTMPDIR" > 
     599           <property name="text" > 
     600            <string>Specify custom temporary directory</string> 
     601           </property> 
     602          </widget> 
     603         </item> 
     604         <item> 
     605          <spacer name="horizontalSpacer" > 
     606           <property name="orientation" > 
     607            <enum>Qt::Horizontal</enum> 
     608           </property> 
     609           <property name="sizeType" > 
     610            <enum>QSizePolicy::Minimum</enum> 
     611           </property> 
     612           <property name="sizeHint" stdset="0" > 
     613            <size> 
     614             <width>40</width> 
     615             <height>20</height> 
     616            </size> 
     617           </property> 
     618          </spacer> 
     619         </item> 
     620         <item> 
     621          <widget class="QLineEdit" name="lineTMPDIR" > 
     622           <property name="readOnly" > 
     623            <bool>true</bool> 
     624           </property> 
     625          </widget> 
     626         </item> 
     627         <item> 
     628          <widget class="QPushButton" name="pushTMPDIR" > 
     629           <property name="sizePolicy" > 
     630            <sizepolicy vsizetype="Fixed" hsizetype="Fixed" > 
     631             <horstretch>0</horstretch> 
     632             <verstretch>0</verstretch> 
     633            </sizepolicy> 
     634           </property> 
     635           <property name="minimumSize" > 
     636            <size> 
     637             <width>28</width> 
     638             <height>28</height> 
     639            </size> 
     640           </property> 
     641           <property name="maximumSize" > 
     642            <size> 
     643             <width>28</width> 
     644             <height>28</height> 
     645            </size> 
     646           </property> 
     647           <property name="text" > 
     648            <string/> 
     649           </property> 
     650           <property name="icon" > 
     651            <iconset resource="SystemUpdater.qrc" > 
     652             <normaloff>:/folder.png</normaloff>:/folder.png</iconset> 
     653           </property> 
     654           <property name="iconSize" > 
     655            <size> 
     656             <width>20</width> 
     657             <height>20</height> 
     658            </size> 
     659           </property> 
     660          </widget> 
     661         </item> 
     662        </layout> 
     663       </item> 
     664       <item row="4" column="0" > 
     665        <widget class="QCheckBox" name="checkProxy" > 
     666         <property name="text" > 
     667          <string>Specify proxy for update check</string> 
     668         </property> 
     669        </widget> 
     670       </item> 
     671       <item row="5" column="0" > 
     672        <widget class="QGroupBox" name="groupProxySettings" > 
     673         <property name="title" > 
     674          <string>Proxy Settings</string> 
     675         </property> 
     676         <layout class="QGridLayout" name="gridLayout" > 
     677          <item row="0" column="0" > 
     678           <layout class="QHBoxLayout" name="horizontalLayout_2" > 
     679            <item> 
     680             <widget class="QLabel" name="label" > 
     681              <property name="text" > 
     682               <string>Proxy Server</string> 
     683              </property> 
     684             </widget> 
     685            </item> 
     686            <item> 
     687             <widget class="QLineEdit" name="lineProxyServer" /> 
     688            </item> 
     689            <item> 
     690             <widget class="QLabel" name="label_2" > 
     691              <property name="text" > 
     692               <string>Port</string> 
     693              </property> 
     694             </widget> 
     695            </item> 
     696            <item> 
     697             <widget class="QSpinBox" name="spinProxyPort" > 
     698              <property name="maximum" > 
     699               <number>9999</number> 
     700              </property> 
     701              <property name="value" > 
     702               <number>8080</number> 
     703              </property> 
     704             </widget> 
     705            </item> 
     706           </layout> 
     707          </item> 
     708         </layout> 
     709        </widget> 
     710       </item> 
     711       <item row="6" column="0" > 
     712        <layout class="QHBoxLayout" name="horizontalLayout_3" > 
     713         <item> 
     714          <spacer name="horizontalSpacer_2" > 
     715           <property name="orientation" > 
     716            <enum>Qt::Horizontal</enum> 
     717           </property> 
     718           <property name="sizeHint" stdset="0" > 
     719            <size> 
     720             <width>40</width> 
     721             <height>20</height> 
     722            </size> 
     723           </property> 
     724          </spacer> 
     725         </item> 
     726         <item> 
     727          <widget class="QPushButton" name="pushConfigProxy" > 
     728           <property name="text" > 
     729            <string>Configure Download Proxy</string> 
     730           </property> 
     731          </widget> 
     732         </item> 
     733         <item> 
     734          <spacer name="horizontalSpacer_3" > 
     735           <property name="orientation" > 
     736            <enum>Qt::Horizontal</enum> 
     737           </property> 
     738           <property name="sizeHint" stdset="0" > 
     739            <size> 
     740             <width>40</width> 
     741             <height>20</height> 
     742            </size> 
     743           </property> 
     744          </spacer> 
     745         </item> 
     746        </layout> 
     747       </item> 
     748       <item row="7" column="0" > 
    613749        <spacer name="spacer8" > 
    614750         <property name="orientation" > 
     
    626762        </spacer> 
    627763       </item> 
    628        <item> 
     764       <item row="8" column="0" > 
    629765        <spacer name="spacer9" > 
    630766         <property name="orientation" > 
  • pcbsd/trunk/SystemUpdater/UpdaterTray.cpp

    r2908 r2940  
    3434#define  UPDATE_MSEC 1000 * 60 * 60 * 12 
    3535 
    36  
     36/* Change this to switch the default patch tmpdir */ 
     37#define  PATCHTMPDIR_DEFAULT "/usr/local/tmp" 
    3738 
    3839 
     
    137138  // If the user wants to view details about a particular update 
    138139  connect( SystemUpdaterDialog, SIGNAL(signalOpenSysDetails(int)), this, SLOT(slotOpenSysDetails(int) ) ); 
     140  connect( SystemUpdaterDialog, SIGNAL(signalLaunchKDEProxy()), this, SLOT(slotLaunchKDEProxyConfig() ) ); 
    139141 
    140142  // Signal if the user wants to start a system update 
     
    154156  
    155157 
    156 // Get the username of the person running X 
     158  // Get the username of the person running X 
    157159  username = getlogin(); 
    158  
    159160 
    160161  // Set the tray icon that we are checking for updates 
     
    247248  getUpdatesDir->addArgument( "sh"); 
    248249  getUpdatesDir->addArgument( "/PCBSD/SystemUpdater/bin/getUpdatesDir.sh"); 
     250  if ( useProxyServer ) 
     251  { 
     252     QString proxyArgPort; 
     253     proxyArgPort.setNum(proxyServerPort); 
     254 
     255     QString proxyArgUrl = proxyServerUrl; 
     256 
     257     // Check if we need to remove a http:// 
     258     if ( proxyServerUrl.indexOf("http://") == 0 ) 
     259     { 
     260        proxyArgUrl.remove(0, 7); 
     261     } 
     262 
     263     getUpdatesDir->addArgument( proxyArgUrl + ":" + proxyArgPort ); 
     264 
     265  } else { 
     266     getUpdatesDir->addArgument( "DISABLE" ); 
     267  } 
    249268 
    250269  // Connect the exited signal and start the process 
     
    252271  //connect( SetupScript, SIGNAL(readyReadStdout()), this, SLOT(readyReadScriptOutput2() ) ); 
    253272  if ( ! getUpdatesDir->start() ) { 
    254         QMessageBox::information( this->contextMenu(), tr("Error!"), tr("Error running updates1 script! "), QMessageBox::Ok ); 
     273        QMessageBox::information( 0, tr("Error!"), tr("Error running updates1 script! "), QMessageBox::Ok ); 
    255274  } 
    256275 
     
    269288  if ( getUpdatesDir->exitStatus() != 0 ) 
    270289  { 
    271         QMessageBox::warning( this->contextMenu(), tr("Update Error!"), tr("Could not contact the PC-BSD update server!"), QMessageBox::Ok ); 
     290        QMessageBox::warning( 0, tr("Update Error!"), tr("Could not contact the PC-BSD update server! Please check your internet connection or proxy settings under 'configure'"), QMessageBox::Ok ); 
    272291  }  
    273292 
     
    280299  connect( readSysUpdates, SIGNAL(processExited()), this, SLOT(slotReadSystemUpdates() ) ); 
    281300  if ( ! readSysUpdates->start() ) { 
    282         QMessageBox::information( this->contextMenu(), tr("Error!"), tr("Error running updates2 script! "), QMessageBox::Ok ); 
     301        QMessageBox::information( 0, tr("Error!"), tr("Error running updates2 script! "), QMessageBox::Ok ); 
    283302  } 
    284303 
     
    644663 
    645664 
    646  
    647   
    648  
    649  
    650  
    651665  // Check if the user wants to check for PBI updates and save it  
    652666  bool enablePBICheck = SystemUpdaterDialog->getPBIUpdateConfig(); 
     
    662676  checkPBIUpdatesFrequently = enablePBICheck; 
    663677 
    664 } 
    665  
    666  
    667  
    668  
    669  
    670  
     678 
     679  // Check if the user has enabled a custom tmpdir  
     680  useCustomTmpDir = SystemUpdaterDialog->getCustomTmpEnabled();   
     681  settings.writeEntry( "/PC-BSD/SystemUpdater/useCustomTmpDir", useCustomTmpDir ); 
     682 
     683  // Load the custom tmpdir string 
     684  customTmpDir = SystemUpdaterDialog->getCustomTmpDir(); 
     685  settings.writeEntry( "/PC-BSD/SystemUpdater/customTmpDir", customTmpDir ); 
     686 
     687  useProxyServer = SystemUpdaterDialog->getProxyEnabled(); 
     688  settings.setValue( "/PC-BSD/SystemUpdater/useProxyServer", useProxyServer ); 
     689  
     690  proxyServerUrl = SystemUpdaterDialog->getProxyUrl(); 
     691  settings.setValue( "/PC-BSD/SystemUpdater/proxyServerUrl", proxyServerUrl ); 
     692 
     693  proxyServerPort = SystemUpdaterDialog->getProxyPort(); 
     694  settings.setValue( "/PC-BSD/SystemUpdater/proxyServerPort", proxyServerPort ); 
     695 
     696 
     697} 
    671698 
    672699void UpdaterTray::loadUpdaterPrefs() { 
    673700  // Load the user preferences for the System Updater 
     701  bool ok; 
    674702  QSettings settings; 
    675   //settings.setPath( "PC-BSD", "SystemUpdater" ); 
     703   
     704  // Disable updating the conf file until we are done loading it 
     705  SystemUpdaterDialog->slotDisableConfUpdates(true); 
    676706 
    677707  bool enableSysCheck = settings.readBoolEntry( "/PC-BSD/SystemUpdater/CheckSysUpdatesConfig", TRUE ); 
     
    679709  checkSysUpdatesFrequently = enableSysCheck; 
    680710   
    681  
    682711  bool enablePBICheck = settings.readBoolEntry( "/PC-BSD/SystemUpdater/CheckPBIUpdatesConfig", TRUE ); 
    683712  SystemUpdaterDialog->setPBIUpdateConfig(enablePBICheck); 
     
    688717  contextMenu()->setItemChecked ( 6, enableStartup ); 
    689718 
    690 } 
    691  
    692  
    693  
    694  
    695  
     719  // Check if we are using a custom tmpdir 
     720  useCustomTmpDir = settings.readBoolEntry( "/PC-BSD/SystemUpdater/useCustomTmpDir", false ); 
     721  SystemUpdaterDialog->setUseCustomTmp( useCustomTmpDir ); 
     722 
     723  // Load a custom tmpdir 
     724  customTmpDir= PATCHTMPDIR_DEFAULT; 
     725  customTmpDir = settings.value("/PC-BSD/SystemUpdater/customTmpDir", customTmpDir).toString(); 
     726  SystemUpdaterDialog->setUseCustomDirName( customTmpDir ); 
     727   
     728  // Load if the user wants to use a proxy server 
     729  useProxyServer = settings.readBoolEntry( "/PC-BSD/SystemUpdater/useProxyServer", false ); 
     730  SystemUpdaterDialog->setUseProxy( useProxyServer ); 
     731   
     732  // Load Proxy Server Settings 
     733  proxyServerUrl = settings.value( "/PC-BSD/SystemUpdater/proxyServerUrl" ).toString(); 
     734 
     735  settings.value("/PC-BSD/SystemUpdater/proxyServerPort").toInt(&ok); 
     736  if ( ok ) { 
     737     proxyServerPort = settings.value( "/PC-BSD/SystemUpdater/proxyServerPort").toInt(&ok); 
     738  } else { 
     739     proxyServerPort = 8080; 
     740  } 
     741  SystemUpdaterDialog->setUseProxySettings( proxyServerUrl, proxyServerPort ); 
     742 
     743  SystemUpdaterDialog->slotDisableConfUpdates(false); 
     744 
     745} 
    696746 
    697747 
     
    700750  slotStartUpdateCheck(); 
    701751} 
    702  
    703  
    704  
    705  
    706752 
    707753 
     
    794840    bool ok; 
    795841 
     842   // Lets set the patch tmpdir variable now 
     843   if ( useCustomTmpDir ) 
     844   { 
     845     patchTmpDir = customTmpDir; 
     846   } else { 
     847     patchTmpDir = PATCHTMPDIR_DEFAULT; 
     848   } 
     849 
     850   // Make sure this tmpdir exists 
     851   system("mkdir -p '" + patchTmpDir + "' >/dev/null 2>/dev/null"); 
     852 
     853 
    796854 
    797855    // Get the output of the .df command 
    798     command = "df -m | grep -v '^devfs' | grep -v 'linprocfs' | grep -v '^Filesystem' | grep -v ' /tmp' > /PCBSD/tmp/.dfoutput"; 
     856    command = "df -m | grep -v '^devfs' | grep -v 'linprocfs' | grep -v '^Filesystem' | grep -v ' /proc' | grep -v ' /tmp' > '" + patchTmpDir + "/.dfoutput'"; 
    799857    FILE *filecmd = popen(command,"r");  
    800858    pclose(filecmd); 
     
    816874    i = 0; 
    817875    // Open our df file, and read it line-by-line 
    818     QFile file( "/PCBSD/tmp/.dfoutput" ); 
     876    QFile file( patchTmpDir + "/.dfoutput" ); 
    819877    if ( file.open( IO_ReadOnly ) ) { 
    820878        QTextStream stream( &file ); 
     
    823881             CheckDFParts[i] =  tmp.simplifyWhiteSpace(); 
    824882 
    825             //QMessageBox::critical( this->contextMenu(), tr("DF"), "Read Line:" + CheckDFParts[i], QMessageBox::Ok); 
     883            //QMessageBox::critical( 0, tr("DF"), "Read Line:" + CheckDFParts[i], QMessageBox::Ok); 
    826884            i++; 
    827885        } 
    828886        // Make sure the last in our array is empty 
    829887        CheckDFParts[i]=""; 
     888        file.close(); 
     889        file.remove(); 
    830890    } 
    831891 
    832892 
    833     installLoc = "/PCBSD/tmp"; 
     893    if ( useCustomTmpDir ) 
     894    { 
     895       installLoc = customTmpDir; 
     896    } else { 
     897       installLoc = PATCHTMPDIR_DEFAULT; 
     898    } 
    834899 
    835900    // Now determine which partition we have selected 
     
    864929        { 
    865930            // Not enough room, warn the user how much they will need 
    866             QMessageBox::critical( this->contextMenu(), tr("System Updater"), tr("Error: Not enough free disk space for these updates! You will need " + tmp.setNum(progSize) + "MB to install the selected updates"), QMessageBox::Ok ); 
     931            QMessageBox::critical( 0, tr("System Updater"), tr("Error: Not enough free disk space for these updates! You will need " + tmp.setNum(progSize) + "MB to install the selected updates. Please select a different partition or free up some space to continue."), QMessageBox::Ok ); 
    867932            return; 
    868933        } else { 
     
    872937 
    873938    } else { 
    874         QMessageBox::critical( this->contextMenu(), tr("ERROR:"), tr("Error determining remaining disk space!"), QMessageBox::Ok); 
     939        QMessageBox::critical( 0, tr("ERROR:"), tr("Error determining remaining disk space!"), QMessageBox::Ok); 
    875940    } 
    876941 
     
    890955void UpdaterTray::slotStartSystemUpdate() 
    891956{ 
    892    // The user is ready to start some system updates 
     957  // The user is ready to start some system updates 
     958   
     959 
     960  // Lets set the patch tmpdir variable now 
     961  if ( useCustomTmpDir ) 
     962  { 
     963    patchTmpDir = customTmpDir; 
     964  } else { 
     965    patchTmpDir = PATCHTMPDIR_DEFAULT; 
     966  } 
     967 
     968  // Make sure this tmpdir exists 
     969  system("mkdir -p '" + patchTmpDir + "' >/dev/null 2>/dev/null");  
    893970   
    894971  // Change the program status and update the tray icon 
     
    9451022    UpdaterStatusDialog->show(); 
    9461023 
    947     QMessageBox::warning( this->contextMenu(), tr("Online Update"), tr("One or more updates will require a reboot. You will be prompted to restart after the update is finished."), QMessageBox::Ok ); 
     1024    QMessageBox::warning( 0, tr("Online Update"), tr("One or more updates will require a reboot. You will be prompted to restart after the update is finished."), QMessageBox::Ok ); 
    9481025    requiresSysReboot = 1; 
    9491026 } 
     
    9651042void UpdaterTray::slotDownloadSysUpdate() 
    9661043{ 
    967    QString status, id, tmp; 
     1044   QString status, id, tmp, command; 
    9681045   bool startNewDownload = false, ok; 
    9691046   int getNextItem = 0; 
     
    10541131   UpdaterStatusDialog->setLabelSysUpdateStatus(status); 
    10551132 
    1056     UpdaterStatusDialog->setProgressTotalSteps(100); 
     1133   UpdaterStatusDialog->setProgressTotalSteps(100); 
     1134    
     1135   command = "rm '" + patchTmpDir + "/patch" + tmp.setNum(currentSysWorkingItem) + ".lzma'"; 
     1136   FILE *file = popen(command,"r");  
     1137   pclose(file); 
    10571138 
    10581139    // Make sure that any old patch is removed first 
    1059     QFile tmpfile("/PCBSD/tmp/patch" + tmp.setNum(currentSysWorkingItem) + ".lzma"); 
     1140    QFile tmpfile( patchTmpDir + "/patch" + tmp.setNum(currentSysWorkingItem) + ".lzma"); 
    10601141    if ( tmpfile.exists() ) 
    10611142    { 
    10621143      tmpfile.remove(); 
    10631144    } 
    1064       
    1065     copyJob = KIO::copy(SysUpdateURL[currentSysWorkingItem], "/PCBSD/tmp/patch" + tmp.setNum(currentSysWorkingItem) + ".lzma", KIO::HideProgressInfo); 
     1145 
     1146 
     1147    copyJob = KIO::copy(SysUpdateURL[currentSysWorkingItem], patchTmpDir + "/patch" + tmp.setNum(currentSysWorkingItem) + ".lzma", KIO::HideProgressInfo); 
    10661148     
    10671149    connect(copyJob, SIGNAL(totalSize(KJob*, qulonglong)), UpdaterStatusDialog, SLOT(slotJobUpdateTotalSize( KJob*, qulonglong))); 
     
    10791161    QString tmp; 
    10801162 
    1081     // This function starts the internal checksum to ensure the PBI is intact 
     1163    // This function starts the internal checksum to ensure the update is intact 
    10821164 
    10831165    tmp = tr("Checking data integrity..."); 
     
    10851167 
    10861168    // Make the checksum.sh script now 
    1087     QFile file4( "/PCBSD/tmp/.syschecksum.sh" ); 
     1169    QFile file4( patchTmpDir + "/.syschecksum.sh" ); 
    10881170    if ( file4.open( IO_WriteOnly ) ) { 
    10891171        QTextStream stream4( &file4 ); 
    1090         stream4 << "cat /PCBSD/tmp/patch" + tmp.setNum(currentSysWorkingItem) + ".lzma | md5 >&1"; 
     1172        stream4 << "cat '" + patchTmpDir + "/patch" + tmp.setNum(currentSysWorkingItem) + ".lzma' | md5 >&1"; 
    10911173        file4.close(); 
    10921174    } 
     
    10941176    checksumProc = new Q3Process( this ); 
    10951177    checksumProc->addArgument( "sh" ); 
    1096     checksumProc->addArgument( "/PCBSD/tmp/.syschecksum.sh" ); 
     1178    checksumProc->addArgument( patchTmpDir + "/.syschecksum.sh" ); 
    10971179    //connect( checksumProc, SIGNAL(processExited()), this, SLOT( slotChecksumFinished() ) ); 
    10981180    connect( checksumProc, SIGNAL(readyReadStdout()), this, SLOT(slotReadSysMD5() ) ); 
    10991181    if ( !checksumProc->start() ) { 
    1100       QMessageBox::information( this->contextMenu(), tr("Error!"), tr("Error running internal checksum Script! "), QMessageBox::Ok ); 
     1182      QMessageBox::information( 0, tr("Error!"), tr("Error running internal checksum Script! "), QMessageBox::Ok ); 
    11011183    } 
    11021184 
     
    11241206 
    11251207       // Remove the bad patch 
    1126        command = "rm /PCBSD/tmp/patch" + tmp.setNum(currentSysWorkingItem) + ".lzma "; 
     1208       command = "rm '" + patchTmpDir + "/patch" + tmp.setNum(currentSysWorkingItem) + ".lzma'"; 
    11271209       FILE *file = popen(command,"r");  
    11281210       pclose(file); 
     
    11341216           UpdaterStatusDialog->show(); 
    11351217 
    1136            QMessageBox::critical( this->contextMenu(), tr("Online Update"), tr("An error occured while downloading. Please check your connection or try again later."), QMessageBox::Ok ); 
     1218           QMessageBox::critical( 0, tr("Online Update"), tr("An error occured while downloading. Please check your connection or try again later."), QMessageBox::Ok ); 
    11371219 
    11381220           if ( UpdaterStatusDialog->isShown() ) 
     
    12161298        if ( requiresSysReboot == 1)  
    12171299        { 
    1218            QMessageBox::information( this->contextMenu(), tr("Online Update"), tr("Updates successfully installed! Your system will need to reboot to finish."), QMessageBox::Ok); 
     1300           QMessageBox::information( 0, tr("Online Update"), tr("Updates successfully installed! Your system will need to reboot to finish."), QMessageBox::Ok); 
    12191301        } else { 
    12201302           QMessageBox::information( 0, tr("Online Update"), tr("Updates successfully installed!"), QMessageBox::Ok ); 
     
    12491331 
    12501332 
    1251     // Make the checksum.sh script now 
    1252     QFile file4( "/PCBSD/tmp/.extractsys.sh" ); 
     1333    // Make the extract script now 
     1334    QFile file4( patchTmpDir + "/.extractsys.sh" ); 
    12531335    if ( file4.open( IO_WriteOnly ) ) { 
    12541336        QTextStream stream4( &file4 ); 
    12551337        stream4 << "#!/bin/sh\n"; 
    1256         stream4 << "mkdir -p /PCBSD/tmp/patch" + tmp.setNum(currentSysWorkingItem); 
    1257         stream4 << "\necho \"" + SysUpdatePatchFile[currentSysWorkingItem] + "\" > /PCBSD/tmp/patch" + tmp.setNum(currentSysWorkingItem) +"/patchFile\n"; 
    1258         stream4 << "lzma -so d /PCBSD/tmp/patch" + tmp.setNum(currentSysWorkingItem) + ".lzma | tar xvC /PCBSD/tmp/patch" + tmp.setNum(currentSysWorkingItem) + " -f - >&1"; 
     1338        stream4 << "mkdir -p '" + patchTmpDir + "/patch" + tmp.setNum(currentSysWorkingItem) + "'\n"; 
     1339        stream4 << "echo \"" + SysUpdatePatchFile[currentSysWorkingItem] + "\" > '" + patchTmpDir + "/patch" + tmp.setNum(currentSysWorkingItem) +"/patchFile'\n"; 
     1340        stream4 << "lzma -so d '" + patchTmpDir + "/patch" + tmp.setNum(currentSysWorkingItem) + ".lzma' | tar xvC '" + patchTmpDir + "/patch" + tmp.setNum(currentSysWorkingItem) + "' -f - >&1"; 
    12591341        file4.close(); 
    12601342    } 
     
    12631345    extractProc = new Q3Process( this ); 
    12641346    extractProc->addArgument( "sh" ); 
    1265     extractProc->addArgument( "/PCBSD/tmp/.extractsys.sh" ); 
     1347    extractProc->addArgument( patchTmpDir + "/.extractsys.sh" ); 
    12661348 
    12671349    connect( extractProc, SIGNAL(processExited()), this, SLOT(slotSysExtractFinished() ) ); 
     
    12711353                UpdaterStatusDialog->show(); 
    12721354 
    1273                 QMessageBox::critical( this->contextMenu(), tr("Online Update"), tr("An error occured while extracting. Please try again later."), QMessageBox::Ok ); 
     1355                QMessageBox::critical( 0, tr("Online Update"), tr("An error occured while extracting. Please try again later."), QMessageBox::Ok ); 
    12741356                if ( UpdaterStatusDialog->isShown() ) 
    12751357                { 
     
    12941376 
    12951377    // Make the checksum.sh script now 
    1296     QFile file4( "/PCBSD/tmp/.installsys.sh" ); 
     1378    QFile file4( patchTmpDir + "/.installsys.sh" ); 
    12971379    if ( file4.open( IO_WriteOnly ) ) { 
    12981380        QTextStream stream4( &file4 ); 
    12991381        stream4 << "#!/bin/sh\n"; 
    1300         stream4 << "rm /PCBSD/tmp/patch" + tmp.setNum(currentSysWorkingItem) + ".lzma\n\n"; 
    1301         stream4 << "cd /PCBSD/tmp/patch" + tmp.setNum(currentSysWorkingItem); 
    1302         stream4 << "\nPATCHDIR=\"/PCBSD/tmp/patch" + tmp.setNum(currentSysWorkingItem) + "\" ; export PATCHDIR\n"; 
    1303         stream4 << "cd $PATCHDIR\n"; 
     1382        stream4 << "rm '" + patchTmpDir + "/patch" + tmp.setNum(currentSysWorkingItem) + ".lzma'\n\n"; 
     1383        stream4 << "cd '" + patchTmpDir + "/patch" + tmp.setNum(currentSysWorkingItem) + "'\n"; 
     1384        stream4 << "PATCHDIR=\"" + patchTmpDir + "/patch" + tmp.setNum(currentSysWorkingItem) + "\" ; export PATCHDIR\n"; 
     1385        stream4 << "cd \"${PATCHDIR}\"\n"; 
    13041386        stream4 << "sh update.sh >&1 2>&1\n"; 
    13051387        stream4 << "if [ \"$?\" = \"0\" ]\n"; 
    13061388        stream4 << "then\n"; 
    13071389        stream4 << "  cp /PCBSD/SystemUpdater/system-updates/available/" + SysUpdatePatchFile[currentSysWorkingItem] + " /PCBSD/SystemUpdater/system-updates/installed/" + SysUpdatePatchFile[currentSysWorkingItem] + "\n"; 
    1308         stream4 << "  rm -rf /PCBSD/tmp/patch" + tmp.setNum(currentSysWorkingItem) + "\n"; 
    1309         stream4 << "  rm /PCBSD/tmp/.extractsys.sh\n"; 
    1310         stream4 << "  rm /PCBSD/tmp/.installsys.sh\n"; 
    1311         stream4 << "  rm /PCBSD/tmp/.syschecksum.sh\n"; 
     1390        stream4 << "  rm -rf '" + patchTmpDir + "/patch" + tmp.setNum(currentSysWorkingItem) + "'\n"; 
     1391        stream4 << "  rm '" + patchTmpDir + "/.extractsys.sh'\n"; 
     1392        stream4 << "  rm '" + patchTmpDir + "/.installsys.sh'\n"; 
     1393        stream4 << "  rm '" + patchTmpDir + "/.syschecksum.sh'\n"; 
    13121394        stream4 << "  exit 0\n"; 
    13131395        stream4 << "else\n"; 
    1314         stream4 << "  rm -rf /PCBSD/tmp/patch" + tmp.setNum(currentSysWorkingItem) + "\n"; 
    1315         stream4 << "  rm /PCBSD/tmp/.extractsys.sh\n"; 
    1316         stream4 << "  rm /PCBSD/tmp/.installsys.sh\n"; 
    1317         stream4 << "  rm /PCBSD/tmp/.syschecksum.sh\n"; 
     1396        stream4 << "  rm -rf '" + patchTmpDir + "/patch" + tmp.setNum(currentSysWorkingItem) + "'\n"; 
     1397        stream4 << "  rm '" + patchTmpDir + "/.extractsys.sh'\n"; 
     1398        stream4 << "  rm '" + patchTmpDir + "/.installsys.sh'\n"; 
     1399        stream4 << "  rm '" + patchTmpDir + "/.syschecksum.sh'\n"; 
    13181400        stream4 << "  exit 1\n"; 
    13191401        stream4 << "fi\n"; 
     
    13241406    installProc = new Q3Process( this ); 
    13251407    installProc->addArgument( "sh" ); 
    1326     installProc->addArgument( "/PCBSD/tmp/.installsys.sh" ); 
     1408    installProc->addArgument( patchTmpDir + "/.installsys.sh" ); 
    13271409 
    13281410    connect( installProc, SIGNAL(processExited()), this, SLOT(slotSysInstallFinished() ) ); 
     
    13311413     
    13321414            if ( ! installProc->start() ) { 
    1333                 QMessageBox::critical( this->contextMenu(), tr("Online Update"), tr("An error occured while installing. Please try again later."), QMessageBox::Ok ); 
     1415                QMessageBox::critical( 0, tr("Online Update"), tr("An error occured while installing. Please try again later."), QMessageBox::Ok ); 
    13341416                exit(15);        
    13351417            }  
     
    15661648  checkPBIProc->addArgument( progName ); 
    15671649  checkPBIProc->addArgument( PBIProgVer[currentWorkingPBI]  ); 
     1650 
     1651  if ( useProxyServer ) 
     1652  { 
     1653     QString proxyArgPort; 
     1654     proxyArgPort.setNum(proxyServerPort); 
     1655     
     1656     QString proxyArgUrl = proxyServerUrl; 
     1657 
     1658     // Check if we need to remove a http:// 
     1659     if ( proxyServerUrl.indexOf("http://") == 0 ) 
     1660     { 
     1661        proxyArgUrl.remove(0, 7); 
     1662     } 
     1663 
     1664     checkPBIProc->addArgument( proxyArgUrl + ":" + proxyArgPort ); 
     1665 
     1666  } else { 
     1667     checkPBIProc->addArgument( "DISABLE" ); 
     1668  } 
     1669 
    15681670 
    15691671  connect( checkPBIProc, SIGNAL(readyReadStdout()), this, SLOT(slotReadPBIStatusResults() ) ); 
     
    17011803  UpdaterStatusDialog->show(); 
    17021804 
     1805  // Lets set the patch tmpdir variable now 
     1806  if ( useCustomTmpDir ) 
     1807  { 
     1808    patchTmpDir = customTmpDir; 
     1809  } else { 
     1810    patchTmpDir = PATCHTMPDIR_DEFAULT; 
     1811  } 
     1812 
     1813  // Make sure this tmpdir exists 
     1814  system("mkdir -p '" + patchTmpDir + "' >/dev/null 2>/dev/null"); 
    17031815 
    17041816  // Get our list of PBIs ready to be updated 
     
    17651877           UpdaterStatusDialog->show(); 
    17661878           
    1767           QMessageBox::critical( this->contextMenu(), tr("Online Update"), PBIProgName[currentWorkingPBI] + ": " + tr("An error occured while downloading. Please try again later."), QMessageBox::Ok ); 
     1879          QMessageBox::critical( 0, tr("Online Update"), PBIProgName[currentWorkingPBI] + ": " + tr("An error occured while downloading. Please try again later."), QMessageBox::Ok ); 
    17681880 
    17691881          // Set the status that this failed 
     
    18651977 
    18661978    // Make sure that any old PBI is removed first 
    1867     QFile tmpfile("/PCBSD/tmp/" + tmp.setNum(currentWorkingPBI) + ".pbi"); 
     1979    system("rm '" + patchTmpDir + "/" + tmp.setNum(currentWorkingPBI) + ".pbi' >/dev/null 2>/dev/null"); 
     1980    QFile tmpfile( patchTmpDir + "/" + tmp.setNum(currentWorkingPBI) + ".pbi"); 
    18681981    if ( tmpfile.exists() ) 
    18691982    { 
    18701983      tmpfile.remove(); 
    18711984    } 
    1872       
    1873      
    1874     copyJob = KIO::copy(URL, "/PCBSD/tmp/" + tmp.setNum(currentWorkingPBI) + ".pbi", KIO::HideProgressInfo); 
     1985 
     1986    copyJob = KIO::copy(URL, patchTmpDir + "/" + tmp.setNum(currentWorkingPBI) + ".pbi", KIO::HideProgressInfo); 
    18751987     
    18761988    connect(copyJob, SIGNAL(totalSize(KJob*, qulonglong)), UpdaterStatusDialog, SLOT(slotJobUpdateTotalSize( KJob*, qulonglong))); 
     
    19212033   { 
    19222034 
    1923        if ( upgradePBIProc->exitStatus() != 0) 
     2035       if ( upgradePBIProc->exitStatus() == 255) 
    19242036       { 
    1925          QMessageBox::critical( this->contextMenu(), tr("Online Update"), tr("The updated version of " + PBIProgName[currentWorkingPBI] + " " + tr("failed the integrity check! Please try updating this PBI again later.") ), QMessageBox::Ok ); 
     2037         QMessageBox::critical( 0, tr("Online Update"), tr("The updated version of %s failed the integrity check! Please try updating this PBI again later.", PBIProgName[currentWorkingPBI] ), QMessageBox::Ok ); 
    19262038         // Update the status on the previous download to finished 
     2039         status = tr("Failed!"); 
     2040         UpdaterStatusDialog->updateStatusListBoxItem(status, id.setNum(currentWorkingPBI) ); 
     2041       } else if ( upgradePBIProc->exitStatus() == 256 ) { 
     2042          QMessageBox::critical( 0, tr("Online Update"), tr("An error occured while upgrading %s You may need to re-install this PBI manually.", PBIProgName[currentWorkingPBI]), QMessageBox::Ok ); 
    19272043         status = tr("Failed!"); 
    19282044         UpdaterStatusDialog->updateStatusListBoxItem(status, id.setNum(currentWorkingPBI) ); 
     
    19582074 
    19592075 
    1960            QMessageBox::information( this->contextMenu(), tr("Online Update"), tr("PBI Upgrades finished!"), QMessageBox::Ok ); 
     2076           QMessageBox::information( 0, tr("Online Update"), tr("PBI Upgrades finished!"), QMessageBox::Ok ); 
    19612077           if ( UpdaterStatusDialog->isShown() ) 
    19622078           { 
     
    20112127 
    20122128    // Make the checksum.sh script now 
    2013     QFile file4( "/PCBSD/tmp/.upgradepbi.sh" ); 
     2129    QFile file4( patchTmpDir + "/.upgradepbi.sh" ); 
    20142130    if ( file4.open( IO_WriteOnly ) ) { 
    20152131        QTextStream stream4( &file4 ); 
     
    20172133        stream4 << "DISPLAY="" ; export DISPLAY\n"; 
    20182134        stream4 << "\n"; 
    2019         stream4 << "MD5=\"`cat /PCBSD/tmp/" + tmp.setNum(currentWorkingPBI) + ".pbi | md5`\"\n"; 
     2135        stream4 << "MD5=\"`cat '" + patchTmpDir + "/" + tmp.setNum(currentWorkingPBI) + ".pbi' | md5`\"\n"; 
    20202136        stream4 << "if [ \"${MD5}\" != \"" + PBIProgMD5[currentWorkingPBI] + "\" ]\n"; 
    20212137        stream4 << "then\n"; 
    2022         stream4 << "  rm /PCBSD/tmp/" + tmp.setNum(currentWorkingPBI) + ".pbi\n"; 
     2138        stream4 << "  rm '" + patchTmpDir + "/" + tmp.setNum(currentWorkingPBI) + ".pbi'\n"; 
    20232139        stream4 << "  exit 255\n"; 
    20242140        stream4 << "fi\n"; 
     
    20372153        stream4 << "echo 'SETSTEPS: 2'\n"; 
    20382154        stream4 << "echo 'MSG: Installing " + NewProgDirName + "'\n"; 
    2039         stream4 << "chmod 755 /PCBSD/tmp/" + tmp.setNum(currentWorkingPBI) + ".pbi\n"; 
    2040         stream4 << "/PCBSD/tmp/" + tmp.setNum(currentWorkingPBI) + ".pbi -text -accept\n"; 
    2041         stream4 << "\n"; 
     2155        stream4 << "chmod 755 '" + patchTmpDir + "/" + tmp.setNum(currentWorkingPBI) + ".pbi'\n"; 
     2156        stream4 << "'" + patchTmpDir + "/" + tmp.setNum(currentWorkingPBI) + ".pbi' -text -accept\n"; 
     2157        stream4 << "if [ \"$?\" != \"0\" ]\n"; 
     2158        stream4 << "then\n"; 
     2159        stream4 << "  rm '" + patchTmpDir + "/" + tmp.setNum(currentWorkingPBI) + ".pbi'\n"; 
     2160        stream4 << "  rm '" + patchTmpDir + "/.upgradepbi.sh'\n"; 
     2161        stream4 << "  exit 256\n"; 
     2162        stream4 << "fi\n"; 
    20422163        stream4 << "echo 'SETSTEPS: 3'\n"; 
    20432164        stream4 << "echo 'MSG: Finished installing " + NewProgDirName + "'\n"; 
    2044         stream4 << "rm /PCBSD/tmp/" + tmp.setNum(currentWorkingPBI) + ".pbi\n"; 
     2165        stream4 << "rm '" + patchTmpDir + "/" + tmp.setNum(currentWorkingPBI) + ".pbi'\n"; 
     2166        stream4 << "rm '" + patchTmpDir + "/.upgradepbi.sh'\n"; 
     2167        stream4 << "exit 0\n"; 
    20452168        file4.close(); 
    20462169    } 
     
    20492172    upgradePBIProc = new Q3Process( this ); 
    20502173    upgradePBIProc->addArgument( "sh" ); 
    2051     upgradePBIProc->addArgument( "/PCBSD/tmp/.upgradepbi.sh" ); 
     2174    upgradePBIProc->addArgument( patchTmpDir + "/.upgradepbi.sh" ); 
    20522175 
    20532176    connect( upgradePBIProc, SIGNAL(processExited()), this, SLOT(slotStartPBIInstall() ) ); 
     
    20552178     
    20562179            if ( ! upgradePBIProc->start() ) { 
    2057                 QMessageBox::critical( this->contextMenu(), tr("Online Update"), tr("An error occured while upgrading. Please try again later."), QMessageBox::Ok ); 
     2180                QMessageBox::critical( 0, tr("Online Update"), tr("An error occured while upgrading. Please try again later."), QMessageBox::Ok ); 
    20582181                exit(15);        
    20592182            }  
    2060  
    2061  
    2062  
    20632183 
    20642184} 
     
    20762196     { 
    20772197         tmp = upgradePBIProc->readLineStdout(); 
     2198 
    20782199 
    20792200         if ( tmp.find("TOTALSTEPS:" ) == 0) 
     
    21052226 
    21062227} 
     2228 
     2229 
     2230void UpdaterTray::slotLaunchKDEProxyConfig() 
     2231{ 
     2232   QString command; 
     2233   command = "su " + username + " -c 'kcmshell4 proxy' &"; 
     2234   system(command);  
     2235} 
  • pcbsd/trunk/SystemUpdater/UpdaterTray.h

    r2600 r2940  
    5454   void slotChangeRunStartup(); 
    5555   void slotTrayActivated(QSystemTrayIcon::ActivationReason reason); 
     56   void slotLaunchKDEProxyConfig(); 
    5657    
    5758protected: 
     
    6263   void loadUpdaterPrefs(); 
    6364   void loadPatchData(QString patchFile, int patchNum); 
    64  
    6565   KJob *copyJob; 
     66   bool useCustomTmpDir; 
     67   QString customTmpDir; 
     68   bool useProxyServer; 
     69   QString proxyServerUrl; 
     70   int proxyServerPort; 
     71   QString patchTmpDir; 
    6672}; 
    6773