Correct issue I introduced last night. Continue moving print panel/layout panel implementation to theme instead of print bundle.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@38321 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2015-02-02 17:05:16 +00:00
parent e53b5e2e46
commit d628aac2e3
4 changed files with 45 additions and 21 deletions

View file

@ -1,3 +1,12 @@
2015-02-02 11:59-EST Gregory John Casamento <greg.casamento@gmail.com>
* Source/GSThemePrintPanels.m: Add default subclass implementation
so that the panels can be instantiated.
* Source/NSPageLayout.m: Change the allocWithZone: method to
return the class indicated by the theme.
* Source/NSPrintPanel.m: Change the allocWithZone: method to
return the class indicated by the theme.
2015-02-01 Gregory Casamento <greg.casamento@gmail.com>
* Source/GSPrinting.m: Add call to GSTheme code to get the

View file

@ -30,6 +30,31 @@
#import "AppKit/NSPageLayout.h"
#import "GNUstepGUI/GSTheme.h"
@interface GSPrintPanel : NSPrintPanel
@end
@interface GSPageLayout : NSPageLayout
@end
@implementation GSPrintPanel
+ (id) allocWithZone: (NSZone*)zone
{
return NSAllocateObject(self, 0, zone);
}
@end
@implementation GSPageLayout
+ (id) allocWithZone: (NSZone*)zone
{
return NSAllocateObject(self, 0, zone);
}
@end
@implementation GSTheme (PrintPanels)
/**
* This method returns the print panel class needed by the
@ -37,7 +62,7 @@
*/
- (Class) printPanelClass
{
return [NSPrintPanel class];
return [GSPrintPanel class];
}
/**
@ -46,7 +71,7 @@
*/
- (Class) pageLayoutClass
{
return [NSPageLayout class];
return [GSPageLayout class];
}
@end

View file

@ -59,6 +59,7 @@
#import "AppKit/NSPrinter.h"
#import "GSGuiPrivate.h"
#import "GNUstepGUI/GSPrinting.h"
#import "GNUstepGUI/GSTheme.h"
static NSPageLayout *shared_instance;
@ -139,6 +140,7 @@ enum {
NSPrintInfo *_printInfo;
NSView *_accessoryView;
}
-(NSPageLayout*) panel;
//IBActions
@ -229,21 +231,14 @@ enum {
// Class methods
//
/** Load the appropriate bundle for the PageLayout
(eg: GSLPRPageLayout, GSCUPSPageLayout).
*/
+ (id) allocWithZone: (NSZone*) zone
{
Class principalClass;
principalClass = [[GSPrinting printingBundle] principalClass];
if (principalClass == nil)
return nil;
return [[principalClass pageLayoutClass] allocWithZone: zone];
Class cls = [[GSTheme theme] pageLayoutClass];
return [cls allocWithZone: zone];
}
/** Creates ( if needed ) and returns a shared instance of the
NSPageLayout panel.
*/

View file

@ -49,6 +49,7 @@
#import "AppKit/NSView.h"
#import "GSGuiPrivate.h"
#import "GNUstepGUI/GSPrinting.h"
#import "GNUstepGUI/GSTheme.h"
static NSPrintPanel *shared_instance = nil;
@ -85,18 +86,12 @@ static NSPrintPanel *shared_instance = nil;
//
/** Load the appropriate bundle for the PrintPanel
and alloc the class from that in our place
(eg: GSLPRPrintPanel, GSCUPSPrintPanel).
*/
+ (id) allocWithZone: (NSZone*) zone
{
Class principalClass;
principalClass = [[GSPrinting printingBundle] principalClass];
if (principalClass == nil)
return nil;
return [[principalClass printPanelClass] allocWithZone: zone];
Class cls = [[GSTheme theme] printPanelClass];
return [cls allocWithZone: zone];
}
/** Creates ( if needed) and returns a shared instance of the