Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add logfile detection for failed replication tasks

  • Loading branch information...
commit 0fbd5bcd03b113fca9e65ec4ec77ef6a9488fefd 1 parent 7b2a986
@beanpole135 beanpole135 authored
Showing with 17 additions and 1 deletion.
  1. +17 −1 life-preserver/LPTray.cpp
View
18 life-preserver/LPTray.cpp
@@ -82,9 +82,25 @@ void LPTray::parseLogMessage(QString log){
this->setToolTip("");
dev = message.section(" ",-1).simplified();
this->showMessage( time, QString(tr("Finished replication for %1")).arg(dev), QSystemTrayIcon::Information, 5000);
+ }else if( message.contains("FAILED replication") ){
+ stopWorkingIcon();
+ //Stop the file wather from watching the status file and clean up
+ if(!sFile.isEmpty()){
+ watcher->removePath(sFile);
+ statFile->close();
+ sFile.clear();
+ }
+ //Clean up and show messages
+ repTotK.clear();
+ dev = message.section(" ",-1).simplified();
+ QString file = log.section("LOGFILE:",1,1).simplified();
+ QString tt = QString(tr("%1: Replication Failed on %2")).arg(time,dev) +"\n"+ QString(tr("Logfile available at: %1")).arg(file);
+ this->setToolTip(tt);
+ this->showMessage( time, QString(tr("Replication Error for %1")).arg(dev), QSystemTrayIcon::Information, 5000);
+ this->setIcon(QIcon(":/images/tray-icon-failed.png"));
}else{
//Just set the standard idle icon
- this->setIcon( QIcon(":/images/tray-icon-idle.png") );
+ //this->setIcon( QIcon(":/images/tray-icon-idle.png") );
}
if(GUI->isVisible()){
GUI->updateDisplay();
Please sign in to comment.
Something went wrong with that request. Please try again.