gtk progressbar

This commit is contained in:
Zach Tibbitts 2007-02-12 23:12:08 +00:00
parent 2a64b816c5
commit 9235d0158d
4 changed files with 673 additions and 707 deletions

File diff suppressed because it is too large Load Diff

View File

@ -34,12 +34,6 @@ parser.add_option("--tray", dest="tray", help="start Deluge hidden in system tra
(options, args) = parser.parse_args() (options, args) = parser.parse_args()
if options.tray:
print "Deluge will start in the system tray if available"
print options
print args
import dbus import dbus
bus = dbus.SessionBus() bus = dbus.SessionBus()

View File

@ -22,10 +22,11 @@ import sys, os, os.path, webbrowser
PROGRAM_NAME = "Deluge" PROGRAM_NAME = "Deluge"
PROGRAM_VERSION = "0.4.9.0" PROGRAM_VERSION = "0.4.9.0"
DELUGE_DIR = os.path.abspath(os.path.dirname(sys.argv[0]))
PREFIX = sys.prefix GLADE_DIR = sys.prefix + '/share/deluge/glade'
GLADE_DIR = PREFIX + "/share/deluge/glade" PIXMAP_DIR = sys.prefix + '/share/deluge/pixmaps'
PIXMAP_DIR = PREFIX + "/share/deluge/pixmaps" PLUGIN_DIR = sys.prefix + '/share/deluge/plugins'
class DelugePreferences: class DelugePreferences:
def __init__(self): def __init__(self):
@ -69,9 +70,8 @@ class DelugePreferences:
key = key.strip(" \n") key = key.strip(" \n")
value = value.strip(" \n") value = value.strip(" \n")
self.pref[key] = value self.pref[key] = value
print 'Read option %s with a value of %s'%(key, value)
except ValueError: except ValueError:
print "Empty Line" pass
f.close() f.close()
def save_to_file(self, filename): def save_to_file(self, filename):

View File

@ -387,7 +387,7 @@ class DelugeGTK(dbus.service.Object):
state = self.manager.get_torrent_state(self.get_selected_torrent()) state = self.manager.get_torrent_state(self.get_selected_torrent())
except deluge.InvalidUniqueIDError: except deluge.InvalidUniqueIDError:
return True return True
self.text_summary_title.set_text(str(state["name"])) self.wtree.get_widget("progressbar").set_text('%s %s'%(str(state["name"]), dcommon.fpcnt(state["progress"])))
self.text_summary_total_size.set_text(dcommon.fsize(state["total_size"])) self.text_summary_total_size.set_text(dcommon.fsize(state["total_size"]))
self.text_summary_pieces.set_text(str(state["pieces"])) self.text_summary_pieces.set_text(str(state["pieces"]))
self.text_summary_total_downloaded.set_text(dcommon.fsize(state["total_download"])) self.text_summary_total_downloaded.set_text(dcommon.fsize(state["total_download"]))
@ -396,7 +396,7 @@ class DelugeGTK(dbus.service.Object):
self.text_summary_upload_rate.set_text(dcommon.frate(state["upload_rate"])) self.text_summary_upload_rate.set_text(dcommon.frate(state["upload_rate"]))
self.text_summary_seeders.set_text(dcommon.fseed(state)) self.text_summary_seeders.set_text(dcommon.fseed(state))
self.text_summary_peers.set_text(dcommon.fpeer(state)) self.text_summary_peers.set_text(dcommon.fpeer(state))
self.text_summary_percentage_done.set_text(dcommon.fpcnt(state["progress"])) self.wtree.get_widget("progressbar").set_fraction(float(state['progress']))
self.text_summary_share_ratio.set_text(self.calc_share_ratio(self.get_selected_torrent(), state)) self.text_summary_share_ratio.set_text(self.calc_share_ratio(self.get_selected_torrent(), state))
#self.text_summary_downloaded_this_session.set_text(str(state[""])) #self.text_summary_downloaded_this_session.set_text(str(state[""]))
#self.text_summary_uplodaded_this_session.set_text(str(state[""])) #self.text_summary_uplodaded_this_session.set_text(str(state[""]))