[139436] branches/gsoc15-pallet

ksammons at macports.org ksammons at macports.org
Mon Aug 17 10:44:37 PDT 2015


Revision: 139436
          https://trac.macports.org/changeset/139436
Author:   ksammons at macports.org
Date:     2015-08-17 10:44:37 -0700 (Mon, 17 Aug 2015)
Log Message:
-----------
Added Rev-Upgrade to Pallet

Modified Paths:
--------------
    branches/gsoc15-pallet/MacPorts_Framework/MPMacPorts.h
    branches/gsoc15-pallet/MacPorts_Framework/MPMacPorts.m
    branches/gsoc15-pallet/Pallet/English.lproj/MainMenu.xib
    branches/gsoc15-pallet/Pallet/GrowlNotifications.h
    branches/gsoc15-pallet/Pallet/MPActionLauncher.h
    branches/gsoc15-pallet/Pallet/MPActionLauncher.m
    branches/gsoc15-pallet/Pallet/MPActionsController.h
    branches/gsoc15-pallet/Pallet/MPActionsController.m
    branches/gsoc15-pallet/Pallet/Pallet.xcodeproj/project.xcworkspace/xcuserdata/mrappleseed.xcuserdatad/UserInterfaceState.xcuserstate

Modified: branches/gsoc15-pallet/MacPorts_Framework/MPMacPorts.h
===================================================================
--- branches/gsoc15-pallet/MacPorts_Framework/MPMacPorts.h	2015-08-17 03:33:04 UTC (rev 139435)
+++ branches/gsoc15-pallet/MacPorts_Framework/MPMacPorts.h	2015-08-17 17:44:37 UTC (rev 139436)
@@ -99,7 +99,12 @@
  */
 - (id)reclaim:(NSError**)sError;
 
+/*!
+ @brief Runs the rev-upgrade command.
+ */
+- (id)revupgrade:(NSError**)sError;
 
+
 /*!
  @brief Synchronizes the ports tree without checking for upgrades to the MacPorts base.
  */

Modified: branches/gsoc15-pallet/MacPorts_Framework/MPMacPorts.m
===================================================================
--- branches/gsoc15-pallet/MacPorts_Framework/MPMacPorts.m	2015-08-17 03:33:04 UTC (rev 139435)
+++ branches/gsoc15-pallet/MacPorts_Framework/MPMacPorts.m	2015-08-17 17:44:37 UTC (rev 139436)
@@ -131,6 +131,32 @@
 
 #pragma MacPorts API
 
