mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-03 06:58:42 +00:00
Fix crash in Windows when creating a torrent
This commit is contained in:
parent
20b6791670
commit
a317fdec48
2 changed files with 9 additions and 5 deletions
|
@ -5,6 +5,7 @@
|
||||||
==== GtkUI ====
|
==== GtkUI ====
|
||||||
* Attempt to register as the default magnet uri handler in GNOME on startup
|
* Attempt to register as the default magnet uri handler in GNOME on startup
|
||||||
* Properly show 100.00% and reduce number of progress bar updates during a torrent creation
|
* Properly show 100.00% and reduce number of progress bar updates during a torrent creation
|
||||||
|
* Fix crash in Windows when creating a torrent
|
||||||
|
|
||||||
=== Deluge 1.2.0_rc4 (24 November 2009) ===
|
=== Deluge 1.2.0_rc4 (24 November 2009) ===
|
||||||
==== Core ====
|
==== Core ====
|
||||||
|
|
|
@ -40,6 +40,8 @@ import os.path
|
||||||
import gobject
|
import gobject
|
||||||
import base64
|
import base64
|
||||||
|
|
||||||
|
from twisted.internet.threads import deferToThread
|
||||||
|
|
||||||
from deluge.ui.client import client
|
from deluge.ui.client import client
|
||||||
import listview
|
import listview
|
||||||
import deluge.component as component
|
import deluge.component as component
|
||||||
|
@ -318,9 +320,10 @@ class CreateTorrentDialog:
|
||||||
self.glade.get_widget("progress_dialog").set_transient_for(component.get("MainWindow").window)
|
self.glade.get_widget("progress_dialog").set_transient_for(component.get("MainWindow").window)
|
||||||
self.glade.get_widget("progress_dialog").show_all()
|
self.glade.get_widget("progress_dialog").show_all()
|
||||||
|
|
||||||
import threading
|
def hide_progress(result):
|
||||||
threading.Thread(target=self.create_torrent,
|
self.glade.get_widget("progress_dialog").hide_all()
|
||||||
args=(
|
|
||||||
|
deferToThread(self.create_torrent,
|
||||||
path,
|
path,
|
||||||
tracker,
|
tracker,
|
||||||
piece_length,
|
piece_length,
|
||||||
|
@ -331,7 +334,7 @@ class CreateTorrentDialog:
|
||||||
private,
|
private,
|
||||||
author,
|
author,
|
||||||
trackers,
|
trackers,
|
||||||
add_to_session)).start()
|
add_to_session).addCallback(hide_progress)
|
||||||
|
|
||||||
chooser.destroy()
|
chooser.destroy()
|
||||||
self.dialog.destroy()
|
self.dialog.destroy()
|
||||||
|
@ -350,7 +353,7 @@ class CreateTorrentDialog:
|
||||||
private=private,
|
private=private,
|
||||||
created_by=created_by,
|
created_by=created_by,
|
||||||
trackers=trackers)
|
trackers=trackers)
|
||||||
self.glade.get_widget("progress_dialog").hide_all()
|
|
||||||
if add_to_session:
|
if add_to_session:
|
||||||
client.core.add_torrent_file(
|
client.core.add_torrent_file(
|
||||||
os.path.split(target)[-1],
|
os.path.split(target)[-1],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue