Browse Source

- Fix JSON communication between qBittorrent and Web UI

adaptive-webui-19844
Christophe Dumez 15 years ago
parent
commit
b5a9fe71e1
  1. 2
      src/eventmanager.cpp
  2. 1
      src/httpconnection.cpp
  3. 56
      src/webui/preferences_content.html

2
src/eventmanager.cpp

@ -354,7 +354,7 @@ void EventManager::modifiedTorrent(QTorrentHandle h) @@ -354,7 +354,7 @@ void EventManager::modifiedTorrent(QTorrentHandle h)
}
event["name"] = QVariant(h.name());
event["size"] = QVariant(misc::friendlyUnit(h.actual_size()));
event["progress"] = QVariant(h.progress());
event["progress"] = QVariant((double)h.progress());
event["dlspeed"] = QVariant(tr("%1/s", "e.g. 120 KiB/s").arg(misc::friendlyUnit(h.download_payload_rate())));
if(BTSession->isQueueingEnabled()) {
if(h.queue_position() >= 0)

1
src/httpconnection.cpp

@ -229,6 +229,7 @@ void HttpConnection::respondJson() @@ -229,6 +229,7 @@ void HttpConnection::respondJson()
QString string = json::toJson(manager->getEventList());
generator.setStatusLine(200, "OK");
generator.setContentTypeByExt("js");
//qDebug("JSON: %s", string.toLocal8Bit().data());
generator.setMessage(string);
write();
}

56
src/webui/preferences_content.html

@ -148,34 +148,34 @@ @@ -148,34 +148,34 @@
<td style="vertical-align: bottom;">_(Language:)</td>
<td style="padding-right: 3px;">
<select id="locale_select">
<option value="en_GB" style="background-image: url(Icons/flags/united_kingdom.png) no-repeat;">English</option>
<option value="fr_FR" style="background-image: url(Icons/flags/france.png) no-repeat;">Français</option>
<option value="de_DE" style="background-image: url(Icons/flags/germany.png) no-repeat;">Deutsch</option>
<option value="hu_HU" style="background-image: url(Icons/flags/hungary.png) no-repeat;">Magyar</option>
<option value="it_IT" style="background-image: url(Icons/flags/italy.png) no-repeat;">Italiano</option>
<option value="nl_NL" style="background-image: url(Icons/flags/netherlands.png) no-repeat;">Nederlands</option>
<option value="es_ES" style="background-image: url(Icons/flags/spain.png) no-repeat;">Español</option>
<option value="ca_ES" style="background-image: url(Icons/flags/spain_catalunya.png) no-repeat;">Català</option>
<option value="pt_PT" style="background-image: url(Icons/flags/portugal.png) no-repeat;">Português</option>
<option value="pt_BR" style="background-image: url(Icons/flags/brazil.png) no-repeat;">Português brasileiro</option>
<option value="pl_PL" style="background-image: url(Icons/flags/poland.png) no-repeat;">Polski</option>
<option value="cs_CZ" style="background-image: url(Icons/flags/czech.png) no-repeat;">Čeština</option>
<option value="sk_SK" style="background-image: url(Icons/flags/slovakia.png) no-repeat;">Slovenčina</option>
<option value="sr_CS" style="background-image: url(Icons/flags/serbia.png) no-repeat;">Српски</option>
<option value="ro_RO" style="background-image: url(Icons/flags/romania.png) no-repeat;">Română</option>
<option value="tr_TR" style="background-image: url(Icons/flags/turkey.png) no-repeat;">Türkçe</option>
<option value="el_GR" style="background-image: url(Icons/flags/greece.png) no-repeat;">Ελληνικά</option>
<option value="sv_SE" style="background-image: url(Icons/flags/sweden.png) no-repeat;">Svenska</option>
<option value="fi_FI" style="background-image: url(Icons/flags/finland.png) no-repeat;">Suomi</option>
<option value="nb_NO" style="background-image: url(Icons/flags/norway.png) no-repeat;">Norsk</option>
<option value="da_DK" style="background-image: url(Icons/flags/denmark.png) no-repeat;">Dansk</option>
<option value="bg_BG" style="background-image: url(Icons/flags/bulgaria.png) no-repeat;">Български</option>
<option value="uk_UA" style="background-image: url(Icons/flags/ukraine.png) no-repeat;">Українська</option>
<option value="ru_RU" style="background-image: url(Icons/flags/russia.png) no-repeat;">Русский</option>
<option value="ja_JP" style="background-image: url(Icons/flags/japan.png) no-repeat;">日本語</option>
<option value="zh_CN" style="background-image: url(Icons/flags/china.png) no-repeat;">中文 (简体)</option>
<option value="zh_TW" style="background-image: url(Icons/flags/taiwan.png) no-repeat;">中文 (繁體)</option>
<option value="ko_KR" style="background-image: url(Icons/flags/south_korea.png) no-repeat;">한글"</option>
<option value="en_GB" title="Icons/flags/united_kingdom.png">English</option>
<option value="fr_FR" title="Icons/flags/france.png">Français</option>
<option value="de_DE" title="Icons/flags/germany.png">Deutsch</option>
<option value="hu_HU" title="Icons/flags/hungary.png">Magyar</option>
<option value="it_IT" title="Icons/flags/italy.png">Italiano</option>
<option value="nl_NL" title="Icons/flags/netherlands.png">Nederlands</option>
<option value="es_ES" title="Icons/flags/spain.png">Español</option>
<option value="ca_ES" title="Icons/flags/spain_catalunya.png">Català</option>
<option value="pt_PT" title="Icons/flags/portugal.png">Português</option>
<option value="pt_BR" title="Icons/flags/brazil.png">Português brasileiro</option>
<option value="pl_PL" title="Icons/flags/poland.png">Polski</option>
<option value="cs_CZ" title="Icons/flags/czech.png">Čeština</option>
<option value="sk_SK" title="Icons/flags/slovakia.png">Slovenčina</option>
<option value="sr_CS" title="Icons/flags/serbia.png">Српски</option>
<option value="ro_RO" title="Icons/flags/romania.png">Română</option>
<option value="tr_TR" title="Icons/flags/turkey.png">Türkçe</option>
<option value="el_GR" title="Icons/flags/greece.png">Ελληνικά</option>
<option value="sv_SE" title="Icons/flags/sweden.png">Svenska</option>
<option value="fi_FI" title="Icons/flags/finland.png">Suomi</option>
<option value="nb_NO" title="Icons/flags/norway.png">Norsk</option>
<option value="da_DK" title="Icons/flags/denmark.png">Dansk</option>
<option value="bg_BG" title="Icons/flags/bulgaria.png">Български</option>
<option value="uk_UA" title="Icons/flags/ukraine.png">Українська</option>
<option value="ru_RU" title="Icons/flags/russia.png">Русский</option>
<option value="ja_JP" title="Icons/flags/japan.png">日本語</option>
<option value="zh_CN" title="Icons/flags/china.png">中文 (简体)</option>
<option value="zh_TW" title="Icons/flags/taiwan.png">中文 (繁體)</option>
<option value="ko_KR" title="Icons/flags/south_korea.png">한글"</option>
</select>
</td>
</tr>

Loading…
Cancel
Save