Rename Statistics tab to Status

This commit is contained in:
Andrew Resch 2008-12-17 00:38:15 +00:00
parent 3dce47d1f0
commit 1b8efd5d10
3 changed files with 615 additions and 613 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# statistics_tab.py
# status_tab.py
#
# Copyright (C) 2008 Andrew Resch <andrewresch@gmail.com>
#
@ -52,16 +52,16 @@ def fspeed(value, max_value=-1):
else:
return deluge.common.fspeed(value)
class StatisticsTab(Tab):
class StatusTab(Tab):
def __init__(self):
Tab.__init__(self)
# Get the labels we need to update.
# widgetname, modifier function, status keys
glade = component.get("MainWindow").main_glade
self._name = "Statistics"
self._child_widget = glade.get_widget("statistics_tab")
self._tab_label = glade.get_widget("statistics_tab_label")
self._name = "Status"
self._child_widget = glade.get_widget("status_tab")
self._tab_label = glade.get_widget("status_tab_label")
self.label_widgets = [
(glade.get_widget("summary_pieces"), fpeer_size_second, ("num_pieces", "piece_length")),

View File

@ -77,14 +77,14 @@ class TorrentDetails(component.Component):
self.tabs = {}
# Add the default tabs
from statistics_tab import StatisticsTab
from status_tab import StatusTab
from details_tab import DetailsTab
from files_tab import FilesTab
from peers_tab import PeersTab
from options_tab import OptionsTab
default_tabs = {
"Statistics": StatisticsTab,
"Status": StatusTab,
"Details": DetailsTab,
"Files": FilesTab,
"Peers": PeersTab,
@ -93,7 +93,7 @@ class TorrentDetails(component.Component):
# tab_name, visible
default_order = [
("Statistics", True),
("Status", True),
("Details", True),
("Files", True),
("Peers", True),
@ -117,6 +117,8 @@ class TorrentDetails(component.Component):
# Add the tabs in the order from the state
for tab_name, visible in state:
# We need to rename the tab in the state for backwards compat
tab_name = tab_name.replace("Statistics", "Status")
self.add_tab(default_tabs[tab_name]())
# Hide any of the non-visible ones