Author: gcasa
Date: Mon Feb 23 03:23:29 2015
New Revision: 38356

URL: http://svn.gna.org/viewcvs/gnustep?rev=38356&view=rev
Log:
Fixes bug#13753: User should now be able to change the color of the guideline 
from the guideline preferences.

Removed:
    apps/gorm/trunk/GormPrefs/GormColorsPref.h
    apps/gorm/trunk/GormPrefs/GormColorsPref.m
Modified:
    apps/gorm/trunk/ChangeLog
    apps/gorm/trunk/English.lproj/GormPrefGuideline.gorm/data.classes
    apps/gorm/trunk/English.lproj/GormPrefGuideline.gorm/data.info
    apps/gorm/trunk/English.lproj/GormPrefGuideline.gorm/objects.gorm
    apps/gorm/trunk/English.lproj/GormPreferences.gorm/data.info
    apps/gorm/trunk/English.lproj/GormPreferences.gorm/objects.gorm
    apps/gorm/trunk/GormPrefs/GNUmakefile
    apps/gorm/trunk/GormPrefs/GormGuidelinePref.h
    apps/gorm/trunk/GormPrefs/GormGuidelinePref.m
    apps/gorm/trunk/GormPrefs/GormPrefController.m

Modified: apps/gorm/trunk/ChangeLog
URL: 
http://svn.gna.org/viewcvs/gnustep/apps/gorm/trunk/ChangeLog?rev=38356&r1=38355&r2=38356&view=diff
==============================================================================
--- apps/gorm/trunk/ChangeLog   (original)
+++ apps/gorm/trunk/ChangeLog   Mon Feb 23 03:23:29 2015
@@ -1,3 +1,15 @@
+2015-02-22 21:21-EST Gregory John Casamento <[email protected]>
+
+       * English.lproj/GormPreferences.gorm: Removed from pulldown menu
+       * English.lproj/GormPrefGuideline.gorm: Added colorwell and
+       connections.
+       * GormPrefs/GNUmakefile: Removed classes.
+       * GormPrefs/GormColorsPref.h
+       * GormPrefs/GormColorsPref.m: Removed.
+       * GormPrefs/GormGuidelinePref.h
+       * GormPrefs/GormGuidelinePref.m: Added color well...
+       * GormPrefs/GormPrefController.m: Removed view from case statement
+
 2014-10-28 03:08-EDT Gregory John Casamento <[email protected]>
 
        * English.lproj/Gorm.gorm: Change connection to point to

Modified: apps/gorm/trunk/English.lproj/GormPrefGuideline.gorm/data.classes
URL: 
http://svn.gna.org/viewcvs/gnustep/apps/gorm/trunk/English.lproj/GormPrefGuideline.gorm/data.classes?rev=38356&r1=38355&r2=38356&view=diff
==============================================================================
--- apps/gorm/trunk/English.lproj/GormPrefGuideline.gorm/data.classes   
(original)
+++ apps/gorm/trunk/English.lproj/GormPrefGuideline.gorm/data.classes   Mon Feb 
23 03:23:29 2015
@@ -14,9 +14,10 @@
        Outlets = (
            spacingSlider,
            window,
-           _view,
+           "_view",
            currentSpacing,
-           halfSpacing
+           halfSpacing,
+           colorWell
        );
        Super = NSObject;
     };

Modified: apps/gorm/trunk/English.lproj/GormPrefGuideline.gorm/data.info
URL: 
http://svn.gna.org/viewcvs/gnustep/apps/gorm/trunk/English.lproj/GormPrefGuideline.gorm/data.info?rev=38356&r1=38355&r2=38356&view=diff
==============================================================================
Binary files - no diff available.

Modified: apps/gorm/trunk/English.lproj/GormPrefGuideline.gorm/objects.gorm
URL: 
http://svn.gna.org/viewcvs/gnustep/apps/gorm/trunk/English.lproj/GormPrefGuideline.gorm/objects.gorm?rev=38356&r1=38355&r2=38356&view=diff
==============================================================================
Binary files - no diff available.

Modified: apps/gorm/trunk/English.lproj/GormPreferences.gorm/data.info
URL: 
http://svn.gna.org/viewcvs/gnustep/apps/gorm/trunk/English.lproj/GormPreferences.gorm/data.info?rev=38356&r1=38355&r2=38356&view=diff
==============================================================================
Binary files - no diff available.

Modified: apps/gorm/trunk/English.lproj/GormPreferences.gorm/objects.gorm
URL: 
http://svn.gna.org/viewcvs/gnustep/apps/gorm/trunk/English.lproj/GormPreferences.gorm/objects.gorm?rev=38356&r1=38355&r2=38356&view=diff
==============================================================================
Binary files - no diff available.

