Exemple #1
0
	def __init__(self, parent):
		# Shows a list of supported features.
		dlg = gtk.Dialog(_("Supported Features"), parent,
		                 buttons=(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE))
		dlg.set_resizable(False)
		
		# Import the librarys needed to check availability.
		import common.dbusBus as bus
		
		# Create a dictionary with the library title and its availability.
		dic = {_("Dbus Message Bus"): bus.avail}
		
		for x in dic:
			# For all the items in the dictionary.
			# Make the availability easier to use.
			a = dic[x]
			# Make an image and assign to it an icon according to the feature's availability.
			img = gtk.Image()
			icon = gtk.STOCK_APPLY if a else gtk.STOCK_CANCEL
			img.set_from_stock(icon, 2)
			# Pack in the button and a label into an HBox,
			# pack the HBox into a VBox and then the VBox
			# into the dialogue.
			hbox = gtk.HBox(spacing=7)
			hbox.pack_start(img, False, False)
			hbox.pack_start(gtk.Label("%s - %s" % (x, _("Available") if a else _("Unavailable"))))
			vbox = gtk.VBox(spacing=7)
			vbox.set_border_width(10)
			vbox.pack_start(hbox, False, False)
			dlg.vbox.pack_start(vbox, False, False)
		
		# Displaying library versions.
		lbl = gtk.Label("<b>"+("Library Versions:")+"</b>")
		lbl.set_use_markup(True)
		lbl.set_alignment(0, 0.5)
		vbox.pack_start(lbl)
		vbox.pack_start(gtk.Label("GTK+ - %s" % useful.verTupleToStr(gtk.gtk_version)))
		vbox.pack_start(gtk.Label("GStreamer - %s" % useful.verTupleToStr(player.version)))
		
		# Show run and destroy it.
		dlg.show_all()
		dlg.run()
		dlg.destroy()
Exemple #2
0
	def __init__(self, parent):
		## Shows the about dialogue.
		# Make the Dialogue.
		dlg = gtk.AboutDialog()
		
		# Sets the correct version, etc, etc.
		# (Name already set in main.py (gobject.set_application_name)
		dlg.set_version(useful.version)
		dlg.set_title("About Whaaw! Media Player")
		dlg.set_copyright("Copyright 2011, Jeff Bailes")
		dlg.set_website("http://home.gna.org/whaawmp/")
		dlg.set_license(useful.licenceText)
		dlg.set_authors(["Jeff Bailes <*****@*****.**>, 2007-2011."])
		dlg.set_translator_credits(_("translator-credits"))
		# Set the parent to the main window.
		dlg.set_transient_for(parent)
		# Set the logo.
		dlg.set_logo(gtk.gdk.pixbuf_new_from_file_at_size(os.path.join(useful.dataDir, 'images', 'whaawmp800.png'), 200, 200))
		# Set the comment.
		dlg.set_comments("GTK+ %s, GStreamer %s" % (useful.verTupleToStr(gtk.gtk_version), useful.verTupleToStr(player.version)))
		
		# Run, then destroy the dialogue.
		dlg.run()
		dlg.destroy()