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:
parent
62bd4a86f8
commit
6733ce38d2
1
TODO
1
TODO
|
@ -9,7 +9,6 @@
|
||||||
* Maybe add pop-up menus to the status bar items
|
* Maybe add pop-up menus to the status bar items
|
||||||
* Address issue where torrents will redownload if the storage is moved outside
|
* Address issue where torrents will redownload if the storage is moved outside
|
||||||
of deluge.
|
of deluge.
|
||||||
* Hide open folder if not localhost
|
|
||||||
* Implement 'Classic' mode
|
* Implement 'Classic' mode
|
||||||
* Tray tooltip
|
* Tray tooltip
|
||||||
* Add autoload folder
|
* Add autoload folder
|
||||||
|
|
|
@ -47,11 +47,11 @@ class MenuBar(component.Component):
|
||||||
component.Component.__init__(self, "MenuBar")
|
component.Component.__init__(self, "MenuBar")
|
||||||
self.window = component.get("MainWindow")
|
self.window = component.get("MainWindow")
|
||||||
# Get the torrent menu from the glade file
|
# 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",
|
pkg_resources.resource_filename("deluge.ui.gtkui",
|
||||||
"glade/torrent_menu.glade"))
|
"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")
|
self.menu_torrent = self.window.main_glade.get_widget("menu_torrent")
|
||||||
|
|
||||||
# Attach the torrent_menu to the Torrent file menu
|
# 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
|
"on_menuitem_about_activate": self.on_menuitem_about_activate
|
||||||
})
|
})
|
||||||
|
|
||||||
torrentmenu_glade.signal_autoconnect({
|
self.torrentmenu_glade.signal_autoconnect({
|
||||||
## Torrent Menu
|
## Torrent Menu
|
||||||
"on_menuitem_pause_activate": self.on_menuitem_pause_activate,
|
"on_menuitem_pause_activate": self.on_menuitem_pause_activate,
|
||||||
"on_menuitem_resume_activate": self.on_menuitem_resume_activate,
|
"on_menuitem_resume_activate": self.on_menuitem_resume_activate,
|
||||||
|
@ -111,6 +111,20 @@ class MenuBar(component.Component):
|
||||||
for widget in self.change_sensitivity:
|
for widget in self.change_sensitivity:
|
||||||
self.window.main_glade.get_widget(widget).set_sensitive(True)
|
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
|
# Show the Torrent menu because we're connected to a host
|
||||||
self.menu_torrent.show()
|
self.menu_torrent.show()
|
||||||
|
|
||||||
|
|
19
setup.py
19
setup.py
|
@ -32,13 +32,12 @@ import ez_setup
|
||||||
ez_setup.use_setuptools()
|
ez_setup.use_setuptools()
|
||||||
|
|
||||||
from setuptools import setup, find_packages, Extension
|
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.build import build as _build
|
||||||
from distutils.command.install import install as _install
|
from distutils.command.install import install as _install
|
||||||
from distutils.command.install_data import install_data as _install_data
|
from distutils.command.install_data import install_data as _install_data
|
||||||
import msgfmt
|
import msgfmt
|
||||||
|
|
||||||
|
|
||||||
import platform
|
import platform
|
||||||
import glob
|
import glob
|
||||||
import os
|
import os
|
||||||
|
@ -54,10 +53,22 @@ _extra_compile_args = [
|
||||||
"-DHAVE_PTHREAD=1",
|
"-DHAVE_PTHREAD=1",
|
||||||
"-DTORRENT_USE_OPENSSL=1",
|
"-DTORRENT_USE_OPENSSL=1",
|
||||||
"-DHAVE_SSL=1",
|
"-DHAVE_SSL=1",
|
||||||
"-g",
|
"-O2"
|
||||||
"-p"
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
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 = [
|
_include_dirs = [
|
||||||
'./libtorrent',
|
'./libtorrent',
|
||||||
'./libtorrent/include',
|
'./libtorrent/include',
|
||||||
|
|
Loading…
Reference in New Issue