Changeset b3cb948


Ignore:
Timestamp:
07/31/13 07:55:37 (21 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, 9.2-release, releng/10.0, releng/10.0.1, releng/10.0.2, releng/10.0.3, releng/10.1, releng/10.1.1
Children:
7d22135
Parents:
ced25c9
Message:

Add in Menu options to pc-bootconfig for rebuilding the GRUB menu's, and restoring from the original GRUB defaults (.../grub.old)

Location:
src-qt4/pc-bootconfig
Files:
2 added
5 edited

Legend:

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

    reb2e9cc rb3cb948  
    3333    { 
    3434        QMessageBox msg; 
    35         msg.setText(w.tr("You should run this application as root")); 
     35        msg.setText(w.tr("This application requires administrator privileges for operation.")); 
    3636        msg.exec(); 
    3737        exit(2); 
  • src-qt4/pc-bootconfig/mainUI.cpp

    rced25c9 rb3cb948  
    6565} 
    6666 
    67 void mainUI::runLongCMD(QString cmd){ 
     67void mainUI::runLongCMD(QString cmd, QString info){ 
     68         
     69  if(info.isEmpty()){ info = tr("Performing Boot Environment Changes. Please Wait."); } 
    6870  //Initialize the Working Message Box 
    6971  QMessageBox wrkmsg(this); 
    7072    wrkmsg.setWindowTitle( tr("Working") ); 
    71     wrkmsg.setText( tr("Performing Boot Environment Changes. Please Wait.") ); 
     73    wrkmsg.setText( info ); 
    7274    wrkmsg.setStandardButtons(0); 
    7375    wrkmsg.setWindowModality(Qt::WindowModal); 
     
    432434} 
    433435 
     436void mainUI::on_action_rebuildGRUBmenu_triggered(){ 
     437  //Rebuild the GRUB menu 
     438  QString cmd = "grub-mkconfig -o /boot/grub/grub.cfg"; 
     439  QString info = tr("Rebuilding GRUB menu system. Please wait."); 
     440  runLongCMD(cmd, info); 
     441} 
     442 
     443void mainUI::on_action_restoreGRUBdefaults_triggered(){ 
     444  QString cmd = "cp "+file_GRUBdefaults+".old "+file_GRUBdefaults; 
     445  system( cmd.toUtf8() ); 
     446  //Now refresh the UI 
     447  updateGRUBdefaults(); //Update the display (load the file) 
     448  on_tool_GRUBsaveentries_clicked(); //make sure the defaults are valid for the number of BE's 
     449} 
     450 
    434451void mainUI::GRUBchangedefaults(){ 
    435452  ui->tool_GRUBsavedefaults->setEnabled(true); 
  • src-qt4/pc-bootconfig/mainUI.h

    rced25c9 rb3cb948  
    3636        int getSelectedBE(); //get the currently selected Boot Environment index 
    3737        bool checkName(QString); //make sure the selected name is valid 
    38         void runLongCMD(QString);  
     38        void runLongCMD(QString cmd , QString info = "");  
    3939 
    4040        //Boot Environment Management Functions 
     
    7474        //UI Buttons - other 
    7575        void on_actionClose_triggered(); 
     76        void on_action_rebuildGRUBmenu_triggered(); 
     77        void on_action_restoreGRUBdefaults_triggered(); 
    7678        void GRUBchangedefaults(); 
    7779        void GRUBchangeentries(); 
  • src-qt4/pc-bootconfig/mainUI.ui

    rcd554b1 rb3cb948  
    397397    <addaction name="actionClose"/> 
    398398   </widget> 
     399   <widget class="QMenu" name="menuAdvanced"> 
     400    <property name="title"> 
     401     <string>Emergency Services</string> 
     402    </property> 
     403    <addaction name="action_rebuildGRUBmenu"/> 
     404    <addaction name="action_restoreGRUBdefaults"/> 
     405   </widget> 
    399406   <addaction name="menuFile"/> 
     407   <addaction name="menuAdvanced"/> 
    400408  </widget> 
    401409  <widget class="QStatusBar" name="statusbar"/> 
     
    407415   <property name="text"> 
    408416    <string>Close</string> 
     417   </property> 
     418  </action> 
     419  <action name="action_rebuildGRUBmenu"> 
     420   <property name="icon"> 
     421    <iconset resource="pc-bootconfig.qrc"> 
     422     <normaloff>:/icons/gear.png</normaloff>:/icons/gear.png</iconset> 
     423   </property> 
     424   <property name="text"> 
     425    <string>Rebuild GRUB Menu</string> 
     426   </property> 
     427  </action> 
     428  <action name="action_restoreGRUBdefaults"> 
     429   <property name="icon"> 
     430    <iconset resource="pc-bootconfig.qrc"> 
     431     <normaloff>:/icons/undo.png</normaloff>:/icons/undo.png</iconset> 
     432   </property> 
     433   <property name="text"> 
     434    <string>Restore GRUB Defaults</string> 
    409435   </property> 
    410436  </action> 
  • src-qt4/pc-bootconfig/pc-bootconfig.qrc

    reb2e9cc rb3cb948  
    11<RCC> 
    22  <qresource> 
     3    <file>icons/undo.png</file> 
     4    <file>icons/gear.png</file> 
    35    <file>icons/save.png</file> 
    46    <file>icons/folder.png</file> 
Note: See TracChangeset for help on using the changeset viewer.