Changeset d25fc88


Ignore:
Timestamp:
05/05/14 11:31:17 (14 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, enter/10, releng/10.0.2, releng/10.0.3, releng/10.1, releng/10.1.1, releng/10.1.2
Children:
d7d7973
Parents:
05b024a
Message:

Add a new "migrate" UI that will run instead of the main AppCafe? UI if the old PBI system is detected.

Location:
src-qt4/pc-softwaremanager
Files:
3 added
2 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/pc-softwaremanager/main.cpp

    rb6102c8 rd25fc88  
    44#include <qtsingleapplication.h> 
    55#include <QDebug> 
     6 
    67#include "mainUI.h" 
     8#include "migrateUI.h" 
     9 
    710//#include "../config.h" 
    811#ifndef PREFIX 
     
    3134    qDebug() << "Locale:" << langCode; 
    3235 
    33     MainUI w;  
    34  
    35     /*if ( argc >= 2) 
    36     { 
    37        QString chkarg = argv[1]; 
    38        // Running in a warden jail? 
    39        if ( chkarg == "-warden" ){ 
    40          if ( argc == 4 ){ 
    41            w.setWardenMode(QString(argv[2]), QString(argv[3])); 
    42          }else { 
    43            qDebug() << "Usage: -warden <directory> <ip>"; 
    44            exit(1); 
    45          } 
    46        } 
    47        // Show the installed tab? 
    48        //if ( chkarg == "-installed" ){ 
    49          //w.showInstalledTab(); 
    50        //} 
    51     }*/ 
    52  
    53     w.ProgramInit(); 
    54          
    55     w.show(); 
    56  
    57     QObject::connect(&a, SIGNAL(messageReceived(const QString&)), &w, SLOT(slotSingleInstance()) ); 
    58     a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) ); 
    59     return a.exec(); 
     36    //Check for the old PBI system, and prompt to migrate if needed 
     37    QDir dir("/var/db/pbi/installed"); 
     38    if( !dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot).isEmpty() ){ 
     39      //Still on the old system - prompt to migrate to PBI-NG 
     40      MigrateUI w; 
     41      w.show(); 
     42      QObject::connect(&a, SIGNAL(messageReceived(const QString&)), &w, SLOT(slotSingleInstance()) ); 
     43      a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) ); 
     44      return a.exec(); 
     45    }else{ 
     46      //Already on PBI-NG 
     47      MainUI w;  
     48      w.ProgramInit(); 
     49      w.show(); 
     50      QObject::connect(&a, SIGNAL(messageReceived(const QString&)), &w, SLOT(slotSingleInstance()) ); 
     51      a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) ); 
     52      return a.exec(); 
     53    } 
    6054} 
  • src-qt4/pc-softwaremanager/pc-softwaremanager.pro

    r0381f41 rd25fc88  
    1010 
    1111HEADERS += mainUI.h \ 
     12          migrateUI.h \ 
    1213          smallItemWidget.h \ 
    1314          largeItemWidget.h \ 
     
    1920SOURCES += main.cpp \ 
    2021         mainUI.cpp \ 
     22         migrateUI.cpp \ 
    2123         pbiNgBackend.cpp \ 
    2224         pbiDBAccess.cpp \ 
     
    2628 
    2729FORMS   = mainUI.ui \ 
     30                migrateUI.ui \ 
    2831                updateDialog.ui 
    2932 
Note: See TracChangeset for help on using the changeset viewer.