mirror of
https://github.com/gnustep/apps-projectcenter.git
synced 2025-02-19 01:51:09 +00:00
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:
parent
f0f502f8ab
commit
74db97895a
9 changed files with 135 additions and 7 deletions
13
ChangeLog
13
ChangeLog
|
@ -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>
|
2013-09-22 Riccardo Mottola <rm@gnu.org>
|
||||||
|
|
||||||
* Modules/Parsers/ProjectCenter/PCParser.m
|
* Modules/Parsers/ProjectCenter/PCParser.m
|
||||||
|
|
|
@ -10,6 +10,13 @@
|
||||||
);
|
);
|
||||||
Super = NSObject;
|
Super = NSObject;
|
||||||
};
|
};
|
||||||
|
PCAuxiliaryWindow = {
|
||||||
|
Actions = (
|
||||||
|
);
|
||||||
|
Outlets = (
|
||||||
|
);
|
||||||
|
Super = NSWindow;
|
||||||
|
};
|
||||||
PCProjectBuilderPanel = {
|
PCProjectBuilderPanel = {
|
||||||
Actions = (
|
Actions = (
|
||||||
);
|
);
|
||||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -53,7 +53,9 @@ ProjectCenter_HEADER_FILES = \
|
||||||
PCFileNameField.h \
|
PCFileNameField.h \
|
||||||
PCFileNameIcon.h \
|
PCFileNameIcon.h \
|
||||||
\
|
\
|
||||||
PCLogController.h
|
PCLogController.h \
|
||||||
|
\
|
||||||
|
PCAuxiliaryWindow.h
|
||||||
|
|
||||||
#
|
#
|
||||||
# Class files
|
# Class files
|
||||||
|
@ -87,7 +89,9 @@ ProjectCenter_OBJC_FILES = \
|
||||||
PCFileNameField.m \
|
PCFileNameField.m \
|
||||||
PCFileNameIcon.m \
|
PCFileNameIcon.m \
|
||||||
\
|
\
|
||||||
PCLogController.m
|
PCLogController.m \
|
||||||
|
\
|
||||||
|
PCAuxiliaryWindow.m
|
||||||
|
|
||||||
#
|
#
|
||||||
# Resources
|
# Resources
|
||||||
|
|
33
Framework/PCAuxiliaryWindow.m
Normal file
33
Framework/PCAuxiliaryWindow.m
Normal 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
|
29
Headers/ProjectCenter/PCAuxiliaryWindow.h
Normal file
29
Headers/ProjectCenter/PCAuxiliaryWindow.h
Normal 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
|
|
@ -24,6 +24,8 @@
|
||||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#import <ProjectCenter/PCAuxiliaryWindow.h>
|
||||||
|
|
||||||
#import "PCEditor.h"
|
#import "PCEditor.h"
|
||||||
#import "PCEditorView.h"
|
#import "PCEditorView.h"
|
||||||
|
|
||||||
|
@ -48,10 +50,10 @@
|
||||||
windowWidth += 35;
|
windowWidth += 35;
|
||||||
rect = NSMakeRect(0,0,windowWidth,320);
|
rect = NSMakeRect(0,0,windowWidth,320);
|
||||||
|
|
||||||
_window = [[NSWindow alloc] initWithContentRect:rect
|
_window = [[PCAuxiliaryWindow alloc] initWithContentRect:rect
|
||||||
styleMask:style
|
styleMask:style
|
||||||
backing:NSBackingStoreBuffered
|
backing:NSBackingStoreBuffered
|
||||||
defer:YES];
|
defer:YES];
|
||||||
[_window setReleasedWhenClosed:NO];
|
[_window setReleasedWhenClosed:NO];
|
||||||
[_window setMinSize:NSMakeSize(512,320)];
|
[_window setMinSize:NSMakeSize(512,320)];
|
||||||
[_window setDelegate:self];
|
[_window setDelegate:self];
|
||||||
|
|
|
@ -149,13 +149,40 @@
|
||||||
[[NSNotificationCenter defaultCenter]
|
[[NSNotificationCenter defaultCenter]
|
||||||
postNotificationName:PCAppDidInitNotification
|
postNotificationName:PCAppDidInitNotification
|
||||||
object:nil];
|
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)applicationShouldTerminate:(id)sender
|
||||||
{
|
{
|
||||||
NSApplicationTerminateReply quit = NSTerminateNow;
|
NSApplicationTerminateReply quit = NSTerminateNow;
|
||||||
|
|
||||||
if ([prefController boolForKey:PromptOnQuit])
|
if ([prefController boolForKey:PromptOnQuit] &&
|
||||||
|
NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", nil) !=
|
||||||
|
NSWindows95InterfaceStyle)
|
||||||
{
|
{
|
||||||
if (NSRunAlertPanel(@"Quit",
|
if (NSRunAlertPanel(@"Quit",
|
||||||
@"Do you really want to quit ProjectCenter?",
|
@"Do you really want to quit ProjectCenter?",
|
||||||
|
@ -228,6 +255,19 @@
|
||||||
RELEASE(doConnection);
|
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(infoController);
|
||||||
RELEASE(prefController);
|
RELEASE(prefController);
|
||||||
RELEASE(logController);
|
RELEASE(logController);
|
||||||
|
|
Loading…
Reference in a new issue