Ignore:
Timestamp:
06/18/13 09:17:09 (15 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, 9.2-release, releng/10.0, releng/10.0.1, releng/10.0.2, releng/10.0.3
Children:
da366a8
Parents:
1105519
Message:

Simplify the install wizard, give options between desktop / server, and
the user can click customize if they want to delve any deeper.

Switch default boot-loader to GRUB while here

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/pc-installgui/installer.cpp

    r1105519 rea6d5ac  
    155155    loadDiskInfo(); 
    156156     
    157  
    158157    // Init the desktop wheel 
    159158    initDesktopSelector(); 
     
    482481{ 
    483482  desks = new desktopSelection(); 
    484   if ( wheelCurItem != wPCSERVER && wheelCurItem != 11 && wheelCurItem != 12) 
     483  if ( radioDesktop->isChecked() ) 
    485484     desks->programInit(listDeskPkgs,selectedPkgs); 
    486485  else 
     
    496495  selectedPkgs = sPkgs; 
    497496 
    498   // Only add +10 if we are not already on the custom screen 
    499   if ( wheelCurItem < 10 ) 
    500     wheelCurItem= wheelCurItem + 10; 
    501  
    502   switch (wheelCurItem) { 
    503     case 12: 
    504         groupDeskSummary->setTitle(tr("TrueOS Package Selection")); 
    505         break; 
    506     case 11: 
    507         groupDeskSummary->setTitle(tr("FreeBSD Package Selection")); 
    508         break; 
    509     default: 
    510         groupDeskSummary->setTitle(tr("PC-BSD Package Selection")); 
    511         break; 
    512   } 
     497  if ( radioDesktop->isChecked() ) 
     498     groupDeskSummary->setTitle(tr("PC-BSD Package Selection")); 
     499  else 
     500     groupDeskSummary->setTitle(tr("TrueOS Package Selection")); 
    513501 
    514502  textDeskSummary->setText(tr("The following meta-pkgs will be installed:") + "<br>" + selectedPkgs.join("<br>")); 
    515   graphicsViewOS->setScene(customScene); 
    516503} 
    517504 
     
    533520} 
    534521 
    535 void Installer::slotDesktopLeftClicked() 
    536 { 
    537   if ( wheelCurItem >= 10 ) { 
    538     int ret = QMessageBox::question(this, tr("PC-BSD Installer"), 
    539                               tr("You currently have a custom package set configured. Continue changing to a default set?"), 
    540                               QMessageBox::No | QMessageBox::Yes, 
    541                               QMessageBox::No); 
    542     switch (ret) { 
    543     case QMessageBox::Yes: 
    544         break; 
    545     case QMessageBox::No: // :) 
    546         return; 
    547         break; 
    548     } 
    549     wheelCurItem = wheelCurItem - 10; 
    550     graphicsViewOS->setScene(defaultScene); 
    551   } 
    552   moveDesktopWheel(false); 
    553 } 
    554  
    555 void Installer::slotDesktopRightClicked() 
    556 { 
    557   if ( wheelCurItem >= 10 ) { 
    558     int ret = QMessageBox::question(this, tr("PC-BSD Installer"), 
    559                               tr("You currently have a custom package set configured. Continue changing to a default set?"), 
    560                               QMessageBox::No | QMessageBox::Yes, 
    561                               QMessageBox::No); 
    562     switch (ret) { 
    563     case QMessageBox::Yes: 
    564         break; 
    565     case QMessageBox::No: // :) 
    566         return; 
    567         break; 
    568     } 
    569     wheelCurItem = wheelCurItem - 10; 
    570     graphicsViewOS->setScene(defaultScene); 
    571   } 
    572   moveDesktopWheel(true); 
    573 } 
    574  
    575 void Installer::moveDesktopWheel(bool direction) 
    576 { 
    577   qDebug() << wheelCurItem << direction; 
    578   // Make sure we aren't scrolling too far 
    579   if ( direction && wheelCurItem >= wheelIcons.size() ) 
    580     return; 
    581   if ( hasFreeBSDOnMedia ) { 
    582     if ( ! direction && wheelCurItem <= 1 ) 
    583       return; 
    584   } else { 
    585     if ( ! direction && wheelCurItem <= 2 ) 
    586       return; 
    587   } 
    588  
    589  
    590   int tItem, tPixel, cPixel; 
    591   cPixel=96 + ((wheelCurItem-1) * 64) + (wheelCurItem * 32); 
    592  
    593   // Right 
    594   if ( direction ) { 
    595     tItem=wheelCurItem + 1; 
    596     tPixel=96 + ((tItem-1) * 64) + (tItem * 32); 
    597   } else { 
    598   // Left 
    599     tItem=wheelCurItem - 1; 
    600     tPixel=96 + ((tItem-1) * 64) + (tItem * 32); 
    601   }  
    602  
    603   if ( direction ) { 
    604     while ( cPixel < tPixel ) { 
    605       cPixel++; 
    606       graphicsViewOS->centerOn(cPixel,0); 
    607       graphicsViewOS->show(); 
    608       QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents, 22); 
    609        
    610     } 
    611   } else { 
    612     while ( cPixel > tPixel ) { 
    613       cPixel--; 
    614       graphicsViewOS->centerOn(cPixel,0); 
    615       graphicsViewOS->show(); 
    616       QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents, 22); 
    617     } 
    618   } 
    619    
    620   wheelCurItem=tItem; 
    621  
    622   groupDeskSummary->setTitle(wheelName.at(tItem-1)); 
    623   textDeskSummary->setText(wheelDesc.at(tItem-1)); 
    624  
    625   // No custom packages for FreeBSD vanilla 
    626   if ( wheelCurItem == 1 )  
    627     pushDeskCustomize->setEnabled(false); 
    628   else 
    629     pushDeskCustomize->setEnabled(true); 
    630    
    631   changeMetaPkgSelection(); 
    632 } 
    633  
    634 void Installer::changeMetaPkgSelection() 
    635 { 
     522void Installer::slotChangedMetaPkgSelection() 
     523{ 
     524 
     525  selectedPkgs.clear(); 
    636526 
    637527  // Set the default desktop meta-pkgs based upon the selection 
    638   // 1 = FreeBSD 
    639   switch (wheelCurItem) 
     528  if ( radioDesktop->isChecked() ) 
    640529  { 
    641     case wKDE: 
    642       selectedPkgs.clear(); 
    643530      selectedPkgs << "KDE" << "KDE-Accessibility" << "KDE-Artwork" << "KDE-Education" << "KDE-Games" << "KDE-Graphics" << "KDE-Multimedia" << "KDE-Network" << "KDE-PIM"; 
     531 
     532      // Include i18n stuff? 
    644533      if ( comboLanguage->currentIndex() != 0 )  
    645534         selectedPkgs << "KDE-L10N"; 
    646       break; 
    647     case wLXDE: 
    648       selectedPkgs.clear(); 
    649       selectedPkgs << "LXDE"; 
    650       break; 
    651     case wGNOME: 
    652       selectedPkgs.clear(); 
    653       selectedPkgs << "GNOME" << "GNOME-Accessibility" << "GNOME-Games" << "GNOME-Net" << "GNOME-Utilities"; 
    654       break; 
    655     case wXFCE: 
    656       selectedPkgs.clear(); 
    657       selectedPkgs << "XFCE" << "XFCE-Plugins"; 
    658       break; 
    659     default: 
    660       selectedPkgs.clear(); 
    661       return; 
    662   } 
    663  
    664   // Check if we are using NVIDIA driver and include it automatically 
    665   QFile file("/etc/X11/xorg.conf"); 
    666   if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) 
    667       return; 
     535 
     536      // Check if we are using NVIDIA driver and include it automatically 
     537      QFile file("/etc/X11/xorg.conf"); 
     538      if (file.open(QIODevice::ReadOnly | QIODevice::Text)) { 
    668539           
    669   QTextStream in(&file); 
    670   while (!in.atEnd()) { 
    671       QString line = in.readLine(); 
    672       if ( line.indexOf("nvidia") != -1 ) { 
    673         selectedPkgs << "NVIDIA"; 
    674         break; 
    675       } 
    676   }      
    677   file.close(); 
    678   // Done with NVIDIA check 
    679  
     540        QTextStream in(&file); 
     541        while (!in.atEnd()) { 
     542           QString line = in.readLine(); 
     543           if ( line.indexOf("nvidia") != -1 ) { 
     544             selectedPkgs << "NVIDIA"; 
     545             break; 
     546           } 
     547        }      
     548        file.close(); 
     549      } // Done with NVIDIA check 
     550 
     551      // Are we on VirtualBox? 
     552      QFile filev("/var/log/Xorg.0.log"); 
     553      if (filev.open(QIODevice::ReadOnly | QIODevice::Text)) { 
     554           
     555        QTextStream in(&file); 
     556        while (!in.atEnd()) { 
     557           QString line = in.readLine(); 
     558           if ( line.indexOf("VirtualBox") != -1 ) { 
     559             selectedPkgs << "VirtualBoxGuest"; 
     560             break; 
     561           } 
     562        }      
     563        file.close(); 
     564      } // End of virtualbox check 
     565  } 
     566 
     567  slotSaveMetaChanges(selectedPkgs); 
    680568  qDebug() << selectedPkgs; 
    681569 
     
    684572void Installer::initDesktopSelector() 
    685573{ 
    686     QString fbsdIcon; 
    687  
    688     if ( hasFreeBSDOnMedia ) 
    689        fbsdIcon = ":modules/images/freebsd.png"; 
    690     else 
    691        fbsdIcon = ""; 
    692  
    693     // Init the desktop selector 
    694     wheelIcons << fbsdIcon << ":/modules/images/pcbsd-server.png" << ":/PCBSD/images/kde.png" << ":/PCBSD/images/lxde.png" << ":/PCBSD/images/gnome.png" << ":/PCBSD/images/xfce.png"; 
    695     wheelName << "FreeBSD Server" << "TrueOS" << "KDE" << "LXDE" << "GNOME" << "XFCE";  
    696     wheelDesc << tr("FreeBSD is an advanced operating system for modern server, desktop, and embedded computer platforms. FreeBSD's code base has undergone over thirty years of continuous development, improvement, and optimization.") \ 
    697     << tr("TrueOS is a console based server running FreeBSD. It includes command-line versions of The Warden jail management, PBI manager, ZFS boot environments (beadm), and other helpful utilities for system administrators.")  \ 
    698     << tr("KDE is a full-featured desktop environment, which includes support for 3D desktop effects, multiple desktops, and a variety of built-in tools and utilities for both new and power-desktop users.<br><br>* Recommended for higher-end systems with 2GB of RAM or more *") \ 
    699     << tr("LXDE is a lightweight desktop, minimalist in nature, with support for multiple-desktops, a system tray, application menu and more.<br><br>* Recommended for netbooks, or lower-end systems * ") \ 
    700     << tr("GNOME is a full-featured desktop environment, complete with a large number of integrated utilities and tools for desktop users.") \ 
    701     << tr("XFCE is a light and modular desktop, with a number of features to enhance customizing the desktop to your liking.");  
    702  
    703     int xOff=96; 
    704     defaultScene = new QGraphicsScene(0,0,(96 + 96 + (wheelIcons.size()*64) + (wheelIcons.size()*32) ),64); 
    705     for ( int i = 0; i < wheelIcons.size(); ++i) { 
    706       defaultScene->addPixmap(QPixmap(wheelIcons.at(i)))->setOffset(xOff,0); 
    707       xOff = xOff +96; 
    708     } 
    709     graphicsViewOS->setScene(defaultScene); 
    710  
    711     // If less than 2GB memory, default to LXDE, otherwise KDE 
    712     if ( systemMemory > 2048 )  { 
    713       wheelCurItem=2; 
    714     } else { 
    715       wheelCurItem=3; 
    716     } 
    717     graphicsViewOS->centerOn(191,0); 
    718     graphicsViewOS->show(); 
    719     moveDesktopWheel(true); 
    720  
    721     customScene = new QGraphicsScene(0,0,220,64); 
    722     customScene->addText(tr("Custom Package Selection")); 
    723  
    724     // Connect our slots 
    725     connect(pushDeskRight,SIGNAL(clicked()), this, SLOT(slotDesktopRightClicked())); 
    726     connect(pushDeskLeft,SIGNAL(clicked()), this, SLOT(slotDesktopLeftClicked())); 
    727574    connect(pushDeskCustomize,SIGNAL(clicked()), this, SLOT(slotDesktopCustomizeClicked())); 
     575    connect(radioDesktop,SIGNAL(clicked()), this, SLOT(slotChangedMetaPkgSelection())); 
     576    connect(radioServer,SIGNAL(clicked()), this, SLOT(slotChangedMetaPkgSelection())); 
     577    slotChangedMetaPkgSelection(); 
    728578} 
    729579 
     
    779629   } 
    780630 
    781    // Start the FreeBSD wizard 
    782    if ( installStackWidget->currentIndex() == 1 && (wheelCurItem == wFREEBSD || wheelCurItem == wPCSERVER || wheelCurItem == 12) ) { 
     631   // Start the TrueOS wizard 
     632   if ( radioServer->isChecked() ) {  
    783633     bool tOS; 
    784      if ( wheelCurItem == wPCSERVER || wheelCurItem == 12 ) 
    785        tOS = true; 
    786      else 
    787        tOS = false; 
     634     tOS = true; 
    788635 
    789636     wFBSD = new wizardFreeBSD(); 
     
    908755     distFiles+=" lib32"; 
    909756 
    910   // If we are doing a PC-BSD install 
    911   if ( wheelCurItem != wPCSERVER && wheelCurItem != 12 && wheelCurItem != wFREEBSD ) { 
    912     tmpList << "installType=PCBSD"; 
    913     tmpList << "packageType=dist"; 
    914   } else { 
    915     tmpList << "installType=FreeBSD"; 
    916     tmpList << "packageType=dist"; 
    917   } 
     757  // System type we are installing 
     758  tmpList << "installType=PCBSD"; 
     759  tmpList << "packageType=dist"; 
    918760 
    919761  // Set the distFiles being used 
     
    927769   
    928770  // Networking setup 
    929   if ( wheelCurItem != wFREEBSD && wheelCurItem != wPCSERVER && wheelCurItem != 12 ) { 
     771  if ( radioDesktop->isChecked() ) { 
    930772    // PC-BSD network setup 
    931773    tmpList << "netSaveDev=AUTO-DHCP-SLAAC"; 
     
    1032874  cfgList+= ""; 
    1033875 
    1034   if ( wheelCurItem != wFREEBSD && wheelCurItem != wPCSERVER && wheelCurItem != 12 ) { 
     876  if ( radioDesktop->isChecked() ) { 
    1035877    // Doing PC-BSD Install 
    1036878 
     
    1050892    cfgList << "runCommand=touch /var/.pcbsd-firstgui"; 
    1051893 
    1052   } else if ( wheelCurItem == wPCSERVER || wheelCurItem == 12 ) { 
     894  } else { 
    1053895    // Doing TrueOS Install 
    1054896    cfgList+=getUsersCfgSettings(); 
     
    1061903    cfgList << "runCommand=sh /usr/local/share/pcbsd/scripts/sys-init.sh server"; 
    1062904 
    1063   } else { // End of PC-BSD specific setup 
    1064     // Doing FreeBSD Install 
    1065     cfgList+=getUsersCfgSettings(); 
    1066  
    1067     // Enable SSH? 
    1068     if ( fSSH ) 
    1069       cfgList << "runCommand=echo 'sshd_enable=\"YES\"' >>/etc/rc.conf"; 
    1070  
    1071   } 
     905  }  
    1072906 
    1073907  // Run newaliases to fix mail errors 
     
    1142976    // Are we loading a boot-loader? 
    1143977    if ( loadMBR ) 
    1144       tmpList << "bootManager=bsd"; 
     978      tmpList << "bootManager=GRUB"; 
    1145979    else 
    1146980      tmpList << "bootManager=none"; 
     
    15691403QStringList Installer::getDeskPkgCfg() 
    15701404{ 
    1571    if ( wheelCurItem == wFREEBSD ) 
    1572       return QStringList(); 
    1573  
    15741405   QStringList cfgList, pkgList; 
    15751406   QString line; 
     
    15771408   QList<QStringList> curList; 
    15781409 
    1579    if ( wheelCurItem != wPCSERVER && wheelCurItem != 11 && wheelCurItem != 12) { 
     1410   if ( radioDesktop->isChecked() ) { 
    15801411     curList = listDeskPkgs; 
    15811412     pkgList << "pcbsd-base"; 
     
    16871518  //qDebug() << totalSize; 
    16881519 
    1689   if ( installStackWidget->currentIndex() == 1 && (wheelCurItem == wPCSERVER || wheelCurItem == 12) ) 
     1520  if ( radioServer->isChecked() ) 
    16901521     targetSize=20000; 
    16911522  else 
Note: See TracChangeset for help on using the changeset viewer.