From d42ab6120e40a80d7df919f58b0d93b35e097c7e Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Tue, 24 Nov 2009 19:41:31 +0000 Subject: [PATCH] - Added right-click menu to transfer list --- src/Icons/skin/delete22.png | Bin 0 -> 1527 bytes src/Icons/skin/delete_perm22.png | Bin 0 -> 1648 bytes src/Icons/skin/pause22.png | Bin 0 -> 1410 bytes src/Icons/skin/play22.png | Bin 0 -> 1519 bytes src/icons.qrc | 4 + src/torrentpersistentdata.h | 2 +- src/webui.qrc | 3 +- src/webui/css/mootabs1.2.css | 92 ------------ src/webui/css/style.css | 16 +++ src/webui/index.html | 8 ++ src/webui/scripts/contextmenu.js | 155 +++++++++++++++++++++ src/webui/scripts/dynamicTable.js | 22 ++- src/webui/scripts/mocha-init.js | 55 ++++++-- src/webui/scripts/mootabs1.2.js | 223 ------------------------------ src/webui/transferlist.html | 33 ++++- 15 files changed, 278 insertions(+), 335 deletions(-) create mode 100644 src/Icons/skin/delete22.png create mode 100644 src/Icons/skin/delete_perm22.png create mode 100644 src/Icons/skin/pause22.png create mode 100644 src/Icons/skin/play22.png delete mode 100644 src/webui/css/mootabs1.2.css create mode 100644 src/webui/scripts/contextmenu.js delete mode 100644 src/webui/scripts/mootabs1.2.js diff --git a/src/Icons/skin/delete22.png b/src/Icons/skin/delete22.png new file mode 100644 index 0000000000000000000000000000000000000000..bb84425334a09c9f6f4d5cc0d6bcfadd62c658fe GIT binary patch literal 1527 zcmVPx#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iXf4 z69xvl!M3~r00nnRL_t(I%UzXCY+P3r$A9A30nzQz%bM~qdccrqiTK(;tKam6NL8ybv*~JT7Ts+TnFTPO-3&TIuUT_+nnsmy5 z(l{BUDkW%fD6!yr8#akAwHv!Xe(Uw;8|Pm61#iCm{ZGIL(6fsdo=By0zf?i?gdb!W zDdqXp#0Za$6)A=pP*871e7w`(gY_!AdrkUr7uVar9!H%s7Z=apI$)`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Qu1U-NIOW# zuC=!wochI!-|BdPfBgAM`k5zA{Z-7K$kO4Qs+#j&b{cACsFwZLpqS=po)L->Nxx;; zpe4@2%_2{~`pWme`96T(zJ}`G{`7l`qWJCU+4;wcbU2p`2WZGJ4U{J+ss$lS$VPoe zy-oV92jruUXg0d}&o{1q=eMu?@D`8*L4X)&0CT`Xqd9x@_{lGRW$(g)V{vt??xQL$ ziniZoFb!yt6N-!?9geo{y?_0U%fI_ox3&Hja1VF@bY<7TRe(ug#yS7Uo|*YiFCIGj zg}w9p9&0pbn)S)43c#q>$-1qLR_p%SzwW&E*46gL{Wn#^ZD0fF0U2Qb17_0CzGv8k Q5&!@I07*qoM6N<$g1D@ys{jB1 literal 0 HcmV?d00001 diff --git a/src/Icons/skin/play22.png b/src/Icons/skin/play22.png new file mode 100644 index 0000000000000000000000000000000000000000..5516f87a27ef34320cf524bc68adcc4eff95be9d GIT binary patch literal 1519 zcmVPx#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iXf4 z69o#GTB%e300nPJL_t(I%T<+2Y@AmW$A9I0JVt} zb%9t^&{RU|h9pERqgFztZV^(UERY~Hz@jTsBqZ1%Avuv)HCCaaLP;pGV+WNueoXA~ zcxF8Fee>OWSa{sJ=juxLO85NELx0_)*kj-O(J%S!8$aOri!ZDGp+mi*^ck(qX>H6D zsBsh^vgn<=<-NPE#LuiOEtLNF_D^Nkch}VJ;llJ4u1;U#rB~kS$@b)bsBL%-of`7W zfYNx`d8(A4#iPW5kC$8$U8_|#e)7(nmn#=v|21#F_We)6yU+{MS5BnToxf3G$EhI9 zP{?(2Xt`oSW3s0wCr_O?pmH4{o!KtD7i3R~NV)zx2vmJ>C0y|Ef}5r_z}$&wTk9+oeT(Pm?YgAlEy*w`(ARAmBZfT7w%O+#_z* zaLwxMR=ITcoi{I6%<~stR)xOdH%zMQ+XNYTVtiPQ4&iflnu}}U@J=K zX$jTZHl_G6ccVG1vJ}+<1HFALtu8RAC&*<7$Yi_d&R7Y}Q*;>)TXX71ojx4#$oxga_)s%&Gf~7XQO|bDqABCYZnD z$qyVr8;jQlt?iTrH4X~2MkxTz(ngc_XWwUK>?2BU6`uxzPgSv|*0^7~&+O(+3bugF zXBhqGb4;9k3ebpB<94r#XlqnyOSx2Iae0Bw@;V~ICqf3a(xk!^fz6>evvhxWoYAj* z{xckl$RfxjZD(mOWCwt5M{eH(9nh8OWdFtpgNsuf8#_zkxq~?8aLpPZD3L|$ox7#I zn-rfQ;_%+%z5i?#D6F=01|8&dp3%84GTeBQlV`t4quC&iW5l-*ao`iYPi|T7-F0!T z?}|?l=MbOlz-0$+l_d;9ieZ7`y~7-F-{9Eio}sf)pcyrA&a><5U8}v_b*seBh>Mpb ziH5|6_$0tNhlr4|Y4WK&`?rVLH*<_9zkZIsu_L%7A&z5Q;&9I4lQuMokR)Cb@iTU1 zX`$3VI&n?u;Ib$qR$1kf2ot2(S1odI{sd#@X%4^eRg5u2aolc~w4pIRiEvR}q}5bD ziLX6+G+#3R{@^_(zx4Fq!!Y=o^KPX5e-WlL=(!?OCtoB#Jc{=omn1lGxWwUIjBmAY zaf7%~BZ;;YNiMTQ_I^{QIqP=^n5GtN~kU&tM3FEKtIcons/skin/handle-icon.gif Icons/skin/url.png Icons/skin/stalledUP.png + Icons/skin/delete_perm22.png Icons/skin/filteractive.png Icons/skin/connected.png Icons/skin/pausedDL.png @@ -37,10 +38,13 @@ Icons/skin/qb_question.png Icons/skin/download.png Icons/skin/open.png + Icons/skin/play22.png Icons/skin/qbittorrent16.png Icons/skin/downloading.png Icons/skin/filterinactive.png + Icons/skin/pause22.png Icons/skin/pause_all.png + Icons/skin/delete22.png Icons/skin/play_all.png Icons/skin/pause.png Icons/skin/firewalled.png diff --git a/src/torrentpersistentdata.h b/src/torrentpersistentdata.h index a9a88cdd3..bdb1ae352 100644 --- a/src/torrentpersistentdata.h +++ b/src/torrentpersistentdata.h @@ -222,7 +222,7 @@ public: QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent-resume")); QHash all_data = settings.value("torrents", QHash()).toHash(); QHash data = all_data[hash].toHash(); - qDebug("TorrentPersistentData: getSavePath %s", data["save_path"].toString().toLocal8Bit().data()); + //qDebug("TorrentPersistentData: getSavePath %s", data["save_path"].toString().toLocal8Bit().data()); return data["save_path"].toString(); } diff --git a/src/webui.qrc b/src/webui.qrc index fb1c22824..6af00ad25 100644 --- a/src/webui.qrc +++ b/src/webui.qrc @@ -14,7 +14,6 @@ webui/css/mocha.css webui/css/dynamicTable.css webui/css/style.css - webui/css/mootabs1.2.css webui/scripts/excanvas-compressed.js webui/scripts/mocha.js webui/scripts/mocha-init.js @@ -23,7 +22,7 @@ webui/scripts/dynamicTable.js webui/scripts/client.js webui/scripts/download.js - webui/scripts/mootabs1.2.js webui/scripts/progressbar.js + webui/scripts/contextmenu.js diff --git a/src/webui/css/mootabs1.2.css b/src/webui/css/mootabs1.2.css deleted file mode 100644 index 029e1cff9..000000000 --- a/src/webui/css/mootabs1.2.css +++ /dev/null @@ -1,92 +0,0 @@ -/* - * MIT License - * Copyright (c) 2008 Christophe Dumez - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -/* - * Original code from http://www.silverscripting.com/mootabs/ - * Edited by Christophe Dumez - */ - -.toolbarTabs { - padding: 0 5px 2px 2px; - background: url(../images/skin/tabs.gif) repeat-x; - background-position: left -70px; - overflow: visible; -} - -.mootabs_title { - padding-top: 1px; - list-style: none; - margin: 0; - padding: 0; - line-height: 16px; - font-size: 11px; -} - -.mootabs_title li { - display: block; - float: left; - margin: 0 0 5px 0; - cursor: pointer; - background: url(../images/skin/tabs.gif) repeat-x; - background-position: left -35px; - -} - -.mootabs_title li.active { - background: url(../images/skin/tabs.gif) repeat-x; - background-position: left 0; -} - -.mootabs_title li a { - display: block; - margin-left: 8px; - padding: 6px 16px 5px 10px; - text-align: center; - font-weight: normal; - color: #141414; - background: url(../images/skin/tabs.gif) repeat-x; - background-position: right -35px; -} - -.mootabs_title li.active a { - color: #141414; - font-weight: bold; - background: url(../images/skin/tabs.gif) repeat-x; - background-position: right 0; -} - -.mootabs_panel { - display: none; - background-color: #ddd; - position: relative; - width: 100%; - top: -1px; - clear: both; - overflow: auto; - -} - -.mootabs_panel.active { - background-color: #e6e6e6; - display: block; -} \ No newline at end of file diff --git a/src/webui/css/style.css b/src/webui/css/style.css index 8b3d9f82a..ae798abb3 100644 --- a/src/webui/css/style.css +++ b/src/webui/css/style.css @@ -154,3 +154,19 @@ a.propButton { a.propButton img { margin-bottom: -4px; } + +/* context menu specific */ +#contextmenu { border:1px solid #999; padding:0; background:#eee; width:200px; list-style-type:none; display:none; } +#contextmenu .separator { border-top:1px solid #999; } +#contextmenu li { margin:0; padding:0; } +#contextmenu li a { display:block; padding:5px 10px 5px 35px; width:155px; font-size:12px; text-decoration:none; font-family:tahoma,arial,sans-serif; color:#000; background-position:8px 2px; background-repeat:no-repeat; } +#contextmenu li a:hover { background-color:#ddd; } +#contextmenu li a.disabled { color:#ccc; font-style:italic; } +#contextmenu li a.disabled:hover { background-color:#eee; } + +/* context menu items */ +#contextmenu li a.pause { background-image:url(../images/skin/pause22.png); } +#contextmenu li a.start { background-image:url(../images/skin/play22.png); } +#contextmenu li a.recheck { background-image:url(../images/oxygen/gear.png); } +#contextmenu li a.delete { background-image:url(../images/skin/delete22.png); } +#contextmenu li a.deleteHD { background-image:url(../images/skin/delete_perm22.png); } diff --git a/src/webui/index.html b/src/webui/index.html index 2b9935dec..bd9e3e07a 100644 --- a/src/webui/index.html +++ b/src/webui/index.html @@ -16,6 +16,7 @@ +
@@ -75,5 +76,12 @@
+ diff --git a/src/webui/scripts/contextmenu.js b/src/webui/scripts/contextmenu.js new file mode 100644 index 000000000..0b7aeebb4 --- /dev/null +++ b/src/webui/scripts/contextmenu.js @@ -0,0 +1,155 @@ +var ContextMenu = new Class({ + + //implements + Implements: [Options,Events], + + //options + options: { + actions: {}, + menu: 'contextmenu', + stopEvent: true, + targets: 'body', + trigger: 'contextmenu', + offsets: { x:0, y:0 }, + onShow: $empty, + onHide: $empty, + onClick: $empty, + fadeSpeed: 200 + }, + + //initialization + initialize: function(options) { + //set options + this.setOptions(options) + + //option diffs menu + this.menu = $(this.options.menu); + this.targets = $$(this.options.targets); + + //fx + this.fx = new Fx.Tween(this.menu, { property: 'opacity', duration:this.options.fadeSpeed }); + + //hide and begin the listener + this.hide().startListener(); + + //hide the menu + this.menu.setStyles({ 'position':'absolute','top':'-900000px', 'display':'block' }); + }, + + addTarget: function(t) { + this.targets[this.targets.length] = t; + t.addEvent(this.options.trigger,function(e) { + //enabled? + if(!this.options.disabled) { + //prevent default, if told to + if(this.options.stopEvent) { e.stop(); } + //record this as the trigger + this.options.element = $(t); + //position the menu + this.menu.setStyles({ + top: (e.page.y + this.options.offsets.y), + left: (e.page.x + this.options.offsets.x), + position: 'absolute', + 'z-index': '2000' + }); + //show the menu + this.show(); + } + }.bind(this)); + }, + + //get things started + startListener: function() { + /* all elements */ + this.targets.each(function(el) { + /* show the menu */ + el.addEvent(this.options.trigger,function(e) { + //enabled? + if(!this.options.disabled) { + //prevent default, if told to + if(this.options.stopEvent) { e.stop(); } + //record this as the trigger + this.options.element = $(el); + //position the menu + this.menu.setStyles({ + top: (e.page.y + this.options.offsets.y), + left: (e.page.x + this.options.offsets.x), + position: 'absolute', + 'z-index': '2000' + }); + //show the menu + this.show(); + } + }.bind(this)); + },this); + + /* menu items */ + this.menu.getElements('a').each(function(item) { + item.addEvent('click',function(e) { + if(!item.hasClass('disabled')) { + this.execute(item.get('href').split('#')[1],$(this.options.element)); + this.fireEvent('click',[item,e]); + } + }.bind(this)); + },this); + + //hide on body click + $(document.body).addEvent('click', function() { + this.hide(); + }.bind(this)); + }, + + //show menu + show: function(trigger) { + //this.menu.fade('in'); + this.fx.start(1); + this.fireEvent('show'); + this.shown = true; + return this; + }, + + //hide the menu + hide: function(trigger) { + if(this.shown) + { + this.fx.start(0); + //this.menu.fade('out'); + this.fireEvent('hide'); + this.shown = false; + } + return this; + }, + + //disable an item + disableItem: function(item) { + this.menu.getElements('a[href$=' + item + ']').addClass('disabled'); + return this; + }, + + //enable an item + enableItem: function(item) { + this.menu.getElements('a[href$=' + item + ']').removeClass('disabled'); + return this; + }, + + //diable the entire menu + disable: function() { + this.options.disabled = true; + return this; + }, + + //enable the entire menu + enable: function() { + this.options.disabled = false; + return this; + }, + + //execute an action + execute: function(action,element) { + if(this.options.actions[action]) { + this.options.actions[action](element,this); + } + return this; + } + +}); \ No newline at end of file diff --git a/src/webui/scripts/dynamicTable.js b/src/webui/scripts/dynamicTable.js index a2e7995e9..8d3c6b49d 100644 --- a/src/webui/scripts/dynamicTable.js +++ b/src/webui/scripts/dynamicTable.js @@ -36,13 +36,14 @@ var dynamicTable = new Class ({ initialize: function(){ }, - setup: function(table, progressIndex){ + setup: function(table, progressIndex, context_menu){ this.table = $(table); this.rows = new Hash(); this.cur = new Array(); this.priority_hidden = false; this.progressIndex = progressIndex; this.filter = 'all'; + this.context_menu = context_menu; }, getCurrentTorrentHash: function() { @@ -130,6 +131,7 @@ var dynamicTable = new Class ({ return; } var tr = new Element('tr'); + tr.addClass("menu-target"); this.rows.set(id, tr); for(var i=0; i - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -/* - * Original code from http://www.silverscripting.com/mootabs/ - * Ported to Mootools 1.2 by Christophe Dumez - */ - -var mootabs = new Class({ - - Implements: [Options], - - options: { - width: '300px', - height: '200px', - changeTransition: Fx.Transitions.Bounce.easeOut, - duration: 1000, - mouseOverClass: 'over', - activateOnLoad: 'first', - useAjax: false, - ajaxUrl: '', - ajaxOptions: {method:'get', evalScripts: true}, - ajaxLoadingText: 'Loading...' - }, - - initialize: function(element, options) { - - if(options) this.setOptions(options); - - this.el = $(element); - this.elid = element; - - this.el.setStyles({ - height: this.options.height, - width: this.options.width - }); - - this.titles = $$('#' + this.elid + ' ul li'); - this.panelHeight = this.el.getSize().y - (this.titles[0].getSize().y + 4); - this.panels = $$('#' + this.elid + ' .mootabs_panel'); - - - this.panels.setStyle('height', this.panelHeight); - - this.titles.each(function(item) { - item.addEvent('click', function(){ - if(item != this.activeTitle) - { - item.removeClass(this.options.mouseOverClass); - this.activate(item); - } - - }.bind(this)); - - item.addEvent('mouseover', function() { - if(item != this.activeTitle) - { - item.addClass(this.options.mouseOverClass); - } - }.bind(this)); - - item.addEvent('mouseout', function() { - if(item != this.activeTitle) - { - item.removeClass(this.options.mouseOverClass); - } - }.bind(this)); - }.bind(this)); - - - if(this.options.activateOnLoad != 'none') - { - if(this.options.activateOnLoad == 'first') - { - this.activate(this.titles[0], true); - } - else - { - this.activate(this.options.activateOnLoad, true); - } - } - }, - - activate: function(tab, skipAnim){ - if(! $defined(skipAnim)) - { - skipAnim = false; - } - if($type(tab) == 'string') - { - myTab = $$('#' + this.elid + ' ul li').filter('[title=' + tab + ']')[0]; - tab = myTab; - } - - if($type(tab) == 'element') - { - var newTab = tab.getProperty('title'); - - this.panels.removeClass('active'); - - this.activePanel = this.panels.filter('#' + newTab)[0]; - - this.activePanel.addClass('active'); - - if(this.options.changeTransition != 'none' && skipAnim==false) - { - this.panels.filter('#' + newTab).setStyle('height', 0); - var changeEffect = new Fx.Elements(this.panels.filter('#' + newTab), {duration: this.options.duration, transition: this.options.changeTransition}); - changeEffect.start({ - '0': { - 'height': [0, this.panelHeight] - } - }); - } - - this.titles.removeClass('active'); - - tab.addClass('active'); - - this.activeTitle = tab; - - if(this.options.useAjax) - { - this._getContent(); - } - } - }, - - _getContent: function(){ - this.activePanel.setHTML(this.options.ajaxLoadingText); - var newOptions = { - url: this.options.ajaxUrl + '?tab=' + this.activeTitle.getProperty('title'), - update: this.activePanel.getProperty('id') - }; - this.options.ajaxOptions = $merge(this.options.ajaxOptions, newOptions); - var tabRequest = new Request.HTML(this.options.ajaxOptions); - tabRequest.send(); - }, - - addTab: function(title, label, content){ - //the new title - var newTitle = new Element('li', { - 'title': title - }); - newTitle.appendText(label); - this.titles.include(newTitle); - $$('#' + this.elid + ' ul').adopt(newTitle); - newTitle.addEvent('click', function() { - this.activate(newTitle); - }.bind(this)); - - newTitle.addEvent('mouseover', function() { - if(newTitle != this.activeTitle) - { - newTitle.addClass(this.options.mouseOverClass); - } - }.bind(this)); - newTitle.addEvent('mouseout', function() { - if(newTitle != this.activeTitle) - { - newTitle.removeClass(this.options.mouseOverClass); - } - }.bind(this)); - //the new panel - var newPanel = new Element('div', { - 'style': {'height': this.options.panelHeight}, - 'id': title, - 'class': 'mootabs_panel' - }); - if(!this.options.useAjax) - { - newPanel.setHTML(content); - } - this.panels.include(newPanel); - this.el.adopt(newPanel); - }, - - removeTab: function(title){ - if(this.activeTitle.title == title) - { - this.activate(this.titles[0]); - } - $$('#' + this.elid + ' ul li').filter('[title=' + title + ']')[0].remove(); - - $$('#' + this.elid + ' .mootabs_panel').filter('#' + title)[0].remove(); - }, - - next: function(){ - var nextTab = this.activeTitle.getNext(); - if(!nextTab) { - nextTab = this.titles[0]; - } - this.activate(nextTab); - }, - - previous: function(){ - var previousTab = this.activeTitle.getPrevious(); - if(!previousTab) { - previousTab = this.titles[this.titles.length - 1]; - } - this.activate(previousTab); - } -}); \ No newline at end of file diff --git a/src/webui/transferlist.html b/src/webui/transferlist.html index 281125a17..38ee5b2f5 100644 --- a/src/webui/transferlist.html +++ b/src/webui/transferlist.html @@ -17,6 +17,33 @@ - \ No newline at end of file + + \ No newline at end of file