Modified: apps/gorm/trunk/GormPrefs/GNUmakefile
URL: 
http://svn.gna.org/viewcvs/gnustep/apps/gorm/trunk/GormPrefs/GNUmakefile?rev=38356&r1=38355&r2=38356&view=diff
==============================================================================
--- apps/gorm/trunk/GormPrefs/GNUmakefile       (original)
+++ apps/gorm/trunk/GormPrefs/GNUmakefile       Mon Feb 23 03:23:29 2015
@@ -38,7 +38,6 @@
 #
 
 GormPrefs_HEADER_FILES= \
-GormColorsPref.h \
 GormGeneralPref.h \
 GormGuidelinePref.h \
 GormHeadersPref.h \
@@ -52,7 +51,6 @@
 #
 
 GormPrefs_OBJC_FILES= \
-GormColorsPref.m \
 GormGeneralPref.m \
 GormGuidelinePref.m \
 GormHeadersPref.m \

Removed: apps/gorm/trunk/GormPrefs/GormColorsPref.h
URL: 
http://svn.gna.org/viewcvs/gnustep/apps/gorm/trunk/GormPrefs/GormColorsPref.h?rev=38355&view=auto
==============================================================================
--- apps/gorm/trunk/GormPrefs/GormColorsPref.h  (original)
+++ apps/gorm/trunk/GormPrefs/GormColorsPref.h  (removed)
@@ -1,52 +0,0 @@
-/* GormColorsPref.h
- *
- * Copyright (C) 2003 Free Software Foundation, Inc.
- *
- * Author:     Gregory John Casamento <[email protected]>
- * Date:       1999, 2003
- * 
- * This file is part of GNUstep.
- * 
- * This program 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 program 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 General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
- */
-
-#ifndef INCLUDED_GormColorsPref_h
-#define INCLUDED_GormColorsPref_h
-
-#include <Foundation/NSObject.h>
-#include <Foundation/NSArray.h>
-#include <AppKit/NSView.h>
-
-@class NSWindow;
-
-@interface GormColorsPref : NSObject
-{
-  id color;
-  NSWindow *window;
-  id _view;
-}
-
-/**
- * View to be shown.
- */
-- (NSView *) view;
-
-/**
- * Set the colors.
- */
-- (void)ok: (id)sender;
-@end
-
-#endif

Removed: apps/gorm/trunk/GormPrefs/GormColorsPref.m
URL: 
http://svn.gna.org/viewcvs/gnustep/apps/gorm/trunk/GormPrefs/GormColorsPref.m?rev=38355&view=auto
==============================================================================
--- apps/gorm/trunk/GormPrefs/GormColorsPref.m  (original)
+++ apps/gorm/trunk/GormPrefs/GormColorsPref.m  (removed)
@@ -1,59 +0,0 @@
-#include "GormColorsPref.h"
-#include <GormCore/GormFunctions.h>
-
-#include <Foundation/NSUserDefaults.h>
-#include <AppKit/NSWindow.h>
-#include <AppKit/NSNibLoading.h>
-#include <AppKit/NSColorWell.h>
-#include <AppKit/NSColor.h>
-
-@implementation GormColorsPref
-- (id) init
-{
-  _view = nil;
-
-  self = [super init];
-  if(self != nil)
-    {
-      NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
-      NSColor *aColor = colorFromDict([defaults objectForKey: @"GuideColor"]);
-      
-      // default the color to something, if nothing is returned.
-      if(aColor == nil)
-       {
-         aColor = [NSColor redColor];
-       }
-
-      if ( ! [NSBundle loadNibNamed:@"GormPrefColors" owner:self] )
-       {
-         NSLog(@"Can not load bundle GormPrefColors");
-         return nil;
-       }
-
-      [color setColor: aColor];
-      _view =  [[window contentView] retain];
-    }
-  return self;
-}
-
-- (void) dealloc
-{
-  TEST_RELEASE(_view);
-  [super dealloc];
-}
-
-
--(NSView *) view
-{
-  return _view;
-}
-
-- (void) ok: (id)sender
-{
-  NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
-  if(sender == color)
-    {
-      [defaults setObject: colorToDict([color color]) forKey: @"GuideColor"];
-    }
-}
-@end

