Skip to content
Browse files

Clean up the text on the replication status updates, it should now be…

… pretty and translatable.
  • Loading branch information...
1 parent ebfbf39 commit 294caaff4ac90348a363a33ba88021587f8afc0d @beanpole135 beanpole135 committed
Showing with 7 additions and 4 deletions.
  1. +2 −1 life-preserver/LPBackend.cpp
  2. +5 −3 life-preserver/LPTray.cpp
View
3 life-preserver/LPBackend.cpp
@@ -41,7 +41,7 @@ QStringList LPBackend::listDatasets(){
}
QStringList LPBackend::listDatasetSubsets(QString dataset){
- QString cmd = "zfs list -H -o name";
+ QString cmd = "zfs list -H -t filesystem -o name";
//Need output, so run this in a QProcess
QProcess *proc = new QProcess;
proc->setProcessChannelMode(QProcess::MergedChannels);
@@ -56,6 +56,7 @@ QStringList LPBackend::listDatasetSubsets(QString dataset){
if(!ds.isEmpty()){ list << ds; }
}
list.removeDuplicates();
+ return list;
}
QStringList LPBackend::listSnapshots(QString dataset){
View
8 life-preserver/LPTray.cpp
@@ -95,7 +95,7 @@ void LPTray::parseStatusMessage(QString stat){
qDebug() << "New Status Message:" << stat;
//Divide up the status message into sections
stat.replace("\t"," ");
- QString time = stat.section(" ",0,0,QString::SectionSkipEmpty);
+ QString dataset = stat.section(" ",2,2,QString::SectionSkipEmpty).section("/",0,0).simplified();
QString cSize = stat.section(" ",1,1,QString::SectionSkipEmpty);
//Now Setup the tooltip
if(cSize != lastSize){ //don't update the tooltip if the same size info
@@ -111,8 +111,10 @@ void LPTray::parseStatusMessage(QString stat){
}
}
if(repTotK.isEmpty()){ repTotK = "??"; }
- QString txt = cSize+"/"+repTotK;
- if(!percent.isEmpty()){ txt.append(" ("+percent+")"); }
+ //Format the tooltip String
+ QString status = cSize+"/"+repTotK;
+ if(!percent.isEmpty()){ status.append(" ("+percent+")"); }
+ QString txt = QString(tr("Replicating %1: %2")).arg(dataset, status);
this->setToolTip(txt);
lastSize = cSize; //save the current size for later
}

0 comments on commit 294caaf

Please sign in to comment.
Something went wrong with that request. Please try again.