2006-12-08 19:06:49 +00:00
|
|
|
#!/usr/bin/env python
|
2006-11-28 22:28:37 +00:00
|
|
|
#
|
2006-12-08 18:10:47 +00:00
|
|
|
# delugegtk.py
|
|
|
|
#
|
|
|
|
# Copyright (C) Zach Tibbitts 2006 <zach@collegegeek.org>
|
2007-01-08 19:38:19 +00:00
|
|
|
#
|
|
|
|
# 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)
|
2006-12-08 18:10:47 +00:00
|
|
|
# any later version.
|
|
|
|
#
|
2007-01-08 19:38:19 +00:00
|
|
|
# This program is distributed in the hope that it will be useful,
|
2006-12-08 18:10:47 +00:00
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2007-01-08 19:38:19 +00:00
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
2006-12-08 18:10:47 +00:00
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
2007-01-08 19:38:19 +00:00
|
|
|
# along with this program. If not, write to:
|
2006-12-08 18:10:47 +00:00
|
|
|
# The Free Software Foundation, Inc.,
|
|
|
|
# 51 Franklin Street, Fifth Floor
|
|
|
|
# Boston, MA 02110-1301, USA.
|
2006-11-28 22:28:37 +00:00
|
|
|
|
2007-02-12 19:09:56 +00:00
|
|
|
import sys, os, os.path, gettext, urllib
|
2007-02-14 22:43:48 +00:00
|
|
|
import deluge, dcommon, dgtk, delugeplugins
|
2006-11-28 22:28:37 +00:00
|
|
|
import pygtk
|
|
|
|
pygtk.require('2.0')
|
2007-01-11 21:53:25 +00:00
|
|
|
import gtk, gtk.glade, gobject
|
2007-01-11 00:58:23 +00:00
|
|
|
import xdg, xdg.BaseDirectory
|
2007-01-12 20:07:55 +00:00
|
|
|
import dbus, dbus.service
|
|
|
|
if getattr(dbus, 'version', (0,0,0)) >= (0,41,0):
|
|
|
|
import dbus.glib
|
2006-11-28 22:28:37 +00:00
|
|
|
|
2007-02-12 18:14:15 +00:00
|
|
|
_ = gettext.gettext
|
2006-11-28 22:28:37 +00:00
|
|
|
|
2007-01-12 20:07:55 +00:00
|
|
|
class DelugeGTK(dbus.service.Object):
|
2007-02-14 22:43:48 +00:00
|
|
|
## external_add_torrent should only be called from outside the class
|
|
|
|
@dbus.service.method('org.deluge_torrent.DelugeInterface')
|
|
|
|
def external_add_torrent(self, torrent_file):
|
|
|
|
print "Ding!"
|
|
|
|
print "Got torrent externally:", os.path.basename(torrent_file)
|
|
|
|
print "\tNow, what to do with it?"
|
|
|
|
if self.is_running:
|
|
|
|
print "\t\tthe client seems to already be running, i'll try and add the torrent"
|
|
|
|
uid = self.manager.add_torrent(torrent_file, ".", True)
|
|
|
|
self.store.append(self.get_list_from_unique_id(uid))
|
|
|
|
else:
|
|
|
|
print "\t\tthe client hasn't started yet, I'll queue the torrent"
|
|
|
|
self.torrent_file_queue.append(torrent_file)
|
|
|
|
|
2007-01-12 20:07:55 +00:00
|
|
|
def __init__(self, bus_name=dbus.service.BusName('org.deluge_torrent.Deluge',
|
|
|
|
bus=dbus.SessionBus()), object_path='/org/deluge_torrent/DelugeObject'):
|
|
|
|
dbus.service.Object.__init__(self, bus_name, object_path)
|
|
|
|
self.is_running = False
|
|
|
|
self.torrent_file_queue = []
|
2007-02-07 23:49:31 +00:00
|
|
|
#Load up a config file:
|
2007-02-14 22:43:48 +00:00
|
|
|
self.conf_file = dcommon.CONFIG_DIR + '/deluge.conf'
|
2007-02-07 23:49:31 +00:00
|
|
|
if os.path.isdir(self.conf_file):
|
|
|
|
print 'Weird, the file I was trying to write to, %s, is an existing directory'%(self.conf_file)
|
|
|
|
sys.exit(0)
|
|
|
|
if not os.path.isfile(self.conf_file):
|
|
|
|
f = open(self.conf_file, mode='w')
|
|
|
|
f.flush()
|
|
|
|
f.close()
|
|
|
|
self.pref = dcommon.DelugePreferences()
|
2007-02-12 19:09:56 +00:00
|
|
|
self.load_default_settings()
|
2007-02-07 23:49:31 +00:00
|
|
|
self.pref.load_from_file(self.conf_file)
|
2007-01-11 00:58:23 +00:00
|
|
|
#Start the Deluge Manager:
|
2007-02-15 05:24:44 +00:00
|
|
|
self.manager = deluge.Manager("DE", "0490", "Deluge 0.4.90", dcommon.CONFIG_DIR)
|
2007-01-11 00:58:23 +00:00
|
|
|
#Set up the interface:
|
2007-02-08 22:40:55 +00:00
|
|
|
self.wtree = gtk.glade.XML(dcommon.get_glade_file("delugegtk.glade"))
|
2006-11-28 22:28:37 +00:00
|
|
|
self.window = self.wtree.get_widget("main_window")
|
2007-01-12 20:07:55 +00:00
|
|
|
self.window.hide()
|
2006-12-22 23:24:42 +00:00
|
|
|
self.toolbar = self.wtree.get_widget("tb_middle")
|
2006-11-28 22:28:37 +00:00
|
|
|
if(self.window):
|
2007-01-11 21:53:25 +00:00
|
|
|
self.window.connect("destroy", self.quit)
|
2007-02-08 22:40:55 +00:00
|
|
|
self.window.set_title('%s %s'%(dcommon.PROGRAM_NAME, dcommon.PROGRAM_VERSION))
|
2006-11-28 22:28:37 +00:00
|
|
|
self.window.set_icon_from_file(dcommon.get_pixmap("deluge32.png"))
|
2006-12-08 19:02:22 +00:00
|
|
|
|
2007-02-14 22:43:48 +00:00
|
|
|
self.plugins = delugeplugins.PluginManager(self.manager, self)
|
|
|
|
self.plugins.add_plugin_dir(dcommon.PLUGIN_DIR)
|
|
|
|
if os.path.isdir(dcommon.CONFIG_DIR + '/plugins'):
|
|
|
|
self.plugins.add_plugin_dir(dcommon.CONFIG_DIR + '/plugins')
|
|
|
|
self.plugins.scan_for_plugins()
|
|
|
|
|
2007-02-08 22:40:55 +00:00
|
|
|
## Construct the Interface
|
2007-02-14 18:08:33 +00:00
|
|
|
self.build_tray_icon()
|
2007-02-08 22:40:55 +00:00
|
|
|
self.build_about_dialog()
|
|
|
|
self.build_pref_dialog()
|
|
|
|
self.build_torrent_table()
|
|
|
|
self.build_summary_tab()
|
|
|
|
self.build_file_tab()
|
|
|
|
self.build_peer_tab()
|
2006-12-08 19:02:22 +00:00
|
|
|
|
2007-02-08 22:40:55 +00:00
|
|
|
self.connect_signals()
|
2006-12-08 19:02:22 +00:00
|
|
|
|
2007-02-08 22:40:55 +00:00
|
|
|
self.apply_prefs()
|
|
|
|
|
|
|
|
def connect_signals(self):
|
2007-01-12 20:07:55 +00:00
|
|
|
self.wtree.signal_autoconnect({
|
2006-11-28 22:28:37 +00:00
|
|
|
## File Menu
|
2007-01-12 20:07:55 +00:00
|
|
|
"add_torrent": self.add_torrent_clicked,
|
2007-02-12 18:14:15 +00:00
|
|
|
"add_torrent_url": self.add_torrent_url_clicked,
|
2007-01-12 20:07:55 +00:00
|
|
|
"remove_torrent" : self.remove_torrent_clicked,
|
2006-12-22 23:24:42 +00:00
|
|
|
"menu_quit": self.quit,
|
2006-12-21 07:28:55 +00:00
|
|
|
## Edit Menu
|
2007-02-08 22:40:55 +00:00
|
|
|
"pref_clicked": self.show_pref_dialog,
|
|
|
|
"plugins_clicked": self.show_plugin_dialog,
|
2007-01-11 21:53:25 +00:00
|
|
|
## View Menu
|
2007-01-12 20:40:56 +00:00
|
|
|
"infopane_toggle": self.infopane_toggle,
|
2007-01-11 21:53:25 +00:00
|
|
|
"size_toggle": self.size_toggle,
|
|
|
|
"status_toggle": self.status_toggle,
|
|
|
|
"seeders_toggle": self.seeders_toggle,
|
|
|
|
"peers_toggle": self.peers_toggle,
|
|
|
|
"dl_toggle": self.dl_toggle,
|
|
|
|
"ul_toggle": self.ul_toggle,
|
|
|
|
"eta_toggle": self.eta_toggle,
|
|
|
|
"share_toggle": self.share_toggle,
|
2006-11-28 22:28:37 +00:00
|
|
|
## Help Menu
|
2007-02-08 22:40:55 +00:00
|
|
|
"show_about_dialog": self.show_about_dialog,
|
2007-01-12 20:07:55 +00:00
|
|
|
## Toolbar
|
|
|
|
"update_tracker": self.update_tracker,
|
2007-02-07 23:49:31 +00:00
|
|
|
"clear_finished": self.clear_finished,
|
|
|
|
"queue_up": self.q_torrent_up,
|
|
|
|
"queue_down": self.q_torrent_down,
|
2007-01-11 21:53:25 +00:00
|
|
|
## Other events
|
|
|
|
"torrentrow_click": self.torrentview_clicked,
|
2007-01-12 20:07:55 +00:00
|
|
|
})
|
2007-02-08 22:40:55 +00:00
|
|
|
|
2007-02-14 18:08:33 +00:00
|
|
|
def build_tray_icon(self):
|
|
|
|
self.tray = gtk.StatusIcon()
|
|
|
|
self.tray.set_from_file(dcommon.get_pixmap("deluge32.png"))
|
|
|
|
self.tray.set_tooltip("Deluge BitTorrent Client")
|
|
|
|
tray_glade = gtk.glade.XML(dcommon.get_glade_file("dgtkpopups.glade"))
|
|
|
|
self.tray_menu = tray_glade.get_widget("tray_menu")
|
|
|
|
dic = { "show_hide_window": self.force_show_hide,
|
|
|
|
"add_torrent": self.add_torrent_clicked,
|
|
|
|
"clear_finished": self.clear_finished,
|
|
|
|
"preferences": self.show_pref_dialog,
|
|
|
|
"plugins": self.show_plugin_dialog,
|
|
|
|
"quit": self.quit,
|
|
|
|
}
|
|
|
|
tray_glade.signal_autoconnect(dic)
|
|
|
|
self.tray.connect("popup-menu", self.tray_popup, None)
|
|
|
|
self.tray.connect("activate", self.tray_clicked, None)
|
|
|
|
|
|
|
|
def tray_popup(self, status_icon, button, activate_time, arg0=None):
|
|
|
|
self.tray_menu.popup(None, None, gtk.status_icon_position_menu,
|
|
|
|
button, activate_time, self.tray)
|
|
|
|
|
|
|
|
def tray_clicked(self, status_icon=None, arg=None):
|
|
|
|
if self.window.get_property("visible"):
|
|
|
|
if self.window.is_active():
|
|
|
|
self.window.hide()
|
|
|
|
else:
|
|
|
|
self.window.present()
|
|
|
|
else:
|
|
|
|
self.window.show()
|
|
|
|
|
|
|
|
def force_show_hide(self, arg=None):
|
|
|
|
if self.window.get_property("visible"):
|
|
|
|
self.window.hide()
|
|
|
|
else:
|
|
|
|
self.window.show()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-02-08 22:40:55 +00:00
|
|
|
def build_about_dialog(self):
|
|
|
|
gtk.about_dialog_set_url_hook(dcommon.open_url_in_browser)
|
|
|
|
self.abt = gtk.AboutDialog()
|
|
|
|
self.abt.set_name(dcommon.PROGRAM_NAME)
|
|
|
|
self.abt.set_version(dcommon.PROGRAM_VERSION)
|
|
|
|
self.abt.set_authors(["Zach Tibbits", "A. Zakai"])
|
|
|
|
self.abt.set_artists(["Andrew Wedderburn"])
|
|
|
|
self.abt.set_website("http://deluge-torrent.org")
|
|
|
|
self.abt.set_icon_from_file(dcommon.get_pixmap("deluge32.png"))
|
2007-02-08 23:52:01 +00:00
|
|
|
self.abt.set_logo(gtk.gdk.pixbuf_new_from_file(
|
|
|
|
dcommon.get_pixmap("deluge32.png")))
|
2007-02-08 22:40:55 +00:00
|
|
|
|
|
|
|
def build_pref_dialog(self):
|
|
|
|
self.prf_glade = gtk.glade.XML(dcommon.get_glade_file("dgtkpref.glade"))
|
|
|
|
self.prf = self.prf_glade.get_widget("pref_dialog")
|
|
|
|
self.prf.set_icon_from_file(dcommon.get_pixmap("deluge32.png"))
|
|
|
|
self.prf_glade.signal_autoconnect({"tray_toggle": self.tray_toggle,})
|
2007-02-14 22:43:48 +00:00
|
|
|
self.plugin_dlg = self.prf_glade.get_widget("plugin_dialog")
|
|
|
|
self.plugin_dlg.set_icon_from_file(dcommon.get_pixmap("deluge32.png"))
|
|
|
|
self.plugin_view = self.prf_glade.get_widget("plugin_view")
|
|
|
|
self.plugin_store = gtk.ListStore(str, bool)
|
|
|
|
self.plugin_view.set_model(self.plugin_store)
|
2007-02-15 18:30:28 +00:00
|
|
|
self.plugin_view.get_selection().set_select_function(self.plugin_clicked, full=True
|
|
|
|
)
|
|
|
|
name_col = dgtk.add_text_column(self.plugin_view, "Name", 0)
|
|
|
|
name_col.set_expand(True)
|
2007-02-14 22:43:48 +00:00
|
|
|
dgtk.add_toggle_column(self.plugin_view, "Enabled", 1, toggled_signal=self.plugin_toggled)
|
2007-02-15 00:41:22 +00:00
|
|
|
self.prf_glade.signal_autoconnect({'plugin_pref': self.plugin_pref})
|
2007-02-15 18:30:28 +00:00
|
|
|
|
|
|
|
def plugin_clicked(self, selection, model, path, is_selected):
|
|
|
|
if is_selected:
|
|
|
|
return True
|
|
|
|
name = model.get_value(model.get_iter(path), 0)
|
|
|
|
plugin = self.plugins.get_plugin(name)
|
|
|
|
version = plugin['version']
|
|
|
|
config = plugin['config']
|
2007-02-15 18:46:57 +00:00
|
|
|
description = plugin['description']
|
2007-02-15 21:30:17 +00:00
|
|
|
if name in self.plugins.get_enabled_plugins():
|
|
|
|
self.prf_glade.get_widget("plugin_conf").set_sensitive(config)
|
|
|
|
else:
|
|
|
|
self.prf_glade.get_widget("plugin_conf").set_sensitive(False)
|
2007-02-15 18:46:57 +00:00
|
|
|
self.prf_glade.get_widget("plugin_text").get_buffer(
|
|
|
|
).set_text("%s\nVersion: %s\n\n%s"%
|
|
|
|
(name, version, description))
|
2007-02-15 18:30:28 +00:00
|
|
|
return True
|
2007-02-15 00:41:22 +00:00
|
|
|
|
|
|
|
def plugin_toggled(self, renderer, path):
|
|
|
|
plugin_iter = self.plugin_store.get_iter_from_string(path)
|
|
|
|
plugin_name = self.plugin_store.get_value(plugin_iter, 0)
|
|
|
|
plugin_value = not self.plugin_store.get_value(plugin_iter, 1)
|
|
|
|
self.plugin_store.set_value(plugin_iter, 1, plugin_value)
|
|
|
|
if plugin_value:
|
|
|
|
self.plugins.enable_plugin(plugin_name)
|
2007-02-15 21:30:17 +00:00
|
|
|
self.prf_glade.get_widget("plugin_conf").set_sensitive(
|
|
|
|
self.plugins.get_plugin(plugin_name)['config'])
|
2007-02-15 00:41:22 +00:00
|
|
|
else:
|
|
|
|
self.plugins.disable_plugin(plugin_name)
|
|
|
|
|
|
|
|
def plugin_pref(self, widget=None):
|
|
|
|
(model, plugin_iter) = self.plugin_view.get_selection().get_selected()
|
|
|
|
plugin_name = self.plugin_store.get_value(plugin_iter, 0)
|
|
|
|
self.plugins.configure_plugin(plugin_name)
|
2007-02-08 22:40:55 +00:00
|
|
|
|
|
|
|
def build_torrent_table(self):
|
2006-12-08 18:10:47 +00:00
|
|
|
## Create the torrent listview
|
2006-12-22 23:24:42 +00:00
|
|
|
self.view = self.wtree.get_widget("torrent_view")
|
|
|
|
# UID, Q#, Name, Size, Progress, Message, Seeders, Peers, DL, UL, ETA, Share
|
2007-02-07 23:49:31 +00:00
|
|
|
self.store = gtk.ListStore(int, int, str, str, float, str, str, str, str, str, str, str)
|
2006-12-22 23:24:42 +00:00
|
|
|
self.view.set_model(self.store)
|
2006-12-23 03:30:25 +00:00
|
|
|
self.view.set_rules_hint(True)
|
2007-02-08 23:52:01 +00:00
|
|
|
self.view.set_reorderable(True)
|
2006-12-08 19:02:22 +00:00
|
|
|
|
2006-12-24 04:08:34 +00:00
|
|
|
## Initializes the columns for the torrent_view
|
2007-02-08 22:40:55 +00:00
|
|
|
#Just found out there are built-in pygtk methods with similar functionality
|
|
|
|
#to these, perhaps I should look into using those.
|
2006-12-22 23:24:42 +00:00
|
|
|
self.queue_column = dgtk.add_text_column(self.view, "#", 1)
|
|
|
|
self.name_column = dgtk.add_text_column(self.view, "Name", 2)
|
|
|
|
self.size_column = dgtk.add_text_column(self.view, "Size", 3)
|
|
|
|
self.status_column = dgtk.add_progress_column(self.view, "Status", 4, 5)
|
|
|
|
self.seed_column = dgtk.add_text_column(self.view, "Seeders", 6)
|
|
|
|
self.peer_column = dgtk.add_text_column(self.view, "Peers", 7)
|
|
|
|
self.dl_column = dgtk.add_text_column(self.view, "Download", 8)
|
|
|
|
self.ul_column = dgtk.add_text_column(self.view, "Upload", 9)
|
2007-02-14 18:08:33 +00:00
|
|
|
self.eta_column = dgtk.add_text_column(self.view, "Time Remaining", 10)
|
|
|
|
self.share_column = dgtk.add_text_column(self.view, "Ratio", 11)
|
2006-11-28 22:28:37 +00:00
|
|
|
|
2006-12-24 04:08:34 +00:00
|
|
|
self.status_column.set_expand(True)
|
|
|
|
|
2007-02-08 22:40:55 +00:00
|
|
|
|
|
|
|
def build_summary_tab(self):
|
2007-01-11 23:15:22 +00:00
|
|
|
#Torrent Summary tab
|
2007-01-12 20:07:55 +00:00
|
|
|
# Look into glade's widget prefix function
|
2007-01-11 23:15:22 +00:00
|
|
|
self.text_summary_title = self.wtree.get_widget("summary_title")
|
|
|
|
self.text_summary_total_size = self.wtree.get_widget("summary_total_size")
|
|
|
|
self.text_summary_pieces = self.wtree.get_widget("summary_pieces")
|
|
|
|
self.text_summary_total_downloaded = self.wtree.get_widget("summary_total_downloaded")
|
|
|
|
self.text_summary_total_uploaded = self.wtree.get_widget("summary_total_uploaded")
|
|
|
|
self.text_summary_download_rate = self.wtree.get_widget("summary_download_rate")
|
|
|
|
self.text_summary_upload_rate = self.wtree.get_widget("summary_upload_rate")
|
2007-02-06 21:21:09 +00:00
|
|
|
self.text_summary_seeders = self.wtree.get_widget("summary_seeders")
|
|
|
|
self.text_summary_peers = self.wtree.get_widget("summary_peers")
|
2007-01-11 23:15:22 +00:00
|
|
|
self.text_summary_percentage_done = self.wtree.get_widget("summary_percentage_done")
|
|
|
|
self.text_summary_share_ratio = self.wtree.get_widget("summary_share_ratio")
|
|
|
|
self.text_summary_downloaded_this_session = self.wtree.get_widget("summary_downloaded_this_session")
|
|
|
|
self.text_summary_uplodaded_this_session = self.wtree.get_widget("summary_uploaded_this_session")
|
|
|
|
self.text_summary_tracker = self.wtree.get_widget("summary_tracker")
|
|
|
|
self.text_summary_tracker_response = self.wtree.get_widget("summary_tracker_response")
|
2007-02-06 21:21:09 +00:00
|
|
|
self.text_summary_tracker_status = self.wtree.get_widget("summary_tracker_status")
|
2007-01-11 23:15:22 +00:00
|
|
|
self.text_summary_next_announce = self.wtree.get_widget("summary_next_announce")
|
|
|
|
self.text_summary_compact_allocation = self.wtree.get_widget("summary_compact_allocation")
|
|
|
|
self.text_summary_eta = self.wtree.get_widget("summary_eta")
|
2007-02-08 22:40:55 +00:00
|
|
|
|
|
|
|
def build_peer_tab(self):
|
|
|
|
self.peer_view = self.wtree.get_widget("peer_view")
|
|
|
|
self.peer_store = gtk.ListStore(str, str, str, str, str)
|
|
|
|
self.peer_view.set_model(self.peer_store)
|
|
|
|
|
|
|
|
self.peer_ip_column = dgtk.add_text_column(self.peer_view, "IP Address", 0)
|
|
|
|
self.peer_client_column = dgtk.add_text_column(self.peer_view, "Client", 1)
|
|
|
|
## Note: (maybe) change this column to use a progress column before 0.5 is released
|
|
|
|
self.peer_complete_column = dgtk.add_text_column(self.peer_view, "Percent Complete", 2)
|
|
|
|
self.peer_download_column = dgtk.add_text_column(self.peer_view, "Download Rate", 3)
|
|
|
|
self.peer_upload_column = dgtk.add_text_column(self.peer_view, "Upload Rate", 4)
|
|
|
|
|
|
|
|
|
|
|
|
def build_file_tab(self):
|
|
|
|
self.file_view = self.wtree.get_widget("file_view")
|
|
|
|
self.file_store = gtk.ListStore(str, bool)
|
|
|
|
self.file_view.set_model(self.file_store)
|
2007-01-11 23:15:22 +00:00
|
|
|
|
2007-02-08 22:40:55 +00:00
|
|
|
self.filename_column = dgtk.add_text_column(self.file_view, "Filename", 0)
|
|
|
|
self.filetoggle_column = dgtk.add_toggle_column(self.file_view, "DL?", 0)
|
|
|
|
|
|
|
|
self.filename_column.set_expand(True)
|
|
|
|
|
2007-02-12 19:09:56 +00:00
|
|
|
def load_default_settings(self):
|
|
|
|
self.pref.set("enable_system_tray", True)
|
|
|
|
self.pref.set("close_to_tray", False)
|
|
|
|
self.pref.set("use_default_dir", False)
|
|
|
|
self.pref.set("default_download_path", os.path.expandvars('$HOME'))
|
|
|
|
self.pref.set("auto_end_seeding", False)
|
|
|
|
self.pref.set("end_seed_ratio", 1.0)
|
|
|
|
self.pref.set("use_compact_storage", False)
|
|
|
|
|
2007-02-12 20:53:33 +00:00
|
|
|
self.pref.set("tcp_port_range_lower", 6881)
|
2007-02-12 19:09:56 +00:00
|
|
|
self.pref.set("tcp_port_range_upper", 6889)
|
|
|
|
self.pref.set("max_upload_rate", 0)
|
|
|
|
self.pref.set("max_number_uploads", 0)
|
|
|
|
self.pref.set("max_download_rate", 0)
|
|
|
|
self.pref.set("max_number_downloads", 0)
|
2007-02-08 22:40:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def show_about_dialog(self, arg=None):
|
|
|
|
self.abt.show_all()
|
|
|
|
self.abt.run()
|
|
|
|
self.abt.hide_all()
|
|
|
|
|
|
|
|
def show_pref_dialog(self, arg=None):
|
2007-02-09 21:41:58 +00:00
|
|
|
#Try to get current settings from pref, if an error occurs, the default settings will be used:
|
|
|
|
try:
|
|
|
|
# Page 1
|
|
|
|
self.prf_glade.get_widget("chk_use_tray").set_active(self.pref.get("enable_system_tray", bool))
|
|
|
|
self.prf_glade.get_widget("chk_min_on_close").set_active(self.pref.get("close_to_tray", bool))
|
2007-02-12 19:09:56 +00:00
|
|
|
if(self.pref.get("use_default_dir", bool)):
|
|
|
|
self.prf_glade.get_widget("radio_save_all_to").set_active(True)
|
|
|
|
else:
|
|
|
|
self.prf_glade.get_widget("radio_ask_save").set_active(True)
|
|
|
|
|
2007-02-09 21:41:58 +00:00
|
|
|
self.prf_glade.get_widget("download_path_button").set_filename(self.pref.get("default_download_path", str))
|
|
|
|
self.prf_glade.get_widget("chk_autoseed").set_active(self.pref.get("auto_end_seeding", bool))
|
|
|
|
self.prf_glade.get_widget("ratio_spinner").set_value(self.pref.get("end_seed_ratio", float))
|
|
|
|
self.prf_glade.get_widget("chk_compact").set_active(self.pref.get("use_compact_storage", bool))
|
|
|
|
# Page 2
|
|
|
|
self.prf_glade.get_widget("spin_port_min").set_value(self.pref.get("tcp_port_range_lower", int))
|
|
|
|
self.prf_glade.get_widget("spin_port_max").set_value(self.pref.get("tcp_port_range_upper", int))
|
|
|
|
self.prf_glade.get_widget("spin_max_upload").set_value(self.pref.get("max_upload_rate", int))
|
|
|
|
self.prf_glade.get_widget("spin_num_upload").set_value(self.pref.get("max_number_uploads", int))
|
|
|
|
self.prf_glade.get_widget("spin_max_download").set_value(self.pref.get("max_download_rate", int))
|
|
|
|
self.prf_glade.get_widget("spin_num_download").set_value(self.pref.get("max_number_downloads", int))
|
|
|
|
except KeyError:
|
|
|
|
pass
|
2007-02-08 22:40:55 +00:00
|
|
|
self.prf.show_all()
|
2007-02-09 21:41:58 +00:00
|
|
|
result = self.prf.run()
|
2007-02-08 22:40:55 +00:00
|
|
|
self.prf.hide_all()
|
2007-02-09 21:41:58 +00:00
|
|
|
print result
|
|
|
|
if result == 1:
|
|
|
|
self.pref.set("enable_system_tray", self.prf_glade.get_widget("chk_use_tray").get_active())
|
|
|
|
self.pref.set("close_to_tray", self.prf_glade.get_widget("chk_min_on_close").get_active())
|
2007-02-12 19:09:56 +00:00
|
|
|
self.pref.set("use_default_dir", self.prf_glade.get_widget("radio_save_all_to").get_active())
|
2007-02-09 21:41:58 +00:00
|
|
|
self.pref.set("default_download_path", self.prf_glade.get_widget("download_path_button").get_filename())
|
|
|
|
self.pref.set("auto_end_seeding", self.prf_glade.get_widget("chk_autoseed").get_active())
|
|
|
|
self.pref.set("end_seed_ratio", self.prf_glade.get_widget("ratio_spinner").get_value())
|
|
|
|
self.pref.set("use_compact_storage", self.prf_glade.get_widget("chk_compact").get_active())
|
|
|
|
|
|
|
|
self.pref.set("tcp_port_range_lower", self.prf_glade.get_widget("spin_port_min").get_value())
|
|
|
|
self.pref.set("tcp_port_range_upper", self.prf_glade.get_widget("spin_port_max").get_value())
|
|
|
|
self.pref.set("max_upload_rate", self.prf_glade.get_widget("spin_max_upload").get_value())
|
|
|
|
self.pref.set("max_number_uploads", self.prf_glade.get_widget("spin_num_upload").get_value())
|
|
|
|
self.pref.set("max_download_rate", self.prf_glade.get_widget("spin_max_download").get_value())
|
|
|
|
self.pref.set("max_number_downloads", self.prf_glade.get_widget("spin_num_download").get_value())
|
|
|
|
|
|
|
|
self.pref.save_to_file(self.conf_file)
|
2007-02-07 23:49:31 +00:00
|
|
|
self.apply_prefs()
|
2007-01-12 20:07:55 +00:00
|
|
|
|
2007-02-08 22:40:55 +00:00
|
|
|
def show_plugin_dialog(self, arg=None):
|
2007-02-14 22:43:48 +00:00
|
|
|
self.plugin_store.clear()
|
|
|
|
for plugin in self.plugins.get_available_plugins():
|
2007-02-15 00:41:22 +00:00
|
|
|
if plugin in self.plugins.get_enabled_plugins():
|
|
|
|
self.plugin_store.append( (plugin, True) )
|
|
|
|
else:
|
|
|
|
self.plugin_store.append( (plugin, False) )
|
2007-02-15 21:30:17 +00:00
|
|
|
self.prf_glade.get_widget("plugin_text").get_buffer().set_text("")
|
|
|
|
self.prf_glade.get_widget("plugin_conf").set_sensitive(False)
|
2007-02-14 22:43:48 +00:00
|
|
|
self.plugin_dlg.show()
|
|
|
|
self.plugin_dlg.run()
|
|
|
|
self.plugin_dlg.hide()
|
|
|
|
|
2007-02-15 00:41:22 +00:00
|
|
|
|
2007-02-14 22:43:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2007-02-08 22:40:55 +00:00
|
|
|
def tray_toggle(self, obj):
|
|
|
|
if obj.get_active():
|
2007-02-09 21:41:58 +00:00
|
|
|
self.prf_glade.get_widget("chk_min_on_close").set_sensitive(True)
|
2007-02-08 22:40:55 +00:00
|
|
|
else:
|
2007-02-09 21:41:58 +00:00
|
|
|
self.prf_glade.get_widget("chk_min_on_close").set_sensitive(False)
|
2007-02-08 22:40:55 +00:00
|
|
|
|
|
|
|
|
2007-02-14 22:43:48 +00:00
|
|
|
def apply_prefs(self):
|
|
|
|
pass
|
|
|
|
|
2007-02-08 22:40:55 +00:00
|
|
|
|
2007-02-14 22:43:48 +00:00
|
|
|
# UID, Q#, Name, Size, Progress, Message, Seeders, Peers, DL, UL, ETA, Share
|
|
|
|
def get_list_from_unique_id(self, unique_id):
|
|
|
|
state = self.manager.get_torrent_state(unique_id)
|
|
|
|
queue = int(state['queue_pos']) + 1
|
|
|
|
name = state['name']
|
|
|
|
size = dcommon.fsize(state['total_size'])
|
|
|
|
progress = float(state['progress'] * 100)
|
|
|
|
message = '%s %d%%'%(deluge.STATE_MESSAGES[state['state']], int(state['progress'] * 100))
|
|
|
|
seeds = dcommon.fseed(state)
|
|
|
|
peers = dcommon.fpeer(state)
|
|
|
|
dlrate = dcommon.frate(state['download_rate'])
|
|
|
|
ulrate = dcommon.frate(state['upload_rate'])
|
|
|
|
eta = dcommon.estimate_eta(state)
|
|
|
|
share = self.calc_share_ratio(unique_id, state)
|
|
|
|
return [unique_id, queue, name, size, progress, message,
|
|
|
|
seeds, peers, dlrate, ulrate, eta, share]
|
|
|
|
|
|
|
|
|
2007-01-11 00:58:23 +00:00
|
|
|
## Start the timer that updates the interface
|
2007-01-12 20:07:55 +00:00
|
|
|
def start(self, hidden=False):
|
|
|
|
if not hidden:
|
|
|
|
self.window.show()
|
|
|
|
# go through torrent files to add
|
|
|
|
#dummy preferences values:
|
|
|
|
use_default_download_location = True
|
|
|
|
default_download_location = "."
|
|
|
|
for torrent_file in self.torrent_file_queue:
|
|
|
|
print "adding torrent", torrent_file
|
|
|
|
try:
|
|
|
|
self.manager.add_torrent(torrent_file, ".", True)
|
|
|
|
except deluge.DelugeError:
|
|
|
|
print "duplicate torrent found, ignoring", torrent_file
|
|
|
|
## add torrents in manager to interface
|
|
|
|
for uid in self.manager.get_unique_IDs():
|
|
|
|
self.store.append(self.get_list_from_unique_id(uid))
|
2007-01-11 00:58:23 +00:00
|
|
|
gobject.timeout_add(1000, self.update)
|
2007-01-12 20:07:55 +00:00
|
|
|
try:
|
|
|
|
self.is_running = True
|
|
|
|
gtk.main()
|
|
|
|
except KeyboardInterrupt:
|
|
|
|
self.manager.quit()
|
2007-02-14 22:43:48 +00:00
|
|
|
|
2007-01-11 00:58:23 +00:00
|
|
|
|
|
|
|
## Call via a timer to update the interface
|
|
|
|
def update(self):
|
2007-01-11 21:53:25 +00:00
|
|
|
# Make sure that the interface still exists
|
|
|
|
try:
|
2007-01-11 05:01:11 +00:00
|
|
|
tab = self.wtree.get_widget("torrent_info").get_current_page()
|
2007-01-11 21:53:25 +00:00
|
|
|
except AttributeError:
|
|
|
|
return False
|
2007-02-14 22:43:48 +00:00
|
|
|
|
|
|
|
self.plugins.update_active_plugins()
|
|
|
|
|
2007-01-11 23:15:22 +00:00
|
|
|
# If no torrent is selected, select the first torrent:
|
|
|
|
(temp, selection) = self.view.get_selection().get_selected()
|
|
|
|
if selection is None:
|
|
|
|
self.view.get_selection().select_path("0")
|
2007-01-12 20:40:56 +00:00
|
|
|
#Torrent List
|
|
|
|
itr = self.store.get_iter_first()
|
|
|
|
if itr is None:
|
|
|
|
return True
|
2007-02-14 22:43:48 +00:00
|
|
|
|
2007-01-12 20:40:56 +00:00
|
|
|
while itr is not None:
|
|
|
|
uid = self.store.get_value(itr, 0)
|
|
|
|
try:
|
|
|
|
state = self.manager.get_torrent_state(uid)
|
|
|
|
tlist = self.get_list_from_unique_id(uid)
|
|
|
|
for i in range(12):
|
|
|
|
self.store.set_value(itr, i, tlist[i])
|
|
|
|
itr = self.store.iter_next(itr)
|
|
|
|
except deluge.InvalidUniqueIDError:
|
|
|
|
self.store.remove(itr)
|
|
|
|
if not self.store.iter_is_valid(itr):
|
|
|
|
itr = None
|
2007-02-12 20:41:06 +00:00
|
|
|
|
|
|
|
self.saved_peer_info = None
|
|
|
|
|
2007-02-14 22:43:48 +00:00
|
|
|
|
|
|
|
|
2007-02-09 21:41:58 +00:00
|
|
|
if tab == 0: #Details Pane
|
|
|
|
try:
|
|
|
|
state = self.manager.get_torrent_state(self.get_selected_torrent())
|
|
|
|
except deluge.InvalidUniqueIDError:
|
|
|
|
return True
|
2007-02-12 23:12:08 +00:00
|
|
|
self.wtree.get_widget("progressbar").set_text('%s %s'%(str(state["name"]), dcommon.fpcnt(state["progress"])))
|
2007-02-06 21:21:09 +00:00
|
|
|
self.text_summary_total_size.set_text(dcommon.fsize(state["total_size"]))
|
2007-01-11 23:15:22 +00:00
|
|
|
self.text_summary_pieces.set_text(str(state["pieces"]))
|
2007-02-06 21:21:09 +00:00
|
|
|
self.text_summary_total_downloaded.set_text(dcommon.fsize(state["total_download"]))
|
|
|
|
self.text_summary_total_uploaded.set_text(dcommon.fsize(state["total_upload"]))
|
|
|
|
self.text_summary_download_rate.set_text(dcommon.frate(state["download_rate"]))
|
|
|
|
self.text_summary_upload_rate.set_text(dcommon.frate(state["upload_rate"]))
|
|
|
|
self.text_summary_seeders.set_text(dcommon.fseed(state))
|
|
|
|
self.text_summary_peers.set_text(dcommon.fpeer(state))
|
2007-02-12 23:12:08 +00:00
|
|
|
self.wtree.get_widget("progressbar").set_fraction(float(state['progress']))
|
2007-02-07 23:49:31 +00:00
|
|
|
self.text_summary_share_ratio.set_text(self.calc_share_ratio(self.get_selected_torrent(), state))
|
2007-01-11 23:15:22 +00:00
|
|
|
#self.text_summary_downloaded_this_session.set_text(str(state[""]))
|
|
|
|
#self.text_summary_uplodaded_this_session.set_text(str(state[""]))
|
|
|
|
self.text_summary_tracker.set_text(str(state["tracker"]))
|
|
|
|
#self.text_summary_tracker_response.set_text(str(state[""]))
|
2007-02-06 21:21:09 +00:00
|
|
|
self.text_summary_tracker_status.set_text(str(state["tracker_ok"]))
|
2007-01-11 23:15:22 +00:00
|
|
|
self.text_summary_next_announce.set_text(str(state["next_announce"]))
|
|
|
|
#self.text_summary_compact_allocation.set_text(str(state[""]))
|
2007-02-12 19:36:16 +00:00
|
|
|
self.text_summary_eta.set_text(dcommon.estimate_eta(state))
|
2007-01-12 20:40:56 +00:00
|
|
|
elif tab == 1: #Peers List
|
2007-02-12 20:41:06 +00:00
|
|
|
unique_id = self.get_selected_torrent()
|
|
|
|
|
|
|
|
if self.saved_peer_info is None:
|
|
|
|
self.saved_peer_info = self.manager.get_torrent_peer_info(unique_id)
|
|
|
|
|
|
|
|
|
|
|
|
new_peer_info = self.saved_peer_info
|
|
|
|
|
|
|
|
new_ips = {}
|
|
|
|
|
|
|
|
for index in range(len(new_peer_info)):
|
|
|
|
if not new_peer_info[index]['client'] == "":
|
|
|
|
assert(new_peer_info[index]['ip'] not in new_ips.keys())
|
|
|
|
new_ips[new_peer_info[index]['ip']] = index
|
|
|
|
|
|
|
|
def biographer(model, path, iter, dictionary):
|
|
|
|
assert(model.get_value(iter, 0) not in dictionary.keys())
|
|
|
|
dictionary[model.get_value(iter, 0)] = model.get_string_from_iter(iter)
|
|
|
|
|
|
|
|
class remover_data:
|
|
|
|
def __init__(self, new_ips):
|
|
|
|
self.new_ips = new_ips
|
|
|
|
self.removed = False
|
|
|
|
|
|
|
|
def remover(model, path, iter, data):
|
|
|
|
if model.get_value(iter, 0) not in data.new_ips:
|
|
|
|
model.remove(iter)
|
|
|
|
data.removed = True
|
|
|
|
return True
|
|
|
|
else:
|
|
|
|
return False
|
|
|
|
|
|
|
|
while True:
|
|
|
|
data = remover_data(new_ips.keys())
|
|
|
|
self.peer_store.foreach(remover, data)
|
|
|
|
if not data.removed:
|
|
|
|
break
|
|
|
|
|
|
|
|
curr_ips = {}
|
|
|
|
|
|
|
|
self.peer_store.foreach(biographer, curr_ips)
|
|
|
|
|
|
|
|
assert(self.peer_store.iter_n_children(None) == len(curr_ips.keys()))
|
|
|
|
|
|
|
|
for peer in new_peer_info:
|
|
|
|
if peer['ip'] in curr_ips.keys():
|
|
|
|
self.peer_store.set(self.peer_store.get_iter_from_string(curr_ips[peer['ip']]),
|
|
|
|
1, unicode(peer['client'], 'Latin-1'),
|
|
|
|
2, peer['peer_has'],
|
|
|
|
3, peer['download_speed'],
|
|
|
|
4, peer['upload_speed'])
|
|
|
|
for peer in new_peer_info:
|
|
|
|
if peer['ip'] not in curr_ips.keys() and peer['client'] is not "":
|
|
|
|
self.peer_store.append([peer["ip"], unicode(peer["client"], 'Latin-1'), peer["peer_has"],
|
|
|
|
peer["download_speed"], peer["upload_speed"]])
|
|
|
|
|
2007-01-12 20:40:56 +00:00
|
|
|
elif tab == 2: #File List
|
2007-01-11 21:53:25 +00:00
|
|
|
pass
|
|
|
|
else:
|
|
|
|
pass
|
|
|
|
|
2007-01-11 00:58:23 +00:00
|
|
|
return True
|
|
|
|
|
2007-02-07 23:49:31 +00:00
|
|
|
def calc_share_ratio(self, unique_id, torrent_state):
|
|
|
|
r = self.manager.calc_ratio(unique_id, torrent_state)
|
|
|
|
return '%.2f'%(r)
|
2007-01-11 23:15:22 +00:00
|
|
|
|
2007-01-11 05:01:11 +00:00
|
|
|
def get_selected_torrent(self):
|
2007-02-07 23:49:31 +00:00
|
|
|
try:
|
|
|
|
return self.store.get_value(self.view.get_selection().get_selected()[1], 0)
|
|
|
|
except TypeError:
|
|
|
|
return None
|
|
|
|
|
2006-12-22 23:24:42 +00:00
|
|
|
|
2007-02-12 19:09:56 +00:00
|
|
|
def interactive_add_torrent(self, torrent):
|
|
|
|
if self.pref.get('use_default_dir', bool):
|
|
|
|
path = self.pref.get('default_download_path')
|
|
|
|
else:
|
|
|
|
path = dgtk.show_directory_chooser_dialog(self.window)
|
|
|
|
if path is None:
|
|
|
|
return
|
|
|
|
unique_id = self.manager.add_torrent(torrent, path, True)
|
|
|
|
self.store.append(self.get_list_from_unique_id(unique_id))
|
|
|
|
|
|
|
|
|
2006-11-28 22:28:37 +00:00
|
|
|
|
2007-01-12 20:07:55 +00:00
|
|
|
def add_torrent_clicked(self, obj=None):
|
2007-01-11 00:58:23 +00:00
|
|
|
torrent = dgtk.show_file_open_dialog()
|
|
|
|
if torrent is not None:
|
2007-02-12 19:09:56 +00:00
|
|
|
self.interactive_add_torrent(torrent)
|
2007-01-11 05:01:11 +00:00
|
|
|
|
2007-02-12 18:14:15 +00:00
|
|
|
def add_torrent_url_clicked(self, obj=None):
|
2007-02-12 19:09:56 +00:00
|
|
|
dlg = gtk.Dialog(title="Add torrent from URL", parent=self.window,
|
|
|
|
buttons=(gtk.STOCK_CANCEL, 0, gtk.STOCK_OK, 1))
|
|
|
|
dlg.set_icon_from_file(dcommon.get_pixmap("deluge32.png"))
|
|
|
|
|
|
|
|
label = gtk.Label("Enter the URL of the .torrent to download")
|
|
|
|
entry = gtk.Entry()
|
|
|
|
dlg.vbox.pack_start(label)
|
|
|
|
dlg.vbox.pack_start(entry)
|
|
|
|
dlg.show_all()
|
|
|
|
result = dlg.run()
|
|
|
|
url = entry.get_text()
|
|
|
|
dlg.destroy()
|
|
|
|
|
|
|
|
if result == 1:
|
|
|
|
opener = urllib.URLopener()
|
|
|
|
filename, headers = opener.retrieve(url)
|
|
|
|
if filename.endswith(".torrent") or headers["content-type"]=="application/x=bittorrent":
|
|
|
|
self.interactive_add_torrent(filename)
|
|
|
|
|
2007-02-12 18:14:15 +00:00
|
|
|
|
2007-01-12 20:07:55 +00:00
|
|
|
def remove_torrent_clicked(self, obj=None):
|
2007-02-07 23:49:31 +00:00
|
|
|
torrent = self.get_selected_torrent()
|
|
|
|
if torrent is not None:
|
2007-02-12 18:14:15 +00:00
|
|
|
glade = gtk.glade.XML(dcommon.get_glade_file("dgtkpopups.glade"))
|
|
|
|
asker = glade.get_widget("remove_torrent_dlg")
|
|
|
|
|
|
|
|
warning = glade.get_widget("warning")
|
|
|
|
warning.set_text(" ")
|
|
|
|
|
|
|
|
data_also = glade.get_widget("data_also")
|
|
|
|
data_also.connect("toggled", self.remove_toggle_warning, warning)
|
|
|
|
|
|
|
|
response = asker.run()
|
|
|
|
asker.destroy()
|
|
|
|
if response == 1:
|
|
|
|
self.manager.remove_torrent(torrent, data_also.get_active())
|
|
|
|
|
|
|
|
|
|
|
|
def remove_toggle_warning(self, args, warning):
|
|
|
|
if not args.get_active():
|
|
|
|
warning.set_text(" ")
|
|
|
|
else:
|
|
|
|
warning.set_markup("<i>" + "Warning - all downloaded files for this torrent will be deleted!" + "</i>")
|
|
|
|
return False
|
2007-02-07 23:49:31 +00:00
|
|
|
|
2007-01-12 20:07:55 +00:00
|
|
|
def update_tracker(self, obj=None):
|
2007-02-07 23:49:31 +00:00
|
|
|
torrent = self.get_selected_torrent()
|
|
|
|
if torrent is not None:
|
|
|
|
self.manager.update_tracker(torrent)
|
|
|
|
|
|
|
|
def clear_finished(self, obj=None):
|
|
|
|
self.manager.clear_completed()
|
|
|
|
|
|
|
|
def q_torrent_up(self, obj=None):
|
|
|
|
torrent = self.get_selected_torrent()
|
|
|
|
if torrent is not None:
|
|
|
|
self.manager.queue_up(torrent)
|
|
|
|
|
|
|
|
def q_torrent_down(self, obj=None):
|
|
|
|
torrent = self.get_selected_torrent()
|
|
|
|
if torrent is not None:
|
|
|
|
self.manager.queue_up(torrent)
|
|
|
|
|
2007-01-11 21:53:25 +00:00
|
|
|
def torrentview_clicked(self, widget, event):
|
|
|
|
pass
|
2007-01-12 20:40:56 +00:00
|
|
|
|
|
|
|
def infopane_toggle(self, widget):
|
|
|
|
if widget.get_active():
|
|
|
|
self.wtree.get_widget("torrent_info").show()
|
|
|
|
else:
|
|
|
|
self.wtree.get_widget("torrent_info").hide()
|
2007-01-11 21:53:25 +00:00
|
|
|
|
|
|
|
def size_toggle(self, obj):
|
|
|
|
self.size_column.set_visible(obj.get_active())
|
|
|
|
|
|
|
|
|
|
|
|
def status_toggle(self, obj):
|
|
|
|
self.status_column.set_visible(obj.get_active())
|
|
|
|
|
|
|
|
def seeders_toggle(self, obj):
|
|
|
|
self.seed_column.set_visible(obj.get_active())
|
|
|
|
|
|
|
|
def peers_toggle(self, obj):
|
|
|
|
self.peer_column.set_visible(obj.get_active())
|
|
|
|
|
|
|
|
def dl_toggle(self, obj):
|
|
|
|
self.dl_column.set_visible(obj.get_active())
|
|
|
|
|
|
|
|
def ul_toggle(self, obj):
|
|
|
|
self.ul_column.set_visible(obj.get_active())
|
|
|
|
|
|
|
|
def eta_toggle(self, obj):
|
|
|
|
self.eta_column.set_visible(obj.get_active())
|
|
|
|
|
|
|
|
def share_toggle(self, obj):
|
|
|
|
self.share_column.set_visible(obj.get_active())
|
|
|
|
|
2006-12-22 23:24:42 +00:00
|
|
|
def quit(self, obj=None):
|
2007-02-15 21:30:17 +00:00
|
|
|
self.shutdown()
|
|
|
|
|
|
|
|
def shutdown(self):
|
|
|
|
self.plugins.shutdown_all_plugins()
|
2007-01-11 00:58:23 +00:00
|
|
|
self.manager.quit()
|
2007-01-11 21:53:25 +00:00
|
|
|
gtk.main_quit()
|
2006-12-22 23:24:42 +00:00
|
|
|
|
2007-01-11 00:58:23 +00:00
|
|
|
|
2006-12-04 23:59:45 +00:00
|
|
|
|
|
|
|
|
2006-12-08 20:26:35 +00:00
|
|
|
## For testing purposes, create a copy of the interface
|
2006-11-28 22:28:37 +00:00
|
|
|
if __name__ == "__main__":
|
2007-01-11 00:58:23 +00:00
|
|
|
interface = DelugeGTK()
|
2007-02-06 21:21:09 +00:00
|
|
|
interface.start()
|