+- (id)revupgrade:(NSError **)sError
+{
+    NSString * result = nil;
+    [[NSDistributedNotificationCenter defaultCenter] postNotificationName:@"MacPorts_revupgrade_Started" object:nil];
+    [[MPNotifications sharedListener] setPerformingTclCommand:@"revupgrade"];
+    
+    //FIXME
+    /*
+     if ([self authorizationMode])
+     {
+     result = [interpreter evaluateStringWithMPHelperTool:@"mportdiagnose" error:sError];
+     }
+     else
+     {
+     result = [interpreter evaluateStringWithPossiblePrivileges:@"mportdiagnose" error:sError];
+     }*/
+    
+    result = [interpreter evaluateStringAsString:@"macports::revupgrade \"\"" error:sError];
+    
+    [[MPNotifications sharedListener] setPerformingTclCommand:@""];
+    [[NSDistributedNotificationCenter defaultCenter] postNotificationName:@"MacPorts_revupgrade_Finished" object:nil];
+    
+    return result;
+
+}
+
 - (id)reclaim:(NSError**)sError
 {
     NSString * result = nil;

Modified: branches/gsoc15-pallet/Pallet/English.lproj/MainMenu.xib
===================================================================
--- branches/gsoc15-pallet/Pallet/English.lproj/MainMenu.xib	2015-08-17 03:33:04 UTC (rev 139435)
+++ branches/gsoc15-pallet/Pallet/English.lproj/MainMenu.xib	2015-08-17 17:44:37 UTC (rev 139436)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="5056" systemVersion="13C64" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
     <dependencies>
-        <deployment version="1060" identifier="macosx"/>
+        <deployment version="1060" defaultVersion="1060" identifier="macosx"/>
         <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="5056"/>
     </dependencies>
     <objects>
@@ -696,12 +696,12 @@
                         <rect key="frame" x="6" y="9" width="63" height="12"/>
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                         <connections>
-                            <binding destination="764" name="animate" keyPath="busy" id="791"/>
                             <binding destination="764" name="hidden" keyPath="busy" id="780">
                                 <dictionary key="options">
                                     <string key="NSValueTransformerName">NSNegateBoolean</string>
                                 </dictionary>
                             </binding>
+                            <binding destination="764" name="animate" keyPath="busy" id="791"/>
                         </connections>
                     </progressIndicator>
                     <textField verticalHuggingPriority="750" id="781">
@@ -733,7 +733,7 @@
                             <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
                             <popUpButtonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="TB_Install" imagePosition="above" alignment="right" lineBreakMode="truncatingTail" state="on" borderStyle="bezel" imageScaling="proportionallyUpOrDown" inset="2" pullsDown="YES" arrowPosition="noArrow" selectedItem="898" id="896">
                                 <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
-                                <font key="font" metaFont="system"/>
+                                <font key="font" metaFont="menu"/>
                                 <menu key="menu" title="OtherViews" id="897">
                                     <items>
                                         <menuItem state="on" image="TB_Install" hidden="YES" id="898"/>
@@ -827,6 +827,11 @@
                             <action selector="reclaim:" target="628" id="MDu-KV-96b"/>
                         </connections>
                     </toolbarItem>
+                    <toolbarItem implicitItemIdentifier="24F28DE3-525B-41DE-AA7F-DEF4857BF1AB" label="Rev-Upgrade" paletteLabel="Rev-Upgrade" tag="-1" image="NSCaution" id="gyM-mH-Mv9">
+                        <connections>
+                            <action selector="revupgrade:" target="628" id="Adk-7S-iro"/>
+                        </connections>
+                    </toolbarItem>
                 </allowedToolbarItems>
                 <defaultToolbarItems>
                     <toolbarItem reference="901"/>
@@ -837,12 +842,16 @@
                     <toolbarItem reference="645"/>
                     <toolbarItem reference="3pR-dv-sVZ"/>
                     <toolbarItem reference="iMK-ib-TIq"/>
+                    <toolbarItem reference="gyM-mH-Mv9"/>
                     <toolbarItem reference="762"/>
                     <toolbarItem reference="423"/>
                     <toolbarItem reference="1035"/>
                     <toolbarItem reference="426"/>
                     <toolbarItem reference="453"/>
                 </defaultToolbarItems>
+                <connections>
+                    <outlet property="delegate" destination="503" id="mib-8d-vBn"/>
+                </connections>
             </toolbar>
         </window>
         <window title="Activity" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" hidesOnDeactivate="YES" oneShot="NO" visibleAtLaunch="NO" animationBehavior="default" id="435" customClass="NSPanel">
@@ -858,11 +867,11 @@
                         <rect key="frame" x="6" y="26" width="263" height="348"/>
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
                         <clipView key="contentView" id="Wnl-09-Bxi">
-                            <rect key="frame" x="1" y="1" width="261" height="346"/>
+                            <rect key="frame" x="1" y="1" width="246" height="330"/>
                             <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                             <subviews>
                                 <tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" alternatingRowBackgroundColors="YES" columnSelection="YES" multipleSelection="NO" autosaveColumns="NO" rowHeight="40" id="440">
-                                    <rect key="frame" x="0.0" y="0.0" width="261" height="346"/>
+                                    <rect key="frame" x="0.0" y="0.0" width="246" height="330"/>
                                     <autoresizingMask key="autoresizingMask"/>
                                     <size key="intercellSpacing" width="3" height="2"/>
                                     <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
@@ -890,7 +899,7 @@
                                             </textFieldCell>
                                             <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
                                         </tableColumn>
-                                        <tableColumn width="25" minWidth="10" maxWidth="3.4028230607370965e+38" id="446">
+                                        <tableColumn width="10" minWidth="10" maxWidth="3.4028230607370965e+38" id="446">
                                             <tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left">
                                                 <font key="font" metaFont="smallSystem"/>
                                                 <color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
@@ -905,11 +914,11 @@
                             <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
                         </clipView>
                         <scroller key="horizontalScroller" verticalHuggingPriority="750" horizontal="YES" id="439">
-                            <rect key="frame" x="1" y="331" width="261" height="16"/>
+                            <rect key="frame" x="1" y="331" width="246" height="16"/>
                             <autoresizingMask key="autoresizingMask"/>
                         </scroller>
                         <scroller key="verticalScroller" verticalHuggingPriority="750" horizontal="NO" id="438">
-                            <rect key="frame" x="246" y="1" width="16" height="346"/>
+                            <rect key="frame" x="247" y="1" width="15" height="330"/>
                             <autoresizingMask key="autoresizingMask"/>
                         </scroller>
                     </scrollView>
@@ -1485,6 +1494,7 @@
     <resources>
         <image name="Installed" width="13" height="13"/>
         <image name="NSAdvanced" width="32" height="32"/>
+        <image name="NSCaution" width="32" height="32"/>
         <image name="NSTrashFull" width="32" height="32"/>
         <image name="TB_Cancel" width="512" height="512"/>
         <image name="TB_Info" width="512" height="512"/>

Modified: branches/gsoc15-pallet/Pallet/GrowlNotifications.h
===================================================================
--- branches/gsoc15-pallet/Pallet/GrowlNotifications.h	2015-08-17 03:33:04 UTC (rev 139435)
+++ branches/gsoc15-pallet/Pallet/GrowlNotifications.h	2015-08-17 17:44:37 UTC (rev 139436)
@@ -10,7 +10,7 @@
 /* Defining growl types*/
 
 /**/
-#define GROWL_TYPES 16
+#define GROWL_TYPES 18
 #define GROWL_INSTALL 0
 #define GROWL_UNINSTALL 1
 #define GROWL_UPGRADE 2
@@ -18,14 +18,16 @@
 #define GROWL_SELFUPDATE 4
 #define GROWL_DIAGNOSE 5
 #define GROWL_RECLAIM 6
-#define GROWL_INSTALLFAILED 7
-#define GROWL_UNINSTALLFAILED 8
-#define GROWL_UPGRADEFAILED 9
-#define GROWL_SYNCFAILED 10
-#define GROWL_DIAGNOSEFAILED 11
-#define GROWL_RECLAIMFAILED 12
-#define GROWL_SELFUPDATEFAILED 13
+#define GROWL_REVUPGRADE 7
+#define GROWL_INSTALLFAILED 8
+#define GROWL_UNINSTALLFAILED 9
+#define GROWL_UPGRADEFAILED 10
+#define GROWL_SYNCFAILED 11
+#define GROWL_DIAGNOSEFAILED 12
+#define GROWL_RECLAIMFAILED 13
+#define GROWL_REVUPGRADEFAILED 14
+#define GROWL_SELFUPDATEFAILED 15
 
 
-#define GROWL_ALLOPS 14
-#define GROWL_ALLOPSFAILED 15
+#define GROWL_ALLOPS 16
+#define GROWL_ALLOPSFAILED 17

Modified: branches/gsoc15-pallet/Pallet/MPActionLauncher.h
===================================================================
--- branches/gsoc15-pallet/Pallet/MPActionLauncher.h	2015-08-17 03:33:04 UTC (rev 139435)
+++ branches/gsoc15-pallet/Pallet/MPActionLauncher.h	2015-08-17 17:44:37 UTC (rev 139436)
@@ -90,6 +90,11 @@
 - (void)reclaim;
 
 /*!
+ @brief Runs the revupgrade command.
+ */
+- (void)revupgrade;
+
+/*!
  @brief Syncs the MacPorts installation in another thread
  */
 - (void)sync;

Modified: branches/gsoc15-pallet/Pallet/MPActionLauncher.m
===================================================================
--- branches/gsoc15-pallet/Pallet/MPActionLauncher.m	2015-08-17 03:33:04 UTC (rev 139435)
+++ branches/gsoc15-pallet/Pallet/MPActionLauncher.m	2015-08-17 17:44:37 UTC (rev 139436)
@@ -118,6 +118,22 @@
 	}
 }
 
