Skip to content
Newer
Older
100644 926 lines (751 sloc) 28.1 KB
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
1 /*
8a878fe Cleanup commit before I start a couple of branches. What a mess.
Alexander Rauchfuss authored Aug 30, 2009
2 Copyright (c) 2006-2009 Dancing Tortoise Software
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
3
4 Permission is hereby granted, free of charge, to any person
5 obtaining a copy of this software and associated documentation
6 files (the "Software"), to deal in the Software without
7 restriction, including without limitation the rights to use,
8 copy, modify, merge, publish, distribute, sublicense, and/or
9 sell copies of the Software, and to permit persons to whom the
10 Software is furnished to do so, subject to the following
11 conditions:
12
13 The above copyright notice and this permission notice shall be
14 included in all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
18 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
21 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23 OTHER DEALINGS IN THE SOFTWARE.
24
25 Simple Comic
26 SimpleComicAppDelegate.m
27 */
28
29
30 #import "SimpleComicAppDelegate.h"
31 #import <XADMaster/XADArchive.h>
bb18646 Changing the toolbar images be more standardized. The progress bar is…
Alexander Rauchfuss authored Nov 14, 2009
32 #import <Carbon/Carbon.h>
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
33 #import "TSSTSessionWindowController.h"
34 #import "TSSTSortDescriptor.h"
35 #import "TSSTPage.h"
36 #import "TSSTManagedGroup.h"
37 #import "TSSTManagedBookmarkGroup.h"
38 #import "TSSTManagedSession.h"
39 #import "TSSTCustomValueTransformers.h"
634f52f Clean up and changes for the os-x app store
Alexander Rauchfuss authored Nov 6, 2010
40 #import "DTPreferencesController.h"
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
41
42
43 NSString * TSSTPageOrder = @"pageOrder";
44 NSString * TSSTPageZoomRate = @"pageZoomRate";
45 NSString * TSSTFullscreen = @"fullscreen";
46 NSString * TSSTSavedSelection = @"savedSelection";
47 NSString * TSSTThumbnailSize = @"thumbnailSize";
48 NSString * TSSTTwoPageSpread = @"twoPageSpread";
49 NSString * TSSTPageScaleOptions = @"scaleOptions";
50 NSString * TSSTIgnoreDonation = @"ignoreDonation";
51 NSString * TSSTScrollPosition = @"scrollPosition";
52 NSString * TSSTConstrainScale = @"constrainScale";
53 NSString * TSSTZoomLevel = @"zoomLevel";
54 NSString * TSSTViewRotation = @"rotation";
55 NSString * TSSTBackgroundColor = @"pageBackgroundColor";
56 NSString * TSSTSessionRestore = @"sessionRestore";
57 NSString * TSSTScrollersVisible = @"scrollersVisible";
58 NSString * TSSTAutoPageTurn = @"autoPageTurn";
59 NSString * TSSTWindowAutoResize = @"windowAutoResize";
60 NSString * TSSTLoupeDiameter = @"loupeDiameter";
61 NSString * TSSTLoupePower = @"loupePower";
62 NSString * TSSTStatusbarVisible = @"statusBarVisisble";
63 NSString * TSSTLonelyFirstPage = @"lonelyFirstPage";
64 NSString * TSSTNestedArchives = @"nestedArchives";
65 NSString * TSSTUpdateSelection = @"updateSelection";
66
631ca00 Added page capture feature as well as changing the icon selection int…
Alexander Rauchfuss authored Jul 2, 2009
67 NSString * TSSTSessionEndNotification = @"sessionEnd";
68
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
69
70 #pragma mark -
71 #pragma mark String Encoding Functions
72
73
74
75 static NSArray * allAvailableStringEncodings(void)
76 {
438d319 Updated XADMaster encoding delegate method and in the process fixed a…
Alexander Rauchfuss authored Jul 7, 2009
77 NSStringEncoding encodings[] = {
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
78 kCFStringEncodingMacRoman,
79 kCFStringEncodingISOLatin1,
80 kCFStringEncodingASCII,
81 101,
82 kCFStringEncodingWindowsLatin2,
83 kCFStringEncodingMacCentralEurRoman,
84 kCFStringEncodingDOSLatin2,
85 101,
86 kCFStringEncodingDOSJapanese,
87 kCFStringEncodingMacJapanese,
88 kCFStringEncodingShiftJIS_X0213_00,
89 kCFStringEncodingISO_2022_JP,
90 kCFStringEncodingEUC_JP,
91 101,
92 kCFStringEncodingGBK_95,
93 kCFStringEncodingGB_18030_2000,
94 101,
95 kCFStringEncodingDOSChineseSimplif,
96 kCFStringEncodingVISCII,
97 kCFStringEncodingHZ_GB_2312,
98 kCFStringEncodingEUC_CN,
99 kCFStringEncodingGB_2312_80,
100 101,
101 kCFStringEncodingDOSChineseTrad,
102 kCFStringEncodingBig5_HKSCS_1999,
103 kCFStringEncodingBig5,
104 101,
105 kCFStringEncodingDOSKorean,
106 kCFStringEncodingEUC_KR,
107 kCFStringEncodingKSC_5601_87,
108 kCFStringEncodingWindowsKoreanJohab,
109 101,
110 kCFStringEncodingWindowsCyrillic,
111 kCFStringEncodingDOSCyrillic,
112 kCFStringEncodingDOSRussian,
113 kCFStringEncodingKOI8_R,
114 kCFStringEncodingKOI8_U,
115 101,
116 kCFStringEncodingWindowsArabic,
117 kCFStringEncodingISOLatinArabic,
118 101,
119 kCFStringEncodingISOLatinHebrew,
120 kCFStringEncodingWindowsHebrew,
121 101,
122 kCFStringEncodingISOLatinGreek,
123 kCFStringEncodingWindowsGreek,
124 101,
125 kCFStringEncodingISOLatin5,
126 kCFStringEncodingWindowsLatin5,
127 101,
128 kCFStringEncodingISOLatinThai,
129 kCFStringEncodingDOSThai,
130 101,
131 kCFStringEncodingWindowsVietnamese,
132 kCFStringEncodingDOSPortuguese,
133 kCFStringEncodingWindowsBalticRim,
134 NSNotFound
135 };
136
137 NSMutableArray * codeNumbers = [NSMutableArray array];
138 int counter = 0;
438d319 Updated XADMaster encoding delegate method and in the process fixed a…
Alexander Rauchfuss authored Jul 8, 2009
139 NSStringEncoding encoding;
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
140 while(encodings[counter] != NSNotFound)
141 {
142 if(encodings[counter] != 101)
143 {
144 encoding = CFStringConvertEncodingToNSStringEncoding(encodings[counter]);
145 }
146 else
147 {
148 encoding = 101;
149 }
150
438d319 Updated XADMaster encoding delegate method and in the process fixed a…
Alexander Rauchfuss authored Jul 8, 2009
151 [codeNumbers addObject: [NSNumber numberWithUnsignedInteger: encoding]];
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
152 ++counter;
153 }
154
438d319 Updated XADMaster encoding delegate method and in the process fixed a…
Alexander Rauchfuss authored Jul 8, 2009
155 return [[codeNumbers retain] autorelease];
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
156 }
157
158
159
160 @implementation SimpleComicAppDelegate
161
162
163 @synthesize encodingSelection;
164
165
166 /* Convenience method for adding metadata to the core data store.
167 Used by Simple Comic to keep track of store versioning. */
168 + (void)setMetadata:(NSString *)value forKey:(NSString *)key onStoreWithURL:(NSURL *)url managedBy:(NSPersistentStoreCoordinator *)coordinator
169 {
170 NSPersistentStore * store = [coordinator persistentStoreForURL: url];
171 NSMutableDictionary * metadata = [[coordinator metadataForPersistentStore: store] mutableCopy];
172 [metadata setValue: value forKey: key];
173 [coordinator setMetadata: metadata forPersistentStore: store];
174 [metadata release];
175 }
176
177
178
179 /* Sets up the user defaults and arrays of compatible file types. */
180 + (void)initialize
181 {
182 NSMutableDictionary* standardDefaults = [NSMutableDictionary dictionary];
183 [standardDefaults setObject: [NSNumber numberWithBool: NO] forKey: TSSTPageOrder];
184 [standardDefaults setObject: [NSNumber numberWithFloat: 0.1] forKey: TSSTPageZoomRate];
185 [standardDefaults setObject: [NSNumber numberWithInt: 1] forKey: TSSTPageScaleOptions];
186 [standardDefaults setObject: [NSNumber numberWithInt: 100] forKey: TSSTThumbnailSize];
187 [standardDefaults setObject: [NSNumber numberWithBool: YES] forKey: TSSTTwoPageSpread];
188 [standardDefaults setObject: [NSNumber numberWithBool: NO] forKey: TSSTIgnoreDonation];
189 [standardDefaults setObject: [NSNumber numberWithBool: YES] forKey: TSSTConstrainScale];
190 [standardDefaults setObject: [NSNumber numberWithBool: YES] forKey: TSSTScrollersVisible];
191 [standardDefaults setObject: [NSNumber numberWithBool: YES] forKey: TSSTSessionRestore];
192 [standardDefaults setObject: [NSNumber numberWithBool: YES] forKey: TSSTAutoPageTurn];
193 [standardDefaults setObject: [NSArchiver archivedDataWithRootObject: [NSColor whiteColor]] forKey: TSSTBackgroundColor];
194 [standardDefaults setObject: [NSNumber numberWithBool: YES] forKey: TSSTWindowAutoResize];
195 [standardDefaults setObject: [NSNumber numberWithInt: 500] forKey: TSSTLoupeDiameter];
196 [standardDefaults setObject: [NSNumber numberWithFloat: 2.0] forKey: TSSTLoupePower];
197 [standardDefaults setObject: [NSNumber numberWithBool: YES] forKey: TSSTStatusbarVisible];
198 [standardDefaults setObject: [NSNumber numberWithBool: YES] forKey: TSSTLonelyFirstPage];
199 [standardDefaults setObject: [NSNumber numberWithBool: YES] forKey: TSSTNestedArchives];
200 [standardDefaults setObject: [NSNumber numberWithInt: 0] forKey: TSSTUpdateSelection];
201
202 NSUserDefaultsController * sharedDefaultsController = [NSUserDefaultsController sharedUserDefaultsController];
203 [sharedDefaultsController setInitialValues: standardDefaults];
204 NSUserDefaults * defaults = [sharedDefaultsController defaults];
205 [defaults registerDefaults: standardDefaults];
206
207 id transformer = [[TSSTLastPathComponent new] autorelease];
208 [NSValueTransformer setValueTransformer: transformer forName: @"TSSTLastPathComponent"];
209 }
210
211
212 - (void) dealloc
213 {
214 [[NSUserDefaults standardUserDefaults] removeObserver: self forKeyPath: TSSTUpdateSelection];
631ca00 Added page capture feature as well as changing the icon selection int…
Alexander Rauchfuss authored Jul 3, 2009
215 [[NSUserDefaults standardUserDefaults] removeObserver: self forKeyPath: TSSTSessionRestore];
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
216
217 [sessions release];
218 [preferences release];
219 [super dealloc];
220 }
221
222
223 #pragma mark -
224 #pragma mark Application Delegate Methods
225
226
631ca00 Added page capture feature as well as changing the icon selection int…
Alexander Rauchfuss authored Jul 3, 2009
227 /* Stores any files that were opened on launch till applicationDidFinishLaunching:
228 is called. */
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
229 - (void)applicationWillFinishLaunching:(NSNotification *)aNotification
230 {
631ca00 Added page capture feature as well as changing the icon selection int…
Alexander Rauchfuss authored Jul 3, 2009
231 autoSave = nil;
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
232 launchFiles = nil;
233 launchInProgress = YES;
234 preferences = nil;
bb18646 Changing the toolbar images be more standardized. The progress bar is…
Alexander Rauchfuss authored Nov 14, 2009
235 optionHeldAtlaunch = NO;
631ca00 Added page capture feature as well as changing the icon selection int…
Alexander Rauchfuss authored Jul 3, 2009
236 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(endSession:) name: TSSTSessionEndNotification object: nil];
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
237 [[NSUserDefaults standardUserDefaults] addObserver: self forKeyPath: TSSTUpdateSelection options: 0 context: nil];
631ca00 Added page capture feature as well as changing the icon selection int…
Alexander Rauchfuss authored Jul 3, 2009
238 [[NSUserDefaults standardUserDefaults] addObserver: self forKeyPath: TSSTSessionRestore options: 0 context: nil];
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
239 }
240
241
631ca00 Added page capture feature as well as changing the icon selection int…
Alexander Rauchfuss authored Jul 3, 2009
242
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
243 - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
244 {
631ca00 Added page capture feature as well as changing the icon selection int…
Alexander Rauchfuss authored Jul 3, 2009
245 NSUserDefaults * userDefaults = [NSUserDefaults standardUserDefaults];
438d319 Updated XADMaster encoding delegate method and in the process fixed a…
Alexander Rauchfuss authored Jul 8, 2009
246 [self generateEncodingMenu];
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
247
631ca00 Added page capture feature as well as changing the icon selection int…
Alexander Rauchfuss authored Jul 3, 2009
248 /* Starts the auto save timer */
249 if([[userDefaults valueForKey: TSSTSessionRestore] boolValue])
250 {
251 autoSave = [NSTimer scheduledTimerWithTimeInterval: 30.0 target: self selector: @selector(saveContext) userInfo: nil repeats: YES];
252 }
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
253 sessions = [NSMutableArray new];
254 [self sessionRelaunch];
255 launchInProgress = NO;
256
257 if(launchFiles)
258 {
bb18646 Changing the toolbar images be more standardized. The progress bar is…
Alexander Rauchfuss authored Nov 14, 2009
259 TSSTManagedSession * session;
260 // if (optionHeldAtlaunch)
261 // {
262 // NSMutableArray * looseImages = [NSMutableArray array];
263 // for(NSString * path in launchFiles)
264 // {
265 // if([[TSSTManagedArchive archiveExtensions] containsObject: [[path pathExtension] lowercaseString]])
266 // {
267 // session = [self newSessionWithFiles: [NSArray arrayWithObject: path]];
268 // [self windowForSession: session];
269 // }
270 // else {
271 // [looseImages addObject: path];
272 // }
273 //
274 // if ([looseImages count]> 0) {
275 // session = [self newSessionWithFiles: looseImages];
276 // [self windowForSession: session];
277 // }
278 //
279 // }
280 // }
281 // else
282 // {
283 session = [self newSessionWithFiles: launchFiles];
284 [self windowForSession: session];
285 // }
286
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
287 [launchFiles release];
288 launchFiles = nil;
289 }
290 }
291
292
293 - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender
294 {
295 NSUserDefaults * userDefaults = [NSUserDefaults standardUserDefaults];
296
cdf1259 Not sure how this crept in but it prevented sessions from saving.
Alexander Rauchfuss authored Sep 12, 2009
297 if(![[userDefaults valueForKey: TSSTSessionRestore] boolValue])
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
298 {
299 /* Goes through and deletes all active sessions if the user has auto save turned off */
300 for(TSSTSessionWindowController * sessionWindow in sessions)
301 {
8a2521a Fixes an issue with the encoding menu, another involving quiting with…
Alexander Rauchfuss authored Sep 8, 2009
302 [[sessionWindow window] performClose: self];
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
303 }
304 }
305
306 int reply = NSTerminateNow;
631ca00 Added page capture feature as well as changing the icon selection int…
Alexander Rauchfuss authored Jul 3, 2009
307 /* TODO: some day I really need to add the fallback error handling */
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
308 if(![self saveContext])
309 {
310 // Error handling wasn't implemented. Fall back to displaying a "quit anyway" panel.
311 int alertReturn = NSRunAlertPanel(nil, @"Could not save changes while quitting. Quit anyway?" , @"Quit anyway", @"Cancel", nil);
312 if (alertReturn == NSAlertAlternateReturn)
313 {
314 reply = NSTerminateCancel;
315 }
316 }
317
318 return reply;
319 }
320
321
322 - (NSUndoManager *)windowWillReturnUndoManager:(NSWindow *)window
323 {
324 return [[self managedObjectContext] undoManager];
325 }
326
327
631ca00 Added page capture feature as well as changing the icon selection int…
Alexander Rauchfuss authored Jul 3, 2009
328 /* Used to watch and react to pref changes */
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
329 - (void)observeValueForKeyPath:(NSString *)keyPath
330 ofObject:(id)object
331 change:(NSDictionary *)change
332 context:(void *)context
333 {
631ca00 Added page capture feature as well as changing the icon selection int…
Alexander Rauchfuss authored Jul 3, 2009
334 NSUserDefaults * userDefaults = [NSUserDefaults standardUserDefaults];
335
634f52f Clean up and changes for the os-x app store
Alexander Rauchfuss authored Nov 6, 2010
336 if([keyPath isEqualToString: TSSTSessionRestore])
631ca00 Added page capture feature as well as changing the icon selection int…
Alexander Rauchfuss authored Jul 3, 2009
337 {
338 [autoSave invalidate];
339 autoSave = nil;
340 if([[userDefaults valueForKey: TSSTSessionRestore] boolValue])
341 {
342 autoSave = [NSTimer scheduledTimerWithTimeInterval: 30.0 target: self selector: @selector(saveContext) userInfo: nil repeats: YES];
343 }
344 }
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
345 }
346
347
348
349 - (void)application:(NSApplication *)sender openFiles:(NSArray *)filenames
bb18646 Changing the toolbar images be more standardized. The progress bar is…
Alexander Rauchfuss authored Nov 14, 2009
350 {
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
351 if(!launchInProgress)
352 {
bb18646 Changing the toolbar images be more standardized. The progress bar is…
Alexander Rauchfuss authored Nov 14, 2009
353 TSSTManagedSession * session;
66c5dfc Code cleanup and some commenting.
Alexander Rauchfuss authored Dec 15, 2009
354 session = [self newSessionWithFiles: filenames];
355 [self windowForSession: session];
356 }
357 else
358 {
359 launchFiles = [filenames retain];
360 }
361 }
362
363
364
3bba624 Requires XCode 3.2 now. Changed SDK 10.6 with a target platform of 10…
Alexander Rauchfuss authored Jan 10, 2010
365 //- (BOOL)application:(NSApplication *)sender openFile:(NSString *)filename;
366 //{
367 // if(!launchInProgress)
66c5dfc Code cleanup and some commenting.
Alexander Rauchfuss authored Dec 16, 2009
368 // {
3bba624 Requires XCode 3.2 now. Changed SDK 10.6 with a target platform of 10…
Alexander Rauchfuss authored Jan 10, 2010
369 // TSSTManagedSession * session;
370 // session = [self newSessionWithFiles: [NSArray arrayWithObject: filename]];
371 // [self windowForSession: session];
372 // return YES;
373 //
66c5dfc Code cleanup and some commenting.
Alexander Rauchfuss authored Dec 16, 2009
374 // }
3bba624 Requires XCode 3.2 now. Changed SDK 10.6 with a target platform of 10…
Alexander Rauchfuss authored Jan 10, 2010
375 //
376 // return NO;
377 //
378 //// else
379 //// {
380 //// launchFiles = [filenames retain];
381 //// }
382 //}
66c5dfc Code cleanup and some commenting.
Alexander Rauchfuss authored Dec 16, 2009
383
384
385 //- (void)application:(NSApplication *)sender openFiles:(NSArray *)filenames
386 //{
387 // BOOL option = (GetCurrentKeyModifiers()&(optionKey) != 0);
388 // if(!launchInProgress)
389 // {
390 // TSSTManagedSession * session;
bb18646 Changing the toolbar images be more standardized. The progress bar is…
Alexander Rauchfuss authored Nov 14, 2009
391 // if (option)
392 // {
393 // NSMutableArray * looseImages = [NSMutableArray array];
394 // for(NSString * path in filenames)
395 // {
396 // if([[TSSTManagedArchive archiveExtensions] containsObject: [[path pathExtension] lowercaseString]])
397 // {
398 // session = [self newSessionWithFiles: [NSArray arrayWithObject: path]];
399 // [self windowForSession: session];
400 // }
401 // else
402 // {
403 // [looseImages addObject: path];
404 // }
405 //
406 // if ([looseImages count]> 0) {
407 // session = [self newSessionWithFiles: looseImages];
408 // [self windowForSession: session];
409 // }
66c5dfc Code cleanup and some commenting.
Alexander Rauchfuss authored Dec 16, 2009
410 //
bb18646 Changing the toolbar images be more standardized. The progress bar is…
Alexander Rauchfuss authored Nov 14, 2009
411 // }
412 // }
413 // else
414 // {
66c5dfc Code cleanup and some commenting.
Alexander Rauchfuss authored Dec 16, 2009
415 // session = [self newSessionWithFiles: filenames];
416 // [self windowForSession: session];
bb18646 Changing the toolbar images be more standardized. The progress bar is…
Alexander Rauchfuss authored Nov 14, 2009
417 // }
66c5dfc Code cleanup and some commenting.
Alexander Rauchfuss authored Dec 16, 2009
418 // }
419 // else
420 // {
421 // launchFiles = [filenames retain];
bfdcafe Fixed problem with the fullscreen bezel resizing also made the fullsc…
Alexander Rauchfuss authored Nov 25, 2009
422 // optionHeldAtlaunch = option;
66c5dfc Code cleanup and some commenting.
Alexander Rauchfuss authored Dec 16, 2009
423 // }
424 //}
425
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
426
427
428 #pragma mark -
429 #pragma mark Core Data
430
431
432
433 - (NSManagedObjectModel *)managedObjectModel
434 {
435 if (managedObjectModel != nil)
436 {
437 return managedObjectModel;
438 }
439
440 managedObjectModel = [[NSManagedObjectModel mergedModelFromBundles: nil] retain];
441 return managedObjectModel;
442 }
443
444
631ca00 Added page capture feature as well as changing the icon selection int…
Alexander Rauchfuss authored Jul 3, 2009
445 /* Returns the persistent store coordinator for the application. This
446 implementation will create and return a coordinator, having added the
447 store for the application to it. (The folder for the store is created,
448 if necessary.) */
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
449 - (NSPersistentStoreCoordinator *) persistentStoreCoordinator
450 {
451 if (persistentStoreCoordinator != nil)
452 {
453 return persistentStoreCoordinator;
454 }
455
456 NSURL * url;
a4cbb15 Merging a fix from the SL branch.
Alexander Rauchfuss authored Sep 3, 2009
457 NSError * error = nil;
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
458
459 NSFileManager * fileManager = [NSFileManager defaultManager];
460 NSString * applicationSupportFolder = [self applicationSupportFolder];
461 if (![fileManager fileExistsAtPath: applicationSupportFolder isDirectory: NULL] )
462 {
caa421d Clearing up quite a number of methods that were depreciated in 10.5
Alexander Rauchfuss authored Sep 2, 2009
463 if(![fileManager createDirectoryAtPath: applicationSupportFolder withIntermediateDirectories: YES attributes: nil error: &error])
464 {
465 NSLog(@"%@",[error localizedDescription]);
466 }
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
467 }
468
469 NSDictionary * storeOptions = [NSDictionary dictionaryWithObject: [NSNumber numberWithBool: YES]
470 forKey: NSMigratePersistentStoresAutomaticallyOption];
471 url = [NSURL fileURLWithPath: [applicationSupportFolder stringByAppendingPathComponent: @"SimpleComic.sql"]];
472
a4cbb15 Merging a fix from the SL branch.
Alexander Rauchfuss authored Sep 3, 2009
473 error = nil;
caa421d Clearing up quite a number of methods that were depreciated in 10.5
Alexander Rauchfuss authored Sep 3, 2009
474 NSDictionary * storeInfo = [NSPersistentStoreCoordinator metadataForPersistentStoreOfType: NSSQLiteStoreType URL: url error: &error];
475 if(error)
476 {
477 NSLog(@"%@",[error localizedDescription]);
478 }
479
f5cfdca Changes to the zoom code to make it a bit more sane. Might be able to…
Alexander Rauchfuss authored Mar 20, 2010
480 if(![[storeInfo valueForKey: @"viewVersion"] isEqualToString: @"Version 1706"])
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
481 {
caa421d Clearing up quite a number of methods that were depreciated in 10.5
Alexander Rauchfuss authored Sep 3, 2009
482 if(![fileManager removeItemAtPath: [url path] error: &error])
483 {
484 NSLog(@"%@",[error localizedDescription]);
485 }
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
486 }
487
488 persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel: [self managedObjectModel]];
489
490 if (![persistentStoreCoordinator addPersistentStoreWithType: NSSQLiteStoreType configuration: nil URL: url options: storeOptions error: &error])
491 {
492 [[NSApplication sharedApplication] presentError: error];
493 }
494
f5cfdca Changes to the zoom code to make it a bit more sane. Might be able to…
Alexander Rauchfuss authored Mar 20, 2010
495 [SimpleComicAppDelegate setMetadata: @"Version 1706" forKey: @"viewVersion" onStoreWithURL: url managedBy: persistentStoreCoordinator];
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
496
497 return persistentStoreCoordinator;
498 }
499
500
501 - (NSManagedObjectContext *) managedObjectContext
502 {
503 if (managedObjectContext != nil)
504 {
505 return managedObjectContext;
506 }
507
508 NSPersistentStoreCoordinator *coordinator = [self persistentStoreCoordinator];
509 if (coordinator != nil)
510 {
511 managedObjectContext = [[NSManagedObjectContext alloc] init];
512 [managedObjectContext setPersistentStoreCoordinator: coordinator];
513 }
514
515 return managedObjectContext;
516 }
517
518
519
520 /* Method creates an application support directory for Simpl Comic if one
521 is does not already exist.
522 @return The absolute path to Simple Comic's application support directory
631ca00 Added page capture feature as well as changing the icon selection int…
Alexander Rauchfuss authored Jul 3, 2009
523 as a string. */
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
524 - (NSString *)applicationSupportFolder
525 {
526
527 NSArray * paths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES);
528 NSString * basePath = ([paths count] > 0) ? [paths objectAtIndex:0] : NSTemporaryDirectory();
529 return [basePath stringByAppendingPathComponent: @"Simple Comic"];
530 }
531
532
533
534 - (BOOL)saveContext
535 {
536 TSSTSessionWindowController * controller;
537 for (controller in sessions)
538 {
539 [controller updateSessionObject];
540 }
541
542 NSError * error;
543 NSManagedObjectContext * context = [self managedObjectContext];
544 [context retain];
545 [context lock];
546 BOOL saved = NO;
547 if (context != nil)
548 {
549 if ([context commitEditing])
550 {
551 if (![context save: &error])
552 {
553 // This default error handling implementation should be changed to make sure the error presented includes application specific error recovery.
554 // For now, simply display 2 panels.
555 [[NSApplication sharedApplication] presentError: error];
556 }
557 else
558 {
559 saved = YES;
560 }
561 }
562 }
563
564 [context unlock];
565 [context release];
566 return saved;
567 }
568
569
570
571 #pragma mark -
572 #pragma mark Session Managment
573
574
575
576 - (void)windowForSession:(TSSTManagedSession *)settings
577 {
578 NSArray * existingSessions = [sessions valueForKey: @"session"];
579 if([[settings valueForKey: @"images"] count] > 0 && ![existingSessions containsObject: settings])
580 {
581 TSSTSessionWindowController * comicWindow = [[TSSTSessionWindowController alloc] initWithSession: settings];
582 [sessions addObject: comicWindow];
583 [comicWindow release];
584 [comicWindow showWindow: self];
585 }
586 }
587
588
589
631ca00 Added page capture feature as well as changing the icon selection int…
Alexander Rauchfuss authored Jul 3, 2009
590 - (void)endSession:(NSNotification *)notification
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
591 {
631ca00 Added page capture feature as well as changing the icon selection int…
Alexander Rauchfuss authored Jul 3, 2009
592 TSSTSessionWindowController * controller = [notification object];
593 TSSTManagedSession * sessionToRemove = [[controller session] retain];
594 [sessions removeObject: controller];
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
595 [[self managedObjectContext] deleteObject: sessionToRemove];
596 [sessionToRemove release];
597 }
598
599
600
601 - (void)sessionRelaunch
602 {
603 TSSTManagedSession * session;
604 NSFetchRequest * sessionRequest = [NSFetchRequest new];
605 [sessionRequest setEntity: [NSEntityDescription entityForName: @"Session" inManagedObjectContext: [self managedObjectContext]]];
606 NSError * fetchError;
607 NSArray * managedSessions = [[self managedObjectContext] executeFetchRequest: sessionRequest error: &fetchError];
608 [sessionRequest release];
609 for(session in managedSessions)
610 {
611 if([[session valueForKey: @"groups"] count] <= 0)
612 {
613 [[self managedObjectContext] deleteObject: session];
614 }
615 else
616 {
a5f6d71 Fixed a bug where exiting SC in fullscreen mode with a window open wo…
Alexander Rauchfuss authored Oct 25, 2009
617
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
618 [self windowForSession: session];
619 }
620 }
621 }
622
623
624 - (TSSTManagedSession *)newSessionWithFiles:(NSArray *)files
625 {
626 TSSTManagedSession * sessionDescription = [NSEntityDescription insertNewObjectForEntityForName: @"Session" inManagedObjectContext: [self managedObjectContext]];
627 NSUserDefaults * defaults = [NSUserDefaults standardUserDefaults];
628
629 [sessionDescription setValue: [defaults valueForKey: TSSTPageScaleOptions] forKey: TSSTPageScaleOptions];
630 [sessionDescription setValue: [defaults valueForKey: TSSTPageOrder] forKey: TSSTPageOrder];
631 [sessionDescription setValue: [defaults valueForKey: TSSTTwoPageSpread] forKey: TSSTTwoPageSpread];
632
633 [self addFiles: files toSession: sessionDescription];
634
635 return sessionDescription;
636 }
637
638
639
640 - (void)addFiles:(NSArray *)paths toSession:(TSSTManagedSession *)session
641 {
bb18646 Changing the toolbar images be more standardized. The progress bar is…
Alexander Rauchfuss authored Nov 14, 2009
642 // [[self managedObjectContext] retain];
643 // [[self managedObjectContext] lock];
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
644 NSFileManager * fileManager = [NSFileManager defaultManager];
645 NSString * path, * fileExtension;
646 BOOL isDirectory, exists;
647 NSManagedObject * fileDescription;
648 NSMutableSet * pageSet = [[NSMutableSet alloc] initWithSet: [session valueForKey: @"images"]];
649 for (path in paths)
650 {
651 fileDescription = nil;
652 fileExtension = [[path pathExtension] lowercaseString];
653 exists = [fileManager fileExistsAtPath: path isDirectory: &isDirectory];
654 if(exists && ![[[path lastPathComponent] substringToIndex: 1] isEqualToString: @"."])
655 {
656 if(isDirectory)
657 {
658 fileDescription = [NSEntityDescription insertNewObjectForEntityForName: @"ImageGroup" inManagedObjectContext: [self managedObjectContext]];
659 [fileDescription setValue: path forKey: @"path"];
660 [fileDescription setValue: [path lastPathComponent] forKey: @"name"];
661 [(TSSTManagedGroup *)fileDescription nestedFolderContents];
662 }
663 else if([[TSSTManagedArchive archiveExtensions] containsObject: fileExtension])
664 {
665 fileDescription = [NSEntityDescription insertNewObjectForEntityForName: @"Archive" inManagedObjectContext: [self managedObjectContext]];
666 [fileDescription setValue: path forKey: @"path"];
667 [fileDescription setValue: [path lastPathComponent] forKey: @"name"];
668 [(TSSTManagedArchive *)fileDescription nestedArchiveContents];
669 }
670 else if([fileExtension isEqualToString: @"pdf"])
671 {
672 fileDescription = [NSEntityDescription insertNewObjectForEntityForName: @"PDF" inManagedObjectContext: [self managedObjectContext]];
673 [fileDescription setValue: path forKey: @"path"];
674 [fileDescription setValue: [path lastPathComponent] forKey: @"name"];
675 [(TSSTManagedPDF *)fileDescription pdfContents];
676 }
677 else if([[TSSTPage imageExtensions] containsObject: fileExtension] || [[TSSTPage textExtensions] containsObject: fileExtension])
678 {
679 fileDescription = [NSEntityDescription insertNewObjectForEntityForName: @"Image" inManagedObjectContext: [self managedObjectContext]];
680 [fileDescription setValue: path forKey: @"imagePath"];
681 }
682
683 if([fileDescription class] == [TSSTManagedGroup class] || [fileDescription superclass] == [TSSTManagedGroup class])
684 {
685 [pageSet unionSet: [(TSSTManagedGroup *)fileDescription nestedImages]];
686 [fileDescription setValue: session forKey: @"session"];
687 }
688 else if ([fileDescription class] == [TSSTPage class])
689 {
690 [pageSet addObject: fileDescription];
691 }
692
693 if(fileDescription)
694 {
695 [[NSDocumentController sharedDocumentController] noteNewRecentDocumentURL: [NSURL fileURLWithPath: path]];
696 }
697 }
698 }
699
700 [session setValue: pageSet forKey: @"images"];
701 [pageSet release];
bb18646 Changing the toolbar images be more standardized. The progress bar is…
Alexander Rauchfuss authored Nov 14, 2009
702 // [[self managedObjectContext] unlock];
703 // [[self managedObjectContext] release];
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
704 }
705
706
707 #pragma mark -
708 #pragma mark Actions
709
710
711 // Launches open modal.
712 - (IBAction)addPages:(id)sender
713 {
714 // Creates a new modal.
715 NSOpenPanel * addPagesModal = [NSOpenPanel openPanel];
716 [addPagesModal setAllowsMultipleSelection: YES];
717 [addPagesModal setCanChooseDirectories: YES];
718
719 NSMutableArray * allAllowedFilesExtensions = [NSMutableArray arrayWithArray: [TSSTManagedArchive archiveExtensions]];
720 [allAllowedFilesExtensions addObjectsFromArray: [TSSTPage imageExtensions]];
721
722 if([addPagesModal runModalForTypes: allAllowedFilesExtensions] != NSCancelButton)
723 {
724 TSSTManagedSession * session = [self newSessionWithFiles: [addPagesModal filenames]];
725 [self windowForSession: session];
726 }
727 }
728
729
730
731 /* Kills the password and encoding modals if the OK button was clicked. */
732 - (IBAction)modalOK:(id)sender
733 {
734 [NSApp stopModalWithCode: NSOKButton];
735 }
736
737
738
739 /* Kills the password and encoding modals if the Cancel button was clicked. */
740 - (IBAction)modalCancel:(id)sender
741 {
742 [NSApp stopModalWithCode: NSCancelButton];
743 }
744
745
746
747 - (IBAction)openPreferences:(id)sender
748 {
749 if(!preferences)
750 {
634f52f Clean up and changes for the os-x app store
Alexander Rauchfuss authored Nov 6, 2010
751 preferences = [DTPreferencesController new];
752 }
753 [preferences showWindow: self];
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
754 }
755
756
757
4173496 Fixed a couple memory leaks. Yay build and analyze.
Alexander Rauchfuss authored Sep 26, 2009
758
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
759 #pragma mark -
760 #pragma mark Archive Encoding Handling
761
762
4173496 Fixed a couple memory leaks. Yay build and analyze.
Alexander Rauchfuss authored Sep 27, 2009
763
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
764 - (IBAction)testEncodingMenu:(id)sender
765 {
766 [NSApp runModalForWindow: encodingPanel];
767 }
768
769
4173496 Fixed a couple memory leaks. Yay build and analyze.
Alexander Rauchfuss authored Sep 27, 2009
770
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
771 - (void)generateEncodingMenu
772 {
631ca00 Added page capture feature as well as changing the icon selection int…
Alexander Rauchfuss authored Jul 3, 2009
773 NSMenu * encodingMenu = [encodingPopup menu];
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
774 NSMenuItem * encodingMenuItem;
775 NSArray * allEncodings = allAvailableStringEncodings();
776 NSNumber * encodingIdent;
777 NSStringEncoding stringEncoding;
778 NSString * encodingName;
438d319 Updated XADMaster encoding delegate method and in the process fixed a…
Alexander Rauchfuss authored Jul 8, 2009
779 self.encodingSelection = 0;
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
780 [encodingMenu setAutoenablesItems: NO];
781 for(encodingMenuItem in [encodingMenu itemArray])
782 {
783 [encodingMenu removeItem: encodingMenuItem];
784 }
785
786 for(encodingIdent in allEncodings)
787 {
438d319 Updated XADMaster encoding delegate method and in the process fixed a…
Alexander Rauchfuss authored Jul 8, 2009
788 stringEncoding = [encodingIdent unsignedIntegerValue];
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
789 encodingName = [NSString localizedNameOfStringEncoding: stringEncoding];
790 if(stringEncoding == 101)
791 {
792 encodingMenuItem = [NSMenuItem separatorItem];
793 [encodingMenu addItem: encodingMenuItem];
794 }
795 else if(encodingName && ![encodingName isEqualToString: @""])
796 {
797 encodingMenuItem = [[NSMenuItem alloc] initWithTitle: encodingName action: nil keyEquivalent: @""];
798 [encodingMenuItem setRepresentedObject: encodingIdent];
799 [encodingMenu addItem: encodingMenuItem];
800 [encodingMenuItem release];
801 }
802 }
631ca00 Added page capture feature as well as changing the icon selection int…
Alexander Rauchfuss authored Jul 3, 2009
803 [encodingPopup bind: @"selectedIndex" toObject: self withKeyPath: @"encodingSelection" options: nil];
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
804 }
805
806
4173496 Fixed a couple memory leaks. Yay build and analyze.
Alexander Rauchfuss authored Sep 27, 2009
807
438d319 Updated XADMaster encoding delegate method and in the process fixed a…
Alexander Rauchfuss authored Jul 8, 2009
808 - (void)updateEncodingMenuTestedAgainst:(NSData *)data
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
809 {
810
811 NSStringEncoding stringEncoding;
812 NSMenuItem * encodingMenuItem;
813 NSString * testText;
814
631ca00 Added page capture feature as well as changing the icon selection int…
Alexander Rauchfuss authored Jul 3, 2009
815 for(encodingMenuItem in [[encodingPopup menu] itemArray])
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
816 {
438d319 Updated XADMaster encoding delegate method and in the process fixed a…
Alexander Rauchfuss authored Jul 8, 2009
817 stringEncoding = [[encodingMenuItem representedObject] unsignedIntegerValue];
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
818 [encodingMenuItem setEnabled: NO];
8a2521a Fixes an issue with the encoding menu, another involving quiting with…
Alexander Rauchfuss authored Sep 9, 2009
819 if(![encodingMenuItem isSeparatorItem])
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
820 {
438d319 Updated XADMaster encoding delegate method and in the process fixed a…
Alexander Rauchfuss authored Jul 8, 2009
821 testText = [[NSString alloc] initWithData: data encoding: stringEncoding];
822
823 [encodingMenuItem setEnabled: testText ? YES : NO];
824 [testText release];
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
825 }
826 }
827 }
828
829
4af13e0 Changed support for password protected archives. It seems to work now…
Alexander Rauchfuss authored Apr 25, 2011
830
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
831 - (NSString*)passwordForArchiveWithPath:(NSString*)filename
832 {
833 NSString* password = nil;
834 [passwordField setStringValue: @""];
835 if([NSApp runModalForWindow: passwordPanel] != NSCancelButton)
836 {
837 password = [passwordField stringValue];
838 }
839
840 [passwordPanel close];
841 return password;
842 }
843
844
4173496 Fixed a couple memory leaks. Yay build and analyze.
Alexander Rauchfuss authored Sep 27, 2009
845
438d319 Updated XADMaster encoding delegate method and in the process fixed a…
Alexander Rauchfuss authored Jul 8, 2009
846 -(NSStringEncoding)archive:(XADArchive *)archive
847 encodingForData:(NSData *)data
848 guess:(NSStringEncoding)guess
849 confidence:(float)confidence
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
850 {
438d319 Updated XADMaster encoding delegate method and in the process fixed a…
Alexander Rauchfuss authored Jul 8, 2009
851 NSString * testText = [[NSString alloc] initWithData: data encoding: guess];
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
852 if(confidence < 0.8 || !testText)
853 {
631ca00 Added page capture feature as well as changing the icon selection int…
Alexander Rauchfuss authored Jul 3, 2009
854 NSMenu * encodingMenu = [encodingPopup menu];
438d319 Updated XADMaster encoding delegate method and in the process fixed a…
Alexander Rauchfuss authored Jul 8, 2009
855 [self updateEncodingMenuTestedAgainst: data];
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
856 NSArray * encodingIdentifiers = [[encodingMenu itemArray] valueForKey: @"representedObject"];
857
438d319 Updated XADMaster encoding delegate method and in the process fixed a…
Alexander Rauchfuss authored Jul 8, 2009
858 NSUInteger index = [encodingIdentifiers indexOfObject: [NSNumber numberWithUnsignedInteger: guess]];
859 NSUInteger counter = 0;
2dfdcd9 Fixes issue with encoding menu where there was no good guess.
Alexander Rauchfuss authored Sep 23, 2009
860 // NSStringEncoding encoding;
861 NSNumber * encoding;
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
862 while(!testText)
863 {
438d319 Updated XADMaster encoding delegate method and in the process fixed a…
Alexander Rauchfuss authored Jul 8, 2009
864 [testText release];
2dfdcd9 Fixes issue with encoding menu where there was no good guess.
Alexander Rauchfuss authored Sep 23, 2009
865 encoding = [encodingIdentifiers objectAtIndex: counter];
866 if ([encoding class] != [NSNull class]) {
867 testText = [[NSString alloc] initWithData: data encoding: [encoding unsignedIntegerValue]];
868 }
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
869 index = counter++;
870 }
871
872 if(index != NSNotFound)
873 {
874 self.encodingSelection = index;
875 }
876
438d319 Updated XADMaster encoding delegate method and in the process fixed a…
Alexander Rauchfuss authored Jul 8, 2009
877 encodingTestData = data;
878
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
879 [self testEncoding: self];
880 guess = NSNotFound;
881 if([NSApp runModalForWindow: encodingPanel] != NSCancelButton)
882 {
438d319 Updated XADMaster encoding delegate method and in the process fixed a…
Alexander Rauchfuss authored Jul 8, 2009
883 guess = [[[encodingMenu itemAtIndex: encodingSelection] representedObject] unsignedIntegerValue];
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
884 }
885 [encodingPanel close];
886 [archive setNameEncoding: guess];
887 }
888
438d319 Updated XADMaster encoding delegate method and in the process fixed a…
Alexander Rauchfuss authored Jul 8, 2009
889 [testText release];
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
890 return guess;
891 }
892
893
894
895 - (IBAction)testEncoding:(id)sender
896 {
631ca00 Added page capture feature as well as changing the icon selection int…
Alexander Rauchfuss authored Jul 3, 2009
897 NSMenuItem * encodingMenuItem = [[encodingPopup menu] itemAtIndex: encodingSelection];
438d319 Updated XADMaster encoding delegate method and in the process fixed a…
Alexander Rauchfuss authored Jul 8, 2009
898 NSString * testText = [[NSString alloc] initWithData: encodingTestData encoding: [[encodingMenuItem representedObject] unsignedIntegerValue]];
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
899
900 if(!testText)
901 {
902 testText = @"invalid Selection";
903 }
904
905 [encodingTestField setStringValue: testText];
438d319 Updated XADMaster encoding delegate method and in the process fixed a…
Alexander Rauchfuss authored Jul 8, 2009
906 [testText release];
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
907 }
908
909
910
911 - (IBAction)actionStub:(id)sender
912 {
913
914 }
915
916
bfdcafe Fixed problem with the fullscreen bezel resizing also made the fullsc…
Alexander Rauchfuss authored Nov 26, 2009
917 - (IBAction)endLaunchPanel:(id)sender
918 {
919 [launchPanel close];
920 }
921
7cfcc8b Complete project import to GitHub
Alexander Rauchfuss authored Jun 20, 2009
922
923 @end
924
925
Something went wrong with that request. Please try again.