Add removals to the setup script.

Do not display the Open Folder menu item if not connected to a 
localhost.
This commit is contained in:
Andrew Resch 2007-12-14 07:44:53 +00:00
parent 62bd4a86f8
commit 6733ce38d2
3 changed files with 32 additions and 8 deletions

1
TODO
View File

@ -9,7 +9,6 @@
* Maybe add pop-up menus to the status bar items
* Address issue where torrents will redownload if the storage is moved outside
of deluge.
* Hide open folder if not localhost
* Implement 'Classic' mode
* Tray tooltip
* Add autoload folder

View File

@ -47,11 +47,11 @@ class MenuBar(component.Component):
component.Component.__init__(self, "MenuBar")
self.window = component.get("MainWindow")
# Get the torrent menu from the glade file
torrentmenu_glade = gtk.glade.XML(
self.torrentmenu_glade = gtk.glade.XML(
pkg_resources.resource_filename("deluge.ui.gtkui",
"glade/torrent_menu.glade"))
self.torrentmenu = torrentmenu_glade.get_widget("torrent_menu")
self.torrentmenu = self.torrentmenu_glade.get_widget("torrent_menu")
self.menu_torrent = self.window.main_glade.get_widget("menu_torrent")
# Attach the torrent_menu to the Torrent file menu
@ -88,7 +88,7 @@ class MenuBar(component.Component):
"on_menuitem_about_activate": self.on_menuitem_about_activate
})
torrentmenu_glade.signal_autoconnect({
self.torrentmenu_glade.signal_autoconnect({
## Torrent Menu
"on_menuitem_pause_activate": self.on_menuitem_pause_activate,
"on_menuitem_resume_activate": self.on_menuitem_resume_activate,
@ -111,6 +111,20 @@ class MenuBar(component.Component):
for widget in self.change_sensitivity:
self.window.main_glade.get_widget(widget).set_sensitive(True)
# Hide the Open Folder menuitem and separator if not connected to a
# localhost.
non_remote_items = [
"menuitem_open_folder",
"separator4"
]
if not client.is_localhost():
for widget in non_remote_items:
self.torrentmenu_glade.get_widget(widget).hide()
self.torrentmenu_glade.get_widget(widget).set_no_show_all(True)
else:
for widget in non_remote_items:
self.torrentmenu_glade.get_widget(widget).set_no_show_all(False)
# Show the Torrent menu because we're connected to a host
self.menu_torrent.show()

View File

@ -32,13 +32,12 @@ import ez_setup
ez_setup.use_setuptools()
from setuptools import setup, find_packages, Extension
from distutils import cmd
from distutils import cmd, sysconfig
from distutils.command.build import build as _build
from distutils.command.install import install as _install
from distutils.command.install_data import install_data as _install_data
import msgfmt
import platform
import glob
import os
@ -54,10 +53,22 @@ _extra_compile_args = [
"-DHAVE_PTHREAD=1",
"-DTORRENT_USE_OPENSSL=1",
"-DHAVE_SSL=1",
"-g",
"-p"
"-O2"
]
removals = ["-Wstrict-prototypes"]
if python_version == '2.5':
cv_opt = sysconfig.get_config_vars()["CFLAGS"]
for removal in removals:
cv_opt = cv_opt.replace(removal, " ")
sysconfig.get_config_vars()["CFLAGS"] = " ".join(cv_opt.split())
else:
cv_opt = sysconfig.get_config_vars()["OPT"]
for removal in removals:
cv_opt = cv_opt.replace(removal, " ")
sysconfig.get_config_vars()["OPT"] = " ".join(cv_opt.split())
_include_dirs = [
'./libtorrent',
'./libtorrent/include',