From bbc667cb78240c01384a503b8030342aecf63320 Mon Sep 17 00:00:00 2001 From: ngosang Date: Wed, 17 Jun 2015 01:00:59 +0200 Subject: [PATCH 1/4] [Web UI] Changes in menus to keep the client's style --- src/webui/www/private/index.html | 15 ++++++++++----- src/webui/www/public/about.html | 7 +++++-- src/webui/www/public/scripts/client.js | 2 ++ src/webui/www/public/scripts/dynamicTable.js | 18 +++++++++++------- src/webui/www/public/scripts/mocha-init.js | 20 +++++++++++--------- 5 files changed, 39 insertions(+), 23 deletions(-) diff --git a/src/webui/www/private/index.html b/src/webui/www/private/index.html index 31753b09f..c5094bf53 100644 --- a/src/webui/www/private/index.html +++ b/src/webui/www/private/index.html @@ -48,14 +48,20 @@
  • QBT_TR(P&ause All)QBT_TRQBT_TR(P&ause All)QBT_TR
  • QBT_TR(&Resume)QBT_TRQBT_TR(&Resume)QBT_TR
  • QBT_TR(&Pause)QBT_TRQBT_TR(&Pause)QBT_TR
  • -
  • QBT_TR(Force recheck)QBT_TRQBT_TR(Force recheck)QBT_TR
  • QBT_TR(&Delete)QBT_TRQBT_TR(&Delete)QBT_TR
  • + +
  • QBT_TR(Top Priority)QBT_TRQBT_TR(Top Priority)QBT_TR
  • +
  • QBT_TR(Increase Priority)QBT_TRQBT_TR(Increase Priority)QBT_TR
  • +
  • QBT_TR(Decrease Priority)QBT_TRQBT_TR(Decrease Priority)QBT_TR
  • +
  • QBT_TR(Minimum Priority)QBT_TRQBT_TR(Minimum Priority)QBT_TR
  • +
    +
  • QBT_TR(Force Recheck)QBT_TRQBT_TR(Force Recheck)QBT_TR
  • QBT_TR(&View)QBT_TR
  • @@ -67,9 +73,8 @@
  • QBT_TR(&Help)QBT_TR
  • @@ -77,8 +82,8 @@
       - QBT_TR(&Add Torrent File...)QBT_TR QBT_TR(Add Torrent &Link...)QBT_TR + QBT_TR(&Add Torrent File...)QBT_TR QBT_TR(Delete)QBT_TR QBT_TR(Resume)QBT_TR QBT_TR(Pause)QBT_TR diff --git a/src/webui/www/public/about.html b/src/webui/www/public/about.html index c5c39d5dd..ec816d3f2 100644 --- a/src/webui/www/public/about.html +++ b/src/webui/www/public/about.html @@ -1,7 +1,10 @@ -

    qBittorrent ${VERSION} QBT_TR(Web UI)QBT_TR

    +

    qBittorrent ${VERSION} QBT_TR(Web UI)QBT_TR

    +

    QBT_TR(An advanced BitTorrent client programmed in C++, based on Qt toolkit and libtorrent-rasterbar.)QBT_TR

    Copyright (c) 2011-2015 The qBittorrent project

    QBT_TR(Home Page: )QBT_TR http://www.qbittorrent.org

    - +

    QBT_TR(Bug Tracker: )QBT_TR http://bugs.qbittorrent.org

    +

    QBT_TR(Forum: )QBT_TR http://forum.qbittorrent.org

    +

    QBT_TR(IRC: #qbittorrent on Freenode)QBT_TR

    QBT_TR(Original authors)QBT_TR

    Ishan Arora, Ankit Gupta, Chandan Shikhar Dua and Swapnil Kumar. diff --git a/src/webui/www/public/scripts/client.js b/src/webui/www/public/scripts/client.js index 4461d771f..f2db50cc0 100644 --- a/src/webui/www/public/scripts/client.js +++ b/src/webui/www/public/scripts/client.js @@ -218,10 +218,12 @@ window.addEvent('load', function () { myTable.columns['priority'].force_hide = !queueing_enabled; myTable.updateColumn('priority'); if (queueing_enabled) { + $('queueingLinks').removeClass('invisible'); $('queueingButtons').removeClass('invisible'); $('queueingMenuItems').removeClass('invisible'); } else { + $('queueingLinks').addClass('invisible'); $('queueingButtons').addClass('invisible'); $('queueingMenuItems').addClass('invisible'); } diff --git a/src/webui/www/public/scripts/dynamicTable.js b/src/webui/www/public/scripts/dynamicTable.js index e3e827631..28828d8fb 100644 --- a/src/webui/www/public/scripts/dynamicTable.js +++ b/src/webui/www/public/scripts/dynamicTable.js @@ -49,9 +49,9 @@ var dynamicTable = new Class({ }, initColumns : function () { + this.newColumn('priority', 'width: 30px; cursor: pointer', '#'); this.newColumn('state_icon', 'width: 16px', ''); this.newColumn('name', 'min-width: 200px; cursor: pointer', 'QBT_TR(Name)QBT_TR'); - this.newColumn('priority', 'width: 90px; cursor: pointer', '#'); this.newColumn('size', 'width: 100px; cursor: pointer', 'QBT_TR(Size)QBT_TR'); this.newColumn('progress', 'width: 80px; cursor: pointer', 'QBT_TR(Done)QBT_TR'); this.newColumn('num_seeds', 'width: 100px; cursor: pointer', 'QBT_TR(Seeds)QBT_TR'); @@ -507,6 +507,10 @@ var dynamicTable = new Class({ state = "queued"; else if (state == "checkingUP" || state == "checkingDL") state = "checking"; + else if (state == "forcedDL" || state == "metaDL") + state = "downloading"; + else if (state == "forcedUP") + state = "uploading"; var img_path = 'images/skin/' + state + '.png'; @@ -522,12 +526,6 @@ var dynamicTable = new Class({ })); }; - // name - - this.columns['name'].updateTd = function (td, row) { - td.set('html', escapeHtml(this.getRowValue(row))); - }; - // priority this.columns['priority'].updateTd = function (td, row) { @@ -548,6 +546,12 @@ var dynamicTable = new Class({ else return 0; }; + // name + + this.columns['name'].updateTd = function (td, row) { + td.set('html', escapeHtml(this.getRowValue(row))); + }; + // size this.columns['size'].updateTd = function (td, row) { diff --git a/src/webui/www/public/scripts/mocha-init.js b/src/webui/www/public/scripts/mocha-init.js index 8c9c0cf9a..f1205049f 100644 --- a/src/webui/www/public/scripts/mocha-init.js +++ b/src/webui/www/public/scripts/mocha-init.js @@ -366,8 +366,8 @@ initializeWindows = function() { title: 'QBT_TR(About)QBT_TR', loadMethod: 'xhr', contentURL: 'about.html', - width: 650, - height: 200, + width: 550, + height: 290, padding: 10 }); }); @@ -385,13 +385,15 @@ initializeWindows = function() { addClickEvent('shutdown', function(e) { new Event(e).stop(); - new Request({ - url: 'command/shutdown', - onSuccess: function() { - document.write("QBT_TR(qBittorrent has been shutdown.)QBT_TR

    QBT_TR(qBittorrent has been shutdown.)QBT_TR

    "); - stop(); - } - }).send(); + if (confirm('QBT_TR(Are you sure you want to quit qBittorrent?)QBT_TR')) { + new Request({ + url: 'command/shutdown', + onSuccess: function() { + document.write("QBT_TR(qBittorrent has been shutdown.)QBT_TR

    QBT_TR(qBittorrent has been shutdown.)QBT_TR

    "); + stop(); + } + }).send(); + } }); // Deactivate menu header links From 6f7dca1f837edfff17f632fa8e1271c93e5b0748 Mon Sep 17 00:00:00 2001 From: ngosang Date: Wed, 17 Jun 2015 01:01:57 +0200 Subject: [PATCH 2/4] [Web UI] Option to hide Top Toolbar --- src/webui/www/private/index.html | 1 + src/webui/www/public/css/Layout.css | 1 - src/webui/www/public/css/style.css | 4 ++++ src/webui/www/public/scripts/client.js | 28 +++++++++++++++++++++++++- 4 files changed, 32 insertions(+), 2 deletions(-) diff --git a/src/webui/www/private/index.html b/src/webui/www/private/index.html index c5094bf53..0459315e5 100644 --- a/src/webui/www/private/index.html +++ b/src/webui/www/private/index.html @@ -61,6 +61,7 @@
  • QBT_TR(&View)QBT_TR
  • diff --git a/src/webui/www/public/css/Layout.css b/src/webui/www/public/css/Layout.css index f400335df..c9d8bf7a4 100644 --- a/src/webui/www/public/css/Layout.css +++ b/src/webui/www/public/css/Layout.css @@ -108,7 +108,6 @@ body { /* Fixes by Chris */ /*background-color: #ccc;*/ height: 20px; - margin-bottom: 5px; border-bottom: 1px solid #3f3f3f; } diff --git a/src/webui/www/public/css/style.css b/src/webui/www/public/css/style.css index d5ddf31dd..05eadaf23 100644 --- a/src/webui/www/public/css/style.css +++ b/src/webui/www/public/css/style.css @@ -262,6 +262,10 @@ a.propButton img { } /* Mocha Customization */ +#mochaToolbar { + margin-top: 5px; +} + #mochaToolbar .divider { background-image: url(../images/skin/toolbox-divider.gif); background-repeat: no-repeat; diff --git a/src/webui/www/public/scripts/client.js b/src/webui/www/public/scripts/client.js index f2db50cc0..f1891c626 100644 --- a/src/webui/www/public/scripts/client.js +++ b/src/webui/www/public/scripts/client.js @@ -89,7 +89,6 @@ window.addEvent('load', function () { width : null, resizeLimit : [100, 300] }); - MochaUI.Desktop.setDesktopSize(); setFilter = function (f) { // Visually Select the right filter @@ -129,10 +128,23 @@ window.addEvent('load', function () { }); initializeWindows(); + // Show Top Toolbar is enabled by default + if (localStorage.getItem('show_top_toolbar') == null) + var showTopToolbar = true; + else + var showTopToolbar = localStorage.getItem('show_top_toolbar') == "true"; + if (!showTopToolbar) { + $('showTopToolbarLink').firstChild.style.opacity = '0'; + $('mochaToolbar').addClass('invisible'); + } + var speedInTitle = localStorage.getItem('speed_in_browser_title_bar') == "true"; if (!speedInTitle) $('speedInBrowserTitleBarLink').firstChild.style.opacity = '0'; + // After Show Top Toolbar + MochaUI.Desktop.setDesktopSize(); + var syncMainDataLastResponseId = 0; var serverState = {}; @@ -271,6 +283,20 @@ window.addEvent('load', function () { updateMainData(); }; + $('showTopToolbarLink').addEvent('click', function(e) { + showTopToolbar = !showTopToolbar; + localStorage.setItem('show_top_toolbar', showTopToolbar.toString()); + if (showTopToolbar) { + $('showTopToolbarLink').firstChild.style.opacity = '1'; + $('mochaToolbar').removeClass('invisible'); + } + else { + $('showTopToolbarLink').firstChild.style.opacity = '0'; + $('mochaToolbar').addClass('invisible'); + } + MochaUI.Desktop.setDesktopSize(); + }); + $('speedInBrowserTitleBarLink').addEvent('click', function(e) { speedInTitle = !speedInTitle; localStorage.setItem('speed_in_browser_title_bar', speedInTitle.toString()); From d6caf1c8395338a21e03b12876fab240823bcc2f Mon Sep 17 00:00:00 2001 From: ngosang Date: Wed, 17 Jun 2015 01:24:59 +0200 Subject: [PATCH 3/4] [Web UI] Reorder the tabs/groups in Options window --- src/webui/www/public/preferences.html | 27 +- src/webui/www/public/preferences_content.html | 233 +++++++++--------- 2 files changed, 127 insertions(+), 133 deletions(-) diff --git a/src/webui/www/public/preferences.html b/src/webui/www/public/preferences.html index 882e59bc2..50bed9489 100644 --- a/src/webui/www/public/preferences.html +++ b/src/webui/www/public/preferences.html @@ -13,11 +13,10 @@
    @@ -27,25 +26,21 @@ // Tabs MochaUI.initializeTabs('preferencesTabs'); -$('PrefConnectionLink').addEvent('click', function(e){ - $$('.PrefTab').addClass('invisible'); - $('ConnectionTab').removeClass('invisible'); -}); -$('PrefBittorrentLink').addEvent('click', function(e) { - $$('.PrefTab').addClass('invisible'); - $('BittorrentTab').removeClass('invisible'); -}); $('PrefDownloadsLink').addEvent('click', function(e) { $$('.PrefTab').addClass('invisible'); $('DownloadsTab').removeClass('invisible'); }); -$('PrefProxyLink').addEvent('click', function(e) { +$('PrefConnectionLink').addEvent('click', function(e){ $$('.PrefTab').addClass('invisible'); - $('ProxyTab').removeClass('invisible'); + $('ConnectionTab').removeClass('invisible'); }); -$('PrefFilterLink').addEvent('click', function(e) { +$('PrefSpeedLink').addEvent('click', function(e) { $$('.PrefTab').addClass('invisible'); - $('FilterTab').removeClass('invisible'); + $('SpeedTab').removeClass('invisible'); +}); +$('PrefBittorrentLink').addEvent('click', function(e) { + $$('.PrefTab').addClass('invisible'); + $('BittorrentTab').removeClass('invisible'); }); $('PrefWebUILink').addEvent('click', function(e) { $$('.PrefTab').addClass('invisible'); diff --git a/src/webui/www/public/preferences_content.html b/src/webui/www/public/preferences_content.html index ca76f6cd4..b5d15372e 100644 --- a/src/webui/www/public/preferences_content.html +++ b/src/webui/www/public/preferences_content.html @@ -1,4 +1,71 @@ -
    +
    +
    + QBT_TR(Hard Disk)QBT_TR +
    + + +
    +
    + + + +
    +
    + QBT_TR(Automatically add torrents from:)QBT_TR
    + + + + +
    QBT_TR(Watched Folder)QBT_TRQBT_TR(Download here)QBT_TR
    Add

    + + +    +
    + + +
    +
    + + +
    +
    + +
    + QBT_TR(Email notification upon download completion)QBT_TR + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    + +
    +
    + +
    +
    + +
    + QBT_TR(Run an external program on torrent completion)QBT_TR + +
    +
    +QBT_TR(The following parameters are supported:)QBT_TR +
      +
    • %f: QBT_TR(Torrent path)QBT_TR
    • +
    • %n: QBT_TR(Torrent name)QBT_TR
    • +
    +
    +
    + + + + - - - -