Modified: apps/gorm/trunk/GormPrefs/GormGuidelinePref.h
URL: 
http://svn.gna.org/viewcvs/gnustep/apps/gorm/trunk/GormPrefs/GormGuidelinePref.h?rev=38356&r1=38355&r2=38356&view=diff
==============================================================================
--- apps/gorm/trunk/GormPrefs/GormGuidelinePref.h       (original)
+++ apps/gorm/trunk/GormPrefs/GormGuidelinePref.h       Mon Feb 23 03:23:29 2015
@@ -38,6 +38,7 @@
   id spacingSlider;
   id currentSpacing;
   id halfSpacing;
+  id colorWell;
 }
 /**
  * View to show in prefs panel.

Modified: apps/gorm/trunk/GormPrefs/GormGuidelinePref.m
URL: 
http://svn.gna.org/viewcvs/gnustep/apps/gorm/trunk/GormPrefs/GormGuidelinePref.m?rev=38356&r1=38355&r2=38356&view=diff
==============================================================================
--- apps/gorm/trunk/GormPrefs/GormGuidelinePref.m       (original)
+++ apps/gorm/trunk/GormPrefs/GormGuidelinePref.m       Mon Feb 23 03:23:29 2015
@@ -8,22 +8,32 @@
 #include <AppKit/NSColor.h>
 
 @implementation GormGuidelinePref
+
 - (id) init
 {
   if((self = [super init]) != nil)
     {
       NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
       int spacing = [defaults integerForKey: @"GuideSpacing"];
-      
+      NSColor *aColor = colorFromDict([defaults objectForKey: @"GuideColor"]);
+
+      // default the color to something, if nothing is returned.
+      if(aColor == nil)
+       {
+         aColor = [NSColor redColor];
+       }
+
       if ( [NSBundle loadNibNamed:@"GormPrefGuideline" owner:self] == NO )
        {
          NSLog(@"Can not load bundle GormPrefGuideline");
          return nil;
        } 
 
+      [colorWell setColor: aColor];
       [spacingSlider setIntValue: spacing];
       [currentSpacing setIntValue: spacing];
       [halfSpacing setIntValue: spacing/2];
+
       _view =  [[window contentView] retain];
     }
   return self;
@@ -34,7 +44,6 @@
   TEST_RELEASE(_view);
   [super dealloc];
 }
-
 
 -(NSView *) view
 {
@@ -47,15 +56,27 @@
   if(sender == spacingSlider)
     {
       int spacing = [spacingSlider intValue]; 
+
       [currentSpacing setIntValue: spacing];
       [halfSpacing setIntValue: spacing/2];
-      [defaults setInteger: spacing forKey: @"GuideSpacing"];
+      [defaults setInteger: spacing 
+                   forKey: @"GuideSpacing"];
+    }
+  else if(sender == colorWell)
+    {
+      NSColor *color = [colorWell color];
+      [defaults setObject: colorToDict(color) 
+                  forKey: @"GuideColor"];
     }
 }
 
 - (void) reset: (id)sender
 {
   [spacingSlider setIntValue: 10];
+  [colorWell setColor: [NSColor redColor]];
+
   [self ok: spacingSlider];
+  [self ok: colorWell];
 }
+
 @end

Modified: apps/gorm/trunk/GormPrefs/GormPrefController.m
URL: 
http://svn.gna.org/viewcvs/gnustep/apps/gorm/trunk/GormPrefs/GormPrefController.m?rev=38356&r1=38355&r2=38356&view=diff
==============================================================================
--- apps/gorm/trunk/GormPrefs/GormPrefController.m      (original)
+++ apps/gorm/trunk/GormPrefs/GormPrefController.m      Mon Feb 23 03:23:29 2015
@@ -2,7 +2,6 @@
 #include "GormGeneralPref.h"
 #include "GormHeadersPref.h"
 #include "GormShelfPref.h"
-#include "GormColorsPref.h"
 #include "GormPalettesPref.h"
 #include "GormPluginsPref.h"
 #include "GormGuidelinePref.h"
@@ -32,7 +31,6 @@
   _generalView  = [[GormGeneralPref alloc] init];
   _headersView  = [[GormHeadersPref alloc] init];
   _shelfView    = [[GormShelfPref alloc] init];
-  _colorsView   = [[GormColorsPref alloc] init];
   _palettesView = [[GormPalettesPref alloc] init];
   _pluginsView = [[GormPluginsPref alloc] init];
   _guidelineView = [[GormGuidelinePref alloc] init];
@@ -62,9 +60,6 @@
       break;
     case 2:
       [prefBox setContentView: [_shelfView view]];
-      break;
-    case 3:
-      [prefBox setContentView: [_colorsView view]];
       break;
     case 4:
       [prefBox setContentView: [_palettesView view]];


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to