revert tray tooltip lifetime
This commit is contained in:
parent
2cebfca612
commit
a111d8e648
|
@ -52,9 +52,6 @@ class DelugeGTK:
|
|||
#Start the Deluge Manager:
|
||||
self.manager = core.Manager(common.CLIENT_CODE, common.CLIENT_VERSION,
|
||||
'%s %s'%(common.PROGRAM_NAME, common.PROGRAM_VERSION), common.CONFIG_DIR)
|
||||
self.logdir = os.path.join(common.CONFIG_DIR, 'logs')
|
||||
self.alltime_download = None
|
||||
self.alltime_upload = None
|
||||
self.plugins = plugins.PluginManager(self.manager, self)
|
||||
self.plugins.add_plugin_dir(common.PLUGIN_DIR)
|
||||
if os.path.isdir(os.path.join(common.CONFIG_DIR , 'plugins')):
|
||||
|
@ -819,20 +816,6 @@ class DelugeGTK:
|
|||
|
||||
## Start the timer that updates the interface
|
||||
def start(self, start_in_tray=False, cmd_line_torrents=None):
|
||||
if not os.path.isdir(self.logdir):
|
||||
os.mkdir(self.logdir)
|
||||
log = os.path.join(self.logdir, "stats.log")
|
||||
try:
|
||||
logfile = open(log, "r")
|
||||
except:
|
||||
self.alltime_download = 0
|
||||
self.alltime_upload = 0
|
||||
else:
|
||||
readlines = logfile.readlines()
|
||||
self.alltime_download = long(readlines[0])
|
||||
self.alltime_upload = long(readlines[1])
|
||||
logfile.close()
|
||||
|
||||
if cmd_line_torrents is None:
|
||||
cmd_line_torrents = []
|
||||
|
||||
|
@ -981,13 +964,8 @@ class DelugeGTK:
|
|||
else:
|
||||
max_connections = int(self.config.get("max_connections_global"))
|
||||
|
||||
dlall = long(core_state['total_downloaded']) + self.alltime_download
|
||||
ulall = long(core_state['total_uploaded']) + self.alltime_upload
|
||||
|
||||
dlspeed = common.fspeed(core_state['download_rate'])
|
||||
ulspeed = common.fspeed(core_state['upload_rate'])
|
||||
dltotal = common.fsize(dlall)
|
||||
ultotal = common.fsize(ulall)
|
||||
dltotal = common.fsize(core_state['total_downloaded'])
|
||||
ultotal = common.fsize(core_state['total_uploaded'])
|
||||
|
||||
if self.config.get("max_download_speed") < 0:
|
||||
dlspeed_max = _("Unlimited")
|
||||
|
@ -1362,16 +1340,6 @@ class DelugeGTK:
|
|||
self.shutdown()
|
||||
|
||||
def shutdown(self):
|
||||
core_state = self.manager.get_state()
|
||||
|
||||
dlall = long(core_state['total_downloaded']) + self.alltime_download
|
||||
ulall = long(core_state['total_uploaded']) + self.alltime_upload
|
||||
|
||||
log = os.path.join(self.logdir, "stats.log")
|
||||
logfile = open(log, "w")
|
||||
logfile.writelines([str(dlall)+'\n', str(ulall)+'\n'])
|
||||
logfile.close()
|
||||
|
||||
enabled_plugins = ':'.join(self.plugins.get_enabled_plugins())
|
||||
self.config.set('enabled_plugins', enabled_plugins)
|
||||
self.save_window_settings()
|
||||
|
|
Loading…
Reference in New Issue