Browse Source

Merge pull request #3086 from ngosang/webui_titlebar

Web UI: Changes in title bar, translatable strings and style
adaptive-webui-19844
sledgehammer999 10 years ago
parent
commit
50a5e830ac
  1. 4
      src/webui/abstractwebapplication.cpp
  2. 24
      src/webui/extra_translations.h
  3. 6
      src/webui/www/private/index.html
  4. 4
      src/webui/www/private/login.html
  5. 7
      src/webui/www/public/about.html
  6. 5
      src/webui/www/public/addtrackers.html
  7. 2
      src/webui/www/public/css/Layout.css
  8. 19
      src/webui/www/public/css/style.css
  9. 2
      src/webui/www/public/download.html
  10. 10
      src/webui/www/public/preferences_content.html
  11. 9
      src/webui/www/public/properties_content.html
  12. 9
      src/webui/www/public/scripts/client.js
  13. 2
      src/webui/www/public/scripts/mocha-init.js

4
src/webui/abstractwebapplication.cpp

@ -194,7 +194,7 @@ bool AbstractWebApplication::readFile(const QString& path, QByteArray &data, QSt
QString dataStr = QString::fromUtf8(data.constData()); QString dataStr = QString::fromUtf8(data.constData());
translateDocument(dataStr); translateDocument(dataStr);
if (path.endsWith("about.html")) if (path.endsWith("about.html") || path.endsWith("index.html") || path.endsWith("client.js"))
dataStr.replace("${VERSION}", VERSION); dataStr.replace("${VERSION}", VERSION);
data = dataStr.toUtf8(); data = dataStr.toUtf8();
@ -241,7 +241,7 @@ void AbstractWebApplication::translateDocument(QString& data)
"HttpServer", "confirmDeletionDlg", "TrackerList", "TorrentFilesModel", "HttpServer", "confirmDeletionDlg", "TrackerList", "TorrentFilesModel",
"options_imp", "Preferences", "TrackersAdditionDlg", "ScanFoldersModel", "options_imp", "Preferences", "TrackersAdditionDlg", "ScanFoldersModel",
"PropTabBar", "TorrentModel", "downloadFromURL", "MainWindow", "misc", "PropTabBar", "TorrentModel", "downloadFromURL", "MainWindow", "misc",
"StatusBar" "StatusBar", "AboutDlg", "about", "PeerListWidget"
}; };
const size_t context_count = sizeof(contexts) / sizeof(contexts[0]); const size_t context_count = sizeof(contexts) / sizeof(contexts[0]);
int i = 0; int i = 0;

24
src/webui/extra_translations.h