+- (void)revupgrade
+{
+    errorReceived = NO;
+    NSError * error;
+    [[MPMacPorts sharedInstance] revupgrade:&error];
+    if(errorReceived)
+    {
+        [self sendNotification:GROWL_REVUPGRADEFAILED];
+    }
+    else
+    {
+        [self sendNotification:GROWL_REVUPGRADE];
+        [[NSNotificationCenter defaultCenter] postNotificationName:@"advanceQ" object:nil userInfo:nil];
+    }
+}
+
 - (void)reclaim
 {
     errorReceived = NO;
@@ -208,6 +224,7 @@
 	notificationTitles[GROWL_SYNC]                      = @"Sync Completed";
     notificationTitles[GROWL_DIAGNOSE]                  = @"Diagnose Completed";
     notificationTitles[GROWL_RECLAIM]                   = @"Reclaim Completed";
+    notificationTitles[GROWL_REVUPGRADE]                = @"Rev-Upgrade Completed";
 	notificationTitles[GROWL_SELFUPDATE]                = @"Selfupdate Completed";
 	notificationTitles[GROWL_INSTALLFAILED]             = @"Installation Failed";
 	notificationTitles[GROWL_UNINSTALLFAILED]           = @"Uninstall Failed";
@@ -215,6 +232,7 @@
 	notificationTitles[GROWL_SYNCFAILED]                = @"Sync Failed";
     notificationTitles[GROWL_DIAGNOSEFAILED]            = @"Diagnose Failed";
     notificationTitles[GROWL_RECLAIMFAILED]             = @"Reclaim Failed";
+    notificationTitles[GROWL_REVUPGRADEFAILED]          = @"Rev-Upgrade Failed";
 	notificationTitles[GROWL_SELFUPDATEFAILED]          = @"Selfupdate Failed";
 
 	notificationTitles[GROWL_ALLOPS]                    = @"Operations Completed";
@@ -228,6 +246,7 @@
 	notificationDescriptions[GROWL_SYNC]                = @"Operation completed successfully";
     notificationDescriptions[GROWL_DIAGNOSE]            = @"Operation completed successfully";
     notificationDescriptions[GROWL_RECLAIM]             = @"Operation completed successfully";
+    notificationDescriptions[GROWL_REVUPGRADE]          = @"Operation completed successfully";
 	notificationDescriptions[GROWL_SELFUPDATE]          = @"Operation completed successfully";
 	notificationDescriptions[GROWL_INSTALLFAILED]       = @"Operation Failed";
 	notificationDescriptions[GROWL_UNINSTALLFAILED]     = @"Operation Failed";
@@ -235,6 +254,7 @@
 	notificationDescriptions[GROWL_SYNCFAILED]          = @"Operation Failed";
     notificationDescriptions[GROWL_DIAGNOSEFAILED]      = @"Operation Failed";
     notificationDescriptions[GROWL_RECLAIMFAILED]       = @"Operation Failed";
+    notificationDescriptions[GROWL_REVUPGRADEFAILED]    = @"Operation Failed";
 	notificationDescriptions[GROWL_SELFUPDATEFAILED]    = @"Operation Failed";
 
 	notificationDescriptions[GROWL_ALLOPS]              = @"All Operations Completed Succesfully";

Modified: branches/gsoc15-pallet/Pallet/MPActionsController.h
===================================================================
--- branches/gsoc15-pallet/Pallet/MPActionsController.h	2015-08-17 03:33:04 UTC (rev 139435)
+++ branches/gsoc15-pallet/Pallet/MPActionsController.h	2015-08-17 17:44:37 UTC (rev 139436)
@@ -59,6 +59,7 @@
 - (IBAction)sync:(id)sender;
 - (IBAction)diagnose:(id)sender;
 - (IBAction)reclaim:(id)sender;
+- (IBAction)revupgrade:(id)sender;
 - (IBAction)selfupdate:(id)sender;
 - (IBAction)cancel:(id)sender;
 - (IBAction)toggleInfoPanel: (id) sender;

Modified: branches/gsoc15-pallet/Pallet/MPActionsController.m
===================================================================
--- branches/gsoc15-pallet/Pallet/MPActionsController.m	2015-08-17 03:33:04 UTC (rev 139435)
+++ branches/gsoc15-pallet/Pallet/MPActionsController.m	2015-08-17 17:44:37 UTC (rev 139436)
@@ -209,6 +209,11 @@
 	if (altWasPressed)
 		[self startQueue:nil];
 }
