diff options
author | Marcos Pinto <markybob@dipconsultants.com> | 2008-01-06 19:53:47 +0000 |
---|---|---|
committer | Marcos Pinto <markybob@dipconsultants.com> | 2008-01-06 19:53:47 +0000 |
commit | 65d007c68153aa1d3b037dcb416ebef0cba966b5 (patch) | |
tree | 64fae1b3002cb4de40f5c416bd1065bbf44d0e4f /plugins | |
parent | d15a03bce1384378507bb41eed563628d93fd0ba (diff) | |
download | deluge-65d007c68153aa1d3b037dcb416ebef0cba966b5.tar.gz deluge-65d007c68153aa1d3b037dcb416ebef0cba966b5.tar.bz2 deluge-65d007c68153aa1d3b037dcb416ebef0cba966b5.zip |
browser and search are now plugins
Diffstat (limited to 'plugins')
24 files changed, 2474 insertions, 11 deletions
diff --git a/plugins/AnonymizingBrowser/__init__.py b/plugins/AnonymizingBrowser/__init__.py new file mode 100755 index 000000000..734c1d5a3 --- /dev/null +++ b/plugins/AnonymizingBrowser/__init__.py @@ -0,0 +1,597 @@ +# -*- coding: utf-8 -*- +# +# browser.py +# +# Copyright (C) Marcos Pinto 2007 <markybob@gmail.com> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, write to: +# The Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor +# Boston, MA 02110-1301, USA. +# +# In addition, as a special exception, the copyright holders give +# permission to link the code of portions of this program with the OpenSSL +# library. +# You must obey the GNU General Public License in all respects for all of +# the code used other than OpenSSL. If you modify file(s) with this +# exception, you may extend this exception to your version of the file(s), +# but you are not obligated to do so. If you do not wish to do so, delete +# this exception statement from your version. If you delete this exception +# statement from all source files in the program, then also delete it here. + +plugin_name = "Anonymizing Browser" +plugin_author = "Marcos Pinto" +plugin_version = "0.2" +plugin_description = _("Browser websites anonymously") + +def deluge_init(deluge_path): + global path + path = deluge_path + +def enable(core, interface): + global path + return Browser(path, core, interface) + +import os +import deluge.common + +if deluge.common.windows_check(): + import win32con + from ctypes import * + from ctypes.wintypes import * + from comtypes import IUnknown, GUID, COMMETHOD, COMObject + from comtypes.automation import IDispatch, VARIANT + from comtypes.hresult import * + from comtypes.client import CreateObject, GetModule + CreateObject("InternetExplorer.Application").Quit() + from comtypes.gen.SHDocVw import IWebBrowser2 + kernel32 = windll.kernel32 + user32 = windll.user32 + atl = windll.atl +else: + import gtkmozembed + +import pygtk +pygtk.require("2.0") +import gtk, gtk.keysyms, gtk.glade +import gobject +import deluge.common + +class Browser: + """class builds and displays our internal browser""" + def __init__(self, path, core, interface): + print "Found AnonymizingBrowser plugin..." + self.interface = interface + if deluge.common.windows_check(): + self.widgets = gtk.glade.XML(path + "/browserwin.glade", domain='deluge') + else: + self.widgets = gtk.glade.XML(path + "/browser.glade", domain='deluge') + self.browserbutton_image = gtk.Image() + self.browserbutton_image.set_from_pixbuf(\ + gtk.gdk.pixbuf_new_from_file_at_size(path + '/browser.png', 18, 18)) + self.browserbutton = gtk.ToolButton(self.browserbutton_image, _("Browser")) + self.browserbutton_tip = gtk.Tooltips() + self.browserbutton.set_tooltip(self.browserbutton_tip, _("Launch Anonymizing Browser")) + self.browserbutton.connect("clicked", self.launch_browser_clicked) + self.toolbar = self.interface.wtree.get_widget("tb_left") + self.toolbar.insert(self.browserbutton, -1) + self.toolbar.show_all() + self.txt_url = self.widgets.get_widget("entry1") + self.widgets.get_widget("window1").set_title("Deluge Web Browser") + self.txt_google = self.widgets.get_widget("entry2") + self.window = self.widgets.get_widget("window1") + self.window.set_default_size(940, 700) + self.window.set_position(gtk.WIN_POS_CENTER_ALWAYS) + self.window.set_focus(self.txt_url) + self.window.connect("key_press_event", self.key_pressed) + self.window.connect("delete_event", self.hide) + self.window.realize() + self.signal_dic = { "load_url" : self.load_url, + "search" : self.search, + "reload" : self.reload_url, + "go_back" : self.go_back, + "go_forward" : self.go_forward, + "go_back2" : self.go_back2, + "go_forward2" : self.go_forward2, + "stop_load" : self.stop_load, + "launch_main" : self.launch_main, + "launch_footer" : self.launch_footer, + "list_bookmarks" : self.bookmark_manager } + self.widgets.signal_autoconnect(self.signal_dic) + + if not deluge.common.windows_check(): + """do all the work nessecary setup the mozilla environment.""" + self.window.set_icon(deluge.common.get_logo(48)) + self.create_profile_directory() + self.create_prefs_js() + self.create_mime() + gtkmozembed.set_profile_path(deluge.common.CONFIG_DIR, "mozilla") + self.gtkmoz = gtkmozembed.MozEmbed() + self.gtkmoz2 = gtkmozembed.MozEmbed() + self.gtkmoz.load_url("http://deluge-torrent.org/google_search.htm") + self.gtkmoz2.load_url("http://deluge-torrent.org/google.php") + self.widgets.get_widget("frame1").add(self.gtkmoz) + self.widgets.get_widget("frame2").add(self.gtkmoz2) + self.txt_url.set_text(self.gtkmoz.get_location()) + + else: + # + # here begins all the COM nonsense necessary for IE to use a different + # user-agent string. we need to implement IOleClientSite, from which + # IE will ask for the user-agent string via IDispatch. to make it ask, + # we need to prod it via IOleControl.OnAmbientPropertyChange() + # + USER_AGENT = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1) Deluge BitTorrent/0.5.8" + PROXY = "147932-web1.dipconsultants.com:3128" + class INTERNET_PROXY_INFO(Structure): + _fields_ = [ + ('dwAccessType', c_long), + ('lpszProxy', c_char_p), + ('lpszProxyBypass', c_char_p) + ] + INTERNET_OPEN_TYPE_PROXY = 3 + INTERNET_OPTION_PROXY = 38 + InternetSetOption = windll.wininet.InternetSetOptionA + ProxyInfo = INTERNET_PROXY_INFO() + ProxyInfo.dwAccessType = INTERNET_OPEN_TYPE_PROXY + ProxyInfo.lpszProxy = "http=" + PROXY + ProxyInfo.lpszProxyBypass = "<local>" # Any address with no dots isn't proxied + InternetSetOption(0, INTERNET_OPTION_PROXY, byref(ProxyInfo), sizeof(ProxyInfo)) + + class IOleClientSite(IUnknown): + _case_insensitive_ = True + _iid_ = GUID('{00000118-0000-0000-C000-000000000046}') + _idlflags_ = [] + + IOleClientSite._methods_ = [ + COMMETHOD([], HRESULT, 'SaveObject'), + COMMETHOD([], HRESULT, 'GetMoniker', + ( ['in'], c_ulong, 'dwAssign' ), + ( ['in'], c_ulong, 'dwWhichMoniker' ), + ( ['out'], POINTER(POINTER(DWORD)), 'ppmk' )), # should be IMoniker but we don't use it + COMMETHOD([], HRESULT, 'GetContainer', + ( ['out'], POINTER(POINTER(DWORD)), 'ppContainer' )), # should be IOleContainer but we don't use it + COMMETHOD([], HRESULT, 'ShowObject'), + COMMETHOD([], HRESULT, 'OnShowWindow', + ( ['in'], c_int, 'fShow' )), + COMMETHOD([], HRESULT, 'RequestNewObjectLayout'), + ] + + class IOleObject(IUnknown): + _case_insensitive_ = True + _iid_ = GUID('{00000112-0000-0000-C000-000000000046}') + _idlflags_ = [] + + IOleObject._methods_ = [ + COMMETHOD([], HRESULT, 'SetClientSite', + ( ['in'], POINTER(IOleClientSite), 'pClientSite' )), + # ... + ] + + class IOleControl(IUnknown): + _case_insensitive_ = True + _iid_ = GUID('{B196B288-BAB4-101A-B69C-00AA00341D07}') + + IOleControl._methods_ = [ + COMMETHOD([], HRESULT, 'GetControlInfo', + (['out'], POINTER(DWORD), 'pCI')), # should be CONTROLINFO but we don't use it + COMMETHOD([], HRESULT, 'OnMnemonic', + (['in'], POINTER(DWORD), 'pMsg')), # should be MSG but we don't use it + COMMETHOD([], HRESULT, 'OnAmbientPropertyChange', + (['in'], DWORD, 'dispID')), # should be DISPID but we don't use it + # ... + ] + + DISPID_AMBIENT_USERAGENT = -5513 + + class IESite(COMObject): + _com_interfaces_ = [IDispatch, IOleClientSite] + def IDispatch_Invoke(self, this, memid, riid, lcid, wFlags, pDispParams, + pVarResult, pExcepInfo, puArgErr): + if memid == DISPID_AMBIENT_USERAGENT and pVarResult: + pVarResult[0].value = USER_AGENT + return S_OK + + _ieSite = IESite() + + # + # here ends the COM nonsense for user-agent. + # + + self.container = self.widgets.get_widget('drawingarea1') + self.container2 = self.widgets.get_widget('drawingarea2') + self.container.realize() + self.container2.realize() + self.container.show() + self.container2.show() + self.container.set_property("can-focus", True) + self.widgets.get_widget('vpaned1').set_position(600) + self.container.connect("focus", self.on_container_focus) + self.container.connect("size-allocate", self.on_container_size) + self.container2.connect("size-allocate", self.on_container_size) + + def makeBrowser(container, num): + """Create and return an instance of IE via AtlAxWin. + 'container' should be a gtk.DrawingArea which acts as IE's parent.""" + # Create the IE control instance. + atl.AtlAxWinInit() + hInstance = kernel32.GetModuleHandleA(None) + parentHwnd = container.window.handle + self.atlAxWinHwnd = \ + user32.CreateWindowExA(0, "AtlAxWin", + "{EAB22AC1-30C1-11CF-A7EB-0000C05BAE0B}", # IWebBrowser2 + win32con.WS_VISIBLE | win32con.WS_CHILD | + win32con.WS_HSCROLL | win32con.WS_VSCROLL, + 0, 0, 100, 100, parentHwnd, None, hInstance, 0) + + # Get the IWebBrowser2 interface for the IE control. + pBrowserUnk = POINTER(IUnknown)() + atl.AtlAxGetControl(self.atlAxWinHwnd, byref(pBrowserUnk)) + # Wire up our client site, which provides the User-Agent as an ambient property. + oleObject = pBrowserUnk.QueryInterface(IOleObject) + oleObject.SetClientSite(_ieSite); + oleControl = pBrowserUnk.QueryInterface(IOleControl) + oleControl.OnAmbientPropertyChange(DISPID_AMBIENT_USERAGENT); + + if num == 1: + self.pBrowser = pBrowserUnk.QueryInterface(IWebBrowser2) + self.pBrowser.Navigate("about:blank") + self.pBrowser.Navigate("http://deluge-torrent.org/google_search.htm") + + elif num == 2: + self.pBrowser2 = pBrowserUnk.QueryInterface(IWebBrowser2) + self.pBrowser2.Navigate("about:blank") + self.pBrowser2.Navigate("http://deluge-torrent.org/google.php") + return gtk.gdk.window_foreign_new(long(self.atlAxWinHwnd)) + # Create the IE controls. + self.ieParents = { + self.container: makeBrowser(self.container, 1), + self.container2: makeBrowser(self.container2, 2) + } + + + # Create the BookmarkManager + import bookmark + self.bookmarks = bookmark.BookmarkManager(path, self, + self.widgets.get_widget("toolbutton_bookmarks")) + gobject.timeout_add(int(1000), self.update) + + def launch_browser_clicked(self, arg=None): + self.window.show_all() + + def unload(self, arg=None): + self.toolbar.remove(self.browserbutton) + + def on_widget_click(self, widget, data): + self.main.window.focus() + + def on_container_size(self, widget, sizeAlloc): + self.ieParents[widget].move_resize(0, 0, sizeAlloc.width, sizeAlloc.height) + + def on_container_focus(self, widget, data): + rect = RECT() + user32.GetWindowRect(self.atlAxWinHwnd, byref(rect)) + ieHwnd = user32.WindowFromPoint(POINT(rect.left, rect.top)) + user32.SetFocus(ieHwnd) + + def create_profile_directory(widget=None): + """create the mozilla profile directory, if needed.""" + if not deluge.common.windows_check(): + path = os.path.join(deluge.common.CONFIG_DIR, "mozilla") + if not os.path.exists(path): + os.makedirs(path) + else: + pass + + def create_mime(widget=None): + """create the mimeTypes.rdf file""" + if not deluge.common.windows_check(): + mime_content = """\ +<?xml version="1.0"?> +<RDF:RDF xmlns:NC="http://home.netscape.com/NC-rdf#" + xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> + <RDF:Description RDF:about="urn:mimetype:handler:application/x-bittorrent" + NC:saveToDisk="false" + NC:alwaysAsk="false" + NC:useSystemDefault="true"> + <NC:externalApplication RDF:resource="urn:mimetype:externalApplication:application/x-bittorrent"/> + </RDF:Description> + <RDF:Seq RDF:about="urn:mimetypes:root"> + <RDF:li RDF:resource="urn:mimetype:application/x-bittorrent"/> + </RDF:Seq> + <RDF:Description RDF:about="urn:mimetypes"> + <NC:MIME-types RDF:resource="urn:mimetypes:root"/> + </RDF:Description> + <RDF:Description RDF:about="urn:mimetype:application/x-bittorrent" + NC:description="BitTorrent seed file" + NC:value="application/x-bittorrent" + NC:editable="true"> + <NC:handlerProp RDF:resource="urn:mimetype:handler:application/x-bittorrent"/> + </RDF:Description> + <RDF:Description RDF:about="urn:mimetype:externalApplication:application/x-bittorrent" + NC:prettyName="" + NC:path="" /> +</RDF:RDF> +""" + mime_path = os.path.join(deluge.common.CONFIG_DIR, "mozilla", "mimeTypes.rdf") + f = open(mime_path, "wt") + f.write(mime_content) + f.close() + else: + pass + + def create_prefs_js(widget=None): + """create the file prefs.js in the mozilla profile directory. this + does things like turn off the warning when navigating to https pages. + """ + if not deluge.common.windows_check(): + prefs_content = """\ +user_pref("security.warn_entering_secure", false); +user_pref("security.warn_entering_weak", false); +user_pref("security.warn_viewing_mixed", false); +user_pref("security.warn_leaving_secure", false); +user_pref("security.warn_submit_insecure", false); +user_pref("security.warn_entering_secure.show_once", false); +user_pref("security.warn_entering_weak.show_once", false); +user_pref("security.warn_viewing_mixed.show_once", false); +user_pref("security.warn_leaving_secure.show_once", false); +user_pref("security.warn_submit_insecure.show_once", false); +user_pref("security.enable_java", false); +user_pref("browser.xul.error_pages.enabled", false); +user_pref("general.useragent.vendor", %s); +user_pref("general.useragent.vendorSub", %s); +user_pref("network.proxy.http", "%s"); +user_pref("network.proxy.http_port", %s); +user_pref("network.proxy.ssl", "%s"); +user_pref("network.proxy.ssl_port", %s); +user_pref("network.proxy.type", 1); +""" % (repr("Deluge BitTorrent"), + repr("0.5.8"), + '147932-web1.dipconsultants.com', + 3128, + '147932-web1.dipconsultants.com', + 3128) + prefs_path = os.path.join(deluge.common.CONFIG_DIR, "mozilla", "prefs.js") + f = open(prefs_path, "wt") + f.write(prefs_content) + f.close() + else: + pass + + def update(self): + """updates the GUI""" + if self.window.get_focus() != self.txt_url: + if not deluge.common.windows_check(): + self.txt_url.set_text(self.gtkmoz.get_location()) + try: + self.widgets.get_widget("window1").set_title("Deluge Web Browser " \ + + self.gtkmoz.get_title()) + except: + pass + if self.gtkmoz.can_go_back(): + self.widgets.get_widget("toolbutton_back").set_sensitive(True) + else: + self.widgets.get_widget("toolbutton_back").set_sensitive(False) + if self.gtkmoz.can_go_forward(): + self.widgets.get_widget("toolbutton_forward").set_sensitive(True) + else: + self.widgets.get_widget("toolbutton_forward").set_sensitive(False) + if self.gtkmoz2.can_go_back(): + self.widgets.get_widget("toolbutton_back2").set_sensitive(True) + else: + self.widgets.get_widget("toolbutton_back2").set_sensitive(False) + if self.gtkmoz2.can_go_forward(): + self.widgets.get_widget("toolbutton_forward2").set_sensitive(True) + else: + self.widgets.get_widget("toolbutton_forward2").set_sensitive(False) + else: + self.txt_url.set_text(self.pBrowser.LocationURL) + try: + self.widgets.get_widget("window1").set_title("Deluge Web Browser " \ + + self.pBrowser.LocationName) + except: + pass + return True + + def key_pressed(self, widget, key): + """captures ctrl+ keys and sets focus accordingly, or quits""" + if key.keyval in (gtk.keysyms.L, gtk.keysyms.l) and (key.state & \ + gtk.gdk.CONTROL_MASK) != 0: + self.window.set_focus(self.txt_url) + elif key.keyval in (gtk.keysyms.K, gtk.keysyms.k) and (key.state & \ + gtk.gdk.CONTROL_MASK) != 0: + self.window.set_focus(self.txt_google) + elif key.keyval in (gtk.keysyms.R, gtk.keysyms.r) and (key.state & \ + gtk.gdk.CONTROL_MASK) != 0: + if not deluge.common.windows_check(): + self.gtkmoz.reload(0) + else: + self.pBrowser.refresh() + elif key.keyval == gtk.keysyms.Return and (key.state & \ + gtk.gdk.CONTROL_MASK) != 0: + if not deluge.common.windows_check(): + self.gtkmoz.load_url("http://www.%s.com" % (self.txt_url.get_text())) + self.txt_url.set_text(self.gtkmoz.get_location()) + else: + v = byref(VARIANT()) + self.pBrowser.Navigate("http://www.%s.com" % (self.txt_url.get_text()), v, v, v, v) + elif key.keyval == gtk.keysyms.Return and (key.state & \ + gtk.gdk.SHIFT_MASK) != 0: + if not deluge.common.windows_check(): + self.gtkmoz.load_url("http://www.%s.net" % (self.txt_url.get_text())) + self.txt_url.set_text(self.gtkmoz.get_location()) + else: + v = byref(VARIANT()) + self.pBrowser.Navigate("http://www.%s.net" % (self.txt_url.get_text()), v, v, v, v) + elif key.keyval in (gtk.keysyms.Q, gtk.keysyms.q, gtk.keysyms.W, \ + gtk.keysyms.w) and (key.state & gtk.gdk.CONTROL_MASK) != 0: + self.hide() + + + def search(self, widget=None): + """open a new search page""" + if not deluge.common.windows_check(): + self.gtkmoz.load_url("http://www.google.com/cse?cx=0103316019315568500" + + "92%3Apfadwhze_jy&q=" + self.txt_google.get_text() + "&sa=Search&cof=FORID%3A1") + try: + self.widgets.get_widget("window1").set_title("Deluge Web Browser " \ + + self.gtkmoz.get_title()) + except: + pass + else: + v = byref(VARIANT()) + self.pBrowser.Navigate("http://www.google.com/cse?cx=0103316019315568500" + + "92%3Apfadwhze_jy&q=" + self.txt_google.get_text() + "&sa=Search&cof=FORID%3A1", v, v, v, v) + + def load_url(self, widget=None): + """open a new url""" + if not deluge.common.windows_check(): + self.gtkmoz.load_url(self.txt_url.get_text()) + try: + self.widgets.get_widget("window1").set_title("Deluge Web Browser " \ + + self.gtkmoz.get_title()) + except: + pass + else: + v = byref(VARIANT()) + self.pBrowser.Navigate(self.txt_url.get_text(), v, v, v, v) + + def launch_site(self, url): + """open a new url""" + if not deluge.common.windows_check(): + self.gtkmoz.load_url(url) + try: + self.widgets.get_widget("window1").set_title("Deluge Web Browser " \ + + self.gtkmoz.get_title()) + except: + pass + else: + v = byref(VARIANT()) + self.pBrowser.Navigate(url, v, v, v, v) + + def reload_url(self, widget=None): + """refresh the current url""" + if not deluge.common.windows_check(): + self.gtkmoz.reload(0) + else: + self.pBrowser.refresh() + + def launch_main(self, widget=None): + """loads frame into external browser""" + import threading + import webbrowser + if not deluge.common.windows_check(): + self.link = self.gtkmoz.get_location() + else: + self.link = self.pBrowser.LocationURL + + class BrowserThread(threading.Thread): + def __init__(self, link): + threading.Thread.__init__(self) + self.url = link + def run(self): + webbrowser.open(self.url) + BrowserThread(self.link).start() + return True + + def launch_footer(self, widget=None): + """loads frame into external browser""" + import threading + import webbrowser + if not deluge.common.windows_check(): + self.link = self.gtkmoz2.get_location() + else: + self.link = self.pBrowser2.LocationURL + + class BrowserThread(threading.Thread): + def __init__(self, link): + threading.Thread.__init__(self) + self.url = link + def run(self): + webbrowser.open(self.url) + BrowserThread(self.link).start() + return True + + def go_back(self, widget=None): + """go a page back""" + if not deluge.common.windows_check(): + if self.gtkmoz.can_go_back(): + self.gtkmoz.go_back() + self.txt_url.set_text(self.gtkmoz.get_location()) + try: + self.widgets.get_widget("window1").set_title("Deluge Web Browser " \ + + self.gtkmoz.get_title()) + except: + pass + else: + self.pBrowser.GoBack() + self.txt_url.set_text(self.pBrowser.LocationURL) + try: + self.widgets.get_widget("window1").set_title("Deluge Web Browser" \ + + self.pBrowser.LocationName) + except: + pass + + def go_forward(self, widget=None): + """go a page ahead""" + if not deluge.common.windows_check(): + if self.gtkmoz.can_go_forward(): + self.gtkmoz.go_forward() + self.txt_url.set_text(self.gtkmoz.get_location()) + try: + self.widgets.get_widget("window1").set_title("Deluge Web Browser " \ + + self.gtkmoz.get_title()) + except: + pass + else: + self.pBrowser.GoForward() + self.txt_url.set_text(self.pBrowser.LocationURL) + try: + self.widgets.get_widget("window1").set_title("Deluge Web Browser" \ + + self.pBrowser.LocationName) + except: + pass + + def go_back2(self, widget=None): + """go a page back""" + if not deluge.common.windows_check(): + if self.gtkmoz2.can_go_back(): + self.gtkmoz2.go_back() + else: + self.pBrowser2.GoBack() + + def go_forward2(self, widget=None): + """go a page ahead""" + if not deluge.common.windows_check(): + if self.gtkmoz2.can_go_forward(): + self.gtkmoz2.go_forward() + else: + self.pBrowser2.GoForward() + + def stop_load(self, widget=None): + """stop loading current page""" + if not deluge.common.windows_check(): + self.gtkmoz.stop_load() + else: + self.pBrowser.Stop() + + def bookmark_manager(self, widget=None): + """show bookmark manager""" + self.bookmarks.show() + + def hide(self, widget=None, arg=None): + """close browser""" + self.window.hide() + return True + diff --git a/plugins/AnonymizingBrowser/bookmark.py b/plugins/AnonymizingBrowser/bookmark.py new file mode 100755 index 000000000..bf74c58a3 --- /dev/null +++ b/plugins/AnonymizingBrowser/bookmark.py @@ -0,0 +1,257 @@ +# -*- coding: utf-8 -*- +# +# bookmark.py +# +# Copyright (C) Marcos Pinto 2007 <markybob@gmail.com> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, write to: +# The Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor +# Boston, MA 02110-1301, USA. +# +# In addition, as a special exception, the copyright holders give +# permission to link the code of portions of this program with the OpenSSL +# library. +# You must obey the GNU General Public License in all respects for all of +# the code used other than OpenSSL. If you modify file(s) with this +# exception, you may extend this exception to your version of the file(s), +# but you are not obligated to do so. If you do not wish to do so, delete +# 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 cPickle +import os.path +import pygtk +pygtk.require("2.0") +import gtk.glade +import deluge.common + +class BookmarkManager: + """class builds and displays our internal bookmark manager""" + def __init__(self, path, parent, toolbutton): + """show bookmark manager""" + self.bookmarks = [] + self.toolbutton = toolbutton + self.menu = gtk.Menu() + self.parent = parent + self.widgets = gtk.glade.XML(path + "/list_bookmarks.glade") + self.list_dlg = self.widgets.get_widget("list_bookmarks_dialog") + self.treeview = self.widgets.get_widget("bookmarks_treeview") + self.add_bookmark_dialog = self.widgets.get_widget("add_bookmark_dialog") + self.edit_bookmark_dialog = self.widgets.get_widget("edit_bookmark_dialog") + if deluge.common.windows_check(): + self.add_bookmark_dialog.set_position(gtk.WIN_POS_CENTER_ALWAYS) + self.edit_bookmark_dialog.set_position(gtk.WIN_POS_CENTER_ALWAYS) + else: + self.list_dlg.set_icon(deluge.common.get_logo(18)) + self.edit_bookmark_dialog.set_icon(deluge.common.get_logo(18)) + self.add_bookmark_dialog.set_icon(deluge.common.get_logo(18)) + self.list_dlg.set_transient_for(self.parent.window) + self.signal_dic = { "on_button_cancel_clicked" : self.on_button_cancel_clicked, + "on_button_ok_clicked" : self.on_button_ok_clicked, + "on_button_add_clicked" : self.on_button_add_clicked, + "on_button_edit_clicked" : self.on_button_edit_clicked, + "on_button_remove_clicked" : self.on_button_remove_clicked, + "on_button_add_ok_clicked" : self.on_button_add_ok_clicked, + "on_button_add_cancel_clicked" : self.on_button_add_cancel_clicked, + "on_button_edit_ok_clicked" : self.on_button_edit_ok_clicked, + "on_button_edit_cancel_clicked" : self.on_button_edit_cancel_clicked, + "quit" : self.on_button_cancel_clicked + } + self.widgets.signal_autoconnect(self.signal_dic) + # Create a liststore for tier, url + self.liststore = gtk.ListStore(str, str) + + # Create the columns + self.treeview.append_column( + gtk.TreeViewColumn("Name", gtk.CellRendererText(), text=0)) + self.treeview.append_column( + gtk.TreeViewColumn("URL", gtk.CellRendererText(), text=1)) + + self.treeview.set_model(self.liststore) + self.liststore.set_sort_column_id(0, gtk.SORT_ASCENDING) + self.load_bookmarks() + + self.build_menu() + + def show(self): + self.list_dlg.show() + + def hide(self): + self.list_dlg.hide() + if deluge.common.windows_check(): + path = os.path.join(deluge.common.CONFIG_DIR, "bookmarks.save") + else: + path = os.path.join(deluge.common.CONFIG_DIR, "mozilla", "bookmarks.save") + try: + bookmark_file = open(path, "wb") + cPickle.dump(self.bookmarks, bookmark_file) + bookmark_file.close() + except Exception, e: + print "Unable to save bookmarks file: %s", e + + def load_bookmarks(self): + bookmarks = None + if deluge.common.windows_check(): + path = os.path.join(deluge.common.CONFIG_DIR, "bookmarks.save") + else: + path = os.path.join(deluge.common.CONFIG_DIR, "mozilla", "bookmarks.save") + + if os.path.exists(path): + try: + bookmark_file = open(path, "rb") + bookmarks = cPickle.load(bookmark_file) + bookmark_file.close() + except Exception, e: + print "Unable to load bookmarks file: %s", e + + if bookmarks == None: + return + + self.liststore.clear() + + for bookmark in bookmarks: + self.liststore.append([bookmark["name"], bookmark["url"]]) + + self.bookmarks = bookmarks + + self.build_menu() + + def build_menu(self): + """Builds the bookmark menu""" + self.menu = gtk.Menu() + menuitem = gtk.MenuItem("Bookmark This Page...") + menuitem.connect("activate", self.menuitem_activate) + self.menu.append(menuitem) + menuitem = gtk.SeparatorMenuItem() + self.menu.append(menuitem) + # Iterate through the bookmark list and make menuitems for them + def add_menuitem(model, path, row, data): + menuitem = gtk.MenuItem(model.get_value(row, 0)) + menuitem.connect("activate", self.menuitem_activate) + self.menu.append(menuitem) + + self.liststore.foreach(add_menuitem, None) + self.menu.show_all() + # Set the new menu on the toolbutton + self.toolbutton.set_menu(self.menu) + + def add_bookmark(self, name, url): + """Adds a bookmark to the list""" + self.liststore.append([name, url]) + self.build_menu() + + def get_selected(self): + """Returns the selected bookmark""" + return self.treeview.get_selection().get_selected()[1] + + def on_button_add_clicked(self, widget): + # Show the add bookmark dialog + self.add_bookmark_dialog.show() + self.widgets.get_widget("entry_add_name").grab_focus() + + def on_button_edit_clicked(self, widget): + # Show the edit bookmark dialog + selected = self.get_selected() + if selected != None: + self.edit_bookmark_dialog.show() + self.widgets.get_widget("entry_edit_name").grab_focus() + self.widgets.get_widget("entry_edit_name").set_text(self.liststore.\ + get_value(selected, 0)) + self.widgets.get_widget("entry_edit_url").set_text(self.liststore.\ + get_value(selected, 1)) + + def on_button_add_ok_clicked(self, widget): + # Get values from the entry widgets + name = self.widgets.get_widget("entry_add_name").get_text() + url = self.widgets.get_widget("entry_add_url").get_text() + + self.add_bookmark(name, url) + # Clear the entry widget and hide the dialog + self.widgets.get_widget("entry_add_name").set_text("") + self.widgets.get_widget("entry_add_url").set_text("") + self.add_bookmark_dialog.hide() + + def on_button_add_cancel_clicked(self, widget, arg=None): + # Clear the entry widget and hide the dialog + self.widgets.get_widget("entry_add_name").set_text("") + self.widgets.get_widget("entry_add_url").set_text("") + self.add_bookmark_dialog.hide() + if arg != None: + return True + + def on_button_edit_ok_clicked(self, widget): + # Get values from the entry widgets + name = self.widgets.get_widget("entry_edit_name").get_text() + url = self.widgets.get_widget("entry_edit_url").get_text() + selected = self.get_selected() + if selected != None: + self.liststore.remove(selected) + self.add_bookmark(name, url) + self.build_menu() + + # Clear the entry widget and hide the dialog + self.widgets.get_widget("entry_edit_name").set_text("") + self.widgets.get_widget("entry_edit_url").set_text("") + self.edit_bookmark_dialog.hide() + + def on_button_edit_cancel_clicked(self, widget, arg=None): + # Clear the entry widget and hide the dialog + self.widgets.get_widget("entry_edit_name").set_text("") + self.widgets.get_widget("entry_edit_url").set_text("") + self.edit_bookmark_dialog.hide() + if arg != None: + return True + + def on_button_remove_clicked(self, widget): + selected = self.get_selected() + if selected != None: + self.liststore.remove(selected) + + self.build_menu() + + def on_button_cancel_clicked(self, widget, arg=None): + self.load_bookmarks() + self.hide() + if arg != None: + return True + + def on_button_ok_clicked(self, widget): + def each(model, path, iter, data): + bookmark = {} + bookmark["name"] = model.get_value(iter, 0) + bookmark["url"] = model.get_value(iter, 1) + self.bookmarks.append(bookmark) + self.bookmarks = [] + self.liststore.foreach(each, None) + self.hide() + + def menuitem_activate(self, widget): + text = widget.get_child().get_text() + def load_url(model, path, row, data): + if model.get_value(row, 0) == text: + # Grab the URL and load it + url = model.get_value(row, 1) + self.parent.txt_url.set_text(url) + self.parent.load_url() + if text == "Bookmark This Page...": + # Show the add bookmark dialog + self.add_bookmark_dialog.show() + self.widgets.get_widget("entry_add_name").grab_focus() + self.widgets.get_widget("entry_add_url").set_text( + self.parent.txt_url.get_text()) + self.on_button_ok_clicked(widget) + return + + self.liststore.foreach(load_url, None) diff --git a/plugins/AnonymizingBrowser/browser.glade b/plugins/AnonymizingBrowser/browser.glade new file mode 100755 index 000000000..0557c42e3 --- /dev/null +++ b/plugins/AnonymizingBrowser/browser.glade @@ -0,0 +1,320 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd"> +<!--Generated with glade3 3.4.0 on Mon Dec 24 21:29:57 2007 --> +<glade-interface> + <widget class="GtkWindow" id="window1"> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <child> + <widget class="GtkVBox" id="vbox1"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <child> + <widget class="GtkToolbar" id="toolbar3"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="icon_size">GTK_ICON_SIZE_MENU</property> + <property name="icon_size_set">True</property> + <child> + <widget class="GtkToolButton" id="toolbutton_back"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="stock_id">gtk-go-back</property> + <signal name="clicked" handler="go_back"/> + </widget> + <packing> + <property name="expand">False</property> + </packing> + </child> + <child> + <widget class="GtkToolButton" id="toolbutton_forward"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="stock_id">gtk-go-forward</property> + <signal name="clicked" handler="go_forward"/> + </widget> + <packing> + <property name="expand">False</property> + </packing> + </child> + <child> + <widget class="GtkToolButton" id="toolbutton17"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="stock_id">gtk-refresh</property> + <signal name="clicked" handler="reload"/> + </widget> + <packing> + <property name="expand">False</property> + </packing> + </child> + <child> + <widget class="GtkSeparatorToolItem" id="separatortoolitem5"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + </widget> + <packing> + <property name="expand">False</property> + <property name="homogeneous">False</property> + </packing> + </child> + <child> + <widget class="GtkToolItem" id="toolbutton18"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <child> + <widget class="GtkEntry" id="entry1"> + <property name="width_request">300</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <signal name="activate" handler="load_url"/> + </widget> + </child> + </widget> + <packing> + <property name="expand">False</property> + <property name="homogeneous">False</property> + </packing> + </child> + <child> + <widget class="GtkToolButton" id="toolbutton19"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="label" translatable="yes">Go</property> + <property name="stock_id">gtk-jump-to</property> + <signal name="clicked" handler="load_url"/> + </widget> + <packing> + <property name="expand">False</property> + </packing> + </child> + <child> + <widget class="GtkToolButton" id="toolbutton20"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="stock_id">gtk-stop</property> + <signal name="clicked" handler="stop_load"/> + </widget> + <packing> + <property name="expand">False</property> + </packing> + </child> + <child> + <widget class="GtkSeparatorToolItem" id="separatortoolitem6"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + </widget> + <packing> + <property name="expand">False</property> + <property name="homogeneous">False</property> + </packing> + </child> + <child> + <widget class="GtkMenuToolButton" id="toolbutton_bookmarks"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="label" translatable="yes">Bookmarks</property> + <property name="stock_id">gtk-justify-fill</property> + <signal name="clicked" handler="list_bookmarks"/> + </widget> + <packing> + <property name="expand">False</property> + <property name="homogeneous">False</property> + </packing> + </child> + <child> + <widget class="GtkSeparatorToolItem" id="separatortoolitem1"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + </widget> + <packing> + <property name="expand">False</property> + <property name="homogeneous">False</property> + </packing> + </child> + <child> + <widget class="GtkToolItem" id="toolbutton1"> + <property name="width_request">150</property> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <child> + <widget class="GtkEntry" id="entry2"> + <property name="width_request">150</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <signal name="activate" handler="search"/> + </widget> + </child> + </widget> + <packing> + <property name="expand">False</property> + <property name="homogeneous">False</property> + </packing> + </child> + <child> + <widget class="GtkSeparatorToolItem" id="separatortoolitem2"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + </widget> + <packing> + <property name="expand">False</property> + <property name="homogeneous">False</property> + </packing> + </child> + <child> + <widget class="GtkToolButton" id="toolbutton2"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="tooltip" translatable="yes">Launch Main Externally</property> + <property name="label" translatable="yes">Launch Main</property> + <property name="stock_id">gtk-goto-top</property> + <signal name="clicked" handler="launch_main"/> + </widget> + <packing> + <property name="expand">False</property> + </packing> + </child> + <child> + <widget class="GtkToolButton" id="toolbutton3"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="has_tooltip">True</property> + <property name="tooltip" translatable="yes">Launch Footer Externally</property> + <property name="label" translatable="yes">Launch Footer</property> + <property name="stock_id">gtk-goto-bottom</property> + <signal name="clicked" handler="launch_footer"/> + </widget> + <packing> + <property name="expand">False</property> + </packing> + </child> + </widget> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + <child> + <widget class="GtkVPaned" id="vpaned1"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <child> + <widget class="GtkFrame" id="frame1"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="label_xalign">0</property> + <property name="shadow_type">GTK_SHADOW_NONE</property> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="resize">True</property> + <property name="shrink">True</property> + </packing> + </child> + <child> + <widget class="GtkHBox" id="hbox1"> + <property name="height_request">98</property> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <child> + <widget class="GtkToolbar" id="toolbar1"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="orientation">GTK_ORIENTATION_VERTICAL</property> + <property name="toolbar_style">GTK_TOOLBAR_ICONS</property> + <property name="show_arrow">False</property> + <property name="icon_size">GTK_ICON_SIZE_MENU</property> + <child> + <widget class="GtkToolButton" id="toolbutton_back2"> + <property name="height_request">94</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="stock_id">gtk-go-back</property> + <signal name="clicked" handler="go_back2"/> + <signal name="clicked" handler="go_back2"/> + </widget> + <packing> + <property name="expand">False</property> + </packing> + </child> + </widget> + <packing> + <property name="expand">False</property> + </packing> + </child> + <child> + <widget class="GtkFrame" id="frame2"> + <property name="height_request">94</property> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="label_xalign">0</property> + <property name="shadow_type">GTK_SHADOW_NONE</property> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="position">1</property> + </packing> + </child> + <child> + <widget class="GtkToolbar" id="toolbar2"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="orientation">GTK_ORIENTATION_VERTICAL</property> + <property name="toolbar_style">GTK_TOOLBAR_ICONS</property> + <property name="show_arrow">False</property> + <property name="icon_size">GTK_ICON_SIZE_MENU</property> + <child> + <widget class="GtkToolButton" id="toolbutton_forward2"> + <property name="height_request">94</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="stock_id">gtk-go-forward</property> + <signal name="clicked" handler="go_forward2"/> + </widget> + <packing> + <property name="expand">False</property> + </packing> + </child> + </widget> + <packing> + <property name="expand">False</property> + <property name="position">2</property> + </packing> + </child> + </widget> + <packing> + <property name="resize">False</property> + <property name="shrink">False</property> + </packing> + </child> + </widget> + <packing> + <property name="position">1</property> + </packing> + </child> + </widget> + </child> + </widget> +</glade-interface> diff --git a/plugins/AnonymizingBrowser/browser.png b/plugins/AnonymizingBrowser/browser.png Binary files differnew file mode 100755 index 000000000..bba66e1a8 --- /dev/null +++ b/plugins/AnonymizingBrowser/browser.png diff --git a/plugins/AnonymizingBrowser/browserwin.glade b/plugins/AnonymizingBrowser/browserwin.glade new file mode 100755 index 000000000..1ef87372d --- /dev/null +++ b/plugins/AnonymizingBrowser/browserwin.glade @@ -0,0 +1,295 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd"> +<!--Generated with glade3 3.4.0 on Mon Dec 24 21:29:26 2007 --> +<glade-interface> + <widget class="GtkWindow" id="window1"> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <child> + <widget class="GtkVBox" id="vbox1"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <child> + <widget class="GtkToolbar" id="toolbar3"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="icon_size">GTK_ICON_SIZE_MENU</property> + <property name="icon_size_set">True</property> + <child> + <widget class="GtkToolButton" id="toolbutton_back"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="stock_id">gtk-go-back</property> + <signal name="clicked" handler="go_back"/> + </widget> + <packing> + <property name="expand">False</property> + </packing> + </child> + <child> + <widget class="GtkToolButton" id="toolbutton_forward"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="stock_id">gtk-go-forward</property> + <signal name="clicked" handler="go_forward"/> + </widget> + <packing> + <property name="expand">False</property> + </packing> + </child> + <child> + <widget class="GtkToolButton" id="toolbutton17"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="stock_id">gtk-refresh</property> + <signal name="clicked" handler="reload"/> + </widget> + <packing> + <property name="expand">False</property> + </packing> + </child> + <child> + <widget class="GtkSeparatorToolItem" id="separatortoolitem5"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + </widget> + <packing> + <property name="expand">False</property> + <property name="homogeneous">False</property> + </packing> + </child> + <child> + <widget class="GtkToolItem" id="toolbutton18"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <child> + <widget class="GtkEntry" id="entry1"> + <property name="width_request">300</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <signal name="activate" handler="load_url"/> + </widget> + </child> + </widget> + <packing> + <property name="expand">False</property> + <property name="homogeneous">False</property> + </packing> + </child> + <child> + <widget class="GtkToolButton" id="toolbutton19"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="label" translatable="yes">Go</property> + <property name="stock_id">gtk-jump-to</property> + <signal name="clicked" handler="load_url"/> + </widget> + <packing> + <property name="expand">False</property> + </packing> + </child> + <child> + <widget class="GtkToolButton" id="toolbutton20"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="stock_id">gtk-stop</property> + <signal name="clicked" handler="stop_load"/> + </widget> + <packing> + <property name="expand">False</property> + </packing> + </child> + <child> + <widget class="GtkSeparatorToolItem" id="separatortoolitem6"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + </widget> + <packing> + <property name="expand">False</property> + <property name="homogeneous">False</property> + </packing> + </child> + <child> + <widget class="GtkMenuToolButton" id="toolbutton_bookmarks"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="label" translatable="yes">Bookmarks</property> + <property name="stock_id">gtk-justify-fill</property> + <signal name="clicked" handler="list_bookmarks"/> + </widget> + <packing> + <property name="expand">False</property> + <property name="homogeneous">False</property> + </packing> + </child> + <child> + <widget class="GtkSeparatorToolItem" id="separatortoolitem1"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + </widget> + <packing> + <property name="expand">False</property> + <property name="homogeneous">False</property> + </packing> + </child> + <child> + <widget class="GtkToolItem" id="toolbutton1"> + <property name="width_request">150</property> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <child> + <widget class="GtkEntry" id="entry2"> + <property name="width_request">150</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <signal name="activate" handler="search"/> + </widget> + </child> + </widget> + <packing> + <property name="expand">False</property> + <property name="homogeneous">False</property> + </packing> + </child> + <child> + <widget class="GtkSeparatorToolItem" id="separatortoolitem2"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + </widget> + <packing> + <property name="expand">False</property> + <property name="homogeneous">False</property> + </packing> + </child> + <child> + <widget class="GtkToolButton" id="toolbutton2"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="tooltip" translatable="yes">Launch Main Externally</property> + <property name="label" translatable="yes">Launch Main</property> + <property name="stock_id">gtk-goto-top</property> + <signal name="clicked" handler="launch_main"/> + </widget> + <packing> + <property name="expand">False</property> + </packing> + </child> + <child> + <widget class="GtkToolButton" id="toolbutton3"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="tooltip" translatable="yes">Launch Footer Externally</property> + <property name="label" translatable="yes">Launch Footer</property> + <property name="stock_id">gtk-goto-bottom</property> + <signal name="clicked" handler="launch_footer"/> + </widget> + <packing> + <property name="expand">False</property> + </packing> + </child> + </widget> + <packing> + <property name="expand">False</property> + </packing> + </child> + <child> + <widget class="GtkVPaned" id="vpaned1"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <child> + <widget class="GtkDrawingArea" id="drawingarea1"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + </widget> + <packing> + <property name="resize">False</property> + <property name="shrink">True</property> + </packing> + </child> + <child> + <widget class="GtkHBox" id="hbox1"> + <property name="height_request">98</property> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <child> + <widget class="GtkToolbar" id="toolbar1"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="orientation">GTK_ORIENTATION_VERTICAL</property> + <property name="toolbar_style">GTK_TOOLBAR_ICONS</property> + <property name="show_arrow">False</property> + <property name="icon_size">GTK_ICON_SIZE_SMALL_TOOLBAR</property> + <child> + <widget class="GtkToolButton" id="toolbutton_back2"> + <property name="height_request">94</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="stock_id">gtk-go-back</property> + <signal name="clicked" handler="go_back2"/> + <signal name="clicked" handler="go_back2"/> + </widget> + <packing> + <property name="expand">False</property> + </packing> + </child> + </widget> + <packing> + <property name="expand">False</property> + </packing> + </child> + <child> + <widget class="GtkDrawingArea" id="drawingarea2"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + </widget> + <packing> + <property name="position">1</property> + </packing> + </child> + <child> + <widget class="GtkToolbar" id="toolbar2"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="orientation">GTK_ORIENTATION_VERTICAL</property> + <property name="toolbar_style">GTK_TOOLBAR_ICONS</property> + <property name="show_arrow">False</property> + <property name="icon_size">GTK_ICON_SIZE_SMALL_TOOLBAR</property> + <child> + <widget class="GtkToolButton" id="toolbutton_forward2"> + <property name="height_request">94</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="stock_id">gtk-go-forward</property> + <signal name="clicked" handler="go_forward2"/> + </widget> + <packing> + <property name="expand">False</property> + </packing> + </child> + </widget> + <packing> + <property name="expand">False</property> + <property name="position">2</property> + </packing> + </child> + </widget> + <packing> + <property name="resize">False</property> + <property name="shrink">False</property> + </packing> + </child> + </widget> + <packing> + <property name="position">1</property> + </packing> + </child> + </widget> + </child> + </widget> +</glade-interface> diff --git a/plugins/AnonymizingBrowser/list_bookmarks.glade b/plugins/AnonymizingBrowser/list_bookmarks.glade new file mode 100755 index 000000000..be143a971 --- /dev/null +++ b/plugins/AnonymizingBrowser/list_bookmarks.glade @@ -0,0 +1,597 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd"> +<!--Generated with glade3 3.4.0 on Sat Dec 22 01:05:23 2007 --> +<glade-interface> + <widget class="GtkDialog" id="list_bookmarks_dialog"> + <property name="width_request">425</property> + <property name="height_request">250</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="border_width">5</property> + <property name="title" translatable="yes">Edit Bookmarks</property> + <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property> + <property name="default_width">400</property> + <property name="destroy_with_parent">True</property> + <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property> + <property name="has_separator">False</property> + <signal name="close" handler="quit"/> + <signal name="destroy" handler="quit"/> + <signal name="delete_event" handler="quit"/> + <signal name="destroy_event" handler="quit"/> + <child internal-child="vbox"> + <widget class="GtkVBox" id="dialog-vbox1"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="spacing">2</property> + <child> + <widget class="GtkVBox" id="vbox3"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="spacing">5</property> + <child> + <widget class="GtkHBox" id="hbox5"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="spacing">10</property> + <child> + <widget class="GtkImage" id="image3"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="stock">gtk-edit</property> + </widget> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="label3"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="xalign">0.05000000074505806</property> + <property name="ypad">10</property> + <property name="label" translatable="yes"><big><b>Edit Bookmarks</b></big></property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">1</property> + </packing> + </child> + </widget> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + <child> + <widget class="GtkHBox" id="hbox6"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="spacing">5</property> + <child> + <widget class="GtkScrolledWindow" id="scrolledwindow3"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="shadow_type">GTK_SHADOW_IN</property> + <child> + <widget class="GtkTreeView" id="bookmarks_treeview"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + </widget> + </child> + </widget> + </child> + <child> + <widget class="GtkVButtonBox" id="vbuttonbox3"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="spacing">1</property> + <property name="layout_style">GTK_BUTTONBOX_CENTER</property> + <child> + <widget class="GtkButton" id="button_add"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="label" translatable="yes">gtk-add</property> + <property name="use_stock">True</property> + <property name="response_id">0</property> + <signal name="clicked" handler="on_button_add_clicked"/> + </widget> + </child> + <child> + <widget class="GtkButton" id="button1"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="label" translatable="yes">gtk-edit</property> + <property name="use_stock">True</property> + <property name="response_id">0</property> + <signal name="clicked" handler="on_button_edit_clicked"/> + </widget> + <packing> + <property name="position">1</property> + </packing> + </child> + <child> + <widget class="GtkButton" id="button_remove"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="label" translatable="yes">gtk-remove</property> + <property name="use_stock">True</property> + <property name="response_id">0</property> + <signal name="clicked" handler="on_button_remove_clicked"/> + </widget> + <packing> + <property name="position">2</property> + </packing> + </child> + </widget> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">1</property> + </packing> + </child> + </widget> + <packing> + <property name="position">1</property> + </packing> + </child> + </widget> + <packing> + <property name="position">1</property> + </packing> + </child> + <child internal-child="action_area"> + <widget class="GtkHButtonBox" id="dialog-action_area1"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="layout_style">GTK_BUTTONBOX_END</property> + <child> + <widget class="GtkButton" id="button_cancel"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="label" translatable="yes">gtk-cancel</property> + <property name="use_stock">True</property> + <property name="response_id">0</property> + <signal name="clicked" handler="on_button_cancel_clicked"/> + </widget> + </child> + <child> + <widget class="GtkButton" id="button_ok"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="label" translatable="yes">gtk-ok</property> + <property name="use_stock">True</property> + <property name="response_id">0</property> + <signal name="clicked" handler="on_button_ok_clicked"/> + </widget> + <packing> + <property name="position">1</property> + </packing> + </child> + </widget> + <packing> + <property name="expand">False</property> + <property name="pack_type">GTK_PACK_END</property> + </packing> + </child> + </widget> + </child> + </widget> + <widget class="GtkDialog" id="add_bookmark_dialog"> + <property name="width_request">350</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="border_width">5</property> + <property name="title" translatable="yes">Add Bookmark</property> + <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property> + <property name="destroy_with_parent">True</property> + <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property> + <property name="skip_taskbar_hint">True</property> + <property name="has_separator">False</property> + <signal name="close" handler="on_button_add_cancel_clicked"/> + <signal name="delete_event" handler="on_button_add_cancel_clicked"/> + <signal name="destroy_event" handler="on_button_add_cancel_clicked"/> + <child internal-child="vbox"> + <widget class="GtkVBox" id="dialog-vbox2"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="spacing">2</property> + <child> + <widget class="GtkVBox" id="vbox1"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="spacing">5</property> + <child> + <widget class="GtkHBox" id="hbox1"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="spacing">5</property> + <child> + <widget class="GtkImage" id="image1"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="stock">gtk-add</property> + </widget> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="label" translatable="yes"><b>Add Bookmark</b></property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">1</property> + </packing> + </child> + </widget> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + <child> + <widget class="GtkHSeparator" id="hseparator1"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + </widget> + <packing> + <property name="expand">False</property> + <property name="position">1</property> + </packing> + </child> + <child> + <widget class="GtkVBox" id="vbox2"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <child> + <widget class="GtkTable" id="table1"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="n_rows">2</property> + <property name="n_columns">2</property> + <child> + <widget class="GtkLabel" id="label2"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Name:</property> + </widget> + <packing> + <property name="x_options">GTK_FILL</property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="label4"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">URL:</property> + </widget> + <packing> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">GTK_FILL</property> + </packing> + </child> + <child> + <widget class="GtkAlignment" id="alignment1"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="left_padding">5</property> + <child> + <widget class="GtkEntry" id="entry_add_name"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + </widget> + </child> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + </packing> + </child> + <child> + <widget class="GtkAlignment" id="alignment2"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="left_padding">5</property> + <child> + <widget class="GtkEntry" id="entry_add_url"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + </widget> + </child> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + </packing> + </child> + </widget> + <packing> + <property name="expand">False</property> + </packing> + </child> + <child> + <placeholder/> + </child> + </widget> + <packing> + <property name="position">2</property> + </packing> + </child> + </widget> + <packing> + <property name="position">1</property> + </packing> + </child> + <child internal-child="action_area"> + <widget class="GtkHButtonBox" id="dialog-action_area2"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="layout_style">GTK_BUTTONBOX_END</property> + <child> + <widget class="GtkButton" id="button_add_cancel"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="label" translatable="yes">gtk-cancel</property> + <property name="use_stock">True</property> + <property name="response_id">0</property> + <signal name="clicked" handler="on_button_add_cancel_clicked"/> + </widget> + </child> + <child> + <widget class="GtkButton" id="button_add_ok"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="has_default">True</property> + <property name="receives_default">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="label" translatable="yes">gtk-ok</property> + <property name="use_stock">True</property> + <property name="response_id">0</property> + <signal name="clicked" handler="on_button_add_ok_clicked"/> + </widget> + <packing> + <property name="position">1</property> + </packing> + </child> + </widget> + <packing> + <property name="expand">False</property> + <property name="pack_type">GTK_PACK_END</property> + </packing> + </child> + </widget> + </child> + </widget> + <widget class="GtkDialog" id="edit_bookmark_dialog"> + <property name="width_request">350</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="border_width">5</property> + <property name="title" translatable="yes">Add Bookmark</property> + <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property> + <property name="destroy_with_parent">True</property> + <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property> + <property name="skip_taskbar_hint">True</property> + <property name="has_separator">False</property> + <signal name="close" handler="on_button_edit_cancel_clicked"/> + <signal name="delete_event" handler="on_button_edit_cancel_clicked"/> + <signal name="destroy_event" handler="on_button_edit_cancel_clicked"/> + <child internal-child="vbox"> + <widget class="GtkVBox" id="dialog-vbox6"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="spacing">2</property> + <child> + <widget class="GtkVBox" id="vbox8"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="spacing">5</property> + <child> + <widget class="GtkHBox" id="hbox4"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="spacing">5</property> + <child> + <widget class="GtkImage" id="image5"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="stock">gtk-edit</property> + </widget> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="label11"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="label" translatable="yes"><b>Edit Bookmark</b></property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">1</property> + </packing> + </child> + </widget> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + <child> + <widget class="GtkHSeparator" id="hseparator4"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + </widget> + <packing> + <property name="expand">False</property> + <property name="position">1</property> + </packing> + </child> + <child> + <widget class="GtkVBox" id="vbox9"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <child> + <widget class="GtkTable" id="table4"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="n_rows">2</property> + <property name="n_columns">2</property> + <child> + <widget class="GtkLabel" id="label13"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Name:</property> + </widget> + <packing> + <property name="x_options">GTK_FILL</property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="label12"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">URL:</property> + </widget> + <packing> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">GTK_FILL</property> + </packing> + </child> + <child> + <widget class="GtkAlignment" id="alignment8"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="left_padding">5</property> + <child> + <widget class="GtkEntry" id="entry_edit_name"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + </widget> + </child> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + </packing> + </child> + <child> + <widget class="GtkAlignment" id="alignment7"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="left_padding">5</property> + <child> + <widget class="GtkEntry" id="entry_edit_url"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + </widget> + </child> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + </packing> + </child> + </widget> + <packing> + <property name="expand">False</property> + </packing> + </child> + <child> + <placeholder/> + </child> + </widget> + <packing> + <property name="position">2</property> + </packing> + </child> + </widget> + <packing> + <property name="position">1</property> + </packing> + </child> + <child internal-child="action_area"> + <widget class="GtkHButtonBox" id="dialog-action_area6"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="layout_style">GTK_BUTTONBOX_END</property> + <child> + <widget class="GtkButton" id="button_edit_cancel"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="label" translatable="yes">gtk-cancel</property> + <property name="use_stock">True</property> + <property name="response_id">0</property> + <signal name="clicked" handler="on_button_edit_cancel_clicked"/> + </widget> + </child> + <child> + <widget class="GtkButton" id="button_edit_ok"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="has_default">True</property> + <property name="receives_default">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="label" translatable="yes">gtk-ok</property> + <property name="use_stock">True</property> + <property name="response_id">0</property> + <signal name="clicked" handler="on_button_edit_ok_clicked"/> + </widget> + <packing> + <property name="position">1</property> + </packing> + </child> + </widget> + <packing> + <property name="expand">False</property> + <property name="pack_type">GTK_PACK_END</property> + </packing> + </child> + </widget> + </child> + </widget> +</glade-interface> diff --git a/plugins/BlocklistImport/__init__.py b/plugins/BlocklistImport/__init__.py index df47f586d..8fd9a88fb 100644 --- a/plugins/BlocklistImport/__init__.py +++ b/plugins/BlocklistImport/__init__.py @@ -46,7 +46,7 @@ readers = {'p2bgz':[_("PeerGuardian P2B (GZip)"), PGReader, None], class BlocklistImport: def __init__(self, path, core, interface): - print "Loading blocklist plugin ..." + print "Found blocklist plugin ..." # Save the path, interface, and core so they can be used later self.path = path self.core = core diff --git a/plugins/DesiredRatio/__init__.py b/plugins/DesiredRatio/__init__.py index 29c011899..b312d8a37 100644 --- a/plugins/DesiredRatio/__init__.py +++ b/plugins/DesiredRatio/__init__.py @@ -42,6 +42,7 @@ import os.path class DesiredRatio: def __init__(self, path, core, interface): + print "Found DesiredRatio plugin..." self.path = path self.core = core self.interface = interface diff --git a/plugins/EventLogging/__init__.py b/plugins/EventLogging/__init__.py index e3c16e121..2a0f22950 100644 --- a/plugins/EventLogging/__init__.py +++ b/plugins/EventLogging/__init__.py @@ -58,7 +58,7 @@ from EventLogging.tab_log import LogTabManager class EventLogging: def __init__(self, path, core, interface): - print "Loading LogEvents plugin..." + print "Found LogEvents plugin..." self.manager = core self.parent = interface # Create an options file and try to load existing Values diff --git a/plugins/ExtraStats/__init__.py b/plugins/ExtraStats/__init__.py index 7f1e99ac1..e75ca141b 100644 --- a/plugins/ExtraStats/__init__.py +++ b/plugins/ExtraStats/__init__.py @@ -54,7 +54,7 @@ from deluge import common class ExtraStats: def __init__(self, path, core, interface): - print "Loading ExtraStats plugin..." + print "Found ExtraStats plugin..." self.manager = core # Create an options file and try to load existing Values self.config_file = os.path.join(deluge.common.CONFIG_DIR, "extra_stats.conf") diff --git a/plugins/FlexRSS/plugin.py b/plugins/FlexRSS/plugin.py index 0176f2d6f..4fd015a93 100644 --- a/plugins/FlexRSS/plugin.py +++ b/plugins/FlexRSS/plugin.py @@ -1712,6 +1712,7 @@ class plugin_FlexRSS: return 0 def __init__(self, path, core, interface, defaults): + print "Found FlexRSS plugin..." self.path = path self.core = core self.interface = interface diff --git a/plugins/MoveTorrent/__init__.py b/plugins/MoveTorrent/__init__.py index e0c1021ef..714c0639a 100644 --- a/plugins/MoveTorrent/__init__.py +++ b/plugins/MoveTorrent/__init__.py @@ -23,7 +23,7 @@ plugin_description = _("This plugin allows users to move the torrent to a \ different directory without having to remove and re-add the torrent. This \ feature can be found by right-clicking on a torrent.\nFurthermore, it \ allows the user to automatically have finished torrents moved to a different \ -folder.") +folder.\nNote: Files can currently only be moved within the same partition") def deluge_init(deluge_path): global path @@ -47,7 +47,7 @@ DEFAULT_PREFS = { class movetorrentMenu: def __init__(self, path, core, interface): - print "Loading Move Torrent plugin..." + print "Found MoveTorrent plugin..." self.path = path self.core = core self.interface = interface diff --git a/plugins/NetworkGraph/__init__.py b/plugins/NetworkGraph/__init__.py index 59abf9a0d..5f999315b 100644 --- a/plugins/NetworkGraph/__init__.py +++ b/plugins/NetworkGraph/__init__.py @@ -52,6 +52,7 @@ import os.path class NetworkGraph: def __init__(self, path, core, interface): + print "Found NetworkGraph plugin..." self.parent = interface self.location = path self.manager = core diff --git a/plugins/NetworkHealth/plugin.py b/plugins/NetworkHealth/plugin.py index a7e5ee1c4..7dc195dea 100644 --- a/plugins/NetworkHealth/plugin.py +++ b/plugins/NetworkHealth/plugin.py @@ -32,6 +32,7 @@ class plugin_NetworkHealth: def __init__(self, path, deluge_core, deluge_interface): + print "Found NetworkHealth plugin..." self.parent = deluge_interface # Using this, you can access the Deluge client self.core = deluge_core self.location = path diff --git a/plugins/Scheduler/plugin.py b/plugins/Scheduler/plugin.py index d64e3a9f9..045a52a0c 100644 --- a/plugins/Scheduler/plugin.py +++ b/plugins/Scheduler/plugin.py @@ -3,6 +3,7 @@ import os.path class plugin_Scheduler: def __init__(self, path, deluge_core, deluge_interface): + print "Found Scheduler plugin..." self.path = path self.core = deluge_core self.interface = deluge_interface diff --git a/plugins/Search/__init__.py b/plugins/Search/__init__.py new file mode 100644 index 000000000..5dabc004a --- /dev/null +++ b/plugins/Search/__init__.py @@ -0,0 +1,206 @@ +# -*- coding: utf-8 -*- +# +# plugin.py +# +# Copyright (C) Marcos Pinto 2007 <markybob@gmail.com> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, write to: +# The Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor +# Boston, MA 02110-1301, USA. +# +# In addition, as a special exception, the copyright holders give +# permission to link the code of portions of this program with the OpenSSL +# library. +# You must obey the GNU General Public License in all respects for all of +# the code used other than OpenSSL. If you modify file(s) with this +# exception, you may extend this exception to your version of the file(s), +# but you are not obligated to do so. If you do not wish to do so, delete +# this exception statement from your version. If you delete this exception +# statement from all source files in the program, then also delete it here. + + +plugin_name = "Torrent Search" +plugin_author = "Marcos Pinto" +plugin_version = "0.3" +plugin_description = _("Search for torrents anonymously") + +def deluge_init(deluge_path): + global path + path = deluge_path + +def enable(core, interface): + global path + return Search(path, core, interface) + +### The Plugin ### +import deluge +import deluge.common +import gtk +import os.path + +class Search: + def __init__(self, path, core, interface): + print "Found TorrentSearch plugin..." + import gtk, gtk.glade, os + import deluge.dgtk, deluge.pref + self.interface = interface + self.config_file = os.path.join(deluge.common.CONFIG_DIR, "newsearch.conf") + self.config = deluge.pref.Preferences(self.config_file, False, + defaults={'YouTorrent': 'http://www.youtorrent.com/tag/?q=${query}', + 'Pirate Bay' : 'http://thepiratebay.org/search/${query}/0/7/0', + 'Google' : "http://www.google.com/cse?cx=010331601\ +931556850092%3Apfadwhze_jy&q=${query}&sa=Search&cof=FORID%3A1", + 'Mininova' : 'http://www.mininova.org/search/?search=${query}/seeds', + 'isoHunt' : "http://isohunt.com/torrents/?ihq=${query}"}) + try: + self.config.load() + except IOError: + pass + + glade = gtk.glade.XML(path + "/searchdlg.glade") + self.dlg = glade.get_widget("search_dialog") + if not deluge.common.windows_check(): + self.dlg.set_icon(deluge.common.get_logo(18)) + self.view = glade.get_widget("search_view") + model = gtk.ListStore(str, str) + self.view.set_model(model) + deluge.dgtk.add_text_column(self.view, _("Name"), 0, width=80) + deluge.dgtk.add_text_column(self.view, _("Search String"), 1) + self.field_name = glade.get_widget("field_name") + self.field_search = glade.get_widget("field_search") + self.button_add = glade.get_widget("button_addsearch") + self.button_del = glade.get_widget("button_delsearch") + dic = { "add_clicked" : self.add_clicked, + "del_clicked" : self.del_clicked, + "row_clicked" : self.row_clicked, + "text_changed" : self.text_changed } + glade.signal_autoconnect(dic) + self.view.get_selection().set_select_function(self.row_clicked) + ### Note: All other plugins should use self.interface.toolbar + ### when adding items to the toolbar + self.se = '' + self.toolbar = self.interface.wtree.get_widget("tb_left") + self.search_entry = gtk.Entry() + self.search_entry.connect("activate", self.torrent_search) + self.search_item = gtk.ToolItem() + self.search_item.add(self.search_entry) + self.search_icon = gtk.Image() + self.search_icon.set_from_stock(gtk.STOCK_FIND, gtk.ICON_SIZE_SMALL_TOOLBAR) + self.menu_button = gtk.MenuToolButton(self.search_icon, _("Choose an Engine")) + self.menu_button.set_is_important(True) + self.menu_button.connect("clicked", self.torrent_search) + self.menu = gtk.Menu() + self.manage_item = gtk.ImageMenuItem(_("Manage Engines")) + self.image = gtk.Image() + self.image.set_from_stock(gtk.STOCK_PREFERENCES, gtk.ICON_SIZE_SMALL_TOOLBAR) + self.manage_item.set_image(self.image) + self.manage_item.connect("activate", self.configure) + self.menu.add(self.manage_item) + self.menu_button.set_menu(self.menu) + self.toolbar.insert(self.menu_button, -1) + self.toolbar.insert(self.search_item, -1) + self.populate_search_menu() + self.toolbar.show_all() + self.search_item.show_all() + self.menu_button.show_all() + self.menu.show_all() + + def unload(self): + self.config.save(self.config_file) + self.toolbar.remove(self.search_item) + self.toolbar.remove(self.menu_button) + + def text_changed(self, args): + a = (self.field_name.get_text() != "") + b = (self.field_search.get_text() != "") + if(a and b): + self.button_add.set_sensitive(1) + else: + self.button_add.set_sensitive(0) + + def add_clicked(self, args): + self.view.get_model().append([self.field_name.get_text(), + self.field_search.get_text()]) + self.field_name.set_text("") + self.field_search.set_text("") + + def del_clicked(self, args): + (model, selection) = self.view.get_selection().get_selected() + model.remove(selection) + self.button_del.set_sensitive(0) + + def row_clicked(self, args): + self.button_del.set_sensitive(1) + return True + + def configure(self, widget=None): + import gtk, gtk.glade + from deluge import common + self.dlg.show_all() + model = self.view.get_model() + model.clear() + for name in self.config.keys(): + self.view.get_model().append( (name, self.config.get(name)) ) + self.button_add.set_sensitive(0) + self.button_del.set_sensitive(0) + result = self.dlg.run() + self.dlg.hide_all() + if result == 1: + self.config.clear() + the_iter = model.get_iter_first() + while the_iter is not None: + self.config.set(model.get_value(the_iter, 0), model.get_value(the_iter, 1)) + the_iter = model.iter_next(the_iter) + self.config.save(self.config_file) + self.populate_search_menu() + + + def torrent_search(self, widget=None): + if self.search_entry.get_text() != "": + from deluge import common + print "Searching with engine", self.se + url = self.config.get(self.se) + entry = self.search_entry.get_text() + entry = entry.replace(' ', '+') + url = url.replace('${query}', entry) + print 'URL =', url + print 'Entry =', entry + common.open_url_in_browser(url, self.interface.plugins) + + def populate_search_menu(self): + import gtk + self.menu_button.set_label(_("Choose an Engine")) + for child in self.menu.get_children(): + self.menu.remove(child) + group = None + i = 0 + for engine in self.config.keys(): + rmi = gtk.RadioMenuItem(None, engine) + rmi.eng_name = engine + rmi.connect("activate", self.select_search, rmi.eng_name) + if (group != None): + rmi.set_group(group) + else: + group = rmi + rmi.set_active(1) + self.menu.insert(rmi, i) + i = i + 1 + rmi.show() + self.menu.insert(self.manage_item, i) + self.menu.show() + + def select_search(self, menuitem, engine_string): + self.menu_button.set_label(_("Search ") + engine_string) + self.se = engine_string diff --git a/plugins/Search/searchdlg.glade b/plugins/Search/searchdlg.glade new file mode 100755 index 000000000..9e409df5c --- /dev/null +++ b/plugins/Search/searchdlg.glade @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd"> +<!--Generated with glade3 3.1.4 on Thu Feb 15 12:48:42 2007 by zach@notapowerbook--> +<glade-interface> + <widget class="GtkDialog" id="search_dialog"> + <property name="border_width">5</property> + <property name="title" translatable="yes">Manage Search Plugins</property> + <property name="has_separator">False</property> + <child internal-child="vbox"> + <widget class="GtkVBox" id="dialog-vbox1"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK</property> + <property name="spacing">2</property> + <child> + <widget class="GtkTable" id="table1"> + <property name="visible">True</property> + <property name="n_rows">4</property> + <property name="n_columns">4</property> + <child> + <widget class="GtkButton" id="button_addsearch"> + <property name="visible">True</property> + <property name="label">gtk-add</property> + <property name="use_stock">True</property> + <signal name="clicked" handler="add_clicked"/> + <signal name="activate" handler="add_clicked"/> + </widget> + <packing> + <property name="left_attach">2</property> + <property name="right_attach">3</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options">GTK_FILL</property> + </packing> + </child> + <child> + <widget class="GtkScrolledWindow" id="scrolledwindow1"> + <property name="visible">True</property> + <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <child> + <widget class="GtkTreeView" id="search_view"> + <property name="visible">True</property> + </widget> + </child> + </widget> + <packing> + <property name="right_attach">4</property> + </packing> + </child> + <child> + <widget class="GtkEntry" id="field_name"> + <property name="visible">True</property> + <signal name="changed" handler="text_changed"/> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="y_options">GTK_FILL</property> + </packing> + </child> + <child> + <widget class="GtkEntry" id="field_search"> + <property name="visible">True</property> + <signal name="changed" handler="text_changed"/> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">4</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="y_options">GTK_FILL</property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="label" translatable="yes">Name:</property> + </widget> + <packing> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options">GTK_FILL</property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="label2"> + <property name="visible">True</property> + <property name="label" translatable="yes">URL:</property> + </widget> + <packing> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options">GTK_FILL</property> + </packing> + </child> + <child> + <widget class="GtkButton" id="button_delsearch"> + <property name="visible">True</property> + <property name="label">gtk-remove</property> + <property name="use_stock">True</property> + <signal name="clicked" handler="del_clicked"/> + </widget> + <packing> + <property name="left_attach">3</property> + <property name="right_attach">4</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">GTK_FILL</property> + <property name="y_options">GTK_FILL</property> + </packing> + </child> + <child> + <widget class="GtkExpander" id="expander1"> + <property name="visible">True</property> + <property name="expanded">True</property> + <child> + <widget class="GtkLabel" id="label3"> + <property name="visible">True</property> + <property name="label" translatable="yes">Add a new search engine by entering a Name and a URL. For Name, enter the name of the search engine to be used. For URL, enter the url of the seach page. The user's search query will replace any instance of ${query} in the URL. +For example, a Google search would be: +Name: Google +URL: http://www.google.com/search?q=${query}</property> + <property name="wrap">True</property> + </widget> + </child> + <child> + <widget class="GtkLabel" id="label3"> + <property name="visible">True</property> + <property name="label" translatable="yes">Help</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="right_attach">4</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + </packing> + </child> + </widget> + <packing> + <property name="position">1</property> + </packing> + </child> + <child internal-child="action_area"> + <widget class="GtkHButtonBox" id="dialog-action_area1"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK</property> + <property name="layout_style">GTK_BUTTONBOX_END</property> + <child> + <widget class="GtkButton" id="button3"> + <property name="visible">True</property> + <property name="label">gtk-cancel</property> + <property name="use_stock">True</property> + </widget> + </child> + <child> + <widget class="GtkButton" id="button2"> + <property name="visible">True</property> + <property name="label">gtk-ok</property> + <property name="use_stock">True</property> + <property name="response_id">1</property> + </widget> + <packing> + <property name="position">1</property> + </packing> + </child> + </widget> + <packing> + <property name="expand">False</property> + <property name="pack_type">GTK_PACK_END</property> + </packing> + </child> + </widget> + </child> + </widget> +</glade-interface> diff --git a/plugins/SpeedLimiter/__init__.py b/plugins/SpeedLimiter/__init__.py index 49f7cc0d1..ba06abd3b 100644 --- a/plugins/SpeedLimiter/__init__.py +++ b/plugins/SpeedLimiter/__init__.py @@ -41,6 +41,7 @@ import os.path class DesiredSpeed: def __init__(self, path, core, interface): + print "Found SpeedLimiter plugin..." self.path = path self.core = core self.interface = interface diff --git a/plugins/TorrentCreator/__init__.py b/plugins/TorrentCreator/__init__.py index 2167b3b19..e242a536a 100644 --- a/plugins/TorrentCreator/__init__.py +++ b/plugins/TorrentCreator/__init__.py @@ -38,7 +38,7 @@ import os.path class TorrentCreator: def __init__(self, path, core, interface): - print "Loading TorrentCreator plugin..." + print "Found TorrentCreator plugin..." self.path = path self.core = core self.interface = interface diff --git a/plugins/TorrentFiles/__init__.py b/plugins/TorrentFiles/__init__.py index 6a5509d04..75118ff48 100644 --- a/plugins/TorrentFiles/__init__.py +++ b/plugins/TorrentFiles/__init__.py @@ -53,7 +53,7 @@ import os.path class TorrentFiles: def __init__(self, path, core, interface): - print "Loading TorrentFiles plugin..." + print "Found TorrentFiles plugin..." self.parent = interface self.manager = core config_file = os.path.join(deluge.common.CONFIG_DIR, "files.conf") diff --git a/plugins/TorrentNotification/__init__.py b/plugins/TorrentNotification/__init__.py index 305a4ae4d..4aba15726 100644 --- a/plugins/TorrentNotification/__init__.py +++ b/plugins/TorrentNotification/__init__.py @@ -39,7 +39,7 @@ import os.path class TorrentNotification: def __init__(self, path, core, interface): - print "Loading TorrentNotification plugin..." + print "Found TorrentNotification plugin..." import os.path self.path = path self.core = core @@ -107,7 +107,8 @@ class TorrentNotification: if pynotify.init("Deluge"): n = pynotify.Notification(_("Torrent complete"), state['name']) n.set_icon_from_pixbuf(deluge.common.get_logo(48)) - n.show() + if not n.show(): + print "Failed to send notification" else: pass diff --git a/plugins/TorrentPeers/__init__.py b/plugins/TorrentPeers/__init__.py index 5fdab548e..ee7188afa 100644 --- a/plugins/TorrentPeers/__init__.py +++ b/plugins/TorrentPeers/__init__.py @@ -54,7 +54,7 @@ import os.path class TorrentPeers: def __init__(self, path, core, interface): - print "Loading TorrentPeers plugin..." + print "Found TorrentPeers plugin..." self.parent = interface self.manager = core self.config_file = os.path.join(deluge.common.CONFIG_DIR, "peers.conf") diff --git a/plugins/WebSeed/__init__.py b/plugins/WebSeed/__init__.py index d71379490..4cd73f645 100644 --- a/plugins/WebSeed/__init__.py +++ b/plugins/WebSeed/__init__.py @@ -38,7 +38,7 @@ import os.path class webseedMenu: def __init__(self, path, core, interface): - print "Loading Web Seed plugin..." + print "Found Web Seed plugin..." self.path = path self.core = core self.interface = interface diff --git a/plugins/WebUi/__init__.py b/plugins/WebUi/__init__.py index 9410b2ba9..fc4e353b4 100644 --- a/plugins/WebUi/__init__.py +++ b/plugins/WebUi/__init__.py @@ -186,6 +186,7 @@ class ConfigDialog(gtk.Dialog): from what I read glade is better, but i dont want to invest time in them. """ def __init__(self, config, plugin, parent): + print "Found WebUI plugin..." gtk.Dialog.__init__(self ,parent=parent) self.config = config self.plugin = plugin |