Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 9 files changed
  • 0 commit comments
  • 1 contributor
Commits on Aug 01, 2013
@beanpole135 beanpole135 Setup the AppCafe so that the status displayed in the treewidget is a…
… short status, with the full status at the bottom of the info group if selected. This status shows not only the current download percent and rate, but also any install/remove/update status notifications as they happen.
74c359f
@beanpole135 beanpole135 Merge branch 'master' of github.com:pcbsd/pcbsd 5f57be9
View
60 src-qt4/pc-softwaremanager/containers.cpp
@@ -1,60 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2011 - iXsystems *
- * kris@pcbsd.org *
- * tim@pcbsd.org *
- * ken@pcbsd.org *
- * *
- * Permission is hereby granted, free of charge, to any person obtaining *
- * a copy of this software and associated documentation files (the *
- * "Software"), to deal in the Software without restriction, including *
- * without limitation the rights to use, copy, modify, merge, publish, *
- * distribute, sublicense, and/or sell copies of the Software, and to *
- * permit persons to whom the Software is furnished to do so, subject to *
- * the following conditions: *
- * *
- * The above copyright notice and this permission notice shall be *
- * included in all copies or substantial portions of the Software. *
- * *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR *
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR *
- * OTHER DEALINGS IN THE SOFTWARE. *
- ***************************************************************************/
-#include "containers.h"
-
-//Initialization functions for the container classes
-
-// --- INSTALLEDPBI ---
-InstalledPBI::InstalledPBI(){
- rootInstall=FALSE; autoUpdate=FALSE; desktopIcons=FALSE; menuIcons=FALSE;
- status = NONE;
-}
-
-void InstalledPBI::setStatus(PBISTATUS stat, QString addinfo){
- //addinfo: additional info (download statistics or update version available)
- status = stat;
- if(stat == DOWNLOADING){
- if(addinfo.isEmpty()){ statusString = QObject::tr("Downloading..."); }
- else{ statusString = QString(QObject::tr("Downloading: %1")).arg(addinfo); }
- }
- else if(stat == INSTALLING){ statusString = QObject::tr("Installing..."); }
- else if(stat == REMOVING){ statusString = QObject::tr("Removing..."); }
- else if(stat == UPDATING){
- if(addinfo.isEmpty()){ statusString = QObject::tr("Updating..."); }
- else{ statusString = QString(QObject::tr("Update Downloading: %1 ")).arg(addinfo); }
- }
- else if(stat == PENDINGDOWNLOAD){ statusString = QObject::tr("Pending Download"); }
- else if(stat == PENDINGINSTALL){ statusString = QObject::tr("Pending Install"); }
- else if(stat == PENDINGREMOVAL){ statusString = QObject::tr("Pending Removal"); }
- else if(stat == PENDINGUPDATE){ statusString = QObject::tr("Pending Update"); }
- else if(stat == UPDATEAVAILABLE){
- if(addinfo.isEmpty()){ statusString = QObject::tr("Update Available!"); }
- else{ statusString = QString(QObject::tr("Version %1 Available")).arg(addinfo); }
- }
- else{ statusString = ""; }
- //qDebug() << "Status Update:" << name << status << statusString;
-}
-
View
11 src-qt4/pc-softwaremanager/containers.h
@@ -36,14 +36,17 @@ class InstalledPBI{
public:
enum PBISTATUS{ NONE, DOWNLOADING, INSTALLING, REMOVING, UPDATING, PENDINGDOWNLOAD, PENDINGINSTALL, PENDINGREMOVAL, PENDINGUPDATE, UPDATEAVAILABLE, WORKING };
- QString name, version, author, website, arch, path, icon, license, mdate, metaID, statusString, downloadfile;
+ QString name, version, author, website, arch, path, icon, license, mdate, metaID, downloadfile;
PBISTATUS status;
bool rootInstall, autoUpdate, desktopIcons, menuIcons;
- InstalledPBI();
+ InstalledPBI(){
+ rootInstall=FALSE; autoUpdate=FALSE; desktopIcons=FALSE; menuIcons=FALSE;
+ status = NONE;
+ }
~InstalledPBI(){}
- void setStatus(PBISTATUS stat, QString addInfo="");
-
+ void setStatus(PBISTATUS stat){ status = stat; }
+
};
// Info Container for PBI Meta information on a repo
View
57 src-qt4/pc-softwaremanager/mainUI.cpp
@@ -264,6 +264,7 @@ void MainUI::slotRefreshInstallTab(){
on_tree_install_apps_itemSelectionChanged(); //Update the info boxes
slotDisplayStats();
}
+
void MainUI::slotPBIStatusUpdate(QString pbiID){
for(int i=0; i<ui->tree_install_apps->topLevelItemCount(); i++){
QString itemID = ui->tree_install_apps->topLevelItem(i)->whatsThis(0);
@@ -275,23 +276,8 @@ void MainUI::slotPBIStatusUpdate(QString pbiID){
if(ui->tree_install_apps->topLevelItemCount() > 0){
appID = ui->tree_install_apps->currentItem()->whatsThis(0);
}
- if ( appID == pbiID && stat.contains("Downloading:")) {
- QString done, tot, display, speed;
- bool ok, ok2;
- display = stat.section(" ", 2, 3);
- done = stat.section(" ", 2, 2).section("/", 0, 0).section(".", 0, 0);
- tot = stat.section(" ", 2, 2).section("/", 1, 1).section(".", 0, 0);
- speed = stat.section(" ", 6, 7);
- done.toInt(&ok);
- tot.toInt(&ok2);
- //qDebug() << done << tot << speed;
- if ( !ok || !ok2)
- return;
- ui->progressStatus->setVisible(true);
- ui->progressStatus->setRange(0, tot.toInt(&ok));
- ui->progressStatus->setValue(done.toInt(&ok));
- ui->labelDL->setVisible(true);
- ui->labelDL->setText(display + " @ " + speed);
+ if ( appID == pbiID ) {
+ on_tree_install_apps_itemSelectionChanged();
}
return; // Found our match, we can return now
}
@@ -334,10 +320,6 @@ void MainUI::on_tree_install_apps_itemSelectionChanged(){
ui->group_install_info->setVisible( ui->group_install_showinfo->isChecked() );
}
- // Hide the progress bar, it will re-appear when we need it
- ui->progressStatus->setVisible(false);
- ui->labelDL->setVisible(false);
-
//Get the PBI info for that item
QStringList vals;
vals << "name" << "icon" << "author" << "website" << "version" << "license";
@@ -404,7 +386,38 @@ void MainUI::on_tree_install_apps_itemSelectionChanged(){
ui->tool_install_update->setVisible(FALSE);
}
}
-
+ //Update the current status indicators
+ QString stat = PBI->currentAppStatus(appID,true); //get the raw status
+ if(stat.isEmpty() || stat == "DLSTART" || stat == "DLDONE"){
+ //Not currently running - hide the display indicators
+ ui->group_install_appStat->setVisible(FALSE);
+ }else if(stat.startsWith("DLSTAT::")){
+ //Currently downloading - show download status indicators
+ QString percent = stat.section("::",1,1);
+ QString total = stat.section("::",2,2);
+ QString speed = stat.section("::",3,3);
+ ui->group_install_appStat->setVisible(TRUE);
+ ui->progress_install_DL->setVisible(TRUE);
+ if(total == "??"){ ui->label_install_status->setText( tr("Downloading file:") ); }
+ else{ ui->label_install_status->setText( QString(tr("Downloading %1 file:")).arg(total) ); }
+ if(percent == "??"){
+ ui->progress_install_DL->setMinimum(0); ui->progress_install_DL->setMaximum(0);
+ }else{
+ ui->progress_install_DL->setMinimum(0); ui->progress_install_DL->setMaximum(100);
+ ui->progress_install_DL->setValue( int(percent.toFloat()) );
+ }
+ if(speed == "??"){ ui->label_install_DL->setVisible(FALSE); }
+ else{
+ ui->label_install_DL->setVisible(TRUE);
+ ui->label_install_DL->setText(speed);
+ }
+ }else{
+ //Currently installing/removing/updating - show last message from process
+ ui->label_install_status->setText(stat);
+ ui->group_install_appStat->setVisible(TRUE);
+ ui->progress_install_DL->setVisible(FALSE);
+ ui->label_install_DL->setVisible(FALSE);
+ }
}
void MainUI::on_check_install_autoupdate_clicked(){
View
74 src-qt4/pc-softwaremanager/mainUI.ui
@@ -441,6 +441,40 @@ border-radius: 5px;
</item>
</layout>
</item>
+ <item row="3" column="0" colspan="4">
+ <widget class="QGroupBox" name="group_install_appStat">
+ <property name="title">
+ <string/>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_18">
+ <item>
+ <widget class="QLabel" name="label_install_status">
+ <property name="text">
+ <string notr="true">TextLabel</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_9">
+ <item>
+ <widget class="QProgressBar" name="progress_install_DL">
+ <property name="value">
+ <number>24</number>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_install_DL">
+ <property name="text">
+ <string notr="true">label</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
<item row="1" column="2" rowspan="2">
<spacer name="horizontalSpacer_2">
<property name="orientation">
@@ -454,20 +488,6 @@ border-radius: 5px;
</property>
</spacer>
</item>
- <item row="3" column="0" colspan="3">
- <widget class="QProgressBar" name="progressStatus">
- <property name="value">
- <number>24</number>
- </property>
- </widget>
- </item>
- <item row="3" column="3">
- <widget class="QLabel" name="labelDL">
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
</layout>
</widget>
</item>
@@ -674,8 +694,8 @@ spacing: 1px;
<rect>
<x>0</x>
<y>0</y>
- <width>98</width>
- <height>28</height>
+ <width>70</width>
+ <height>16</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_5"/>
@@ -725,8 +745,8 @@ spacing: 1px;
<rect>
<x>0</x>
<y>0</y>
- <width>98</width>
- <height>28</height>
+ <width>49</width>
+ <height>16</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_6"/>
@@ -750,8 +770,8 @@ spacing: 1px;
<rect>
<x>0</x>
<y>0</y>
- <width>98</width>
- <height>28</height>
+ <width>86</width>
+ <height>16</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_23"/>
@@ -1150,8 +1170,8 @@ spacing: 1px;
<rect>
<x>0</x>
<y>0</y>
- <width>98</width>
- <height>28</height>
+ <width>447</width>
+ <height>61</height>
</rect>
</property>
</widget>
@@ -1211,8 +1231,8 @@ spacing: 1px;
<rect>
<x>0</x>
<y>0</y>
- <width>98</width>
- <height>28</height>
+ <width>55</width>
+ <height>16</height>
</rect>
</property>
</widget>
@@ -1249,8 +1269,8 @@ spacing: 1px;
<rect>
<x>0</x>
<y>0</y>
- <width>98</width>
- <height>28</height>
+ <width>55</width>
+ <height>16</height>
</rect>
</property>
</widget>
@@ -1275,7 +1295,7 @@ spacing: 1px;
<x>0</x>
<y>0</y>
<width>509</width>
- <height>22</height>
+ <height>20</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
View
75 src-qt4/pc-softwaremanager/pbiBackend.cpp
@@ -455,7 +455,7 @@ QStringList PBIBackend::PBIInfo( QString pbiID, QStringList infoList){
else if(infoList[i]=="icon"){ output << PBIHASH[pbiID].icon; }
else if(infoList[i]=="license"){ output << PBIHASH[pbiID].license; }
else if(infoList[i]=="metaid"){ output << PBIHASH[pbiID].metaID; }
- else if(infoList[i]=="status"){ output << PBIHASH[pbiID].statusString; }
+ else if(infoList[i]=="status"){ output << currentAppStatus(pbiID); }
//Now the boolians
else if(infoList[i]=="requiresroot"){
if(PBIHASH[pbiID].rootInstall){output<<"true";}
@@ -521,29 +521,62 @@ QStringList PBIBackend::AppInfo( QString appID, QStringList infoList){
return output;
}
-QString PBIBackend::currentAppStatus( QString appID ){
+QString PBIBackend::currentAppStatus( QString appID, bool rawstatus ){
QString output;
int status = -999;
+ QString metaID;
//pbiID given (quicker)
- if(PBIHASH.contains(appID)){ status = PBIHASH[appID].status; }
+ if(PBIHASH.contains(appID)){ status = PBIHASH[appID].status; metaID = PBIHASH[appID].metaID; }
else{
//appID given
if(!APPHASH.contains(appID)){ return ""; }
QStringList pbilist = PBIHASH.keys();
for(int i=0; i<pbilist.length(); i++){
- if(PBIHASH[pbilist[i]].metaID == appID){ status = PBIHASH[pbilist[i]].status; }
+ if(PBIHASH[pbilist[i]].metaID == appID){ status = PBIHASH[pbilist[i]].status; metaID=appID; break; }
}
}
- //Determine if the app is currently in a pending state
- switch (status){
+ //Determine if the app is currently in a pending/running state
+ if(rawstatus){ //output the raw status for active processes
+ switch (status){
+ case InstalledPBI::DOWNLOADING:
+ output = lDownload; break;
+ case InstalledPBI::INSTALLING:
+ output = lInstall; break;
+ case InstalledPBI::REMOVING:
+ output = lRemove; break;
+ case InstalledPBI::UPDATING:
+ output = lUpdate; break;
+ default:
+ output.clear();
+ }
+ }else{
+ switch (status){
case InstalledPBI::DOWNLOADING:
- output = tr("Downloading"); break;
+ if(lDownload.startsWith("DLSTAT::")){
+ QString percent = lDownload.section("::",1,1);
+ output = QString(tr("Downloading: %1%")).arg( percent );
+ }else if(lDownload == "DLDONE"){
+ output = tr("Download Finished");
+ }else{
+ output = tr("Download Starting");
+ }
+ break;
case InstalledPBI::INSTALLING:
output = tr("Installing"); break;
case InstalledPBI::REMOVING:
output = tr("Removing"); break;
case InstalledPBI::UPDATING:
- output = tr("Updating"); break;
+ if(lUpdate.startsWith("DLSTAT::")){
+ QString percent = lUpdate.section("::",1,1);
+ output = QString(tr("Update Downloading: %1%")).arg( percent );
+ }else if(lUpdate == "DLDONE"){
+ output = tr("Starting Update");
+ }else if(lUpdate == "DLSTART"){
+ output = tr("Starting Download");
+ }else{
+ output = tr("Updating");
+ }
+ break;
case InstalledPBI::PENDINGDOWNLOAD:
output = tr("Pending Download"); break;
case InstalledPBI::PENDINGINSTALL:
@@ -552,8 +585,12 @@ QString PBIBackend::currentAppStatus( QString appID ){
output = tr("Pending Removal"); break;
case InstalledPBI::PENDINGUPDATE:
output = tr("Pending Update"); break;
+ case InstalledPBI::UPDATEAVAILABLE:
+ output = QString(tr("Update Available: %1")).arg(APPHASH[metaID].latestVersion);
+ break;
default: //do nothing for the rest
output.clear();
+ }
}
return output;
}
@@ -916,6 +953,10 @@ bool PBIBackend::loadSettings(){
void PBIBackend::slotProcessFinished(int ID){
bool resync = FALSE;
if(ID == ProcessManager::UPDATE){
+ if(sUpdate){
+ //Update stopped during installation of new version: re-install old version
+ qDebug() << "Still need to add update cancellation during install phase";
+ }
//Update the PBIHASH for installed versions
slotSyncToDatabase(TRUE);
cUpdate.clear(); //remove that it is finished
@@ -988,14 +1029,22 @@ bool PBIBackend::loadSettings(){
QTimer::singleShot(0,this,SLOT(checkProcesses()) ); //look for more processes to start
}
-void PBIBackend::slotProcessMessage(int ID, QString dlinfo){
+void PBIBackend::slotProcessMessage(int ID, QString info){
if(ID == ProcessManager::UPDATE){
- PBIHASH[cUpdate].setStatus(InstalledPBI::UPDATING, dlinfo);
+ //PBIHASH[cUpdate].setStatus(InstalledPBI::UPDATING, dlinfo);
+ lUpdate = info;
emit PBIStatusChange(cUpdate);
}else if(ID == ProcessManager::DOWNLOAD){
- PBIHASH[cDownload].setStatus(InstalledPBI::DOWNLOADING, dlinfo);
+ //PBIHASH[cDownload].setStatus(InstalledPBI::DOWNLOADING, dlinfo);
+ lDownload = info;
emit PBIStatusChange(cDownload);
- }
+ }else if( ID == ProcessManager::REMOVE){
+ lRemove = info;
+ emit PBIStatusChange(cRemove);
+ }else if( ID == ProcessManager::INSTALL){
+ lInstall = info;
+ emit PBIStatusChange(cInstall);
+ }
}
void PBIBackend::slotProcessError(int ID, QStringList log){
@@ -1182,7 +1231,7 @@ void PBIBackend::slotProcessError(int ID, QStringList log){
}else if(PENDINGREMOVAL.join(" ").contains(chk)){PBIHASH[pbiID].setStatus(InstalledPBI::PENDINGREMOVAL);}
else if(PENDINGUPDATE.join(" ").contains(chk)){PBIHASH[pbiID].setStatus(InstalledPBI::PENDINGUPDATE);}
//else if(PENDINGOTHER.join(" ").contains(chk)){PBIHASH[pbiID].setStatus(InstalledPBI::WORKING);}
- else if( !upgrade.isEmpty() ){PBIHASH[pbiID].setStatus(InstalledPBI::UPDATEAVAILABLE, upgrade); }
+ else if( !upgrade.isEmpty() ){PBIHASH[pbiID].setStatus(InstalledPBI::UPDATEAVAILABLE); }
else{ PBIHASH[pbiID].setStatus(InstalledPBI::NONE); }
}
View
3  src-qt4/pc-softwaremanager/pbiBackend.h
@@ -65,7 +65,7 @@ class PBIBackend : public QObject{
QStringList PBIInfo( QString pbiID, QStringList infoList);
QStringList CatInfo( QString catID, QStringList infoList);
QStringList AppInfo( QString appID, QStringList infoList);
- QString currentAppStatus( QString appID );
+ QString currentAppStatus( QString appID , bool rawstatus = false);
//Configuration Management
void openConfigurationDialog();
@@ -98,6 +98,7 @@ public slots:
QString cDownload, cInstall, cRemove, cUpdate, cDownloadFile, cOther; //currently running command/pbi
bool sDownload, sInstall, sRemove, sUpdate; //flag that these processes were Stopped
QStringList PENDINGDL, PENDINGINSTALL, PENDINGREMOVAL, PENDINGUPDATE, PENDINGOTHER;
+ QString lDownload, lInstall, lRemove, lUpdate; //latest string output from process
//variables - other
QString baseDlDir, dlDir; // download/install directories
QString sysArch; //system architecture
View
1  src-qt4/pc-softwaremanager/pc-softwaremanager.pro
@@ -21,7 +21,6 @@ HEADERS += mainUI.h \
SOURCES += main.cpp \
mainUI.cpp \
pbiBackend.cpp \
- containers.cpp \
pbiDBAccess.cpp \
processManager.cpp \
configDialog.cpp \
View
77 src-qt4/pc-softwaremanager/processManager.cpp
@@ -71,6 +71,7 @@ void ProcessManager::goToDirectory(ProcessID ID, QString dir){
otProc->setWorkingDirectory(dir);
}
}
+
// =========================
// ===== PUBLIC ACCESS =====
// =========================
@@ -128,8 +129,16 @@ QStringList ProcessManager::getProcessLog(ProcessID ID){
// ===== PRIVATE SLOTS =====
// =========================
QString ProcessManager::parseDlLine(QString line){
+ /*DOWNLOAD NOTIFICATION CODES:
+ Download complete: "DLDONE"
+ Download running: "DLSTAT::<percent>::<total size>::<download speed>"
+ -- A value of "??" means that it is unknown
+ Download starting: "DLSTART"
+ */
QString out;
- if(!line.startsWith("SIZE:")){ return out; }
+ if( line.startsWith("FETCH:") ){ return "DLSTART"; }
+ else if( line == "FETCHDONE"){ return "DLDONE"; }
+ else if(!line.startsWith("SIZE:")){ return out; }
//qDebug() << "parse Download Line:" << line;
//Line format: SIZE: <KB> DOWNLOADED: <KB> SPEED: <KB/s> KB/s
line = line.simplified();
@@ -148,22 +157,53 @@ QString ProcessManager::parseDlLine(QString line){
if(spdok && spd==0){spdok=FALSE;}
//Now format the output string
QString stats;
+ out = "DLSTAT::";
+ //Get percent and totals
if(totok && curok){
bool totErr = (tot==cur); //catch for a display error where the cur is always identical to the tot
+ if(!totErr){
+ //Calculate the percentage
+ double percent = (cur/tot)*100;
+ percent = int(percent*10)/10.0;
+ out.append(QString::number(percent)+"::");
+ //Now list the total
+ out.append( Extras::sizeKToDisplay(QString::number(tot)) +"::" );
+ }else{
+ //Only Total/Current is known (unknown percentage since not complete yet)
+ out.append("??::"+Extras::sizeKToDisplay(QString::number(tot))+"::");
+ }
+ }else if(curok){
+ //Only Total/Current is known (unknown percentage since not complete yet)
+ out.append("??::"+Extras::sizeKToDisplay(QString::number(cur))+"::");
+ }else if(totok){
+ //Only Total/Current is known (unknown percentage since not complete yet)
+ out.append("??::"+Extras::sizeKToDisplay(QString::number(tot))+"::");
+ }else{
+ //Unknown Total and Current
+ out.append("??::??::");
+ }
+ //Now get the speed
+ if(spdok){
+ out.append( Extras::sizeKToDisplay(QString::number(spd))+"/s" );
+ }else{
+ out.append("??");
+ }
+ /*
int i=0;
QStringList lab; lab << "KB" <<"MB"<<"GB"<<"TB"<<"PB";
while( (tot>1000) && (i<lab.length()) ){
cur=cur/1024; tot=tot/1024; i++;
}
- float percent = (cur*100)/tot;
- //round all numbers to one decimel place
- percent = int(percent*10)/10.0;
+
cur = int(cur*10)/10.0;
tot = int(tot*10)/10.0;
if(totErr){ // cur==tot
- stats = QString::number(tot)+" "+lab[i];
+ //Percentage unknown (since fetch is not done)
+ out.append("??::"+QString::number(tot)+" "+lab[i]+"::");
+ //stats = QString::number(tot)+" "+lab[i];
}else{
- stats = QString::number(cur)+"/"+QString::number(tot)+" "+lab[i]+" ("+QString::number(percent)+"%)";
+ out.append(QString::number(percent)+"::"+QString::number(tot)+" "+lab[i]+"::");
+ //stats = QString::number(cur)+"/"+QString::number(tot)+" "+lab[i]+" ("+QString::number(percent)+"%)";
}
// Format: <current>/<total> <size label> (<percent>%)
}else if(curok){
@@ -178,6 +218,7 @@ QString ProcessManager::parseDlLine(QString line){
else if(stats.isEmpty()){ out = speed; }
else if(speed.isEmpty()){ out = stats; }
else{ out = QString( tr("%1 at %2") ).arg(stats,speed); }
+ */
//qDebug() << " - Result:" << out;
return out;
}
@@ -187,11 +228,16 @@ void ProcessManager::slotUpProcMessage(){
while( upProc->canReadLine() ){
QString line = upProc->readLine().simplified();
if(line.isEmpty()){ continue; }
- // Change status back to "Updating..."
- emit ProcessMessage(UPDATE,QString());
QString dl = parseDlLine(line);
- if(!dl.isEmpty()){ emit ProcessMessage(UPDATE,dl); }
- else{ upLog << line; } //not a download line - add to the log
+ if(!dl.isEmpty()){
+ emit ProcessMessage(UPDATE,dl); //Download status
+ if( !dl.startsWith("DLSTAT::") ){
+ upLog << line; //not just a status update - add to the log (log download start/stop)
+ }
+ }else{
+ emit ProcessMessage(UPDATE,line);
+ upLog << line; //not a download line - add to the log
+ }
}
}
@@ -233,8 +279,15 @@ void ProcessManager::slotDlProcMessage(){
QString line = dlProc->readLine().simplified();
if(line.isEmpty()){ continue; }
QString dl = parseDlLine(line);
- if(!dl.isEmpty()){ emit ProcessMessage(DOWNLOAD,dl); }
- else{ dlLog << line; } //not a download line - add to the log
+ if(!dl.isEmpty()){
+ emit ProcessMessage(DOWNLOAD,dl); //Download status
+ if( !dl.startsWith("DLSTAT::") ){
+ dlLog << line; //not just a status update - add to the log (log download start/stop)
+ }
+ }else{
+ emit ProcessMessage(DOWNLOAD,line);
+ dlLog << line; //not a download line - add to the log
+ }
}
}
View
2  src-qt4/pc-softwaremanager/processManager.h
@@ -33,7 +33,7 @@ class ProcessManager : public QObject
private:
QProcess *upProc, *remProc, *dlProc, *inProc, *otProc;
QStringList upLog, remLog, dlLog, inLog;
-
+
private slots:
QString parseDlLine(QString);
void slotUpProcMessage();

No commit comments for this range

Something went wrong with that request. Please try again.