WebUI: Add missing icons

This adds missing icons to WebUI (in tabs, buttons, etc.).

PR #21162.
This commit is contained in:
skomerko
2024-08-17 07:38:44 +02:00
committed by GitHub
parent efdc4af448
commit e069fbc37f
31 changed files with 217 additions and 64 deletions

View File

@@ -1603,6 +1603,7 @@ window.addEventListener("DOMContentLoaded", () => {
const id = "uploadPage";
new MochaUI.Window({
id: id,
icon: "images/qbittorrent-tray.svg",
title: "QBT_TR(Upload local torrent)QBT_TR[CONTEXT=HttpServer]",
loadMethod: "iframe",
contentURL: new URI("upload.html").toString(),
@@ -1645,6 +1646,7 @@ window.addEventListener("DOMContentLoaded", () => {
const contentURI = new URI("download.html").setData("urls", urls.map(encodeURIComponent).join("|"));
new MochaUI.Window({
id: id,
icon: "images/qbittorrent-tray.svg",
title: "QBT_TR(Download from URLs)QBT_TR[CONTEXT=downloadFromURL]",
loadMethod: "iframe",
contentURL: contentURI.toString(),

View File

@@ -130,6 +130,7 @@ const initializeWindows = function() {
new MochaUI.Window({
id: id,
icon: "images/qbittorrent-tray.svg",
title: "QBT_TR(Download from URLs)QBT_TR[CONTEXT=downloadFromURL]",
loadMethod: "iframe",
contentURL: contentUri.toString(),
@@ -155,6 +156,7 @@ const initializeWindows = function() {
const id = "preferencesPage";
new MochaUI.Window({
id: id,
icon: "images/qbittorrent-tray.svg",
title: "QBT_TR(Options)QBT_TR[CONTEXT=OptionsDialog]",
loadMethod: "xhr",
toolbar: true,
@@ -182,6 +184,7 @@ const initializeWindows = function() {
const id = "uploadPage";
new MochaUI.Window({
id: id,
icon: "images/qbittorrent-tray.svg",
title: "QBT_TR(Upload local torrent)QBT_TR[CONTEXT=HttpServer]",
loadMethod: "iframe",
contentURL: new URI("upload.html").toString(),
@@ -202,6 +205,7 @@ const initializeWindows = function() {
globalUploadLimitFN = function() {
new MochaUI.Window({
id: "uploadLimitPage",
icon: "images/qbittorrent-tray.svg",
title: "QBT_TR(Global Upload Speed Limit)QBT_TR[CONTEXT=MainWindow]",
loadMethod: "iframe",
contentURL: new URI("uploadlimit.html").setData("hashes", "global").toString(),
@@ -220,6 +224,7 @@ const initializeWindows = function() {
if (hashes.length) {
new MochaUI.Window({
id: "uploadLimitPage",
icon: "images/qbittorrent-tray.svg",
title: "QBT_TR(Torrent Upload Speed Limiting)QBT_TR[CONTEXT=TransferListWidget]",
loadMethod: "iframe",
contentURL: new URI("uploadlimit.html").setData("hashes", hashes.join("|")).toString(),
@@ -261,6 +266,7 @@ const initializeWindows = function() {
const orig = torrentsHaveSameShareRatio ? shareRatio : "";
new MochaUI.Window({
id: "shareRatioPage",
icon: "images/qbittorrent-tray.svg",
title: "QBT_TR(Torrent Upload/Download Ratio Limiting)QBT_TR[CONTEXT=UpDownRatioDialog]",
loadMethod: "iframe",
contentURL: new URI("shareratio.html").setData("hashes", hashes.join("|")).setData("orig", orig).toString(),
@@ -335,6 +341,7 @@ const initializeWindows = function() {
globalDownloadLimitFN = function() {
new MochaUI.Window({
id: "downloadLimitPage",
icon: "images/qbittorrent-tray.svg",
title: "QBT_TR(Global Download Speed Limit)QBT_TR[CONTEXT=MainWindow]",
loadMethod: "iframe",
contentURL: new URI("downloadlimit.html").setData("hashes", "global").toString(),
@@ -352,6 +359,7 @@ const initializeWindows = function() {
const id = "statisticspage";
new MochaUI.Window({
id: id,
icon: "images/qbittorrent-tray.svg",
title: "QBT_TR(Statistics)QBT_TR[CONTEXT=StatsDialog]",
loadMethod: "xhr",
contentURL: new URI("views/statistics.html").toString(),
@@ -370,6 +378,7 @@ const initializeWindows = function() {
if (hashes.length) {
new MochaUI.Window({
id: "downloadLimitPage",
icon: "images/qbittorrent-tray.svg",
title: "QBT_TR(Torrent Download Speed Limiting)QBT_TR[CONTEXT=TransferListWidget]",
loadMethod: "iframe",
contentURL: new URI("downloadlimit.html").setData("hashes", hashes.join("|")).toString(),
@@ -389,6 +398,7 @@ const initializeWindows = function() {
if (hashes.length) {
new MochaUI.Window({
id: "confirmDeletionPage",
icon: "images/qbittorrent-tray.svg",
title: "QBT_TR(Remove torrent(s))QBT_TR[CONTEXT=confirmDeletionDlg]",
loadMethod: "iframe",
contentURL: new URI("confirmdeletion.html").setData("hashes", hashes.join("|")).setData("deleteFiles", deleteFiles).toString(),
@@ -494,6 +504,7 @@ const initializeWindows = function() {
new MochaUI.Window({
id: "setLocationPage",
icon: "images/qbittorrent-tray.svg",
title: "QBT_TR(Set location)QBT_TR[CONTEXT=TransferListWidget]",
loadMethod: "iframe",
contentURL: new URI("setlocation.html").setData("hashes", hashes.join("|")).setData("path", encodeURIComponent(row.full_data.save_path)).toString(),
@@ -516,6 +527,7 @@ const initializeWindows = function() {
if (row) {
new MochaUI.Window({
id: "renamePage",
icon: "images/qbittorrent-tray.svg",
title: "QBT_TR(Rename)QBT_TR[CONTEXT=TransferListWidget]",
loadMethod: "iframe",
contentURL: new URI("rename.html").setData("hash", hash).setData("name", row.full_data.name).toString(),
@@ -539,6 +551,7 @@ const initializeWindows = function() {
if (row) {
new MochaUI.Window({
id: "multiRenamePage",
icon: "images/qbittorrent-tray.svg",
title: "QBT_TR(Renaming)QBT_TR[CONTEXT=TransferListWidget]",
data: { hash: hash, selectedRows: [] },
loadMethod: "xhr",
@@ -562,6 +575,7 @@ const initializeWindows = function() {
if (hashes.length) {
new MochaUI.Window({
id: "newCategoryPage",
icon: "images/qbittorrent-tray.svg",
title: "QBT_TR(New Category)QBT_TR[CONTEXT=TransferListWidget]",
loadMethod: "iframe",
contentURL: new URI("newcategory.html").setData("action", action).setData("hashes", hashes.join("|")).toString(),
@@ -604,6 +618,7 @@ const initializeWindows = function() {
const action = "create";
new MochaUI.Window({
id: "newCategoryPage",
icon: "images/qbittorrent-tray.svg",
title: "QBT_TR(New Category)QBT_TR[CONTEXT=CategoryFilterWidget]",
loadMethod: "iframe",
contentURL: new URI("newcategory.html").setData("action", action).toString(),
@@ -623,6 +638,7 @@ const initializeWindows = function() {
const categoryName = category_list.get(categoryHash).name + "/";
new MochaUI.Window({
id: "newSubcategoryPage",
icon: "images/qbittorrent-tray.svg",
title: "QBT_TR(New Category)QBT_TR[CONTEXT=CategoryFilterWidget]",
loadMethod: "iframe",
contentURL: new URI("newcategory.html").setData("action", action).setData("categoryName", categoryName).toString(),
@@ -642,6 +658,7 @@ const initializeWindows = function() {
const category = category_list.get(categoryHash);
new MochaUI.Window({
id: "editCategoryPage",
icon: "images/qbittorrent-tray.svg",
title: "QBT_TR(Edit Category)QBT_TR[CONTEXT=TransferListWidget]",
loadMethod: "iframe",
contentURL: new URI("newcategory.html").setData("action", action).setData("categoryName", category.name).setData("savePath", category.savePath).toString(),
@@ -718,6 +735,7 @@ const initializeWindows = function() {
if (hashes.length) {
new MochaUI.Window({
id: "confirmDeletionPage",
icon: "images/qbittorrent-tray.svg",
title: "QBT_TR(Remove torrent(s))QBT_TR[CONTEXT=confirmDeletionDlg]",
loadMethod: "iframe",
contentURL: new URI("confirmdeletion.html").setData("hashes", hashes.join("|")).toString(),
@@ -738,6 +756,7 @@ const initializeWindows = function() {
if (hashes.length) {
new MochaUI.Window({
id: "newTagPage",
icon: "images/qbittorrent-tray.svg",
title: "QBT_TR(Add tags)QBT_TR[CONTEXT=TransferListWidget]",
loadMethod: "iframe",
contentURL: new URI("newtag.html").setData("action", action).setData("hashes", hashes.join("|")).toString(),
@@ -785,6 +804,7 @@ const initializeWindows = function() {
const action = "create";
new MochaUI.Window({
id: "newTagPage",
icon: "images/qbittorrent-tray.svg",
title: "QBT_TR(New Tag)QBT_TR[CONTEXT=TagFilterWidget]",
loadMethod: "iframe",
contentURL: new URI("newtag.html").setData("action", action).toString(),
@@ -860,6 +880,7 @@ const initializeWindows = function() {
if (hashes.length) {
new MochaUI.Window({
id: "confirmDeletionPage",
icon: "images/qbittorrent-tray.svg",
title: "QBT_TR(Remove torrent(s))QBT_TR[CONTEXT=confirmDeletionDlg]",
loadMethod: "iframe",
contentURL: new URI("confirmdeletion.html").setData("hashes", hashes.join("|")).toString(),
@@ -964,6 +985,7 @@ const initializeWindows = function() {
if (hashes.length) {
new MochaUI.Window({
id: "confirmDeletionPage",
icon: "images/qbittorrent-tray.svg",
title: "QBT_TR(Remove torrent(s))QBT_TR[CONTEXT=confirmDeletionDlg]",
loadMethod: "iframe",
contentURL: new URI("confirmdeletion.html").setData("hashes", hashes.join("|")).toString(),
@@ -1157,6 +1179,7 @@ const initializeWindows = function() {
const id = "aboutpage";
new MochaUI.Window({
id: id,
icon: "images/qbittorrent-tray.svg",
title: "QBT_TR(About qBittorrent)QBT_TR[CONTEXT=AboutDialog]",
loadMethod: "xhr",
contentURL: new URI("views/about.html").toString(),

View File

@@ -545,6 +545,7 @@ window.qBittorrent.PropFiles ??= (() => {
new MochaUI.Window({
id: "renamePage",
icon: "images/qbittorrent-tray.svg",
title: "QBT_TR(Renaming)QBT_TR[CONTEXT=TorrentContentTreeView]",
loadMethod: "iframe",
contentURL: "rename_file.html?hash=" + hash + "&isFolder=" + node.isFolder
@@ -562,6 +563,7 @@ window.qBittorrent.PropFiles ??= (() => {
const multiFileRename = function(hash) {
new MochaUI.Window({
id: "multiRenamePage",
icon: "images/qbittorrent-tray.svg",
title: "QBT_TR(Renaming)QBT_TR[CONTEXT=TorrentContentTreeView]",
data: { hash: hash, selectedRows: torrentFilesTable.selectedRows },
loadMethod: "xhr",

View File

@@ -123,6 +123,7 @@ window.qBittorrent.PropPeers ??= (() => {
new MochaUI.Window({
id: "addPeersPage",
icon: "images/qbittorrent-tray.svg",
title: "QBT_TR(Add Peers)QBT_TR[CONTEXT=PeersAdditionDialog]",
loadMethod: "iframe",
contentURL: "addpeers.html?hash=" + hash,

View File

@@ -166,6 +166,7 @@ window.qBittorrent.PropTrackers ??= (() => {
return;
new MochaUI.Window({
id: "trackersPage",
icon: "images/qbittorrent-tray.svg",
title: "QBT_TR(Add trackers)QBT_TR[CONTEXT=TrackersAdditionDialog]",
loadMethod: "iframe",
contentURL: "addtrackers.html?hash=" + current_hash,
@@ -190,6 +191,7 @@ window.qBittorrent.PropTrackers ??= (() => {
const trackerUrl = encodeURIComponent(element.childNodes[1].textContent);
new MochaUI.Window({
id: "trackersPage",
icon: "images/qbittorrent-tray.svg",
title: "QBT_TR(Tracker editing)QBT_TR[CONTEXT=TrackerListWidget]",
loadMethod: "iframe",
contentURL: "edittracker.html?hash=" + current_hash + "&url=" + trackerUrl,

View File

@@ -128,7 +128,7 @@ window.qBittorrent.Search ??= (() => {
const elem = e.event.srcElement;
if (elem.className.contains("searchInputField")) {
$("startSearchButton").click();
document.getElementById("startSearchButton").click();
return;
}
@@ -179,7 +179,7 @@ window.qBittorrent.Search ??= (() => {
listItem.classList.add("selected");
listItem.addEventListener("click", (e) => {
setActiveTab(listItem);
$("startSearchButton").textContent = "QBT_TR(Search)QBT_TR[CONTEXT=SearchEngineWidget]";
document.getElementById("startSearchButton").lastChild.textContent = "QBT_TR(Search)QBT_TR[CONTEXT=SearchEngineWidget]";
});
listItem.appendChild(tabElem);
$("searchTabs").appendChild(listItem);
@@ -258,7 +258,7 @@ window.qBittorrent.Search ??= (() => {
}
else if (isTabSelected && newTabToSelect) {
setActiveTab(newTabToSelect);
$("startSearchButton").textContent = "QBT_TR(Search)QBT_TR[CONTEXT=SearchEngineWidget]";
document.getElementById("startSearchButton").lastChild.textContent = "QBT_TR(Search)QBT_TR[CONTEXT=SearchEngineWidget]";
}
};
@@ -335,7 +335,7 @@ window.qBittorrent.Search ??= (() => {
const currentSearchPattern = $("searchPattern").value.trim();
if (state.running && (state.searchPattern === currentSearchPattern)) {
// allow search to be stopped
$("startSearchButton").textContent = "QBT_TR(Stop)QBT_TR[CONTEXT=SearchEngineWidget]";
document.getElementById("startSearchButton").lastChild.textContent = "QBT_TR(Stop)QBT_TR[CONTEXT=SearchEngineWidget]";
searchPatternChanged = false;
}
@@ -392,7 +392,7 @@ window.qBittorrent.Search ??= (() => {
plugins: plugins
},
onSuccess: (response) => {
$("startSearchButton").textContent = "QBT_TR(Stop)QBT_TR[CONTEXT=SearchEngineWidget]";
document.getElementById("startSearchButton").lastChild.textContent = "QBT_TR(Stop)QBT_TR[CONTEXT=SearchEngineWidget]";
const searchId = response.id;
createSearchTab(searchId, pattern);
@@ -493,6 +493,7 @@ window.qBittorrent.Search ??= (() => {
new MochaUI.Window({
id: id,
title: "QBT_TR(Search plugins)QBT_TR[CONTEXT=PluginSelectDlg]",
icon: "images/qbittorrent-tray.svg",
loadMethod: "xhr",
contentURL: "views/searchplugins.html",
scrollbars: false,
@@ -527,11 +528,11 @@ window.qBittorrent.Search ??= (() => {
// start a new search if pattern has changed, otherwise allow the search to be stopped
if (state && (state.searchPattern === currentSearchPattern)) {
searchPatternChanged = false;
$("startSearchButton").textContent = "QBT_TR(Stop)QBT_TR[CONTEXT=SearchEngineWidget]";
document.getElementById("startSearchButton").lastChild.textContent = "QBT_TR(Stop)QBT_TR[CONTEXT=SearchEngineWidget]";
}
else {
searchPatternChanged = true;
$("startSearchButton").textContent = "QBT_TR(Search)QBT_TR[CONTEXT=SearchEngineWidget]";
document.getElementById("startSearchButton").lastChild.textContent = "QBT_TR(Search)QBT_TR[CONTEXT=SearchEngineWidget]";
}
};
@@ -567,7 +568,7 @@ window.qBittorrent.Search ??= (() => {
};
const resetSearchState = function(searchId) {
$("startSearchButton").textContent = "QBT_TR(Search)QBT_TR[CONTEXT=SearchEngineWidget]";
document.getElementById("startSearchButton").lastChild.textContent = "QBT_TR(Search)QBT_TR[CONTEXT=SearchEngineWidget]";
const state = searchState.get(searchId);
if (state) {
state.running = false;
@@ -677,7 +678,7 @@ window.qBittorrent.Search ??= (() => {
$("searchPattern").disabled = searchPluginsEmpty;
$("categorySelect").disabled = searchPluginsEmpty;
$("pluginsSelect").disabled = searchPluginsEmpty;
$("startSearchButton").disabled = searchPluginsEmpty;
document.getElementById("startSearchButton").disabled = searchPluginsEmpty;
if (window.qBittorrent.SearchPlugins !== undefined)
window.qBittorrent.SearchPlugins.updateTable();