diff --git a/ChangeLog b/ChangeLog index 6795f40..3642b77 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2013-09-24 German Arias + + * PCAppController.m (-applicationDidFinishLaunching: and + -applicationShouldTerminate:) Code to handle the style + NSWindows95InterfaceStyle. + * Headers/ProjectCenter/PCAuxiliaryWindow.h: + * Framework/PCAuxiliaryWindow.m: Add this class for auxiliary windows. + This is windows that don't should add the in-window menu. + * Framework/English.lproj/BuilderPanel.gorm: + * Modules/Editors/ProjectCenter/PCEditor.m: Use the new class + PCAuxiliaryWindow. + * Framework/GNUmakefile: Add new class. + 2013-09-22 Riccardo Mottola * Modules/Parsers/ProjectCenter/PCParser.m diff --git a/Framework/English.lproj/BuilderPanel.gorm/data.classes b/Framework/English.lproj/BuilderPanel.gorm/data.classes index 096069a..19a05e2 100644 --- a/Framework/English.lproj/BuilderPanel.gorm/data.classes +++ b/Framework/English.lproj/BuilderPanel.gorm/data.classes @@ -10,6 +10,13 @@ ); Super = NSObject; }; + PCAuxiliaryWindow = { + Actions = ( + ); + Outlets = ( + ); + Super = NSWindow; + }; PCProjectBuilderPanel = { Actions = ( ); diff --git a/Framework/English.lproj/BuilderPanel.gorm/data.info b/Framework/English.lproj/BuilderPanel.gorm/data.info index da98e43..6361435 100644 Binary files a/Framework/English.lproj/BuilderPanel.gorm/data.info and b/Framework/English.lproj/BuilderPanel.gorm/data.info differ diff --git a/Framework/English.lproj/BuilderPanel.gorm/objects.gorm b/Framework/English.lproj/BuilderPanel.gorm/objects.gorm index c603d98..6db66f8 100644 Binary files a/Framework/English.lproj/BuilderPanel.gorm/objects.gorm and b/Framework/English.lproj/BuilderPanel.gorm/objects.gorm differ diff --git a/Framework/GNUmakefile b/Framework/GNUmakefile index a903b8d..d115fe7 100644 --- a/Framework/GNUmakefile +++ b/Framework/GNUmakefile @@ -53,7 +53,9 @@ ProjectCenter_HEADER_FILES = \ PCFileNameField.h \ PCFileNameIcon.h \ \ - PCLogController.h + PCLogController.h \ + \ + PCAuxiliaryWindow.h # # Class files @@ -87,7 +89,9 @@ ProjectCenter_OBJC_FILES = \ PCFileNameField.m \ PCFileNameIcon.m \ \ - PCLogController.m + PCLogController.m \ + \ + PCAuxiliaryWindow.m # # Resources diff --git a/Framework/PCAuxiliaryWindow.m b/Framework/PCAuxiliaryWindow.m new file mode 100644 index 0000000..3a910a1 --- /dev/null +++ b/Framework/PCAuxiliaryWindow.m @@ -0,0 +1,33 @@ +/* + PCAuxiliaryWindow.m + + Author: German A. Arias + Date: September 2013 + + This file is part of ProjectCenter. + + ProjectCenter is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + This application is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. +*/ + +#import + +@implementation PCAuxiliaryWindow + +- (BOOL) canBecomeMainWindow +{ + return NO; +} + +@end diff --git a/Headers/ProjectCenter/PCAuxiliaryWindow.h b/Headers/ProjectCenter/PCAuxiliaryWindow.h new file mode 100644 index 0000000..157824b --- /dev/null +++ b/Headers/ProjectCenter/PCAuxiliaryWindow.h @@ -0,0 +1,29 @@ +/* + PCAuxiliaryWindow.h + + Author: German A. Arias + Date: September 2013 + + This file is part of ProjectCenter. + + ProjectCenter is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + This application is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. +*/ + +#import + +@interface PCAuxiliaryWindow : NSWindow +{ +} +@end diff --git a/Modules/Editors/ProjectCenter/PCEditor.m b/Modules/Editors/ProjectCenter/PCEditor.m index e116662..d6f609e 100644 --- a/Modules/Editors/ProjectCenter/PCEditor.m +++ b/Modules/Editors/ProjectCenter/PCEditor.m @@ -24,6 +24,8 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ +#import + #import "PCEditor.h" #import "PCEditorView.h" @@ -48,10 +50,10 @@ windowWidth += 35; rect = NSMakeRect(0,0,windowWidth,320); - _window = [[NSWindow alloc] initWithContentRect:rect - styleMask:style - backing:NSBackingStoreBuffered - defer:YES]; + _window = [[PCAuxiliaryWindow alloc] initWithContentRect:rect + styleMask:style + backing:NSBackingStoreBuffered + defer:YES]; [_window setReleasedWhenClosed:NO]; [_window setMinSize:NSMakeSize(512,320)]; [_window setDelegate:self]; diff --git a/PCAppController.m b/PCAppController.m index f5ef52a..d0fa19e 100644 --- a/PCAppController.m +++ b/PCAppController.m @@ -149,13 +149,40 @@ [[NSNotificationCenter defaultCenter] postNotificationName:PCAppDidInitNotification object:nil]; + + if (NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", nil) == + NSWindows95InterfaceStyle) + { + NSFileManager *fm = [NSFileManager defaultManager]; + NSString *path = [NSHomeDirectory() stringByAppendingPathComponent: + @"PCExample"]; + + if ([fm fileExistsAtPath: path]) + { + [projectManager openProjectAt: path makeActive: YES]; + } + else + { + PCProject *project; + + project = [projectManager createProjectOfType: @"Application" + path: [NSHomeDirectory() stringByAppendingPathComponent: @"PCExample"]]; + + [[projectManager loadedProjects] setObject: project + forKey: [project projectPath]]; + [projectManager setActiveProject:project]; + [[project projectWindow] orderFront: self]; + } + } } - (NSApplicationTerminateReply)applicationShouldTerminate:(id)sender { NSApplicationTerminateReply quit = NSTerminateNow; - if ([prefController boolForKey:PromptOnQuit]) + if ([prefController boolForKey:PromptOnQuit] && + NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", nil) != + NSWindows95InterfaceStyle) { if (NSRunAlertPanel(@"Quit", @"Do you really want to quit ProjectCenter?", @@ -228,6 +255,19 @@ RELEASE(doConnection); } + if (NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", nil) == + NSWindows95InterfaceStyle) + { + NSFileManager *fm = [NSFileManager defaultManager]; + NSString *path = [NSHomeDirectory() stringByAppendingPathComponent: + @"PCExample"]; + + if ([fm fileExistsAtPath: path]) + { + [fm removeFileAtPath: path handler: nil]; + } + } + RELEASE(infoController); RELEASE(prefController); RELEASE(logController);