Author: rmottola
Date: Wed Mar 11 08:21:35 2015
New Revision: 38395
URL: http://svn.gna.org/viewcvs/gnustep?rev=38395&view=rev
Log:
Provide Editor and Fixed font preferences, instead of plain and rich
Modified:
apps/projectcenter/trunk/Modules/Preferences/EditorFSC/PCEditorFSCPrefs.h
apps/projectcenter/trunk/Modules/Preferences/EditorFSC/PCEditorFSCPrefs.m
apps/projectcenter/trunk/Modules/Preferences/EditorFSC/Resources/EditorFSCPrefs.gorm/data.classes
apps/projectcenter/trunk/Modules/Preferences/EditorFSC/Resources/EditorFSCPrefs.gorm/objects.gorm
Modified:
apps/projectcenter/trunk/Modules/Preferences/EditorFSC/PCEditorFSCPrefs.h
URL:
http://svn.gna.org/viewcvs/gnustep/apps/projectcenter/trunk/Modules/Preferences/EditorFSC/PCEditorFSCPrefs.h?rev=38395&r1=38394&r2=38395&view=diff
==============================================================================
--- apps/projectcenter/trunk/Modules/Preferences/EditorFSC/PCEditorFSCPrefs.h
(original)
+++ apps/projectcenter/trunk/Modules/Preferences/EditorFSC/PCEditorFSCPrefs.h
Wed Mar 11 08:21:35 2015
@@ -1,9 +1,10 @@
//
// GNUstep ProjectCenter - http://www.gnustep.org/experience/ProjectCenter.html
//
-// Copyright (C) 2001-2009 Free Software Foundation
+// Copyright (C) 2001-2015 Free Software Foundation
//
// Authors: Sergii Stoian
+// Riccardo Mottola
//
// Description:
//
@@ -26,10 +27,10 @@
#import <AppKit/AppKit.h>
#import <Protocols/Preferences.h>
-#define EditorPlainTextFont @"EditorPlainTextFont"
-#define EditorPlainTextFontSize @"EditorPlainTextFontSize"
-#define EditorRichTextFont @"EditorRichTextFont"
-#define EditorRichTextFontSize @"EditorRichTextFontSize"
+#define EditorTextFont @"EditorTextFont"
+#define EditorTextFontSize @"EditorTextFontSize"
+#define ConsoleFixedFont @"ConsoleFixedFont"
+#define ConsoleFixedFontSize @"ConsoleFixedFontSize"
#define EditorLines @"EditorLines"
#define EditorColumns @"EditorColumns"
@@ -45,10 +46,10 @@
IBOutlet NSBox *editorFSCView;
- IBOutlet NSButton *plainTextFontButton;
- IBOutlet NSTextField *plainTextFontField;
- IBOutlet NSButton *richTextFontButton;
- IBOutlet NSTextField *richTextFontField;
+ IBOutlet NSButton *editorFontButton;
+ IBOutlet NSTextField *editorFontField;
+ IBOutlet NSButton *consoleFixedFontButton;
+ IBOutlet NSTextField *consoleFixedFontField;
IBOutlet NSTextField *editorLinesField;
IBOutlet NSTextField *editorColumnsField;
@@ -57,15 +58,15 @@
IBOutlet NSColorWell *backgroundColorWell;
IBOutlet NSColorWell *selectionColorWell;
- NSFont *currentPlainFont;
- NSFont *currentRichFont;
+ NSFont *currentEditorFont;
+ NSFont *currentConsoleFixedFont;
NSColor *currentBackgroundColor;
NSColor *currentForegroundColor;
NSColor *currentSelectionColor;
}
-- (void)setEditorPlainTextFont:(id)sender;
-- (void)setEditorRichTextFont:(id)sender;
+- (void)setEditorTextFont:(id)sender;
+- (void)setConsoleFixedFont:(id)sender;
- (void)setEditorSize:(id)sender;
- (void)setEditorColor:(id)sender;
Modified:
apps/projectcenter/trunk/Modules/Preferences/EditorFSC/PCEditorFSCPrefs.m
URL:
http://svn.gna.org/viewcvs/gnustep/apps/projectcenter/trunk/Modules/Preferences/EditorFSC/PCEditorFSCPrefs.m?rev=38395&r1=38394&r2=38395&view=diff
==============================================================================
--- apps/projectcenter/trunk/Modules/Preferences/EditorFSC/PCEditorFSCPrefs.m
(original)
+++ apps/projectcenter/trunk/Modules/Preferences/EditorFSC/PCEditorFSCPrefs.m
Wed Mar 11 08:21:35 2015
@@ -1,9 +1,10 @@
//
// GNUstep ProjectCenter - http://www.gnustep.org/experience/ProjectCenter.html
//
-// Copyright (C) 2001-2009 Free Software Foundation
+// Copyright (C) 2001-2015 Free Software Foundation
//
// Authors: Sergii Stoian
+// Riccardo Mottola
//
// Description:
//
@@ -67,8 +68,8 @@
}
prefs = aPrefs;
- currentPlainFont = nil;
- currentRichFont = nil;
+ currentEditorFont = nil;
+ currentConsoleFixedFont = nil;
RETAIN(editorFSCView);
@@ -90,11 +91,11 @@
- (void)awakeFromNib
{
- [plainTextFontButton setTarget:self];
- [plainTextFontField setAllowsEditingTextAttributes:YES];
-
- [richTextFontButton setTarget:self];
- [richTextFontField setAllowsEditingTextAttributes:YES];
+ [editorFontButton setTarget:self];
+ [editorFontField setAllowsEditingTextAttributes:YES];
+
+ [consoleFixedFontButton setTarget:self];
+ [consoleFixedFontField setAllowsEditingTextAttributes:YES];
}
// ----------------------------------------------------------------------------
@@ -105,7 +106,7 @@
{
NSFontManager *fontManager = [NSFontManager sharedFontManager];
- [fontManager setSelectedFont:currentPlainFont isMultiple:NO];
+ [fontManager setSelectedFont:currentEditorFont isMultiple:NO];
[fontManager orderFrontFontPanel:self];
}
@@ -121,27 +122,27 @@
return;
}
- font = [sender convertFont:currentPlainFont];
+ font = [sender convertFont:currentEditorFont];
fontString = [NSString stringWithFormat:@"%@ %0.1f",
[font fontName], [font pointSize]];
buttonTag = [button tag];
- if (buttonTag == 0) // plain text font button
- {
- [plainTextFontField setStringValue:fontString];
- [plainTextFontField setFont:font];
- [prefs setString:[font fontName] forKey:EditorPlainTextFont notify:YES];
+ if (buttonTag == 0) // Editor font button
+ {
+ [editorFontField setStringValue:fontString];
+ [editorFontField setFont:font];
+ [prefs setString:[font fontName] forKey:EditorTextFont notify:YES];
[prefs setFloat:[font pointSize]
- forKey:EditorPlainTextFontSize
+ forKey:EditorTextFontSize
notify:YES];
}
- else if (buttonTag == 1) // rich text font button
- {
- [richTextFontField setStringValue:fontString];
- [richTextFontField setFont:font];
- [prefs setString:[font fontName] forKey:EditorRichTextFont notify:YES];
+ else if (buttonTag == 1) // Console Fixed Font button
+ {
+ [consoleFixedFontField setStringValue:fontString];
+ [consoleFixedFontField setFont:font];
+ [prefs setString:[font fontName] forKey:ConsoleFixedFont notify:YES];
[prefs setFloat:[font pointSize]
- forKey:EditorRichTextFontSize
+ forKey:ConsoleFixedFontSize
notify:YES];
}
}
@@ -180,29 +181,29 @@
{
NSString *fontName;
float fontSize;
- NSFont *plainFont = [NSFont userFixedPitchFontOfSize:0.0];
- NSFont *richFont = [NSFont systemFontOfSize:0.0];
+ NSFont *editorFont = [NSFont userFixedPitchFontOfSize:0.0];
+ NSFont *consoleFixedFont = [NSFont userFixedPitchFontOfSize:0.0];
NSString *val;
- // Plain text font
- fontName = [prefs stringForKey:EditorPlainTextFont
- defaultValue:[plainFont fontName]];
- fontSize = [prefs floatForKey:EditorPlainTextFontSize
- defaultValue:[plainFont pointSize]];
- currentPlainFont = [NSFont fontWithName:fontName size:fontSize];
- [plainTextFontField setStringValue:[NSString stringWithFormat:@"%@ %0.1f",
- [currentPlainFont fontName], [currentPlainFont pointSize]]];
- [plainTextFontField setFont:currentPlainFont];
-
- // Rich text font
- fontName = [prefs stringForKey:EditorRichTextFont
- defaultValue:[richFont fontName]];
- fontSize = [prefs floatForKey:EditorRichTextFontSize
- defaultValue:[richFont pointSize]];
- currentRichFont = [NSFont fontWithName:fontName size:fontSize];
- [richTextFontField setStringValue:[NSString stringWithFormat:@"%@ %0.1f",
- [currentRichFont fontName], [currentRichFont pointSize]]];
- [richTextFontField setFont:currentRichFont];
+ // Editor font
+ fontName = [prefs stringForKey:EditorTextFont
+ defaultValue:[editorFont fontName]];
+ fontSize = [prefs floatForKey:EditorTextFontSize
+ defaultValue:[editorFont pointSize]];
+ currentEditorFont = [NSFont fontWithName:fontName size:fontSize];
+ [editorFontField setStringValue:[NSString stringWithFormat:@"%@ %0.1f",
+ [currentEditorFont fontName], [currentEditorFont pointSize]]];
+ [editorFontField setFont:currentEditorFont];
+
+ // Console fixed font
+ fontName = [prefs stringForKey:ConsoleFixedFont
+ defaultValue:[consoleFixedFont fontName]];
+ fontSize = [prefs floatForKey:ConsoleFixedFontSize
+ defaultValue:[consoleFixedFont pointSize]];
+ consoleFixedFont = [NSFont fontWithName:fontName size:fontSize];
+ [consoleFixedFontField setStringValue:[NSString stringWithFormat:@"%@
%0.1f",
+ [currentConsoleFixedFont fontName], [currentConsoleFixedFont pointSize]]];
+ [consoleFixedFontField setFont:currentConsoleFixedFont];
// Editor window size
val = [prefs stringForKey:EditorLines defaultValue:@"30"];
@@ -233,16 +234,16 @@
// --- Actions
// ----------------------------------------------------------------------------
-- (void)setEditorPlainTextFont:(id)sender
-{
- [[editorFSCView window] makeFirstResponder:plainTextFontButton];
- [self pickFont:currentPlainFont];
-}
-
-- (void)setEditorRichTextFont:(id)sender
-{
- [[editorFSCView window] makeFirstResponder:richTextFontButton];
- [self pickFont:currentRichFont];
+- (void)setEditorTextFont:(id)sender
+{
+ [[editorFSCView window] makeFirstResponder:editorFontButton];
+ [self pickFont:currentEditorFont];
+}
+
+- (void)setConsoleFixedFont:(id)sender
+{
+ [[editorFSCView window] makeFirstResponder:consoleFixedFontButton];
+ [self pickFont:currentConsoleFixedFont];
}
- (void)setEditorSize:(id)sender
Modified:
apps/projectcenter/trunk/Modules/Preferences/EditorFSC/Resources/EditorFSCPrefs.gorm/data.classes
URL:
http://svn.gna.org/viewcvs/gnustep/apps/projectcenter/trunk/Modules/Preferences/EditorFSC/Resources/EditorFSCPrefs.gorm/data.classes?rev=38395&r1=38394&r2=38395&view=diff
==============================================================================
---
apps/projectcenter/trunk/Modules/Preferences/EditorFSC/Resources/EditorFSCPrefs.gorm/data.classes
(original)
+++
apps/projectcenter/trunk/Modules/Preferences/EditorFSC/Resources/EditorFSCPrefs.gorm/data.classes
Wed Mar 11 08:21:35 2015
@@ -1,18 +1,28 @@
{
"## Comment" = "Do NOT change this file, Gorm maintains it";
+ FirstResponder = {
+ Actions = (
+ "setConsoleFixedFont:",
+ "setEditorColor:",
+ "setEditorSize:",
+ "setEditorTextFont:"
+ );
+ Super = NSObject;
+ };
PCEditorFSCPrefs = {
Actions = (
- "setEditorPlainTextFont:",
- "setEditorRichTextFont:",
+ "setEditorTextFont:",
+ "setConsoleFixedFont:",
"setEditorSize:",
"setEditorColor:"
);
Outlets = (
+ prefs,
editorFSCView,
- plainTextFontButton,
- plainTextFontField,
- richTextFontButton,
- richTextFontField,
+ editorFontButton,
+ editorFontField,
+ consoleFixedFontButton,
+ consoleFixedFontField,
editorLinesField,
editorColumnsField,
foregroundColorWell,
Modified:
apps/projectcenter/trunk/Modules/Preferences/EditorFSC/Resources/EditorFSCPrefs.gorm/objects.gorm
URL:
http://svn.gna.org/viewcvs/gnustep/apps/projectcenter/trunk/Modules/Preferences/EditorFSC/Resources/EditorFSCPrefs.gorm/objects.gorm?rev=38395&r1=38394&r2=38395&view=diff
==============================================================================
Binary files - no diff available.
_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs