Changeset 0ebf4c2


Ignore:
Timestamp:
12/06/13 08:34:11 (17 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, releng/10.0, releng/10.0.1, releng/10.0.2, releng/10.0.3, releng/10.1, releng/10.1.1, releng/10.1.2
Children:
3038c71
Parents:
93032ef (diff), 74bd9cf (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of github.com:pcbsd/pcbsd

Files:
14 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/pc-updatecenter/mainwindow.cpp

    r136fa80 r72acc29  
    221221void MainWindow::globalStateChanged(CAbstractUpdateController::EUpdateControllerState new_state) 
    222222{ 
    223     refreshMenu(); 
    224  
    225     ui->RebootW->setVisible(mSysController.rebootRequired()); 
     223    refreshMenu();     
    226224 
    227225    bool isUpdatesAvail= (mSysController.currentState() == CAbstractUpdateController::eUPDATES_AVAIL) 
  • src-qt4/pc-updatecenter/pkgcontroller.cpp

    rf74a1b6 r72acc29  
    3030#include <QDebug> 
    3131#include <QFile> 
     32#include <QRegExp> 
    3233 
    3334__string_constant FULLY_UPDATED_MESSAGE = "All packages are up to date!"; 
     
    5556__string_constant PKG_NETWORK_ERROR = ": No address record"; 
    5657 
     58typedef struct 
     59{ 
     60    QString mDEName; 
     61    QStringList mPkgSet; 
     62}SDesktopCriticalPkgs; 
     63 
     64//============== This is list of packages that should cause logaut from desktop environment 
     65//TODO: Add MATE, XFCE. Check KDE and LXDE 
     66 
     67const SDesktopCriticalPkgs DESKTOP_CRITICAL_PKG[]={ 
     68{QString("kde"), QStringList()<<"kde-runtime*"<<"kde-workspace*"<<"kdebindings*"<<"kdelibs*"<<"plasma-scriptengine*"}, 
     69{QString("lxde"), QStringList()<<"lxpanel*"<<"lxde-meta*"<<"lxsession*"<<"lxde-common*"}, 
     70}; 
     71 
     72const int DESKTOP_CRITICAL_PKG_COUNT = sizeof(DESKTOP_CRITICAL_PKG) / sizeof(SDesktopCriticalPkgs); 
    5773 
    5874typedef enum{ 
     
    91107    env.insert("PCFETCHGUI","YES"); //For readable download notifications 
    92108    process().setProcessEnvironment(env); 
     109    mCurrentDEIndex=-1; 
     110 
     111    // Get current DE 
     112    pcbsd::DesktopEnvironmentInfo currDE = pcbsd::Utils::currentDesktop(); 
     113    if (currDE.Name.length()) 
     114    { 
     115        for(int i=0; i<DESKTOP_CRITICAL_PKG_COUNT; i++) 
     116        { 
     117            if (DESKTOP_CRITICAL_PKG[i].mDEName.toLower().trimmed() == currDE.Name.trimmed().toLower()) 
     118            { 
     119                mCurrentDEIndex = i; 
     120                qDebug()<<currDE.Name; 
     121                break; 
     122            } 
     123        }//for all DESKTOP_CRITICAL_PKG 
     124    }// if detected DE 
     125 
     126    misLogoffRequired= false; 
     127 
    93128} 
    94129 
     
    97132{ 
    98133    return mUpdData; 
     134} 
     135 
     136/////////////////////////////////////////////////////////////////////////////// 
     137bool CPkgController::logoffRequired() 
     138{ 
     139    return (currentState() != eUPDATING) && misLogoffRequired; 
    99140} 
    100141 
     
    349390        progress.mMessage = msg; 
    350391 
     392        // Check for lofoff required packages 
     393        if (mCurrentDEIndex>=0) 
     394        { 
     395            QRegExp rx; 
     396            rx.setPatternSyntax(QRegExp::WildcardUnix); 
     397            for (int i=0; i<DESKTOP_CRITICAL_PKG[mCurrentDEIndex].mPkgSet.size(); i++) 
     398            { 
     399                rx.setPattern(DESKTOP_CRITICAL_PKG[mCurrentDEIndex].mPkgSet[i]); 
     400                if (rx.exactMatch(pkg_name)) 
     401                { 
     402                    misLogoffRequired= true; 
     403                    qDebug()<<"Logoff required!"; 
     404                    break; 
     405                }//if match 
     406            }//for all wildcard 
     407        } 
     408 
    351409        misWasInstalation= true; 
    352410        last_message= msg; 
  • src-qt4/pc-updatecenter/pkgcontroller.h

    r08b1b75 r72acc29  
    2727 
    2828#include "updatecontroller.h" 
    29  
    3029#include <QProcess> 
    3130#include <QVector> 
     
    7877 
    7978    SUpdate updateData(); 
     79    bool    logoffRequired(); 
    8080 
    8181protected: 
     
    104104    QString mConflictList; 
    105105    QString mConflictsReply; 
     106    int     mCurrentDEIndex; 
     107    bool    misLogoffRequired; 
    106108}; 
    107109 
  • src-qt4/pc-updatecenter/rebootwidget.cpp

    r6266834 r72acc29  
    33 
    44#include <QProcess> 
     5#include <QDebug> 
     6#include "utils.h" 
     7 
     8__string_constant REBOOT_IMAGE = ":/images/system-reboot.png"; 
     9__string_constant LOGOFF_IMAGE = ":/images/system-log-out.png"; 
    510 
    611RebootWidget::RebootWidget(QWidget *parent) : 
     
    1217    mPkgController= NULL; 
    1318    mPBIController = NULL; 
     19    misReboot= false; 
     20    misLogoff = false; 
    1421} 
    1522 
     
    4855    bool is_reboot_btn = false; 
    4956    if ((!mSysController) || (!mPkgController) || (!mPBIController)) 
    50         return; 
     57        return;         
    5158 
    5259    is_reboot_btn = (mSysController->currentState() != CAbstractUpdateController::eUPDATING) 
     
    5764    ui->restartButton->setVisible(is_reboot_btn); 
    5865 
    59     bool this_visible = mSysController->rebootRequired() && (mSysController->currentState() != CAbstractUpdateController::eUPDATING); 
    60     setVisible(this_visible); 
     66    bool misReboot = mSysController->rebootRequired() && (mSysController->currentState() != CAbstractUpdateController::eUPDATING); 
     67    bool misLogoff = mPkgController->logoffRequired() && (mPkgController->currentState() != CAbstractUpdateController::eUPDATING); 
     68 
     69    setVisible((misReboot) || (misLogoff)); 
     70 
     71    if (misLogoff && (!misReboot)) 
     72    { 
     73        ui->IconLabel->setPixmap(QPixmap(LOGOFF_IMAGE)); 
     74        ui->messageLabel->setText(tr("Please re-enter to desktop environment to prevent unexpected behaviour")); 
     75    } 
     76    if (misReboot) 
     77    { 
     78        ui->IconLabel->setPixmap(QPixmap(REBOOT_IMAGE)); 
     79        ui->messageLabel->setText(tr("Your system should be restarted to finalize update")); 
     80    } 
    6181} 
  • src-qt4/pc-updatecenter/rebootwidget.h

    r6266834 r72acc29  
    3333    CPkgController* mPkgController; 
    3434    CPBIController* mPBIController; 
     35 
     36    bool            misReboot; 
     37    bool            misLogoff; 
    3538}; 
    3639 
  • src-qt4/pc-updatecenter/rebootwidget.ui

    r6266834 r72acc29  
    77    <x>0</x> 
    88    <y>0</y> 
    9     <width>546</width> 
    10     <height>44</height> 
     9    <width>544</width> 
     10    <height>42</height> 
    1111   </rect> 
    1212  </property> 
     
    4747   </item> 
    4848   <item> 
    49     <widget class="QLabel" name="label"> 
     49    <widget class="QLabel" name="messageLabel"> 
    5050     <property name="text"> 
    5151      <string>Your system should be restarted to finalize update</string> 
  • src-qt4/pc-zmanager/main.cpp

    r71c6ff1 r405636bc  
    66#include <qlocale.h> 
    77#include <qtsingleapplication.h> 
     8 
     9#include <unistd.h> 
     10#include <sys/types.h> 
    811 
    912#ifndef PREFIX 
  • src-qt4/port-files/Makefile

    r0535dca0 r13c44de  
    3939.include <bsd.port.pre.mk> 
    4040 
    41 .if ${OSVERSION} < 900030 
    42 IGNORE=         requires FreeBSD 9.0 or later 
     41.if ${OSVERSION} < 1000000 
     42IGNORE=         requires FreeBSD 10 or later 
    4343.endif 
    4444 
  • src-qt4/port-files/pkg-plist

    rba4d08f r74bd9cf  
    7171share/pcbsd/scripts/sound-dev-changed.sh 
    7272share/pcbsd/scripts/portsnap-noterm.sh 
    73 share/pcbsd/icons/update-center.pkg 
     73share/pcbsd/icons/update-center.png 
    7474share/pcbsd/icons/system-software-update.png 
    7575share/pcbsd/icons/hwinfo.png 
  • src-sh/pc-extractoverlay/pc-extractoverlay

    r04630fb ree8502c  
    107107 
    108108  # See if we need to adjust pkg.conf 
    109   grep -q "ARCH" /usr/local/etc/pkg.conf 
     109  grep -q "ARCH" /usr/local/etc/pkg.conf 2>/dev/null 
    110110  if [ $? -eq 0 ] ; then 
    111111    ARCH=`uname -m` 
  • src-sh/port-files/Makefile

    r39079340 r13c44de  
    2929.include <bsd.port.pre.mk> 
    3030 
    31 .if ${OSVERSION} < 900030 
    32 IGNORE=         requires FreeBSD 9.0 or later 
    33 .endif 
    34  
    35 .if ${OSVERSION} > 1000000 
    36 PLIST_FILES+=   share/pbi-manager/.pbime \ 
    37                 share/pbi-manager/.pbimount \ 
    38                 share/pbi-manager/.ldconfig \ 
    39                 share/pbi-manager/.mount_nullfs \ 
    40                 etc/man.d/pbi.conf \ 
    41                 sbin/app \ 
    42                 sbin/pbi 
     31.if ${OSVERSION} < 1000000 
     32IGNORE=         requires FreeBSD 10 or later 
    4333.endif 
    4434 
  • src-sh/port-files/pkg-plist

    r607b4a6 r13c44de  
    2525bin/pc-installdialog 
    2626bin/enable_user_pefs 
     27sbin/app 
     28sbin/pbi 
    2729sbin/pc-sysinstall 
    2830share/lpreserver/backend/zfsmon.sh 
     
    585587sbin/pbid 
    586588etc/pbi.conf 
     589etc/man.d/pbi.conf 
    587590etc/rc.d/pbid 
     591share/pbi-manager/.pbime 
     592share/pbi-manager/.pbimount 
     593share/pbi-manager/.ldconfig 
     594share/pbi-manager/.mount_nullfs 
    588595share/pbi-manager/.pbiwrapper-i386 
    589596share/pbi-manager/.pbiwrapper-amd64 
  • src-qt4/EasyPBI/PBIModule.cpp

    rffa2c7a r93032ef  
    1313  //Valid Scripts 
    1414  scriptValues << "pre-pbicreate.sh" << "pre-install.sh" << "post-install.sh" << "pre-remove.sh"; 
     15  //valid XDG values 
     16  xdgValues << 
     17  //valid MIME values 
     18  mimeValues <<  
    1519         
    1620  HASH.clear(); //Make sure the hash is currently empty 
     
    109113void PBIModule::loadConfig(){ 
    110114//Read the designated pbi.conf and store the variables 
    111   QFile file(basePath+"/pbi.conf"); 
    112   if( !file.open(QIODevice::ReadOnly | QIODevice::Text)){ 
    113     qDebug() << "Warning: Unable to load "+basePath+"/pbi.conf"; 
    114     return; 
    115   } 
    116   QTextStream in(&file); 
    117   while(!in.atEnd()){ 
     115  QStringList contents = readFile(basePath+"/pbi.conf"); 
     116  for(int i=0; i<contents.length(); i++){ 
    118117    //see if the current line conains a desired variable and save it 
    119     QString line = in.readLine(); 
     118    QString line = contents[i]; 
    120119    if(!line.startsWith("#") && !line.startsWith("export")){ //Ignore commented out lines 
    121120      //Pull apart the variable and the value 
    122121      QString var = line.section("=\"",0,0,QString::SectionSkipEmpty).trimmed(); 
    123122      QString val = line.section("=\"",1,50).section("#",0,0,QString::SectionSkipEmpty).section(";",0,0,QString::SectionSkipEmpty).trimmed(); 
    124         while( !val.endsWith("\"") && !in.atEnd() ){ 
    125           line = in.readLine(); 
     123        while( !val.endsWith("\"") && i<contents.length() ){ 
     124          i++; 
     125          line = contents[i]; 
    126126          val.append("\n"+line.section("#",0,0).section(";",0,0).trimmed(); 
    127127        } 
     
    134134    } 
    135135  } 
    136   file.close();  
    137136} 
    138137 
     
    218217//      RESOURCES 
    219218// ============= 
    220          
     219QStringList PBIModule::existingResources(){ 
     220  QStringList out = filesInDir(basePath+"/resources"); 
     221  return out;    
     222} 
     223 
     224bool PBIModule::addResource(QString filePath, QString resourcePath){ 
     225  if(resourcePath.isEmpty()){ 
     226    resourcePath = filePath.section("/",-1); //same file name, in the base resources dir 
     227  } 
     228  bool ok = false; 
     229  if(QFile::exists(filePath)){ 
     230    //Create an intermediary directories in the resources dir 
     231    QString rPath = basePath+"/resources/"+resourcePath.left(resourcePath.length() - resourcePath.section("/",-1).length()); 
     232    QDir dir(rPath); 
     233    if(!dir.exists()){  
     234      ok = dir.mkPath(rPath);  
     235      if(!ok){ 
     236        qDebug() << "Error: Could not create directory: "<<rPath; 
     237        return ok; 
     238      } 
     239    } 
     240    //Now check if that file already exists 
     241    if(QFile::exists(basePath+"/resources/"+resourcePath)){ 
     242      ok = QFile::remove(basePath+"/resources/"+resourcePath); //Overwrite existing file 
     243      if(!ok){ 
     244        qDebug() << "Error: Could not remove existing file: "<<basePath+"/resources/"+resourcePath; 
     245        return ok; 
     246      } 
     247    } 
     248    ok = QFile::copy(filePath, basePath+"/resources/"+resourcePath); 
     249  }else{ 
     250    qDebug() << "Error: File to add to resources does not exist: "<<filePath; 
     251  } 
     252  return ok; 
     253} 
     254 
    221255// ============= 
    222256//           XDG 
     
    227261// ============= 
    228262 
    229 // ============= 
    230 //  PRIVATE UTILITIES 
    231 // ============= 
     263// =============== 
     264//  GENERAL UTILITIES 
     265// =============== 
    232266bool PBIModule::createFile(QString fileName, QStringList contents){ 
    233267//fileName = full path to file (I.E. /home/pcbsd/junk/junk.txt) 
     
    307341  return contents; 
    308342} 
     343 
     344QStringList PBIModule::filesInDir(QString dirPath){ 
     345  //This is a recursive function for listing all the files in a directory (or subdirectories) 
     346  QStringList out; 
     347  QDir dir(dirPath); 
     348  if(dir.exists(dirPath)){ 
     349    QStringList subdirs = dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name); 
     350    out << dir.entryList(QDir::Files | QDir::NoDotAndDotDot,QDir::Name); 
     351    for(int i=0, i<subdirs.length(); i++){ 
     352      out << filesInDir(dirPath+"/"+subdirs[i]); 
     353    } 
     354  } 
     355  return out;    
     356} 
     357 
     358QStringList PBIModule::generateXDGFileContents(QString name, QString gName, QString exec, \ 
     359                QString iconResourcePath, QString mimetype, bool runAsRoot, bool invisible, \ 
     360                bool useTerminal){ 
     361  QStringList contents; 
     362  contents << "#!/usr/bin/env"; 
     363  contents << "[Desktop Entry]"; 
     364  contents << "Value=1.0"; 
     365  contents << "Type=Application"; 
     366  contents << "Name="+name; 
     367  contents << "GenericName="+gName; 
     368  if(runAsRoot){ 
     369    contents << "Exec=pc-su %%PBI_EXEDIR%%/"+exec; 
     370  }else{ 
     371    contents << "Exec=%%PBI_EXEDIR%%/"+exec; 
     372  } 
     373  contents << "Path=%%PBI_APPDIR%%"; 
     374  contents << "Icon=%%PBI_APPDIR%%/"+iconResourcePath; 
     375  contents << "StartupNotify=true"; 
     376  if(invisible){ 
     377    contents << "NoDisplay=true"; 
     378  } 
     379  if(useTerminal){ 
     380    contents << "Terminal=true"; 
     381  } 
     382  if(!mimetype.isEmpty()){ 
     383    contents << "MimeType="+mimetype; 
     384  } 
     385  return contents; 
     386} 
  • src-qt4/EasyPBI/PBIModule.h

    rffa2c7a r93032ef  
    4343         
    4444        //Resources 
    45  
     45        QStringList existingResources(); 
     46        bool addResource(QString, QString); 
     47         
    4648        //XDG files 
     49        QStringList validXdgText(); 
     50        QString xdgText(QString); 
     51        QStringList xdgTextL(QStringList); 
     52        void setXdgText(QString,QString); 
     53        void setXdgTextL(QStringList, QStringList); 
     54         
     55        QStringList validXdgEnables(); 
     56        void xdgEnabled(QString); 
     57        void setXdgEnabled(QString, bool); 
     58         
     59        QStringList listXdgDesktopFiles(); 
     60        QStringList listXdgMenuFiles(); 
     61        bool saveXdgDesktop(QString fileName); 
     62        bool saveXdgMenu(QString fileName); 
     63        bool removeXdgDesktop(QString fileName); 
     64        bool removeXdgMenu(QString fileName); 
     65        bool loadXdgDesktop(QString fileName); 
     66        bool loadXdgMenu(QString filename); 
     67         
     68        QStringList listMimeFiles(); 
     69        QStringList validMimeValues(); 
     70        QString mimeText(QString); 
     71        QStringList mimeTextL(QStringList); 
     72        void setMimeText(QString, QString); 
     73        void setMimeTextL(QStringList, QStringList); 
    4774         
    4875        //External Links 
    4976 
    5077        //General Utilities 
    51         bool createFile(QString,QStringList); 
    52         QStringList readFile(QString); 
     78        static bool createFile(QString,QStringList); 
     79        static QStringList readFile(QString); 
     80        static QStringList filesInDir(QString); 
     81        static QStringList generateXDGFileContents(QString,QString,QString,QString,QString, bool, bool, bool); 
    5382 
    5483private: 
    5584        QHash<QString, QVariant> HASH; 
    56         QStringList CTextValues, CBoolValues, CIntValues, scriptValues; 
     85        QStringList CTextValues, CBoolValues, CIntValues, scriptValues, xdgValues, mimeValues; 
    5786        QString basePath, version; 
    5887 
Note: See TracChangeset for help on using the changeset viewer.