@@ -101,6 +101,8 @@ OnlineClient::OnlineClient(QWidget *parent) :
101
101
connect (m_downloadManger,&DownloadManager::downloadStarted,this ,&OnlineClient::downloadStarted);
102
102
connect (m_downloadManger,&DownloadManager::downloadFinished,this ,&OnlineClient::downloadFinished);
103
103
connect (m_downloadManger,&DownloadManager::downloadError,this ,&OnlineClient::downloadError);
104
+
105
+ ui->label_wTip ->setWordWrap (true );
104
106
}
105
107
106
108
OnlineClient::~OnlineClient ()
@@ -141,6 +143,10 @@ bool OnlineClient::downloadFileWithCurl(const QString &oldurl, const QString &ou
141
143
QString part2 = url.mid (slashIndex + 1 );
142
144
QString encodedFilename = QUrl::toPercentEncoding (part2);
143
145
command = strWget + " -o " +downlog +" -O " + outputFilePath + " " + part1+" /" +encodedFilename;
146
+ if (ui->com_tool ->currentText () == " aria2" )
147
+ {
148
+ command = " aria2c -d " +outputFilePath+" " +part1+" /" +encodedFilename + " >> " +downlog;
149
+ }
144
150
} else {
145
151
qDebug () << " 未找到'/'" ;
146
152
}
@@ -246,7 +252,6 @@ void OnlineClient::slotClickedChange(const QString &md5)
246
252
247
253
void OnlineClient::slotDoubleClickedChange (const QString &md5)
248
254
{
249
- ui->label_DownloadCount ->setText (QString::number (ui->label_DownloadCount ->text ().toInt ()+1 ));
250
255
slotClickedChange (md5);
251
256
QString name = m_datas.value (m_currentMd5).fileName ;
252
257
QString newName = name.replace (QRegExp (" \\ s+" ), " " );
@@ -258,7 +263,7 @@ void OnlineClient::slotDoubleClickedChange(const QString &md5)
258
263
ui->label_DTip ->setText (tr (" Download Ing....." ));
259
264
bool isExists = QFileInfo (saveFile).exists ();
260
265
bool isExistsHtml = QFileInfo (saveHtml).exists ();
261
- if (! isExists )
266
+ if (isExists )
262
267
{
263
268
if (QFileInfo (saveFile).size () <10 )
264
269
{
@@ -267,19 +272,19 @@ void OnlineClient::slotDoubleClickedChange(const QString &md5)
267
272
}
268
273
}
269
274
270
- if (! isExistsHtml )
275
+ if (isExistsHtml )
271
276
{
272
277
if (QFileInfo (saveHtml).size () <10 )
273
278
{
274
279
QFile (saveHtml).remove ();
275
- isExists = false ;
280
+ isExistsHtml = false ;
276
281
}
277
282
}
278
283
279
284
280
285
if (!isExists && !isExistsHtml)
281
286
{
282
-
287
+ ui-> label_DownloadCount -> setText ( QString::number (ui-> label_DownloadCount -> text (). toInt ()+ 1 ));
283
288
// Q_EMIT dApp->sigSetDownloadIng(false);
284
289
QString strExtra;
285
290
strExtra = m_currentMd5;
@@ -563,3 +568,20 @@ void OnlineClient::downloadError(const DownloadInfo &data, const QString &errorM
563
568
Q_EMIT dApp->sigDownloadError ();
564
569
ui->label_DownloadCount ->setText (QString::number (data.downloadIngTaskCount ));
565
570
}
571
+
572
+ void OnlineClient::on_com_tool_currentIndexChanged (const QString &arg1)
573
+ {
574
+ if (arg1 == " wget" )
575
+ {
576
+ ui->label_wTip ->setText (tr (" If unable to download, please check if 'wget' is installed on the command line." ));
577
+ }
578
+ else if (arg1 == " aria2" )
579
+ {
580
+ ui->label_wTip ->setText (tr (" If unable to download, please check if 'aria2' is installed on the command line.But download html web wallpaper need 'wget' ." ));
581
+ }
582
+ else
583
+ {
584
+ ui->label_wTip ->setText (tr (" If unable to download, please check if 'wget' is installed on the command line." ));
585
+ }
586
+ }
587
+
0 commit comments