Commits

elbaschid committed b90f7f5

added About dialog

  • Participants
  • Parent commits c058ecb

Comments (0)

Files changed (1)

File revelation-indicator.py

 
         self.about_item = gtk.MenuItem(_('About'))
         self.about_item.show()
+        self.about_item.connect('activate', self.about)
 
-        #self.quit_item.connect("activate", self.quit)
-        #self.quit_item.show()
-        #self.menu.append(self.quit_item)
+		#	( "about",		lambda w,d=None: self.about() ),
+		#	( "file-lock",		lambda w,d=None: self.file_close() ),
+		#	( "file-reload",	lambda w,d=None: self.file_reload() ),
+		#	( "file-unlock",	lambda w,d=None: self.file_open(self.config.get("file")) ),
+		#	( "prefs",		lambda w,d=None: self.prefs() ),
+		#	( "revelation",		lambda w,d=None: util.execute_child("@bindir@/revelation") ),
+
         self.menu.append(self.lock_item)
         self.menu.append(self.unlock_item)
         self.menu.append(self.reload_item)
 
         self.ind.set_menu(self.menu)
 
-#		gtk.about_dialog_set_url_hook(lambda d,l: gtk.show_uri(None, l, gtk.get_current_event_time()))
-#		gtk.about_dialog_set_email_hook(lambda d,l: gtk.show_uri(None, "mailto:" + l, gtk.get_current_event_time()))
+        gtk.about_dialog_set_url_hook(
+            lambda d,l: gtk.show_uri(None, l, gtk.get_current_event_time())
+        )
+
+	gtk.about_dialog_set_email_hook(
+            lambda d,l: gtk.show_uri(None, "mailto:" + l, gtk.get_current_event_time())
+        )
+
+#	# set up window icons
+#	pixbufs = [ self.items.get_pixbuf("revelation", size) for size in ( 48, 32, 24, 16) ]
+#	pixbufs = [ pixbuf for pixbuf in pixbufs if pixbuf != None ]
 #
-#		# set up applet
-#		self.applet.set_flags(gnomeapplet.EXPAND_MINOR)
+#	if len(pixbufs) > 0:
+#	    gtk.window_set_default_icon_list(*pixbufs)
 #
-#		# set up window icons
-#		pixbufs = [ self.items.get_pixbuf("revelation", size) for size in ( 48, 32, 24, 16) ]
-#		pixbufs = [ pixbuf for pixbuf in pixbufs if pixbuf != None ]
-#
-#		if len(pixbufs) > 0:
-#			gtk.window_set_default_icon_list(*pixbufs)
-#
-		# set up popup menu
-		#self.applet.setup_menu("""
+        # set up popup menu
+        #self.applet.setup_menu("""
 		#	<popup name="button3">
 		#		<menuitem name="file-unlock"	verb="file-unlock"	label=\"""" + _('Unlock File') + """\"		pixtype="stock" pixname="revelation-unlock" />
 		#		<menuitem name="file-lock"	verb="file-lock"	label=\"""" + _('Lock File') + """\"		pixtype="stock" pixname="revelation-lock" />
     def quit(self, widget):
         sys.exit(0)
 
-
+    def about(self, item):
+        dialog = gtk.AboutDialog()
+        dialog.set_name(_('Revelation Indicator'))
+        dialog.set_comments(_('An indicator applet to browse a Revelation database'))
+        dialog.set_version("0.1")
+        dialog.set_copyright("(c) Sebastian Vetter")
+        dialog.run()
+        dialog.destroy()
 
     def __cb_exception(self, type, value, trace):
 
             gtk.main()
         else:
             sys.exit(1)
-            
 
 def main():
     revelation_indicator = RevelationIndicator()