diff --git a/Documentation/ChangeLog b/Documentation/ChangeLog index de007f6..f6370ca 100644 --- a/Documentation/ChangeLog +++ b/Documentation/ChangeLog @@ -1,4 +1,22 @@ -2008-01-15 Sergii Stoian +2008-01-16 Sergii Stoian + + * GNUmakefile: Remove FileRTF.tiff from resoures. + * Images/FileRTF.tiff: Removed. + * Images/FileM.tiff, + * Images/FileMH.tiff, + * Images/FileH.tiff, + * Images/FileHH.tiff, + * Images/FileC.tiff, + * Images/FileCH.tiff, + Moved to Modules/Editors/ProjectEditor/Resources. + * Modules/Editors/ProjectCenter/PCEditor.h: Added new variable + _isEditable. + * Modules/Editors/ProjectCenter/PCEditor.m: + (_createEditorViewWithFrame:): Set editable state for NSTextView here. + Add observer for changed text notification here. + * Resources/Info.plist: NSTypes was extended. + +2008-01-15 Sergii Stoian * Framework/PCBundleManager.m: (objectForClassName:bundleType:protocol:) Return nil if className is nil. diff --git a/GNUmakefile b/GNUmakefile index 12cb934..34b72a2 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -33,7 +33,6 @@ SUBPROJECTS = \ ProjectCenter_RESOURCE_FILES = \ Resources/Info-gnustep.plist \ Images/ProjectCenter.tiff \ -Images/FileRTF.tiff \ Images/FileProject.tiff \ Images/Build.tiff \ Images/Clean.tiff \ diff --git a/Images/FileC.tiff b/Images/FileC.tiff deleted file mode 100644 index 781a88e..0000000 Binary files a/Images/FileC.tiff and /dev/null differ diff --git a/Images/FileCH.tiff b/Images/FileCH.tiff deleted file mode 100644 index 7e7f0f5..0000000 Binary files a/Images/FileCH.tiff and /dev/null differ diff --git a/Images/FileH.tiff b/Images/FileH.tiff deleted file mode 100644 index 94106cd..0000000 Binary files a/Images/FileH.tiff and /dev/null differ diff --git a/Images/FileHH.tiff b/Images/FileHH.tiff deleted file mode 100644 index 0268ac3..0000000 Binary files a/Images/FileHH.tiff and /dev/null differ diff --git a/Images/FileM.tiff b/Images/FileM.tiff deleted file mode 100644 index 7bf2f0f..0000000 Binary files a/Images/FileM.tiff and /dev/null differ diff --git a/Images/FileMH.tiff b/Images/FileMH.tiff deleted file mode 100644 index 099e77c..0000000 Binary files a/Images/FileMH.tiff and /dev/null differ diff --git a/Images/FileRTF.tiff b/Images/FileRTF.tiff deleted file mode 100644 index 8176b03..0000000 Binary files a/Images/FileRTF.tiff and /dev/null differ diff --git a/Modules/Editors/ProjectCenter/PCEditor.h b/Modules/Editors/ProjectCenter/PCEditor.h index 8d82666..06ca3b8 100644 --- a/Modules/Editors/ProjectCenter/PCEditor.h +++ b/Modules/Editors/ProjectCenter/PCEditor.h @@ -50,6 +50,7 @@ BOOL _isEdited; + BOOL _isEditable; BOOL _isWindowed; BOOL _isExternal; diff --git a/Modules/Editors/ProjectCenter/PCEditor.m b/Modules/Editors/ProjectCenter/PCEditor.m index b61914c..23e33c5 100644 --- a/Modules/Editors/ProjectCenter/PCEditor.m +++ b/Modules/Editors/ProjectCenter/PCEditor.m @@ -70,7 +70,7 @@ (NSViewWidthSizable|NSViewHeightSizable)]; rect = [[_extScrollView contentView] frame]; - // Editor view + // Text view _extEditorView = [self _createEditorViewWithFrame:rect]; // Include editor view @@ -135,7 +135,6 @@ [ev setMinSize:NSMakeSize(0, 0)]; [ev setMaxSize:NSMakeSize(1e7, 1e7)]; [ev setRichText:YES]; - [ev setEditable:YES]; [ev setVerticallyResizable:YES]; [ev setHorizontallyResizable:NO]; [ev setAutoresizingMask:NSViewWidthSizable|NSViewHeightSizable]; @@ -144,6 +143,13 @@ [[ev textContainer] setContainerSize:NSMakeSize(fr.size.width, 1e7)]; + [ev setEditable:_isEditable]; + [[NSNotificationCenter defaultCenter] + addObserver:self + selector:@selector(textDidChange:) + name:NSTextDidChangeNotification + object:ev]; + return ev; } @@ -247,6 +253,7 @@ projectEditor = aProjectEditor; _path = [file copy]; _categoryPath = [categoryPath copy]; + _isEditable = editable; // Prepare font = [NSFont userFixedPitchFontOfSize:0.0]; @@ -277,22 +284,9 @@ if (![[ud objectForKey:SeparateEditor] isEqualToString:@"YES"]) { [self _createInternalView]; - [_intEditorView setEditable:editable]; - - [[NSNotificationCenter defaultCenter] - addObserver:self - selector:@selector(textDidChange:) - name:NSTextDidChangeNotification - object:_intEditorView]; } } - [[NSNotificationCenter defaultCenter] - addObserver:self - selector:@selector(textDidChange:) - name:NSTextDidChangeNotification - object:_extEditorView]; - // File open was finished [[NSNotificationCenter defaultCenter] postNotificationName:PCEditorDidOpenNotification diff --git a/Resources/Info-gnustep.plist b/Resources/Info-gnustep.plist index 8e33aae..acf4145 100644 --- a/Resources/Info-gnustep.plist +++ b/Resources/Info-gnustep.plist @@ -21,24 +21,44 @@ NSRole = "Editor"; NSTypes = ( { - NSUnixExtensions = ( "project" ); - NSIcon = "FileProject.tiff"; + NSDocumentClass = PCProjectDocument; + NSHumanReadableName = "GNUstep project"; + NSIcon = FileProject.tiff; + NSName = GSPCProjectFileType; + NSRole = Editor; + NSUnixExtensions = ( project ); }, { - NSUnixExtensions = ( "pcproj" ); - NSIcon = "FileProject.tiff"; + NSDocumentClass = PCProjectDocument; + NSHumanReadableName = "GNUstep project"; + NSIcon = FileProject.tiff; + NSName = GSPCFileType; + NSRole = Editor; + NSUnixExtensions = ( pcproj ); }, { - NSUnixExtensions = ( "m" ); - NSIcon = "FileM.tiff"; + NSDocumentClass = PCClassDocument; + NSHumanReadableName = "Objective C class file"; + NSIcon = ProjectCenter.editor/Resources/FileM.tiff; + NSName = GSPClassType; + NSRole = Editor; + NSUnixExtensions = ( m ); }, { - NSUnixExtensions = ( "h" ); - NSIcon = "FileH.tiff"; + NSDocumentClass = PCHeaderDocument; + NSHumanReadableName = "C or Objective C header file"; + NSIcon = ProjectCenter.editor/Resources/FileH.tiff; + NSName = GSPCHeaderType; + NSRole = Editor; + NSUnixExtensions = ( h ); }, { - NSUnixExtensions = ( "c" ); - NSIcon = "FileC.tiff"; + NSDocumentClass = PCCDocument; + NSHumanReadableName = "C file"; + NSIcon = ProjectCenter.editor/Resources/FileC.tiff; + NSName = GSPCCType; + NSRole = Editor; + NSUnixExtensions = ( c ); } ); URL = "See http://www.gnustep.org/";