Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Clean up when the SSH key generation is automatically run, and remind…

… the user if the remote host information changes to save the SSH Key to a USB stick
  • Loading branch information...
commit 4a54eefae84c38efc80f6078f4dbfb13cfb86a5e 1 parent 171831b
Ken Moore beanpole135 authored
12 src-qt4/life-preserver/LPConfig.cpp
View
@@ -104,17 +104,19 @@ void LPConfig::checkForChanges(){
if(nTotSnaps != localSnapshots){ localChanged = true; localSnapshots = nTotSnaps; }
//Replication Settings
+ bool updateSSHKey = false;
if(isReplicated != ui->groupReplicate->isChecked()){
remoteChanged = true;
isReplicated = ui->groupReplicate->isChecked();
+ if(isReplicated){ updateSSHKey = true; }
}
QString tmp = ui->lineHostName->text().simplified();
- if( tmp != remoteHost ){ remoteChanged = true; remoteHost = tmp; }
+ if( tmp != remoteHost ){ remoteChanged = true; remoteHost = tmp; updateSSHKey=true;}
tmp = ui->lineUserName->text().simplified();
- if( tmp != remoteUser ){ remoteChanged = true; remoteUser = tmp; }
+ if( tmp != remoteUser ){ remoteChanged = true; remoteUser = tmp; updateSSHKey=true;}
tmp = ui->lineRemoteDataset->text().simplified();
if( tmp != remoteDataset ){ remoteChanged = true; remoteDataset = tmp; }
- if( ui->spinPort->value() != remotePort){ remoteChanged = true; remotePort = ui->spinPort->value(); }
+ if( ui->spinPort->value() != remotePort){ remoteChanged = true; remotePort = ui->spinPort->value(); updateSSHKey=true;}
int nFreq = -1;
if(ui->radioRepTime->isChecked()){
nFreq = ui->time_replicate->time().hour();
@@ -124,6 +126,10 @@ void LPConfig::checkForChanges(){
}else{
if( nFreq != remoteFreq ){ remoteChanged = true; remoteFreq = nFreq; }
}
+ if(updateSSHKey){
+ //Prompt for the SSH key generation
+ LPBackend::setupSSHKey(remoteHost, remoteUser, remotePort);
+ }
}
void LPConfig::setLocalKeepNumber(){
3  src-qt4/life-preserver/LPWizard.cpp
View
@@ -32,6 +32,8 @@ void LPWizard::slotFinished(){
remoteHost = ui->lineHostName->text();
remoteUser = ui->lineUserName->text();
remoteDataset = ui->lineRemoteDataset->text();
+ //Prompt for the SSH key generation
+ LPBackend::setupSSHKey(remoteHost, remoteUser, remotePort);
}
if(ui->radioDaily->isChecked()){ localTime = ui->timeEdit->time().hour(); }
else if( ui->radio10Min->isChecked()){ localTime = -10; }
@@ -44,6 +46,7 @@ void LPWizard::slotFinished(){
if(localTime >0){ totalSnapshots = ui->spin_keepDays->value(); }
else{ totalSnapshots = ui->spin_keepDays->value() * (1440/(-localTime)); } //convert to number of snapshots a day
}
+
//Now close the UI
this->close();
}
2  src-qt4/life-preserver/LPWizard.h
View
@@ -5,6 +5,8 @@
#include <QString>
#include <QDebug>
+#include "LPBackend.h"
+
namespace Ui{
class LPWizard;
}
10 src-qt4/life-preserver/mainUI.cpp
View
@@ -238,8 +238,13 @@ void mainUI::on_tool_config_clicked(){
change = true;
}
if(CFG.remoteChanged){
- LPBackend::setupReplication(ds, CFG.remoteHost, CFG.remoteUser, CFG.remotePort, CFG.remoteDataset, CFG.remoteFreq);
- change = true;
+ change = true;
+ if(CFG.isReplicated){
+ LPBackend::setupReplication(ds, CFG.remoteHost, CFG.remoteUser, CFG.remotePort, CFG.remoteDataset, CFG.remoteFreq);
+ QMessageBox::information(this,tr("Reminder"),tr("Don't forget to save your SSH key to a USB stick so that you can restore your system from the remote host later!!"));
+ }else{
+ LPBackend::removeReplication(ds);
+ }
}
//Now update the UI if appropriate
if(change){
@@ -341,6 +346,7 @@ void mainUI::slotAddDataset(QAction *act){
if( LPBackend::setupDataset(dataset, wiz.localTime, wiz.totalSnapshots) ){
if(wiz.enableReplication){
LPBackend::setupReplication(dataset, wiz.remoteHost, wiz.remoteUser, wiz.remotePort, wiz.remoteDataset, wiz.remoteTime);
+ QMessageBox::information(this,tr("Reminder"),tr("Don't forget to save your SSH key to a USB stick so that you can restore your system from the remote host later!!"));
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.