@ -36,13 +36,12 @@ static const char *__TRANSLATIONS__[] = {
QT_TRANSLATE_NOOP("HttpServer", "File"), QT_TRANSLATE_NOOP("HttpServer", "File"),
QT_TRANSLATE_NOOP("HttpServer", "Edit"), QT_TRANSLATE_NOOP("HttpServer", "Edit"),
QT_TRANSLATE_NOOP("HttpServer", "Help"), QT_TRANSLATE_NOOP("HttpServer", "Help"),
QT_TRANSLATE_NOOP("HttpServer", "Logout"),
QT_TRANSLATE_NOOP("HttpServer", "Download Torrents from their URL or Magnet link"), QT_TRANSLATE_NOOP("HttpServer", "Download Torrents from their URL or Magnet link"),
QT_TRANSLATE_NOOP("HttpServer", "Only one link per line"), QT_TRANSLATE_NOOP("HttpServer", "Only one link per line"),
QT_TRANSLATE_NOOP("HttpServer", "Download local torrent"), QT_TRANSLATE_NOOP("HttpServer", "Download local torrent"),
QT_TRANSLATE_NOOP("HttpServer", "Torrent files were correctly added to download list."),
QT_TRANSLATE_NOOP("HttpServer", "Point to torrent file"),
QT_TRANSLATE_NOOP("HttpServer", "Download"), QT_TRANSLATE_NOOP("HttpServer", "Download"),
QT_TRANSLATE_NOOP("HttpServer", "Are you sure you want to delete the selected torrents from the transfer list and hard disk?"), QT_TRANSLATE_NOOP("HttpServer", "Are you sure you want to delete the selected torrents from the transfer list?"),
QT_TRANSLATE_NOOP("HttpServer", "Download rate limit must be greater than 0 or disabled."), QT_TRANSLATE_NOOP("HttpServer", "Download rate limit must be greater than 0 or disabled."),
QT_TRANSLATE_NOOP("HttpServer", "Upload rate limit must be greater than 0 or disabled."), QT_TRANSLATE_NOOP("HttpServer", "Upload rate limit must be greater than 0 or disabled."),
QT_TRANSLATE_NOOP("HttpServer", "Maximum number of connections limit must be greater than 0 or disabled."), QT_TRANSLATE_NOOP("HttpServer", "Maximum number of connections limit must be greater than 0 or disabled."),
@ -65,8 +64,23 @@ static const char *__TRANSLATIONS__[] = {
QT_TRANSLATE_NOOP("HttpServer", "Invalid Username or Password."), QT_TRANSLATE_NOOP("HttpServer", "Invalid Username or Password."),
QT_TRANSLATE_NOOP("HttpServer", "Password"), QT_TRANSLATE_NOOP("HttpServer", "Password"),
QT_TRANSLATE_NOOP("HttpServer", "Login"), QT_TRANSLATE_NOOP("HttpServer", "Login"),
QT_TRANSLATE_NOOP("HttpServer", "qBittorrent web User Interface"), QT_TRANSLATE_NOOP("HttpServer", "Upload Failed!"),
QT_TRANSLATE_NOOP("HttpServer", "Upload Failed!") QT_TRANSLATE_NOOP("HttpServer", "Original authors"),
QT_TRANSLATE_NOOP("HttpServer", "Upload limit:"),
QT_TRANSLATE_NOOP("HttpServer", "Download limit:"),
QT_TRANSLATE_NOOP("HttpServer", "Apply"),
QT_TRANSLATE_NOOP("HttpServer", "Add"),
QT_TRANSLATE_NOOP("HttpServer", "Upload Torrents"),
QT_TRANSLATE_NOOP("HttpServer", "Use a different port for DHT and BitTorrent"),
QT_TRANSLATE_NOOP("HttpServer", "DHT port:"),
QT_TRANSLATE_NOOP("HttpServer", "All"),
QT_TRANSLATE_NOOP("HttpServer", "Downloading"),
QT_TRANSLATE_NOOP("HttpServer", "Seeding"),
QT_TRANSLATE_NOOP("HttpServer", "Completed"),
QT_TRANSLATE_NOOP("HttpServer", "Resumed"),
QT_TRANSLATE_NOOP("HttpServer", "Paused"),
QT_TRANSLATE_NOOP("HttpServer", "Active"),
QT_TRANSLATE_NOOP("HttpServer", "Inactive")
}; };
static const struct { const char *source; const char *comment; } __COMMENTED_TRANSLATIONS__[] = { static const struct { const char *source; const char *comment; } __COMMENTED_TRANSLATIONS__[] = {

6
src/webui/www/private/index.html

@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=10; IE=9; IE=8;" /> <meta http-equiv="X-UA-Compatible" content="IE=10; IE=9; IE=8;" />
<title>QBT_TR(qBittorrent web User Interface)QBT_TR</title> <title>qBittorrent ${VERSION} QBT_TR(Web UI)QBT_TR</title>
<link rel="stylesheet" href="css/dynamicTable.css" type="text/css" /> <link rel="stylesheet" href="css/dynamicTable.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="css/style.css" /> <link rel="stylesheet" type="text/css" href="css/style.css" />
<!--<link rel="stylesheet" type="text/css" href="css/Content.css" />--> <!--<link rel="stylesheet" type="text/css" href="css/Content.css" />-->
@ -126,9 +126,9 @@
<td style="width: 2px;margin:0;"><img src="images/skin/toolbox-divider.gif" alt="" style="height: 18px; padding-left: 10px; padding-right: 10px; margin-bottom: -2px;"/></td> <td style="width: 2px;margin:0;"><img src="images/skin/toolbox-divider.gif" alt="" style="height: 18px; padding-left: 10px; padding-right: 10px; margin-bottom: -2px;"/></td>
<td style="cursor:pointer;"><img id="alternativeSpeedLimits" alt="QBT_TR(Alternative speed limits)QBT_TR" src="images/slow_off.png" /></td> <td style="cursor:pointer;"><img id="alternativeSpeedLimits" alt="QBT_TR(Alternative speed limits)QBT_TR" src="images/slow_off.png" /></td>
<td style="width: 2px;margin:0;"><img src="images/skin/toolbox-divider.gif" alt="" style="height: 18px; padding-left: 10px; padding-right: 10px; margin-bottom: -2px;"/></td> <td style="width: 2px;margin:0;"><img src="images/skin/toolbox-divider.gif" alt="" style="height: 18px; padding-left: 10px; padding-right: 10px; margin-bottom: -2px;"/></td>
<td id="DlInfos" style="cursor:pointer; min-width: 200px"></td> <td style="cursor:pointer; min-width: 200px"><img src="images/skin/download.png" alt="" style="padding-right: 5px; margin-bottom: -4px;"><span id="DlInfos"></span></td>
<td style="width: 2px;margin:0;"><img src="images/skin/toolbox-divider.gif" alt="" style="height: 18px; padding-left: 10px; padding-right: 10px; margin-bottom: -2px;"/></td> <td style="width: 2px;margin:0;"><img src="images/skin/toolbox-divider.gif" alt="" style="height: 18px; padding-left: 10px; padding-right: 10px; margin-bottom: -2px;"/></td>
<td id="UpInfos" style="cursor:pointer; min-width: 200px"></td></tr> <td style="cursor:pointer; min-width: 200px"><img src="images/skin/seeding.png" alt="" style="padding-right: 5px; margin-bottom: -3px;"><span id="UpInfos"></span></td></tr>
</table> </table>
</div> </div>
</div> </div>

4
src/webui/www/private/login.html

@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=8" /> <meta http-equiv="X-UA-Compatible" content="IE=8" />
<title>QBT_TR(qBittorrent web User Interface)QBT_TR</title> <title>qBittorrent QBT_TR(Web UI)QBT_TR</title>
<link rel="stylesheet" type="text/css" href="css/style.css" /> <link rel="stylesheet" type="text/css" href="css/style.css" />
<script type="text/javascript" src="scripts/mootools-1.2-core-yc.js" charset="utf-8"></script> <script type="text/javascript" src="scripts/mootools-1.2-core-yc.js" charset="utf-8"></script>
<script type="text/javascript"> <script type="text/javascript">
@ -70,7 +70,7 @@
</head> </head>
<body> <body>
<div id="main"> <div id="main">
<h1>QBT_TR(qBittorrent web User Interface)QBT_TR</h1> <h1>qBittorrent QBT_TR(Web UI)QBT_TR</h1>
<div id="logo" class="col"> <div id="logo" class="col">
<img src="images/qbittorrent.png" alt="qBittorrent logo"/> <img src="images/qbittorrent.png" alt="qBittorrent logo"/>
</div> </div>

7
src/webui/www/public/about.html

@ -1,8 +1,7 @@
<img src="images/skin/mascot.png" align="right"></img> <img src="images/skin/mascot.png" align="right"></img>
<p>qBittorrent ${VERSION} (Web UI)</p> <p>qBittorrent ${VERSION} QBT_TR(Web UI)QBT_TR</p>
<p>Copyright (c) 2011-2015 The qBittorrent project</p> <p>Copyright (c) 2011-2015 The qBittorrent project</p>
<p>Homepage: <a href="http://www.qbittorrent.org">http://www.qbittorrent.org</a></p> <p>QBT_TR(Home Page: )QBT_TR <a href="http://www.qbittorrent.org">http://www.qbittorrent.org</a></p>
<h3>Original authors</h3> <h3>QBT_TR(Original authors)QBT_TR</h3>
<a href="mailto:ishanarora@gmail.com">Ishan Arora</a>, <a href="mailto:ank.iitd@gmail.com">Ankit Gupta</a>, <a href="mailto:shikhar.ap@gmail.com">Chandan Shikhar Dua</a> and <a href="mailto:swapnil.iitd@gmail.com">Swapnil Kumar</a>. <a href="mailto:ishanarora@gmail.com">Ishan Arora</a>, <a href="mailto:ank.iitd@gmail.com">Ankit Gupta</a>, <a href="mailto:shikhar.ap@gmail.com">Chandan Shikhar Dua</a> and <a href="mailto:swapnil.iitd@gmail.com">Swapnil Kumar</a>.

5
src/webui/www/public/addtrackers.html

@ -23,10 +23,11 @@
</head> </head>
<body> <body>
<center> <center>
<h1 class="vcenter">QBT_TR(List of trackers to add (one per line):)QBT_TR</h1><br/> <br/>
<h2 class="vcenter">QBT_TR(List of trackers to add (one per line):)QBT_TR</h2>
<textarea name="list" id="trackersUrls" rows="10" cols="1"></textarea> <textarea name="list" id="trackersUrls" rows="10" cols="1"></textarea>
<br/> <br/>
<a id="addTrackersButton">QBT_TR(Add)QBT_TR</a> <input type="button" value="QBT_TR(Add)QBT_TR" id="addTrackersButton"/>
</center> </center>
</body> </body>
</html> </html>

2
src/webui/www/public/css/Layout.css

@ -240,7 +240,7 @@ li.divider {
#desktopFooter { #desktopFooter {
font-family: Verdana, Arial, Helvetica, sans-serif; font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px; font-size: 11px;
height: 24px; height: 24px;
padding: 6px 8px 0 8px; padding: 6px 8px 0 8px;
background: #f2f2f2; background: #f2f2f2;

19
src/webui/www/public/css/style.css

@ -350,10 +350,14 @@ ul.filterList li:hover a {
line-height: 20px; line-height: 20px;
} }
#trackersTable {
line-height: 25px;
}
#addTrackersPlus { #addTrackersPlus {
width: 16px; width: 16px;
cursor: pointer; cursor: pointer;
vertical-align: middle; margin-bottom: -3px;
} }
.torrentTable th { .torrentTable th {
@ -368,6 +372,19 @@ ul.filterList li:hover a {
background-color: #eee; background-color: #eee;
} }
#prop_general {
padding: 2px;
}
#watched_folders_tab {
border-collapse: collapse;
}
#watched_folders_tab td, #watched_folders_tab th {
padding: 2px 4px;
border: 1px solid black;
}
/* /*
* Workaround to prevent the transfer list from * Workaround to prevent the transfer list from
* disappearing when zooming in the browser. * disappearing when zooming in the browser.

2
src/webui/www/public/download.html

@ -10,7 +10,7 @@
<body> <body>
<center> <center>
<br/> <br/>
<h2 class="vcenter"><img class="vcenter" title="Download from URL" src="theme/insert-link"/>QBT_TR(Download Torrents from their URL or Magnet link)QBT_TR</h2> <h2 class="vcenter">QBT_TR(Download Torrents from their URL or Magnet link)QBT_TR</h2>
<textarea id="urls" rows="10"></textarea> <textarea id="urls" rows="10"></textarea>
<p>QBT_TR(Only one link per line)QBT_TR</p> <p>QBT_TR(Only one link per line)QBT_TR</p>
<input type="button" value="QBT_TR(Download)QBT_TR" id="downButton"/> <input type="button" value="QBT_TR(Download)QBT_TR" id="downButton"/>

10
src/webui/www/public/preferences_content.html

@ -222,7 +222,7 @@
<legend>QBT_TR(IP Filtering)QBT_TR</legend> <legend>QBT_TR(IP Filtering)QBT_TR</legend>
<input type="checkbox" id="ipfilter_enabled_checkbox" onclick="updateFilterSettings();"/> <input type="checkbox" id="ipfilter_enabled_checkbox" onclick="updateFilterSettings();"/>
<label for="ipfilter_enabled_checkbox">QBT_TR(IP Filtering)QBT_TR</label><br/> <label for="ipfilter_enabled_checkbox">QBT_TR(IP Filtering)QBT_TR</label><br/>
<label for="ipfilter_text">QBT_TR(Filter path (.dat, .p2p, .p2b):)QBT_TR</label> <label for="ipfilter_text" style="margin-left: 20px;">QBT_TR(Filter path (.dat, .p2p, .p2b):)QBT_TR</label>
<input type="text" id="ipfilter_text"/> <input type="text" id="ipfilter_text"/>
</fieldset> </fieldset>
</div> </div>
@ -255,11 +255,11 @@
<label for="peer_proxy_auth_checkbox">QBT_TR(Authentication)QBT_TR</label><br/> <label for="peer_proxy_auth_checkbox">QBT_TR(Authentication)QBT_TR</label><br/>
<div class="formRow"> <div class="formRow">
<label for="peer_proxy_username_text" style="margin-left: 20px;" class="leftLabelSmall">QBT_TR(Username:)QBT_TR</label> <label for="peer_proxy_username_text" class="leftLabelLarge">QBT_TR(Username:)QBT_TR</label>
<input type="text" id="peer_proxy_username_text" /> <input type="text" id="peer_proxy_username_text" />
</div> </div>
<div class="formRow"> <div class="formRow">
<label for="peer_proxy_password_text" style="margin-left: 20px;" class="leftLabelSmall">QBT_TR(Password:)QBT_TR</label> <label for="peer_proxy_password_text" class="leftLabelLarge">QBT_TR(Password:)QBT_TR</label>
<input type="password" id="peer_proxy_password_text" /> <input type="password" id="peer_proxy_password_text" />
</div> </div>
</fieldset> </fieldset>
@ -321,11 +321,11 @@
<input type="checkbox" id="use_https_checkbox" onclick="updateHttpsSettings();" /> <input type="checkbox" id="use_https_checkbox" onclick="updateHttpsSettings();" />
<label for="use_https_checkbox">QBT_TR(Use HTTPS instead of HTTP)QBT_TR</label><br/> <label for="use_https_checkbox">QBT_TR(Use HTTPS instead of HTTP)QBT_TR</label><br/>
<div class="formRow"> <div class="formRow">
<label for="ssl_key_textarea" style="margin-left: 20px;" class="leftLabelSmall">QBT_TR(Key:)QBT_TR</label> <label for="ssl_key_textarea" style="margin-left: 20px;">QBT_TR(Key:)QBT_TR</label>
<textarea id="ssl_key_textarea" rows="5" cols="70"></textarea> <textarea id="ssl_key_textarea" rows="5" cols="70"></textarea>
</div> </div>
<div class="formRow"> <div class="formRow">
<label for="ssl_cert_textarea" style="margin-left: 20px;" class="leftLabelSmall">QBT_TR(Certificate:)QBT_TR</label> <label for="ssl_cert_textarea" style="margin-left: 20px;">QBT_TR(Certificate:)QBT_TR</label>
<textarea id="ssl_cert_textarea" rows="5" cols="70"></textarea> <textarea id="ssl_cert_textarea" rows="5" cols="70"></textarea>
</div> </div>
<div style="padding-left: 10px;"><a href=http://httpd.apache.org/docs/2.2/ssl/ssl_faq.html#aboutcerts>Information about certificates</a></div> <div style="padding-left: 10px;"><a href=http://httpd.apache.org/docs/2.2/ssl/ssl_faq.html#aboutcerts>Information about certificates</a></div>

9
src/webui/www/public/properties_content.html

@ -15,13 +15,8 @@
<tr><td style="text-align:right; padding: 4px;">QBT_TR(Created on:)QBT_TR</td><td id="creation_date"></td></tr> <tr><td style="text-align:right; padding: 4px;">QBT_TR(Created on:)QBT_TR</td><td id="creation_date"></td></tr>
<tr><td style="text-align:right; padding: 4px;">QBT_TR(Piece size:)QBT_TR</td><td id="piece_size"></td></tr> <tr><td style="text-align:right; padding: 4px;">QBT_TR(Piece size:)QBT_TR</td><td id="piece_size"></td></tr>
<tr><td style="text-align:right; padding: 4px;">QBT_TR(Torrent hash:)QBT_TR</td><td id="torrent_hash"></td></tr> <tr><td style="text-align:right; padding: 4px;">QBT_TR(Torrent hash:)QBT_TR</td><td id="torrent_hash"></td></tr>
<tr><td style="vertical-align: top; padding: 4px; text-align:right;"> <tr><td style="vertical-align: top; padding: 4px; text-align:right;">QBT_TR(Comment:)QBT_TR</td>
<br/> <td><textarea name="comment" id="comment" rows="5" cols="80" readonly></textarea></td></tr>
QBT_TR(Comment:)QBT_TR
</td><td>
<textarea name="comment" id="comment" rows="15" cols="80" readonly>
</textarea>
</td></tr>
</table> </table>
<br/> <br/>
</fieldset> </fieldset>

9
src/webui/www/public/scripts/client.js

@ -200,10 +200,11 @@ window.addEvent('load', function () {
transfer_info += friendlyUnit(serverState.up_info_speed, true) transfer_info += friendlyUnit(serverState.up_info_speed, true)
transfer_info += " (" + friendlyUnit(serverState.up_info_data, false) + ")" transfer_info += " (" + friendlyUnit(serverState.up_info_data, false) + ")"
$("UpInfos").set('html', transfer_info); $("UpInfos").set('html', transfer_info);
if (speedInTitle) if (speedInTitle) {
document.title = "QBT_TR(D:%1 U:%2)QBT_TR".replace("%1", friendlyUnit(serverState.dl_info_speed, true)).replace("%2", friendlyUnit(serverState.up_info_speed, true)); document.title = "QBT_TR([D:%1 U:%2])QBT_TR".replace("%1", friendlyUnit(serverState.dl_info_speed, true)).replace("%2", friendlyUnit(serverState.up_info_speed, true));
else document.title += " qBittorrent ${VERSION} QBT_TR(Web UI)QBT_TR";
document.title = "QBT_TR(qBittorrent web User Interface)QBT_TR"; }else
document.title = "qBittorrent ${VERSION} QBT_TR(Web UI)QBT_TR";
$('DHTNodes').set('html', 'QBT_TR(DHT: %1 nodes)QBT_TR'.replace("%1", serverState.dht_nodes)); $('DHTNodes').set('html', 'QBT_TR(DHT: %1 nodes)QBT_TR'.replace("%1", serverState.dht_nodes));
if (serverState.connection_status == "connected") if (serverState.connection_status == "connected")
$('connectionStatus').src = 'images/skin/connected.png'; $('connectionStatus').src = 'images/skin/connected.png';

2
src/webui/www/public/scripts/mocha-init.js

@ -363,7 +363,7 @@ initializeWindows = function() {
new Event(e).stop(); new Event(e).stop();
new MochaUI.Window({ new MochaUI.Window({
id: 'aboutpage', id: 'aboutpage',
title: 'About', title: 'QBT_TR(About)QBT_TR',
loadMethod: 'xhr', loadMethod: 'xhr',
contentURL: 'about.html', contentURL: 'about.html',
width: 650, width: 650,

Loading…
Cancel
Save