Changeset ec61e8e


Ignore:
Timestamp:
02/05/14 12:15:54 (11 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, releng/10.0.1, releng/10.0.2, releng/10.0.3, releng/10.1
Children:
6310240
Parents:
42d16db
Message:

Make sure that the life-preserver GUI saves which view mode the UI is in for the next time it gets started.

Location:
src-qt4/life-preserver/lp-gui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/life-preserver/lp-gui/LPMain.cpp

    r862b615 rec61e8e  
    3030  connect(viewBasic, SIGNAL(toggled(bool)), this, SLOT(viewChanged()) ); 
    3131  //Now set the default view type 
    32   viewBasic->setChecked(true); //will automatically call the "viewChanged" function 
     32  settings = new QSettings(QSettings::UserScope, "PC-BSD", "Life-Preserver-GUI", this); 
     33  bool basicMode = settings->value("viewmode", true).toBool(); //basic by default 
     34  if(basicMode){ viewBasic->setChecked(true); } //will automatically call the "viewChanged" function 
     35  else{ viewAdvanced->setChecked(true); } //will automatically call the "viewChanged" function 
    3336  //Create the filesystem model and tie it to the treewidget 
    3437  fsModel = new QFileSystemModel(this); 
     
    144147    ui->combo_pools->addItem("No Managed Pools!"); 
    145148    ui->combo_pools->setCurrentIndex(0); 
     149    //Reset to Basic View 
     150    viewBasic->setChecked(true); 
    146151  } 
    147152  qDebug() << "[DEBUG] Update pool menu options"; 
     
    175180  ui->menuView->hide(); 
    176181  ui->menubar->clear(); 
     182  settings->setValue("viewmode", viewBasic->isChecked()); //save value for later 
    177183  if(viewBasic->isChecked()){ 
    178184    ui->menubar->addMenu(ui->menuFile); 
  • src-qt4/life-preserver/lp-gui/LPMain.h

    r862b615 rec61e8e  
    1616#include <QFileDialog> 
    1717#include <QFileSystemWatcher> 
     18#include <QSettings> 
    1819 
    1920#include "LPBackend.h" 
     
    4546        QFileSystemWatcher *watcher; 
    4647        QTimer *timer; 
     48        QSettings *settings; 
    4749 
    4850        void showErrorDialog(QString title, QString message, QString errors); 
Note: See TracChangeset for help on using the changeset viewer.