source: src-qt4/life-preserver/lp-gui/LPWizard.cpp @ 6a2483b

9.2-releasereleng/10.0releng/10.0.1releng/10.0.2releng/10.0.3
Last change on this file since 6a2483b was 6a2483b, checked in by Ken Moore <ken@…>, 10 months ago

Remove the old life-preserver from the src-qt4/life-preserver dir, and replace it with src-qt4/life-preserver/lp-tray and src-qt4/life-preserver/lp-gui.

  • Property mode set to 100644
File size: 1.9 KB
Line 
1#include "LPWizard.h"
2#include "ui_LPWizard.h"
3
4LPWizard::LPWizard(QWidget *parent) : QWizard(parent), ui(new Ui::LPWizard){
5  //Initialize the graphical items
6  ui->setupUi(this);  //load the mainUI.ui file
7  cancelled = true; //Make sure this is always set by default
8  connect(this,SIGNAL(accepted()), this,SLOT(slotFinished()) );
9  connect(this,SIGNAL(rejected()),this,SLOT(slotCancelled()) );
10}
11
12LPWizard::~LPWizard(){
13       
14}
15
16void LPWizard::setDataset(QString ds){
17  ui->label_dataset->setText(ds);
18}
19       
20void LPWizard::slotFinished(){
21  qDebug() << "Wizard Finished";
22  cancelled = false; //use the values from the UI
23  //Now load the information from the UI
24  enableReplication = ui->groupReplicate->isChecked();
25  if(enableReplication){
26    remotePort = ui->spinPort->value();
27    if(ui->radioSYNC->isChecked()){ 
28      remoteTime = -1;
29    }else{
30      remoteTime = ui->time_replicate->time().hour();
31    }
32    remoteHost = ui->lineHostName->text();
33    remoteUser = ui->lineUserName->text();
34    remoteDataset = ui->lineRemoteDataset->text();
35    //Prompt for the SSH key generation
36    LPBackend::setupSSHKey(remoteHost, remoteUser, remotePort);
37  }
38  if(ui->radioDaily->isChecked()){ localTime = ui->timeEdit->time().hour(); }
39  else if( ui->radio10Min->isChecked()){ localTime = -10; }
40  else if( ui->radio30Min->isChecked()){ localTime = -30; }
41  else if( ui->radio5Min->isChecked()){ localTime = -5; }
42  else{ localTime = -60; } //hourly
43  if( ui->radioKeepTotal->isChecked() ){
44    totalSnapshots = ui->spin_keepTotal->value();
45  }else{
46    if(localTime >0){ totalSnapshots = ui->spin_keepDays->value(); }
47    else{ totalSnapshots = ui->spin_keepDays->value() * (1440/(-localTime)); } //convert to number of snapshots a day
48  }
49
50  //Now close the UI
51  this->close();
52}
53
54void LPWizard::slotCancelled(){
55  qDebug() << "Wizard Cancelled";
56  cancelled = true; //just to make sure
57  this->close();
58}
Note: See TracBrowser for help on using the repository browser.