+- (IBAction)revupgrade:(id)sender
+{
+    [tableController open:nil];
+    [self queueOperation:@"revupgrade" portName:@"-" portObject:@"-" variants:0];
+}
 
 - (IBAction)reclaim:(id)sender
 {
@@ -449,6 +454,11 @@
             NSLog(@"We have reclaim");
             [[MPActionLauncher sharedInstance] performSelectorInBackground:@selector(reclaim) withObject:nil];
         }
+        else if([[dict objectForKey:@"operation"] isEqualToString:@"revupgrade"])
+        {
+            NSLog(@"We have revupgrade");
+            [[MPActionLauncher sharedInstance] performSelectorInBackground:@selector(revupgrade) withObject:nil];
+        }
 	}
 	else
 	{
@@ -504,6 +514,10 @@
     {
         image = [NSImage imageNamed:@"NSTrashFull"];
     }
+    else if([operation isEqualToString:@"revupgrade"])
+    {
+        image = [NSImage imageNamed:@"NSCaution"];
+    }
 	
 	//If we have variants, print them out for debugging purposes
 	if(variants!=nil)

Modified: branches/gsoc15-pallet/Pallet/Pallet.xcodeproj/project.xcworkspace/xcuserdata/mrappleseed.xcuserdatad/UserInterfaceState.xcuserstate
===================================================================
(Binary files differ)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20150817/1829d6cd/attachment-0001.html>


More information about the macports-changes mailing list