mirror of
https://git.deluge-torrent.org/deluge
synced 2025-04-20 19:44:52 +00:00
Moving functions.py to UI
This commit is contained in:
parent
139b5d82c7
commit
6f3a57f827
5 changed files with 9 additions and 13 deletions
|
@ -52,9 +52,6 @@ import pygtk
|
|||
pygtk.require('2.0')
|
||||
import gtk, gtk.glade
|
||||
|
||||
from addtorrentdialog import AddTorrentDialog
|
||||
from deluge.ui.ui import UI
|
||||
|
||||
# Get the logger
|
||||
log = logging.getLogger("deluge")
|
||||
|
||||
|
@ -69,10 +66,10 @@ def get_core():
|
|||
log.debug("Got core proxy object..")
|
||||
return core
|
||||
|
||||
def add_torrent_file():
|
||||
"""Opens a file chooser dialog and adds any files selected to the core"""
|
||||
at_dialog = AddTorrentDialog()
|
||||
torrent_files = at_dialog.run()
|
||||
def add_torrent_file(torrent_files):
|
||||
"""Adds torrent files to the core
|
||||
Expects a list of torrent files
|
||||
"""
|
||||
if torrent_files is None:
|
||||
log.debug("No torrent files selected..")
|
||||
return
|
||||
|
|
|
@ -38,7 +38,7 @@ pygtk.require('2.0')
|
|||
import gtk, gtk.glade
|
||||
import pkg_resources
|
||||
|
||||
import functions
|
||||
import ui.functions
|
||||
|
||||
# Get the logger
|
||||
log = logging.getLogger("deluge")
|
||||
|
@ -101,7 +101,8 @@ class MenuBar:
|
|||
## File Menu ##
|
||||
def on_menuitem_addtorrent_activate(self, data=None):
|
||||
log.debug("on_menuitem_addtorrent_activate")
|
||||
functions.add_torrent_file()
|
||||
from addtorrentdialog import AddTorrentDialog
|
||||
functions.add_torrent_file(AddTorrentDialog().run())
|
||||
|
||||
def on_menuitem_addurl_activate(self, data=None):
|
||||
log.debug("on_menuitem_addurl_activate")
|
||||
|
|
|
@ -50,7 +50,7 @@ import pygtk
|
|||
pygtk.require('2.0')
|
||||
import gtk, gtk.glade
|
||||
|
||||
import functions
|
||||
import ui.functions
|
||||
from deluge.config import Config
|
||||
|
||||
# Get the logger
|
||||
|
|
|
@ -37,8 +37,6 @@ import pygtk
|
|||
pygtk.require('2.0')
|
||||
import gtk, gtk.glade
|
||||
|
||||
import functions
|
||||
|
||||
# Get the logger
|
||||
log = logging.getLogger("deluge")
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ import gobject
|
|||
import gettext
|
||||
|
||||
import columns
|
||||
import functions
|
||||
import ui.functions
|
||||
|
||||
# Get the logger
|
||||
log = logging.getLogger("deluge")
|
||||
|
|
Loading…
Add table
Reference in a new issue