* Finish alert panels review. All situations that I've missed will

be worked out in future.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@27954 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Sergii Stoian 2009-02-22 21:46:01 +00:00
parent c3c4cfcc79
commit 9724c929cb
6 changed files with 11 additions and 30 deletions

View file

@ -48,7 +48,7 @@ ProjectCenter 0.6
- change project type from file to bundle casamento/mottola
- Finish FileNameIcon (draggable, files can be dragged to it) [done!]
- More options for file creation [done!]
- Review all situations when dialogs must be popped up [75% done]
- Review all situations when dialogs must be popped up [done!]
- Check all textfields if 'scrollable' attribute set stoyan
- Rewrite Preferences (3rd party sections etc.) stoyan
--- Project Editor ---------------------------------------------

View file

@ -118,7 +118,7 @@ ProjectCenter_LOCALIZED_RESOURCE_FILES = \
ProjectDescription.gorm \
FileAttributes.gorm \
LogPanel.gorm \
SaveModifiedFiles.gorm
SaveModified.gorm
ProjectCenter_LANGUAGES = \

View file

@ -31,6 +31,7 @@
#import <ProjectCenter/PCProject.h>
#import <ProjectCenter/PCLogController.h>
#import <ProjectCenter/PCSaveModified.h>
NSString *PCEditorDidChangeFileNameNotification =
@"PCEditorDidChangeFileNameNotification";
@ -304,35 +305,15 @@ NSString *PCEditorDidResignActiveNotification =
- (BOOL)closeAllEditors
{
NSArray *modifiedFiles = [self modifiedFiles];
int ret;
NSLog(@"[PCEditorManager] modified files: %@", modifiedFiles);
if ([modifiedFiles count])
{
ret = NSRunAlertPanel(@"Close",
@"Project has unsaved files.",
@"Review Unsaved",
@"Close Anyway",
@"Save and Close");
switch (ret)
if (!PCRunSaveModifiedFilesPanel(self,
@"Save and Close",
@"Close Anyway",
@"Cancel"))
{
case NSAlertDefaultReturn: // Review Unsaved
if ([self reviewUnsaved:modifiedFiles] == NO)
{ // Operation was canceled
return NO;
}
break;
case NSAlertAlternateReturn: // Close Anyway
break;
case NSAlertOtherReturn: // Save and Close
if ([self saveAllFiles] == NO)
{
return NO;
}
break;
return NO;
}
}
@ -501,7 +482,7 @@ NSString *PCEditorDidResignActiveNotification =
[_editorsDict setObject:_editor forKey:_newFileName];
}
- (void) debuggerDidHitBreakpoint: (NSNotification *)aNotif
- (void)debuggerDidHitBreakpoint:(NSNotification *)aNotif
{
id object = [aNotif object];
NSString *filePath = [object objectForKey: @"file"];

View file

@ -59,7 +59,7 @@ BOOL PCRunSaveModifiedFilesPanel(PCEditorManager *manager,
{
if ([NSBundle loadNibNamed:@"SaveModified" owner:self] == NO)
{
NSLog(@"Error loading SaveModifiedFiles NIB file!");
NSLog(@"Error loading SaveModified NIB file!");
return NO;
}

View file

@ -723,7 +723,7 @@
}
ret = NSRunAlertPanel(@"Close File",
@"File has been modified. Save?",
@"File %@ has been modified. Save?",
@"Save and Close", @"Don't save", @"Cancel",
[_path lastPathComponent]);
switch (ret)