mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-25 12:50:55 +00:00
Don't raise an alert panel if unable to contact an app while checking launched
applications ... simply remove the app. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@25370 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
c1b1b1ded1
commit
c5beecb472
1 changed files with 18 additions and 11 deletions
|
@ -387,7 +387,7 @@ static id GSLaunched(NSNotification *notification, BOOL active)
|
||||||
// application communication
|
// application communication
|
||||||
- (BOOL) _launchApplication: (NSString*)appName
|
- (BOOL) _launchApplication: (NSString*)appName
|
||||||
arguments: (NSArray*)args;
|
arguments: (NSArray*)args;
|
||||||
- (id) _connectApplication: (NSString*)appName;
|
- (id) _connectApplication: (NSString*)appName alert: (BOOL)alert;
|
||||||
- (id) _workspaceApplication;
|
- (id) _workspaceApplication;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@ -697,7 +697,7 @@ static NSString *_rootPath = @"/";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
app = [self _connectApplication: appName];
|
app = [self _connectApplication: appName alert: YES];
|
||||||
if (app == nil)
|
if (app == nil)
|
||||||
{
|
{
|
||||||
NSArray *args;
|
NSArray *args;
|
||||||
|
@ -759,7 +759,7 @@ static NSString *_rootPath = @"/";
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
app = [self _connectApplication: appName];
|
app = [self _connectApplication: appName alert: YES];
|
||||||
if (app == nil)
|
if (app == nil)
|
||||||
{
|
{
|
||||||
NSArray *args;
|
NSArray *args;
|
||||||
|
@ -1359,7 +1359,7 @@ inFileViewerRootedAtPath: (NSString*)rootFullpath
|
||||||
// workspace manager problem ... fall through to default code
|
// workspace manager problem ... fall through to default code
|
||||||
NS_ENDHANDLER
|
NS_ENDHANDLER
|
||||||
|
|
||||||
app = [self _connectApplication: appName];
|
app = [self _connectApplication: appName alert: YES];
|
||||||
if (app == nil)
|
if (app == nil)
|
||||||
{
|
{
|
||||||
NSArray *args = nil;
|
NSArray *args = nil;
|
||||||
|
@ -1456,7 +1456,7 @@ inFileViewerRootedAtPath: (NSString*)rootFullpath
|
||||||
CREATE_AUTORELEASE_POOL(arp);
|
CREATE_AUTORELEASE_POOL(arp);
|
||||||
BOOL found = NO;
|
BOOL found = NO;
|
||||||
|
|
||||||
if ([self _connectApplication: name] != nil)
|
if ([self _connectApplication: name alert: NO] != nil)
|
||||||
{
|
{
|
||||||
found = YES;
|
found = YES;
|
||||||
}
|
}
|
||||||
|
@ -2445,7 +2445,7 @@ inFileViewerRootedAtPath: (NSString*)rootFullpath
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) _connectApplication: (NSString*)appName
|
- (id) _connectApplication: (NSString*)appName alert: (BOOL)alert
|
||||||
{
|
{
|
||||||
NSString *host;
|
NSString *host;
|
||||||
NSString *port;
|
NSString *port;
|
||||||
|
@ -2508,9 +2508,16 @@ inFileViewerRootedAtPath: (NSString*)rootFullpath
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
DESTROY(when);
|
DESTROY(when);
|
||||||
result = NSRunAlertPanel(appName,
|
if (alert == YES)
|
||||||
@"Application seems to have hung",
|
{
|
||||||
@"Continue", @"Terminate", @"Wait");
|
result = NSRunAlertPanel(appName,
|
||||||
|
@"Application seems to have hung",
|
||||||
|
@"Continue", @"Terminate", @"Wait");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
result = NSAlertAlternateReturn;
|
||||||
|
}
|
||||||
|
|
||||||
if (result == NSAlertDefaultReturn)
|
if (result == NSAlertDefaultReturn)
|
||||||
{
|
{
|
||||||
|
@ -2583,7 +2590,7 @@ inFileViewerRootedAtPath: (NSString*)rootFullpath
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
app = [self _connectApplication: appName];
|
app = [self _connectApplication: appName alert: YES];
|
||||||
if (app == nil)
|
if (app == nil)
|
||||||
{
|
{
|
||||||
NSString *host;
|
NSString *host;
|
||||||
|
@ -2613,7 +2620,7 @@ inFileViewerRootedAtPath: (NSString*)rootFullpath
|
||||||
if ([self _launchApplication: appName
|
if ([self _launchApplication: appName
|
||||||
arguments: nil] == YES)
|
arguments: nil] == YES)
|
||||||
{
|
{
|
||||||
app = [self _connectApplication: appName];
|
app = [self _connectApplication: appName alert: YES];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue