[38122] branches/gsoc08-framework/MacPorts.Framework/init.tcl

armahg at macports.org armahg at macports.org
Mon Jul 7 03:11:16 PDT 2008


Revision: 38122
          http://trac.macosforge.org/projects/macports/changeset/38122
Author:   armahg at macports.org
Date:     2008-07-07 03:11:15 -0700 (Mon, 07 Jul 2008)
Log Message:
-----------
Finally fixed notifications issue in init.tcl

Modified Paths:
--------------
    branches/gsoc08-framework/MacPorts.Framework/init.tcl

Modified: branches/gsoc08-framework/MacPorts.Framework/init.tcl
===================================================================
--- branches/gsoc08-framework/MacPorts.Framework/init.tcl	2008-07-07 07:45:33 UTC (rev 38121)
+++ branches/gsoc08-framework/MacPorts.Framework/init.tcl	2008-07-07 10:11:15 UTC (rev 38122)
@@ -74,10 +74,9 @@
 
 #Modifying UI initialization to enable notifications
 proc ui_init {priority prefix channels message} {
-    
-	set t "duna"
+
 	#notifications send global "MP $message Notification" "INSIDE UI_INIT"
-	notifications send global "MP $priority Notification" "Channel none \
+	#notifications send global "MP $priority Notification" "Channel none \
 		Prefix $prefix" $message
 	
     # Get the list of channels.
@@ -90,10 +89,12 @@
     # Simplify ui_$priority.
     set nbchans [llength $channels]
     if {$nbchans == 0} {
-        proc ::ui_$priority {str} 
-		[ 
-		notifications send global "MP $priority Notification1" "Channel none \
-		Prefix $prefix" $str ]
+        proc ::ui_$priority {str} [ 
+			subst {
+				notifications send global "MP $priority Notification" "Channel none \
+				Prefix $prefix" "\$str 
+			}
+		]
     } else {
         try {
             set prefix [ui_prefix $priority]
@@ -106,26 +107,26 @@
 				
 				#Redefine ui_$priority here to also throw notifications of some sort
 				proc ::ui_$priority {str} [
-					subst { puts $chan "$prefix\$str" }
-
+					subst { 
+					puts $chan "$prefix\$str"
+					
 					#Send notifications using NSDistributedNotificationCenter for now
 					#We need a way to name notifications based on given input, using
 					#testMacPortsNotification for now
-					notifications send global "MP $priority Notification2" "Channel $chan \
-					Prefix $prefix" "$str"
+					notifications send global "MP $priority Notification5" "Channel $chan \
+					Prefix $prefix" "\$str"
+					}
 				]
 				
-				
             } else {
                 proc ::ui_$priority {str} [
 					subst {
 						foreach chan \$channels {
 							puts $chan "$prefix\$str"
 						}
+						notifications send global "MP $priority Notification" "Channel $chan \
+						Prefix $prefix" $str
 					}
-					#Should we discriminate based on channel?
-					notifications send global "MP $priority Notification3" "Channel $chan \
-					Prefix $prefix" $str
 				]
             }
 			
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20080707/0f9b6b92/attachment.html 


More information about the macports-changes mailing list