From 493499cded19ea773c0b5d11d5b0463be75efe5c Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Wed, 15 Dec 2010 19:51:19 +0000 Subject: [PATCH] COSMETIC: Same deletion confirmation dialog in the GUI and Web UI --- Changelog | 1 + src/Icons/skin/delete_perm.png | Bin 2665 -> 0 bytes src/Icons/skin/delete_perm22.png | Bin 1648 -> 0 bytes src/icons.qrc | 2 - src/webui/html/confirmdeletion.html | 69 ++++++++++++++++++++++++++++ src/webui/html/index.html | 7 +-- src/webui/scripts/mocha-init.js | 36 +++++++-------- src/webui/webui.qrc | 1 + 8 files changed, 91 insertions(+), 25 deletions(-) delete mode 100644 src/Icons/skin/delete_perm.png delete mode 100644 src/Icons/skin/delete_perm22.png create mode 100644 src/webui/html/confirmdeletion.html diff --git a/Changelog b/Changelog index dfe919ebf..3d713b577 100644 --- a/Changelog +++ b/Changelog @@ -1,6 +1,7 @@ * Unreleased - Christophe Dumez - v2.6.0 - FEATURE: Use system icons (Linux, Qt >= 4.6) - FEATURE: Simplify program preferences + - COSMETIC: Same deletion confirmation dialog in the GUI and Web UI - COSMETIC: Simplified the top toolbar * Sun Dec 5 2010 - Christophe Dumez - v2.5.0 diff --git a/src/Icons/skin/delete_perm.png b/src/Icons/skin/delete_perm.png deleted file mode 100644 index a3442b9c5bb0e881a36bfb279463560909d3e1be..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2665 zcmV-v3YPVWP)n5A0|INk~E{YN3=6L}?q4_(9ZGMTvT-LJ-tS{nu8ajf#*e zA%Rpiz>i9_{{hiJTGU)%kpPifENqexUs<2)W7m6ncJ99Kw_evstw0_5^Ulukz0Z3+ z@3T@EhWIkaQzu_aM-=7WNJP0yjzn&UBn<*mXZ>!tj4+%De1F{cy%FE@F1>v6#Kf1` zSNb9VCw}+xVO7;1lNI$*$jX2$N9Zk??$DC9J;?inKEi;PmkB)gwCmb$y!4x=-u=G- zJbCiekfud{8qxG0OR~}>$r{;>AfzSBGBhb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DG+eRuisIjbM|Jp0EuYV{bt>9bI3L#WT zBx6xl+J=SM$3z1@>2x=)>r$)L$mjFizI~fQp+LLc#&un!QiMVQ_H5rEY&3~@^v(6T zEg5NqJRp?aFRTF43ea|4nw5E$i;w6^Ch$BD&-0j?nxa%Hp|xgma+2lcWwh2rqfr`- zCfBduB9l#1X_l5c0AL}B4VmMxj)WId5&7W%IN47>h(H~;~=Hv z$dMz2!(p~<+lCO&PGDwchOy7a@q$TOeh{G)Qd&DK5IK+t?cgpJsLwy<;OmFky7d)q z+_=Go3m5p|Yp=0!<3<1ifdHeUqiC%ul}a?54%yxwscbWid;=JSF;kZD{c$_JVR(At3bkZ{($hH#k7vnd)8vNMbNlukQmHNu9y~}i z8fE9MT?inT%P~Jc&%K9}+-oH;zK1ay{0_d~8JAjjMumjfy6u$8O&&ja!t88`a;1ea zlC3WfV~n9vso*#cw{G4fpU+dRRwOc=Azb(&dUYa^r-b~whG zuWbW6M#6Ggw|0Q;bPth8m`0<)^h}ZKcc)A^WD9BZM8|V}^2ZN0OL|VhB5Oy?<9g5?+4y7;dQp}H2c{)upvxayogR;YP_YDw>L?JHZFa3QC zCa4-R=u_O<@ES} zE`9o!T6y6i@D!K_YT`NX3j%SVM@qG}tEYE+|N2ee>F!Icons/magnet.png Icons/slow.png Icons/L.gif - Icons/skin/delete_perm22.png Icons/skin/seeding.png Icons/skin/splash.png Icons/skin/tabs.gif @@ -23,7 +22,6 @@ Icons/skin/paused.png Icons/skin/slider-area.gif Icons/skin/stalledDL.png - Icons/skin/delete_perm.png Icons/skin/error.png Icons/skin/handle-icon-horizontal.gif Icons/skin/qbittorrent32.png diff --git a/src/webui/html/confirmdeletion.html b/src/webui/html/confirmdeletion.html new file mode 100644 index 000000000..1a4821736 --- /dev/null +++ b/src/webui/html/confirmdeletion.html @@ -0,0 +1,69 @@ + + + + + _(Deletion confirmation - qBittorrent) + + + + + + + + +
+ +

_(Are you sure you want to delete the selected torrents from the transfer list?)

+      _(Also delete the files on the hard disk)

+
+      +
+ + diff --git a/src/webui/html/index.html b/src/webui/html/index.html index 2e8730f56..f5a69f8bc 100644 --- a/src/webui/html/index.html +++ b/src/webui/html/index.html @@ -48,8 +48,7 @@
  • _(&Start)
  • _(&Pause)
  • _(Force recheck)
  • -
  • _(&Delete)
  • -
  • _(Delete from HD)
  • +
  • _(&Delete)
  • @@ -73,7 +72,6 @@ - @@ -89,8 +87,7 @@
    • _(Start)
    • _(Pause)
    • -
    • _(Delete)
    • -
    • _(Delete from HD)
    • +
    • _(Delete)
    • _(Priority)
      • _(Move to top)
      • diff --git a/src/webui/scripts/mocha-init.js b/src/webui/scripts/mocha-init.js index 490a60514..c3d5c58da 100644 --- a/src/webui/scripts/mocha-init.js +++ b/src/webui/scripts/mocha-init.js @@ -150,11 +150,25 @@ initializeWindows = function(){ deleteFN = function() { var h = myTable.selectedIds(); - if(h.length && confirm('_(Are you sure you want to delete the selected torrents from the transfer list?)')) { + /*if(h.length && confirm('_(Are you sure you want to delete the selected torrents from the transfer list?)')) { h.each(function(item, index){ new Request({url: '/command/delete', method: 'post', data: {hash: item}}).send(); }); - } + }*/ + if(h.length) { + new MochaUI.Window({ + id: 'confirmDeletionPage', + title: "_(Deletion confirmation - qBittorrent)", + loadMethod: 'iframe', + contentURL:'confirmdeletion.html?hashes='+JSON.encode(h), + scrollbars: false, + resizable: false, + maximizable: false, + padding: 10, + width: 424, + height: 140 + }); + } }; addClickEvent('delete', function(e){ @@ -162,21 +176,6 @@ initializeWindows = function(){ deleteFN(); }); - deleteHDFN = function() { - var h = myTable.selectedIds(); - if(h.length && confirm('_(Are you sure you want to delete the selected torrents from the transfer list and hard disk?)')) { - h.each(function(item, index){ - new Request({url: '/command/deletePerm', method: 'post', data: {hash: item}}).send(); - }); - } - }; - - - addClickEvent('deletePerm', function(e){ - new Event(e).stop(); - deleteHDFN(); - }); - pauseFN = function() { var h = myTable.selectedIds(); if(h.length){ @@ -274,7 +273,8 @@ initializeWindows = function(){ loadMethod: 'iframe', contentURL: 'about.html', width: 650, - height: 400 + height: 400, + padding: 10 }); }); diff --git a/src/webui/webui.qrc b/src/webui/webui.qrc index 366c981d3..3aefdb824 100644 --- a/src/webui/webui.qrc +++ b/src/webui/webui.qrc @@ -16,6 +16,7 @@ html/downloadlimit.html html/preferences.html html/preferences_content.html + html/confirmdeletion.html css/Core.css css/Layout.css css/Window.css