Added Launcher.app

git-svn-id: https://svn.macports.org/repository/macports/branches/gsoc15-pallet@143487 d073be05-634f-4543-b044-5fe20cf6d1d6
This commit is contained in:
Kyle Sammons
2015-12-13 20:16:41 +00:00
parent 69405b0d9b
commit 365326ca6e
20 changed files with 105 additions and 40 deletions
+14 -7
View File
@@ -141,14 +141,18 @@
/*
if ([self authorizationMode])
{
result = [interpreter evaluateStringWithMPHelperTool:@"mportdiagnose" error:sError];
result = [interpreter evaluateStringWithMPHelperTool:@"mportrevupgrade" error:sError];
}
else
{
result = [interpreter evaluateStringWithPossiblePrivileges:@"mportdiagnose" error:sError];
result = [interpreter evaluateStringWithPossiblePrivileges:@"mportrevupgrade" error:sError];
}*/
result = [interpreter evaluateStringAsString:@"macports::revupgrade \"\"" error:sError];
/*result = [interpreter evaluateStringAsString:@"exec port rev-upgrade 2>foo.txt > foo.txt; set test [exec cat foo.txt]; file delete -force foo.txt; return \"Port revupgrade output:\n $test\"" error:sError];
NSAlert * alert = [[NSAlert alloc]init];
[alert setMessageText:result];
[alert runModal];*/
result = [interpreter evaluateStringAsString:@"macports::rev_upgrade" error:sError];
[[MPNotifications sharedListener] setPerformingTclCommand:@""];
[[NSDistributedNotificationCenter defaultCenter] postNotificationName:@"MacPorts_revupgrade_Finished" object:nil];
@@ -168,15 +172,15 @@
/*
if ([self authorizationMode])
{
result = [interpreter evaluateStringWithMPHelperTool:@"mportdiagnose" error:sError];
result = [interpreter evaluateStringWithMPHelperTool:@"mportreclaim" error:sError];
}
else
{
result = [interpreter evaluateStringWithPossiblePrivileges:@"mportdiagnose" error:sError];
result = [interpreter evaluateStringWithPossiblePrivileges:@"mportreclaim" error:sError];
}*/
result = [interpreter evaluateStringAsString:@"reclaim::main \"\"" error:sError];
[[MPNotifications sharedListener] setPerformingTclCommand:@""];
[[NSDistributedNotificationCenter defaultCenter] postNotificationName:@"MacPorts_reclaim_Finished" object:nil];
@@ -202,7 +206,10 @@
result = [interpreter evaluateStringWithPossiblePrivileges:@"mportdiagnose" error:sError];
}*/
result = [interpreter evaluateStringAsString:@"diagnose::main \"--quiet\"" error:sError];
result = [interpreter evaluateStringAsString:@"global display_message; incr display_message 1; puts \"Display_Message in XCode: $display_message\"; ui_msg \"Test\"" error:sError];
/*NSAlert * alert = [[NSAlert alloc]init];
[alert setMessageText:result];
[alert runModal];*/
NSLog(@"RESULT: %@", result);
-1
View File
@@ -116,7 +116,6 @@
*/
- (NSArray *)depends;
/*!
@brief Deactivates and uninstalls this MPPort from the MacPorts system
@param version An NSString indicating which version of this port to uninstall
+12 -9
View File
@@ -1,21 +1,23 @@
package require macports
package require notifications
proc ui_init {priority prefix channels message} {
proc ui_init {priority prefix channels args} {
global display_message
switch $priority {
msg {
set nottype "MPMsgNotification"
}
debug {
set nottype "MPDebugNotification"
puts "Recieved Debug init"
puts "Debug: $args"
}
warn {
set nottype "MPWarnNotification"
}
error {
set nottype "MPErrorNotification"
puts "Recieved Error"
puts "Error: $args"
}
info {
set nottype "MPInfoNotification"
@@ -27,11 +29,8 @@ proc ui_init {priority prefix channels message} {
}
proc ::ui_$priority {message} [subst {
notifications send $nottype "$channels($priority) $prefix" "\$message"
set $prefix "TEST"
notifications send $nottype "$prefix" "\$message"
ui_message $priority $prefix "" "\$message"
puts "TESTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT"
}]
}
@@ -40,8 +39,11 @@ proc ui_init {priority prefix channels message} {
#Wrapping the following API routines to catch errors
#and log error Information in a similar fashion to code
#in macports.tcl.
proc test {} {
puts "TEST"
}
proc mportuninstall {portname {version ""} {revision ""} {variants 0} {optionslist ""}} {
puts "IN THIS REALLY COOL SHIT NOW. NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOW"
if {[catch {registry_uninstall::uninstall $portname $version $revision $variants $optionslist} result]} {
global errorInfo
@@ -51,7 +53,6 @@ proc mportuninstall {portname {version ""} {revision ""} {variants 0} {optionsli
}
}
proc mportuninstall_composite {portname {v ""} {optionslist ""}} {
puts "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!IN THIS REALLY COOL SHIT NOW. NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOW"
if {[catch {registry_uninstall::uninstall_composite $portname $v $optionslist} result]} {
global errorInfo
@@ -113,6 +114,8 @@ proc mportupgrade {portname} {
# Initialize dport
# This must be done following parse of global options, as some options are
# evaluated by dportinit.
global display_message
set display_message 0
if {[catch {mportinit ui_options global_options global_variations} result]} {
global errorInfo
puts "$errorInfo"
+3 -1
View File
@@ -30,7 +30,6 @@ proc ui_init {priority prefix channels message} {
proc ::ui_$priority {message} [subst {
simplelog "$nottype $channels($priority) $prefix" "\$message"
ui_message $priority $prefix "" "\$message"
puts "**************************************************"
}]
}
@@ -39,6 +38,9 @@ proc ui_init {priority prefix channels message} {
#and log error Information in a similar fashion to code
#in macports.tcl. Note optionslist is not being used for now
set mp_empty_list [list]
proc test {} {
puts "TEST"
}
proc mportuninstall {portname {version ""} {revision ""} {variants 0} {optionslist ""} } {
if {[catch {registry_uninstall::uninstall $portname $version $revision $variants [array get options]} result]} {
+4 -3
View File
@@ -29,9 +29,7 @@ proc ui_init {priority prefix channels message} {
proc ::ui_$priority {message} [subst {
simplelog "$nottype $channels($priority) $prefix" "\$message"
set $prefix "TEST"
ui_message $priority $prefix"" "\$message"
puts "TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT"
}]
}
@@ -40,6 +38,10 @@ proc ui_init {priority prefix channels message} {
#and log error Information in a similar fashion to code
#in macports.tcl. Note optionslist is not being used for now
set mp_empty_list [list]
proc test {} {
puts "TEST"
}
proc mportuninstall {portname {version ""} {revision ""} {variants 0} {optionslist ""} } {
if {[catch {registry_uninstall::uninstall $portname $version $revision $variants [array get options]} result]} {
@@ -99,7 +101,6 @@ proc mportdeactivate_composite {portname {v ""} {optionslist ""} } {
}
proc mportupgrade {portname} {
puts "I'm upgrading this stuff in portProcessInit.tcl, man."
array set depscache {}
if {[catch {macports::upgrade $portname "port:$portname" [array get global_variations] [array get variations] [array get options] depscache} result]} {
+1 -1
View File
@@ -525,7 +525,7 @@
<autoresizingMask key="autoresizingMask"/>
</scroller>
<scroller key="verticalScroller" verticalHuggingPriority="750" horizontal="NO" id="401">
<rect key="frame" x="757" y="17" width="15" height="381"/>
<rect key="frame" x="756" y="17" width="16" height="381"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<tableHeaderView key="headerView" id="404">
+48
View File
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleAllowMixedLocalizations</key>
<true/>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>applet</string>
<key>CFBundleIconFile</key>
<string>applet</string>
<key>CFBundleIdentifier</key>
<string>com.apple.ScriptEditor.id.Launcher</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Launcher</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>aplt</string>
<key>LSMinimumSystemVersionByArchitecture</key>
<dict>
<key>x86_64</key>
<string>10.6</string>
</dict>
<key>LSRequiresCarbon</key>
<true/>
<key>WindowState</key>
<dict>
<key>dividerCollapsed</key>
<false/>
<key>eventLogLevel</key>
<integer>-1</integer>
<key>name</key>
<string>ScriptWindowState</string>
<key>positionOfDivider</key>
<real>333</real>
<key>savedFrame</key>
<string>3 281 602 597 0 0 1440 878 </string>
<key>selectedTabView</key>
<string>result</string>
</dict>
</dict>
</plist>
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
APPLaplt
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 362 B

@@ -0,0 +1,4 @@
{\rtf1\ansi\ansicpg1252\cocoartf1265\cocoasubrtf190
{\fonttbl}
{\colortbl;\red255\green255\blue255;}
}
+1 -1
View File
@@ -82,7 +82,7 @@
/*!
@brief Runs the diagnose command.
*/
- (void)diagnose;
- (void)diagnose:(MPPort *)port;
/*!
@brief Runs the reclaim command.
+3 -1
View File
@@ -7,6 +7,7 @@
//
#import "MPActionLauncher.h"
#import "MPActionsController.h"
extern BOOL errorReceived;
@@ -147,10 +148,11 @@ static MPActionLauncher *sharedActionLauncher = nil;
{
[self sendNotification:GROWL_RECLAIM];
[[NSNotificationCenter defaultCenter] postNotificationName:@"advanceQ" object:nil userInfo:nil];
}
}
- (void)diagnose
- (void)diagnose:(MPPort *)port
{
errorReceived = NO;
NSError * error;
+2 -1
View File
@@ -23,7 +23,7 @@ extern BOOL altWasPressed;
IBOutlet NSToolbarItem *cancel;
IBOutlet NSButton *startQueueButton;
IBOutlet NSButton *removeFromQueueButton;
//IBOutlet NSButton *removeFromQueueButton;
IBOutlet NSMutableArray *queueArray;
IBOutlet NSArrayController *queue;
NSUInteger queueCounter;
@@ -73,5 +73,6 @@ extern BOOL altWasPressed;
//-(IBAction) removeFromQueue:(id) sender;
-(void)clearQueue;
-(void)advanceQueue;
-(void)removeFromQueue;
@end
+5 -7
View File
@@ -447,12 +447,12 @@
else if([[dict objectForKey:@"operation"] isEqualToString:@"diagnose"])
{
NSLog(@"We have diagnose");
[[MPActionLauncher sharedInstance] performSelectorInBackground:@selector(diagnose) withObject:nil];
[[MPActionLauncher sharedInstance] performSelectorInBackground:@selector(diagnose:) withObject:port];
}
else if([[dict objectForKey:@"operation"] isEqualToString:@"reclaim"])
{
NSLog(@"We have reclaim");
[[MPActionLauncher sharedInstance] performSelectorInBackground:@selector(reclaim) withObject:nil];
[[MPActionLauncher sharedInstance] performSelectorInBackground:@selector(reclaim:) withObject:nil];
}
else if([[dict objectForKey:@"operation"] isEqualToString:@"revupgrade"])
{
@@ -533,21 +533,19 @@
[queue addObject:[NSMutableDictionary dictionaryWithObjectsAndKeys:operation, @"operation", name, @"port", port, @"object", image, @"image", variants, @"variants", nil]];
}
/*
-(void) removeFromQueue:(id)sender
-(void) removeFromQueue
{
UInt index = [queue selectionIndex];
[queue removeObject: [[queue selectedObjects] objectAtIndex:0]];
[queue removeObjectAtArrangedObjectIndex:0];
[queue setSelectionIndex: index];
}
*/
//This is called when we have the alt key pressed, so that we clear the queue before adding and performing our new operation
-(void) clearQueue
{
NSIndexSet *tempIndex = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, [queueArray count])];
[queue removeObjectsAtArrangedObjectIndexes:tempIndex];
}
-(id) init
+1 -2
View File
@@ -1,6 +1,5 @@
CC = xcodebuild
BUILDDIR = build
FLAGS = build -project Pallet.xcodeproj -scheme Pallet-standalone -derivedDataPath $(BUILDDIR)
FLAGS = build -project Pallet.xcodeproj -scheme Pallet-standalone -derivedDataPath $(DESTDIR)
all:
$(CC) $(FLAGS)
@@ -10,11 +10,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "MPActionLauncher.m"
timestampString = "456866266.106236"
timestampString = "461531270.161182"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "38"
endingLineNumber = "38"
startingLineNumber = "39"
endingLineNumber = "39"
landmarkName = "-loadPorts"
landmarkType = "5">
</BreakpointContent>
@@ -26,11 +26,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "MPActionLauncher.m"
timestampString = "456866266.106236"
timestampString = "461531270.161182"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "39"
endingLineNumber = "39"
startingLineNumber = "40"
endingLineNumber = "40"
landmarkName = "-loadPorts"
landmarkType = "5">
</BreakpointContent>