Hi all,

Here's a patch to fink commander to make it indicate positive or
negative feedback from the feedback buttons.
diff -r a9acf33ff2ff FinkController.m
--- a/FinkController.m  Mon Jan 22 05:43:23 2007 +0000
+++ b/FinkController.m  Sun Jan 21 14:28:55 2007 -0800
@@ -744,12 +744,20 @@ enum {
 {
     NSEnumerator *e = [[tableView selectedPackageArray] objectEnumerator];
     NSString *sig = [installationInfo formattedEmailSig];
+    NSString *feedbackMessage;
     FinkPackage *pkg;
     NSMutableArray *pkgNames = [NSMutableArray arrayWithCapacity:5];
 
     if (!packageInfo){
                packageInfo = [[FinkPackageInfo alloc] init];
     }
+
+    if (typeOfFeedback == POSITIVE)
+        feedbackMessage = @"Feedback: works for me";
+    else if (typeOfFeedback == NEGATIVE)
+        feedbackMessage = @"Feedback: not good";
+    else
+        feedbackMessage = @"Feedback: ???";
 
     [packageInfo setEmailSig:sig];
     while (nil != (pkg = [e nextObject])){
@@ -765,7 +773,8 @@ enum {
                        ! [[pkg installed] isEqualToString:[pkg stable]]){
                        [pkgNames addObject:[pkg name]];
                }
-               [[NSWorkspace sharedWorkspace] openURL:[packageInfo 
mailURLForPackage:pkg]];
+        [[NSWorkspace sharedWorkspace] openURL:[packageInfo 
mailURLForPackage:pkg
+                                                                     
withBody:feedbackMessage]];
     }
        if (typeOfFeedback == POSITIVE && [pkgNames count] > 0){
                NSString *msg = [pkgNames count] > 1 ? 
diff -r a9acf33ff2ff FinkPackageInfo.h
--- a/FinkPackageInfo.h Mon Jan 22 05:43:23 2007 +0000
+++ b/FinkPackageInfo.h Sun Jan 21 14:28:55 2007 -0800
@@ -51,6 +51,6 @@
 
 -(void)setEmailSig:(NSString *)s;
 
--(NSURL *)mailURLForPackage:(FinkPackage *)pkg;
+-(NSURL *)mailURLForPackage:(FinkPackage *)pkg withBody:(NSString *)body;
 
 @end
diff -r a9acf33ff2ff FinkPackageInfo.m
--- a/FinkPackageInfo.m Mon Jan 22 05:43:23 2007 +0000
+++ b/FinkPackageInfo.m Sun Jan 21 14:28:55 2007 -0800
@@ -65,11 +65,11 @@
 
 /* Used to set URL attribute for email addresses displayed by Package 
Inspector and
        in FinkController's emailMaintainer method */
--(NSURL *)mailURLForPackage:(FinkPackage *)pkg
+-(NSURL *)mailURLForPackage:(FinkPackage *)pkg withBody:(NSString *)body
 { 
        return [[NSString stringWithFormat: 
-                                               @"mailto:[EMAIL 
PROTECTED]@-%@&body=\n\n%@", 
-                                               [pkg email], [pkg name], [pkg 
version], emailSig]
+                                               @"mailto:[EMAIL 
PROTECTED]@-%@&[EMAIL PROTECTED]@", 
+                                               [pkg email], [pkg name], [pkg 
version], body, emailSig]
                                URLByAddingPercentEscapesToString];
 }
 
@@ -154,7 +154,7 @@
                
        //look for e-mail url and if found turn it into an active link
        if ([[p email] length] > 0){
-               NSURL *murl = [self mailURLForPackage:p];
+            NSURL *murl = [self mailURLForPackage:p withBody:@""];
                r = [[description string] rangeOfString:[p email]];
                [description addAttributes:urlAttributes range:r];
                [description addAttribute:NSLinkAttributeName
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Fink-devel mailing list
Fink-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fink-devel

Reply via email to