Do not show Torrent menu when not connected.

Fix force recheck.
This commit is contained in:
Andrew Resch 2007-11-10 10:04:07 +00:00
parent 5c154c3231
commit 6da931e815
4 changed files with 559 additions and 565 deletions

View File

@ -413,8 +413,8 @@ class TorrentManager:
log.debug("Deleting fastresume file: %s", path)
try:
os.remove(path)
except IOError:
log.warning("Unable to delete the fastresume file: %s", path)
except Exception, e:
log.warning("Unable to delete the fastresume file: %s", e)
def write_fastresume(self, torrent_id):
"""Writes the .fastresume file for the torrent"""

File diff suppressed because it is too large Load Diff

View File

@ -29,7 +29,6 @@
<child>
<widget class="GtkImageMenuItem" id="menuitem_pause">
<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="label">_Pause</property>
<property name="use_underline">True</property>
@ -45,7 +44,6 @@
<child>
<widget class="GtkImageMenuItem" id="menuitem_resume">
<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="tooltip" translatable="yes">Resume selected torrents.</property>
<property name="label" translatable="yes">Resu_me</property>
@ -69,7 +67,6 @@
<child>
<widget class="GtkImageMenuItem" id="menuitem_updatetracker">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="label" translatable="yes">_Update Tracker</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_menuitem_updatetracker_activate"/>
@ -86,7 +83,6 @@
<child>
<widget class="GtkImageMenuItem" id="menuitem_edittrackers">
<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="label" translatable="yes">_Edit Trackers</property>
<property name="use_underline">True</property>
@ -109,7 +105,6 @@
<child>
<widget class="GtkImageMenuItem" id="menuitem_remove">
<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="label" translatable="yes">_Remove Torrent</property>
<property name="use_underline">True</property>

View File

@ -52,10 +52,10 @@ class MenuBar(component.Component):
"glade/torrent_menu.glade"))
self.torrentmenu = 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
self.window.main_glade.get_widget("menu_torrent").set_submenu(
self.torrentmenu)
self.menu_torrent.set_submenu(self.torrentmenu)
### Connect Signals ###
self.window.main_glade.signal_autoconnect({
@ -106,8 +106,8 @@ class MenuBar(component.Component):
for widget in self.change_sensitivity:
self.window.main_glade.get_widget(widget).set_sensitive(True)
for child in self.torrentmenu:
child.set_sensitive(True)
# Show the Torrent menu because we're connected to a host
self.menu_torrent.show()
self.window.main_glade.get_widget("separatormenuitem").show()
self.window.main_glade.get_widget("menuitem_quitdaemon").show()
@ -116,8 +116,8 @@ class MenuBar(component.Component):
for widget in self.change_sensitivity:
self.window.main_glade.get_widget(widget).set_sensitive(False)
for child in self.torrentmenu:
child.set_sensitive(False)
# Hide the Torrent menu
self.menu_torrent.hide()
self.window.main_glade.get_widget("separatormenuitem").hide()
self.window.main_glade.get_widget("menuitem_quitdaemon").hide()