From 62c52e874082ddaf51ee365d9bfc02f70efbeb4a Mon Sep 17 00:00:00 2001 From: Mark Stahler Date: Sun, 9 Mar 2008 16:16:16 +0000 Subject: [PATCH] fixed icon path, added gtk download list button --- deluge/plugins/blocklist/blocklist/core.py | 15 ++++++- .../blocklist/blocklist/data/blocklist16.png | Bin 0 -> 705 bytes .../blocklist/data/blocklist_download24.png | Bin 0 -> 926 bytes .../blocklist/data/blocklist_import24.png | Bin 0 -> 1240 bytes deluge/plugins/blocklist/blocklist/gtkui.py | 37 +++++++++++++----- .../blocklist/blocklist/torrentblocklist.py | 10 +++-- deluge/plugins/blocklist/setup.py | 2 +- 7 files changed, 48 insertions(+), 16 deletions(-) create mode 100644 deluge/plugins/blocklist/blocklist/data/blocklist16.png create mode 100644 deluge/plugins/blocklist/blocklist/data/blocklist_download24.png create mode 100644 deluge/plugins/blocklist/blocklist/data/blocklist_import24.png diff --git a/deluge/plugins/blocklist/blocklist/core.py b/deluge/plugins/blocklist/blocklist/core.py index f68bddeb0..d1757b9c3 100644 --- a/deluge/plugins/blocklist/blocklist/core.py +++ b/deluge/plugins/blocklist/blocklist/core.py @@ -33,12 +33,14 @@ # this exception statement from your version. If you delete this exception # statement from all source files in the program, then also delete it here. +import deluge.component from torrentblocklist import TorrentBlockList from deluge.log import LOG as log from deluge.plugins.corepluginbase import CorePluginBase class Core(CorePluginBase): def enable(self): + deluge.component.get("Core").session.set_max_connections(0) self.blocklist = TorrentBlockList(self.plugin) self.plugin.register_hook("post_session_load", self._post_session_load) log.debug('Blocklist: Plugin enabled..') @@ -57,7 +59,7 @@ class Core(CorePluginBase): ## Hooks for core ## def _post_session_load(self): log.info('Blocklist: Session load hook caught') - if self.blocklist.load_on_start == True or self.blocklist.load_on_start == 'True': + if self.blocklist.load_on_start == True: # Wait until an idle time to load block list import gobject gobject.idle_add(self.blocklist.import_list) @@ -86,6 +88,17 @@ class Core(CorePluginBase): def export_import_list(self): log.debug('Blocklist: Import started from GTK UI') self.blocklist.import_list() + + def export_download_list(self): + log.debug('Blocklist: Download started from GTK UI') + force_check = True + self.blocklist.check_update(force_check) + # Initialize download attempt + self.blocklist.attempt = 0 + + if self.blocklist.fetch == True: + self.blocklist.download() + def export_set_options(self, settings): log.debug("Blocklist: Set Options") diff --git a/deluge/plugins/blocklist/blocklist/data/blocklist16.png b/deluge/plugins/blocklist/blocklist/data/blocklist16.png new file mode 100644 index 0000000000000000000000000000000000000000..58240de7db77f74943870bc06dea91cdac51a288 GIT binary patch literal 705 zcmV;y0zUnTP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FZT01FZU(%pXi00007bV*G`2iO7{ z5+o(klahu200KctL_t(IjfIm>NRx3G$3MS!@4Kn*Og61hHX9lR)uD`{WEh0)U?H(6 ziomeKbrI?&-Xk)S4tDF>#i)xH=}@*6v@N1qt1zg!4dqpwv+2hEzFkr_o%X=*^nAV_ ze$NAsVEbyeSS(#a2$4u6UIW@jKx`3IIy*Z@T`t!xtJNwelSx9M(2CdVy{Kv0WI1T4 z5|(;;dd3F_2d~Y|%}McioKz}>EXziqD;kYHs(?49?RNVmkH_N<27^Q*5yIi{hjcof zFBA#@t^eNE0;kj2rzi?OpN~Kw@IupOM%vq3bBdynOeO)$+X@^GM{6t=!(h-Edw9z2 zpXwjK-gi_r8jaX(wG0m(ySJra;AYp|j>DGynM?+wV&Jsv2Ij_YetwA~gg|7{^j~%K z0!P*|a#`MT*)0vrh8({lI)z*wy_7(REc@CQIPYAfrPoH`R~Vq7nm}F-|G=`V27TVd zmF@=gQXIXMrJg8<%wgu=erHK8RE%6Mpsv}(!9DNjIPON0ilo1dur&Ld32&YgZ30!* zsoSu#O-nTIHlgl4i)yQ`nkO)dZ_4Z83|EiQ>|FtFZy@-_DYp)`^+O zPE0Wd1gi^4a-cSBxNcT nEaaDd{p*azE8x#YZms?T-dxR4E|Q|j00000NkvXXu0mjf{RTZi literal 0 HcmV?d00001 diff --git a/deluge/plugins/blocklist/blocklist/data/blocklist_download24.png b/deluge/plugins/blocklist/blocklist/data/blocklist_download24.png new file mode 100644 index 0000000000000000000000000000000000000000..de73891d94fa6846e38c487df74228a144a21850 GIT binary patch literal 926 zcmV;P17ZA$P)JUUG6JZ|sjqBFzHw6~om>VNZ{ob#Rk|9hPS|1revptrZ@X*Kl3 zyglzwr}^w5g?D+;Ki`NmmzJRW9eQ}lgvoLnx4X_|EIdx82oAK6@nOeVAF{>lQX zD2mtP;qxy(!?tbC{xZa5Y>Jk3Yw-vC1Ok3`J=IP+ora1WjFkl(R24z6ZJU$*15C!I z0GNzjpt6tXQx6&Wb14u}vAhY9){IlSLjW)}jG zJHD&yfs+qVXlZHYVAo3k9PFZKP18g~7ACHmChzNfer$MnSf1^8X3^P}&0Bc=weI|w zO7X8r&E8&Ae^&t&4Zii}J8ayziQ(TP)Yf`=VEuz2!u|uDOed!Dk7|Li^hH-r(NY3N zCY=dg`tuS4-+xE*+Gcj`+zld3Tp2Iv%Tiy4B8E|RRw*DrJz#EoavMhAA+kBeG%ZHY zM+vV9190EHt;-I@wW%0}Y1~{&zys8R@ZsrE#{NojeP#}T4foU$jgI1LXyCo~-&NBz zT}2GTNG7Hehh0kKlN-Lr;qd0wt7Cf+7d-MF(^Rn0b z!hgKfoj!PXZ*(e-qfH@%ei7*rL8I_msVoGM*FN#t z;sqL+qkruhbQF`MDaAq?!yg?cilSUAu7Ql$piT~cY!5B>jITeu|6KgWd$4bP--fok z@7dnbziEqZ?;hajhwsqS(@S~m6v>hhYiOi~&U<$Ou;=-~wxqGRrB7kw`eV-yuG{tKlU;WW^y>C}oKmsL7oTC$8cCXfc$~9H@BnD7h!)PX zu749zT;!2GuM%mMtw<1QRWC%+m0tOgMtzA=F{bEE6A%Jkgj(Iu-O&afoVBgGdV*O( zyrH9aBgM#rx(U!X>#rJlQb9#ULWviZ0uqF3-O$+{H;n*m48{ejmCNXmQZ*fT zr7x^VV7;8Hl;`oP9Up|;c)ZQ=qNvtW)^Fa*`pw&@)^n87B$>el)k+{37jP6Qm&?u= z^~(x?apC95>6yBZI`9FE4H%OVM3ZGXrOrM|U41lii}&E1!;8k4ylEZ;Q6(m(t~IQv z?^gn%!nao^rX#OQv~SpfZXdwrIYAV$RwPRcG-?YJqlna6RPgwqvAMyzKp-YHFuzbK zY$H9h0!^sYYfijdK48q=w*|0BbD*=tyH-zzd;YQ=LA-<6yckL0}9P~g4i~_*$0000