Improvements to handle the style NSWindows95InterfaceStyle.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@37153 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Germán Arias 2013-09-25 00:25:49 +00:00
parent f0f502f8ab
commit 74db97895a
9 changed files with 135 additions and 7 deletions

View file

@ -1,3 +1,16 @@
2013-09-24 German Arias <germanandre@gmx.es>
* 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 <rm@gnu.org>
* Modules/Parsers/ProjectCenter/PCParser.m

View file

@ -10,6 +10,13 @@
);
Super = NSObject;
};
PCAuxiliaryWindow = {
Actions = (
);
Outlets = (
);
Super = NSWindow;
};
PCProjectBuilderPanel = {
Actions = (
);

View file

@ -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

View file

@ -0,0 +1,33 @@
/*
PCAuxiliaryWindow.m
Author: German A. Arias <germanandre@gmx.es>
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 <ProjectCenter/PCAuxiliaryWindow.h>
@implementation PCAuxiliaryWindow
- (BOOL) canBecomeMainWindow
{
return NO;
}
@end

View file

@ -0,0 +1,29 @@
/*
PCAuxiliaryWindow.h
Author: German A. Arias <germanandre@gmx.es>
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 <AppKit/AppKit.h>
@interface PCAuxiliaryWindow : NSWindow
{
}
@end

View file

@ -24,6 +24,8 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
*/
#import <ProjectCenter/PCAuxiliaryWindow.h>
#import "PCEditor.h"
#import "PCEditorView.h"
@ -48,7 +50,7 @@
windowWidth += 35;
rect = NSMakeRect(0,0,windowWidth,320);
_window = [[NSWindow alloc] initWithContentRect:rect
_window = [[PCAuxiliaryWindow alloc] initWithContentRect:rect
styleMask:style
backing:NSBackingStoreBuffered
defer:YES];

View file

@ -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);