Entropy/Spritz:
- LicenseDialog, change API, make it multithreading-aware git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@2975 cd1c1023-2f26-0410-ae45-c471fc1f0318
This commit is contained in:
@@ -5849,13 +5849,15 @@ class MessageDialog:
|
||||
dialog.destroy()
|
||||
|
||||
class LicenseDialog:
|
||||
def __init__( self, parent, licenses, entropy ):
|
||||
def __init__( self, spritz_app, entropy, licenses ):
|
||||
|
||||
self.parent = spritz_app.ui.main
|
||||
self.Spritz = spritz_app
|
||||
self.Entropy = entropy
|
||||
self.xml = gtk.glade.XML( const.GLADE_FILE, 'licenseWindow',domain="entropy" )
|
||||
self.xml_licread = gtk.glade.XML( const.GLADE_FILE, 'licenseReadWindow',domain="entropy" )
|
||||
self.dialog = self.xml.get_widget( "licenseWindow" )
|
||||
self.dialog.set_transient_for( parent )
|
||||
self.dialog.set_transient_for( self.parent )
|
||||
self.read_dialog = self.xml_licread.get_widget( "licenseReadWindow" )
|
||||
self.read_dialog.connect( 'delete-event', self.close_read_text_window )
|
||||
#self.read_dialog.set_transient_for( self.dialog )
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
import gtk
|
||||
import sys
|
||||
from spritz_setup import const
|
||||
from dialogs import questionDialog, LicenseDialog, okDialog, choiceDialog, inputDialog
|
||||
@@ -44,10 +45,14 @@ class QueueExecutor:
|
||||
### Before even starting the fetch, make sure that the user accepts their licenses
|
||||
licenses = self.Entropy.get_licenses_to_accept(queue)
|
||||
if licenses:
|
||||
dialog = LicenseDialog(self.Spritz.ui.main, licenses, self.Entropy)
|
||||
accept = dialog.run()
|
||||
dialog.destroy()
|
||||
return accept,licenses
|
||||
gtk.gdk.threads_enter()
|
||||
try:
|
||||
dialog = LicenseDialog(self.Spritz, self.Entropy, licenses)
|
||||
accept = dialog.run()
|
||||
dialog.destroy()
|
||||
return accept,licenses
|
||||
finally:
|
||||
gtk.gdk.threads_leave()
|
||||
else:
|
||||
return 0,licenses
|
||||
|
||||
|
||||
Reference in New Issue
Block a user