Changeset 0a4c18a


Ignore:
Timestamp:
01/20/14 07:14:49 (6 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, releng/10.0, releng/10.0.1, releng/10.0.2
Children:
55a6fd9
Parents:
f841e81
Message:

Add pool auto-refresh to the Life Preserver GUI. It will trigger whenever the /var/log/lpreserver directory contents get modified. This should make sure that the GUI is always showing up-to-date information about the currently selected zpool.

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

Legend:

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

    rff74b40 r0a4c18a  
    55LPMain::LPMain(QWidget *parent) : QMainWindow(parent), ui(new Ui::LPMain){ 
    66  ui->setupUi(this); //load the Qt-designer UI file 
     7  //Initialize the system watcher 
     8  watcher = new QFileSystemWatcher(this); 
     9    //Make sure the lpreserver log directory exists and watch it 
     10    if(!QFile::exists("/var/log/lpreserver")){ 
     11      qDebug() << "Creating the lpreserver log directory (/var/log/lpreserver)"; 
     12      QDir dir; 
     13      dir.mkpath("/var/log/lpreserver"); 
     14    } 
     15    watcher->addPath("/var/log/lpreserver/"); 
    716  //Initialize the waitbox pointer 
    817  waitBox = 0; 
     
    5160  //Make sure the status tab is shown initially 
    5261  ui->tabWidget->setCurrentWidget(ui->tab_status); 
     62  //Now connect the watcher to the update slot 
     63  connect(watcher, SIGNAL(directoryChanged(QString)), this, SLOT(updateTabs()) ); 
    5364} 
    5465 
  • src-qt4/life-preserver/lp-gui/LPMain.h

    r6a2483b r0a4c18a  
    1515#include <QTimer> 
    1616#include <QFileDialog> 
     17#include <QFileSystemWatcher> 
    1718 
    1819#include "LPBackend.h" 
     
    4243        LPDataset POOLDATA; 
    4344        QMessageBox *waitBox; 
     45        QFileSystemWatcher *watcher; 
    4446 
    4547        void showErrorDialog(QString title, QString message, QString errors); 
Note: See TracChangeset for help on using the changeset viewer.