From 870e1ffad5b08372c248964d31ea6ddc767b3f7b Mon Sep 17 00:00:00 2001 From: Sascha Schwabbauer Date: Wed, 3 Dec 2014 17:28:01 +0100 Subject: [PATCH 01/10] 10.10 and Xcode 6.1.1 (6A2008a) support --- Lin.xcodeproj/project.pbxproj | 4 +++- .../xcshareddata/xcschemes/Lin.xcscheme | 11 ++++++++++- .../xcshareddata/xcschemes/LinTests.xcscheme | 11 ++++++++++- Lin/LNPopoverWindowController.h | 2 -- Lin/LNPopoverWindowController.m | 18 ------------------ Lin/Lin-Info.plist | 4 +--- Lin/NSPopoverFrame+Lin.m | 2 +- 7 files changed, 25 insertions(+), 27 deletions(-) diff --git a/Lin.xcodeproj/project.pbxproj b/Lin.xcodeproj/project.pbxproj index 34b6ce0..cac9355 100644 --- a/Lin.xcodeproj/project.pbxproj +++ b/Lin.xcodeproj/project.pbxproj @@ -470,7 +470,7 @@ AA1B7D9B17C3C1EC00A3A6D7 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0500; + LastUpgradeCheck = 0610; ORGANIZATIONNAME = "Tanaka Katsuma"; TargetAttributes = { AA470D6217C3D380005CBB7F = { @@ -717,6 +717,7 @@ AA470D7217C3D380005CBB7F /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + COMBINE_HIDPI_IMAGES = YES; FRAMEWORK_SEARCH_PATHS = ( "$(DEVELOPER_FRAMEWORKS_DIR)", "$(inherited)", @@ -736,6 +737,7 @@ AA470D7317C3D380005CBB7F /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + COMBINE_HIDPI_IMAGES = YES; FRAMEWORK_SEARCH_PATHS = ( "$(DEVELOPER_FRAMEWORKS_DIR)", "$(inherited)", diff --git a/Lin.xcodeproj/xcshareddata/xcschemes/Lin.xcscheme b/Lin.xcodeproj/xcshareddata/xcschemes/Lin.xcscheme index ca24f78..00e2fe5 100644 --- a/Lin.xcodeproj/xcshareddata/xcschemes/Lin.xcscheme +++ b/Lin.xcodeproj/xcshareddata/xcschemes/Lin.xcscheme @@ -1,6 +1,6 @@ + + + + + + + + diff --git a/Lin/LNPopoverWindowController.h b/Lin/LNPopoverWindowController.h index 55357c1..bb0188d 100644 --- a/Lin/LNPopoverWindowController.h +++ b/Lin/LNPopoverWindowController.h @@ -14,8 +14,6 @@ extern NSString * const LNPopoverWindowControllerWindowWillCloseNotification; @interface LNPopoverWindowController : NSWindowController -@property (nonatomic, strong) NSViewController *contentViewController; - - (instancetype)initWithContentViewController:(NSViewController *)contentViewController; @end diff --git a/Lin/LNPopoverWindowController.m b/Lin/LNPopoverWindowController.m index 996c872..50b22dc 100644 --- a/Lin/LNPopoverWindowController.m +++ b/Lin/LNPopoverWindowController.m @@ -30,24 +30,6 @@ - (instancetype)initWithContentViewController:(NSViewController *)contentViewCon } -#pragma mark - Accessors - -- (void)setContentViewController:(NSViewController *)contentViewController -{ - // Remove previous content view - if (self.contentViewController) { - [self.contentViewController.view removeFromSuperview]; - } - - _contentViewController = contentViewController; - - // Set content view of the window - self.contentViewController.view.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable; - [self.window.contentView setFrame:self.contentViewController.view.bounds]; - [self.window.contentView addSubview:self.contentViewController.view]; -} - - #pragma mark - NSWindowDelegate - (void)windowWillClose:(NSNotification *)notification diff --git a/Lin/Lin-Info.plist b/Lin/Lin-Info.plist index c105d9a..efc6362 100644 --- a/Lin/Lin-Info.plist +++ b/Lin/Lin-Info.plist @@ -24,9 +24,7 @@ 1 DVTPlugInCompatibilityUUIDs - 37B30044-3B14-46BA-ABAA-F01000C27B63 - 640F884E-CE55-4B40-87C0-8869546CAB7A - A2E4D43F-41F4-4FB9-BB94-7177011C9AED + C4A681B0-4A26-480E-93EC-1218098B9AA0 LSApplicationCategoryType diff --git a/Lin/NSPopoverFrame+Lin.m b/Lin/NSPopoverFrame+Lin.m index ee02480..eb501de 100644 --- a/Lin/NSPopoverFrame+Lin.m +++ b/Lin/NSPopoverFrame+Lin.m @@ -15,7 +15,7 @@ @implementation NSPopoverFrame (Lin) + (void)load { - MethodSwizzle(self, @selector(_drawMinimalPopoverAppearanceInRect:anchorEdge:anchorPoint:), @selector(jp_questbeat_lin_drawMinimalPopoverAppearanceInRect:anchorEdge:anchorPoint:)); +// MethodSwizzle(self, @selector(_drawMinimalPopoverAppearanceInRect:anchorEdge:anchorPoint:), @selector(jp_questbeat_lin_drawMinimalPopoverAppearanceInRect:anchorEdge:anchorPoint:)); } - (void)jp_questbeat_lin_drawMinimalPopoverAppearanceInRect:(struct CGRect)arg1 anchorEdge:(unsigned long long)arg2 anchorPoint:(struct CGPoint)arg3 From 8eb9faa85898e598dc9aea226fe623c462744347 Mon Sep 17 00:00:00 2001 From: Sascha Schwabbauer Date: Wed, 3 Dec 2014 23:27:10 +0100 Subject: [PATCH 02/10] Refactoring, Yosemite, Xcode 6, etc. --- Lin.xcodeproj/project.pbxproj | 234 ++++++------------ .../xcshareddata/xcschemes/Lin.xcscheme | 3 +- Lin/{ => Categories}/IDEIndex+Lin.h | 0 Lin/Categories/IDEIndex+Lin.m | 27 ++ .../NSTableView+EditedColumnIdentifier.h | 15 ++ .../NSTableView+EditedColumnIdentifier.m} | 11 +- Lin/IDEIndex+Lin.m | 28 --- Lin/IDEWorkspaceWindow.h | 13 - Lin/LNButtonCell.h | 13 - Lin/LNButtonCell.m | 21 -- Lin/LNImageButtonCell.h | 13 - Lin/LNImageButtonCell.m | 21 -- Lin/LNTableCornerView.h | 13 - Lin/LNTableCornerView.m | 27 -- Lin/LNTableHeaderCell.h | 17 -- Lin/LNTableHeaderCell.m | 147 ----------- Lin/LNTableView.h | 13 - Lin/LNTableView.m | 38 --- Lin/Lin.m | 197 ++++++--------- Lin/MethodSwizzle.h | 11 - Lin/MethodSwizzle.m | 23 -- Lin/{ => Models}/LNDetector.h | 0 Lin/{ => Models}/LNDetector.m | 0 Lin/{ => Models}/LNEntity.h | 2 +- Lin/{ => Models}/LNEntity.m | 0 Lin/{ => Models}/LNLocalization.h | 2 +- Lin/{ => Models}/LNLocalization.m | 0 Lin/{ => Models}/LNLocalizationCollection.h | 4 +- Lin/{ => Models}/LNLocalizationCollection.m | 2 +- .../LNRegularExpressionPattern+type.h | 0 .../LNRegularExpressionPattern+type.m | 0 Lin/{ => Models}/LNRegularExpressionPattern.h | 2 +- Lin/{ => Models}/LNRegularExpressionPattern.m | 0 Lin/NSBundle+versions.h | 16 -- Lin/NSBundle+versions.m | 23 -- Lin/NSPopoverFrame+Lin.h | 13 - Lin/NSPopoverFrame+Lin.m | 89 ------- Lin/NSPopoverFrame.h | 20 -- Lin/NSTableView+editedColumnIdentifier.h | 15 -- .../icon120.imageset/Contents.json | 22 ++ .../icon120.imageset}/icon120.png | Bin .../icon120.imageset}/icon120@2x.png | Bin .../icon_detach.imageset/Contents.json | 22 ++ .../icon_detach.imageset}/icon_detach.png | Bin .../icon_detach.imageset}/icon_detach@2x.png | Bin .../icon_minus.imageset/Contents.json | 22 ++ .../icon_minus.imageset}/icon_minus.png | Bin .../icon_minus.imageset}/icon_minus@2x.png | Bin .../icon_plus.imageset/Contents.json | 22 ++ .../icon_plus.imageset}/icon_plus.png | Bin .../icon_plus.imageset}/icon_plus@2x.png | Bin .../XIBs}/LNAlertAccessoryView.xib | 0 .../XIBs/MainViewController.xib} | 79 +++--- .../LNLocalizedStringCollectionOperation.h | 2 +- .../LNLocalizedStringCollectionOperation.m | 0 Lin/{ => Shared}/LNUserDefaultsManager.h | 0 Lin/{ => Shared}/LNUserDefaultsManager.m | 0 Lin/{ => Supporting Files}/Lin-Info.plist | 8 +- Lin/{ => Supporting Files}/Lin-Prefix.pch | 0 .../en.lproj/InfoPlist.strings | 0 .../MainViewController.h} | 8 +- .../MainViewController.m} | 80 +++--- Lin/{ => Views}/LNAlertAccessoryView.h | 0 Lin/{ => Views}/LNAlertAccessoryView.m | 0 Lin/{ => Views}/LNHorizontalLine.h | 0 Lin/{ => Views}/LNHorizontalLine.m | 0 Lin/{ => Views}/LNPopoverWindow.h | 0 Lin/{ => Views}/LNPopoverWindow.m | 8 +- .../LNPopoverWindowController.h | 2 +- .../LNPopoverWindowController.m | 19 +- Lin/{ => Xcode-Private-Classes}/DVTFilePath.h | 0 .../DVTSourceTextView.h | 0 .../IDEEditorDocument.h | 0 Lin/{ => Xcode-Private-Classes}/IDEIndex.h | 0 .../IDEIndexCollection.h | 0 .../IDEWorkspace.h | 0 .../IDEWorkspaceWindow.h} | 4 +- LinTests/LNDetectorTestSet.h | 2 +- 78 files changed, 400 insertions(+), 973 deletions(-) rename Lin/{ => Categories}/IDEIndex+Lin.h (100%) create mode 100644 Lin/Categories/IDEIndex+Lin.m create mode 100644 Lin/Categories/NSTableView+EditedColumnIdentifier.h rename Lin/{NSTableView+editedColumnIdentifier.m => Categories/NSTableView+EditedColumnIdentifier.m} (63%) delete mode 100644 Lin/IDEIndex+Lin.m delete mode 100644 Lin/IDEWorkspaceWindow.h delete mode 100644 Lin/LNButtonCell.h delete mode 100644 Lin/LNButtonCell.m delete mode 100644 Lin/LNImageButtonCell.h delete mode 100644 Lin/LNImageButtonCell.m delete mode 100644 Lin/LNTableCornerView.h delete mode 100644 Lin/LNTableCornerView.m delete mode 100644 Lin/LNTableHeaderCell.h delete mode 100644 Lin/LNTableHeaderCell.m delete mode 100644 Lin/LNTableView.h delete mode 100644 Lin/LNTableView.m delete mode 100644 Lin/MethodSwizzle.h delete mode 100644 Lin/MethodSwizzle.m rename Lin/{ => Models}/LNDetector.h (100%) rename Lin/{ => Models}/LNDetector.m (100%) rename Lin/{ => Models}/LNEntity.h (95%) rename Lin/{ => Models}/LNEntity.m (100%) rename Lin/{ => Models}/LNLocalization.h (95%) rename Lin/{ => Models}/LNLocalization.m (100%) rename Lin/{ => Models}/LNLocalizationCollection.h (84%) rename Lin/{ => Models}/LNLocalizationCollection.m (98%) rename Lin/{ => Models}/LNRegularExpressionPattern+type.h (100%) rename Lin/{ => Models}/LNRegularExpressionPattern+type.m (100%) rename Lin/{ => Models}/LNRegularExpressionPattern.h (91%) rename Lin/{ => Models}/LNRegularExpressionPattern.m (100%) delete mode 100644 Lin/NSBundle+versions.h delete mode 100644 Lin/NSBundle+versions.m delete mode 100644 Lin/NSPopoverFrame+Lin.h delete mode 100644 Lin/NSPopoverFrame+Lin.m delete mode 100644 Lin/NSPopoverFrame.h delete mode 100644 Lin/NSTableView+editedColumnIdentifier.h create mode 100644 Lin/Resources/Media.xcassets/icon120.imageset/Contents.json rename Lin/{ => Resources/Media.xcassets/icon120.imageset}/icon120.png (100%) rename Lin/{ => Resources/Media.xcassets/icon120.imageset}/icon120@2x.png (100%) create mode 100644 Lin/Resources/Media.xcassets/icon_detach.imageset/Contents.json rename Lin/{ => Resources/Media.xcassets/icon_detach.imageset}/icon_detach.png (100%) rename Lin/{ => Resources/Media.xcassets/icon_detach.imageset}/icon_detach@2x.png (100%) create mode 100644 Lin/Resources/Media.xcassets/icon_minus.imageset/Contents.json rename Lin/{ => Resources/Media.xcassets/icon_minus.imageset}/icon_minus.png (100%) rename Lin/{ => Resources/Media.xcassets/icon_minus.imageset}/icon_minus@2x.png (100%) create mode 100644 Lin/Resources/Media.xcassets/icon_plus.imageset/Contents.json rename Lin/{ => Resources/Media.xcassets/icon_plus.imageset}/icon_plus.png (100%) rename Lin/{ => Resources/Media.xcassets/icon_plus.imageset}/icon_plus@2x.png (100%) rename Lin/{ => Resources/XIBs}/LNAlertAccessoryView.xib (100%) rename Lin/{LNPopoverContentView.xib => Resources/XIBs/MainViewController.xib} (83%) rename Lin/{ => Shared}/LNLocalizedStringCollectionOperation.h (87%) rename Lin/{ => Shared}/LNLocalizedStringCollectionOperation.m (100%) rename Lin/{ => Shared}/LNUserDefaultsManager.h (100%) rename Lin/{ => Shared}/LNUserDefaultsManager.m (100%) rename Lin/{ => Supporting Files}/Lin-Info.plist (84%) rename Lin/{ => Supporting Files}/Lin-Prefix.pch (100%) rename Lin/{ => Supporting Files}/en.lproj/InfoPlist.strings (100%) rename Lin/{LNPopoverContentView.h => View Controllers/MainViewController.h} (72%) rename Lin/{LNPopoverContentView.m => View Controllers/MainViewController.m} (81%) rename Lin/{ => Views}/LNAlertAccessoryView.h (100%) rename Lin/{ => Views}/LNAlertAccessoryView.m (100%) rename Lin/{ => Views}/LNHorizontalLine.h (100%) rename Lin/{ => Views}/LNHorizontalLine.m (100%) rename Lin/{ => Views}/LNPopoverWindow.h (100%) rename Lin/{ => Views}/LNPopoverWindow.m (93%) rename Lin/{ => Window Controllers}/LNPopoverWindowController.h (90%) rename Lin/{ => Window Controllers}/LNPopoverWindowController.m (69%) rename Lin/{ => Xcode-Private-Classes}/DVTFilePath.h (100%) rename Lin/{ => Xcode-Private-Classes}/DVTSourceTextView.h (100%) rename Lin/{ => Xcode-Private-Classes}/IDEEditorDocument.h (100%) rename Lin/{ => Xcode-Private-Classes}/IDEIndex.h (100%) rename Lin/{ => Xcode-Private-Classes}/IDEIndexCollection.h (100%) rename Lin/{ => Xcode-Private-Classes}/IDEWorkspace.h (100%) rename Lin/{DVTDualProxyWindow.h => Xcode-Private-Classes/IDEWorkspaceWindow.h} (71%) diff --git a/Lin.xcodeproj/project.pbxproj b/Lin.xcodeproj/project.pbxproj index cac9355..48bc34e 100644 --- a/Lin.xcodeproj/project.pbxproj +++ b/Lin.xcodeproj/project.pbxproj @@ -7,14 +7,14 @@ objects = { /* Begin PBXBuildFile section */ + 2B2FEC9B1A2F894500D0534D /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2B2FEC9A1A2F894500D0534D /* MainViewController.m */; }; + 2BC7C6A51A2FC3C60065C278 /* Media.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2BC7C6A41A2FC3C60065C278 /* Media.xcassets */; }; + 2BC7C6A81A2FC4690065C278 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 2BC7C6AA1A2FC4690065C278 /* InfoPlist.strings */; }; AA02CE8B17EE08240041C2BD /* LNAlertAccessoryView.xib in Resources */ = {isa = PBXBuildFile; fileRef = AA02CE8A17EE08240041C2BD /* LNAlertAccessoryView.xib */; }; AA02CE8E17EE083A0041C2BD /* LNAlertAccessoryView.m in Sources */ = {isa = PBXBuildFile; fileRef = AA02CE8D17EE083A0041C2BD /* LNAlertAccessoryView.m */; }; AA1B7DA717C3C1EC00A3A6D7 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AA1B7DA617C3C1EC00A3A6D7 /* Cocoa.framework */; }; - AA1B7DB117C3C1EC00A3A6D7 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = AA1B7DAF17C3C1EC00A3A6D7 /* InfoPlist.strings */; }; AA1B7DBA17C3C20F00A3A6D7 /* Lin.m in Sources */ = {isa = PBXBuildFile; fileRef = AA1B7DB917C3C20F00A3A6D7 /* Lin.m */; }; - AA20D87F17ECB12A006B7CA2 /* NSPopoverFrame+Lin.m in Sources */ = {isa = PBXBuildFile; fileRef = AA20D87E17ECB12A006B7CA2 /* NSPopoverFrame+Lin.m */; }; AA2980B417EE2C5300CF46E3 /* LNUserDefaultsManager.m in Sources */ = {isa = PBXBuildFile; fileRef = AA2980B317EE2C5300CF46E3 /* LNUserDefaultsManager.m */; }; - AA36376617D9EF9E003C5E55 /* LNPopoverContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = AA36376517D9EF9E003C5E55 /* LNPopoverContentView.m */; }; AA3EC36F17EB2A290003A180 /* DVTFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AA3EC36D17EB2A290003A180 /* DVTFoundation.framework */; }; AA3EC37017EB2A290003A180 /* DVTKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AA3EC36E17EB2A290003A180 /* DVTKit.framework */; }; AA3EC37317EB2A380003A180 /* IDEFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AA3EC37117EB2A380003A180 /* IDEFoundation.framework */; }; @@ -24,19 +24,10 @@ AA470D6517C3D380005CBB7F /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AA470D6417C3D380005CBB7F /* XCTest.framework */; }; AA470D6B17C3D380005CBB7F /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = AA470D6917C3D380005CBB7F /* InfoPlist.strings */; }; AA470D7D17C3DE31005CBB7F /* LNDetectorTests.m in Sources */ = {isa = PBXBuildFile; fileRef = AA470D7C17C3DE31005CBB7F /* LNDetectorTests.m */; }; - AA6377CE18C5CCFC005EADC7 /* LNImageButtonCell.m in Sources */ = {isa = PBXBuildFile; fileRef = AA6377CD18C5CCFC005EADC7 /* LNImageButtonCell.m */; }; - AA63897918C6019A0061C2C4 /* icon_plus@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = AA63897118C6019A0061C2C4 /* icon_plus@2x.png */; }; - AA63897A18C6019A0061C2C4 /* icon_minus.png in Resources */ = {isa = PBXBuildFile; fileRef = AA63897218C6019A0061C2C4 /* icon_minus.png */; }; - AA63897B18C6019A0061C2C4 /* icon_minus@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = AA63897318C6019A0061C2C4 /* icon_minus@2x.png */; }; - AA63897C18C6019A0061C2C4 /* icon120.png in Resources */ = {isa = PBXBuildFile; fileRef = AA63897418C6019A0061C2C4 /* icon120.png */; }; - AA63897D18C6019A0061C2C4 /* icon_plus.png in Resources */ = {isa = PBXBuildFile; fileRef = AA63897518C6019A0061C2C4 /* icon_plus.png */; }; - AA63897E18C6019A0061C2C4 /* icon_detach@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = AA63897618C6019A0061C2C4 /* icon_detach@2x.png */; }; - AA63897F18C6019A0061C2C4 /* icon120@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = AA63897718C6019A0061C2C4 /* icon120@2x.png */; }; - AA63898018C6019A0061C2C4 /* icon_detach.png in Resources */ = {isa = PBXBuildFile; fileRef = AA63897818C6019A0061C2C4 /* icon_detach.png */; }; AA7D4DB117C74CFE0092DF8A /* LNLocalizationCollection.m in Sources */ = {isa = PBXBuildFile; fileRef = AA7D4DB017C74CFE0092DF8A /* LNLocalizationCollection.m */; }; AA7D4DB417C74D0A0092DF8A /* LNLocalization.m in Sources */ = {isa = PBXBuildFile; fileRef = AA7D4DB317C74D0A0092DF8A /* LNLocalization.m */; }; - AA8F8EF017EDFC68004964FB /* NSTableView+editedColumnIdentifier.m in Sources */ = {isa = PBXBuildFile; fileRef = AA8F8EEF17EDFC68004964FB /* NSTableView+editedColumnIdentifier.m */; }; - AA95FDEC17EB48A9007D33D4 /* LNPopoverContentView.xib in Resources */ = {isa = PBXBuildFile; fileRef = AA95FDEB17EB48A9007D33D4 /* LNPopoverContentView.xib */; }; + AA8F8EF017EDFC68004964FB /* NSTableView+EditedColumnIdentifier.m in Sources */ = {isa = PBXBuildFile; fileRef = AA8F8EEF17EDFC68004964FB /* NSTableView+EditedColumnIdentifier.m */; }; + AA95FDEC17EB48A9007D33D4 /* MainViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = AA95FDEB17EB48A9007D33D4 /* MainViewController.xib */; }; AA95FDEF17EB4E77007D33D4 /* LNPopoverWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = AA95FDEE17EB4E77007D33D4 /* LNPopoverWindowController.m */; }; AAAC873317ED9D4F00BF251D /* LNHorizontalLine.m in Sources */ = {isa = PBXBuildFile; fileRef = AAAC873217ED9D4F00BF251D /* LNHorizontalLine.m */; }; AAAC873B17EDA9CF00BF251D /* LNPopoverWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = AAAC873A17EDA9CF00BF251D /* LNPopoverWindow.m */; }; @@ -47,15 +38,9 @@ AAB0CD3817C46B070085E913 /* LNRegularExpressionPattern.m in Sources */ = {isa = PBXBuildFile; fileRef = AAB0CD3017C4382D0085E913 /* LNRegularExpressionPattern.m */; }; AAB0CD3917C46B070085E913 /* LNRegularExpressionPattern+type.m in Sources */ = {isa = PBXBuildFile; fileRef = AAB0CD3317C448200085E913 /* LNRegularExpressionPattern+type.m */; }; AAB0CD3C17C477030085E913 /* LNDetectorTestSet.m in Sources */ = {isa = PBXBuildFile; fileRef = AAB0CD3B17C477030085E913 /* LNDetectorTestSet.m */; }; - AADDDA9417C49D4800BBA67C /* NSBundle+versions.m in Sources */ = {isa = PBXBuildFile; fileRef = AADDDA9317C49D4800BBA67C /* NSBundle+versions.m */; }; AADEADB317C7B6D3001E0C65 /* LNLocalizationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = AADEADB217C7B6D3001E0C65 /* LNLocalizationTests.m */; }; AADEADB417C7B838001E0C65 /* LNLocalization.m in Sources */ = {isa = PBXBuildFile; fileRef = AA7D4DB317C74D0A0092DF8A /* LNLocalization.m */; }; AADEADB717C87298001E0C65 /* IDEIndex+Lin.m in Sources */ = {isa = PBXBuildFile; fileRef = AADEADB617C87298001E0C65 /* IDEIndex+Lin.m */; }; - AADEADC017C87392001E0C65 /* MethodSwizzle.m in Sources */ = {isa = PBXBuildFile; fileRef = AADEADBF17C87392001E0C65 /* MethodSwizzle.m */; }; - AAF0D6AB17ECB87100B4318B /* LNTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = AAF0D6AA17ECB87100B4318B /* LNTableView.m */; }; - AAF0D6AE17ECB89800B4318B /* LNTableHeaderCell.m in Sources */ = {isa = PBXBuildFile; fileRef = AAF0D6AD17ECB89800B4318B /* LNTableHeaderCell.m */; }; - AAF0D6B117ECC4AF00B4318B /* LNTableCornerView.m in Sources */ = {isa = PBXBuildFile; fileRef = AAF0D6B017ECC4AF00B4318B /* LNTableCornerView.m */; }; - AAF0D6B417ECD8EC00B4318B /* LNButtonCell.m in Sources */ = {isa = PBXBuildFile; fileRef = AAF0D6B317ECD8EC00B4318B /* LNButtonCell.m */; }; AAFE3C3F17EECF4A0018E478 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = AAFE3C3E17EECF4A0018E478 /* Localizable.strings */; }; AAFE3C4117EED36C0018E478 /* LNLocalizationCollection.m in Sources */ = {isa = PBXBuildFile; fileRef = AA7D4DB017C74CFE0092DF8A /* LNLocalizationCollection.m */; }; F5859DBD18CABC2A009AF108 /* LNLocalizedStringCollectionOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = F5859DBC18CABC2A009AF108 /* LNLocalizedStringCollectionOperation.m */; }; @@ -72,6 +57,10 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 2B2FEC991A2F894500D0534D /* MainViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainViewController.h; sourceTree = ""; }; + 2B2FEC9A1A2F894500D0534D /* MainViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainViewController.m; sourceTree = ""; }; + 2BC7C6A41A2FC3C60065C278 /* Media.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Media.xcassets; sourceTree = ""; }; + 2BC7C6A91A2FC4690065C278 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; AA02CE8A17EE08240041C2BD /* LNAlertAccessoryView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = LNAlertAccessoryView.xib; sourceTree = ""; }; AA02CE8C17EE083A0041C2BD /* LNAlertAccessoryView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LNAlertAccessoryView.h; sourceTree = ""; }; AA02CE8D17EE083A0041C2BD /* LNAlertAccessoryView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LNAlertAccessoryView.m; sourceTree = ""; }; @@ -84,17 +73,11 @@ AA1B7DAA17C3C1EC00A3A6D7 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; AA1B7DAB17C3C1EC00A3A6D7 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; AA1B7DAE17C3C1EC00A3A6D7 /* Lin-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Lin-Info.plist"; sourceTree = ""; }; - AA1B7DB017C3C1EC00A3A6D7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; AA1B7DB217C3C1EC00A3A6D7 /* Lin-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Lin-Prefix.pch"; sourceTree = ""; }; AA1B7DB817C3C20F00A3A6D7 /* Lin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Lin.h; sourceTree = ""; }; AA1B7DB917C3C20F00A3A6D7 /* Lin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Lin.m; sourceTree = ""; }; - AA20D87D17ECB12A006B7CA2 /* NSPopoverFrame+Lin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSPopoverFrame+Lin.h"; sourceTree = ""; }; - AA20D87E17ECB12A006B7CA2 /* NSPopoverFrame+Lin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSPopoverFrame+Lin.m"; sourceTree = ""; }; - AA20D88017ECB1AD006B7CA2 /* NSPopoverFrame.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NSPopoverFrame.h; sourceTree = ""; }; AA2980B217EE2C5300CF46E3 /* LNUserDefaultsManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LNUserDefaultsManager.h; sourceTree = ""; }; AA2980B317EE2C5300CF46E3 /* LNUserDefaultsManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LNUserDefaultsManager.m; sourceTree = ""; }; - AA36376417D9EF9E003C5E55 /* LNPopoverContentView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LNPopoverContentView.h; sourceTree = ""; }; - AA36376517D9EF9E003C5E55 /* LNPopoverContentView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LNPopoverContentView.m; sourceTree = ""; }; AA3EC36D17EB2A290003A180 /* DVTFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DVTFoundation.framework; path = ../../../../Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework; sourceTree = ""; }; AA3EC36E17EB2A290003A180 /* DVTKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DVTKit.framework; path = ../../../../Applications/Xcode.app/Contents/SharedFrameworks/DVTKit.framework; sourceTree = ""; }; AA3EC37117EB2A380003A180 /* IDEFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IDEFoundation.framework; path = ../../../../Applications/Xcode.app/Contents/Frameworks/IDEFoundation.framework; sourceTree = ""; }; @@ -109,27 +92,16 @@ AA470D6A17C3D380005CBB7F /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; AA470D6E17C3D380005CBB7F /* LinTests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "LinTests-Prefix.pch"; sourceTree = ""; }; AA470D7C17C3DE31005CBB7F /* LNDetectorTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LNDetectorTests.m; sourceTree = ""; }; - AA6377CC18C5CCFC005EADC7 /* LNImageButtonCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LNImageButtonCell.h; sourceTree = ""; }; - AA6377CD18C5CCFC005EADC7 /* LNImageButtonCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LNImageButtonCell.m; sourceTree = ""; }; - AA63897118C6019A0061C2C4 /* icon_plus@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon_plus@2x.png"; sourceTree = ""; }; - AA63897218C6019A0061C2C4 /* icon_minus.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon_minus.png; sourceTree = ""; }; - AA63897318C6019A0061C2C4 /* icon_minus@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon_minus@2x.png"; sourceTree = ""; }; - AA63897418C6019A0061C2C4 /* icon120.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon120.png; sourceTree = ""; }; - AA63897518C6019A0061C2C4 /* icon_plus.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon_plus.png; sourceTree = ""; }; - AA63897618C6019A0061C2C4 /* icon_detach@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon_detach@2x.png"; sourceTree = ""; }; - AA63897718C6019A0061C2C4 /* icon120@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon120@2x.png"; sourceTree = ""; }; - AA63897818C6019A0061C2C4 /* icon_detach.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon_detach.png; sourceTree = ""; }; - AA7B0CAD17F4228E0004FE3B /* DVTDualProxyWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVTDualProxyWindow.h; sourceTree = ""; }; AA7B0CB017F4229D0004FE3B /* IDEWorkspaceWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDEWorkspaceWindow.h; sourceTree = ""; }; AA7B0CB317F422BB0004FE3B /* DVTSourceTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVTSourceTextView.h; sourceTree = ""; }; AA7D4DAF17C74CFE0092DF8A /* LNLocalizationCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LNLocalizationCollection.h; sourceTree = ""; }; AA7D4DB017C74CFE0092DF8A /* LNLocalizationCollection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LNLocalizationCollection.m; sourceTree = ""; }; AA7D4DB217C74D0A0092DF8A /* LNLocalization.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LNLocalization.h; sourceTree = ""; }; AA7D4DB317C74D0A0092DF8A /* LNLocalization.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LNLocalization.m; sourceTree = ""; }; - AA8F8EEE17EDFC68004964FB /* NSTableView+editedColumnIdentifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSTableView+editedColumnIdentifier.h"; sourceTree = ""; }; - AA8F8EEF17EDFC68004964FB /* NSTableView+editedColumnIdentifier.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSTableView+editedColumnIdentifier.m"; sourceTree = ""; }; + AA8F8EEE17EDFC68004964FB /* NSTableView+EditedColumnIdentifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSTableView+EditedColumnIdentifier.h"; sourceTree = ""; }; + AA8F8EEF17EDFC68004964FB /* NSTableView+EditedColumnIdentifier.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSTableView+EditedColumnIdentifier.m"; sourceTree = ""; }; AA93691517C4E4C000E94318 /* IDEWorkspace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDEWorkspace.h; sourceTree = ""; }; - AA95FDEB17EB48A9007D33D4 /* LNPopoverContentView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = LNPopoverContentView.xib; sourceTree = ""; }; + AA95FDEB17EB48A9007D33D4 /* MainViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MainViewController.xib; sourceTree = ""; }; AA95FDED17EB4E77007D33D4 /* LNPopoverWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LNPopoverWindowController.h; sourceTree = ""; }; AA95FDEE17EB4E77007D33D4 /* LNPopoverWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LNPopoverWindowController.m; sourceTree = ""; }; AAAC873117ED9D4F00BF251D /* LNHorizontalLine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LNHorizontalLine.h; sourceTree = ""; }; @@ -142,22 +114,10 @@ AAB0CD3317C448200085E913 /* LNRegularExpressionPattern+type.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "LNRegularExpressionPattern+type.m"; sourceTree = ""; }; AAB0CD3A17C477030085E913 /* LNDetectorTestSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LNDetectorTestSet.h; sourceTree = ""; }; AAB0CD3B17C477030085E913 /* LNDetectorTestSet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LNDetectorTestSet.m; sourceTree = ""; }; - AADDDA9217C49D4800BBA67C /* NSBundle+versions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSBundle+versions.h"; sourceTree = ""; }; - AADDDA9317C49D4800BBA67C /* NSBundle+versions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSBundle+versions.m"; sourceTree = ""; }; AADEADB217C7B6D3001E0C65 /* LNLocalizationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LNLocalizationTests.m; sourceTree = ""; }; AADEADB517C87298001E0C65 /* IDEIndex+Lin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "IDEIndex+Lin.h"; sourceTree = ""; }; AADEADB617C87298001E0C65 /* IDEIndex+Lin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "IDEIndex+Lin.m"; sourceTree = ""; }; AADEADBB17C872EB001E0C65 /* IDEEditorDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDEEditorDocument.h; sourceTree = ""; }; - AADEADBE17C87392001E0C65 /* MethodSwizzle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MethodSwizzle.h; sourceTree = ""; }; - AADEADBF17C87392001E0C65 /* MethodSwizzle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MethodSwizzle.m; sourceTree = ""; }; - AAF0D6A917ECB87100B4318B /* LNTableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LNTableView.h; sourceTree = ""; }; - AAF0D6AA17ECB87100B4318B /* LNTableView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LNTableView.m; sourceTree = ""; }; - AAF0D6AC17ECB89800B4318B /* LNTableHeaderCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LNTableHeaderCell.h; sourceTree = ""; }; - AAF0D6AD17ECB89800B4318B /* LNTableHeaderCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LNTableHeaderCell.m; sourceTree = ""; }; - AAF0D6AF17ECC4AF00B4318B /* LNTableCornerView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LNTableCornerView.h; sourceTree = ""; }; - AAF0D6B017ECC4AF00B4318B /* LNTableCornerView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LNTableCornerView.m; sourceTree = ""; }; - AAF0D6B217ECD8EC00B4318B /* LNButtonCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LNButtonCell.h; sourceTree = ""; }; - AAF0D6B317ECD8EC00B4318B /* LNButtonCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LNButtonCell.m; sourceTree = ""; }; AAFE3C3E17EECF4A0018E478 /* Localizable.strings */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; path = Localizable.strings; sourceTree = ""; }; F5859DBB18CABC2A009AF108 /* LNLocalizedStringCollectionOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LNLocalizedStringCollectionOperation.h; sourceTree = ""; }; F5859DBC18CABC2A009AF108 /* LNLocalizedStringCollectionOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LNLocalizedStringCollectionOperation.m; sourceTree = ""; }; @@ -187,6 +147,24 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 2B2FEC981A2F890C00D0534D /* View Controllers */ = { + isa = PBXGroup; + children = ( + 2B2FEC991A2F894500D0534D /* MainViewController.h */, + 2B2FEC9A1A2F894500D0534D /* MainViewController.m */, + ); + path = "View Controllers"; + sourceTree = ""; + }; + 2BC7C6A31A2FC3A10065C278 /* XIBs */ = { + isa = PBXGroup; + children = ( + AA02CE8A17EE08240041C2BD /* LNAlertAccessoryView.xib */, + AA95FDEB17EB48A9007D33D4 /* MainViewController.xib */, + ); + path = XIBs; + sourceTree = ""; + }; AA1B7D9A17C3C1EC00A3A6D7 = { isa = PBXGroup; children = ( @@ -233,17 +211,17 @@ AA1B7DAC17C3C1EC00A3A6D7 /* Lin */ = { isa = PBXGroup; children = ( - AA93691817C4E4C700E94318 /* Xcode-Private-Classes */, - AA20D88117ECB467006B7CA2 /* AppKit-Private-Classes */, AADDDA9517C49D4D00BBA67C /* Categories */, - AA2980B517EE2CF600CF46E3 /* Shared */, - AA470D7817C3DD42005CBB7F /* Models */, - AADDDAA017C4A3BA00BBA67C /* Views */, - AADDDA9C17C4A0E200BBA67C /* Controllers */, AA1B7DB817C3C20F00A3A6D7 /* Lin.h */, AA1B7DB917C3C20F00A3A6D7 /* Lin.m */, + AA470D7817C3DD42005CBB7F /* Models */, AADDDA9B17C4A0DA00BBA67C /* Resources */, + AA2980B517EE2CF600CF46E3 /* Shared */, AA1B7DAD17C3C1EC00A3A6D7 /* Supporting Files */, + 2B2FEC981A2F890C00D0534D /* View Controllers */, + AADDDAA017C4A3BA00BBA67C /* Views */, + AADDDA9C17C4A0E200BBA67C /* Window Controllers */, + AA93691817C4E4C700E94318 /* Xcode-Private-Classes */, ); path = Lin; sourceTree = ""; @@ -251,30 +229,22 @@ AA1B7DAD17C3C1EC00A3A6D7 /* Supporting Files */ = { isa = PBXGroup; children = ( + 2BC7C6AA1A2FC4690065C278 /* InfoPlist.strings */, AA1B7DAE17C3C1EC00A3A6D7 /* Lin-Info.plist */, - AA1B7DAF17C3C1EC00A3A6D7 /* InfoPlist.strings */, AA1B7DB217C3C1EC00A3A6D7 /* Lin-Prefix.pch */, ); - name = "Supporting Files"; - sourceTree = ""; - }; - AA20D88117ECB467006B7CA2 /* AppKit-Private-Classes */ = { - isa = PBXGroup; - children = ( - AA20D88017ECB1AD006B7CA2 /* NSPopoverFrame.h */, - ); - name = "AppKit-Private-Classes"; + path = "Supporting Files"; sourceTree = ""; }; AA2980B517EE2CF600CF46E3 /* Shared */ = { isa = PBXGroup; children = ( - AA2980B217EE2C5300CF46E3 /* LNUserDefaultsManager.h */, - AA2980B317EE2C5300CF46E3 /* LNUserDefaultsManager.m */, F5859DBB18CABC2A009AF108 /* LNLocalizedStringCollectionOperation.h */, F5859DBC18CABC2A009AF108 /* LNLocalizedStringCollectionOperation.m */, + AA2980B217EE2C5300CF46E3 /* LNUserDefaultsManager.h */, + AA2980B317EE2C5300CF46E3 /* LNUserDefaultsManager.m */, ); - name = Shared; + path = Shared; sourceTree = ""; }; AA470D6617C3D380005CBB7F /* LinTests */ = { @@ -306,46 +276,30 @@ AA470D5A17C3CFEC005CBB7F /* LNDetector.m */, AA470D5C17C3D05D005CBB7F /* LNEntity.h */, AA470D5D17C3D05D005CBB7F /* LNEntity.m */, + AA7D4DB217C74D0A0092DF8A /* LNLocalization.h */, + AA7D4DB317C74D0A0092DF8A /* LNLocalization.m */, + AA7D4DAF17C74CFE0092DF8A /* LNLocalizationCollection.h */, + AA7D4DB017C74CFE0092DF8A /* LNLocalizationCollection.m */, AAB0CD2F17C4382D0085E913 /* LNRegularExpressionPattern.h */, AAB0CD3017C4382D0085E913 /* LNRegularExpressionPattern.m */, AAB0CD3217C448200085E913 /* LNRegularExpressionPattern+type.h */, AAB0CD3317C448200085E913 /* LNRegularExpressionPattern+type.m */, - AA7D4DAF17C74CFE0092DF8A /* LNLocalizationCollection.h */, - AA7D4DB017C74CFE0092DF8A /* LNLocalizationCollection.m */, - AA7D4DB217C74D0A0092DF8A /* LNLocalization.h */, - AA7D4DB317C74D0A0092DF8A /* LNLocalization.m */, ); - name = Models; - sourceTree = ""; - }; - AA63898118C6019F0061C2C4 /* Images */ = { - isa = PBXGroup; - children = ( - AA63897118C6019A0061C2C4 /* icon_plus@2x.png */, - AA63897518C6019A0061C2C4 /* icon_plus.png */, - AA63897218C6019A0061C2C4 /* icon_minus.png */, - AA63897318C6019A0061C2C4 /* icon_minus@2x.png */, - AA63897618C6019A0061C2C4 /* icon_detach@2x.png */, - AA63897818C6019A0061C2C4 /* icon_detach.png */, - AA63897718C6019A0061C2C4 /* icon120@2x.png */, - AA63897418C6019A0061C2C4 /* icon120.png */, - ); - name = Images; + path = Models; sourceTree = ""; }; AA93691817C4E4C700E94318 /* Xcode-Private-Classes */ = { isa = PBXGroup; children = ( - AA93691517C4E4C000E94318 /* IDEWorkspace.h */, AA11AC4017C66F0200889DFB /* DVTFilePath.h */, + AA7B0CB317F422BB0004FE3B /* DVTSourceTextView.h */, + AADEADBB17C872EB001E0C65 /* IDEEditorDocument.h */, AA11AC4317C6746800889DFB /* IDEIndex.h */, AA11AC4617C6755400889DFB /* IDEIndexCollection.h */, - AADEADBB17C872EB001E0C65 /* IDEEditorDocument.h */, - AA7B0CAD17F4228E0004FE3B /* DVTDualProxyWindow.h */, + AA93691517C4E4C000E94318 /* IDEWorkspace.h */, AA7B0CB017F4229D0004FE3B /* IDEWorkspaceWindow.h */, - AA7B0CB317F422BB0004FE3B /* DVTSourceTextView.h */, ); - name = "Xcode-Private-Classes"; + path = "Xcode-Private-Classes"; sourceTree = ""; }; AAB0CD3D17C478EF0085E913 /* Models */ = { @@ -360,62 +314,43 @@ AADDDA9517C49D4D00BBA67C /* Categories */ = { isa = PBXGroup; children = ( - AADEADBE17C87392001E0C65 /* MethodSwizzle.h */, - AADEADBF17C87392001E0C65 /* MethodSwizzle.m */, - AADDDA9217C49D4800BBA67C /* NSBundle+versions.h */, - AADDDA9317C49D4800BBA67C /* NSBundle+versions.m */, AADEADB517C87298001E0C65 /* IDEIndex+Lin.h */, AADEADB617C87298001E0C65 /* IDEIndex+Lin.m */, - AA20D87D17ECB12A006B7CA2 /* NSPopoverFrame+Lin.h */, - AA20D87E17ECB12A006B7CA2 /* NSPopoverFrame+Lin.m */, - AA8F8EEE17EDFC68004964FB /* NSTableView+editedColumnIdentifier.h */, - AA8F8EEF17EDFC68004964FB /* NSTableView+editedColumnIdentifier.m */, + AA8F8EEE17EDFC68004964FB /* NSTableView+EditedColumnIdentifier.h */, + AA8F8EEF17EDFC68004964FB /* NSTableView+EditedColumnIdentifier.m */, ); - name = Categories; + path = Categories; sourceTree = ""; }; AADDDA9B17C4A0DA00BBA67C /* Resources */ = { isa = PBXGroup; children = ( - AA95FDEB17EB48A9007D33D4 /* LNPopoverContentView.xib */, - AA02CE8A17EE08240041C2BD /* LNAlertAccessoryView.xib */, - AA63898118C6019F0061C2C4 /* Images */, + 2BC7C6A41A2FC3C60065C278 /* Media.xcassets */, + 2BC7C6A31A2FC3A10065C278 /* XIBs */, ); - name = Resources; + path = Resources; sourceTree = ""; }; - AADDDA9C17C4A0E200BBA67C /* Controllers */ = { + AADDDA9C17C4A0E200BBA67C /* Window Controllers */ = { isa = PBXGroup; children = ( AA95FDED17EB4E77007D33D4 /* LNPopoverWindowController.h */, AA95FDEE17EB4E77007D33D4 /* LNPopoverWindowController.m */, ); - name = Controllers; + path = "Window Controllers"; sourceTree = ""; }; AADDDAA017C4A3BA00BBA67C /* Views */ = { isa = PBXGroup; children = ( - AAAC873917EDA9CF00BF251D /* LNPopoverWindow.h */, - AAAC873A17EDA9CF00BF251D /* LNPopoverWindow.m */, - AA36376417D9EF9E003C5E55 /* LNPopoverContentView.h */, - AA36376517D9EF9E003C5E55 /* LNPopoverContentView.m */, - AAF0D6A917ECB87100B4318B /* LNTableView.h */, - AAF0D6AA17ECB87100B4318B /* LNTableView.m */, - AAF0D6AF17ECC4AF00B4318B /* LNTableCornerView.h */, - AAF0D6B017ECC4AF00B4318B /* LNTableCornerView.m */, - AAF0D6AC17ECB89800B4318B /* LNTableHeaderCell.h */, - AAF0D6AD17ECB89800B4318B /* LNTableHeaderCell.m */, - AAF0D6B217ECD8EC00B4318B /* LNButtonCell.h */, - AAF0D6B317ECD8EC00B4318B /* LNButtonCell.m */, - AAAC873117ED9D4F00BF251D /* LNHorizontalLine.h */, - AAAC873217ED9D4F00BF251D /* LNHorizontalLine.m */, AA02CE8C17EE083A0041C2BD /* LNAlertAccessoryView.h */, AA02CE8D17EE083A0041C2BD /* LNAlertAccessoryView.m */, - AA6377CC18C5CCFC005EADC7 /* LNImageButtonCell.h */, - AA6377CD18C5CCFC005EADC7 /* LNImageButtonCell.m */, + AAAC873117ED9D4F00BF251D /* LNHorizontalLine.h */, + AAAC873217ED9D4F00BF251D /* LNHorizontalLine.m */, + AAAC873917EDA9CF00BF251D /* LNPopoverWindow.h */, + AAAC873A17EDA9CF00BF251D /* LNPopoverWindow.m */, ); - name = Views; + path = Views; sourceTree = ""; }; AAFE3C4017EED0950018E478 /* Resources */ = { @@ -471,7 +406,7 @@ isa = PBXProject; attributes = { LastUpgradeCheck = 0610; - ORGANIZATIONNAME = "Tanaka Katsuma"; + ORGANIZATIONNAME = evolved.io; TargetAttributes = { AA470D6217C3D380005CBB7F = { TestTargetID = AA1B7DA217C3C1EC00A3A6D7; @@ -501,17 +436,10 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - AA63897B18C6019A0061C2C4 /* icon_minus@2x.png in Resources */, - AA63897F18C6019A0061C2C4 /* icon120@2x.png in Resources */, - AA63898018C6019A0061C2C4 /* icon_detach.png in Resources */, - AA63897A18C6019A0061C2C4 /* icon_minus.png in Resources */, - AA95FDEC17EB48A9007D33D4 /* LNPopoverContentView.xib in Resources */, - AA63897C18C6019A0061C2C4 /* icon120.png in Resources */, - AA63897D18C6019A0061C2C4 /* icon_plus.png in Resources */, - AA63897E18C6019A0061C2C4 /* icon_detach@2x.png in Resources */, - AA63897918C6019A0061C2C4 /* icon_plus@2x.png in Resources */, + AA95FDEC17EB48A9007D33D4 /* MainViewController.xib in Resources */, + 2BC7C6A81A2FC4690065C278 /* InfoPlist.strings in Resources */, AA02CE8B17EE08240041C2BD /* LNAlertAccessoryView.xib in Resources */, - AA1B7DB117C3C1EC00A3A6D7 /* InfoPlist.strings in Resources */, + 2BC7C6A51A2FC3C60065C278 /* Media.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -532,27 +460,19 @@ buildActionMask = 2147483647; files = ( AA7D4DB117C74CFE0092DF8A /* LNLocalizationCollection.m in Sources */, - AAF0D6B417ECD8EC00B4318B /* LNButtonCell.m in Sources */, - AAF0D6B117ECC4AF00B4318B /* LNTableCornerView.m in Sources */, AAB0CD3417C448200085E913 /* LNRegularExpressionPattern+type.m in Sources */, - AADDDA9417C49D4800BBA67C /* NSBundle+versions.m in Sources */, AAAC873B17EDA9CF00BF251D /* LNPopoverWindow.m in Sources */, - AA8F8EF017EDFC68004964FB /* NSTableView+editedColumnIdentifier.m in Sources */, - AA6377CE18C5CCFC005EADC7 /* LNImageButtonCell.m in Sources */, - AA20D87F17ECB12A006B7CA2 /* NSPopoverFrame+Lin.m in Sources */, + AA8F8EF017EDFC68004964FB /* NSTableView+EditedColumnIdentifier.m in Sources */, AA02CE8E17EE083A0041C2BD /* LNAlertAccessoryView.m in Sources */, - AA36376617D9EF9E003C5E55 /* LNPopoverContentView.m in Sources */, AA470D5E17C3D05D005CBB7F /* LNEntity.m in Sources */, AA7D4DB417C74D0A0092DF8A /* LNLocalization.m in Sources */, AAB0CD3117C4382D0085E913 /* LNRegularExpressionPattern.m in Sources */, AA1B7DBA17C3C20F00A3A6D7 /* Lin.m in Sources */, - AAF0D6AE17ECB89800B4318B /* LNTableHeaderCell.m in Sources */, AAAC873317ED9D4F00BF251D /* LNHorizontalLine.m in Sources */, + 2B2FEC9B1A2F894500D0534D /* MainViewController.m in Sources */, AADEADB717C87298001E0C65 /* IDEIndex+Lin.m in Sources */, - AAF0D6AB17ECB87100B4318B /* LNTableView.m in Sources */, AA2980B417EE2C5300CF46E3 /* LNUserDefaultsManager.m in Sources */, AA95FDEF17EB4E77007D33D4 /* LNPopoverWindowController.m in Sources */, - AADEADC017C87392001E0C65 /* MethodSwizzle.m in Sources */, F5859DBD18CABC2A009AF108 /* LNLocalizedStringCollectionOperation.m in Sources */, AA470D5B17C3CFEC005CBB7F /* LNDetector.m in Sources */, ); @@ -585,10 +505,10 @@ /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ - AA1B7DAF17C3C1EC00A3A6D7 /* InfoPlist.strings */ = { + 2BC7C6AA1A2FC4690065C278 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( - AA1B7DB017C3C1EC00A3A6D7 /* en */, + 2BC7C6A91A2FC4690065C278 /* en */, ); name = InfoPlist.strings; sourceTree = ""; @@ -636,7 +556,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.7; + MACOSX_DEPLOYMENT_TARGET = 10.10; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; }; @@ -669,7 +589,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.7; + MACOSX_DEPLOYMENT_TARGET = 10.10; SDKROOT = macosx; }; name = Release; @@ -686,8 +606,8 @@ "$(SYSTEM_APPS_DIR)/Xcode.app/Contents/Frameworks", ); GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "Lin/Lin-Prefix.pch"; - INFOPLIST_FILE = "Lin/Lin-Info.plist"; + GCC_PREFIX_HEADER = "Lin/Supporting Files/Lin-Prefix.pch"; + INFOPLIST_FILE = "Lin/Supporting Files/Lin-Info.plist"; INSTALL_PATH = "/Library/Application Support/Developer/Shared/Xcode/Plug-ins"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = xcplugin; @@ -706,8 +626,8 @@ "$(SYSTEM_APPS_DIR)/Xcode.app/Contents/Frameworks", ); GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "Lin/Lin-Prefix.pch"; - INFOPLIST_FILE = "Lin/Lin-Info.plist"; + GCC_PREFIX_HEADER = "Lin/Supporting Files/Lin-Prefix.pch"; + INFOPLIST_FILE = "Lin/Supporting Files/Lin-Info.plist"; INSTALL_PATH = "/Library/Application Support/Developer/Shared/Xcode/Plug-ins"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = xcplugin; diff --git a/Lin.xcodeproj/xcshareddata/xcschemes/Lin.xcscheme b/Lin.xcodeproj/xcshareddata/xcschemes/Lin.xcscheme index 00e2fe5..32d3fd1 100644 --- a/Lin.xcodeproj/xcshareddata/xcschemes/Lin.xcscheme +++ b/Lin.xcodeproj/xcshareddata/xcschemes/Lin.xcscheme @@ -48,7 +48,8 @@ buildConfiguration = "Debug" ignoresPersistentStateOnLaunch = "NO" debugDocumentVersioning = "YES" - allowLocationSimulation = "YES"> + allowLocationSimulation = "YES" + viewDebuggingEnabled = "No"> diff --git a/Lin/IDEIndex+Lin.h b/Lin/Categories/IDEIndex+Lin.h similarity index 100% rename from Lin/IDEIndex+Lin.h rename to Lin/Categories/IDEIndex+Lin.h diff --git a/Lin/Categories/IDEIndex+Lin.m b/Lin/Categories/IDEIndex+Lin.m new file mode 100644 index 0000000..4809599 --- /dev/null +++ b/Lin/Categories/IDEIndex+Lin.m @@ -0,0 +1,27 @@ +// +// IDEIndex+Lin.m +// Lin +// +// Created by Tanaka Katsuma on 2013/08/24. +// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. +// + +#import "IDEIndex+Lin.h" +#import "Lin.h" +#import + +static IMP __original_Method_Imp; + +void _evo_lin_close_Method(id self, SEL _cmd) { + [[Lin sharedPlugIn] removeLocalizationsForIndex:self]; + ((void(*)(id,SEL))__original_Method_Imp)(self, _cmd); +} + +@implementation IDEIndex (Lin) + ++ (void)load { + Method m = class_getInstanceMethod(self, @selector(close)); + __original_Method_Imp = method_setImplementation(m, (IMP)_evo_lin_close_Method); +} + +@end diff --git a/Lin/Categories/NSTableView+EditedColumnIdentifier.h b/Lin/Categories/NSTableView+EditedColumnIdentifier.h new file mode 100644 index 0000000..799b996 --- /dev/null +++ b/Lin/Categories/NSTableView+EditedColumnIdentifier.h @@ -0,0 +1,15 @@ +// +// NSTableView+EditedColumnIdentifier.h +// Lin +// +// Created by Tanaka Katsuma on 2013/09/22. +// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. +// + +#import + +@interface NSTableView (EditedColumnIdentifier) + +@property (nonatomic, readonly, copy) NSString *evo_editedColumnIdentifier; + +@end diff --git a/Lin/NSTableView+editedColumnIdentifier.m b/Lin/Categories/NSTableView+EditedColumnIdentifier.m similarity index 63% rename from Lin/NSTableView+editedColumnIdentifier.m rename to Lin/Categories/NSTableView+EditedColumnIdentifier.m index 30d7f1e..c0213c3 100644 --- a/Lin/NSTableView+editedColumnIdentifier.m +++ b/Lin/Categories/NSTableView+EditedColumnIdentifier.m @@ -1,22 +1,21 @@ // -// NSTableView+editedColumnIdentifier.m +// NSTableView+EditedColumnIdentifier.m // Lin // // Created by Tanaka Katsuma on 2013/09/22. // Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. // -#import "NSTableView+editedColumnIdentifier.h" +#import "NSTableView+EditedColumnIdentifier.h" -@implementation NSTableView (editedColumnIdentifier) +@implementation NSTableView (EditedColumnIdentifier) -- (NSString *)editedColumnIdentifier -{ +- (NSString *)evo_editedColumnIdentifier { NSInteger editedColumnIndex = [self editedColumn]; NSArray *tableColumns = [self tableColumns]; for (NSInteger i = 0; i < tableColumns.count; i++) { - NSTableColumn *column = [tableColumns objectAtIndex:i]; + NSTableColumn *column = tableColumns[i]; if (i == editedColumnIndex) { return column.identifier; diff --git a/Lin/IDEIndex+Lin.m b/Lin/IDEIndex+Lin.m deleted file mode 100644 index 35d862e..0000000 --- a/Lin/IDEIndex+Lin.m +++ /dev/null @@ -1,28 +0,0 @@ -// -// IDEIndex+Lin.m -// Lin -// -// Created by Tanaka Katsuma on 2013/08/24. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import "IDEIndex+Lin.h" - -#import "MethodSwizzle.h" -#import "Lin.h" - -@implementation IDEIndex (Lin) - -+ (void)load -{ - MethodSwizzle(self, @selector(close), @selector(jp_questbeat_lin_close)); -} - -- (void)jp_questbeat_lin_close -{ - [[Lin sharedPlugIn] removeLocalizationsForIndex:self]; - - [self jp_questbeat_lin_close]; -} - -@end diff --git a/Lin/IDEWorkspaceWindow.h b/Lin/IDEWorkspaceWindow.h deleted file mode 100644 index e9b614a..0000000 --- a/Lin/IDEWorkspaceWindow.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// IDEWorkspaceWindow.h -// Lin -// -// Created by Tanaka Katsuma on 2013/09/26. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import "DVTDualProxyWindow.h" - -@interface IDEWorkspaceWindow : DVTDualProxyWindow - -@end diff --git a/Lin/LNButtonCell.h b/Lin/LNButtonCell.h deleted file mode 100644 index 9ed4e28..0000000 --- a/Lin/LNButtonCell.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// LNButtonCell.h -// Lin -// -// Created by Tanaka Katsuma on 2013/09/21. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import - -@interface LNButtonCell : NSButtonCell - -@end diff --git a/Lin/LNButtonCell.m b/Lin/LNButtonCell.m deleted file mode 100644 index d1eb0b7..0000000 --- a/Lin/LNButtonCell.m +++ /dev/null @@ -1,21 +0,0 @@ -// -// LNButtonCell.m -// Lin -// -// Created by Tanaka Katsuma on 2013/09/21. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import "LNButtonCell.h" - -@implementation LNButtonCell - -- (void)drawImage:(NSImage *)image withFrame:(NSRect)frame inView:(NSView *)controlView -{ - // Adjustment - frame.origin.y += 3; - - [super drawImage:image withFrame:frame inView:controlView]; -} - -@end diff --git a/Lin/LNImageButtonCell.h b/Lin/LNImageButtonCell.h deleted file mode 100644 index a865f94..0000000 --- a/Lin/LNImageButtonCell.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// LNImageButtonCell.h -// Lin -// -// Created by Tanaka Katsuma on 2014/03/04. -// Copyright (c) 2014年 Tanaka Katsuma. All rights reserved. -// - -#import - -@interface LNImageButtonCell : NSButtonCell - -@end diff --git a/Lin/LNImageButtonCell.m b/Lin/LNImageButtonCell.m deleted file mode 100644 index 45b8c9a..0000000 --- a/Lin/LNImageButtonCell.m +++ /dev/null @@ -1,21 +0,0 @@ -// -// LNImageButtonCell.m -// Lin -// -// Created by Tanaka Katsuma on 2014/03/04. -// Copyright (c) 2014年 Tanaka Katsuma. All rights reserved. -// - -#import "LNImageButtonCell.h" - -@implementation LNImageButtonCell - -- (void)drawImage:(NSImage *)image withFrame:(NSRect)frame inView:(NSView *)controlView -{ - // Adjustment - frame.origin.y += 2; - - [super drawImage:image withFrame:frame inView:controlView]; -} - -@end diff --git a/Lin/LNTableCornerView.h b/Lin/LNTableCornerView.h deleted file mode 100644 index c5b25e6..0000000 --- a/Lin/LNTableCornerView.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// LNTableCornerView.h -// Lin -// -// Created by Tanaka Katsuma on 2013/09/21. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import - -@interface LNTableCornerView : NSView - -@end diff --git a/Lin/LNTableCornerView.m b/Lin/LNTableCornerView.m deleted file mode 100644 index c910b5c..0000000 --- a/Lin/LNTableCornerView.m +++ /dev/null @@ -1,27 +0,0 @@ -// -// LNTableCornerView.m -// Lin -// -// Created by Tanaka Katsuma on 2013/09/21. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import "LNTableCornerView.h" - -@implementation LNTableCornerView - -- (void)drawRect:(NSRect)dirtyRect -{ - [super drawRect:dirtyRect]; - - // Background - [[NSColor whiteColor] setFill]; - NSRectFill(dirtyRect); - - // Draw separator - [[NSColor colorWithDeviceWhite:204.0/255.0 alpha:1.0] setStroke]; - [NSBezierPath strokeLineFromPoint:NSMakePoint(dirtyRect.origin.x, 0.5) - toPoint:NSMakePoint(dirtyRect.origin.x + dirtyRect.size.width, 0.5)]; -} - -@end diff --git a/Lin/LNTableHeaderCell.h b/Lin/LNTableHeaderCell.h deleted file mode 100644 index 90bd377..0000000 --- a/Lin/LNTableHeaderCell.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// LNTableHeaderCell.h -// Lin -// -// Created by Tanaka Katsuma on 2013/09/21. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import - -@interface LNTableHeaderCell : NSTableHeaderCell - -@property (nonatomic, weak) NSTableView *tableView; - -- (void)setSortAscending:(BOOL)ascending priority:(NSInteger)priority; - -@end diff --git a/Lin/LNTableHeaderCell.m b/Lin/LNTableHeaderCell.m deleted file mode 100644 index 11e226c..0000000 --- a/Lin/LNTableHeaderCell.m +++ /dev/null @@ -1,147 +0,0 @@ -// -// LNTableHeaderCell.m -// Lin -// -// Created by Tanaka Katsuma on 2013/09/21. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import "LNTableHeaderCell.h" - -static const NSInteger kLNTableHeaderCellSortIndicatorWidth = 8; -static const NSInteger kLNTableHeaderCellSortIndicatorHeight = 7; -static const NSInteger kLNTableHeaderCellSortIndicatorMarginX = 4; -static const NSInteger kLNTableHeaderCellSortIndicatorMarginY = 6; - -@interface LNTableHeaderCell () - -@property (nonatomic, assign) BOOL ascending; -@property (nonatomic, assign) NSInteger priority; - -- (void)drawContentInRect:(NSRect)rect highlighted:(BOOL)highlighted; - -@end - -@implementation LNTableHeaderCell - -- (instancetype)init -{ - self = [super init]; - - if (self) { - self.priority = 1; - } - - return self; -} - - -#pragma mark - Accessors - -- (void)setSortAscending:(BOOL)ascending priority:(NSInteger)priority -{ - self.ascending = ascending; - self.priority = priority; -} - - -#pragma mark - Drawing the View - -- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView -{ - [self drawContentInRect:cellFrame highlighted:NO]; - [self drawSortIndicatorWithFrame:cellFrame inView:controlView ascending:self.ascending priority:self.priority]; -} - -- (void)highlight:(BOOL)flag withFrame:(NSRect)cellFrame inView:(NSView *)controlView -{ - [self drawContentInRect:cellFrame highlighted:YES]; - [self drawSortIndicatorWithFrame:cellFrame inView:controlView ascending:self.ascending priority:self.priority]; -} - -- (void)drawContentInRect:(NSRect)rect highlighted:(BOOL)highlighted -{ - // Draw background - NSRect backgroundRect = rect; - backgroundRect.size.width -= 1; - - if (highlighted) { - [[NSColor colorWithDeviceWhite:153.0/255.0 alpha:1.0] set]; - } else { - [[NSColor whiteColor] set]; - } - - NSRectFill(backgroundRect); - - // Draw separator - [[NSColor colorWithDeviceWhite:204.0/255.0 alpha:1.0] setStroke]; - [NSBezierPath strokeLineFromPoint:NSMakePoint(rect.origin.x, rect.size.height - 0.5) - toPoint:NSMakePoint(rect.origin.x + rect.size.width, rect.size.height - 0.5)]; - - // Draw title - NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithAttributedString:[self attributedStringValue]]; - - NSDictionary *attributes; - if (highlighted) { - attributes = @{ - NSForegroundColorAttributeName: [NSColor whiteColor], - NSFontAttributeName: [NSFont systemFontOfSize:12.0] - }; - } else { - attributes = @{ - NSForegroundColorAttributeName: [NSColor colorWithDeviceWhite:153.0/255.0 alpha:1.0], - NSFontAttributeName: [NSFont systemFontOfSize:12.0] - }; - } - - [attributedString addAttributes:attributes range:NSMakeRange(0, [attributedString length])]; - - NSRect titleRect = rect; - titleRect.origin.x += 3; - titleRect.origin.y += 0; - - [attributedString drawInRect:titleRect]; -} - -- (void)drawSortIndicatorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView ascending:(BOOL)ascending priority:(NSInteger)priority -{ - NSBezierPath *path = [NSBezierPath bezierPath]; - - if (ascending) { - NSPoint p = NSMakePoint(cellFrame.origin.x + cellFrame.size.width - kLNTableHeaderCellSortIndicatorWidth - kLNTableHeaderCellSortIndicatorMarginX, - cellFrame.origin.y + cellFrame.size.height - kLNTableHeaderCellSortIndicatorMarginY); - [path moveToPoint:p]; - - p.x += kLNTableHeaderCellSortIndicatorWidth / 2.0; - p.y -= kLNTableHeaderCellSortIndicatorHeight; - [path lineToPoint:p]; - - p.x += kLNTableHeaderCellSortIndicatorWidth / 2.0; - p.y += kLNTableHeaderCellSortIndicatorHeight; - [path lineToPoint:p]; - } else { - NSPoint p = NSMakePoint(cellFrame.origin.x + cellFrame.size.width - kLNTableHeaderCellSortIndicatorWidth - kLNTableHeaderCellSortIndicatorMarginX, - cellFrame.origin.y + cellFrame.size.height - kLNTableHeaderCellSortIndicatorHeight - kLNTableHeaderCellSortIndicatorMarginY); - [path moveToPoint:p]; - - p.x += kLNTableHeaderCellSortIndicatorWidth / 2.0; - p.y += kLNTableHeaderCellSortIndicatorHeight; - [path lineToPoint:p]; - - p.x += kLNTableHeaderCellSortIndicatorWidth / 2.0; - p.y -= kLNTableHeaderCellSortIndicatorHeight; - [path lineToPoint:p]; - } - - [path closePath]; - - if (priority == 0) { - [[NSColor colorWithDeviceWhite:153.0/255.0 alpha:1.0] set]; - } else { - [[NSColor clearColor] set]; - } - - [path fill]; -} - -@end diff --git a/Lin/LNTableView.h b/Lin/LNTableView.h deleted file mode 100644 index ce100e1..0000000 --- a/Lin/LNTableView.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// LNTableView.h -// Lin -// -// Created by Tanaka Katsuma on 2013/09/21. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import - -@interface LNTableView : NSTableView - -@end diff --git a/Lin/LNTableView.m b/Lin/LNTableView.m deleted file mode 100644 index 2d70f37..0000000 --- a/Lin/LNTableView.m +++ /dev/null @@ -1,38 +0,0 @@ -// -// LNTableView.m -// Lin -// -// Created by Tanaka Katsuma on 2013/09/21. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import "LNTableView.h" - -// Views -#import "LNTableCornerView.h" -#import "LNTableHeaderCell.h" - -@implementation LNTableView - -- (void)awakeFromNib -{ - [super awakeFromNib]; - - // Set corner view - NSView *cornerView = [self cornerView]; - LNTableCornerView *newCornerView = [[LNTableCornerView alloc] initWithFrame:cornerView.frame]; - [self setCornerView:newCornerView]; - - // Change header cell - for (NSTableColumn *tableColumn in [self tableColumns]) { - NSTableHeaderCell *headerCell = [tableColumn headerCell]; - - LNTableHeaderCell *newHeaderCell = [[LNTableHeaderCell alloc] init]; - newHeaderCell.tableView = self; - [newHeaderCell setAttributedStringValue:[headerCell attributedStringValue]]; - - [tableColumn setHeaderCell:newHeaderCell]; - } -} - -@end diff --git a/Lin/Lin.m b/Lin/Lin.m index f3d3b17..f4ea914 100644 --- a/Lin/Lin.m +++ b/Lin/Lin.m @@ -17,9 +17,6 @@ #import "IDEWorkspaceWindow.h" #import "DVTSourceTextView.h" -// Categories -#import "NSBundle+versions.h" - // Shared #import "LNUserDefaultsManager.h" @@ -29,10 +26,8 @@ #import "LNLocalizationCollection.h" #import "LNLocalization.h" -// Views -#import "LNPopoverContentView.h" - // Controllers +#import "MainViewController.h" #import "LNPopoverWindowController.h" #import "LNLocalizedStringCollectionOperation.h" @@ -65,21 +60,18 @@ @interface Lin () @implementation Lin -+ (void)pluginDidLoad:(NSBundle *)bundle -{ ++ (void)pluginDidLoad:(NSBundle *)bundle { static dispatch_once_t _onceToken; dispatch_once(&_onceToken, ^{ _sharedPlugin = [[self alloc] init]; }); } -+ (instancetype)sharedPlugIn -{ ++ (instancetype)sharedPlugIn { return _sharedPlugin; } -- (instancetype)init -{ +- (instancetype)init { self = [super init]; if (self) { @@ -143,35 +135,32 @@ - (instancetype)init return self; } -- (void)instantiatePopover -{ +- (void)instantiatePopover { NSBundle *bundle = [NSBundle bundleForClass:[self class]]; - NSViewController *contentViewController = [[NSViewController alloc] initWithNibName:@"LNPopoverContentView" bundle:bundle]; + MainViewController *contentViewController = [[MainViewController alloc] initWithNibName:@"MainViewController" bundle:bundle]; + NSLog(@"%@", contentViewController.view); // FIXME + contentViewController.tableView.selectionHighlightStyle = NSTableViewSelectionHighlightStyleSourceList; NSPopover *popover = [[NSPopover alloc] init]; popover.delegate = self; popover.behavior = NSPopoverBehaviorTransient; - popover.appearance = NSPopoverAppearanceMinimal; popover.animates = NO; popover.contentViewController = contentViewController; self.popover = popover; } -- (void)instantiatePopoverWindowController -{ +- (void)instantiatePopoverWindowController { NSBundle *bundle = [NSBundle bundleForClass:[self class]]; - NSViewController *contentViewController = [[NSViewController alloc] initWithNibName:@"LNPopoverContentView" bundle:bundle]; - LNPopoverContentView *contentView = (LNPopoverContentView *)contentViewController.view; - [contentView.detachButton setHidden:YES]; + MainViewController *contentViewController = [[MainViewController alloc] initWithNibName:@"MainViewController" bundle:bundle]; + [contentViewController.detachButton setHidden:YES]; LNPopoverWindowController *popoverWindowController = [[LNPopoverWindowController alloc] initWithContentViewController:contentViewController]; self.popoverWindowController = popoverWindowController; } -- (void)dealloc -{ +- (void)dealloc { // Deactivate [self deactivate]; @@ -208,8 +197,7 @@ - (void)dealloc #pragma mark - Managing Application State -- (void)activate -{ +- (void)activate { if (!self.activated) { self.activated = YES; @@ -224,8 +212,7 @@ - (void)activate } } -- (void)deactivate -{ +- (void)deactivate { if (self.activated) { self.activated = NO; @@ -241,8 +228,7 @@ - (void)deactivate #pragma mark - Notifications -- (void)textDidChange:(NSNotification *)notification -{ +- (void)textDidChange:(NSNotification *)notification { if ([[notification object] isKindOfClass:[DVTSourceTextView class]]) { NSTextView *textView = (NSTextView *)[notification object]; self.textView = textView; @@ -258,8 +244,7 @@ - (void)textDidChange:(NSNotification *)notification } } -- (void)textViewDidChangeSelection:(NSNotification *)notification -{ +- (void)textViewDidChangeSelection:(NSNotification *)notification { if ([[notification object] isKindOfClass:[DVTSourceTextView class]]) { NSTextView *textView = (NSTextView *)[notification object]; self.textView = textView; @@ -275,8 +260,7 @@ - (void)textViewDidChangeSelection:(NSNotification *)notification } } -- (void)workspaceWindowDidBecomeMain:(NSNotification *)notification -{ +- (void)workspaceWindowDidBecomeMain:(NSNotification *)notification { if ([[notification object] isKindOfClass:[IDEWorkspaceWindow class]]) { NSWindow *workspaceWindow = (NSWindow *)[notification object]; NSWindowController *workspaceWindowController = (NSWindowController *)workspaceWindow.windowController; @@ -289,20 +273,18 @@ - (void)workspaceWindowDidBecomeMain:(NSNotification *)notification } } -- (void)indexDidIndexWorkspace:(NSNotification *)notification -{ +- (void)indexDidIndexWorkspace:(NSNotification *)notification { IDEIndex *index = (IDEIndex *)[notification object]; [self indexNeedsUpdate:index]; } -- (void)editorDocumentDidSave:(NSNotification *)notification -{ +- (void)editorDocumentDidSave:(NSNotification *)notification { IDEEditorDocument *editorDocument = (IDEEditorDocument *)[notification object]; DVTFilePath *filePath = editorDocument.filePath; NSString *pathString = filePath.pathString; // Check whether there are any changes to .strings - NSArray *collections = [self.workspaceLocalizations objectForKey:self.currentWorkspaceFilePath]; + NSArray *collections = self.workspaceLocalizations[self.currentWorkspaceFilePath]; for (LNLocalizationCollection *collection in collections) { if ([collection.filePath isEqualToString:pathString]) { @@ -313,14 +295,12 @@ - (void)editorDocumentDidSave:(NSNotification *)notification } } -- (void)popoverWindowControllerWindowWillClose:(NSNotification *)notification -{ +- (void)popoverWindowControllerWindowWillClose:(NSNotification *)notification { // Instantiate popover [self instantiatePopover]; } -- (void)popoverContentViewLocalizationDidSelect:(NSNotification *)notification -{ +- (void)popoverContentViewLocalizationDidSelect:(NSNotification *)notification { NSTextView *textView = self.textView; LNEntity *entity = [self selectedEntityInTextView:textView]; @@ -328,33 +308,30 @@ - (void)popoverContentViewLocalizationDidSelect:(NSNotification *)notification NSArray *selectedRanges = textView.selectedRanges; if (selectedRanges.count > 0) { - NSRange selectedRange = [[selectedRanges objectAtIndex:0] rangeValue]; + NSRange selectedRange = [selectedRanges[0] rangeValue]; // Locate the key NSRange lineRange = [textView.textStorage.string lineRangeForRange:selectedRange]; NSRange keyRange = NSMakeRange(lineRange.location + entity.keyRange.location, entity.keyRange.length); // Replace - LNLocalization *localization = [[notification userInfo] objectForKey:LNPopoverContentViewLocalizationKey]; + LNLocalization *localization = [notification userInfo][LNPopoverContentViewLocalizationKey]; [textView insertText:localization.key replacementRange:keyRange]; } } } -- (void)popoverContentViewAlertDidDismiss:(NSNotification *)notification -{ +- (void)popoverContentViewAlertDidDismiss:(NSNotification *)notification { // Show popover again [self presentPopoverInTextView:self.textView entity:[self selectedEntityInTextView:self.textView]]; } -- (void)popoverContentViewDetachButtonDidClick:(NSNotification *)notification -{ +- (void)popoverContentViewDetachButtonDidClick:(NSNotification *)notification { [self preparePopoverWindow]; [self detachPopover]; } -- (void)menuDidChange:(NSNotification *)notification -{ +- (void)menuDidChange:(NSNotification *)notification { // Create menu item [self createMenuItem]; } @@ -362,8 +339,7 @@ - (void)menuDidChange:(NSNotification *)notification #pragma mark - Detachig Popover -- (void)preparePopoverWindow -{ +- (void)preparePopoverWindow { // Resize popover window NSWindow *popoverWindow = [self.popover _popoverWindow]; @@ -374,15 +350,13 @@ - (void)preparePopoverWindow display:NO]; // Copy popover content - LNPopoverContentView *popoverContentView = (LNPopoverContentView *)self.popover.contentViewController.view; - LNPopoverContentView *popoverWindowContentView = (LNPopoverContentView *)self.popoverWindowController.contentViewController.view; - popoverWindowContentView.tableView.sortDescriptors = popoverContentView.tableView.sortDescriptors; - popoverWindowContentView.collections = popoverContentView.collections; - popoverWindowContentView.searchString = popoverContentView.searchString; + MainViewController *popoverContentView = (MainViewController *)self.popover.contentViewController; + popoverContentView.tableView.sortDescriptors = popoverContentView.tableView.sortDescriptors; + popoverContentView.collections = popoverContentView.collections; + popoverContentView.searchString = popoverContentView.searchString; } -- (void)detachPopover -{ +- (void)detachPopover { [self dismissPopover]; [self.popoverWindowController showWindow:nil]; } @@ -390,12 +364,11 @@ - (void)detachPopover #pragma mark - Entity -- (LNEntity *)selectedEntityInTextView:(NSTextView *)textView -{ +- (LNEntity *)selectedEntityInTextView:(NSTextView *)textView { NSArray *selectedRanges = textView.selectedRanges; if (selectedRanges.count > 0) { - NSRange selectedRange = [[selectedRanges objectAtIndex:0] rangeValue]; + NSRange selectedRange = [selectedRanges[0] rangeValue]; // Locate the line containing the caret NSString *string = textView.textStorage.string; @@ -419,8 +392,7 @@ - (LNEntity *)selectedEntityInTextView:(NSTextView *)textView #pragma mark - Menu -- (void)createMenuItem -{ +- (void)createMenuItem { NSMenuItem *editorMenuItem = [[NSApp mainMenu] itemWithTitle:@"Editor"]; if (editorMenuItem && [[editorMenuItem submenu] itemWithTitle:@"Lin"] == nil) { @@ -460,8 +432,7 @@ - (void)createMenuItem } } -- (BOOL)validateMenuItem:(NSMenuItem *)menuItem -{ +- (BOOL)validateMenuItem:(NSMenuItem *)menuItem { if (menuItem == self.showWindowMenuItem) { return [[LNUserDefaultsManager sharedManager] isEnabled]; } @@ -469,8 +440,7 @@ - (BOOL)validateMenuItem:(NSMenuItem *)menuItem return YES; } -- (void)toggleEnabled:(id)sender -{ +- (void)toggleEnabled:(id)sender { // Save defaults LNUserDefaultsManager *userDefaultManager = [LNUserDefaultsManager sharedManager]; BOOL enabled = ![userDefaultManager isEnabled]; @@ -487,14 +457,13 @@ - (void)toggleEnabled:(id)sender } } -- (void)showWindow:(id)sender -{ +- (void)showWindow:(id)sender { // Prepare window - NSArray *collections = [self.workspaceLocalizations objectForKey:self.currentWorkspaceFilePath]; + NSArray *collections = self.workspaceLocalizations[self.currentWorkspaceFilePath]; - LNPopoverContentView *popoverWindowContentView = (LNPopoverContentView *)self.popoverWindowController.contentViewController.view; - popoverWindowContentView.collections = collections; - popoverWindowContentView.searchString = @""; + MainViewController *mainViewController = (MainViewController *)self.popoverWindowController.contentViewController; + mainViewController.collections = collections; + mainViewController.searchString = @""; // Show window [self.popoverWindowController.window setFrame:NSMakeRect(0, 0, 500, 280) display:NO]; @@ -502,15 +471,13 @@ - (void)showWindow:(id)sender [self.popoverWindowController showWindow:nil]; } -- (void)showVersionInfo:(id)sender -{ +- (void)showVersionInfo:(id)sender { // Create alert NSBundle *bundle = [NSBundle bundleForClass:[self class]]; - NSAlert *alert = [NSAlert alertWithMessageText:@"Lin" - defaultButton:@"OK" - alternateButton:nil - otherButton:@"Open Website" - informativeTextWithFormat:@"Version %@\n\nCopyright (c) 2013 Katsuma Tanaka\n\nEmail: questbeat@gmail.com\nTwitter: @questbeat", [bundle shortVersionString]]; + NSAlert *alert = [[NSAlert alloc] init]; + alert.messageText = @"Lin"; + [alert addButtonWithTitle:@"OK"]; + alert.informativeText = [NSString stringWithFormat:@"Version %@\n\nCopyright (c) 2014 Sascha Schwabbauer\n\nEmail: sascha@evolved.io\nTwitter: @_SaschaS", [bundle objectForInfoDictionaryKey:@"CFBundleShortVersionString"]]; // Set icon NSString *filePath = [bundle pathForResource:@"icon120" ofType:@"tiff"]; @@ -518,16 +485,13 @@ - (void)showVersionInfo:(id)sender [alert setIcon:icon]; // Show alert - if ([alert runModal] == NSAlertOtherReturn) { - [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://questbe.at/lin"]]; - } + [alert runModal]; } #pragma mark - Index -- (void)indexNeedsUpdate:(IDEIndex *)index -{ +- (void)indexNeedsUpdate:(IDEIndex *)index { DVTFilePath *workspaceFile = index.workspaceFile; NSString *workspaceFilePath = workspaceFile.pathString; @@ -537,18 +501,17 @@ - (void)indexNeedsUpdate:(IDEIndex *)index } } -- (void)updateLocalizationsForIndex:(IDEIndex *)index -{ +- (void)updateLocalizationsForIndex:(IDEIndex *)index { LNLocalizedStringCollectionOperation *processOperation = [[LNLocalizedStringCollectionOperation alloc] initWithIndex:index]; processOperation.collectionCompletedBlock = ^(NSString *workspaceFilePath, NSArray *collections) { - [self.workspaceLocalizations setObject:collections forKey:workspaceFilePath]; + self.workspaceLocalizations[workspaceFilePath] = collections; if ([workspaceFilePath isEqualToString:self.currentWorkspaceFilePath]) { if ([self.popover isShown]) { - LNPopoverContentView *contentView = (LNPopoverContentView *)self.popover.contentViewController.view; - contentView.collections = collections; + MainViewController *mainViewController = (MainViewController *)self.popoverWindowController.contentViewController; + mainViewController.collections = collections; } else if ([self.popoverWindowController.window isVisible]) { - LNPopoverContentView *contentView = (LNPopoverContentView *)self.popoverWindowController.contentViewController.view; - contentView.collections = collections; + MainViewController *mainViewController = (MainViewController *)self.popoverWindowController.contentViewController; + mainViewController.collections = collections; } } }; @@ -556,8 +519,7 @@ - (void)updateLocalizationsForIndex:(IDEIndex *)index [self.collectionProcessQueue addOperation:processOperation]; } -- (void)removeLocalizationsForIndex:(IDEIndex *)index -{ +- (void)removeLocalizationsForIndex:(IDEIndex *)index { DVTFilePath *workspaceFile = index.workspaceFile; NSString *workspaceFilePath = workspaceFile.pathString; @@ -569,8 +531,7 @@ - (void)removeLocalizationsForIndex:(IDEIndex *)index #pragma mark - Popover -- (void)presentPopoverInTextView:(NSTextView *)textView entity:(LNEntity *)entity -{ +- (void)presentPopoverInTextView:(NSTextView *)textView entity:(LNEntity *)entity { if (![[LNUserDefaultsManager sharedManager] isEnabled]) { return; } @@ -578,34 +539,34 @@ - (void)presentPopoverInTextView:(NSTextView *)textView entity:(LNEntity *)entit NSArray *selectedRanges = textView.selectedRanges; if (selectedRanges.count > 0) { - NSRange selectedRange = [[selectedRanges objectAtIndex:0] rangeValue]; + NSRange selectedRange = [selectedRanges[0] rangeValue]; // Locate the line containing the caret NSRange lineRange = [textView.textStorage.string lineRangeForRange:selectedRange]; // Stick popover at the beginning of the key NSRange keyRange = NSMakeRange(lineRange.location + entity.keyRange.location, 1); - NSRect keyRectOnScreen = [textView firstRectForCharacterRange:keyRange]; + NSRect keyRectOnScreen = [textView firstRectForCharacterRange:keyRange actualRange:nil]; NSRect keyRectOnWindow = [textView.window convertRectFromScreen:keyRectOnScreen]; NSRect keyRectOnTextView = [textView convertRect:keyRectOnWindow fromView:nil]; // Update or show popover - NSArray *collections = [self.workspaceLocalizations objectForKey:self.currentWorkspaceFilePath]; + NSArray *collections = self.workspaceLocalizations[self.currentWorkspaceFilePath]; NSString *key = [textView.textStorage.string substringWithRange:NSMakeRange(lineRange.location + entity.keyRange.location, entity.keyRange.length)]; if ([self.popoverWindowController.window isVisible]) { // Update popover content - LNPopoverContentView *contentView = (LNPopoverContentView *)self.popoverWindowController.contentViewController.view; - contentView.collections = collections; - contentView.searchString = key; + MainViewController *mainViewController = (MainViewController *)self.popoverWindowController.contentViewController; + mainViewController.collections = collections; + mainViewController.searchString = key; } else { if ([self.popover isShown]) { // Update the position for popover when the cursor moved self.popover.positioningRect = keyRectOnTextView; // Update popover content - LNPopoverContentView *contentView = (LNPopoverContentView *)self.popover.contentViewController.view; - contentView.searchString = key; + MainViewController *mainViewController = (MainViewController *)self.popoverWindowController.contentViewController; + mainViewController.searchString = key; } else { // Show popover [self.popover showRelativeToRect:keyRectOnTextView @@ -613,23 +574,22 @@ - (void)presentPopoverInTextView:(NSTextView *)textView entity:(LNEntity *)entit preferredEdge:NSMinYEdge]; // Update popover content - LNPopoverContentView *contentView = (LNPopoverContentView *)self.popover.contentViewController.view; - contentView.collections = collections; - contentView.searchString = key; + MainViewController *mainViewController = (MainViewController *)self.popoverWindowController.contentViewController; + mainViewController.collections = collections; + mainViewController.searchString = key; } } } } -- (void)dismissPopover -{ +- (void)dismissPopover { if ([self.popoverWindowController.window isVisible]) { // Update popover content - NSArray *collections = [self.workspaceLocalizations objectForKey:self.currentWorkspaceFilePath]; + NSArray *collections = self.workspaceLocalizations[self.currentWorkspaceFilePath]; - LNPopoverContentView *contentView = (LNPopoverContentView *)self.popoverWindowController.contentViewController.view; - contentView.collections = collections; - contentView.searchString = nil; + MainViewController *mainViewController = (MainViewController *)self.popoverWindowController.contentViewController; + mainViewController.collections = collections; + mainViewController.searchString = nil; } else { // Hide popover if (self.popover.shown) { @@ -641,21 +601,18 @@ - (void)dismissPopover #pragma mark - NSPopoverDelegate -- (void)popoverWillShow:(NSNotification *)notification -{ +- (void)popoverWillShow:(NSNotification *)notification { // Save first responder self.previousFirstResponder = [self.textView.window firstResponder]; } -- (void)popoverDidShow:(NSNotification *)notification -{ +- (void)popoverDidShow:(NSNotification *)notification { // Reclaim key window and first responder [self.textView.window becomeKeyWindow]; [self.textView.window makeFirstResponder:self.previousFirstResponder]; } -- (NSWindow *)detachableWindowForPopover:(NSPopover *)popover -{ +- (NSWindow *)detachableWindowForPopover:(NSPopover *)popover { // Prepare for detaching [self preparePopoverWindow]; diff --git a/Lin/MethodSwizzle.h b/Lin/MethodSwizzle.h deleted file mode 100644 index 1acf847..0000000 --- a/Lin/MethodSwizzle.h +++ /dev/null @@ -1,11 +0,0 @@ -// -// MethodSwizzle.h -// Lin -// -// Created by Tanaka Katsuma on 2013/08/24. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import - -void MethodSwizzle(Class cls, SEL org_sel, SEL alt_sel); diff --git a/Lin/MethodSwizzle.m b/Lin/MethodSwizzle.m deleted file mode 100644 index 064dd18..0000000 --- a/Lin/MethodSwizzle.m +++ /dev/null @@ -1,23 +0,0 @@ -// -// MethodSwizzle.m -// Lin -// -// Created by Tanaka Katsuma on 2013/08/24. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import "MethodSwizzle.h" -#import - -void MethodSwizzle(Class cls, SEL org_sel, SEL alt_sel) -{ - Method org_method = nil, alt_method = nil; - - org_method = class_getInstanceMethod(cls, org_sel); - alt_method = class_getInstanceMethod(cls, alt_sel); - - if (org_method != nil && alt_method != nil) { - method_exchangeImplementations(org_method, alt_method); - } -} - diff --git a/Lin/LNDetector.h b/Lin/Models/LNDetector.h similarity index 100% rename from Lin/LNDetector.h rename to Lin/Models/LNDetector.h diff --git a/Lin/LNDetector.m b/Lin/Models/LNDetector.m similarity index 100% rename from Lin/LNDetector.m rename to Lin/Models/LNDetector.m diff --git a/Lin/LNEntity.h b/Lin/Models/LNEntity.h similarity index 95% rename from Lin/LNEntity.h rename to Lin/Models/LNEntity.h index 88c015d..3aee520 100644 --- a/Lin/LNEntity.h +++ b/Lin/Models/LNEntity.h @@ -48,6 +48,6 @@ NS_INLINE NSString * NSStringFromEntityType(LNEntityType type) { + (instancetype)entityWithType:(LNEntityType)type entityRange:(NSRange)entityRange keyRange:(NSRange)keyRange; -- (instancetype)initWithType:(LNEntityType)type entityRange:(NSRange)entityRange keyRange:(NSRange)keyRange; +- (instancetype)initWithType:(LNEntityType)type entityRange:(NSRange)entityRange keyRange:(NSRange)keyRange NS_DESIGNATED_INITIALIZER; @end diff --git a/Lin/LNEntity.m b/Lin/Models/LNEntity.m similarity index 100% rename from Lin/LNEntity.m rename to Lin/Models/LNEntity.m diff --git a/Lin/LNLocalization.h b/Lin/Models/LNLocalization.h similarity index 95% rename from Lin/LNLocalization.h rename to Lin/Models/LNLocalization.h index 147dd85..cacfb12 100644 --- a/Lin/LNLocalization.h +++ b/Lin/Models/LNLocalization.h @@ -23,6 +23,6 @@ + (instancetype)localizationWithKey:(NSString *)key value:(NSString *)value entityRange:(NSRange)entityRange keyRange:(NSRange)keyRange valueRange:(NSRange)valueRange collection:(LNLocalizationCollection *)collection; -- (instancetype)initWithKey:(NSString *)key value:(NSString *)value entityRange:(NSRange)entityRange keyRange:(NSRange)keyRange valueRange:(NSRange)valueRange collection:(LNLocalizationCollection *)collection; +- (instancetype)initWithKey:(NSString *)key value:(NSString *)value entityRange:(NSRange)entityRange keyRange:(NSRange)keyRange valueRange:(NSRange)valueRange collection:(LNLocalizationCollection *)collection NS_DESIGNATED_INITIALIZER; @end diff --git a/Lin/LNLocalization.m b/Lin/Models/LNLocalization.m similarity index 100% rename from Lin/LNLocalization.m rename to Lin/Models/LNLocalization.m diff --git a/Lin/LNLocalizationCollection.h b/Lin/Models/LNLocalizationCollection.h similarity index 84% rename from Lin/LNLocalizationCollection.h rename to Lin/Models/LNLocalizationCollection.h index f4bd5ad..0d94f9e 100644 --- a/Lin/LNLocalizationCollection.h +++ b/Lin/Models/LNLocalizationCollection.h @@ -19,9 +19,9 @@ + (instancetype)localizationCollectionWithContentsOfFile:(NSString *)filePath; -- (instancetype)initWithContentsOfFile:(NSString *)filePath; +- (instancetype)initWithContentsOfFile:(NSString *)filePath NS_DESIGNATED_INITIALIZER; -- (NSString *)fileName; +@property (nonatomic, readonly, copy) NSString *fileName; - (void)reloadLocalizations; - (void)addLocalization:(LNLocalization *)localization; diff --git a/Lin/LNLocalizationCollection.m b/Lin/Models/LNLocalizationCollection.m similarity index 98% rename from Lin/LNLocalizationCollection.m rename to Lin/Models/LNLocalizationCollection.m index 2c786d5..62505f9 100644 --- a/Lin/LNLocalizationCollection.m +++ b/Lin/Models/LNLocalizationCollection.m @@ -36,7 +36,7 @@ - (instancetype)initWithContentsOfFile:(NSString *)filePath // Extract language designation NSArray *pathComponents = [filePath pathComponents]; - self.languageDesignation = [[pathComponents objectAtIndex:pathComponents.count - 2] stringByDeletingPathExtension]; + self.languageDesignation = [pathComponents[pathComponents.count - 2] stringByDeletingPathExtension]; // Update [self reloadLocalizations]; diff --git a/Lin/LNRegularExpressionPattern+type.h b/Lin/Models/LNRegularExpressionPattern+type.h similarity index 100% rename from Lin/LNRegularExpressionPattern+type.h rename to Lin/Models/LNRegularExpressionPattern+type.h diff --git a/Lin/LNRegularExpressionPattern+type.m b/Lin/Models/LNRegularExpressionPattern+type.m similarity index 100% rename from Lin/LNRegularExpressionPattern+type.m rename to Lin/Models/LNRegularExpressionPattern+type.m diff --git a/Lin/LNRegularExpressionPattern.h b/Lin/Models/LNRegularExpressionPattern.h similarity index 91% rename from Lin/LNRegularExpressionPattern.h rename to Lin/Models/LNRegularExpressionPattern.h index 6d88698..fa470c5 100644 --- a/Lin/LNRegularExpressionPattern.h +++ b/Lin/Models/LNRegularExpressionPattern.h @@ -17,6 +17,6 @@ + (instancetype)patternWithString:(NSString *)string numberOfRanges:(NSUInteger)numberOfRanges entityRangeIndex:(NSUInteger)entityRangeIndex keyRangeIndex:(NSUInteger)keyRangeIndex; -- (instancetype)initWithString:(NSString *)string numberOfRanges:(NSUInteger)numberOfRanges entityRangeIndex:(NSUInteger)entityRangeIndex keyRangeIndex:(NSUInteger)keyRangeIndex; +- (instancetype)initWithString:(NSString *)string numberOfRanges:(NSUInteger)numberOfRanges entityRangeIndex:(NSUInteger)entityRangeIndex keyRangeIndex:(NSUInteger)keyRangeIndex NS_DESIGNATED_INITIALIZER; @end diff --git a/Lin/LNRegularExpressionPattern.m b/Lin/Models/LNRegularExpressionPattern.m similarity index 100% rename from Lin/LNRegularExpressionPattern.m rename to Lin/Models/LNRegularExpressionPattern.m diff --git a/Lin/NSBundle+versions.h b/Lin/NSBundle+versions.h deleted file mode 100644 index 9b7d984..0000000 --- a/Lin/NSBundle+versions.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// NSBundle+versions.h -// Lin -// -// Created by Tanaka Katsuma on 2013/08/21. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import - -@interface NSBundle (versions) - -- (NSString *)shortVersionString; -- (NSNumber *)buildNumber; - -@end diff --git a/Lin/NSBundle+versions.m b/Lin/NSBundle+versions.m deleted file mode 100644 index e142c77..0000000 --- a/Lin/NSBundle+versions.m +++ /dev/null @@ -1,23 +0,0 @@ -// -// NSBundle+versions.m -// Lin -// -// Created by Tanaka Katsuma on 2013/08/21. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import "NSBundle+versions.h" - -@implementation NSBundle (versions) - -- (NSString *)shortVersionString -{ - return [self objectForInfoDictionaryKey:@"CFBundleShortVersionString"]; -} - -- (NSNumber *)buildNumber -{ - return [self objectForInfoDictionaryKey:@"CFBundleVersion"]; -} - -@end diff --git a/Lin/NSPopoverFrame+Lin.h b/Lin/NSPopoverFrame+Lin.h deleted file mode 100644 index dcf5d2b..0000000 --- a/Lin/NSPopoverFrame+Lin.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// NSPopoverFrame+Lin.h -// Lin -// -// Created by Tanaka Katsuma on 2013/09/21. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import "NSPopoverFrame.h" - -@interface NSPopoverFrame (Lin) - -@end diff --git a/Lin/NSPopoverFrame+Lin.m b/Lin/NSPopoverFrame+Lin.m deleted file mode 100644 index eb501de..0000000 --- a/Lin/NSPopoverFrame+Lin.m +++ /dev/null @@ -1,89 +0,0 @@ -// -// NSPopoverFrame+Lin.m -// Lin -// -// Created by Tanaka Katsuma on 2013/09/21. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import "NSPopoverFrame+Lin.h" -#import - -#import "MethodSwizzle.h" - -@implementation NSPopoverFrame (Lin) - -+ (void)load -{ -// MethodSwizzle(self, @selector(_drawMinimalPopoverAppearanceInRect:anchorEdge:anchorPoint:), @selector(jp_questbeat_lin_drawMinimalPopoverAppearanceInRect:anchorEdge:anchorPoint:)); -} - -- (void)jp_questbeat_lin_drawMinimalPopoverAppearanceInRect:(struct CGRect)arg1 anchorEdge:(unsigned long long)arg2 anchorPoint:(struct CGPoint)arg3 -{ - [self jp_questbeat_lin_drawMinimalPopoverAppearanceInRect:arg1 anchorEdge:arg2 anchorPoint:arg3]; - - // Check OS version - SInt32 major = 0; - SInt32 minor = 0; - Gestalt(gestaltSystemVersionMajor, &major); - Gestalt(gestaltSystemVersionMinor, &minor); - - if ((major == 10 && minor <= 8) || major <= 9) { - // Mac OS X Mountain Lion or older - // This code will cause a problem on Max OS X 10.9 Mavericks (or maybe later) - [[NSColor whiteColor] setFill]; - NSRectFill(arg1); - } else { - // Mac OS X Mavericks or later - CGPathRef path = [self _newMinimalAppearancePathInBounds:arg1 - anchorEdge:arg2 - anchorPoint:arg3 - topCapOnly:NO - arrowOffset:0]; - CGImageRef maskImage = [self _imageMaskForPath:(struct CGPath *)path - anchorEdge:arg2 - anchorPoint:arg3]; - - NSBitmapImageRep *backgroundImageRep = [self backgroundImageRepWithSize:self.bounds.size maskImage:maskImage]; - - CGContextRef context = [[NSGraphicsContext currentContext] graphicsPort]; - CGImageRef backgroundImageRef = [backgroundImageRep CGImage]; - CGContextDrawImage(context, self.bounds, backgroundImageRef); - } -} - -- (NSBitmapImageRep *)backgroundImageRepWithSize:(NSSize)size maskImage:(CGImageRef)maskImage -{ - CGContextRef currentContext = [[NSGraphicsContext currentContext] graphicsPort]; - CGContextSaveGState(currentContext); - - CGFloat scale = [self convertSizeToBacking:CGSizeMake(1, 1)].width; - size.width *= scale; - size.height *= scale; - - CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); - CGContextRef context = CGBitmapContextCreate(NULL, - size.width, - size.height, - 8, - 4 * size.width, - colorSpace, - (CGBitmapInfo)kCGImageAlphaPremultipliedLast); - - CGContextClipToMask(context, CGRectMake(0, 0, size.width, size.height), maskImage); - - CGContextSetFillColorWithColor(context, [[NSColor whiteColor] CGColor]); - CGContextFillRect(context, CGRectMake(0, 0, size.width, size.height)); - - CGImageRef backgroundImageRef = CGBitmapContextCreateImage(context); - NSBitmapImageRep *backgroundImageRep = [[NSBitmapImageRep alloc] initWithCGImage:backgroundImageRef]; - CGImageRelease(backgroundImageRef); - - CGContextRelease(context); - - CGContextRestoreGState(currentContext); - - return backgroundImageRep; -} - -@end diff --git a/Lin/NSPopoverFrame.h b/Lin/NSPopoverFrame.h deleted file mode 100644 index aa25802..0000000 --- a/Lin/NSPopoverFrame.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Generated by class-dump 3.4 (64 bit). - * - * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2012 by Steve Nygard. - */ - -#import - -@class NSImage; - -@interface NSPopoverFrame : NSView - -- (void)_drawMinimalPopoverAppearanceInRect:(struct CGRect)arg1 anchorEdge:(unsigned long long)arg2 anchorPoint:(struct CGPoint)arg3; - -- (struct CGImage *)_imageMaskForPath:(struct CGPath *)arg1 anchorEdge:(unsigned long long)arg2 anchorPoint:(struct CGPoint)arg3; -- (struct CGPath *)_newMinimalAppearancePathInBounds:(struct CGRect)arg1 anchorEdge:(unsigned long long)arg2 anchorPoint:(struct CGPoint)arg3 topCapOnly:(BOOL)arg4 arrowOffset:(double)arg5; -- (struct CGPath *)_newMinimalAppearancePathInBounds:(struct CGRect)arg1 anchorEdge:(unsigned long long)arg2 arrowPosition:(double)arg3 topCapOnly:(BOOL)arg4 arrowOffset:(double)arg5; - -@end - diff --git a/Lin/NSTableView+editedColumnIdentifier.h b/Lin/NSTableView+editedColumnIdentifier.h deleted file mode 100644 index 528fd74..0000000 --- a/Lin/NSTableView+editedColumnIdentifier.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// NSTableView+editedColumnIdentifier.h -// Lin -// -// Created by Tanaka Katsuma on 2013/09/22. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import - -@interface NSTableView (editedColumnIdentifier) - -- (NSString *)editedColumnIdentifier; - -@end diff --git a/Lin/Resources/Media.xcassets/icon120.imageset/Contents.json b/Lin/Resources/Media.xcassets/icon120.imageset/Contents.json new file mode 100644 index 0000000..af55597 --- /dev/null +++ b/Lin/Resources/Media.xcassets/icon120.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "icon120.png" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "icon120@2x.png" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Lin/icon120.png b/Lin/Resources/Media.xcassets/icon120.imageset/icon120.png similarity index 100% rename from Lin/icon120.png rename to Lin/Resources/Media.xcassets/icon120.imageset/icon120.png diff --git a/Lin/icon120@2x.png b/Lin/Resources/Media.xcassets/icon120.imageset/icon120@2x.png similarity index 100% rename from Lin/icon120@2x.png rename to Lin/Resources/Media.xcassets/icon120.imageset/icon120@2x.png diff --git a/Lin/Resources/Media.xcassets/icon_detach.imageset/Contents.json b/Lin/Resources/Media.xcassets/icon_detach.imageset/Contents.json new file mode 100644 index 0000000..a9d5118 --- /dev/null +++ b/Lin/Resources/Media.xcassets/icon_detach.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "icon_detach.png" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "icon_detach@2x.png" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Lin/icon_detach.png b/Lin/Resources/Media.xcassets/icon_detach.imageset/icon_detach.png similarity index 100% rename from Lin/icon_detach.png rename to Lin/Resources/Media.xcassets/icon_detach.imageset/icon_detach.png diff --git a/Lin/icon_detach@2x.png b/Lin/Resources/Media.xcassets/icon_detach.imageset/icon_detach@2x.png similarity index 100% rename from Lin/icon_detach@2x.png rename to Lin/Resources/Media.xcassets/icon_detach.imageset/icon_detach@2x.png diff --git a/Lin/Resources/Media.xcassets/icon_minus.imageset/Contents.json b/Lin/Resources/Media.xcassets/icon_minus.imageset/Contents.json new file mode 100644 index 0000000..00dc3bb --- /dev/null +++ b/Lin/Resources/Media.xcassets/icon_minus.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "icon_minus.png" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "icon_minus@2x.png" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Lin/icon_minus.png b/Lin/Resources/Media.xcassets/icon_minus.imageset/icon_minus.png similarity index 100% rename from Lin/icon_minus.png rename to Lin/Resources/Media.xcassets/icon_minus.imageset/icon_minus.png diff --git a/Lin/icon_minus@2x.png b/Lin/Resources/Media.xcassets/icon_minus.imageset/icon_minus@2x.png similarity index 100% rename from Lin/icon_minus@2x.png rename to Lin/Resources/Media.xcassets/icon_minus.imageset/icon_minus@2x.png diff --git a/Lin/Resources/Media.xcassets/icon_plus.imageset/Contents.json b/Lin/Resources/Media.xcassets/icon_plus.imageset/Contents.json new file mode 100644 index 0000000..a21e529 --- /dev/null +++ b/Lin/Resources/Media.xcassets/icon_plus.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "icon_plus.png" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "icon_plus@2x.png" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Lin/icon_plus.png b/Lin/Resources/Media.xcassets/icon_plus.imageset/icon_plus.png similarity index 100% rename from Lin/icon_plus.png rename to Lin/Resources/Media.xcassets/icon_plus.imageset/icon_plus.png diff --git a/Lin/icon_plus@2x.png b/Lin/Resources/Media.xcassets/icon_plus.imageset/icon_plus@2x.png similarity index 100% rename from Lin/icon_plus@2x.png rename to Lin/Resources/Media.xcassets/icon_plus.imageset/icon_plus@2x.png diff --git a/Lin/LNAlertAccessoryView.xib b/Lin/Resources/XIBs/LNAlertAccessoryView.xib similarity index 100% rename from Lin/LNAlertAccessoryView.xib rename to Lin/Resources/XIBs/LNAlertAccessoryView.xib diff --git a/Lin/LNPopoverContentView.xib b/Lin/Resources/XIBs/MainViewController.xib similarity index 83% rename from Lin/LNPopoverContentView.xib rename to Lin/Resources/XIBs/MainViewController.xib index aeaa319..1f7d03c 100644 --- a/Lin/LNPopoverContentView.xib +++ b/Lin/Resources/XIBs/MainViewController.xib @@ -1,33 +1,32 @@ - + - - + - + + + - - + + - - - - + + + - - + - + @@ -44,6 +43,25 @@ + + + + + + + + + + + + + + + + + + + @@ -89,8 +107,8 @@ - - + + @@ -100,7 +118,7 @@ - - + - - @@ -189,18 +202,12 @@ + - - - - - - - @@ -208,4 +215,4 @@ - \ No newline at end of file + diff --git a/Lin/LNLocalizedStringCollectionOperation.h b/Lin/Shared/LNLocalizedStringCollectionOperation.h similarity index 87% rename from Lin/LNLocalizedStringCollectionOperation.h rename to Lin/Shared/LNLocalizedStringCollectionOperation.h index 5effbca..8e718f5 100644 --- a/Lin/LNLocalizedStringCollectionOperation.h +++ b/Lin/Shared/LNLocalizedStringCollectionOperation.h @@ -17,5 +17,5 @@ typedef void(^LNLocalizedStringCollectionCompletionBlock)(NSString *workspacePat @property (nonatomic, strong) IDEIndex *index; @property (nonatomic, copy) LNLocalizedStringCollectionCompletionBlock collectionCompletedBlock; -- (instancetype)initWithIndex:(IDEIndex *)index; +- (instancetype)initWithIndex:(IDEIndex *)index NS_DESIGNATED_INITIALIZER; @end diff --git a/Lin/LNLocalizedStringCollectionOperation.m b/Lin/Shared/LNLocalizedStringCollectionOperation.m similarity index 100% rename from Lin/LNLocalizedStringCollectionOperation.m rename to Lin/Shared/LNLocalizedStringCollectionOperation.m diff --git a/Lin/LNUserDefaultsManager.h b/Lin/Shared/LNUserDefaultsManager.h similarity index 100% rename from Lin/LNUserDefaultsManager.h rename to Lin/Shared/LNUserDefaultsManager.h diff --git a/Lin/LNUserDefaultsManager.m b/Lin/Shared/LNUserDefaultsManager.m similarity index 100% rename from Lin/LNUserDefaultsManager.m rename to Lin/Shared/LNUserDefaultsManager.m diff --git a/Lin/Lin-Info.plist b/Lin/Supporting Files/Lin-Info.plist similarity index 84% rename from Lin/Lin-Info.plist rename to Lin/Supporting Files/Lin-Info.plist index efc6362..a2aac1d 100644 --- a/Lin/Lin-Info.plist +++ b/Lin/Supporting Files/Lin-Info.plist @@ -9,7 +9,7 @@ CFBundleIconFile CFBundleIdentifier - jp.questbeat.${PRODUCT_NAME:rfc1034identifier} + io.evolved.${PRODUCT_NAME:rfc1034identifier} CFBundleInfoDictionaryVersion 6.0 CFBundleName @@ -17,7 +17,7 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 2.0 + 1.0 CFBundleSignature ???? CFBundleVersion @@ -29,15 +29,13 @@ LSApplicationCategoryType NSHumanReadableCopyright - Copyright © 2013年 Tanaka Katsuma. All rights reserved. + Copyright © 2014 Sascha Schwabbauer. All rights reserved. NSPrincipalClass Lin XC4Compatible XC5Compatible - XCGCReady - XCPluginHasUI diff --git a/Lin/Lin-Prefix.pch b/Lin/Supporting Files/Lin-Prefix.pch similarity index 100% rename from Lin/Lin-Prefix.pch rename to Lin/Supporting Files/Lin-Prefix.pch diff --git a/Lin/en.lproj/InfoPlist.strings b/Lin/Supporting Files/en.lproj/InfoPlist.strings similarity index 100% rename from Lin/en.lproj/InfoPlist.strings rename to Lin/Supporting Files/en.lproj/InfoPlist.strings diff --git a/Lin/LNPopoverContentView.h b/Lin/View Controllers/MainViewController.h similarity index 72% rename from Lin/LNPopoverContentView.h rename to Lin/View Controllers/MainViewController.h index c1e1a4f..3e0577f 100644 --- a/Lin/LNPopoverContentView.h +++ b/Lin/View Controllers/MainViewController.h @@ -1,9 +1,9 @@ // -// LNPopoverContentView.h +// MainViewController.h // Lin // -// Created by Tanaka Katsuma on 2013/09/06. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. +// Created by Sascha Schwabbauer on 03/12/14. +// Copyright (c) 2014 evolved.io. All rights reserved. // #import @@ -14,7 +14,7 @@ extern NSString * const LNPopoverContentViewLocalizationDidSelectNotification; extern NSString * const LNPopoverContentViewAlertDidDismissNotification; extern NSString * const LNPopoverContentViewDetachButtonDidClickNotification; -@interface LNPopoverContentView : NSView +@interface MainViewController : NSViewController @property (nonatomic, weak, readonly) NSTableView *tableView; @property (nonatomic, weak, readonly) NSButton *detachButton; diff --git a/Lin/LNPopoverContentView.m b/Lin/View Controllers/MainViewController.m similarity index 81% rename from Lin/LNPopoverContentView.m rename to Lin/View Controllers/MainViewController.m index 65f6129..40914fe 100644 --- a/Lin/LNPopoverContentView.m +++ b/Lin/View Controllers/MainViewController.m @@ -1,12 +1,12 @@ // -// LNPopoverContentView.m +// MainViewController.m // Lin // -// Created by Tanaka Katsuma on 2013/09/06. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. +// Created by Sascha Schwabbauer on 03/12/14. +// Copyright (c) 2014 evolved.io. All rights reserved. // -#import "LNPopoverContentView.h" +#import "MainViewController.h" // Categories #import "NSTableView+editedColumnIdentifier.h" @@ -16,7 +16,6 @@ #import "LNLocalization.h" // Views -#import "LNTableHeaderCell.h" #import "LNAlertAccessoryView.h" NSString * const LNPopoverContentViewLocalizationKey = @"LNPopoverContentViewLocalizationKey"; @@ -25,7 +24,9 @@ NSString * const LNPopoverContentViewAlertDidDismissNotification = @"LNPopoverContentViewAlertDidDismissNotification"; NSString * const LNPopoverContentViewDetachButtonDidClickNotification = @"LNPopoverContentViewDetachButtonDidClickNotification"; -@interface LNPopoverContentView () +static NSString * const EVOPopoverContentViewCellReuseIdentifier = @"EVOPopoverContentViewCellReuseIdentifier"; + +@interface MainViewController () @property (nonatomic, weak, readwrite) IBOutlet NSTableView *tableView; @property (nonatomic, weak, readwrite) IBOutlet NSButton *detachButton; @@ -39,11 +40,10 @@ - (IBAction)detachPopover:(id)sender; @end -@implementation LNPopoverContentView +@implementation MainViewController -- (void)awakeFromNib -{ - [super awakeFromNib]; +- (void)viewDidLoad { + [super viewDidLoad]; // Set default sort order NSSortDescriptor *sortDescriptor = [NSSortDescriptor sortDescriptorWithKey:@"key" @@ -103,15 +103,15 @@ - (void)textDidEndEditing:(NSNotification *)notification NSInteger editedColumn = [self.tableView editedColumn]; if (editedRow >= 0 && editedColumn >= 0) { - NSTextView *textView = (NSTextView *)[notification.userInfo objectForKey:@"NSFieldEditor"]; + NSTextView *textView = (NSTextView *)notification.userInfo[@"NSFieldEditor"]; // Create a new localization - LNLocalization *localization = [self.sortedLocalizations objectAtIndex:editedRow]; + LNLocalization *localization = self.sortedLocalizations[editedRow]; NSString *key = localization.key; NSString *value = localization.value; - NSString *columnIdentifier = [self.tableView editedColumnIdentifier]; + NSString *columnIdentifier = [self.tableView evo_editedColumnIdentifier]; if ([columnIdentifier isEqualToString:@"key"]) { key = textView.textStorage.string; @@ -142,7 +142,7 @@ - (void)tableViewDidDoubleClick:(id)sender NSInteger clickedRow = [self.tableView clickedRow]; if (clickedRow >= 0) { - LNLocalization *localization = [self.sortedLocalizations objectAtIndex:clickedRow]; + LNLocalization *localization = self.sortedLocalizations[clickedRow]; // Post notification [[NSNotificationCenter defaultCenter] postNotificationName:LNPopoverContentViewLocalizationDidSelectNotification @@ -159,14 +159,14 @@ - (IBAction)addLocalization:(id)sender LNAlertAccessoryView *accessoryView = (LNAlertAccessoryView *)viewController.view; accessoryView.collections = self.collections; - NSAlert *alert = [NSAlert alertWithMessageText:@"Lin" - defaultButton:@"OK" - alternateButton:@"Cancel" - otherButton:nil - informativeTextWithFormat:@"Input a key/value for a new localization."]; + NSAlert *alert = [[NSAlert alloc] init]; + alert.messageText = @"Lin"; + [alert addButtonWithTitle:@"OK"]; + [alert addButtonWithTitle:@"Cancel"]; + alert.informativeText = @"Input a key/value for a new localization."; alert.accessoryView = accessoryView; - NSButton *button = [[alert buttons] objectAtIndex:0]; + NSButton *button = [alert buttons][0]; accessoryView.button = button; // Set icon @@ -176,7 +176,7 @@ - (IBAction)addLocalization:(id)sender // Show alert switch ([alert runModal]) { - case NSAlertDefaultReturn: + case NSAlertFirstButtonReturn: { // Create a new localization LNAlertAccessoryView *accessoryView = (LNAlertAccessoryView *)alert.accessoryView; @@ -218,7 +218,7 @@ - (IBAction)deleteLocalization:(id)sender [self.tableView beginUpdates]; // Delete localization from array - LNLocalization *localization = [self.sortedLocalizations objectAtIndex:selectedRow]; + LNLocalization *localization = self.sortedLocalizations[selectedRow]; NSInteger index = [self.localizations indexOfObject:localization]; [self.localizations removeObjectAtIndex:index]; @@ -292,25 +292,29 @@ - (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView return self.sortedLocalizations.count; } -- (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row -{ - LNLocalization *localization = [self.sortedLocalizations objectAtIndex:row]; +- (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row { + NSTableCellView *cell = [tableView makeViewWithIdentifier:EVOPopoverContentViewCellReuseIdentifier owner:self]; + NSString *identifier = tableColumn.identifier; + LNLocalization *localization = self.sortedLocalizations[row]; + if([identifier isEqualToString:@"table"]) { - return [localization.collection.filePath lastPathComponent]; + cell.textField.stringValue = localization.collection.filePath.lastPathComponent; } else if ([identifier isEqualToString:@"language"]) { - return localization.collection.languageDesignation; + cell.textField.stringValue = localization.collection.languageDesignation; } else if ([identifier isEqualToString:@"key"]) { - return localization.key; + cell.textField.stringValue = localization.key; } else if ([identifier isEqualToString:@"value"]) { - return localization.value; + cell.textField.stringValue = localization.value; + } else { + cell.textField.stringValue = nil; } - return nil; + return cell; } - (void)tableView:(NSTableView *)tableView sortDescriptorsDidChange:(NSArray *)oldDescriptors @@ -319,22 +323,6 @@ - (void)tableView:(NSTableView *)tableView sortDescriptorsDidChange:(NSArray *)o [self configureView]; } - #pragma mark - NSTableViewDelegate -- (void)tableView:(NSTableView *)tableView didClickTableColumn:(NSTableColumn *)clickedTableColumn -{ - for (NSTableColumn *tableColumn in [tableView tableColumns]) { - LNTableHeaderCell *headerCell = (LNTableHeaderCell*)[tableColumn headerCell]; - - if (tableColumn == clickedTableColumn) { - [headerCell setSortAscending:[[[tableView sortDescriptors] objectAtIndex:0] ascending] - priority:0]; - } else { - [headerCell setSortAscending:NO - priority:1]; - } - } -} - @end diff --git a/Lin/LNAlertAccessoryView.h b/Lin/Views/LNAlertAccessoryView.h similarity index 100% rename from Lin/LNAlertAccessoryView.h rename to Lin/Views/LNAlertAccessoryView.h diff --git a/Lin/LNAlertAccessoryView.m b/Lin/Views/LNAlertAccessoryView.m similarity index 100% rename from Lin/LNAlertAccessoryView.m rename to Lin/Views/LNAlertAccessoryView.m diff --git a/Lin/LNHorizontalLine.h b/Lin/Views/LNHorizontalLine.h similarity index 100% rename from Lin/LNHorizontalLine.h rename to Lin/Views/LNHorizontalLine.h diff --git a/Lin/LNHorizontalLine.m b/Lin/Views/LNHorizontalLine.m similarity index 100% rename from Lin/LNHorizontalLine.m rename to Lin/Views/LNHorizontalLine.m diff --git a/Lin/LNPopoverWindow.h b/Lin/Views/LNPopoverWindow.h similarity index 100% rename from Lin/LNPopoverWindow.h rename to Lin/Views/LNPopoverWindow.h diff --git a/Lin/LNPopoverWindow.m b/Lin/Views/LNPopoverWindow.m similarity index 93% rename from Lin/LNPopoverWindow.m rename to Lin/Views/LNPopoverWindow.m index d1998ef..3044bde 100644 --- a/Lin/LNPopoverWindow.m +++ b/Lin/Views/LNPopoverWindow.m @@ -8,11 +8,9 @@ #import "LNPopoverWindow.h" -// Views -#import "LNPopoverContentView.h" - // Controllers #import "LNPopoverWindowController.h" +#import "MainViewController.h" static NSString * const kLNPopoverWindowToolbarSearchFieldIdentifier = @"Search"; @@ -100,9 +98,9 @@ - (NSToolbarItem *)toolbar:(NSToolbar *)toolbar itemForItemIdentifier:(NSString - (void)controlTextDidChange:(NSNotification *)obj { LNPopoverWindowController *popoverWindowController = (LNPopoverWindowController *)self.windowController; - LNPopoverContentView *contentView = (LNPopoverContentView *)popoverWindowController.contentViewController.view; + MainViewController *mainViewController = (MainViewController *)popoverWindowController.contentViewController; - contentView.searchString = self.searchField.stringValue; + mainViewController.searchString = self.searchField.stringValue; } @end diff --git a/Lin/LNPopoverWindowController.h b/Lin/Window Controllers/LNPopoverWindowController.h similarity index 90% rename from Lin/LNPopoverWindowController.h rename to Lin/Window Controllers/LNPopoverWindowController.h index bb0188d..c899dd8 100644 --- a/Lin/LNPopoverWindowController.h +++ b/Lin/Window Controllers/LNPopoverWindowController.h @@ -14,6 +14,6 @@ extern NSString * const LNPopoverWindowControllerWindowWillCloseNotification; @interface LNPopoverWindowController : NSWindowController -- (instancetype)initWithContentViewController:(NSViewController *)contentViewController; +- (instancetype)initWithContentViewController:(NSViewController *)contentViewController NS_DESIGNATED_INITIALIZER; @end diff --git a/Lin/LNPopoverWindowController.m b/Lin/Window Controllers/LNPopoverWindowController.m similarity index 69% rename from Lin/LNPopoverWindowController.m rename to Lin/Window Controllers/LNPopoverWindowController.m index 50b22dc..9eadb81 100644 --- a/Lin/LNPopoverWindowController.m +++ b/Lin/Window Controllers/LNPopoverWindowController.m @@ -15,8 +15,15 @@ @implementation LNPopoverWindowController -- (instancetype)initWithContentViewController:(NSViewController *)contentViewController -{ +- (instancetype)initWithWindow:(NSWindow *)window { + return [self initWithContentViewController:nil]; +} + +- (instancetype)initWithCoder:(NSCoder *)coder { + return [self initWithContentViewController:nil]; +} + +- (instancetype)initWithContentViewController:(NSViewController *)contentViewController { LNPopoverWindow *popoverWindow = [LNPopoverWindow popoverWindow]; popoverWindow.delegate = self; @@ -32,12 +39,8 @@ - (instancetype)initWithContentViewController:(NSViewController *)contentViewCon #pragma mark - NSWindowDelegate -- (void)windowWillClose:(NSNotification *)notification -{ - // Post notification - [[NSNotificationCenter defaultCenter] postNotificationName:LNPopoverWindowControllerWindowWillCloseNotification - object:self - userInfo:nil]; +- (void)windowWillClose:(NSNotification *)notification { + [[NSNotificationCenter defaultCenter] postNotificationName:LNPopoverWindowControllerWindowWillCloseNotification object:self userInfo:nil]; } @end diff --git a/Lin/DVTFilePath.h b/Lin/Xcode-Private-Classes/DVTFilePath.h similarity index 100% rename from Lin/DVTFilePath.h rename to Lin/Xcode-Private-Classes/DVTFilePath.h diff --git a/Lin/DVTSourceTextView.h b/Lin/Xcode-Private-Classes/DVTSourceTextView.h similarity index 100% rename from Lin/DVTSourceTextView.h rename to Lin/Xcode-Private-Classes/DVTSourceTextView.h diff --git a/Lin/IDEEditorDocument.h b/Lin/Xcode-Private-Classes/IDEEditorDocument.h similarity index 100% rename from Lin/IDEEditorDocument.h rename to Lin/Xcode-Private-Classes/IDEEditorDocument.h diff --git a/Lin/IDEIndex.h b/Lin/Xcode-Private-Classes/IDEIndex.h similarity index 100% rename from Lin/IDEIndex.h rename to Lin/Xcode-Private-Classes/IDEIndex.h diff --git a/Lin/IDEIndexCollection.h b/Lin/Xcode-Private-Classes/IDEIndexCollection.h similarity index 100% rename from Lin/IDEIndexCollection.h rename to Lin/Xcode-Private-Classes/IDEIndexCollection.h diff --git a/Lin/IDEWorkspace.h b/Lin/Xcode-Private-Classes/IDEWorkspace.h similarity index 100% rename from Lin/IDEWorkspace.h rename to Lin/Xcode-Private-Classes/IDEWorkspace.h diff --git a/Lin/DVTDualProxyWindow.h b/Lin/Xcode-Private-Classes/IDEWorkspaceWindow.h similarity index 71% rename from Lin/DVTDualProxyWindow.h rename to Lin/Xcode-Private-Classes/IDEWorkspaceWindow.h index c842d38..f7ff645 100644 --- a/Lin/DVTDualProxyWindow.h +++ b/Lin/Xcode-Private-Classes/IDEWorkspaceWindow.h @@ -1,5 +1,5 @@ // -// DVTDualProxyWindow.h +// IDEWorkspaceWindow.h // Lin // // Created by Tanaka Katsuma on 2013/09/26. @@ -8,6 +8,6 @@ #import -@interface DVTDualProxyWindow : NSWindow +@interface IDEWorkspaceWindow : NSWindow @end diff --git a/LinTests/LNDetectorTestSet.h b/LinTests/LNDetectorTestSet.h index 38b80b0..487e2c8 100644 --- a/LinTests/LNDetectorTestSet.h +++ b/LinTests/LNDetectorTestSet.h @@ -13,6 +13,6 @@ @property (nonatomic, copy, readonly) NSString *string; @property (nonatomic, copy, readonly) NSArray *keys; -- (instancetype)initWithString:(NSString *)string keys:(NSString *)keyValue, ... NS_REQUIRES_NIL_TERMINATION; +- (instancetype)initWithString:(NSString *)string keys:(NSString *)keyValue, ... NS_REQUIRES_NIL_TERMINATION NS_DESIGNATED_INITIALIZER; @end From 0d206eddef9b07e2994c36e75f9bce8e0386366a Mon Sep 17 00:00:00 2001 From: Sascha Schwabbauer Date: Thu, 4 Dec 2014 00:16:30 +0100 Subject: [PATCH 03/10] More improvements --- Lin.xcodeproj/project.pbxproj | 6 - .../NSTableView+EditedColumnIdentifier.h | 15 -- .../NSTableView+EditedColumnIdentifier.m | 28 ---- Lin/Lin.m | 1 + Lin/Resources/XIBs/MainViewController.xib | 15 +- Lin/View Controllers/MainViewController.m | 138 ++++++------------ 6 files changed, 60 insertions(+), 143 deletions(-) delete mode 100644 Lin/Categories/NSTableView+EditedColumnIdentifier.h delete mode 100644 Lin/Categories/NSTableView+EditedColumnIdentifier.m diff --git a/Lin.xcodeproj/project.pbxproj b/Lin.xcodeproj/project.pbxproj index 48bc34e..7b20245 100644 --- a/Lin.xcodeproj/project.pbxproj +++ b/Lin.xcodeproj/project.pbxproj @@ -26,7 +26,6 @@ AA470D7D17C3DE31005CBB7F /* LNDetectorTests.m in Sources */ = {isa = PBXBuildFile; fileRef = AA470D7C17C3DE31005CBB7F /* LNDetectorTests.m */; }; AA7D4DB117C74CFE0092DF8A /* LNLocalizationCollection.m in Sources */ = {isa = PBXBuildFile; fileRef = AA7D4DB017C74CFE0092DF8A /* LNLocalizationCollection.m */; }; AA7D4DB417C74D0A0092DF8A /* LNLocalization.m in Sources */ = {isa = PBXBuildFile; fileRef = AA7D4DB317C74D0A0092DF8A /* LNLocalization.m */; }; - AA8F8EF017EDFC68004964FB /* NSTableView+EditedColumnIdentifier.m in Sources */ = {isa = PBXBuildFile; fileRef = AA8F8EEF17EDFC68004964FB /* NSTableView+EditedColumnIdentifier.m */; }; AA95FDEC17EB48A9007D33D4 /* MainViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = AA95FDEB17EB48A9007D33D4 /* MainViewController.xib */; }; AA95FDEF17EB4E77007D33D4 /* LNPopoverWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = AA95FDEE17EB4E77007D33D4 /* LNPopoverWindowController.m */; }; AAAC873317ED9D4F00BF251D /* LNHorizontalLine.m in Sources */ = {isa = PBXBuildFile; fileRef = AAAC873217ED9D4F00BF251D /* LNHorizontalLine.m */; }; @@ -98,8 +97,6 @@ AA7D4DB017C74CFE0092DF8A /* LNLocalizationCollection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LNLocalizationCollection.m; sourceTree = ""; }; AA7D4DB217C74D0A0092DF8A /* LNLocalization.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LNLocalization.h; sourceTree = ""; }; AA7D4DB317C74D0A0092DF8A /* LNLocalization.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LNLocalization.m; sourceTree = ""; }; - AA8F8EEE17EDFC68004964FB /* NSTableView+EditedColumnIdentifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSTableView+EditedColumnIdentifier.h"; sourceTree = ""; }; - AA8F8EEF17EDFC68004964FB /* NSTableView+EditedColumnIdentifier.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSTableView+EditedColumnIdentifier.m"; sourceTree = ""; }; AA93691517C4E4C000E94318 /* IDEWorkspace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDEWorkspace.h; sourceTree = ""; }; AA95FDEB17EB48A9007D33D4 /* MainViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MainViewController.xib; sourceTree = ""; }; AA95FDED17EB4E77007D33D4 /* LNPopoverWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LNPopoverWindowController.h; sourceTree = ""; }; @@ -316,8 +313,6 @@ children = ( AADEADB517C87298001E0C65 /* IDEIndex+Lin.h */, AADEADB617C87298001E0C65 /* IDEIndex+Lin.m */, - AA8F8EEE17EDFC68004964FB /* NSTableView+EditedColumnIdentifier.h */, - AA8F8EEF17EDFC68004964FB /* NSTableView+EditedColumnIdentifier.m */, ); path = Categories; sourceTree = ""; @@ -462,7 +457,6 @@ AA7D4DB117C74CFE0092DF8A /* LNLocalizationCollection.m in Sources */, AAB0CD3417C448200085E913 /* LNRegularExpressionPattern+type.m in Sources */, AAAC873B17EDA9CF00BF251D /* LNPopoverWindow.m in Sources */, - AA8F8EF017EDFC68004964FB /* NSTableView+EditedColumnIdentifier.m in Sources */, AA02CE8E17EE083A0041C2BD /* LNAlertAccessoryView.m in Sources */, AA470D5E17C3D05D005CBB7F /* LNEntity.m in Sources */, AA7D4DB417C74D0A0092DF8A /* LNLocalization.m in Sources */, diff --git a/Lin/Categories/NSTableView+EditedColumnIdentifier.h b/Lin/Categories/NSTableView+EditedColumnIdentifier.h deleted file mode 100644 index 799b996..0000000 --- a/Lin/Categories/NSTableView+EditedColumnIdentifier.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// NSTableView+EditedColumnIdentifier.h -// Lin -// -// Created by Tanaka Katsuma on 2013/09/22. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import - -@interface NSTableView (EditedColumnIdentifier) - -@property (nonatomic, readonly, copy) NSString *evo_editedColumnIdentifier; - -@end diff --git a/Lin/Categories/NSTableView+EditedColumnIdentifier.m b/Lin/Categories/NSTableView+EditedColumnIdentifier.m deleted file mode 100644 index c0213c3..0000000 --- a/Lin/Categories/NSTableView+EditedColumnIdentifier.m +++ /dev/null @@ -1,28 +0,0 @@ -// -// NSTableView+EditedColumnIdentifier.m -// Lin -// -// Created by Tanaka Katsuma on 2013/09/22. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import "NSTableView+EditedColumnIdentifier.h" - -@implementation NSTableView (EditedColumnIdentifier) - -- (NSString *)evo_editedColumnIdentifier { - NSInteger editedColumnIndex = [self editedColumn]; - - NSArray *tableColumns = [self tableColumns]; - for (NSInteger i = 0; i < tableColumns.count; i++) { - NSTableColumn *column = tableColumns[i]; - - if (i == editedColumnIndex) { - return column.identifier; - } - } - - return nil; -} - -@end diff --git a/Lin/Lin.m b/Lin/Lin.m index f4ea914..a7000d8 100644 --- a/Lin/Lin.m +++ b/Lin/Lin.m @@ -153,6 +153,7 @@ - (void)instantiatePopover { - (void)instantiatePopoverWindowController { NSBundle *bundle = [NSBundle bundleForClass:[self class]]; MainViewController *contentViewController = [[MainViewController alloc] initWithNibName:@"MainViewController" bundle:bundle]; + NSLog(@"%@", contentViewController.view); // FIXME [contentViewController.detachButton setHidden:YES]; LNPopoverWindowController *popoverWindowController = [[LNPopoverWindowController alloc] initWithContentViewController:contentViewController]; diff --git a/Lin/Resources/XIBs/MainViewController.xib b/Lin/Resources/XIBs/MainViewController.xib index 1f7d03c..3529e5a 100644 --- a/Lin/Resources/XIBs/MainViewController.xib +++ b/Lin/Resources/XIBs/MainViewController.xib @@ -48,15 +48,24 @@ - - - + + + + + + + + + + + + diff --git a/Lin/View Controllers/MainViewController.m b/Lin/View Controllers/MainViewController.m index 40914fe..b54d2a7 100644 --- a/Lin/View Controllers/MainViewController.m +++ b/Lin/View Controllers/MainViewController.m @@ -8,9 +8,6 @@ #import "MainViewController.h" -// Categories -#import "NSTableView+editedColumnIdentifier.h" - // Models #import "LNLocalizationCollection.h" #import "LNLocalization.h" @@ -46,85 +43,61 @@ - (void)viewDidLoad { [super viewDidLoad]; // Set default sort order - NSSortDescriptor *sortDescriptor = [NSSortDescriptor sortDescriptorWithKey:@"key" - ascending:YES - selector:@selector(compare:)]; + NSSortDescriptor *sortDescriptor = [NSSortDescriptor sortDescriptorWithKey:@"key" ascending:YES selector:@selector(compare:)]; [self.tableView setSortDescriptors:@[sortDescriptor]]; - // Register to notification center - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(textDidEndEditing:) - name:NSControlTextDidEndEditingNotification - object:nil]; + self.tableView.target = self; + self.tableView.doubleAction = @selector(doubleClickedTableView:); } -- (void)dealloc -{ +- (void)dealloc { // Remove from notification center - [[NSNotificationCenter defaultCenter] removeObserver:self - name:NSControlTextDidEndEditingNotification - object:nil]; + [[NSNotificationCenter defaultCenter] removeObserver:self]; } #pragma mark - Accessors -- (void)setTableView:(NSTableView *)tableView -{ - _tableView = tableView; - - // Set double click action - [_tableView setTarget:self]; - [_tableView setDoubleAction:@selector(tableViewDidDoubleClick:)]; -} - -- (void)setCollections:(NSArray *)collections -{ - _collections = collections; - - // Update - [self configureView]; +- (void)setCollections:(NSArray *)collections { + if (![_collections isEqual:collections]) { + _collections = collections; + + [self configureView]; + } } -- (void)setSearchString:(NSString *)searchString -{ - _searchString = searchString; - - // Update - [self configureView]; +- (void)setSearchString:(NSString *)searchString { + if (![_searchString isEqualToString:searchString]) { + _searchString = searchString; + + [self configureView]; + } } +#pragma mark - Actions -#pragma mark - Notifications - -- (void)textDidEndEditing:(NSNotification *)notification -{ - NSInteger editedRow = [self.tableView editedRow]; - NSInteger editedColumn = [self.tableView editedColumn]; +- (IBAction)textChanged:(id)sender { + NSInteger editedRowIndex = [self.tableView rowForView:sender]; + NSInteger editedColumnIndex = [self.tableView columnForView:sender]; - if (editedRow >= 0 && editedColumn >= 0) { - NSTextView *textView = (NSTextView *)notification.userInfo[@"NSFieldEditor"]; + if (editedRowIndex >= 0 && editedColumnIndex >= 0) { + NSTextField *textField = (NSTextField *)sender; // Create a new localization - LNLocalization *localization = self.sortedLocalizations[editedRow]; + LNLocalization *localization = self.sortedLocalizations[editedRowIndex]; NSString *key = localization.key; NSString *value = localization.value; - NSString *columnIdentifier = [self.tableView evo_editedColumnIdentifier]; + NSTableColumn *editedColumn = self.tableView.tableColumns[editedColumnIndex]; - if ([columnIdentifier isEqualToString:@"key"]) { - key = textView.textStorage.string; - } else if ([columnIdentifier isEqualToString:@"value"]) { - value = textView.textStorage.string; + if ([editedColumn.identifier isEqualToString:@"key"]) { + key = textField.stringValue; + } else if ([editedColumn.identifier isEqualToString:@"value"]) { + value = textField.stringValue; } - LNLocalization *newLocalization = [LNLocalization localizationWithKey:key - value:value - entityRange:localization.entityRange - keyRange:localization.keyRange - valueRange:localization.valueRange - collection:localization.collection]; + LNLocalization *newLocalization = [LNLocalization localizationWithKey:key value:value entityRange:localization.entityRange keyRange:localization.keyRange valueRange:localization.valueRange collection:localization.collection]; // Replace in file [localization.collection replaceLocalization:localization withLocalization:newLocalization]; @@ -134,25 +107,18 @@ - (void)textDidEndEditing:(NSNotification *)notification } } - -#pragma mark - Actions - -- (void)tableViewDidDoubleClick:(id)sender -{ - NSInteger clickedRow = [self.tableView clickedRow]; +- (void)doubleClickedTableView:(id)sender { + NSInteger clickedRow = self.tableView.clickedRow; if (clickedRow >= 0) { LNLocalization *localization = self.sortedLocalizations[clickedRow]; // Post notification - [[NSNotificationCenter defaultCenter] postNotificationName:LNPopoverContentViewLocalizationDidSelectNotification - object:self - userInfo:@{LNPopoverContentViewLocalizationKey: localization}]; + [[NSNotificationCenter defaultCenter] postNotificationName:LNPopoverContentViewLocalizationDidSelectNotification object:self userInfo:@{LNPopoverContentViewLocalizationKey: localization}]; } } -- (IBAction)addLocalization:(id)sender -{ +- (IBAction)addLocalization:(id)sender { // Create alert NSBundle *bundle = [NSBundle bundleForClass:[self class]]; NSViewController *viewController = [[NSViewController alloc] initWithNibName:@"LNAlertAccessoryView" bundle:bundle]; @@ -210,8 +176,7 @@ - (IBAction)addLocalization:(id)sender } } -- (IBAction)deleteLocalization:(id)sender -{ +- (IBAction)deleteLocalization:(id)sender { NSInteger selectedRow = [self.tableView selectedRow]; if (selectedRow >= 0) { @@ -230,26 +195,21 @@ - (IBAction)deleteLocalization:(id)sender [collection deleteLocalization:localization]; // Delete localization from table view - [self.tableView removeRowsAtIndexes:[NSIndexSet indexSetWithIndex:selectedRow] - withAnimation:NSTableViewAnimationEffectFade]; + [self.tableView removeRowsAtIndexes:[NSIndexSet indexSetWithIndex:selectedRow] withAnimation:NSTableViewAnimationEffectFade]; [self.tableView endUpdates]; } } -- (IBAction)detachPopover:(id)sender -{ +- (IBAction)detachPopover:(id)sender { // Post notification - [[NSNotificationCenter defaultCenter] postNotificationName:LNPopoverContentViewDetachButtonDidClickNotification - object:self - userInfo:nil]; + [[NSNotificationCenter defaultCenter] postNotificationName:LNPopoverContentViewDetachButtonDidClickNotification object:self userInfo:nil]; } #pragma mark - Updating and Drawing the View -- (void)reloadLocalizations -{ +- (void)reloadLocalizations { NSMutableArray *localizations = [NSMutableArray array]; for (LNLocalizationCollection *collection in self.collections) { @@ -259,8 +219,7 @@ - (void)reloadLocalizations self.localizations = localizations; } -- (void)filterLocalizations -{ +- (void)filterLocalizations { // Filter localizations NSArray *filteredLocalizations = self.localizations; @@ -272,8 +231,7 @@ - (void)filterLocalizations self.sortedLocalizations = [[filteredLocalizations sortedArrayUsingDescriptors:self.tableView.sortDescriptors] mutableCopy]; } -- (void)configureView -{ +- (void)configureView { // Reload localizations [self reloadLocalizations]; @@ -287,8 +245,7 @@ - (void)configureView #pragma mark - NSTableViewDataSource -- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView -{ +- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView { return self.sortedLocalizations.count; } @@ -301,28 +258,27 @@ - (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn if([identifier isEqualToString:@"table"]) { cell.textField.stringValue = localization.collection.filePath.lastPathComponent; + cell.textField.editable = NO; } else if ([identifier isEqualToString:@"language"]) { cell.textField.stringValue = localization.collection.languageDesignation; + cell.textField.editable = NO; } else if ([identifier isEqualToString:@"key"]) { cell.textField.stringValue = localization.key; + cell.textField.editable = YES; } else if ([identifier isEqualToString:@"value"]) { cell.textField.stringValue = localization.value; - } else { - cell.textField.stringValue = nil; + cell.textField.editable = YES; } return cell; } -- (void)tableView:(NSTableView *)tableView sortDescriptorsDidChange:(NSArray *)oldDescriptors -{ +- (void)tableView:(NSTableView *)tableView sortDescriptorsDidChange:(NSArray *)oldDescriptors { // Update [self configureView]; } -#pragma mark - NSTableViewDelegate - @end From 1ce8dad9077a2cbdabf6597ec2222a8a8b9e54db Mon Sep 17 00:00:00 2001 From: Sascha Schwabbauer Date: Thu, 4 Dec 2014 00:27:40 +0100 Subject: [PATCH 04/10] Updated readme --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index ef33746..982f1e9 100755 --- a/README.md +++ b/README.md @@ -1,16 +1,16 @@ # Lin -Lin is a open source plug-in for **Xcode 5**. +Lin is a open source plug-in for **Xcode 6**. It lets you search/manage localizations without opening the .strings files. -[![Build Status](https://travis-ci.org/questbeat/Lin-Xcode5.svg?branch=master)](https://travis-ci.org/questbeat/Lin-Xcode5) +[![Build Status](https://travis-ci.org/sascha/Lin-Xcode6.svg?branch=master)](https://travis-ci.org/sascha/Lin-Xcode6) ![01.png](http://questbe.at/lin/img/screenshots/01.png) -Lin for Xcode 4 (previous version) -[questbeat/Lin](https://github.com/questbeat/Lin) - - +Lin for Xcode 5 +[questbeat/Lin](https://github.com/questbeat/Lin-Xcode5) +Lin for Xcode 4 +[questbeat/Lin](https://github.com/questbeat/Lin) ## Features When you are focusing on NSLocalizedString or other functions to get a localized version of a string, Lin shows the list of localizations that contains the inputted key string. From 60b3af963fd9d0e532c1dcb73ad9472fefd57474 Mon Sep 17 00:00:00 2001 From: Sascha Schwabbauer Date: Thu, 4 Dec 2014 00:32:39 +0100 Subject: [PATCH 05/10] Removed files on .gitignore --- .gitignore | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 747901d..c21a9f2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,5 @@ -# Generated by http://gitignore.io - -### Objective-C ### -# Xcode .DS_Store -*/build/* +build/ *.pbxuser !default.pbxuser *.mode1v3 @@ -20,4 +16,6 @@ profile DerivedData .idea/ *.hmap - +*.xccheckout +*.ipa +*.xcuserstate From 5cc7fb5391d10af0d1147719d8b5529e3e7e30a8 Mon Sep 17 00:00:00 2001 From: Sascha Schwabbauer Date: Sat, 6 Dec 2014 20:27:21 +0100 Subject: [PATCH 06/10] Adding a localization uses a popover instead of an alert now --- Lin.xcodeproj/project.pbxproj | 20 +- .../xcshareddata/xcschemes/Lin.xcscheme | 9 + Lin/Lin.m | 388 ++++++++---------- Lin/Resources/XIBs/AddViewController.xib | 201 +++++++++ Lin/Resources/XIBs/LNAlertAccessoryView.xib | 121 ------ Lin/View Controllers/AddViewController.h | 27 ++ Lin/View Controllers/AddViewController.m | 133 ++++++ Lin/View Controllers/MainViewController.h | 2 +- Lin/View Controllers/MainViewController.m | 131 +++--- Lin/Views/LNAlertAccessoryView.h | 22 - Lin/Views/LNAlertAccessoryView.m | 138 ------- 11 files changed, 604 insertions(+), 588 deletions(-) create mode 100644 Lin/Resources/XIBs/AddViewController.xib delete mode 100644 Lin/Resources/XIBs/LNAlertAccessoryView.xib create mode 100644 Lin/View Controllers/AddViewController.h create mode 100644 Lin/View Controllers/AddViewController.m delete mode 100644 Lin/Views/LNAlertAccessoryView.h delete mode 100644 Lin/Views/LNAlertAccessoryView.m diff --git a/Lin.xcodeproj/project.pbxproj b/Lin.xcodeproj/project.pbxproj index 7b20245..edec8eb 100644 --- a/Lin.xcodeproj/project.pbxproj +++ b/Lin.xcodeproj/project.pbxproj @@ -7,11 +7,11 @@ objects = { /* Begin PBXBuildFile section */ + 2B0E049B1A3385AE0052E29D /* AddViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2B0E049A1A3385AE0052E29D /* AddViewController.m */; }; 2B2FEC9B1A2F894500D0534D /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2B2FEC9A1A2F894500D0534D /* MainViewController.m */; }; 2BC7C6A51A2FC3C60065C278 /* Media.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2BC7C6A41A2FC3C60065C278 /* Media.xcassets */; }; 2BC7C6A81A2FC4690065C278 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 2BC7C6AA1A2FC4690065C278 /* InfoPlist.strings */; }; - AA02CE8B17EE08240041C2BD /* LNAlertAccessoryView.xib in Resources */ = {isa = PBXBuildFile; fileRef = AA02CE8A17EE08240041C2BD /* LNAlertAccessoryView.xib */; }; - AA02CE8E17EE083A0041C2BD /* LNAlertAccessoryView.m in Sources */ = {isa = PBXBuildFile; fileRef = AA02CE8D17EE083A0041C2BD /* LNAlertAccessoryView.m */; }; + AA02CE8B17EE08240041C2BD /* AddViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = AA02CE8A17EE08240041C2BD /* AddViewController.xib */; }; AA1B7DA717C3C1EC00A3A6D7 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AA1B7DA617C3C1EC00A3A6D7 /* Cocoa.framework */; }; AA1B7DBA17C3C20F00A3A6D7 /* Lin.m in Sources */ = {isa = PBXBuildFile; fileRef = AA1B7DB917C3C20F00A3A6D7 /* Lin.m */; }; AA2980B417EE2C5300CF46E3 /* LNUserDefaultsManager.m in Sources */ = {isa = PBXBuildFile; fileRef = AA2980B317EE2C5300CF46E3 /* LNUserDefaultsManager.m */; }; @@ -56,13 +56,13 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 2B0E04991A3385AE0052E29D /* AddViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddViewController.h; sourceTree = ""; }; + 2B0E049A1A3385AE0052E29D /* AddViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AddViewController.m; sourceTree = ""; }; 2B2FEC991A2F894500D0534D /* MainViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainViewController.h; sourceTree = ""; }; 2B2FEC9A1A2F894500D0534D /* MainViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainViewController.m; sourceTree = ""; }; 2BC7C6A41A2FC3C60065C278 /* Media.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Media.xcassets; sourceTree = ""; }; 2BC7C6A91A2FC4690065C278 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; - AA02CE8A17EE08240041C2BD /* LNAlertAccessoryView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = LNAlertAccessoryView.xib; sourceTree = ""; }; - AA02CE8C17EE083A0041C2BD /* LNAlertAccessoryView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LNAlertAccessoryView.h; sourceTree = ""; }; - AA02CE8D17EE083A0041C2BD /* LNAlertAccessoryView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LNAlertAccessoryView.m; sourceTree = ""; }; + AA02CE8A17EE08240041C2BD /* AddViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = AddViewController.xib; sourceTree = ""; }; AA11AC4017C66F0200889DFB /* DVTFilePath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVTFilePath.h; sourceTree = ""; }; AA11AC4317C6746800889DFB /* IDEIndex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDEIndex.h; sourceTree = ""; }; AA11AC4617C6755400889DFB /* IDEIndexCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDEIndexCollection.h; sourceTree = ""; }; @@ -147,6 +147,8 @@ 2B2FEC981A2F890C00D0534D /* View Controllers */ = { isa = PBXGroup; children = ( + 2B0E04991A3385AE0052E29D /* AddViewController.h */, + 2B0E049A1A3385AE0052E29D /* AddViewController.m */, 2B2FEC991A2F894500D0534D /* MainViewController.h */, 2B2FEC9A1A2F894500D0534D /* MainViewController.m */, ); @@ -156,7 +158,7 @@ 2BC7C6A31A2FC3A10065C278 /* XIBs */ = { isa = PBXGroup; children = ( - AA02CE8A17EE08240041C2BD /* LNAlertAccessoryView.xib */, + AA02CE8A17EE08240041C2BD /* AddViewController.xib */, AA95FDEB17EB48A9007D33D4 /* MainViewController.xib */, ); path = XIBs; @@ -338,8 +340,6 @@ AADDDAA017C4A3BA00BBA67C /* Views */ = { isa = PBXGroup; children = ( - AA02CE8C17EE083A0041C2BD /* LNAlertAccessoryView.h */, - AA02CE8D17EE083A0041C2BD /* LNAlertAccessoryView.m */, AAAC873117ED9D4F00BF251D /* LNHorizontalLine.h */, AAAC873217ED9D4F00BF251D /* LNHorizontalLine.m */, AAAC873917EDA9CF00BF251D /* LNPopoverWindow.h */, @@ -433,7 +433,7 @@ files = ( AA95FDEC17EB48A9007D33D4 /* MainViewController.xib in Resources */, 2BC7C6A81A2FC4690065C278 /* InfoPlist.strings in Resources */, - AA02CE8B17EE08240041C2BD /* LNAlertAccessoryView.xib in Resources */, + AA02CE8B17EE08240041C2BD /* AddViewController.xib in Resources */, 2BC7C6A51A2FC3C60065C278 /* Media.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -457,9 +457,9 @@ AA7D4DB117C74CFE0092DF8A /* LNLocalizationCollection.m in Sources */, AAB0CD3417C448200085E913 /* LNRegularExpressionPattern+type.m in Sources */, AAAC873B17EDA9CF00BF251D /* LNPopoverWindow.m in Sources */, - AA02CE8E17EE083A0041C2BD /* LNAlertAccessoryView.m in Sources */, AA470D5E17C3D05D005CBB7F /* LNEntity.m in Sources */, AA7D4DB417C74D0A0092DF8A /* LNLocalization.m in Sources */, + 2B0E049B1A3385AE0052E29D /* AddViewController.m in Sources */, AAB0CD3117C4382D0085E913 /* LNRegularExpressionPattern.m in Sources */, AA1B7DBA17C3C20F00A3A6D7 /* Lin.m in Sources */, AAAC873317ED9D4F00BF251D /* LNHorizontalLine.m in Sources */, diff --git a/Lin.xcodeproj/xcshareddata/xcschemes/Lin.xcscheme b/Lin.xcodeproj/xcshareddata/xcschemes/Lin.xcscheme index 32d3fd1..baa7026 100644 --- a/Lin.xcodeproj/xcshareddata/xcschemes/Lin.xcscheme +++ b/Lin.xcodeproj/xcshareddata/xcschemes/Lin.xcscheme @@ -76,6 +76,15 @@ useCustomWorkingDirectory = "NO" buildConfiguration = "Release" debugDocumentVersioning = "YES"> + + + + diff --git a/Lin/Lin.m b/Lin/Lin.m index a7000d8..4d05ccf 100644 --- a/Lin/Lin.m +++ b/Lin/Lin.m @@ -33,23 +33,23 @@ static Lin *_sharedPlugin = nil; -@interface NSPopover () - -- (id)_popoverWindow; - -@end +//@interface NSPopover () +// +//- (id)_popoverWindow; +// +//@end @interface Lin () @property (nonatomic, strong) NSPopover *popover; -@property (nonatomic, strong) LNPopoverWindowController *popoverWindowController; +//@property (nonatomic, strong) LNPopoverWindowController *popoverWindowController; @property (nonatomic, strong) NSTextView *textView; @property (nonatomic, strong) LNDetector *detector; @property (nonatomic, strong) NSMutableDictionary *workspaceLocalizations; @property (nonatomic, copy) NSString *currentWorkspaceFilePath; -@property (nonatomic, unsafe_unretained) NSResponder *previousFirstResponder; +////@property (nonatomic, weak) NSResponder *previousFirstResponder; @property (nonatomic, assign, getter = isActivated) BOOL activated; @property (nonatomic, strong) NSMenuItem *enableMenuItem; @@ -84,44 +84,20 @@ - (instancetype)init { // Load views [self instantiatePopover]; - [self instantiatePopoverWindowController]; +// [self instantiatePopoverWindowController]; // Register to notification center - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(workspaceWindowDidBecomeMain:) - name:NSWindowDidBecomeMainNotification - object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(indexDidIndexWorkspace:) - name:@"IDEIndexDidIndexWorkspaceNotification" - object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(editorDocumentDidSave:) - name:@"IDEEditorDocumentDidSaveNotification" - object:nil]; - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(popoverWindowControllerWindowWillClose:) - name:LNPopoverWindowControllerWindowWillCloseNotification - object:nil]; - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(popoverContentViewLocalizationDidSelect:) - name:LNPopoverContentViewLocalizationDidSelectNotification - object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(popoverContentViewAlertDidDismiss:) - name:LNPopoverContentViewAlertDidDismissNotification - object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(popoverContentViewDetachButtonDidClick:) - name:LNPopoverContentViewDetachButtonDidClickNotification - object:nil]; - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(menuDidChange:) - name:NSMenuDidChangeItemNotification - object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(workspaceWindowDidBecomeMain:) name:NSWindowDidBecomeMainNotification object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(indexDidIndexWorkspace:) name:@"IDEIndexDidIndexWorkspaceNotification" object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(editorDocumentDidSave:) name:@"IDEEditorDocumentDidSaveNotification" object:nil]; + +// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(popoverWindowControllerWindowWillClose:) name:LNPopoverWindowControllerWindowWillCloseNotification object:nil]; + +// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(popoverContentViewLocalizationDidSelect:) name:LNPopoverContentViewLocalizationDidSelectNotification object:nil]; +// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(popoverContentViewAlertDidDismiss:) name:LNPopoverContentViewAlertDidDismissNotification object:nil]; +// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(popoverContentViewDetachButtonDidClick:) name:LNPopoverContentViewDetachButtonDidClickNotification object:nil]; + + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(menuDidChange:) name:NSMenuDidChangeItemNotification object:nil]; // Activate if enabled if ([[LNUserDefaultsManager sharedManager] isEnabled]) { @@ -138,61 +114,33 @@ - (instancetype)init { - (void)instantiatePopover { NSBundle *bundle = [NSBundle bundleForClass:[self class]]; MainViewController *contentViewController = [[MainViewController alloc] initWithNibName:@"MainViewController" bundle:bundle]; - NSLog(@"%@", contentViewController.view); // FIXME - contentViewController.tableView.selectionHighlightStyle = NSTableViewSelectionHighlightStyleSourceList; + contentViewController.inPopover = YES; NSPopover *popover = [[NSPopover alloc] init]; popover.delegate = self; - popover.behavior = NSPopoverBehaviorTransient; popover.animates = NO; + popover.behavior = NSPopoverBehaviorTransient; popover.contentViewController = contentViewController; self.popover = popover; } - -- (void)instantiatePopoverWindowController { - NSBundle *bundle = [NSBundle bundleForClass:[self class]]; - MainViewController *contentViewController = [[MainViewController alloc] initWithNibName:@"MainViewController" bundle:bundle]; - NSLog(@"%@", contentViewController.view); // FIXME - [contentViewController.detachButton setHidden:YES]; - - LNPopoverWindowController *popoverWindowController = [[LNPopoverWindowController alloc] initWithContentViewController:contentViewController]; - - self.popoverWindowController = popoverWindowController; -} +// +//- (void)instantiatePopoverWindowController { +// NSBundle *bundle = [NSBundle bundleForClass:[self class]]; +// MainViewController *contentViewController = [[MainViewController alloc] initWithNibName:@"MainViewController" bundle:bundle]; +// contentViewController.inPopover = NO; +// +// LNPopoverWindowController *popoverWindowController = [[LNPopoverWindowController alloc] initWithContentViewController:contentViewController]; +// +// self.popoverWindowController = popoverWindowController; +//} - (void)dealloc { // Deactivate [self deactivate]; // Remove from notification center - [[NSNotificationCenter defaultCenter] removeObserver:self - name:NSWindowDidBecomeMainNotification - object:nil]; - [[NSNotificationCenter defaultCenter] removeObserver:self - name:@"IDEIndexDidIndexWorkspaceNotification" - object:nil]; - [[NSNotificationCenter defaultCenter] removeObserver:self - name:@"IDEEditorDocumentDidSaveNotification" - object:nil]; - - [[NSNotificationCenter defaultCenter] removeObserver:self - name:LNPopoverWindowControllerWindowWillCloseNotification - object:nil]; - - [[NSNotificationCenter defaultCenter] removeObserver:self - name:LNPopoverContentViewLocalizationDidSelectNotification - object:nil]; - [[NSNotificationCenter defaultCenter] removeObserver:self - name:LNPopoverContentViewAlertDidDismissNotification - object:nil]; - [[NSNotificationCenter defaultCenter] removeObserver:self - name:LNPopoverContentViewDetachButtonDidClickNotification - object:nil]; - - [[NSNotificationCenter defaultCenter] removeObserver:self - name:NSMenuDidChangeItemNotification - object:nil]; + [[NSNotificationCenter defaultCenter] removeObserver:self]; } @@ -202,14 +150,8 @@ - (void)activate { if (!self.activated) { self.activated = YES; - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(textDidChange:) - name:NSTextDidChangeNotification - object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(textViewDidChangeSelection:) - name:NSTextViewDidChangeSelectionNotification - object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textDidChange:) name:NSTextDidChangeNotification object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textViewDidChangeSelection:) name:NSTextViewDidChangeSelectionNotification object:nil]; } } @@ -217,12 +159,8 @@ - (void)deactivate { if (self.activated) { self.activated = NO; - [[NSNotificationCenter defaultCenter] removeObserver:self - name:NSTextDidChangeNotification - object:nil]; - [[NSNotificationCenter defaultCenter] removeObserver:self - name:NSTextViewDidChangeSelectionNotification - object:nil]; + [[NSNotificationCenter defaultCenter] removeObserver:self name:NSTextDidChangeNotification object:nil]; + [[NSNotificationCenter defaultCenter] removeObserver:self name:NSTextViewDidChangeSelectionNotification object:nil]; } } @@ -230,8 +168,8 @@ - (void)deactivate { #pragma mark - Notifications - (void)textDidChange:(NSNotification *)notification { - if ([[notification object] isKindOfClass:[DVTSourceTextView class]]) { - NSTextView *textView = (NSTextView *)[notification object]; + if ([notification.object isKindOfClass:DVTSourceTextView.class]) { + NSTextView *textView = (NSTextView *)notification.object; self.textView = textView; // Find entity @@ -246,8 +184,8 @@ - (void)textDidChange:(NSNotification *)notification { } - (void)textViewDidChangeSelection:(NSNotification *)notification { - if ([[notification object] isKindOfClass:[DVTSourceTextView class]]) { - NSTextView *textView = (NSTextView *)[notification object]; + if ([notification.object isKindOfClass:DVTSourceTextView.class]) { + NSTextView *textView = (NSTextView *)notification.object; self.textView = textView; // Find entity @@ -262,8 +200,8 @@ - (void)textViewDidChangeSelection:(NSNotification *)notification { } - (void)workspaceWindowDidBecomeMain:(NSNotification *)notification { - if ([[notification object] isKindOfClass:[IDEWorkspaceWindow class]]) { - NSWindow *workspaceWindow = (NSWindow *)[notification object]; + if ([notification.object isKindOfClass:IDEWorkspaceWindow.class]) { + NSWindow *workspaceWindow = (NSWindow *)notification.object; NSWindowController *workspaceWindowController = (NSWindowController *)workspaceWindow.windowController; IDEWorkspace *workspace = (IDEWorkspace *)[workspaceWindowController valueForKey:@"_workspace"]; @@ -275,12 +213,12 @@ - (void)workspaceWindowDidBecomeMain:(NSNotification *)notification { } - (void)indexDidIndexWorkspace:(NSNotification *)notification { - IDEIndex *index = (IDEIndex *)[notification object]; + IDEIndex *index = (IDEIndex *)notification.object; [self indexNeedsUpdate:index]; } - (void)editorDocumentDidSave:(NSNotification *)notification { - IDEEditorDocument *editorDocument = (IDEEditorDocument *)[notification object]; + IDEEditorDocument *editorDocument = (IDEEditorDocument *)notification.object; DVTFilePath *filePath = editorDocument.filePath; NSString *pathString = filePath.pathString; @@ -296,72 +234,67 @@ - (void)editorDocumentDidSave:(NSNotification *)notification { } } -- (void)popoverWindowControllerWindowWillClose:(NSNotification *)notification { - // Instantiate popover - [self instantiatePopover]; -} - -- (void)popoverContentViewLocalizationDidSelect:(NSNotification *)notification { - NSTextView *textView = self.textView; - LNEntity *entity = [self selectedEntityInTextView:textView]; - - if (entity) { - NSArray *selectedRanges = textView.selectedRanges; - - if (selectedRanges.count > 0) { - NSRange selectedRange = [selectedRanges[0] rangeValue]; - - // Locate the key - NSRange lineRange = [textView.textStorage.string lineRangeForRange:selectedRange]; - NSRange keyRange = NSMakeRange(lineRange.location + entity.keyRange.location, entity.keyRange.length); - - // Replace - LNLocalization *localization = [notification userInfo][LNPopoverContentViewLocalizationKey]; - [textView insertText:localization.key replacementRange:keyRange]; - } - } -} - -- (void)popoverContentViewAlertDidDismiss:(NSNotification *)notification { - // Show popover again - [self presentPopoverInTextView:self.textView entity:[self selectedEntityInTextView:self.textView]]; -} - -- (void)popoverContentViewDetachButtonDidClick:(NSNotification *)notification { - [self preparePopoverWindow]; - [self detachPopover]; -} +//- (void)popoverWindowControllerWindowWillClose:(NSNotification *)notification { +// // Instantiate popover +// [self instantiatePopover]; +//} + +//- (void)popoverContentViewLocalizationDidSelect:(NSNotification *)notification { +// NSTextView *textView = self.textView; +// LNEntity *entity = [self selectedEntityInTextView:textView]; +// +// if (entity) { +// NSArray *selectedRanges = textView.selectedRanges; +// +// if (selectedRanges.count > 0) { +// NSRange selectedRange = [selectedRanges[0] rangeValue]; +// +// // Locate the key +// NSRange lineRange = [textView.textStorage.string lineRangeForRange:selectedRange]; +// NSRange keyRange = NSMakeRange(lineRange.location + entity.keyRange.location, entity.keyRange.length); +// +// // Replace +// LNLocalization *localization = [notification userInfo][LNPopoverContentViewLocalizationKey]; +// [textView insertText:localization.key replacementRange:keyRange]; +// } +// } +//} + +//- (void)popoverContentViewAlertDidDismiss:(NSNotification *)notification { +// // Show popover again +// [self presentPopoverInTextView:self.textView entity:[self selectedEntityInTextView:self.textView]]; +//} + +//- (void)popoverContentViewDetachButtonDidClick:(NSNotification *)notification { +// [self preparePopoverWindow]; +// [self detachPopover]; +//} - (void)menuDidChange:(NSNotification *)notification { // Create menu item [self createMenuItem]; } +#pragma mark - Detaching Popover -#pragma mark - Detachig Popover - -- (void)preparePopoverWindow { - // Resize popover window - NSWindow *popoverWindow = [self.popover _popoverWindow]; - - [self.popoverWindowController.window setFrame:NSMakeRect(popoverWindow.frame.origin.x, - popoverWindow.frame.origin.y - (80.0 / 2.0), - self.popover.contentSize.width, - self.popover.contentSize.height + 80.0) - display:NO]; - - // Copy popover content - MainViewController *popoverContentView = (MainViewController *)self.popover.contentViewController; - popoverContentView.tableView.sortDescriptors = popoverContentView.tableView.sortDescriptors; - popoverContentView.collections = popoverContentView.collections; - popoverContentView.searchString = popoverContentView.searchString; -} - -- (void)detachPopover { - [self dismissPopover]; - [self.popoverWindowController showWindow:nil]; -} +//- (void)preparePopoverWindow { +// // Resize popover window +// NSWindow *popoverWindow = [self.popover _popoverWindow]; +// +// [self.popoverWindowController.window setFrame:NSMakeRect(popoverWindow.frame.origin.x, popoverWindow.frame.origin.y - (80.0 / 2.0), self.popover.contentSize.width, self.popover.contentSize.height + 80.0) display:NO]; +// +// // Copy popover content +// MainViewController *popoverMainViewController = (MainViewController *)self.popover.contentViewController; +// MainViewController *popoverWindowMainViewController = (MainViewController *)self.popoverWindowController.contentViewController; +// popoverWindowMainViewController.tableView.sortDescriptors = popoverMainViewController.tableView.sortDescriptors; +// popoverWindowMainViewController.collections = popoverMainViewController.collections; +// popoverWindowMainViewController.searchString = popoverMainViewController.searchString; +//} +//- (void)detachPopover { +// [self dismissPopover]; +// [self.popoverWindowController showWindow:nil]; +//} #pragma mark - Entity @@ -390,15 +323,14 @@ - (LNEntity *)selectedEntityInTextView:(NSTextView *)textView { return nil; } - #pragma mark - Menu - (void)createMenuItem { NSMenuItem *editorMenuItem = [[NSApp mainMenu] itemWithTitle:@"Editor"]; - if (editorMenuItem && [[editorMenuItem submenu] itemWithTitle:@"Lin"] == nil) { + if (editorMenuItem && [editorMenuItem.submenu itemWithTitle:@"Lin"] == nil) { // Load defaults - BOOL enabled = [[LNUserDefaultsManager sharedManager] isEnabled]; + BOOL enabled = LNUserDefaultsManager.sharedManager.isEnabled; NSMenuItem *menuItem = [[NSMenuItem alloc] initWithTitle:@"Lin" action:NULL keyEquivalent:@""]; @@ -421,21 +353,21 @@ - (void)createMenuItem { self.showWindowMenuItem = showWindowMenuItem; // Separator - [submenu addItem:[NSMenuItem separatorItem]]; + [submenu addItem:NSMenuItem.separatorItem]; // Version Info NSMenuItem *versionInfoMenuItem = [[NSMenuItem alloc] initWithTitle:@"Version Info" action:@selector(showVersionInfo:) keyEquivalent:@""]; [versionInfoMenuItem setTarget:self]; [submenu addItem:versionInfoMenuItem]; - [[editorMenuItem submenu] addItem:[NSMenuItem separatorItem]]; - [[editorMenuItem submenu] addItem:menuItem]; + [editorMenuItem.submenu addItem:NSMenuItem.separatorItem]; + [editorMenuItem.submenu addItem:menuItem]; } } - (BOOL)validateMenuItem:(NSMenuItem *)menuItem { if (menuItem == self.showWindowMenuItem) { - return [[LNUserDefaultsManager sharedManager] isEnabled]; + return LNUserDefaultsManager.sharedManager.isEnabled; } return YES; @@ -443,8 +375,8 @@ - (BOOL)validateMenuItem:(NSMenuItem *)menuItem { - (void)toggleEnabled:(id)sender { // Save defaults - LNUserDefaultsManager *userDefaultManager = [LNUserDefaultsManager sharedManager]; - BOOL enabled = ![userDefaultManager isEnabled]; + LNUserDefaultsManager *userDefaultManager = LNUserDefaultsManager.sharedManager; + BOOL enabled = !userDefaultManager.isEnabled; userDefaultManager.enabled = enabled; // Update menu item @@ -459,17 +391,17 @@ - (void)toggleEnabled:(id)sender { } - (void)showWindow:(id)sender { - // Prepare window - NSArray *collections = self.workspaceLocalizations[self.currentWorkspaceFilePath]; - - MainViewController *mainViewController = (MainViewController *)self.popoverWindowController.contentViewController; - mainViewController.collections = collections; - mainViewController.searchString = @""; - - // Show window - [self.popoverWindowController.window setFrame:NSMakeRect(0, 0, 500, 280) display:NO]; - [self.popoverWindowController.window center]; - [self.popoverWindowController showWindow:nil]; +// // Prepare window +// NSArray *collections = self.workspaceLocalizations[self.currentWorkspaceFilePath]; +// +// MainViewController *mainViewController = (MainViewController *)self.popoverWindowController.contentViewController; +// mainViewController.collections = collections; +// mainViewController.searchString = @""; +// +// // Show window +// [self.popoverWindowController.window setFrame:NSMakeRect(0, 0, 500, 280) display:NO]; +// [self.popoverWindowController.window center]; +// [self.popoverWindowController showWindow:nil]; } - (void)showVersionInfo:(id)sender { @@ -489,7 +421,6 @@ - (void)showVersionInfo:(id)sender { [alert runModal]; } - #pragma mark - Index - (void)indexNeedsUpdate:(IDEIndex *)index { @@ -508,12 +439,12 @@ - (void)updateLocalizationsForIndex:(IDEIndex *)index { self.workspaceLocalizations[workspaceFilePath] = collections; if ([workspaceFilePath isEqualToString:self.currentWorkspaceFilePath]) { if ([self.popover isShown]) { - MainViewController *mainViewController = (MainViewController *)self.popoverWindowController.contentViewController; + MainViewController *mainViewController = (MainViewController *)self.popover.contentViewController; mainViewController.collections = collections; - } else if ([self.popoverWindowController.window isVisible]) { - MainViewController *mainViewController = (MainViewController *)self.popoverWindowController.contentViewController; - mainViewController.collections = collections; - } + } //else if ([self.popoverWindowController.window isVisible]) { +// MainViewController *mainViewController = (MainViewController *)self.popoverWindowController.contentViewController; +// mainViewController.collections = collections; +// } } }; @@ -533,7 +464,7 @@ - (void)removeLocalizationsForIndex:(IDEIndex *)index { #pragma mark - Popover - (void)presentPopoverInTextView:(NSTextView *)textView entity:(LNEntity *)entity { - if (![[LNUserDefaultsManager sharedManager] isEnabled]) { + if (!LNUserDefaultsManager.sharedManager.isEnabled) { return; } @@ -555,69 +486,70 @@ - (void)presentPopoverInTextView:(NSTextView *)textView entity:(LNEntity *)entit NSArray *collections = self.workspaceLocalizations[self.currentWorkspaceFilePath]; NSString *key = [textView.textStorage.string substringWithRange:NSMakeRange(lineRange.location + entity.keyRange.location, entity.keyRange.length)]; - if ([self.popoverWindowController.window isVisible]) { - // Update popover content - MainViewController *mainViewController = (MainViewController *)self.popoverWindowController.contentViewController; - mainViewController.collections = collections; - mainViewController.searchString = key; - } else { +// if ([self.popoverWindowController.window isVisible]) { +// // Update popover content +// MainViewController *mainViewController = (MainViewController *)self.popoverWindowController.contentViewController; +// mainViewController.collections = collections; +// mainViewController.searchString = key; +// } else { if ([self.popover isShown]) { // Update the position for popover when the cursor moved self.popover.positioningRect = keyRectOnTextView; // Update popover content - MainViewController *mainViewController = (MainViewController *)self.popoverWindowController.contentViewController; + MainViewController *mainViewController = (MainViewController *)self.popover.contentViewController; mainViewController.searchString = key; } else { // Show popover - [self.popover showRelativeToRect:keyRectOnTextView - ofView:textView - preferredEdge:NSMinYEdge]; + [self.popover showRelativeToRect:keyRectOnTextView ofView:textView preferredEdge:NSMinYEdge]; // Update popover content - MainViewController *mainViewController = (MainViewController *)self.popoverWindowController.contentViewController; + MainViewController *mainViewController = (MainViewController *)self.popover.contentViewController; mainViewController.collections = collections; mainViewController.searchString = key; } - } +// } } } - (void)dismissPopover { - if ([self.popoverWindowController.window isVisible]) { - // Update popover content - NSArray *collections = self.workspaceLocalizations[self.currentWorkspaceFilePath]; - - MainViewController *mainViewController = (MainViewController *)self.popoverWindowController.contentViewController; - mainViewController.collections = collections; - mainViewController.searchString = nil; - } else { +// if ([self.popoverWindowController.window isVisible]) { +// // Update popover content +// NSArray *collections = self.workspaceLocalizations[self.currentWorkspaceFilePath]; +// +// MainViewController *mainViewController = (MainViewController *)self.popoverWindowController.contentViewController; +// mainViewController.collections = collections; +// mainViewController.searchString = nil; +// } else { // Hide popover - if (self.popover.shown) { + if (self.popover.isShown) { [self.popover performClose:self]; } - } +// } } - #pragma mark - NSPopoverDelegate -- (void)popoverWillShow:(NSNotification *)notification { - // Save first responder - self.previousFirstResponder = [self.textView.window firstResponder]; -} +//- (void)popoverWillShow:(NSNotification *)notification { +// // Save first responder +//// self.previousFirstResponder = [self.textView.window firstResponder]; +//} +// +//- (void)popoverDidShow:(NSNotification *)notification { +// // Reclaim key window and first responder +// [self.textView.window becomeKeyWindow]; +//// [self.textView.window makeFirstResponder:self.previousFirstResponder]; +//} -- (void)popoverDidShow:(NSNotification *)notification { - // Reclaim key window and first responder - [self.textView.window becomeKeyWindow]; - [self.textView.window makeFirstResponder:self.previousFirstResponder]; +- (BOOL)popoverShouldDetach:(NSPopover *)popover { + return YES; } -- (NSWindow *)detachableWindowForPopover:(NSPopover *)popover { - // Prepare for detaching - [self preparePopoverWindow]; - - return self.popoverWindowController.window; -} +//- (NSWindow *)detachableWindowForPopover:(NSPopover *)popover { +// // Prepare for detaching +// [self preparePopoverWindow]; +// +// return self.popoverWindowController.window; +//} @end diff --git a/Lin/Resources/XIBs/AddViewController.xib b/Lin/Resources/XIBs/AddViewController.xib new file mode 100644 index 0000000..be6f637 --- /dev/null +++ b/Lin/Resources/XIBs/AddViewController.xib @@ -0,0 +1,201 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Lin/Resources/XIBs/LNAlertAccessoryView.xib b/Lin/Resources/XIBs/LNAlertAccessoryView.xib deleted file mode 100644 index 4ee3fe0..0000000 --- a/Lin/Resources/XIBs/LNAlertAccessoryView.xib +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Lin/View Controllers/AddViewController.h b/Lin/View Controllers/AddViewController.h new file mode 100644 index 0000000..c1ac9d3 --- /dev/null +++ b/Lin/View Controllers/AddViewController.h @@ -0,0 +1,27 @@ +// +// AddViewController.h +// Lin +// +// Created by Sascha Schwabbauer on 06/12/14. +// Copyright (c) 2014 evolved.io. All rights reserved. +// + +#import + +@class LNLocalizationCollection; +@class LNLocalization; +@class AddViewController; + +@protocol AddViewControllerDelegate + +- (void)addViewControllerDidCancel:(AddViewController *)addViewController; +- (void)addViewController:(AddViewController *)addViewController didFinishWithLocalization:(LNLocalization *)localization forCollection:(LNLocalizationCollection *)collection; + +@end + +@interface AddViewController : NSViewController + +@property (nonatomic, weak) id delegate; +@property (nonatomic, copy) NSArray *collections; + +@end diff --git a/Lin/View Controllers/AddViewController.m b/Lin/View Controllers/AddViewController.m new file mode 100644 index 0000000..8b6dcab --- /dev/null +++ b/Lin/View Controllers/AddViewController.m @@ -0,0 +1,133 @@ +// +// AddViewController.m +// Lin +// +// Created by Sascha Schwabbauer on 06/12/14. +// Copyright (c) 2014 evolved.io. All rights reserved. +// + +#import "AddViewController.h" +#import "LNLocalization.h" +#import "LNLocalizationCollection.h" + +@interface AddViewController () + +@property (nonatomic, weak) IBOutlet NSPopUpButton *tableButton; +@property (nonatomic, weak) IBOutlet NSPopUpButton *languageButton; +@property (nonatomic, weak) IBOutlet NSTextField *keyTextField; +@property (nonatomic, weak) IBOutlet NSTextField *valueTextField; +@property (nonatomic, weak) IBOutlet NSButton *okButton; + +@end + +@implementation AddViewController + +#pragma mark - Accessors + +- (void)setCollections:(NSArray *)collections { + if (![_collections isEqual:collections]) { + _collections = collections; + + if (self.isViewLoaded) { + [self configureView]; + } + } +} + +#pragma mark - NSViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + + [self configureView]; +} + +#pragma mark - Helpers + +- (LNLocalizationCollection *)collectionForCurrentSelection { + NSString *selectedFileName = [self.tableButton titleOfSelectedItem]; + NSString *selectedLanguageDesignations = [self.languageButton titleOfSelectedItem]; + + for (LNLocalizationCollection *collection in self.collections) { + if ([collection.fileName isEqualToString:selectedFileName] && [collection.languageDesignation isEqualToString:selectedLanguageDesignations]) { + return collection; + } + } + + return nil; +} + +#pragma mark - Actions + +- (IBAction)tableDidChange:(id)sender { + [self updateLanguages]; +} + +- (IBAction)okPressed:(id)sender { + LNLocalizationCollection *collection = [self collectionForCurrentSelection]; + NSString *key = self.keyTextField.stringValue; + NSString *value = self.valueTextField.stringValue; + + LNLocalization *localization = [LNLocalization localizationWithKey:key value:value entityRange:NSMakeRange(NSNotFound, 0) keyRange:NSMakeRange(NSNotFound, 0) valueRange:NSMakeRange(NSNotFound, 0) collection:collection]; + + if (self.delegate) { + [self.delegate addViewController:self didFinishWithLocalization:localization forCollection:collection]; + } +} + +- (IBAction)cancelPressed:(id)sender { + if (self.delegate) { + [self.delegate addViewControllerDidCancel:self]; + } +} + +#pragma mark - Updating the Views + +- (void)updateTables { + [self.tableButton removeAllItems]; + + NSMutableSet *tableFileNames = [NSMutableSet set]; + for (LNLocalizationCollection *collection in self.collections) { + [tableFileNames addObject:collection.fileName]; + } + + [self.tableButton addItemsWithTitles:[tableFileNames allObjects]]; +} + +- (void)updateLanguages { + [self.languageButton removeAllItems]; + + NSString *titleOfSelectedItem = [self.tableButton titleOfSelectedItem]; + + NSMutableSet *languageDesignations = [NSMutableSet set]; + for (LNLocalizationCollection *collection in self.collections) { + if ([titleOfSelectedItem isEqualToString:collection.fileName]) { + [languageDesignations addObject:collection.languageDesignation]; + } + } + + [self.languageButton addItemsWithTitles:[languageDesignations allObjects]]; +} + +- (void)configureView { + [self updateTables]; + [self updateLanguages]; + + [self configureButton]; +} + +- (void)configureButton { + NSString *key = self.keyTextField.stringValue; + NSString *value = self.valueTextField.stringValue; + + [self.okButton setEnabled:(self.collections.count > 0 && key.length > 0 && value.length > 0)]; +} + + +#pragma mark - NSTextFieldDelegate + +- (void)controlTextDidChange:(NSNotification *)obj { + [self configureButton]; +} + +@end diff --git a/Lin/View Controllers/MainViewController.h b/Lin/View Controllers/MainViewController.h index 3e0577f..ba4c260 100644 --- a/Lin/View Controllers/MainViewController.h +++ b/Lin/View Controllers/MainViewController.h @@ -16,8 +16,8 @@ extern NSString * const LNPopoverContentViewDetachButtonDidClickNotification; @interface MainViewController : NSViewController +@property (nonatomic, assign, getter=isInPopover) BOOL inPopover; @property (nonatomic, weak, readonly) NSTableView *tableView; -@property (nonatomic, weak, readonly) NSButton *detachButton; @property (nonatomic, copy) NSArray *collections; @property (nonatomic, copy) NSString *searchString; diff --git a/Lin/View Controllers/MainViewController.m b/Lin/View Controllers/MainViewController.m index b54d2a7..dbbb004 100644 --- a/Lin/View Controllers/MainViewController.m +++ b/Lin/View Controllers/MainViewController.m @@ -7,13 +7,9 @@ // #import "MainViewController.h" - -// Models #import "LNLocalizationCollection.h" #import "LNLocalization.h" - -// Views -#import "LNAlertAccessoryView.h" +#import "AddViewController.h" NSString * const LNPopoverContentViewLocalizationKey = @"LNPopoverContentViewLocalizationKey"; @@ -23,22 +19,20 @@ static NSString * const EVOPopoverContentViewCellReuseIdentifier = @"EVOPopoverContentViewCellReuseIdentifier"; -@interface MainViewController () +@interface MainViewController () -@property (nonatomic, weak, readwrite) IBOutlet NSTableView *tableView; -@property (nonatomic, weak, readwrite) IBOutlet NSButton *detachButton; +@property (nonatomic, weak) IBOutlet NSTableView *tableView; +@property (nonatomic, weak) IBOutlet NSButton *detachButton; @property (nonatomic, strong) NSMutableArray *localizations; @property (nonatomic, strong) NSMutableArray *sortedLocalizations; -- (IBAction)addLocalization:(id)sender; -- (IBAction)deleteLocalization:(id)sender; -- (IBAction)detachPopover:(id)sender; - @end @implementation MainViewController +#pragma mark - NSViewController + - (void)viewDidLoad { [super viewDidLoad]; @@ -48,6 +42,9 @@ - (void)viewDidLoad { self.tableView.target = self; self.tableView.doubleAction = @selector(doubleClickedTableView:); + + [self configureForPresentationInPopover:self.isInPopover]; + [self configureView]; } - (void)dealloc { @@ -55,14 +52,35 @@ - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; } +#pragma mark - Helper methods + +- (void)configureForPresentationInPopover:(BOOL)inPopover { + if (inPopover) { + self.tableView.selectionHighlightStyle = NSTableViewSelectionHighlightStyleSourceList; + } else { + self.detachButton.hidden = YES; + } +} #pragma mark - Accessors +- (void)setInPopover:(BOOL)inPopover { + if (_inPopover != inPopover) { + _inPopover = inPopover; + + if (self.isViewLoaded) { + [self configureForPresentationInPopover:_inPopover]; + } + } +} + - (void)setCollections:(NSArray *)collections { if (![_collections isEqual:collections]) { _collections = collections; - [self configureView]; + if (self.isViewLoaded) { + [self configureView]; + } } } @@ -70,7 +88,9 @@ - (void)setSearchString:(NSString *)searchString { if (![_searchString isEqualToString:searchString]) { _searchString = searchString; - [self configureView]; + if (self.isViewLoaded) { + [self configureView]; + } } } @@ -121,63 +141,15 @@ - (void)doubleClickedTableView:(id)sender { - (IBAction)addLocalization:(id)sender { // Create alert NSBundle *bundle = [NSBundle bundleForClass:[self class]]; - NSViewController *viewController = [[NSViewController alloc] initWithNibName:@"LNAlertAccessoryView" bundle:bundle]; - LNAlertAccessoryView *accessoryView = (LNAlertAccessoryView *)viewController.view; - accessoryView.collections = self.collections; - - NSAlert *alert = [[NSAlert alloc] init]; - alert.messageText = @"Lin"; - [alert addButtonWithTitle:@"OK"]; - [alert addButtonWithTitle:@"Cancel"]; - alert.informativeText = @"Input a key/value for a new localization."; - alert.accessoryView = accessoryView; - - NSButton *button = [alert buttons][0]; - accessoryView.button = button; - - // Set icon - NSString *filePath = [bundle pathForResource:@"icon120" ofType:@"tiff"]; - NSImage *icon = [[NSImage alloc] initWithContentsOfFile:filePath]; - [alert setIcon:icon]; + AddViewController *addViewController = [[AddViewController alloc] initWithNibName:@"AddViewController" bundle:bundle]; + addViewController.delegate = self; + addViewController.collections = self.collections; - // Show alert - switch ([alert runModal]) { - case NSAlertFirstButtonReturn: - { - // Create a new localization - LNAlertAccessoryView *accessoryView = (LNAlertAccessoryView *)alert.accessoryView; - - LNLocalizationCollection *collection = accessoryView.selectedCollection; - NSString *key = accessoryView.inputtedKey; - NSString *value = accessoryView.inputtedValue; - - LNLocalization *localization = [LNLocalization localizationWithKey:key - value:value - entityRange:NSMakeRange(NSNotFound, 0) - keyRange:NSMakeRange(NSNotFound, 0) - valueRange:NSMakeRange(NSNotFound, 0) - collection:collection]; - - // Add localization to file - [collection addLocalization:localization]; - - // Update - [self configureView]; - } - - default: - { - // Post notification - [[NSNotificationCenter defaultCenter] postNotificationName:LNPopoverContentViewAlertDidDismissNotification - object:self - userInfo:nil]; - } - break; - } + [self presentViewController:addViewController asPopoverRelativeToRect:((NSView *)sender).bounds ofView:sender preferredEdge:NSMinYEdge behavior:NSPopoverBehaviorTransient]; } - (IBAction)deleteLocalization:(id)sender { - NSInteger selectedRow = [self.tableView selectedRow]; + NSInteger selectedRow = self.tableView.selectedRow; if (selectedRow >= 0) { [self.tableView beginUpdates]; @@ -206,7 +178,6 @@ - (IBAction)detachPopover:(id)sender { [[NSNotificationCenter defaultCenter] postNotificationName:LNPopoverContentViewDetachButtonDidClickNotification object:self userInfo:nil]; } - #pragma mark - Updating and Drawing the View - (void)reloadLocalizations { @@ -281,4 +252,28 @@ - (void)tableView:(NSTableView *)tableView sortDescriptorsDidChange:(NSArray *)o [self configureView]; } +#pragma mark - AddViewControllerDelegate + +- (void)addViewControllerDidCancel:(AddViewController *)addViewController { + // TODO: post notification? + // [[NSNotificationCenter defaultCenter] postNotificationName:LNPopoverContentViewAlertDidDismissNotification + // object:self + // + [self dismissViewController:addViewController]; +} + +- (void)addViewController:(AddViewController *)addViewController didFinishWithLocalization:(LNLocalization *)localization forCollection:(LNLocalizationCollection *)collection { + // Add localization to file + [collection addLocalization:localization]; + + // Update views + [self configureView]; + + // TODO: post notification? + // [[NSNotificationCenter defaultCenter] postNotificationName:LNPopoverContentViewAlertDidDismissNotification + // object:self + // userInfo:nil]; + [self dismissViewController:addViewController]; +} + @end diff --git a/Lin/Views/LNAlertAccessoryView.h b/Lin/Views/LNAlertAccessoryView.h deleted file mode 100644 index 3df161d..0000000 --- a/Lin/Views/LNAlertAccessoryView.h +++ /dev/null @@ -1,22 +0,0 @@ -// -// LNAlertAccessoryView.h -// Lin -// -// Created by Tanaka Katsuma on 2013/09/22. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import - -@class LNLocalizationCollection; - -@interface LNAlertAccessoryView : NSView - -@property (nonatomic, copy) NSArray *collections; -@property (nonatomic, weak) NSButton *button; - -@property (nonatomic, copy, readonly) LNLocalizationCollection *selectedCollection; -@property (nonatomic, copy, readonly) NSString *inputtedKey; -@property (nonatomic, copy, readonly) NSString *inputtedValue; - -@end diff --git a/Lin/Views/LNAlertAccessoryView.m b/Lin/Views/LNAlertAccessoryView.m deleted file mode 100644 index 78b1c14..0000000 --- a/Lin/Views/LNAlertAccessoryView.m +++ /dev/null @@ -1,138 +0,0 @@ -// -// LNAlertAccessoryView.m -// Lin -// -// Created by Tanaka Katsuma on 2013/09/22. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import "LNAlertAccessoryView.h" - -// Models -#import "LNLocalizationCollection.h" - -@interface LNAlertAccessoryView () - -@property (weak) IBOutlet NSPopUpButton *tableButton; -@property (weak) IBOutlet NSPopUpButton *languageButton; -@property (weak) IBOutlet NSTextField *keyTextField; -@property (weak) IBOutlet NSTextField *valueTextField; - -@end - -@implementation LNAlertAccessoryView - -- (void)awakeFromNib -{ - [super awakeFromNib]; -} - - -#pragma mark - Accessors - -- (void)setCollections:(NSArray *)collections -{ - _collections = collections; - - // Update - [self configureView]; -} - -- (void)setButton:(NSButton *)button -{ - _button = button; - - // Update - [self configureButton]; -} - -- (LNLocalizationCollection *)selectedCollection -{ - NSString *selectedFileName = [self.tableButton titleOfSelectedItem]; - NSString *selectedLanguageDesignations = [self.languageButton titleOfSelectedItem]; - - for (LNLocalizationCollection *collection in self.collections) { - if ([collection.fileName isEqualToString:selectedFileName] - && [collection.languageDesignation isEqualToString:selectedLanguageDesignations]) { - return collection; - } - } - - return nil; -} - -- (NSString *)inputtedKey -{ - return self.keyTextField.stringValue; -} - -- (NSString *)inputtedValue -{ - return self.valueTextField.stringValue; -} - - -#pragma mark - Actions - -- (IBAction)tableDidChange:(id)sender -{ - // Update - [self updateLanguages]; -} - - -#pragma mark - Updating the Views - -- (void)updateTables -{ - [self.tableButton removeAllItems]; - - NSMutableSet *tableFileNames = [NSMutableSet set]; - for (LNLocalizationCollection *collection in self.collections) { - [tableFileNames addObject:collection.fileName]; - } - - [self.tableButton addItemsWithTitles:[tableFileNames allObjects]]; -} - -- (void)updateLanguages -{ - [self.languageButton removeAllItems]; - - NSString *titleOfSelectedItem = [self.tableButton titleOfSelectedItem]; - - NSMutableSet *languageDesignations = [NSMutableSet set]; - for (LNLocalizationCollection *collection in self.collections) { - if ([titleOfSelectedItem isEqualToString:collection.fileName]) { - [languageDesignations addObject:collection.languageDesignation]; - } - } - - [self.languageButton addItemsWithTitles:[languageDesignations allObjects]]; -} - -- (void)configureView -{ - [self updateTables]; - [self updateLanguages]; - - [self configureButton]; -} - -- (void)configureButton -{ - NSString *key = self.keyTextField.stringValue; - NSString *value = self.valueTextField.stringValue; - - [self.button setEnabled:(self.collections.count > 0 && key.length > 0 && value.length > 0)]; -} - - -#pragma mark - NSTextFieldDelegate - -- (void)controlTextDidChange:(NSNotification *)obj -{ - [self configureButton]; -} - -@end From ca2eec8f0c59594e3fe50deae14034741376909e Mon Sep 17 00:00:00 2001 From: Sascha Schwabbauer Date: Sat, 6 Dec 2014 21:53:53 +0100 Subject: [PATCH 07/10] More fixes --- Lin.xcodeproj/project.pbxproj | 24 +- Lin/Lin.m | 247 ++++++++---------- Lin/View Controllers/MainViewController.h | 1 - Lin/View Controllers/MainViewController.m | 9 - Lin/Views/LNPopoverWindow.h | 15 -- Lin/Views/LNPopoverWindow.m | 106 -------- Lin/Views/PopoverWindow.h | 15 ++ Lin/Views/PopoverWindow.m | 100 +++++++ .../LNPopoverWindowController.h | 19 -- .../LNPopoverWindowController.m | 46 ---- .../PopoverWindowController.h | 15 ++ .../PopoverWindowController.m | 30 +++ 12 files changed, 282 insertions(+), 345 deletions(-) delete mode 100644 Lin/Views/LNPopoverWindow.h delete mode 100644 Lin/Views/LNPopoverWindow.m create mode 100644 Lin/Views/PopoverWindow.h create mode 100644 Lin/Views/PopoverWindow.m delete mode 100644 Lin/Window Controllers/LNPopoverWindowController.h delete mode 100644 Lin/Window Controllers/LNPopoverWindowController.m create mode 100644 Lin/Window Controllers/PopoverWindowController.h create mode 100644 Lin/Window Controllers/PopoverWindowController.m diff --git a/Lin.xcodeproj/project.pbxproj b/Lin.xcodeproj/project.pbxproj index edec8eb..b66b4fa 100644 --- a/Lin.xcodeproj/project.pbxproj +++ b/Lin.xcodeproj/project.pbxproj @@ -27,9 +27,9 @@ AA7D4DB117C74CFE0092DF8A /* LNLocalizationCollection.m in Sources */ = {isa = PBXBuildFile; fileRef = AA7D4DB017C74CFE0092DF8A /* LNLocalizationCollection.m */; }; AA7D4DB417C74D0A0092DF8A /* LNLocalization.m in Sources */ = {isa = PBXBuildFile; fileRef = AA7D4DB317C74D0A0092DF8A /* LNLocalization.m */; }; AA95FDEC17EB48A9007D33D4 /* MainViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = AA95FDEB17EB48A9007D33D4 /* MainViewController.xib */; }; - AA95FDEF17EB4E77007D33D4 /* LNPopoverWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = AA95FDEE17EB4E77007D33D4 /* LNPopoverWindowController.m */; }; + AA95FDEF17EB4E77007D33D4 /* PopoverWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = AA95FDEE17EB4E77007D33D4 /* PopoverWindowController.m */; }; AAAC873317ED9D4F00BF251D /* LNHorizontalLine.m in Sources */ = {isa = PBXBuildFile; fileRef = AAAC873217ED9D4F00BF251D /* LNHorizontalLine.m */; }; - AAAC873B17EDA9CF00BF251D /* LNPopoverWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = AAAC873A17EDA9CF00BF251D /* LNPopoverWindow.m */; }; + AAAC873B17EDA9CF00BF251D /* PopoverWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = AAAC873A17EDA9CF00BF251D /* PopoverWindow.m */; }; AAB0CD3117C4382D0085E913 /* LNRegularExpressionPattern.m in Sources */ = {isa = PBXBuildFile; fileRef = AAB0CD3017C4382D0085E913 /* LNRegularExpressionPattern.m */; }; AAB0CD3417C448200085E913 /* LNRegularExpressionPattern+type.m in Sources */ = {isa = PBXBuildFile; fileRef = AAB0CD3317C448200085E913 /* LNRegularExpressionPattern+type.m */; }; AAB0CD3617C46A730085E913 /* LNDetector.m in Sources */ = {isa = PBXBuildFile; fileRef = AA470D5A17C3CFEC005CBB7F /* LNDetector.m */; }; @@ -99,12 +99,12 @@ AA7D4DB317C74D0A0092DF8A /* LNLocalization.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LNLocalization.m; sourceTree = ""; }; AA93691517C4E4C000E94318 /* IDEWorkspace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDEWorkspace.h; sourceTree = ""; }; AA95FDEB17EB48A9007D33D4 /* MainViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MainViewController.xib; sourceTree = ""; }; - AA95FDED17EB4E77007D33D4 /* LNPopoverWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LNPopoverWindowController.h; sourceTree = ""; }; - AA95FDEE17EB4E77007D33D4 /* LNPopoverWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LNPopoverWindowController.m; sourceTree = ""; }; + AA95FDED17EB4E77007D33D4 /* PopoverWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PopoverWindowController.h; sourceTree = ""; }; + AA95FDEE17EB4E77007D33D4 /* PopoverWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PopoverWindowController.m; sourceTree = ""; }; AAAC873117ED9D4F00BF251D /* LNHorizontalLine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LNHorizontalLine.h; sourceTree = ""; }; AAAC873217ED9D4F00BF251D /* LNHorizontalLine.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LNHorizontalLine.m; sourceTree = ""; }; - AAAC873917EDA9CF00BF251D /* LNPopoverWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LNPopoverWindow.h; sourceTree = ""; }; - AAAC873A17EDA9CF00BF251D /* LNPopoverWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LNPopoverWindow.m; sourceTree = ""; }; + AAAC873917EDA9CF00BF251D /* PopoverWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PopoverWindow.h; sourceTree = ""; }; + AAAC873A17EDA9CF00BF251D /* PopoverWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PopoverWindow.m; sourceTree = ""; }; AAB0CD2F17C4382D0085E913 /* LNRegularExpressionPattern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LNRegularExpressionPattern.h; sourceTree = ""; }; AAB0CD3017C4382D0085E913 /* LNRegularExpressionPattern.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LNRegularExpressionPattern.m; sourceTree = ""; }; AAB0CD3217C448200085E913 /* LNRegularExpressionPattern+type.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "LNRegularExpressionPattern+type.h"; sourceTree = ""; }; @@ -331,8 +331,8 @@ AADDDA9C17C4A0E200BBA67C /* Window Controllers */ = { isa = PBXGroup; children = ( - AA95FDED17EB4E77007D33D4 /* LNPopoverWindowController.h */, - AA95FDEE17EB4E77007D33D4 /* LNPopoverWindowController.m */, + AA95FDED17EB4E77007D33D4 /* PopoverWindowController.h */, + AA95FDEE17EB4E77007D33D4 /* PopoverWindowController.m */, ); path = "Window Controllers"; sourceTree = ""; @@ -342,8 +342,8 @@ children = ( AAAC873117ED9D4F00BF251D /* LNHorizontalLine.h */, AAAC873217ED9D4F00BF251D /* LNHorizontalLine.m */, - AAAC873917EDA9CF00BF251D /* LNPopoverWindow.h */, - AAAC873A17EDA9CF00BF251D /* LNPopoverWindow.m */, + AAAC873917EDA9CF00BF251D /* PopoverWindow.h */, + AAAC873A17EDA9CF00BF251D /* PopoverWindow.m */, ); path = Views; sourceTree = ""; @@ -456,7 +456,7 @@ files = ( AA7D4DB117C74CFE0092DF8A /* LNLocalizationCollection.m in Sources */, AAB0CD3417C448200085E913 /* LNRegularExpressionPattern+type.m in Sources */, - AAAC873B17EDA9CF00BF251D /* LNPopoverWindow.m in Sources */, + AAAC873B17EDA9CF00BF251D /* PopoverWindow.m in Sources */, AA470D5E17C3D05D005CBB7F /* LNEntity.m in Sources */, AA7D4DB417C74D0A0092DF8A /* LNLocalization.m in Sources */, 2B0E049B1A3385AE0052E29D /* AddViewController.m in Sources */, @@ -466,7 +466,7 @@ 2B2FEC9B1A2F894500D0534D /* MainViewController.m in Sources */, AADEADB717C87298001E0C65 /* IDEIndex+Lin.m in Sources */, AA2980B417EE2C5300CF46E3 /* LNUserDefaultsManager.m in Sources */, - AA95FDEF17EB4E77007D33D4 /* LNPopoverWindowController.m in Sources */, + AA95FDEF17EB4E77007D33D4 /* PopoverWindowController.m in Sources */, F5859DBD18CABC2A009AF108 /* LNLocalizedStringCollectionOperation.m in Sources */, AA470D5B17C3CFEC005CBB7F /* LNDetector.m in Sources */, ); diff --git a/Lin/Lin.m b/Lin/Lin.m index 4d05ccf..55fa0a4 100644 --- a/Lin/Lin.m +++ b/Lin/Lin.m @@ -7,8 +7,6 @@ // #import "Lin.h" - -// Xcode #import "IDEWorkspace.h" #import "DVTFilePath.h" #import "IDEIndex.h" @@ -16,40 +14,28 @@ #import "IDEEditorDocument.h" #import "IDEWorkspaceWindow.h" #import "DVTSourceTextView.h" - -// Shared #import "LNUserDefaultsManager.h" - -// Models #import "LNDetector.h" #import "LNEntity.h" #import "LNLocalizationCollection.h" #import "LNLocalization.h" - -// Controllers #import "MainViewController.h" -#import "LNPopoverWindowController.h" #import "LNLocalizedStringCollectionOperation.h" +#import "PopoverWindowController.h" static Lin *_sharedPlugin = nil; -//@interface NSPopover () -// -//- (id)_popoverWindow; -// -//@end - @interface Lin () @property (nonatomic, strong) NSPopover *popover; -//@property (nonatomic, strong) LNPopoverWindowController *popoverWindowController; +@property (nonatomic, strong) PopoverWindowController *popoverWindowController; @property (nonatomic, strong) NSTextView *textView; @property (nonatomic, strong) LNDetector *detector; @property (nonatomic, strong) NSMutableDictionary *workspaceLocalizations; @property (nonatomic, copy) NSString *currentWorkspaceFilePath; -////@property (nonatomic, weak) NSResponder *previousFirstResponder; +@property (nonatomic, unsafe_unretained) NSResponder *previousFirstResponder; @property (nonatomic, assign, getter = isActivated) BOOL activated; @property (nonatomic, strong) NSMenuItem *enableMenuItem; @@ -84,18 +70,15 @@ - (instancetype)init { // Load views [self instantiatePopover]; -// [self instantiatePopoverWindowController]; + [self instantiatePopoverWindowController]; // Register to notification center [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(workspaceWindowDidBecomeMain:) name:NSWindowDidBecomeMainNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(indexDidIndexWorkspace:) name:@"IDEIndexDidIndexWorkspaceNotification" object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(editorDocumentDidSave:) name:@"IDEEditorDocumentDidSaveNotification" object:nil]; -// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(popoverWindowControllerWindowWillClose:) name:LNPopoverWindowControllerWindowWillCloseNotification object:nil]; - -// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(popoverContentViewLocalizationDidSelect:) name:LNPopoverContentViewLocalizationDidSelectNotification object:nil]; -// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(popoverContentViewAlertDidDismiss:) name:LNPopoverContentViewAlertDidDismissNotification object:nil]; -// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(popoverContentViewDetachButtonDidClick:) name:LNPopoverContentViewDetachButtonDidClickNotification object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(popoverContentViewLocalizationDidSelect:) name:LNPopoverContentViewLocalizationDidSelectNotification object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(popoverContentViewDetachButtonDidClick:) name:LNPopoverContentViewDetachButtonDidClickNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(menuDidChange:) name:NSMenuDidChangeItemNotification object:nil]; @@ -124,16 +107,16 @@ - (void)instantiatePopover { self.popover = popover; } -// -//- (void)instantiatePopoverWindowController { -// NSBundle *bundle = [NSBundle bundleForClass:[self class]]; -// MainViewController *contentViewController = [[MainViewController alloc] initWithNibName:@"MainViewController" bundle:bundle]; -// contentViewController.inPopover = NO; -// -// LNPopoverWindowController *popoverWindowController = [[LNPopoverWindowController alloc] initWithContentViewController:contentViewController]; -// -// self.popoverWindowController = popoverWindowController; -//} + +- (void)instantiatePopoverWindowController { + NSBundle *bundle = [NSBundle bundleForClass:[self class]]; + MainViewController *contentViewController = [[MainViewController alloc] initWithNibName:@"MainViewController" bundle:bundle]; + contentViewController.inPopover = NO; + + PopoverWindowController *popoverWindowController = [[PopoverWindowController alloc] initWithContentViewController:contentViewController]; + + self.popoverWindowController = popoverWindowController; +} - (void)dealloc { // Deactivate @@ -168,7 +151,7 @@ - (void)deactivate { #pragma mark - Notifications - (void)textDidChange:(NSNotification *)notification { - if ([notification.object isKindOfClass:DVTSourceTextView.class]) { + if ([notification.object isKindOfClass:DVTSourceTextView.class]) { NSTextView *textView = (NSTextView *)notification.object; self.textView = textView; @@ -180,11 +163,11 @@ - (void)textDidChange:(NSNotification *)notification { } else { [self dismissPopover]; } - } + } } - (void)textViewDidChangeSelection:(NSNotification *)notification { - if ([notification.object isKindOfClass:DVTSourceTextView.class]) { + if ([notification.object isKindOfClass:DVTSourceTextView.class]) { NSTextView *textView = (NSTextView *)notification.object; self.textView = textView; @@ -196,7 +179,7 @@ - (void)textViewDidChangeSelection:(NSNotification *)notification { } else { [self dismissPopover]; } - } + } } - (void)workspaceWindowDidBecomeMain:(NSNotification *)notification { @@ -234,41 +217,31 @@ - (void)editorDocumentDidSave:(NSNotification *)notification { } } -//- (void)popoverWindowControllerWindowWillClose:(NSNotification *)notification { -// // Instantiate popover -// [self instantiatePopover]; -//} - -//- (void)popoverContentViewLocalizationDidSelect:(NSNotification *)notification { -// NSTextView *textView = self.textView; -// LNEntity *entity = [self selectedEntityInTextView:textView]; -// -// if (entity) { -// NSArray *selectedRanges = textView.selectedRanges; -// -// if (selectedRanges.count > 0) { -// NSRange selectedRange = [selectedRanges[0] rangeValue]; -// -// // Locate the key -// NSRange lineRange = [textView.textStorage.string lineRangeForRange:selectedRange]; -// NSRange keyRange = NSMakeRange(lineRange.location + entity.keyRange.location, entity.keyRange.length); -// -// // Replace -// LNLocalization *localization = [notification userInfo][LNPopoverContentViewLocalizationKey]; -// [textView insertText:localization.key replacementRange:keyRange]; -// } -// } -//} - -//- (void)popoverContentViewAlertDidDismiss:(NSNotification *)notification { -// // Show popover again -// [self presentPopoverInTextView:self.textView entity:[self selectedEntityInTextView:self.textView]]; -//} - -//- (void)popoverContentViewDetachButtonDidClick:(NSNotification *)notification { -// [self preparePopoverWindow]; -// [self detachPopover]; -//} +- (void)popoverContentViewLocalizationDidSelect:(NSNotification *)notification { + NSTextView *textView = self.textView; + LNEntity *entity = [self selectedEntityInTextView:textView]; + + if (entity) { + NSArray *selectedRanges = textView.selectedRanges; + + if (selectedRanges.count > 0) { + NSRange selectedRange = [selectedRanges[0] rangeValue]; + + // Locate the key + NSRange lineRange = [textView.textStorage.string lineRangeForRange:selectedRange]; + NSRange keyRange = NSMakeRange(lineRange.location + entity.keyRange.location, entity.keyRange.length); + + // Replace + LNLocalization *localization = [notification userInfo][LNPopoverContentViewLocalizationKey]; + [textView insertText:localization.key replacementRange:keyRange]; + } + } +} + +- (void)popoverContentViewDetachButtonDidClick:(NSNotification *)notification { + [self preparePopoverWindow]; + [self detachPopover]; +} - (void)menuDidChange:(NSNotification *)notification { // Create menu item @@ -277,24 +250,24 @@ - (void)menuDidChange:(NSNotification *)notification { #pragma mark - Detaching Popover -//- (void)preparePopoverWindow { -// // Resize popover window -// NSWindow *popoverWindow = [self.popover _popoverWindow]; -// -// [self.popoverWindowController.window setFrame:NSMakeRect(popoverWindow.frame.origin.x, popoverWindow.frame.origin.y - (80.0 / 2.0), self.popover.contentSize.width, self.popover.contentSize.height + 80.0) display:NO]; -// -// // Copy popover content -// MainViewController *popoverMainViewController = (MainViewController *)self.popover.contentViewController; -// MainViewController *popoverWindowMainViewController = (MainViewController *)self.popoverWindowController.contentViewController; -// popoverWindowMainViewController.tableView.sortDescriptors = popoverMainViewController.tableView.sortDescriptors; -// popoverWindowMainViewController.collections = popoverMainViewController.collections; -// popoverWindowMainViewController.searchString = popoverMainViewController.searchString; -//} - -//- (void)detachPopover { -// [self dismissPopover]; -// [self.popoverWindowController showWindow:nil]; -//} +- (void)preparePopoverWindow { + // Resize popover window + NSWindow *popoverWindow = self.popover.contentViewController.view.window; + + [self.popoverWindowController.window setFrame:NSMakeRect(popoverWindow.frame.origin.x, popoverWindow.frame.origin.y - (80.0 / 2.0), self.popover.contentSize.width, self.popover.contentSize.height + 80.0) display:NO]; + + // Copy popover content + MainViewController *popoverMainViewController = (MainViewController *)self.popover.contentViewController; + MainViewController *windowMainViewController = (MainViewController *)self.popoverWindowController.contentViewController; + windowMainViewController.tableView.sortDescriptors = popoverMainViewController.tableView.sortDescriptors; + windowMainViewController.collections = popoverMainViewController.collections; + windowMainViewController.searchString = popoverMainViewController.searchString; +} + +- (void)detachPopover { + [self dismissPopover]; + [self.popoverWindowController showWindow:nil]; +} #pragma mark - Entity @@ -391,17 +364,17 @@ - (void)toggleEnabled:(id)sender { } - (void)showWindow:(id)sender { -// // Prepare window -// NSArray *collections = self.workspaceLocalizations[self.currentWorkspaceFilePath]; -// -// MainViewController *mainViewController = (MainViewController *)self.popoverWindowController.contentViewController; -// mainViewController.collections = collections; -// mainViewController.searchString = @""; -// -// // Show window -// [self.popoverWindowController.window setFrame:NSMakeRect(0, 0, 500, 280) display:NO]; -// [self.popoverWindowController.window center]; -// [self.popoverWindowController showWindow:nil]; + // Prepare window + NSArray *collections = self.workspaceLocalizations[self.currentWorkspaceFilePath]; + + MainViewController *mainViewController = (MainViewController *)self.popoverWindowController.contentViewController; + mainViewController.collections = collections; + mainViewController.searchString = nil; + + // Show window + [self.popoverWindowController.window setFrame:NSMakeRect(0, 0, 500, 280) display:NO]; + [self.popoverWindowController.window center]; + [self.popoverWindowController showWindow:nil]; } - (void)showVersionInfo:(id)sender { @@ -441,10 +414,10 @@ - (void)updateLocalizationsForIndex:(IDEIndex *)index { if ([self.popover isShown]) { MainViewController *mainViewController = (MainViewController *)self.popover.contentViewController; mainViewController.collections = collections; - } //else if ([self.popoverWindowController.window isVisible]) { -// MainViewController *mainViewController = (MainViewController *)self.popoverWindowController.contentViewController; -// mainViewController.collections = collections; -// } + } else if ([self.popoverWindowController.window isVisible]) { + MainViewController *mainViewController = (MainViewController *)self.popoverWindowController.contentViewController; + mainViewController.collections = collections; + } } }; @@ -486,12 +459,12 @@ - (void)presentPopoverInTextView:(NSTextView *)textView entity:(LNEntity *)entit NSArray *collections = self.workspaceLocalizations[self.currentWorkspaceFilePath]; NSString *key = [textView.textStorage.string substringWithRange:NSMakeRange(lineRange.location + entity.keyRange.location, entity.keyRange.length)]; -// if ([self.popoverWindowController.window isVisible]) { -// // Update popover content -// MainViewController *mainViewController = (MainViewController *)self.popoverWindowController.contentViewController; -// mainViewController.collections = collections; -// mainViewController.searchString = key; -// } else { + if ([self.popoverWindowController.window isVisible]) { + // Update popover content + MainViewController *mainViewController = (MainViewController *)self.popoverWindowController.contentViewController; + mainViewController.collections = collections; + mainViewController.searchString = key; + } else { if ([self.popover isShown]) { // Update the position for popover when the cursor moved self.popover.positioningRect = keyRectOnTextView; @@ -508,48 +481,48 @@ - (void)presentPopoverInTextView:(NSTextView *)textView entity:(LNEntity *)entit mainViewController.collections = collections; mainViewController.searchString = key; } -// } + } } } - (void)dismissPopover { -// if ([self.popoverWindowController.window isVisible]) { -// // Update popover content -// NSArray *collections = self.workspaceLocalizations[self.currentWorkspaceFilePath]; -// -// MainViewController *mainViewController = (MainViewController *)self.popoverWindowController.contentViewController; -// mainViewController.collections = collections; -// mainViewController.searchString = nil; -// } else { + if ([self.popoverWindowController.window isVisible]) { + // Update popover content + NSArray *collections = self.workspaceLocalizations[self.currentWorkspaceFilePath]; + + MainViewController *mainViewController = (MainViewController *)self.popoverWindowController.contentViewController; + mainViewController.collections = collections; + mainViewController.searchString = nil; + } else { // Hide popover if (self.popover.isShown) { [self.popover performClose:self]; } -// } + } } #pragma mark - NSPopoverDelegate -//- (void)popoverWillShow:(NSNotification *)notification { -// // Save first responder -//// self.previousFirstResponder = [self.textView.window firstResponder]; -//} -// -//- (void)popoverDidShow:(NSNotification *)notification { -// // Reclaim key window and first responder -// [self.textView.window becomeKeyWindow]; -//// [self.textView.window makeFirstResponder:self.previousFirstResponder]; -//} +- (void)popoverWillShow:(NSNotification *)notification { + // Save first responder + self.previousFirstResponder = [self.textView.window firstResponder]; +} + +- (void)popoverDidShow:(NSNotification *)notification { + // Reclaim key window and first responder + [self.textView.window becomeKeyWindow]; + [self.textView.window makeFirstResponder:self.previousFirstResponder]; +} - (BOOL)popoverShouldDetach:(NSPopover *)popover { return YES; } -//- (NSWindow *)detachableWindowForPopover:(NSPopover *)popover { -// // Prepare for detaching -// [self preparePopoverWindow]; -// -// return self.popoverWindowController.window; -//} +- (NSWindow *)detachableWindowForPopover:(NSPopover *)popover { + // Prepare for detaching + [self preparePopoverWindow]; + + return self.popoverWindowController.window; +} @end diff --git a/Lin/View Controllers/MainViewController.h b/Lin/View Controllers/MainViewController.h index ba4c260..d81bede 100644 --- a/Lin/View Controllers/MainViewController.h +++ b/Lin/View Controllers/MainViewController.h @@ -11,7 +11,6 @@ extern NSString * const LNPopoverContentViewLocalizationKey; extern NSString * const LNPopoverContentViewLocalizationDidSelectNotification; -extern NSString * const LNPopoverContentViewAlertDidDismissNotification; extern NSString * const LNPopoverContentViewDetachButtonDidClickNotification; @interface MainViewController : NSViewController diff --git a/Lin/View Controllers/MainViewController.m b/Lin/View Controllers/MainViewController.m index dbbb004..a94dd8e 100644 --- a/Lin/View Controllers/MainViewController.m +++ b/Lin/View Controllers/MainViewController.m @@ -14,7 +14,6 @@ NSString * const LNPopoverContentViewLocalizationKey = @"LNPopoverContentViewLocalizationKey"; NSString * const LNPopoverContentViewLocalizationDidSelectNotification = @"LNPopoverContentViewRowDidDoubleClickNotification"; -NSString * const LNPopoverContentViewAlertDidDismissNotification = @"LNPopoverContentViewAlertDidDismissNotification"; NSString * const LNPopoverContentViewDetachButtonDidClickNotification = @"LNPopoverContentViewDetachButtonDidClickNotification"; static NSString * const EVOPopoverContentViewCellReuseIdentifier = @"EVOPopoverContentViewCellReuseIdentifier"; @@ -255,10 +254,6 @@ - (void)tableView:(NSTableView *)tableView sortDescriptorsDidChange:(NSArray *)o #pragma mark - AddViewControllerDelegate - (void)addViewControllerDidCancel:(AddViewController *)addViewController { - // TODO: post notification? - // [[NSNotificationCenter defaultCenter] postNotificationName:LNPopoverContentViewAlertDidDismissNotification - // object:self - // [self dismissViewController:addViewController]; } @@ -269,10 +264,6 @@ - (void)addViewController:(AddViewController *)addViewController didFinishWithLo // Update views [self configureView]; - // TODO: post notification? - // [[NSNotificationCenter defaultCenter] postNotificationName:LNPopoverContentViewAlertDidDismissNotification - // object:self - // userInfo:nil]; [self dismissViewController:addViewController]; } diff --git a/Lin/Views/LNPopoverWindow.h b/Lin/Views/LNPopoverWindow.h deleted file mode 100644 index 804496c..0000000 --- a/Lin/Views/LNPopoverWindow.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// LNPopoverWindow.h -// Lin -// -// Created by Tanaka Katsuma on 2013/09/21. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import - -@interface LNPopoverWindow : NSWindow - -+ (instancetype)popoverWindow; - -@end diff --git a/Lin/Views/LNPopoverWindow.m b/Lin/Views/LNPopoverWindow.m deleted file mode 100644 index 3044bde..0000000 --- a/Lin/Views/LNPopoverWindow.m +++ /dev/null @@ -1,106 +0,0 @@ -// -// LNPopoverWindow.m -// Lin -// -// Created by Tanaka Katsuma on 2013/09/21. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import "LNPopoverWindow.h" - -// Controllers -#import "LNPopoverWindowController.h" -#import "MainViewController.h" - -static NSString * const kLNPopoverWindowToolbarSearchFieldIdentifier = @"Search"; - -@interface LNPopoverWindow () - -@property (nonatomic, strong) NSSearchField *searchField; - -@end - -@implementation LNPopoverWindow - -+ (instancetype)popoverWindow -{ - LNPopoverWindow *popoverWindow = [[LNPopoverWindow alloc] initWithContentRect:NSZeroRect - styleMask:(NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask) - backing:NSBackingStoreBuffered - defer:NO]; - popoverWindow.title = @"Lin"; - popoverWindow.level = NSFloatingWindowLevel; - popoverWindow.backgroundColor = [NSColor whiteColor]; - [popoverWindow.contentView setAutoresizesSubviews:YES]; - - return popoverWindow; -} - -- (instancetype)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)aStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)flag -{ - self = [super initWithContentRect:contentRect styleMask:aStyle backing:bufferingType defer:flag]; - - if (self) { - // Create toolbar - NSToolbar *toolbar = [[NSToolbar alloc] initWithIdentifier:@"Toolbar"]; - toolbar.delegate = self; - toolbar.displayMode = NSToolbarDisplayModeIconOnly; - - [self setToolbar:toolbar]; - } - - return self; -} - - -#pragma mark - Actions - -- (void)textFieldDidReturn:(id)sender -{ - [self controlTextDidChange:nil]; -} - - -#pragma mark - NSToolbarDelegate - -- (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar *)toolbar -{ - return @[NSToolbarFlexibleSpaceItemIdentifier, kLNPopoverWindowToolbarSearchFieldIdentifier]; -} - -- (NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar *)toolbar -{ - return @[NSToolbarFlexibleSpaceItemIdentifier, kLNPopoverWindowToolbarSearchFieldIdentifier]; -} - -- (NSToolbarItem *)toolbar:(NSToolbar *)toolbar itemForItemIdentifier:(NSString *)itemIdentifier willBeInsertedIntoToolbar:(BOOL)flag -{ - NSToolbarItem *toolbarItem = nil; - - if ([itemIdentifier isEqualToString:kLNPopoverWindowToolbarSearchFieldIdentifier]) { - toolbarItem = [[NSToolbarItem alloc] initWithItemIdentifier:itemIdentifier]; - - NSSearchField *searchField = [[NSSearchField alloc] init]; - [searchField setDelegate:self]; - [searchField setTarget:self]; - [searchField setAction:@selector(textFieldDidReturn:)]; - - [toolbarItem setView:searchField]; - self.searchField = searchField; - } - - return toolbarItem; -} - - -#pragma mark - NSTextFieldDelegate - -- (void)controlTextDidChange:(NSNotification *)obj -{ - LNPopoverWindowController *popoverWindowController = (LNPopoverWindowController *)self.windowController; - MainViewController *mainViewController = (MainViewController *)popoverWindowController.contentViewController; - - mainViewController.searchString = self.searchField.stringValue; -} - -@end diff --git a/Lin/Views/PopoverWindow.h b/Lin/Views/PopoverWindow.h new file mode 100644 index 0000000..9f40fbc --- /dev/null +++ b/Lin/Views/PopoverWindow.h @@ -0,0 +1,15 @@ +// +// PopoverWindow.h +// Lin +// +// Created by Sascha Schwabbauer on 03/12/14. +// Copyright (c) 2014 evolved.io. All rights reserved. +// + +#import + +@interface PopoverWindow : NSWindow + ++ (instancetype)popoverWindow; + +@end diff --git a/Lin/Views/PopoverWindow.m b/Lin/Views/PopoverWindow.m new file mode 100644 index 0000000..709dda6 --- /dev/null +++ b/Lin/Views/PopoverWindow.m @@ -0,0 +1,100 @@ +// +// PopoverWindow.m +// Lin +// +// Created by Sascha Schwabbauer on 03/12/14. +// Copyright (c) 2014 evolved.io. All rights reserved. +// + +#import "PopoverWindow.h" +#import "PopoverWindowController.h" +#import "MainViewController.h" + +static NSString * const kEVOPopoverWindowToolbarSearchFieldIdentifier = @"Search"; + +@interface PopoverWindow () + +@property (nonatomic, strong) NSSearchField *searchField; + +@end + +@implementation PopoverWindow + +#pragma mark - Public API + ++ (instancetype)popoverWindow { + PopoverWindow *popoverWindow = [[PopoverWindow alloc] initWithContentRect:NSZeroRect styleMask:(NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask) backing:NSBackingStoreBuffered defer:NO]; + popoverWindow.title = @"Lin"; + popoverWindow.level = NSFloatingWindowLevel; + popoverWindow.backgroundColor = [NSColor whiteColor]; + [popoverWindow.contentView setAutoresizesSubviews:YES]; + + return popoverWindow; +} + +#pragma mark - Initializers + +- (instancetype)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)aStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)flag { + if ((self = [super initWithContentRect:contentRect styleMask:aStyle backing:bufferingType defer:flag])) { + // Create toolbar + NSToolbar *toolbar = [[NSToolbar alloc] initWithIdentifier:@"Toolbar"]; + toolbar.delegate = self; + toolbar.displayMode = NSToolbarDisplayModeIconOnly; + + self.toolbar = toolbar; + } + + return self; +} + +#pragma mark - Actions + +- (void)searchTextDidChange:(NSNotification *)note { + if (![self.searchField.stringValue isEqual:note.object]) { + self.searchField.stringValue = note.object; + } +} + +- (void)textFieldDidReturn:(id)sender { + [self controlTextDidChange:nil]; +} + +#pragma mark - NSToolbarDelegate + +- (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar *)toolbar { + return @[NSToolbarFlexibleSpaceItemIdentifier, kEVOPopoverWindowToolbarSearchFieldIdentifier]; +} + +- (NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar *)toolbar { + return @[NSToolbarFlexibleSpaceItemIdentifier, kEVOPopoverWindowToolbarSearchFieldIdentifier]; +} + +- (NSToolbarItem *)toolbar:(NSToolbar *)toolbar itemForItemIdentifier:(NSString *)itemIdentifier willBeInsertedIntoToolbar:(BOOL)flag { + NSToolbarItem *toolbarItem = nil; + + if ([itemIdentifier isEqualToString:kEVOPopoverWindowToolbarSearchFieldIdentifier]) { + toolbarItem = [[NSToolbarItem alloc] initWithItemIdentifier:itemIdentifier]; + + NSSearchField *searchField = [[NSSearchField alloc] init]; + searchField.delegate = self; + searchField.target = self; + searchField.action = @selector(textFieldDidReturn:); + + toolbarItem.view = searchField; + self.searchField = searchField; + } + + return toolbarItem; +} + + +#pragma mark - NSTextFieldDelegate + +- (void)controlTextDidChange:(NSNotification *)obj { + PopoverWindowController *popoverWindowController = (PopoverWindowController *)self.windowController; + MainViewController *mainViewController = (MainViewController *)popoverWindowController.contentViewController; + + mainViewController.searchString = self.searchField.stringValue; +} + +@end diff --git a/Lin/Window Controllers/LNPopoverWindowController.h b/Lin/Window Controllers/LNPopoverWindowController.h deleted file mode 100644 index c899dd8..0000000 --- a/Lin/Window Controllers/LNPopoverWindowController.h +++ /dev/null @@ -1,19 +0,0 @@ -// -// LNPopoverWindowController.h -// Lin -// -// Created by Tanaka Katsuma on 2013/09/20. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import - -@class LNPopoverContentViewController; - -extern NSString * const LNPopoverWindowControllerWindowWillCloseNotification; - -@interface LNPopoverWindowController : NSWindowController - -- (instancetype)initWithContentViewController:(NSViewController *)contentViewController NS_DESIGNATED_INITIALIZER; - -@end diff --git a/Lin/Window Controllers/LNPopoverWindowController.m b/Lin/Window Controllers/LNPopoverWindowController.m deleted file mode 100644 index 9eadb81..0000000 --- a/Lin/Window Controllers/LNPopoverWindowController.m +++ /dev/null @@ -1,46 +0,0 @@ -// -// LNPopoverWindowController.m -// Lin -// -// Created by Tanaka Katsuma on 2013/09/20. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import "LNPopoverWindowController.h" - -// Views -#import "LNPopoverWindow.h" - -NSString * const LNPopoverWindowControllerWindowWillCloseNotification = @"LNPopoverWindowControllerWindowWillCloseNotification"; - -@implementation LNPopoverWindowController - -- (instancetype)initWithWindow:(NSWindow *)window { - return [self initWithContentViewController:nil]; -} - -- (instancetype)initWithCoder:(NSCoder *)coder { - return [self initWithContentViewController:nil]; -} - -- (instancetype)initWithContentViewController:(NSViewController *)contentViewController { - LNPopoverWindow *popoverWindow = [LNPopoverWindow popoverWindow]; - popoverWindow.delegate = self; - - self = [super initWithWindow:popoverWindow]; - - if (self) { - self.contentViewController = contentViewController; - } - - return self; -} - - -#pragma mark - NSWindowDelegate - -- (void)windowWillClose:(NSNotification *)notification { - [[NSNotificationCenter defaultCenter] postNotificationName:LNPopoverWindowControllerWindowWillCloseNotification object:self userInfo:nil]; -} - -@end diff --git a/Lin/Window Controllers/PopoverWindowController.h b/Lin/Window Controllers/PopoverWindowController.h new file mode 100644 index 0000000..9ba1453 --- /dev/null +++ b/Lin/Window Controllers/PopoverWindowController.h @@ -0,0 +1,15 @@ +// +// PopoverWindowController.h +// Lin +// +// Created by Sascha Schwabbauer on 03/12/14. +// Copyright (c) 2014 evolved.io. All rights reserved. +// + +#import + +@interface PopoverWindowController : NSWindowController + +- (instancetype)initWithContentViewController:(NSViewController *)contentViewController NS_DESIGNATED_INITIALIZER; + +@end diff --git a/Lin/Window Controllers/PopoverWindowController.m b/Lin/Window Controllers/PopoverWindowController.m new file mode 100644 index 0000000..95b8299 --- /dev/null +++ b/Lin/Window Controllers/PopoverWindowController.m @@ -0,0 +1,30 @@ +// +// LNPopoverWindowController.m +// Lin +// +// Created by Sascha Schwabbauer on 03/12/14. +// Copyright (c) 2014 evolved.io. All rights reserved. +// + +#import "PopoverWindowController.h" +#import "PopoverWindow.h" + +@implementation PopoverWindowController + +- (instancetype)initWithWindow:(NSWindow *)window { + return [self initWithContentViewController:nil]; +} + +- (instancetype)initWithCoder:(NSCoder *)coder { + return [self initWithContentViewController:nil]; +} + +- (instancetype)initWithContentViewController:(NSViewController *)contentViewController { + if ((self = [super initWithWindow:[PopoverWindow popoverWindow]])) { + self.contentViewController = contentViewController; + } + + return self; +} + +@end From 0b79b3549a61c04afd5e83d81e57c3d7509be365 Mon Sep 17 00:00:00 2001 From: Sascha Schwabbauer Date: Sat, 6 Dec 2014 22:06:38 +0100 Subject: [PATCH 08/10] Updated README and added Xcode 6.2 support --- Lin/Lin.m | 2 +- Lin/Supporting Files/Lin-Info.plist | 3 ++- README.md | 4 ++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Lin/Lin.m b/Lin/Lin.m index 55fa0a4..e2ca926 100644 --- a/Lin/Lin.m +++ b/Lin/Lin.m @@ -383,7 +383,7 @@ - (void)showVersionInfo:(id)sender { NSAlert *alert = [[NSAlert alloc] init]; alert.messageText = @"Lin"; [alert addButtonWithTitle:@"OK"]; - alert.informativeText = [NSString stringWithFormat:@"Version %@\n\nCopyright (c) 2014 Sascha Schwabbauer\n\nEmail: sascha@evolved.io\nTwitter: @_SaschaS", [bundle objectForInfoDictionaryKey:@"CFBundleShortVersionString"]]; + alert.informativeText = [NSString stringWithFormat:@"Version %@\n\nVersion 1 and 2 by Katsuma Tanaka\n(Email: questbeat@gmail.com, Twitter: @questbeat)\n\nVersion 3 by Sascha Schwabbauer\n(Email: sascha@evolved.io, Twitter: @_SaschaS)", [bundle objectForInfoDictionaryKey:@"CFBundleShortVersionString"]]; // Set icon NSString *filePath = [bundle pathForResource:@"icon120" ofType:@"tiff"]; diff --git a/Lin/Supporting Files/Lin-Info.plist b/Lin/Supporting Files/Lin-Info.plist index a2aac1d..a6732bb 100644 --- a/Lin/Supporting Files/Lin-Info.plist +++ b/Lin/Supporting Files/Lin-Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 1.0 + 3.0 CFBundleSignature ???? CFBundleVersion @@ -25,6 +25,7 @@ DVTPlugInCompatibilityUUIDs C4A681B0-4A26-480E-93EC-1218098B9AA0 + FEC992CC-CA4A-4CFD-8881-77300FCB848A LSApplicationCategoryType diff --git a/README.md b/README.md index 982f1e9..bbd35fd 100755 --- a/README.md +++ b/README.md @@ -12,6 +12,10 @@ Lin for Xcode 5 Lin for Xcode 4 [questbeat/Lin](https://github.com/questbeat/Lin) +## Compatibility + +**This version of Lin requires Mac OS X 10.10 (Yosemite) and Xcode 6.1.1 (Build 6A2008a) or Xcode 6.2 beta (Build 6C86e).** + ## Features When you are focusing on NSLocalizedString or other functions to get a localized version of a string, Lin shows the list of localizations that contains the inputted key string. From f29c8ef31006a1d4417508e760cca58274c2c5cf Mon Sep 17 00:00:00 2001 From: Sascha Schwabbauer Date: Thu, 15 Jan 2015 15:05:31 +0100 Subject: [PATCH 09/10] Clarified build steps. Closes #1 --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bbd35fd..399be95 100755 --- a/README.md +++ b/README.md @@ -38,7 +38,11 @@ In window mode, the search field can be used to find the localization with a fre ## Installation -Download the project and build it, then relaunch Xcode. + +1. [Download Lin-Xcode6 from GitHub](https://github.com/sascha/Lin-Xcode6/archive/master.zip) +2. Open Lin.xcodeproj and build (⌘B) +3. Relaunch Xcode + Lin will be installed in `~/Library/Application Support/Developer/Shared/Xcode/Plug-ins` automatically. If you want to uninstall Lin, remove Lin.xcplugin in `Plug-ins` directory. From 25eb34744a7b743af3b7556d376ca2788cba9de4 Mon Sep 17 00:00:00 2001 From: Sascha Schwabbauer Date: Wed, 15 Apr 2015 16:31:46 +0200 Subject: [PATCH 10/10] Removed Code and updated README --- .gitignore | 21 - .travis.yml | 3 - LICENSE.txt | 7 - Lin.xcodeproj/project.pbxproj | 700 ------------------ .../xcshareddata/xcschemes/Lin.xcscheme | 96 --- .../xcshareddata/xcschemes/LinTests.xcscheme | 78 -- Lin/Categories/IDEIndex+Lin.h | 13 - Lin/Categories/IDEIndex+Lin.m | 27 - Lin/Lin.h | 21 - Lin/Lin.m | 528 ------------- Lin/Models/LNDetector.h | 19 - Lin/Models/LNDetector.m | 79 -- Lin/Models/LNEntity.h | 53 -- Lin/Models/LNEntity.m | 63 -- Lin/Models/LNLocalization.h | 28 - Lin/Models/LNLocalization.m | 81 -- Lin/Models/LNLocalizationCollection.h | 31 - Lin/Models/LNLocalizationCollection.m | 223 ------ Lin/Models/LNRegularExpressionPattern+type.h | 20 - Lin/Models/LNRegularExpressionPattern+type.m | 79 -- Lin/Models/LNRegularExpressionPattern.h | 22 - Lin/Models/LNRegularExpressionPattern.m | 44 -- .../icon120.imageset/Contents.json | 22 - .../icon120.imageset/icon120.png | Bin 7694 -> 0 bytes .../icon120.imageset/icon120@2x.png | Bin 3214 -> 0 bytes .../icon_detach.imageset/Contents.json | 22 - .../icon_detach.imageset/icon_detach.png | Bin 2201 -> 0 bytes .../icon_detach.imageset/icon_detach@2x.png | Bin 759 -> 0 bytes .../icon_minus.imageset/Contents.json | 22 - .../icon_minus.imageset/icon_minus.png | Bin 1871 -> 0 bytes .../icon_minus.imageset/icon_minus@2x.png | Bin 208 -> 0 bytes .../icon_plus.imageset/Contents.json | 22 - .../icon_plus.imageset/icon_plus.png | Bin 1954 -> 0 bytes .../icon_plus.imageset/icon_plus@2x.png | Bin 349 -> 0 bytes Lin/Resources/XIBs/AddViewController.xib | 201 ----- Lin/Resources/XIBs/MainViewController.xib | 227 ------ .../LNLocalizedStringCollectionOperation.h | 21 - .../LNLocalizedStringCollectionOperation.m | 95 --- Lin/Shared/LNUserDefaultsManager.h | 17 - Lin/Shared/LNUserDefaultsManager.m | 57 -- Lin/Supporting Files/Lin-Info.plist | 43 -- Lin/Supporting Files/Lin-Prefix.pch | 9 - .../en.lproj/InfoPlist.strings | 2 - Lin/View Controllers/AddViewController.h | 27 - Lin/View Controllers/AddViewController.m | 133 ---- Lin/View Controllers/MainViewController.h | 23 - Lin/View Controllers/MainViewController.m | 270 ------- Lin/Views/LNHorizontalLine.h | 13 - Lin/Views/LNHorizontalLine.m | 20 - Lin/Views/PopoverWindow.h | 15 - Lin/Views/PopoverWindow.m | 100 --- .../PopoverWindowController.h | 15 - .../PopoverWindowController.m | 30 - Lin/Xcode-Private-Classes/DVTFilePath.h | 18 - Lin/Xcode-Private-Classes/DVTSourceTextView.h | 13 - Lin/Xcode-Private-Classes/IDEEditorDocument.h | 17 - Lin/Xcode-Private-Classes/IDEIndex.h | 21 - .../IDEIndexCollection.h | 13 - Lin/Xcode-Private-Classes/IDEWorkspace.h | 21 - .../IDEWorkspaceWindow.h | 13 - LinTests/LNDetectorTestSet.h | 18 - LinTests/LNDetectorTestSet.m | 47 -- LinTests/LNDetectorTests.m | 116 --- LinTests/LNLocalizationTests.m | 79 -- LinTests/LinTests-Info.plist | 22 - LinTests/LinTests-Prefix.pch | 13 - LinTests/Localizable.strings | 30 - LinTests/en.lproj/InfoPlist.strings | 2 - Makefile | 12 - README.md | 70 +- 70 files changed, 1 insertion(+), 4166 deletions(-) delete mode 100644 .gitignore delete mode 100644 .travis.yml delete mode 100644 LICENSE.txt delete mode 100644 Lin.xcodeproj/project.pbxproj delete mode 100644 Lin.xcodeproj/xcshareddata/xcschemes/Lin.xcscheme delete mode 100644 Lin.xcodeproj/xcshareddata/xcschemes/LinTests.xcscheme delete mode 100644 Lin/Categories/IDEIndex+Lin.h delete mode 100644 Lin/Categories/IDEIndex+Lin.m delete mode 100644 Lin/Lin.h delete mode 100644 Lin/Lin.m delete mode 100644 Lin/Models/LNDetector.h delete mode 100644 Lin/Models/LNDetector.m delete mode 100644 Lin/Models/LNEntity.h delete mode 100644 Lin/Models/LNEntity.m delete mode 100644 Lin/Models/LNLocalization.h delete mode 100644 Lin/Models/LNLocalization.m delete mode 100644 Lin/Models/LNLocalizationCollection.h delete mode 100644 Lin/Models/LNLocalizationCollection.m delete mode 100644 Lin/Models/LNRegularExpressionPattern+type.h delete mode 100644 Lin/Models/LNRegularExpressionPattern+type.m delete mode 100644 Lin/Models/LNRegularExpressionPattern.h delete mode 100644 Lin/Models/LNRegularExpressionPattern.m delete mode 100644 Lin/Resources/Media.xcassets/icon120.imageset/Contents.json delete mode 100644 Lin/Resources/Media.xcassets/icon120.imageset/icon120.png delete mode 100644 Lin/Resources/Media.xcassets/icon120.imageset/icon120@2x.png delete mode 100644 Lin/Resources/Media.xcassets/icon_detach.imageset/Contents.json delete mode 100644 Lin/Resources/Media.xcassets/icon_detach.imageset/icon_detach.png delete mode 100644 Lin/Resources/Media.xcassets/icon_detach.imageset/icon_detach@2x.png delete mode 100644 Lin/Resources/Media.xcassets/icon_minus.imageset/Contents.json delete mode 100644 Lin/Resources/Media.xcassets/icon_minus.imageset/icon_minus.png delete mode 100644 Lin/Resources/Media.xcassets/icon_minus.imageset/icon_minus@2x.png delete mode 100644 Lin/Resources/Media.xcassets/icon_plus.imageset/Contents.json delete mode 100644 Lin/Resources/Media.xcassets/icon_plus.imageset/icon_plus.png delete mode 100644 Lin/Resources/Media.xcassets/icon_plus.imageset/icon_plus@2x.png delete mode 100644 Lin/Resources/XIBs/AddViewController.xib delete mode 100644 Lin/Resources/XIBs/MainViewController.xib delete mode 100644 Lin/Shared/LNLocalizedStringCollectionOperation.h delete mode 100644 Lin/Shared/LNLocalizedStringCollectionOperation.m delete mode 100644 Lin/Shared/LNUserDefaultsManager.h delete mode 100644 Lin/Shared/LNUserDefaultsManager.m delete mode 100644 Lin/Supporting Files/Lin-Info.plist delete mode 100644 Lin/Supporting Files/Lin-Prefix.pch delete mode 100644 Lin/Supporting Files/en.lproj/InfoPlist.strings delete mode 100644 Lin/View Controllers/AddViewController.h delete mode 100644 Lin/View Controllers/AddViewController.m delete mode 100644 Lin/View Controllers/MainViewController.h delete mode 100644 Lin/View Controllers/MainViewController.m delete mode 100644 Lin/Views/LNHorizontalLine.h delete mode 100644 Lin/Views/LNHorizontalLine.m delete mode 100644 Lin/Views/PopoverWindow.h delete mode 100644 Lin/Views/PopoverWindow.m delete mode 100644 Lin/Window Controllers/PopoverWindowController.h delete mode 100644 Lin/Window Controllers/PopoverWindowController.m delete mode 100644 Lin/Xcode-Private-Classes/DVTFilePath.h delete mode 100644 Lin/Xcode-Private-Classes/DVTSourceTextView.h delete mode 100644 Lin/Xcode-Private-Classes/IDEEditorDocument.h delete mode 100644 Lin/Xcode-Private-Classes/IDEIndex.h delete mode 100644 Lin/Xcode-Private-Classes/IDEIndexCollection.h delete mode 100644 Lin/Xcode-Private-Classes/IDEWorkspace.h delete mode 100644 Lin/Xcode-Private-Classes/IDEWorkspaceWindow.h delete mode 100644 LinTests/LNDetectorTestSet.h delete mode 100644 LinTests/LNDetectorTestSet.m delete mode 100644 LinTests/LNDetectorTests.m delete mode 100644 LinTests/LNLocalizationTests.m delete mode 100644 LinTests/LinTests-Info.plist delete mode 100644 LinTests/LinTests-Prefix.pch delete mode 100644 LinTests/Localizable.strings delete mode 100644 LinTests/en.lproj/InfoPlist.strings delete mode 100644 Makefile diff --git a/.gitignore b/.gitignore deleted file mode 100644 index c21a9f2..0000000 --- a/.gitignore +++ /dev/null @@ -1,21 +0,0 @@ -.DS_Store -build/ -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -*.xcworkspace -!default.xcworkspace -xcuserdata -profile -*.moved-aside -DerivedData -.idea/ -*.hmap -*.xccheckout -*.ipa -*.xcuserstate diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 16165a9..0000000 --- a/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: objective-c -script: make clean test - diff --git a/LICENSE.txt b/LICENSE.txt deleted file mode 100644 index f2a3c8f..0000000 --- a/LICENSE.txt +++ /dev/null @@ -1,7 +0,0 @@ -Copyright (c) 2013 Katsuma Tanaka - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/Lin.xcodeproj/project.pbxproj b/Lin.xcodeproj/project.pbxproj deleted file mode 100644 index b66b4fa..0000000 --- a/Lin.xcodeproj/project.pbxproj +++ /dev/null @@ -1,700 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 2B0E049B1A3385AE0052E29D /* AddViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2B0E049A1A3385AE0052E29D /* AddViewController.m */; }; - 2B2FEC9B1A2F894500D0534D /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2B2FEC9A1A2F894500D0534D /* MainViewController.m */; }; - 2BC7C6A51A2FC3C60065C278 /* Media.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2BC7C6A41A2FC3C60065C278 /* Media.xcassets */; }; - 2BC7C6A81A2FC4690065C278 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 2BC7C6AA1A2FC4690065C278 /* InfoPlist.strings */; }; - AA02CE8B17EE08240041C2BD /* AddViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = AA02CE8A17EE08240041C2BD /* AddViewController.xib */; }; - AA1B7DA717C3C1EC00A3A6D7 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AA1B7DA617C3C1EC00A3A6D7 /* Cocoa.framework */; }; - AA1B7DBA17C3C20F00A3A6D7 /* Lin.m in Sources */ = {isa = PBXBuildFile; fileRef = AA1B7DB917C3C20F00A3A6D7 /* Lin.m */; }; - AA2980B417EE2C5300CF46E3 /* LNUserDefaultsManager.m in Sources */ = {isa = PBXBuildFile; fileRef = AA2980B317EE2C5300CF46E3 /* LNUserDefaultsManager.m */; }; - AA3EC36F17EB2A290003A180 /* DVTFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AA3EC36D17EB2A290003A180 /* DVTFoundation.framework */; }; - AA3EC37017EB2A290003A180 /* DVTKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AA3EC36E17EB2A290003A180 /* DVTKit.framework */; }; - AA3EC37317EB2A380003A180 /* IDEFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AA3EC37117EB2A380003A180 /* IDEFoundation.framework */; }; - AA3EC37417EB2A380003A180 /* IDEKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AA3EC37217EB2A380003A180 /* IDEKit.framework */; }; - AA470D5B17C3CFEC005CBB7F /* LNDetector.m in Sources */ = {isa = PBXBuildFile; fileRef = AA470D5A17C3CFEC005CBB7F /* LNDetector.m */; }; - AA470D5E17C3D05D005CBB7F /* LNEntity.m in Sources */ = {isa = PBXBuildFile; fileRef = AA470D5D17C3D05D005CBB7F /* LNEntity.m */; }; - AA470D6517C3D380005CBB7F /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AA470D6417C3D380005CBB7F /* XCTest.framework */; }; - AA470D6B17C3D380005CBB7F /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = AA470D6917C3D380005CBB7F /* InfoPlist.strings */; }; - AA470D7D17C3DE31005CBB7F /* LNDetectorTests.m in Sources */ = {isa = PBXBuildFile; fileRef = AA470D7C17C3DE31005CBB7F /* LNDetectorTests.m */; }; - AA7D4DB117C74CFE0092DF8A /* LNLocalizationCollection.m in Sources */ = {isa = PBXBuildFile; fileRef = AA7D4DB017C74CFE0092DF8A /* LNLocalizationCollection.m */; }; - AA7D4DB417C74D0A0092DF8A /* LNLocalization.m in Sources */ = {isa = PBXBuildFile; fileRef = AA7D4DB317C74D0A0092DF8A /* LNLocalization.m */; }; - AA95FDEC17EB48A9007D33D4 /* MainViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = AA95FDEB17EB48A9007D33D4 /* MainViewController.xib */; }; - AA95FDEF17EB4E77007D33D4 /* PopoverWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = AA95FDEE17EB4E77007D33D4 /* PopoverWindowController.m */; }; - AAAC873317ED9D4F00BF251D /* LNHorizontalLine.m in Sources */ = {isa = PBXBuildFile; fileRef = AAAC873217ED9D4F00BF251D /* LNHorizontalLine.m */; }; - AAAC873B17EDA9CF00BF251D /* PopoverWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = AAAC873A17EDA9CF00BF251D /* PopoverWindow.m */; }; - AAB0CD3117C4382D0085E913 /* LNRegularExpressionPattern.m in Sources */ = {isa = PBXBuildFile; fileRef = AAB0CD3017C4382D0085E913 /* LNRegularExpressionPattern.m */; }; - AAB0CD3417C448200085E913 /* LNRegularExpressionPattern+type.m in Sources */ = {isa = PBXBuildFile; fileRef = AAB0CD3317C448200085E913 /* LNRegularExpressionPattern+type.m */; }; - AAB0CD3617C46A730085E913 /* LNDetector.m in Sources */ = {isa = PBXBuildFile; fileRef = AA470D5A17C3CFEC005CBB7F /* LNDetector.m */; }; - AAB0CD3717C46B070085E913 /* LNEntity.m in Sources */ = {isa = PBXBuildFile; fileRef = AA470D5D17C3D05D005CBB7F /* LNEntity.m */; }; - AAB0CD3817C46B070085E913 /* LNRegularExpressionPattern.m in Sources */ = {isa = PBXBuildFile; fileRef = AAB0CD3017C4382D0085E913 /* LNRegularExpressionPattern.m */; }; - AAB0CD3917C46B070085E913 /* LNRegularExpressionPattern+type.m in Sources */ = {isa = PBXBuildFile; fileRef = AAB0CD3317C448200085E913 /* LNRegularExpressionPattern+type.m */; }; - AAB0CD3C17C477030085E913 /* LNDetectorTestSet.m in Sources */ = {isa = PBXBuildFile; fileRef = AAB0CD3B17C477030085E913 /* LNDetectorTestSet.m */; }; - AADEADB317C7B6D3001E0C65 /* LNLocalizationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = AADEADB217C7B6D3001E0C65 /* LNLocalizationTests.m */; }; - AADEADB417C7B838001E0C65 /* LNLocalization.m in Sources */ = {isa = PBXBuildFile; fileRef = AA7D4DB317C74D0A0092DF8A /* LNLocalization.m */; }; - AADEADB717C87298001E0C65 /* IDEIndex+Lin.m in Sources */ = {isa = PBXBuildFile; fileRef = AADEADB617C87298001E0C65 /* IDEIndex+Lin.m */; }; - AAFE3C3F17EECF4A0018E478 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = AAFE3C3E17EECF4A0018E478 /* Localizable.strings */; }; - AAFE3C4117EED36C0018E478 /* LNLocalizationCollection.m in Sources */ = {isa = PBXBuildFile; fileRef = AA7D4DB017C74CFE0092DF8A /* LNLocalizationCollection.m */; }; - F5859DBD18CABC2A009AF108 /* LNLocalizedStringCollectionOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = F5859DBC18CABC2A009AF108 /* LNLocalizedStringCollectionOperation.m */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - AA470D6F17C3D380005CBB7F /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = AA1B7D9B17C3C1EC00A3A6D7 /* Project object */; - proxyType = 1; - remoteGlobalIDString = AA1B7DA217C3C1EC00A3A6D7; - remoteInfo = Lin; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 2B0E04991A3385AE0052E29D /* AddViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddViewController.h; sourceTree = ""; }; - 2B0E049A1A3385AE0052E29D /* AddViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AddViewController.m; sourceTree = ""; }; - 2B2FEC991A2F894500D0534D /* MainViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainViewController.h; sourceTree = ""; }; - 2B2FEC9A1A2F894500D0534D /* MainViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainViewController.m; sourceTree = ""; }; - 2BC7C6A41A2FC3C60065C278 /* Media.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Media.xcassets; sourceTree = ""; }; - 2BC7C6A91A2FC4690065C278 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; - AA02CE8A17EE08240041C2BD /* AddViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = AddViewController.xib; sourceTree = ""; }; - AA11AC4017C66F0200889DFB /* DVTFilePath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVTFilePath.h; sourceTree = ""; }; - AA11AC4317C6746800889DFB /* IDEIndex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDEIndex.h; sourceTree = ""; }; - AA11AC4617C6755400889DFB /* IDEIndexCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDEIndexCollection.h; sourceTree = ""; }; - AA1B7DA317C3C1EC00A3A6D7 /* Lin.xcplugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Lin.xcplugin; sourceTree = BUILT_PRODUCTS_DIR; }; - AA1B7DA617C3C1EC00A3A6D7 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; - AA1B7DA917C3C1EC00A3A6D7 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - AA1B7DAA17C3C1EC00A3A6D7 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; - AA1B7DAB17C3C1EC00A3A6D7 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; - AA1B7DAE17C3C1EC00A3A6D7 /* Lin-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Lin-Info.plist"; sourceTree = ""; }; - AA1B7DB217C3C1EC00A3A6D7 /* Lin-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Lin-Prefix.pch"; sourceTree = ""; }; - AA1B7DB817C3C20F00A3A6D7 /* Lin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Lin.h; sourceTree = ""; }; - AA1B7DB917C3C20F00A3A6D7 /* Lin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Lin.m; sourceTree = ""; }; - AA2980B217EE2C5300CF46E3 /* LNUserDefaultsManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LNUserDefaultsManager.h; sourceTree = ""; }; - AA2980B317EE2C5300CF46E3 /* LNUserDefaultsManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LNUserDefaultsManager.m; sourceTree = ""; }; - AA3EC36D17EB2A290003A180 /* DVTFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DVTFoundation.framework; path = ../../../../Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework; sourceTree = ""; }; - AA3EC36E17EB2A290003A180 /* DVTKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DVTKit.framework; path = ../../../../Applications/Xcode.app/Contents/SharedFrameworks/DVTKit.framework; sourceTree = ""; }; - AA3EC37117EB2A380003A180 /* IDEFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IDEFoundation.framework; path = ../../../../Applications/Xcode.app/Contents/Frameworks/IDEFoundation.framework; sourceTree = ""; }; - AA3EC37217EB2A380003A180 /* IDEKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IDEKit.framework; path = ../../../../Applications/Xcode.app/Contents/Frameworks/IDEKit.framework; sourceTree = ""; }; - AA470D5917C3CFEC005CBB7F /* LNDetector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LNDetector.h; sourceTree = ""; }; - AA470D5A17C3CFEC005CBB7F /* LNDetector.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LNDetector.m; sourceTree = ""; }; - AA470D5C17C3D05D005CBB7F /* LNEntity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LNEntity.h; sourceTree = ""; }; - AA470D5D17C3D05D005CBB7F /* LNEntity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LNEntity.m; sourceTree = ""; }; - AA470D6317C3D380005CBB7F /* LinTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LinTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - AA470D6417C3D380005CBB7F /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; - AA470D6817C3D380005CBB7F /* LinTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "LinTests-Info.plist"; sourceTree = ""; }; - AA470D6A17C3D380005CBB7F /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; - AA470D6E17C3D380005CBB7F /* LinTests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "LinTests-Prefix.pch"; sourceTree = ""; }; - AA470D7C17C3DE31005CBB7F /* LNDetectorTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LNDetectorTests.m; sourceTree = ""; }; - AA7B0CB017F4229D0004FE3B /* IDEWorkspaceWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDEWorkspaceWindow.h; sourceTree = ""; }; - AA7B0CB317F422BB0004FE3B /* DVTSourceTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVTSourceTextView.h; sourceTree = ""; }; - AA7D4DAF17C74CFE0092DF8A /* LNLocalizationCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LNLocalizationCollection.h; sourceTree = ""; }; - AA7D4DB017C74CFE0092DF8A /* LNLocalizationCollection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LNLocalizationCollection.m; sourceTree = ""; }; - AA7D4DB217C74D0A0092DF8A /* LNLocalization.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LNLocalization.h; sourceTree = ""; }; - AA7D4DB317C74D0A0092DF8A /* LNLocalization.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LNLocalization.m; sourceTree = ""; }; - AA93691517C4E4C000E94318 /* IDEWorkspace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDEWorkspace.h; sourceTree = ""; }; - AA95FDEB17EB48A9007D33D4 /* MainViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MainViewController.xib; sourceTree = ""; }; - AA95FDED17EB4E77007D33D4 /* PopoverWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PopoverWindowController.h; sourceTree = ""; }; - AA95FDEE17EB4E77007D33D4 /* PopoverWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PopoverWindowController.m; sourceTree = ""; }; - AAAC873117ED9D4F00BF251D /* LNHorizontalLine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LNHorizontalLine.h; sourceTree = ""; }; - AAAC873217ED9D4F00BF251D /* LNHorizontalLine.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LNHorizontalLine.m; sourceTree = ""; }; - AAAC873917EDA9CF00BF251D /* PopoverWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PopoverWindow.h; sourceTree = ""; }; - AAAC873A17EDA9CF00BF251D /* PopoverWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PopoverWindow.m; sourceTree = ""; }; - AAB0CD2F17C4382D0085E913 /* LNRegularExpressionPattern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LNRegularExpressionPattern.h; sourceTree = ""; }; - AAB0CD3017C4382D0085E913 /* LNRegularExpressionPattern.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LNRegularExpressionPattern.m; sourceTree = ""; }; - AAB0CD3217C448200085E913 /* LNRegularExpressionPattern+type.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "LNRegularExpressionPattern+type.h"; sourceTree = ""; }; - AAB0CD3317C448200085E913 /* LNRegularExpressionPattern+type.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "LNRegularExpressionPattern+type.m"; sourceTree = ""; }; - AAB0CD3A17C477030085E913 /* LNDetectorTestSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LNDetectorTestSet.h; sourceTree = ""; }; - AAB0CD3B17C477030085E913 /* LNDetectorTestSet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LNDetectorTestSet.m; sourceTree = ""; }; - AADEADB217C7B6D3001E0C65 /* LNLocalizationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LNLocalizationTests.m; sourceTree = ""; }; - AADEADB517C87298001E0C65 /* IDEIndex+Lin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "IDEIndex+Lin.h"; sourceTree = ""; }; - AADEADB617C87298001E0C65 /* IDEIndex+Lin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "IDEIndex+Lin.m"; sourceTree = ""; }; - AADEADBB17C872EB001E0C65 /* IDEEditorDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDEEditorDocument.h; sourceTree = ""; }; - AAFE3C3E17EECF4A0018E478 /* Localizable.strings */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; path = Localizable.strings; sourceTree = ""; }; - F5859DBB18CABC2A009AF108 /* LNLocalizedStringCollectionOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LNLocalizedStringCollectionOperation.h; sourceTree = ""; }; - F5859DBC18CABC2A009AF108 /* LNLocalizedStringCollectionOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LNLocalizedStringCollectionOperation.m; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - AA1B7DA017C3C1EC00A3A6D7 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - AA3EC37317EB2A380003A180 /* IDEFoundation.framework in Frameworks */, - AA3EC37417EB2A380003A180 /* IDEKit.framework in Frameworks */, - AA3EC36F17EB2A290003A180 /* DVTFoundation.framework in Frameworks */, - AA3EC37017EB2A290003A180 /* DVTKit.framework in Frameworks */, - AA1B7DA717C3C1EC00A3A6D7 /* Cocoa.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - AA470D6017C3D380005CBB7F /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - AA470D6517C3D380005CBB7F /* XCTest.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 2B2FEC981A2F890C00D0534D /* View Controllers */ = { - isa = PBXGroup; - children = ( - 2B0E04991A3385AE0052E29D /* AddViewController.h */, - 2B0E049A1A3385AE0052E29D /* AddViewController.m */, - 2B2FEC991A2F894500D0534D /* MainViewController.h */, - 2B2FEC9A1A2F894500D0534D /* MainViewController.m */, - ); - path = "View Controllers"; - sourceTree = ""; - }; - 2BC7C6A31A2FC3A10065C278 /* XIBs */ = { - isa = PBXGroup; - children = ( - AA02CE8A17EE08240041C2BD /* AddViewController.xib */, - AA95FDEB17EB48A9007D33D4 /* MainViewController.xib */, - ); - path = XIBs; - sourceTree = ""; - }; - AA1B7D9A17C3C1EC00A3A6D7 = { - isa = PBXGroup; - children = ( - AA1B7DAC17C3C1EC00A3A6D7 /* Lin */, - AA470D6617C3D380005CBB7F /* LinTests */, - AA1B7DA517C3C1EC00A3A6D7 /* Frameworks */, - AA1B7DA417C3C1EC00A3A6D7 /* Products */, - ); - sourceTree = ""; - }; - AA1B7DA417C3C1EC00A3A6D7 /* Products */ = { - isa = PBXGroup; - children = ( - AA1B7DA317C3C1EC00A3A6D7 /* Lin.xcplugin */, - AA470D6317C3D380005CBB7F /* LinTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - AA1B7DA517C3C1EC00A3A6D7 /* Frameworks */ = { - isa = PBXGroup; - children = ( - AA3EC37117EB2A380003A180 /* IDEFoundation.framework */, - AA3EC37217EB2A380003A180 /* IDEKit.framework */, - AA3EC36D17EB2A290003A180 /* DVTFoundation.framework */, - AA3EC36E17EB2A290003A180 /* DVTKit.framework */, - AA1B7DA617C3C1EC00A3A6D7 /* Cocoa.framework */, - AA470D6417C3D380005CBB7F /* XCTest.framework */, - AA1B7DA817C3C1EC00A3A6D7 /* Other Frameworks */, - ); - name = Frameworks; - sourceTree = ""; - }; - AA1B7DA817C3C1EC00A3A6D7 /* Other Frameworks */ = { - isa = PBXGroup; - children = ( - AA1B7DA917C3C1EC00A3A6D7 /* Foundation.framework */, - AA1B7DAA17C3C1EC00A3A6D7 /* CoreData.framework */, - AA1B7DAB17C3C1EC00A3A6D7 /* AppKit.framework */, - ); - name = "Other Frameworks"; - sourceTree = ""; - }; - AA1B7DAC17C3C1EC00A3A6D7 /* Lin */ = { - isa = PBXGroup; - children = ( - AADDDA9517C49D4D00BBA67C /* Categories */, - AA1B7DB817C3C20F00A3A6D7 /* Lin.h */, - AA1B7DB917C3C20F00A3A6D7 /* Lin.m */, - AA470D7817C3DD42005CBB7F /* Models */, - AADDDA9B17C4A0DA00BBA67C /* Resources */, - AA2980B517EE2CF600CF46E3 /* Shared */, - AA1B7DAD17C3C1EC00A3A6D7 /* Supporting Files */, - 2B2FEC981A2F890C00D0534D /* View Controllers */, - AADDDAA017C4A3BA00BBA67C /* Views */, - AADDDA9C17C4A0E200BBA67C /* Window Controllers */, - AA93691817C4E4C700E94318 /* Xcode-Private-Classes */, - ); - path = Lin; - sourceTree = ""; - }; - AA1B7DAD17C3C1EC00A3A6D7 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 2BC7C6AA1A2FC4690065C278 /* InfoPlist.strings */, - AA1B7DAE17C3C1EC00A3A6D7 /* Lin-Info.plist */, - AA1B7DB217C3C1EC00A3A6D7 /* Lin-Prefix.pch */, - ); - path = "Supporting Files"; - sourceTree = ""; - }; - AA2980B517EE2CF600CF46E3 /* Shared */ = { - isa = PBXGroup; - children = ( - F5859DBB18CABC2A009AF108 /* LNLocalizedStringCollectionOperation.h */, - F5859DBC18CABC2A009AF108 /* LNLocalizedStringCollectionOperation.m */, - AA2980B217EE2C5300CF46E3 /* LNUserDefaultsManager.h */, - AA2980B317EE2C5300CF46E3 /* LNUserDefaultsManager.m */, - ); - path = Shared; - sourceTree = ""; - }; - AA470D6617C3D380005CBB7F /* LinTests */ = { - isa = PBXGroup; - children = ( - AAB0CD3D17C478EF0085E913 /* Models */, - AA470D7C17C3DE31005CBB7F /* LNDetectorTests.m */, - AADEADB217C7B6D3001E0C65 /* LNLocalizationTests.m */, - AAFE3C4017EED0950018E478 /* Resources */, - AA470D6717C3D380005CBB7F /* Supporting Files */, - ); - path = LinTests; - sourceTree = ""; - }; - AA470D6717C3D380005CBB7F /* Supporting Files */ = { - isa = PBXGroup; - children = ( - AA470D6817C3D380005CBB7F /* LinTests-Info.plist */, - AA470D6917C3D380005CBB7F /* InfoPlist.strings */, - AA470D6E17C3D380005CBB7F /* LinTests-Prefix.pch */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - AA470D7817C3DD42005CBB7F /* Models */ = { - isa = PBXGroup; - children = ( - AA470D5917C3CFEC005CBB7F /* LNDetector.h */, - AA470D5A17C3CFEC005CBB7F /* LNDetector.m */, - AA470D5C17C3D05D005CBB7F /* LNEntity.h */, - AA470D5D17C3D05D005CBB7F /* LNEntity.m */, - AA7D4DB217C74D0A0092DF8A /* LNLocalization.h */, - AA7D4DB317C74D0A0092DF8A /* LNLocalization.m */, - AA7D4DAF17C74CFE0092DF8A /* LNLocalizationCollection.h */, - AA7D4DB017C74CFE0092DF8A /* LNLocalizationCollection.m */, - AAB0CD2F17C4382D0085E913 /* LNRegularExpressionPattern.h */, - AAB0CD3017C4382D0085E913 /* LNRegularExpressionPattern.m */, - AAB0CD3217C448200085E913 /* LNRegularExpressionPattern+type.h */, - AAB0CD3317C448200085E913 /* LNRegularExpressionPattern+type.m */, - ); - path = Models; - sourceTree = ""; - }; - AA93691817C4E4C700E94318 /* Xcode-Private-Classes */ = { - isa = PBXGroup; - children = ( - AA11AC4017C66F0200889DFB /* DVTFilePath.h */, - AA7B0CB317F422BB0004FE3B /* DVTSourceTextView.h */, - AADEADBB17C872EB001E0C65 /* IDEEditorDocument.h */, - AA11AC4317C6746800889DFB /* IDEIndex.h */, - AA11AC4617C6755400889DFB /* IDEIndexCollection.h */, - AA93691517C4E4C000E94318 /* IDEWorkspace.h */, - AA7B0CB017F4229D0004FE3B /* IDEWorkspaceWindow.h */, - ); - path = "Xcode-Private-Classes"; - sourceTree = ""; - }; - AAB0CD3D17C478EF0085E913 /* Models */ = { - isa = PBXGroup; - children = ( - AAB0CD3A17C477030085E913 /* LNDetectorTestSet.h */, - AAB0CD3B17C477030085E913 /* LNDetectorTestSet.m */, - ); - name = Models; - sourceTree = ""; - }; - AADDDA9517C49D4D00BBA67C /* Categories */ = { - isa = PBXGroup; - children = ( - AADEADB517C87298001E0C65 /* IDEIndex+Lin.h */, - AADEADB617C87298001E0C65 /* IDEIndex+Lin.m */, - ); - path = Categories; - sourceTree = ""; - }; - AADDDA9B17C4A0DA00BBA67C /* Resources */ = { - isa = PBXGroup; - children = ( - 2BC7C6A41A2FC3C60065C278 /* Media.xcassets */, - 2BC7C6A31A2FC3A10065C278 /* XIBs */, - ); - path = Resources; - sourceTree = ""; - }; - AADDDA9C17C4A0E200BBA67C /* Window Controllers */ = { - isa = PBXGroup; - children = ( - AA95FDED17EB4E77007D33D4 /* PopoverWindowController.h */, - AA95FDEE17EB4E77007D33D4 /* PopoverWindowController.m */, - ); - path = "Window Controllers"; - sourceTree = ""; - }; - AADDDAA017C4A3BA00BBA67C /* Views */ = { - isa = PBXGroup; - children = ( - AAAC873117ED9D4F00BF251D /* LNHorizontalLine.h */, - AAAC873217ED9D4F00BF251D /* LNHorizontalLine.m */, - AAAC873917EDA9CF00BF251D /* PopoverWindow.h */, - AAAC873A17EDA9CF00BF251D /* PopoverWindow.m */, - ); - path = Views; - sourceTree = ""; - }; - AAFE3C4017EED0950018E478 /* Resources */ = { - isa = PBXGroup; - children = ( - AAFE3C3E17EECF4A0018E478 /* Localizable.strings */, - ); - name = Resources; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - AA1B7DA217C3C1EC00A3A6D7 /* Lin */ = { - isa = PBXNativeTarget; - buildConfigurationList = AA1B7DB517C3C1EC00A3A6D7 /* Build configuration list for PBXNativeTarget "Lin" */; - buildPhases = ( - AA1B7D9F17C3C1EC00A3A6D7 /* Sources */, - AA1B7DA017C3C1EC00A3A6D7 /* Frameworks */, - AA1B7DA117C3C1EC00A3A6D7 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Lin; - productName = Lin; - productReference = AA1B7DA317C3C1EC00A3A6D7 /* Lin.xcplugin */; - productType = "com.apple.product-type.bundle"; - }; - AA470D6217C3D380005CBB7F /* LinTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = AA470D7117C3D380005CBB7F /* Build configuration list for PBXNativeTarget "LinTests" */; - buildPhases = ( - AA470D5F17C3D380005CBB7F /* Sources */, - AA470D6017C3D380005CBB7F /* Frameworks */, - AA470D6117C3D380005CBB7F /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - AA470D7017C3D380005CBB7F /* PBXTargetDependency */, - ); - name = LinTests; - productName = LinTests; - productReference = AA470D6317C3D380005CBB7F /* LinTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - AA1B7D9B17C3C1EC00A3A6D7 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0610; - ORGANIZATIONNAME = evolved.io; - TargetAttributes = { - AA470D6217C3D380005CBB7F = { - TestTargetID = AA1B7DA217C3C1EC00A3A6D7; - }; - }; - }; - buildConfigurationList = AA1B7D9E17C3C1EC00A3A6D7 /* Build configuration list for PBXProject "Lin" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = AA1B7D9A17C3C1EC00A3A6D7; - productRefGroup = AA1B7DA417C3C1EC00A3A6D7 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - AA1B7DA217C3C1EC00A3A6D7 /* Lin */, - AA470D6217C3D380005CBB7F /* LinTests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - AA1B7DA117C3C1EC00A3A6D7 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - AA95FDEC17EB48A9007D33D4 /* MainViewController.xib in Resources */, - 2BC7C6A81A2FC4690065C278 /* InfoPlist.strings in Resources */, - AA02CE8B17EE08240041C2BD /* AddViewController.xib in Resources */, - 2BC7C6A51A2FC3C60065C278 /* Media.xcassets in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - AA470D6117C3D380005CBB7F /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - AA470D6B17C3D380005CBB7F /* InfoPlist.strings in Resources */, - AAFE3C3F17EECF4A0018E478 /* Localizable.strings in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - AA1B7D9F17C3C1EC00A3A6D7 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - AA7D4DB117C74CFE0092DF8A /* LNLocalizationCollection.m in Sources */, - AAB0CD3417C448200085E913 /* LNRegularExpressionPattern+type.m in Sources */, - AAAC873B17EDA9CF00BF251D /* PopoverWindow.m in Sources */, - AA470D5E17C3D05D005CBB7F /* LNEntity.m in Sources */, - AA7D4DB417C74D0A0092DF8A /* LNLocalization.m in Sources */, - 2B0E049B1A3385AE0052E29D /* AddViewController.m in Sources */, - AAB0CD3117C4382D0085E913 /* LNRegularExpressionPattern.m in Sources */, - AA1B7DBA17C3C20F00A3A6D7 /* Lin.m in Sources */, - AAAC873317ED9D4F00BF251D /* LNHorizontalLine.m in Sources */, - 2B2FEC9B1A2F894500D0534D /* MainViewController.m in Sources */, - AADEADB717C87298001E0C65 /* IDEIndex+Lin.m in Sources */, - AA2980B417EE2C5300CF46E3 /* LNUserDefaultsManager.m in Sources */, - AA95FDEF17EB4E77007D33D4 /* PopoverWindowController.m in Sources */, - F5859DBD18CABC2A009AF108 /* LNLocalizedStringCollectionOperation.m in Sources */, - AA470D5B17C3CFEC005CBB7F /* LNDetector.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - AA470D5F17C3D380005CBB7F /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - AAFE3C4117EED36C0018E478 /* LNLocalizationCollection.m in Sources */, - AADEADB417C7B838001E0C65 /* LNLocalization.m in Sources */, - AAB0CD3C17C477030085E913 /* LNDetectorTestSet.m in Sources */, - AAB0CD3717C46B070085E913 /* LNEntity.m in Sources */, - AAB0CD3817C46B070085E913 /* LNRegularExpressionPattern.m in Sources */, - AAB0CD3917C46B070085E913 /* LNRegularExpressionPattern+type.m in Sources */, - AAB0CD3617C46A730085E913 /* LNDetector.m in Sources */, - AA470D7D17C3DE31005CBB7F /* LNDetectorTests.m in Sources */, - AADEADB317C7B6D3001E0C65 /* LNLocalizationTests.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - AA470D7017C3D380005CBB7F /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = AA1B7DA217C3C1EC00A3A6D7 /* Lin */; - targetProxy = AA470D6F17C3D380005CBB7F /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - 2BC7C6AA1A2FC4690065C278 /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 2BC7C6A91A2FC4690065C278 /* en */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; - AA470D6917C3D380005CBB7F /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - AA470D6A17C3D380005CBB7F /* en */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - AA1B7DB317C3C1EC00A3A6D7 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.10; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = macosx; - }; - name = Debug; - }; - AA1B7DB417C3C1EC00A3A6D7 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.10; - SDKROOT = macosx; - }; - name = Release; - }; - AA1B7DB617C3C1EC00A3A6D7 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - COMBINE_HIDPI_IMAGES = YES; - DEPLOYMENT_LOCATION = YES; - DSTROOT = "$(HOME)"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(SYSTEM_APPS_DIR)/Xcode.app/Contents/SharedFrameworks", - "$(SYSTEM_APPS_DIR)/Xcode.app/Contents/Frameworks", - ); - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "Lin/Supporting Files/Lin-Prefix.pch"; - INFOPLIST_FILE = "Lin/Supporting Files/Lin-Info.plist"; - INSTALL_PATH = "/Library/Application Support/Developer/Shared/Xcode/Plug-ins"; - PRODUCT_NAME = "$(TARGET_NAME)"; - WRAPPER_EXTENSION = xcplugin; - }; - name = Debug; - }; - AA1B7DB717C3C1EC00A3A6D7 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - COMBINE_HIDPI_IMAGES = YES; - DEPLOYMENT_LOCATION = YES; - DSTROOT = "$(HOME)"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(SYSTEM_APPS_DIR)/Xcode.app/Contents/SharedFrameworks", - "$(SYSTEM_APPS_DIR)/Xcode.app/Contents/Frameworks", - ); - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "Lin/Supporting Files/Lin-Prefix.pch"; - INFOPLIST_FILE = "Lin/Supporting Files/Lin-Info.plist"; - INSTALL_PATH = "/Library/Application Support/Developer/Shared/Xcode/Plug-ins"; - PRODUCT_NAME = "$(TARGET_NAME)"; - WRAPPER_EXTENSION = xcplugin; - }; - name = Release; - }; - AA470D7217C3D380005CBB7F /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - COMBINE_HIDPI_IMAGES = YES; - FRAMEWORK_SEARCH_PATHS = ( - "$(DEVELOPER_FRAMEWORKS_DIR)", - "$(inherited)", - ); - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "LinTests/LinTests-Prefix.pch"; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - INFOPLIST_FILE = "LinTests/LinTests-Info.plist"; - PRODUCT_NAME = "$(TARGET_NAME)"; - WRAPPER_EXTENSION = xctest; - }; - name = Debug; - }; - AA470D7317C3D380005CBB7F /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - COMBINE_HIDPI_IMAGES = YES; - FRAMEWORK_SEARCH_PATHS = ( - "$(DEVELOPER_FRAMEWORKS_DIR)", - "$(inherited)", - ); - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "LinTests/LinTests-Prefix.pch"; - INFOPLIST_FILE = "LinTests/LinTests-Info.plist"; - PRODUCT_NAME = "$(TARGET_NAME)"; - WRAPPER_EXTENSION = xctest; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - AA1B7D9E17C3C1EC00A3A6D7 /* Build configuration list for PBXProject "Lin" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - AA1B7DB317C3C1EC00A3A6D7 /* Debug */, - AA1B7DB417C3C1EC00A3A6D7 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - AA1B7DB517C3C1EC00A3A6D7 /* Build configuration list for PBXNativeTarget "Lin" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - AA1B7DB617C3C1EC00A3A6D7 /* Debug */, - AA1B7DB717C3C1EC00A3A6D7 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - AA470D7117C3D380005CBB7F /* Build configuration list for PBXNativeTarget "LinTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - AA470D7217C3D380005CBB7F /* Debug */, - AA470D7317C3D380005CBB7F /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = AA1B7D9B17C3C1EC00A3A6D7 /* Project object */; -} diff --git a/Lin.xcodeproj/xcshareddata/xcschemes/Lin.xcscheme b/Lin.xcodeproj/xcshareddata/xcschemes/Lin.xcscheme deleted file mode 100644 index baa7026..0000000 --- a/Lin.xcodeproj/xcshareddata/xcschemes/Lin.xcscheme +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Lin.xcodeproj/xcshareddata/xcschemes/LinTests.xcscheme b/Lin.xcodeproj/xcshareddata/xcschemes/LinTests.xcscheme deleted file mode 100644 index 06826fe..0000000 --- a/Lin.xcodeproj/xcshareddata/xcschemes/LinTests.xcscheme +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Lin/Categories/IDEIndex+Lin.h b/Lin/Categories/IDEIndex+Lin.h deleted file mode 100644 index dea5d58..0000000 --- a/Lin/Categories/IDEIndex+Lin.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// IDEIndex+Lin.h -// Lin -// -// Created by Tanaka Katsuma on 2013/08/24. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import "IDEIndex.h" - -@interface IDEIndex (Lin) - -@end diff --git a/Lin/Categories/IDEIndex+Lin.m b/Lin/Categories/IDEIndex+Lin.m deleted file mode 100644 index 4809599..0000000 --- a/Lin/Categories/IDEIndex+Lin.m +++ /dev/null @@ -1,27 +0,0 @@ -// -// IDEIndex+Lin.m -// Lin -// -// Created by Tanaka Katsuma on 2013/08/24. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import "IDEIndex+Lin.h" -#import "Lin.h" -#import - -static IMP __original_Method_Imp; - -void _evo_lin_close_Method(id self, SEL _cmd) { - [[Lin sharedPlugIn] removeLocalizationsForIndex:self]; - ((void(*)(id,SEL))__original_Method_Imp)(self, _cmd); -} - -@implementation IDEIndex (Lin) - -+ (void)load { - Method m = class_getInstanceMethod(self, @selector(close)); - __original_Method_Imp = method_setImplementation(m, (IMP)_evo_lin_close_Method); -} - -@end diff --git a/Lin/Lin.h b/Lin/Lin.h deleted file mode 100644 index 6cce069..0000000 --- a/Lin/Lin.h +++ /dev/null @@ -1,21 +0,0 @@ -// -// Lin.h -// Lin -// -// Created by Tanaka Katsuma on 2013/08/21. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import - -@class IDEIndex; - -@interface Lin : NSObject - -+ (void)pluginDidLoad:(NSBundle *)bundle; -+ (instancetype)sharedPlugIn; - -- (void)indexNeedsUpdate:(IDEIndex *)index; -- (void)removeLocalizationsForIndex:(IDEIndex *)index; - -@end diff --git a/Lin/Lin.m b/Lin/Lin.m deleted file mode 100644 index e2ca926..0000000 --- a/Lin/Lin.m +++ /dev/null @@ -1,528 +0,0 @@ -// -// Lin.m -// Lin -// -// Created by Tanaka Katsuma on 2013/08/21. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import "Lin.h" -#import "IDEWorkspace.h" -#import "DVTFilePath.h" -#import "IDEIndex.h" -#import "IDEIndexCollection.h" -#import "IDEEditorDocument.h" -#import "IDEWorkspaceWindow.h" -#import "DVTSourceTextView.h" -#import "LNUserDefaultsManager.h" -#import "LNDetector.h" -#import "LNEntity.h" -#import "LNLocalizationCollection.h" -#import "LNLocalization.h" -#import "MainViewController.h" -#import "LNLocalizedStringCollectionOperation.h" -#import "PopoverWindowController.h" - -static Lin *_sharedPlugin = nil; - -@interface Lin () - -@property (nonatomic, strong) NSPopover *popover; -@property (nonatomic, strong) PopoverWindowController *popoverWindowController; - -@property (nonatomic, strong) NSTextView *textView; - -@property (nonatomic, strong) LNDetector *detector; -@property (nonatomic, strong) NSMutableDictionary *workspaceLocalizations; -@property (nonatomic, copy) NSString *currentWorkspaceFilePath; -@property (nonatomic, unsafe_unretained) NSResponder *previousFirstResponder; -@property (nonatomic, assign, getter = isActivated) BOOL activated; - -@property (nonatomic, strong) NSMenuItem *enableMenuItem; -@property (nonatomic, strong) NSMenuItem *showWindowMenuItem; -@property (nonatomic, strong) NSOperationQueue *collectionProcessQueue; - -@end - -@implementation Lin - -+ (void)pluginDidLoad:(NSBundle *)bundle { - static dispatch_once_t _onceToken; - dispatch_once(&_onceToken, ^{ - _sharedPlugin = [[self alloc] init]; - }); -} - -+ (instancetype)sharedPlugIn { - return _sharedPlugin; -} - -- (instancetype)init { - self = [super init]; - - if (self) { - // Initialization - self.detector = [LNDetector detector]; - self.workspaceLocalizations = [NSMutableDictionary dictionary]; - - // Create menu - [self createMenuItem]; - - // Load views - [self instantiatePopover]; - [self instantiatePopoverWindowController]; - - // Register to notification center - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(workspaceWindowDidBecomeMain:) name:NSWindowDidBecomeMainNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(indexDidIndexWorkspace:) name:@"IDEIndexDidIndexWorkspaceNotification" object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(editorDocumentDidSave:) name:@"IDEEditorDocumentDidSaveNotification" object:nil]; - - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(popoverContentViewLocalizationDidSelect:) name:LNPopoverContentViewLocalizationDidSelectNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(popoverContentViewDetachButtonDidClick:) name:LNPopoverContentViewDetachButtonDidClickNotification object:nil]; - - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(menuDidChange:) name:NSMenuDidChangeItemNotification object:nil]; - - // Activate if enabled - if ([[LNUserDefaultsManager sharedManager] isEnabled]) { - [self activate]; - } - - self.collectionProcessQueue = [[NSOperationQueue alloc] init]; - self.collectionProcessQueue.maxConcurrentOperationCount = 1; - } - - return self; -} - -- (void)instantiatePopover { - NSBundle *bundle = [NSBundle bundleForClass:[self class]]; - MainViewController *contentViewController = [[MainViewController alloc] initWithNibName:@"MainViewController" bundle:bundle]; - contentViewController.inPopover = YES; - - NSPopover *popover = [[NSPopover alloc] init]; - popover.delegate = self; - popover.animates = NO; - popover.behavior = NSPopoverBehaviorTransient; - popover.contentViewController = contentViewController; - - self.popover = popover; -} - -- (void)instantiatePopoverWindowController { - NSBundle *bundle = [NSBundle bundleForClass:[self class]]; - MainViewController *contentViewController = [[MainViewController alloc] initWithNibName:@"MainViewController" bundle:bundle]; - contentViewController.inPopover = NO; - - PopoverWindowController *popoverWindowController = [[PopoverWindowController alloc] initWithContentViewController:contentViewController]; - - self.popoverWindowController = popoverWindowController; -} - -- (void)dealloc { - // Deactivate - [self deactivate]; - - // Remove from notification center - [[NSNotificationCenter defaultCenter] removeObserver:self]; -} - - -#pragma mark - Managing Application State - -- (void)activate { - if (!self.activated) { - self.activated = YES; - - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textDidChange:) name:NSTextDidChangeNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textViewDidChangeSelection:) name:NSTextViewDidChangeSelectionNotification object:nil]; - } -} - -- (void)deactivate { - if (self.activated) { - self.activated = NO; - - [[NSNotificationCenter defaultCenter] removeObserver:self name:NSTextDidChangeNotification object:nil]; - [[NSNotificationCenter defaultCenter] removeObserver:self name:NSTextViewDidChangeSelectionNotification object:nil]; - } -} - - -#pragma mark - Notifications - -- (void)textDidChange:(NSNotification *)notification { - if ([notification.object isKindOfClass:DVTSourceTextView.class]) { - NSTextView *textView = (NSTextView *)notification.object; - self.textView = textView; - - // Find entity - LNEntity *entity = [self selectedEntityInTextView:textView]; - - if (entity) { - [self presentPopoverInTextView:textView entity:entity]; - } else { - [self dismissPopover]; - } - } -} - -- (void)textViewDidChangeSelection:(NSNotification *)notification { - if ([notification.object isKindOfClass:DVTSourceTextView.class]) { - NSTextView *textView = (NSTextView *)notification.object; - self.textView = textView; - - // Find entity - LNEntity *entity = [self selectedEntityInTextView:textView]; - - if (entity) { - [self presentPopoverInTextView:textView entity:entity]; - } else { - [self dismissPopover]; - } - } -} - -- (void)workspaceWindowDidBecomeMain:(NSNotification *)notification { - if ([notification.object isKindOfClass:IDEWorkspaceWindow.class]) { - NSWindow *workspaceWindow = (NSWindow *)notification.object; - NSWindowController *workspaceWindowController = (NSWindowController *)workspaceWindow.windowController; - - IDEWorkspace *workspace = (IDEWorkspace *)[workspaceWindowController valueForKey:@"_workspace"]; - DVTFilePath *representingFilePath = workspace.representingFilePath; - NSString *pathString = representingFilePath.pathString; - - self.currentWorkspaceFilePath = pathString; - } -} - -- (void)indexDidIndexWorkspace:(NSNotification *)notification { - IDEIndex *index = (IDEIndex *)notification.object; - [self indexNeedsUpdate:index]; -} - -- (void)editorDocumentDidSave:(NSNotification *)notification { - IDEEditorDocument *editorDocument = (IDEEditorDocument *)notification.object; - DVTFilePath *filePath = editorDocument.filePath; - NSString *pathString = filePath.pathString; - - // Check whether there are any changes to .strings - NSArray *collections = self.workspaceLocalizations[self.currentWorkspaceFilePath]; - - for (LNLocalizationCollection *collection in collections) { - if ([collection.filePath isEqualToString:pathString]) { - [collection reloadLocalizations]; - - break; - } - } -} - -- (void)popoverContentViewLocalizationDidSelect:(NSNotification *)notification { - NSTextView *textView = self.textView; - LNEntity *entity = [self selectedEntityInTextView:textView]; - - if (entity) { - NSArray *selectedRanges = textView.selectedRanges; - - if (selectedRanges.count > 0) { - NSRange selectedRange = [selectedRanges[0] rangeValue]; - - // Locate the key - NSRange lineRange = [textView.textStorage.string lineRangeForRange:selectedRange]; - NSRange keyRange = NSMakeRange(lineRange.location + entity.keyRange.location, entity.keyRange.length); - - // Replace - LNLocalization *localization = [notification userInfo][LNPopoverContentViewLocalizationKey]; - [textView insertText:localization.key replacementRange:keyRange]; - } - } -} - -- (void)popoverContentViewDetachButtonDidClick:(NSNotification *)notification { - [self preparePopoverWindow]; - [self detachPopover]; -} - -- (void)menuDidChange:(NSNotification *)notification { - // Create menu item - [self createMenuItem]; -} - -#pragma mark - Detaching Popover - -- (void)preparePopoverWindow { - // Resize popover window - NSWindow *popoverWindow = self.popover.contentViewController.view.window; - - [self.popoverWindowController.window setFrame:NSMakeRect(popoverWindow.frame.origin.x, popoverWindow.frame.origin.y - (80.0 / 2.0), self.popover.contentSize.width, self.popover.contentSize.height + 80.0) display:NO]; - - // Copy popover content - MainViewController *popoverMainViewController = (MainViewController *)self.popover.contentViewController; - MainViewController *windowMainViewController = (MainViewController *)self.popoverWindowController.contentViewController; - windowMainViewController.tableView.sortDescriptors = popoverMainViewController.tableView.sortDescriptors; - windowMainViewController.collections = popoverMainViewController.collections; - windowMainViewController.searchString = popoverMainViewController.searchString; -} - -- (void)detachPopover { - [self dismissPopover]; - [self.popoverWindowController showWindow:nil]; -} - -#pragma mark - Entity - -- (LNEntity *)selectedEntityInTextView:(NSTextView *)textView { - NSArray *selectedRanges = textView.selectedRanges; - - if (selectedRanges.count > 0) { - NSRange selectedRange = [selectedRanges[0] rangeValue]; - - // Locate the line containing the caret - NSString *string = textView.textStorage.string; - NSRange lineRange = [string lineRangeForRange:selectedRange]; - NSString *lineString = [string substringWithRange:lineRange]; - NSRange selectedRangeInLine = NSMakeRange(selectedRange.location - lineRange.location, selectedRange.length); - - // Search for the entities - NSArray *entities = [self.detector entitiesInString:lineString]; - - for (LNEntity *entity in entities) { - if (NSLocationInRange(selectedRangeInLine.location, entity.entityRange)) { - return entity; - } - } - } - - return nil; -} - -#pragma mark - Menu - -- (void)createMenuItem { - NSMenuItem *editorMenuItem = [[NSApp mainMenu] itemWithTitle:@"Editor"]; - - if (editorMenuItem && [editorMenuItem.submenu itemWithTitle:@"Lin"] == nil) { - // Load defaults - BOOL enabled = LNUserDefaultsManager.sharedManager.isEnabled; - - NSMenuItem *menuItem = [[NSMenuItem alloc] initWithTitle:@"Lin" action:NULL keyEquivalent:@""]; - - NSMenu *submenu = [[NSMenu alloc] initWithTitle:@"Lin"]; - menuItem.submenu = submenu; - - // Enable Lin - NSMenuItem *enableMenuItem = [[NSMenuItem alloc] initWithTitle:@"Enable Lin" action:@selector(toggleEnabled:) keyEquivalent:@""]; - [enableMenuItem setTarget:self]; - enableMenuItem.state = enabled ? NSOnState : NSOffState; - - [submenu addItem:enableMenuItem]; - self.enableMenuItem = enableMenuItem; - - // Show Window - NSMenuItem *showWindowMenuItem = [[NSMenuItem alloc] initWithTitle:@"Show Window" action:@selector(showWindow:) keyEquivalent:@""]; - [showWindowMenuItem setTarget:self]; - - [submenu addItem:showWindowMenuItem]; - self.showWindowMenuItem = showWindowMenuItem; - - // Separator - [submenu addItem:NSMenuItem.separatorItem]; - - // Version Info - NSMenuItem *versionInfoMenuItem = [[NSMenuItem alloc] initWithTitle:@"Version Info" action:@selector(showVersionInfo:) keyEquivalent:@""]; - [versionInfoMenuItem setTarget:self]; - [submenu addItem:versionInfoMenuItem]; - - [editorMenuItem.submenu addItem:NSMenuItem.separatorItem]; - [editorMenuItem.submenu addItem:menuItem]; - } -} - -- (BOOL)validateMenuItem:(NSMenuItem *)menuItem { - if (menuItem == self.showWindowMenuItem) { - return LNUserDefaultsManager.sharedManager.isEnabled; - } - - return YES; -} - -- (void)toggleEnabled:(id)sender { - // Save defaults - LNUserDefaultsManager *userDefaultManager = LNUserDefaultsManager.sharedManager; - BOOL enabled = !userDefaultManager.isEnabled; - userDefaultManager.enabled = enabled; - - // Update menu item - self.enableMenuItem.state = enabled ? NSOnState : NSOffState; - - // Activate/Deactivate - if (enabled) { - [self activate]; - } else { - [self deactivate]; - } -} - -- (void)showWindow:(id)sender { - // Prepare window - NSArray *collections = self.workspaceLocalizations[self.currentWorkspaceFilePath]; - - MainViewController *mainViewController = (MainViewController *)self.popoverWindowController.contentViewController; - mainViewController.collections = collections; - mainViewController.searchString = nil; - - // Show window - [self.popoverWindowController.window setFrame:NSMakeRect(0, 0, 500, 280) display:NO]; - [self.popoverWindowController.window center]; - [self.popoverWindowController showWindow:nil]; -} - -- (void)showVersionInfo:(id)sender { - // Create alert - NSBundle *bundle = [NSBundle bundleForClass:[self class]]; - NSAlert *alert = [[NSAlert alloc] init]; - alert.messageText = @"Lin"; - [alert addButtonWithTitle:@"OK"]; - alert.informativeText = [NSString stringWithFormat:@"Version %@\n\nVersion 1 and 2 by Katsuma Tanaka\n(Email: questbeat@gmail.com, Twitter: @questbeat)\n\nVersion 3 by Sascha Schwabbauer\n(Email: sascha@evolved.io, Twitter: @_SaschaS)", [bundle objectForInfoDictionaryKey:@"CFBundleShortVersionString"]]; - - // Set icon - NSString *filePath = [bundle pathForResource:@"icon120" ofType:@"tiff"]; - NSImage *icon = [[NSImage alloc] initWithContentsOfFile:filePath]; - [alert setIcon:icon]; - - // Show alert - [alert runModal]; -} - -#pragma mark - Index - -- (void)indexNeedsUpdate:(IDEIndex *)index { - DVTFilePath *workspaceFile = index.workspaceFile; - NSString *workspaceFilePath = workspaceFile.pathString; - - if (workspaceFilePath) { - [self.collectionProcessQueue cancelAllOperations]; - [self updateLocalizationsForIndex:index]; - } -} - -- (void)updateLocalizationsForIndex:(IDEIndex *)index { - LNLocalizedStringCollectionOperation *processOperation = [[LNLocalizedStringCollectionOperation alloc] initWithIndex:index]; - processOperation.collectionCompletedBlock = ^(NSString *workspaceFilePath, NSArray *collections) { - self.workspaceLocalizations[workspaceFilePath] = collections; - if ([workspaceFilePath isEqualToString:self.currentWorkspaceFilePath]) { - if ([self.popover isShown]) { - MainViewController *mainViewController = (MainViewController *)self.popover.contentViewController; - mainViewController.collections = collections; - } else if ([self.popoverWindowController.window isVisible]) { - MainViewController *mainViewController = (MainViewController *)self.popoverWindowController.contentViewController; - mainViewController.collections = collections; - } - } - }; - - [self.collectionProcessQueue addOperation:processOperation]; -} - -- (void)removeLocalizationsForIndex:(IDEIndex *)index { - DVTFilePath *workspaceFile = index.workspaceFile; - NSString *workspaceFilePath = workspaceFile.pathString; - - if (workspaceFilePath) { - [self.workspaceLocalizations removeObjectForKey:workspaceFilePath]; - } -} - - -#pragma mark - Popover - -- (void)presentPopoverInTextView:(NSTextView *)textView entity:(LNEntity *)entity { - if (!LNUserDefaultsManager.sharedManager.isEnabled) { - return; - } - - NSArray *selectedRanges = textView.selectedRanges; - - if (selectedRanges.count > 0) { - NSRange selectedRange = [selectedRanges[0] rangeValue]; - - // Locate the line containing the caret - NSRange lineRange = [textView.textStorage.string lineRangeForRange:selectedRange]; - - // Stick popover at the beginning of the key - NSRange keyRange = NSMakeRange(lineRange.location + entity.keyRange.location, 1); - NSRect keyRectOnScreen = [textView firstRectForCharacterRange:keyRange actualRange:nil]; - NSRect keyRectOnWindow = [textView.window convertRectFromScreen:keyRectOnScreen]; - NSRect keyRectOnTextView = [textView convertRect:keyRectOnWindow fromView:nil]; - - // Update or show popover - NSArray *collections = self.workspaceLocalizations[self.currentWorkspaceFilePath]; - NSString *key = [textView.textStorage.string substringWithRange:NSMakeRange(lineRange.location + entity.keyRange.location, entity.keyRange.length)]; - - if ([self.popoverWindowController.window isVisible]) { - // Update popover content - MainViewController *mainViewController = (MainViewController *)self.popoverWindowController.contentViewController; - mainViewController.collections = collections; - mainViewController.searchString = key; - } else { - if ([self.popover isShown]) { - // Update the position for popover when the cursor moved - self.popover.positioningRect = keyRectOnTextView; - - // Update popover content - MainViewController *mainViewController = (MainViewController *)self.popover.contentViewController; - mainViewController.searchString = key; - } else { - // Show popover - [self.popover showRelativeToRect:keyRectOnTextView ofView:textView preferredEdge:NSMinYEdge]; - - // Update popover content - MainViewController *mainViewController = (MainViewController *)self.popover.contentViewController; - mainViewController.collections = collections; - mainViewController.searchString = key; - } - } - } -} - -- (void)dismissPopover { - if ([self.popoverWindowController.window isVisible]) { - // Update popover content - NSArray *collections = self.workspaceLocalizations[self.currentWorkspaceFilePath]; - - MainViewController *mainViewController = (MainViewController *)self.popoverWindowController.contentViewController; - mainViewController.collections = collections; - mainViewController.searchString = nil; - } else { - // Hide popover - if (self.popover.isShown) { - [self.popover performClose:self]; - } - } -} - -#pragma mark - NSPopoverDelegate - -- (void)popoverWillShow:(NSNotification *)notification { - // Save first responder - self.previousFirstResponder = [self.textView.window firstResponder]; -} - -- (void)popoverDidShow:(NSNotification *)notification { - // Reclaim key window and first responder - [self.textView.window becomeKeyWindow]; - [self.textView.window makeFirstResponder:self.previousFirstResponder]; -} - -- (BOOL)popoverShouldDetach:(NSPopover *)popover { - return YES; -} - -- (NSWindow *)detachableWindowForPopover:(NSPopover *)popover { - // Prepare for detaching - [self preparePopoverWindow]; - - return self.popoverWindowController.window; -} - -@end diff --git a/Lin/Models/LNDetector.h b/Lin/Models/LNDetector.h deleted file mode 100644 index 8cd5cd9..0000000 --- a/Lin/Models/LNDetector.h +++ /dev/null @@ -1,19 +0,0 @@ -// -// LNDetector.h -// Lin -// -// Created by Tanaka Katsuma on 2013/08/21. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import - -@interface LNDetector : NSObject - -@property (nonatomic, copy, readonly) NSArray *regularExpressionPatterns; - -+ (instancetype)detector; - -- (NSArray *)entitiesInString:(NSString *)string; - -@end diff --git a/Lin/Models/LNDetector.m b/Lin/Models/LNDetector.m deleted file mode 100644 index 76c213a..0000000 --- a/Lin/Models/LNDetector.m +++ /dev/null @@ -1,79 +0,0 @@ -// -// LNDetector.m -// Lin -// -// Created by Tanaka Katsuma on 2013/08/21. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import "LNDetector.h" - -// Models -#import "LNEntity.h" -#import "LNRegularExpressionPattern.h" -#import "LNRegularExpressionPattern+type.h" - -@interface LNDetector () - -@property (nonatomic, copy, readwrite) NSArray *regularExpressionPatterns; - -@end - -@implementation LNDetector - -+ (instancetype)detector -{ - return [[self alloc] init]; -} - -- (instancetype)init -{ - self = [super init]; - - if (self) { - self.regularExpressionPatterns = @[ - [LNRegularExpressionPattern patternWithType:LNEntityTypeLocalizedString], - [LNRegularExpressionPattern patternWithType:LNEntityTypeLocalizedStringForKey], - [LNRegularExpressionPattern patternWithType:LNEntityTypeLocalizedStringFromTable], - [LNRegularExpressionPattern patternWithType:LNEntityTypeLocalizedStringFromTableInBundle], - [LNRegularExpressionPattern patternWithType:LNEntityTypeLocalizedStringWithDefaultValue] - ]; - } - - return self; -} - - -#pragma mark - Finding Entities - -- (NSArray *)entitiesInString:(NSString *)string -{ - NSMutableArray *entities = [NSMutableArray array]; - - for (LNRegularExpressionPattern *regularExpressionPattern in self.regularExpressionPatterns) { - NSRegularExpression *regularExpression = [NSRegularExpression regularExpressionWithPattern:regularExpressionPattern.pattern options:0 error:NULL]; - - __block NSRange entityRange; - __block NSRange keyRange; - - [regularExpression enumerateMatchesInString:string - options:0 - range:NSMakeRange(0, string.length) - usingBlock:^(NSTextCheckingResult *result, NSMatchingFlags flags, BOOL *stop) { - if (result.numberOfRanges == regularExpressionPattern.numberOfRanges) { - entityRange = [result rangeAtIndex:regularExpressionPattern.entityRangeIndex]; - keyRange = [result rangeAtIndex:regularExpressionPattern.keyRangeIndex]; - - LNEntity *entity = [LNEntity entityWithType:regularExpressionPattern.type - entityRange:entityRange - keyRange:keyRange]; - - [entities addObject:entity]; - } - }]; - } - - return [entities copy]; -} - -@end diff --git a/Lin/Models/LNEntity.h b/Lin/Models/LNEntity.h deleted file mode 100644 index 3aee520..0000000 --- a/Lin/Models/LNEntity.h +++ /dev/null @@ -1,53 +0,0 @@ -// -// LNEntity.h -// Lin -// -// Created by Tanaka Katsuma on 2013/08/21. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import - -typedef NS_ENUM(NSUInteger, LNEntityType) { - LNEntityTypeLocalizedString = 0, - LNEntityTypeLocalizedStringForKey, - LNEntityTypeLocalizedStringFromTable, - LNEntityTypeLocalizedStringFromTableInBundle, - LNEntityTypeLocalizedStringWithDefaultValue -}; - -NS_INLINE NSString * NSStringFromEntityType(LNEntityType type) { - NSString *string = nil; - - switch (type) { - case LNEntityTypeLocalizedString: - string = @"LNEntityTypeLocalizedString"; - break; - case LNEntityTypeLocalizedStringForKey: - string = @"LNEntityTypeLocalizedStringForKey"; - break; - case LNEntityTypeLocalizedStringFromTable: - string = @"LNEntityTypeLocalizedStringFromTable"; - break; - case LNEntityTypeLocalizedStringFromTableInBundle: - string = @"LNEntityTypeLocalizedStringFromTableInBundle"; - break; - case LNEntityTypeLocalizedStringWithDefaultValue: - string = @"LNEntityTypeLocalizedStringWithDefaultValue"; - break; - } - - return string; -} - -@interface LNEntity : NSObject - -@property (nonatomic, assign, readonly) LNEntityType type; -@property (nonatomic, assign, readonly) NSRange entityRange; -@property (nonatomic, assign, readonly) NSRange keyRange; - -+ (instancetype)entityWithType:(LNEntityType)type entityRange:(NSRange)entityRange keyRange:(NSRange)keyRange; - -- (instancetype)initWithType:(LNEntityType)type entityRange:(NSRange)entityRange keyRange:(NSRange)keyRange NS_DESIGNATED_INITIALIZER; - -@end diff --git a/Lin/Models/LNEntity.m b/Lin/Models/LNEntity.m deleted file mode 100644 index 8f029ce..0000000 --- a/Lin/Models/LNEntity.m +++ /dev/null @@ -1,63 +0,0 @@ -// -// LNEntity.m -// Lin -// -// Created by Tanaka Katsuma on 2013/08/21. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import "LNEntity.h" - -@interface LNEntity () - -@property (nonatomic, assign, readwrite) LNEntityType type; -@property (nonatomic, assign, readwrite) NSRange entityRange; -@property (nonatomic, assign, readwrite) NSRange keyRange; - -@end - -@implementation LNEntity - -+ (instancetype)entityWithType:(LNEntityType)type entityRange:(NSRange)entityRange keyRange:(NSRange)keyRange -{ - return [[self alloc] initWithType:type entityRange:entityRange keyRange:keyRange]; -} - -- (instancetype)initWithType:(LNEntityType)type entityRange:(NSRange)entityRange keyRange:(NSRange)keyRange -{ - self = [super init]; - - if (self) { - self.type = type; - self.entityRange = entityRange; - self.keyRange = keyRange; - } - - return self; -} - -- (BOOL)isEqual:(id)object -{ - if (object == self) - return YES; - if (!object || ![[object class] isEqual:[self class]]) - return NO; - if (!NSEqualRanges([self entityRange], [object entityRange])) - return NO; - - return YES; -} - -- (NSString *)description -{ - return [NSString stringWithFormat: - @"<%@: %p; type = %@; range = %@; key = %@>", - NSStringFromClass([self class]), - self, - NSStringFromEntityType(self.type), - NSStringFromRange(self.entityRange), - NSStringFromRange(self.keyRange) - ]; -} - -@end diff --git a/Lin/Models/LNLocalization.h b/Lin/Models/LNLocalization.h deleted file mode 100644 index cacfb12..0000000 --- a/Lin/Models/LNLocalization.h +++ /dev/null @@ -1,28 +0,0 @@ -// -// LNLocalization.h -// Lin -// -// Created by Tanaka Katsuma on 2013/08/23. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import - -@class LNLocalizationCollection; - -@interface LNLocalization : NSObject - -@property (nonatomic, copy, readonly) NSString *key; -@property (nonatomic, copy, readonly) NSString *value; - -@property (nonatomic, assign, readonly) NSRange entityRange; -@property (nonatomic, assign, readonly) NSRange keyRange; -@property (nonatomic, assign, readonly) NSRange valueRange; - -@property (nonatomic, weak, readonly) LNLocalizationCollection *collection; - -+ (instancetype)localizationWithKey:(NSString *)key value:(NSString *)value entityRange:(NSRange)entityRange keyRange:(NSRange)keyRange valueRange:(NSRange)valueRange collection:(LNLocalizationCollection *)collection; - -- (instancetype)initWithKey:(NSString *)key value:(NSString *)value entityRange:(NSRange)entityRange keyRange:(NSRange)keyRange valueRange:(NSRange)valueRange collection:(LNLocalizationCollection *)collection NS_DESIGNATED_INITIALIZER; - -@end diff --git a/Lin/Models/LNLocalization.m b/Lin/Models/LNLocalization.m deleted file mode 100644 index 411f0cf..0000000 --- a/Lin/Models/LNLocalization.m +++ /dev/null @@ -1,81 +0,0 @@ -// -// LNLocalization.m -// Lin -// -// Created by Tanaka Katsuma on 2013/08/23. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import "LNLocalization.h" - -@interface LNLocalization () - -@property (nonatomic, copy, readwrite) NSString *key; -@property (nonatomic, copy, readwrite) NSString *value; - -@property (nonatomic, assign, readwrite) NSRange entityRange; -@property (nonatomic, assign, readwrite) NSRange keyRange; -@property (nonatomic, assign, readwrite) NSRange valueRange; - -@property (nonatomic, weak, readwrite) LNLocalizationCollection *collection; - -@end - -@implementation LNLocalization - -+ (instancetype)localizationWithKey:(NSString *)key value:(NSString *)value entityRange:(NSRange)entityRange keyRange:(NSRange)keyRange valueRange:(NSRange)valueRange collection:(LNLocalizationCollection *)collection -{ - return [[self alloc] initWithKey:key value:value entityRange:(NSRange)entityRange keyRange:keyRange valueRange:valueRange collection:collection]; -} - -- (instancetype)initWithKey:(NSString *)key value:(NSString *)value entityRange:(NSRange)entityRange keyRange:(NSRange)keyRange valueRange:(NSRange)valueRange collection:(LNLocalizationCollection *)collection -{ - self = [super init]; - - if (self) { - self.key = key; - self.value = value; - - self.entityRange = entityRange; - self.keyRange = keyRange; - self.valueRange = valueRange; - - self.collection = collection; - } - - return self; -} - -- (BOOL)isEqual:(id)object -{ - if (object == self) - return YES; - if (!object || ![[object class] isEqual:[self class]]) - return NO; - if (![[self key] isEqualToString:[object key]]) - return NO; - - return YES; -} - -- (NSUInteger)hash -{ - return [self.key hash]; -} - -- (NSString *)description -{ - return [NSString stringWithFormat: - @"<%@: %p; key = %@; value = %@; entityRange = %@; keyRange = %@; valueRange = %@; collection = %p>", - NSStringFromClass([self class]), - self, - self.key, - self.value, - NSStringFromRange(self.entityRange), - NSStringFromRange(self.keyRange), - NSStringFromRange(self.valueRange), - self.collection - ]; -} - -@end diff --git a/Lin/Models/LNLocalizationCollection.h b/Lin/Models/LNLocalizationCollection.h deleted file mode 100644 index 0d94f9e..0000000 --- a/Lin/Models/LNLocalizationCollection.h +++ /dev/null @@ -1,31 +0,0 @@ -// -// LNLocalizationCollection.h -// Lin -// -// Created by Tanaka Katsuma on 2013/08/23. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import - -@class LNLocalization; - -@interface LNLocalizationCollection : NSObject - -@property (nonatomic, copy, readonly) NSString *filePath; -@property (nonatomic, copy, readonly) NSString *languageDesignation; - -@property (nonatomic, strong, readonly) NSMutableSet *localizations; - -+ (instancetype)localizationCollectionWithContentsOfFile:(NSString *)filePath; - -- (instancetype)initWithContentsOfFile:(NSString *)filePath NS_DESIGNATED_INITIALIZER; - -@property (nonatomic, readonly, copy) NSString *fileName; - -- (void)reloadLocalizations; -- (void)addLocalization:(LNLocalization *)localization; -- (void)deleteLocalization:(LNLocalization *)localization; -- (void)replaceLocalization:(LNLocalization *)localization withLocalization:(LNLocalization *)newLocalization; - -@end diff --git a/Lin/Models/LNLocalizationCollection.m b/Lin/Models/LNLocalizationCollection.m deleted file mode 100644 index 62505f9..0000000 --- a/Lin/Models/LNLocalizationCollection.m +++ /dev/null @@ -1,223 +0,0 @@ -// -// LNLocalizationCollection.m -// Lin -// -// Created by Tanaka Katsuma on 2013/08/23. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import "LNLocalizationCollection.h" - -// Models -#import "LNLocalization.h" - -@interface LNLocalizationCollection () - -@property (nonatomic, copy, readwrite) NSString *filePath; -@property (nonatomic, copy, readwrite) NSString *languageDesignation; - -@property (nonatomic, strong, readwrite) NSMutableSet *localizations; - -@end - -@implementation LNLocalizationCollection - -+ (instancetype)localizationCollectionWithContentsOfFile:(NSString *)filePath -{ - return [[self alloc] initWithContentsOfFile:filePath]; -} - -- (instancetype)initWithContentsOfFile:(NSString *)filePath -{ - self = [super init]; - - if (self) { - self.filePath = filePath; - - // Extract language designation - NSArray *pathComponents = [filePath pathComponents]; - self.languageDesignation = [pathComponents[pathComponents.count - 2] stringByDeletingPathExtension]; - - // Update - [self reloadLocalizations]; - } - - return self; -} - -- (NSString *)description -{ - return [NSString stringWithFormat: - @"<%@: %p; filePath = %@; languageDesignation = %@; localizations = %@>", - NSStringFromClass([self class]), - self, - self.filePath, - self.languageDesignation, - self.localizations - ]; -} - - -#pragma mark - Accessors - -- (NSString *)fileName -{ - return [self.filePath lastPathComponent]; -} - - -#pragma mark - Managing Localizations - -- (NSString *)loadContentsOfFile:(NSString *)filePath -{ - NSError *error = nil; - NSStringEncoding encoding = NSUTF8StringEncoding; - NSString *contents = [NSString stringWithContentsOfURL:[NSURL fileURLWithPath:self.filePath] - usedEncoding:&encoding - error:&error]; - - if (error) { - NSLog(@"Error: %@", [error localizedDescription]); - - return nil; - } - - return contents; -} - -- (void)reloadLocalizations -{ - // Load contents - NSString *contents = [self loadContentsOfFile:self.filePath]; - - if (contents) { - NSMutableSet *localizations = [NSMutableSet set]; - - // Parse - __block NSInteger lineOffset = 0; - __block NSString *key; - __block NSString *value; - __block NSRange entityRange; - __block NSRange keyRange; - __block NSRange valueRange; - - NSRegularExpression *regularExpression = [NSRegularExpression regularExpressionWithPattern:@"(\"(\\S+.*\\S+)\"|(\\S+.*\\S+))\\s*=\\s*\"(.*)\";$" - options:0 - error:NULL]; - - [contents enumerateLinesUsingBlock:^(NSString *line, BOOL *stop) { - key = nil; - value = nil; - keyRange = NSMakeRange(NSNotFound, 0); - valueRange = NSMakeRange(NSNotFound, 0); - - NSTextCheckingResult *result = [regularExpression firstMatchInString:line - options:0 - range:NSMakeRange(0, line.length)]; - - if (result.range.location != NSNotFound && result.numberOfRanges == 5) { - entityRange = [result rangeAtIndex:0]; - entityRange.location += lineOffset; - - keyRange = [result rangeAtIndex:2]; - if (keyRange.location == NSNotFound) keyRange = [result rangeAtIndex:3]; - - valueRange = [result rangeAtIndex:4]; - - key = [line substringWithRange:keyRange]; - value = [line substringWithRange:valueRange]; - - keyRange.location += lineOffset; - valueRange.location += lineOffset; - } - - // Create localization - if (key != nil && value != nil) { - LNLocalization *localization = [LNLocalization localizationWithKey:key - value:value - entityRange:entityRange - keyRange:keyRange - valueRange:valueRange - collection:self]; - - [localizations addObject:localization]; - } - - // Move offset - NSRange lineRange = [contents lineRangeForRange:NSMakeRange(lineOffset, 0)]; - lineOffset += lineRange.length; - }]; - - self.localizations = localizations; - } else { - self.localizations = nil; - } -} - -- (void)addLocalization:(LNLocalization *)localization -{ - // Load contents - NSString *contents = [self loadContentsOfFile:self.filePath]; - - // Add - if (![contents hasSuffix:@"\n"]) { - contents = [contents stringByAppendingString:@"\n"]; - } - - contents = [contents stringByAppendingFormat:@"\"%@\" = \"%@\";\n", localization.key, localization.value]; - - // Override - NSError *error = nil; - [contents writeToFile:self.filePath atomically:NO encoding:NSUTF8StringEncoding error:&error]; - - if (error) { - NSLog(@"Error: %@", [error localizedDescription]); - } - - // Reload - [self reloadLocalizations]; -} - -- (void)deleteLocalization:(LNLocalization *)localization -{ - // Load contents - NSString *contents = [self loadContentsOfFile:self.filePath]; - - // Delete line - NSRange lineRange = [contents lineRangeForRange:localization.entityRange]; - contents = [contents stringByReplacingCharactersInRange:lineRange withString:@""]; - - // Override - NSError *error = nil; - [contents writeToFile:self.filePath atomically:NO encoding:NSUTF8StringEncoding error:&error]; - - if (error) { - NSLog(@"Error: %@", [error localizedDescription]); - } - - // Reload - [self reloadLocalizations]; -} - -- (void)replaceLocalization:(LNLocalization *)localization withLocalization:(LNLocalization *)newLocalization -{ - // Load contents - NSString *contents = [self loadContentsOfFile:self.filePath]; - - // Replace - NSString *newEntity = [NSString stringWithFormat:@"\"%@\" = \"%@\";", newLocalization.key, newLocalization.value]; - contents = [contents stringByReplacingCharactersInRange:localization.entityRange withString:newEntity]; - - // Override - NSError *error = nil; - [contents writeToFile:self.filePath atomically:NO encoding:NSUTF8StringEncoding error:&error]; - - if (error) { - NSLog(@"Error: %@", [error localizedDescription]); - } - - // Reload - [self reloadLocalizations]; -} - -@end diff --git a/Lin/Models/LNRegularExpressionPattern+type.h b/Lin/Models/LNRegularExpressionPattern+type.h deleted file mode 100644 index e2bb874..0000000 --- a/Lin/Models/LNRegularExpressionPattern+type.h +++ /dev/null @@ -1,20 +0,0 @@ -// -// LNRegularExpressionPattern+type.h -// Lin -// -// Created by Tanaka Katsuma on 2013/08/21. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import "LNRegularExpressionPattern.h" - -// Models -#import "LNEntity.h" - -@interface LNRegularExpressionPattern (type) - -@property (nonatomic, assign, readonly) LNEntityType type; - -+ (instancetype)patternWithType:(LNEntityType)type; - -@end diff --git a/Lin/Models/LNRegularExpressionPattern+type.m b/Lin/Models/LNRegularExpressionPattern+type.m deleted file mode 100644 index c1b6d79..0000000 --- a/Lin/Models/LNRegularExpressionPattern+type.m +++ /dev/null @@ -1,79 +0,0 @@ -// -// LNRegularExpressionPattern+type.m -// Lin -// -// Created by Tanaka Katsuma on 2013/08/21. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import "LNRegularExpressionPattern+type.h" -#import - -static NSString * const LNRegularExpressionPatternTypePropertyKey = @"type"; - -@implementation LNRegularExpressionPattern (type) - -- (LNEntityType)type -{ - return [objc_getAssociatedObject(self, (__bridge const void *)(LNRegularExpressionPatternTypePropertyKey)) unsignedIntegerValue]; -} - -- (void)setType:(LNEntityType)type -{ - objc_setAssociatedObject(self, (__bridge const void *)(LNRegularExpressionPatternTypePropertyKey), @(type), OBJC_ASSOCIATION_ASSIGN); -} - -+ (instancetype)patternWithType:(LNEntityType)type -{ - LNRegularExpressionPattern *regularExpression = nil; - - NSString *pettern = nil; - NSUInteger numberOfRanges = 0; - NSUInteger entityRangeIndex = 0; - NSUInteger keyRangeIndex = 1; - - switch (type) { - case LNEntityTypeLocalizedString: - { - pettern = @"NSLocalizedString\\s*\\(\\s*@\"(.*?)\"\\s*,\\s*(.*?)\\s*\\)"; - numberOfRanges = 3; - } - break; - case LNEntityTypeLocalizedStringForKey: - { - pettern = @"localizedStringForKey:\\s*@\"(.*?)\"\\s*value:\\s*(.*?)\\s*table:\\s*(.*?)"; - numberOfRanges = 4; - } - break; - case LNEntityTypeLocalizedStringFromTable: - { - pettern = @"NSLocalizedStringFromTable\\s*\\(\\s*@\"(.*?)\"\\s*,\\s*(.*?)\\s*,\\s*(.*?)\\s*\\)"; - numberOfRanges = 4; - } - break; - case LNEntityTypeLocalizedStringFromTableInBundle: - { - pettern = @"NSLocalizedStringFromTableInBundle\\s*\\(\\s*@\"(.*?)\"\\s*,\\s*(.*?)\\s*,\\s*(.*?)\\s*,\\s*(.*?)\\s*\\)"; - numberOfRanges = 5; - } - break; - case LNEntityTypeLocalizedStringWithDefaultValue: - { - pettern = @"NSLocalizedStringWithDefaultValue\\s*\\(\\s*@\"(.*?)\"\\s*,\\s*(.*?)\\s*,\\s*(.*?)\\s*,\\s*(.*?)\\s*,\\s*(.*?)\\s*\\)"; - numberOfRanges = 6; - } - break; - } - - if (pettern) { - regularExpression = [LNRegularExpressionPattern patternWithString:pettern - numberOfRanges:numberOfRanges - entityRangeIndex:entityRangeIndex - keyRangeIndex:keyRangeIndex]; - regularExpression.type = type; - } - - return regularExpression; -} - -@end diff --git a/Lin/Models/LNRegularExpressionPattern.h b/Lin/Models/LNRegularExpressionPattern.h deleted file mode 100644 index fa470c5..0000000 --- a/Lin/Models/LNRegularExpressionPattern.h +++ /dev/null @@ -1,22 +0,0 @@ -// -// LNRegularExpressionPattern.h -// Lin -// -// Created by Tanaka Katsuma on 2013/08/21. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import - -@interface LNRegularExpressionPattern : NSObject - -@property (nonatomic, copy, readonly) NSString *pattern; -@property (nonatomic, assign, readonly) NSUInteger numberOfRanges; -@property (nonatomic, assign, readonly) NSUInteger entityRangeIndex; -@property (nonatomic, assign, readonly) NSUInteger keyRangeIndex; - -+ (instancetype)patternWithString:(NSString *)string numberOfRanges:(NSUInteger)numberOfRanges entityRangeIndex:(NSUInteger)entityRangeIndex keyRangeIndex:(NSUInteger)keyRangeIndex; - -- (instancetype)initWithString:(NSString *)string numberOfRanges:(NSUInteger)numberOfRanges entityRangeIndex:(NSUInteger)entityRangeIndex keyRangeIndex:(NSUInteger)keyRangeIndex NS_DESIGNATED_INITIALIZER; - -@end diff --git a/Lin/Models/LNRegularExpressionPattern.m b/Lin/Models/LNRegularExpressionPattern.m deleted file mode 100644 index 750991e..0000000 --- a/Lin/Models/LNRegularExpressionPattern.m +++ /dev/null @@ -1,44 +0,0 @@ -// -// LNRegularExpressionPattern.m -// Lin -// -// Created by Tanaka Katsuma on 2013/08/21. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import "LNRegularExpressionPattern.h" - -@interface LNRegularExpressionPattern () - -@property (nonatomic, copy, readwrite) NSString *pattern; -@property (nonatomic, assign, readwrite) NSUInteger numberOfRanges; -@property (nonatomic, assign, readwrite) NSUInteger entityRangeIndex; -@property (nonatomic, assign, readwrite) NSUInteger keyRangeIndex; - -@end - -@implementation LNRegularExpressionPattern - -+ (instancetype)patternWithString:(NSString *)string numberOfRanges:(NSUInteger)numberOfRanges entityRangeIndex:(NSUInteger)entityRangeIndex keyRangeIndex:(NSUInteger)keyRangeIndex -{ - return [[self alloc] initWithString:string - numberOfRanges:numberOfRanges - entityRangeIndex:entityRangeIndex - keyRangeIndex:keyRangeIndex]; -} - -- (instancetype)initWithString:(NSString *)string numberOfRanges:(NSUInteger)numberOfRanges entityRangeIndex:(NSUInteger)entityRangeIndex keyRangeIndex:(NSUInteger)keyRangeIndex -{ - self = [super init]; - - if (self) { - self.pattern = string; - self.numberOfRanges = numberOfRanges; - self.entityRangeIndex = entityRangeIndex; - self.keyRangeIndex = keyRangeIndex; - } - - return self; -} - -@end diff --git a/Lin/Resources/Media.xcassets/icon120.imageset/Contents.json b/Lin/Resources/Media.xcassets/icon120.imageset/Contents.json deleted file mode 100644 index af55597..0000000 --- a/Lin/Resources/Media.xcassets/icon120.imageset/Contents.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "scale" : "1x", - "filename" : "icon120.png" - }, - { - "idiom" : "universal", - "scale" : "2x", - "filename" : "icon120@2x.png" - }, - { - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Lin/Resources/Media.xcassets/icon120.imageset/icon120.png b/Lin/Resources/Media.xcassets/icon120.imageset/icon120.png deleted file mode 100644 index a1cc92961a8e2e5e133ee3c540052ace0cc56a06..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7694 zcmai31ymf(mL6!TVGxI`c|L1)t{9W-=U)rqW}N^bXgfm)t9^HpA!lAa^*MYnF0XdsUaYc zvMdNhq3rBv39+*P0Qj(iHP#%L)p12WJF4d4i&AL63k~b5)KJrFA|WpC2g=6fAIah8 z?=3J={}SN+Tug$vyjNeMa%#&`At?Wl(9rs#%H$|^9}70 zg2sA_yD6Poum0uTF#j6=j^K{rvZSyPq%M_6<5Oa3MaDRFLR=w!e5OL!RP78HZl-ik zkvV2~6q}_B?|STDoh%G#_$cQ1N%4xR!#jLs@-wAUrvo0DFVPK}%E*juJs7tG@%{$V z09-jI{XNYC4_gYG&FzK0Uw5tP%6`D$|vE`)ASlx(m|Z;3}iaCRr1I zgqx_lsrRs+z*0q-cNC8P3P21H{Z`&u zgfKcKz{{C~e+JgFb*Ly7U#dveQ9*s=ND(xQ8f36`6r?tPe9ygMQ%nQ)gmHb*VZxfB*Kw1Ql(U=%C2R zRMYxI$y3f#u|ttj5y8xwpiK~wU;(u+qc77Vy)T_F>!W;_t4=fJBeg+7dkhN#f6GZ* z7R`cBrI88Fk1zx4S=%gbIyJ>1pI-!9@ei#JH9{m+xJ^c{;|hPZ{XRs#8bx~~Ya?_; zskKq4^I<-PC*;DU0cHT_`_=n`N?q}Fmb2mtRCxyb7cQs@-SyMA62m+NGQ;R(KA(gu z^$u)s!Zu{K-WcA{Ru#ZqKE>g%2?+eOe=AQj$hnar;G`*af#RArF>2rkT*JtbEp?yc z8N$Ec%dYt9eY=$V4>bE@J;~7L zZovahYrP^I-=kNT9mGo^zZKtabLNC2UN*OF?BvS)0>-EbRIS~U?SVIbxHe3B23%{5 z(@6@F^AbN-@Dd9eQ9k2OTAYjO0GvGSNSJV5J{!nT866h@0QIGfiUR{kO(z5ZU~M7l z+OFCP@&aa#_ADmmj;0nYp7zieGyovvDe%&?w{SI~@U*vca1rnnru+*b@Y4PxW~HR~ z3*u@kOsTD)OaXFqwxHl6hWb&pb&C4w-iv7l>U48%absrwW}*sfR)w5!-K_x zlf}{5ij|$8pP!YDgO!7W`31r3;^p9K;>qmbLiG zO5-&{x|51wv>J!Hn!<0~iL6AsZ^QZc)@``g8LuCeD)YuFg&xo9im%t_=gJd_38B#} z`g4o0Gh}HZ!gfU;Qj}ecR<95&meVK}6pTAw?-?PAF{ypq zlW6h`gk)8}3l&ggS)ipSED3P8@P2%))L=&(>6z(k0~Xsoe1V<{-hc{?(q{_e=u240 zI%YF{?{+*7pTu}hQI47lMwsR=Kq#(wFNM_m zSZgpW0~O1gFG@n;{8A*I(J^cQk_Xf+>>&>~X{KwLMQ9X@Ka)?z9dvSkG7Oh$HZc6$ z!U;wR5w#09oT(kdSxJl(v!E;}AAs9OlizcfgchmUZQgqs1Q4jOVCc%im&4BMSHE?R zf%w27`!K}Z+|=1f9|0!95tCWT2^I7>hg~c-(_}^};vwZU0}}aY49z!%=vpl~`L9d| z;9-t!2qAA}za?Qh$rSgvl4jUV1sRE#GWR*z%_A zB=7A#zK!jd1V&W^jZ5ZC9&lduKsDdHAEj=o3H8=)d$6nPeR-Rt%5*jS)f?7E=C!J% z+*irF9(9;(VVf#5wQ%io+b82fzz`p`df!mEsvcTP#*(TIbHcK%|4+$BWiQEoMt- zLEk(epMSlu8EPC%6=cq_IfwsRTf6fO)&9zll-~Wc2w(d8Ojv!~zWgxhn7K=0L2@)} zE;}S%`z2b6X#pRT4V;~nx)aOrDU+JcrB-O)I@?n4p_F(``daK>#}V!34rJIb?Ce#e z+#Aq!>fGGdBce~VYbjO?a6=zCu&ClVa?0@O-$npK%laP@kH*E+vOp@q+lncp$lsXr znrg)=XC^17ZYuK7h9zd<(?))z5ev2|sglO(Fs*&P3~0c}z2($yui-ymMpo-c=fJ_- znPdpK`^29N-2@B{Zqn*v6s3h%5-=Ta@}>_yWt~~f%fZy)S7o7s(>zwy=EkC?-8VEl zaEuvjkL+57?4_*~E7TwIw}{uOlt{hb?QebcH?9|?B6U<)R5An9+v5hxh4L>??1?y@I;85XzALlE*0SMiZ z`+^4F3q1%J1{Wd46Ir|?Qca969;}yDaL^9~rRs@&j4fz;Ny0arLlb%~M1_i77poRi z{5fg`<){f$nZItJ7(TTe)BAe1@yu=AnPoacrsh9=Ek|+`d^9M`B0!Zr&JD>NUq9zzWa`ftZbE;Av9P z2`LoVF>IE&DJ;H2o8;n~8OzskgitX6XH|EdBj^`2^}mR#4e)$ZanJa;N0>$op_{Ml zI%Jg+yq>;qKh^0J4qHT%g`o67^}1>-Nr`LnBN%MmNvl1Sm%d}&RUD{!>5h;tgR1QB zLwEi3GfHuX)4%^5H7rhPzcEIo1`wt3qZQX^DQktXQVms>bcxG{y`n85-odzpu+jCt zf&K)X=RFZV76z1>Ho6SgOIfiWy{fTHs=PP|{2+PAnR4>xe7@_clPk1A*)+mS2gvLU z$r>l{ecv989Wc^nh^aoRr)su%>P?G2g1*2Cg~)J`1-+-4}*d7Hx@8ixE+9u3VN%YiMEgx%nDi#ZnXGjZ5loHl~fm`m@W*0#!s z>)xek^@{RS`1T_FV*jS9`neaObF86J#F^kcU*UcWwv9AJ`QsR?rM>Zr+;47NHl0kr>+x3Lukk^XB*lCk-St zkXao2QG?HDylW(&5%@^j8EmZ2L_I8P+BluRB;H}r8H^u@mm=F;06BF-#~9458B5Yk zmoDsIdf(&5DmWkQG2%I=Xwa1X5h#}unaD6}Wzb;iTo)%{5HS|z!f?Nd&OwM(C5blA z%sMt9R{H6{MJ=(8N2`L5bhPM%A-mK(n-1_iPABL4vpf?mBeG*Iwv%i);qD=Fm57Bm z3cK?Y6UVf%v^#SCmpe|eg)(%Qf@OGk$5U>Ac*CurYUhxwM(<39tyKQ&d#ZfiGVy|l z*9v)7?)QD9xB|Y0#fKdXb!eX0zs<#J>EvE%E?FUVih!lp@g~!AKI^=1Uk;ik1@@ZG zTelIX_v?vw+ky8we&k;G8g=ha>>`N8U+<^b!puBIWief|PCBYcI94GyNhzb1M8oLn zvtfE*lk{c;jn6RU?2SsJ3tW5_Z$KtZHD%WA0C;ilFF!v;PTfCC>?x42*C$8C58h?X z25L$0OIofyscjwK3g$c9lZw>_l~-N_ULaJAJCOKg;$TXd?_-iC^`(tI-eEDk{>dXw zD>KIg7I_nDdRsBhH0#fb223g3+UoV*)E=6zUdYLptE#d^j;)5ut$D zX!Lqq3d%L7XdKJh4dl4v?Km!UDya1$9(M&*7|uQIjDz84%Z(llk%)B<0d3QrxNWoT zg%=B*`tWBj8OTgVIvD?tZBiM~RC`S5Y6#>Ovv1oyY8nK1#0 zM?sy5oWjbOwGv-IjbP#W>j$+d-s^;xo23D4VT*tLpg{5Wp;Ce2OeHG$m;bj~~KWNYhe)j(dw) zI+2C4Bn1q-0>_$1rob9+wMT6|3n>ONS*~ma_=dRdb;9&qNB&v+2JX`=m&Ug|TyFeQ z1NkN<4bEwM-EG-cHI6xN+Dz;W<@32#!w)KJe`HvcGvX@nNdI8wlsN8$^`j4(;%Xw3 zXdXrpP(8Lz&15l>8;Q;=mk)-ki$m+Prd5N-gciGEC!A52l`Tx{t2WB>pugpy1|t** z(FRP53f?iLizIZ?jv+Y-%QLuI1=xZ(W(tK0;Pu@=2km>;eq36Zyf0;ESe-_(gQ2@0 zCcZXDKzTM0C~3Byw-x#EaHhO0B(of*g@2hfVN~Bfol$VsP=RXVm%H%c zo_2o+Fk*I3lf8D5q}A;}D{Mg$% zr)L_9sL4fR01t7=QE=`JL!+Ye)!U50*elJTfS1{%;@RYbU*ImO6(WP~v8>~k>)i1S z%J=i=+i2z(0ikMZNFwVCrO8P(<+{x~pFVz9%RHn2#aO_1kD%@rU}FZG(<7g!c(*fp z^i2yL4}UbICRLLI-1 zN==hzyv{J9zg$P)gU<&_X=FFOW*gwgA5{>bl9FSBOmB-|h{{Hi`|%lnFZ3oJag54L zcpH`ZCF!?2W_Cdc<-7N?D2yNI_t-BJ{56hi4J}PCP+#9gKgfDEx7~Zh3)C3xwK!Zq zSd1a2Kont)eaIQF$FCSKkDnQ5Lobx1-(OoAR_!Yij+=Yu0Bb(>`y4`R$73ghxRQ0g zmqxWrzu^l4g%*(;g>ZH(Cp2 z##5>t(8gqK1VPDJ+H#xp+)33#ZgZS>1Ex-n!Y;61ksg>YBCt+HjvD9(0H5*GZOQM0 zouBujr<9(W5R)kiK^S4i)_j#)!u#P&#(mvj2VMmB3VFD+p4YgJCx`P;1B~C`WL??F zFCS4N_=a!A+x43R46))H(794t8wqwq$zuJn`YuqZh938dX395w&An}`)vH&xxEnQ( z*V_#68W}>7H%nYUj8N~1^!(&5fUU4`x?)5rB0%4}3R^HoF*O`fy3=ictQ~qh@R$5? zmo->j^`*y+q+^qC{FK=6;MU4;M3VQ+ZvG8bO)Qy~(2>+w+v@_@Z6{GgYO)=%_Ln-t zXArd2A|I~vFtv7OZrHT;h`43gzEQ{NmF{ota`s2fIPW=blYWwNpo77^dm3)+Nu zaG+oN=xTN~oicO5kW|x*yUf~x@XO~NhoZRwwN&|a@1*%}%bLmDlURxYpQ~V~7B9;} zt~lxsG%qe1ElioOSP$1u@vjGMiwuN>$NFwYEti|Xavc|1a-tWAv9Q;4&lM|l?WHqI z3D$yIM=^ae2B7hv`rD(`Gi{rPSwv$oZ|1MW)uS^%e^NT8kvW(&(;3Bl2atyDizs01 zZ(2PYHtqICi@rZu^(MfhEm(_2UPNNa(go~;!kSRHdY-B_g}L$_xiW?4&^58jd20%F?^G)bgK)ML8*vAo zw8(GX@pQ~NG=oCRM3e39z$#Li$MQnbx^Uy(bNP=A1Mm8(mTwJOt>?^#?w@f@rL`LH zX5nS+4MMiDpKsdke^RE|s1aK4=yeAP`cKnmQjHiQBJx_);$aBq_t$JLESjb{F>qAQJ`9G@9)waXj^J#w1_>QdHmz!O+ln~;IqsB)rZ`*J)x{j)c~E7M#dm>Gux4pp`1NxnUvn7~ zr)SoeC)^ZZ=8^{&Y*HlwI@<{!57MAs`LCO7{}8DLk~V!lnRf;3=3#~0A8K5=Ex<(A zWd4_RMX4ltR077UvI-%eS3QJ$UKu3&u=OFjh&Ha7pz*)5+ssOc zJ{gEi99@ICJ57QYfH9)nAbq!%Bakm?fi6v=o~QRKBmGR18GR!EaGh);uGu*p;*5FX zTuLo1&YuF*mQQ;)=O}T6KjD+$XIAzaPlHb8+Ke=hbRotyvLY9wI03Cl;~H19K43f2gwJtd*CyRZwH%z|i^^)#)DXvRLUW7HXsh`)^?(9-q%sd}p`LqAA z5qaf8Np87W%Y?zN1?ODp_C=;JSl)i?@ZCr@@g^yw&%*=*7FdS%Lo)tGt#Ck!v-LUs zH?L0Cu(NBc*Ps?Z$D#TYs4}_9iI=&fOwRJVf`#vaTh#haow9rB4I_I4#hZ&-^dTzN zN1d>?%vm@=S1=fvgXw}B4W~R-QwTi^k#~E7$>mVgIf?Au{&>_p6e<4jV+V+Cbyt{s z=^VuS4VCs=I`IvoU$C$#4I}$uwd4oM!C0S4@Uo5&N%I8kxE)5{jweJqQnI%wyH?W7 z!{X^S<;)iK}8N_BhTm-{yw6W`(!K%;Z^zB)bpy_1(set{J~dk~j?h?tA!#!Z0g zEE7qhTl<}6>4)4djQlgsxWqat=oKbMFD9Nmf_E*<9w(uqphN@m@Y+x&s^L2>_n0mq zWDl)#cIM`CW>DaFAQe`SiEFdy5C12_1!l~TJ6aS6krU}6i*=-G-P#r|@42}1`*cuRG2GIC22HZ6wG4p`F_#LVX#sh%bV^3%1ytnR1RB^27~0_U)9qzLUNwK z`6($ZGUqip!RZmlm|u_@ffE$gTl53vFW)=80`TfSa~FX`K3r4w8~y(G6HV*SFlX_O Vr;M*i$o~9+k(E-EtdKDN_#cDqSu6km diff --git a/Lin/Resources/Media.xcassets/icon120.imageset/icon120@2x.png b/Lin/Resources/Media.xcassets/icon120.imageset/icon120@2x.png deleted file mode 100644 index cfbe83fae4e3d546931437d072e4887bd177aed7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3214 zcmY+Hc{J4D8^=F0W@PJY%buOAjUhB4@wFQyOUM{QNJScCOu|eOzV=-S=^GJWlqH(M zCuE(Z;mb(bmn=;+rqpEl@%!U<&hMP(KF__c^W5is&%Ni|bDk7uC!523(tH2_9JaHy zblHzz4+anSzBhGW&Djr9kyf6Ou35kC-U0ssO? zJ4_ zci4L!eFQ>E!oyQj3}!&m`5#x-*Q0){(YAA$e|7q!HfR3c_^ud}{@tMM`~0uuMj-^R zg-}|Rk646brmLR?PP3{1mS&&BhT^5e#* z+T5|m)pXgfPPzKU9G1_xD8@mF-lT1q%{o`)>qWbYwsa?Byu;C&^3PFs!E%+)8I>W$ z!WuoEqr|cRYg`$9(8DO!(L1Mw8emGpCO9nfc9TK(MnpKI>(^^1(uy#TKsIkS?dP zB(`8gKkj?{YPywpk?hvT2z^9)uI=LIYU(Wm7_q3Tr;i6y->S56qR&awGsFDH%@AUR zk*;=q9?d2rb$wv`p)UM}CO2^tC#M8->2#HA zR$2`dOv8MRS#o~HCRKgi5!XHikyxYjSvpj?&ZXfJb zM7rcqF-knnwRwmodiQgYBD&PWyDm4EV8e8e!60TG#Q7+ZNpE1nmMbFxgSN&T@O|2g zQ-T2c9rlK~mX|qJybd^jsRI6wyU0&r7PQs@?ZYYrUoNbjz9{G{O(>WwZw`Te(VGS; zp69tHiWafqJZg!Bb~w6(Le>#P9{5<+PzYGr+gQpkaU#*9hZe@64$zD|G*P&|~(Dm;fp}nG@R_Ki|#j?ep=Edf* zwZDB^H-GyYZT-6Rz+XM{#TN{VW4wZmm#0%iw(h3xnul9(?2qq82+1!Ab`n-H_vSym zf8tJOV<7{P4;>ICAVzE(qwVAa`^~ z?WWO&T2lE;M5Hg&vQ$Y$cxf|@XDsFK%cv~wYNqBPDi9dj2ZO5UF$#7h* z)1V~4fRiC<{2u}(0SCG&8KPbe0mug?BnkY_{tNz}JrsrtN^t|Z0(LmSJ{YJ%&kA<~ zxSVXBZ89D}4jdAWrlEkMfHV;3g_k1tHSaxsfi<}#%nvHeGuc;F27`f%OO4xtP%cXa zWS~CjxOF46OivD|MC~8K-*(npr&Lf%5HNNqaa>8~24q%KK|q*y`z{`Wd?h0ysZa?E zQsf7@8|#K=vbjVZ`hU6 zGC&tMI1CRE+rHBUJ=7?@!--jOipLp}eFKIE zKGc+Hd6aFcd~Hr|-0HmZwgb;B+|#QD1t&3-q6oi+kyphqIoLPhxa|Se_#GKL0c_5e ze_db%LP*@G=mUGtbc$ix|HlrF`{%9%b9=XNICfVm_weAtXUb6N$+YLc_E=&#v1k@wD6;cK!3Lj<58Ig2NZMcxn!XXfBu(ZdIO& zXSnt@E*p?K_eN*r1%CO=u}O}qg%Lz}fldxlD7s|(_nG0?^*Q^qzhqgIhfc>3E7ngj z&`akKXRepw|7pwH?dyE%lTz5>5qD_pO^1=k1t>pPufcp=QO8M@a7uwU?&IOxJ=s6H z+3j=vl;D+rHF+OUo^fB?LB@vJ9tp3_0v}($v%jdHWcwT=+szem{5aUrRm%Rya^2*B ze`fm_?sLflzPUB`$7UMt$bu7@mu7Zbl`#i~^Q-1mPw2;^3 zxwXHq)X)ewTAuCb8AqNv15D`A7Gs^q1<~lZh&(zVXTM?(3rZ3P(YBbCDCnkBr`Fyp3P#F_Ie`F9*Qsacn_B132pa>(^xz}!=P;Fo_62B(9kZwv= zbLD5d?eGp8woFaVsl+s+%0?PGwy^FMjrFifd2SAN2>O=Yed~;XY2 z)9V{!w_6uuXT7H{h(sStF=n#XRe|;X39II&yO({+JkKC~b;vhb)^c8q!%FSuGHaq0v=!*TiovOHFB%|_B3vwK2~X96H*(<# zCM`aH$~q7{;gt9@ys@x@p?DMkJ0JnM~}s=BbK2&rMG$9Pc$gi--DH+ z7t|*G3W?le3Iuwz|LS2iahp@Qp3F78nXiEA4~lokwS>`Vvip2g6zY-AT@lX5B-3kV z6AZbZ_dB9%W51D3@o4>^T&$5-NSV`icCm1^Usi{gYE)azBQ{0Fk&&g$$uw{%WxL;} z&Ly`OS@!bzAXQ>C$==_@^|5ZxgO~649i%O2)l-uD5(SmIXYT}y_uYSaZl(iud2o_u z$$Z)$x*Ro@=KjG?)HH{V(cIA}&v~|Sp)x0Fl zjjTj)Zaj*XGaV;iz! zx}_x7NQemWHsn@Gj_ssaNm<5Yy|mN<)ytVK3H?o%QC zeAX8abGye-(dKSj+U)UYfL86iwMk}WiFyb8Y+h^biTNhU63L&r*SB!`+Tj@2?KW~r zy@sWeO9jL z-91vH6hF4>y;ozr&C}ZpT64}7#PYj%(rM|XI*H9cUcLJFp1Jquj~`*&;HV(Yxy+d=$5KnwU{>tmTvKmyiO_X@T5+VCYqhN#p%SW zVFzBF8||t(nEpsoH#xAWp!;QvOpMK~()vQ_?tZ|+G+XtZ^Y=7HS&`jv*;QW;`88C! z_2J}>o%Fi2mdiR_inWn9wsomGwe`*HI9(ca^60n2Jn6bjwc($#M*I0}u=)v}O+A2o z1=bqzA0UvcbM863#^H2bRgK7lMNZba?wP2|tquFk(fX*4bLa1OkxXE2{aZptPgo_t zXg~MEO|=H2Y>zza_VUoChm}4yo#hB?06`|iza+70S#NL8@Q?I@$So7Bye^uZb6r)^#j&XurLeMhoV z^9kl1ZM+5Dg2+SHr>-P$fXoEAWBi*$x7POOrjmCu>z58M?Wo9?60WBz8w0=u{k#48 z9j4DSfUpC57a;6wz1{w&z~hS9_>#zfn|G>wKU7{^zEdu`vj*iq=n$vUZKm>g%E0`1 zO+!m!j$Y$gSkh~|v6aTXk)xaGzxm=)XwNu5A7$U^ypUK2sQ==6F2&NebPw}{oIHV{%I=Fd`J!{6lsDmMt-g=N<@oh1ngN9 z5}V2LVlqRpc48Btcsl7Qg+L(%o> zYIe~-LFhWR(J}oFbK0%WRGsFtaCsG_^}M(klkJYBCL>Hjnj*i)c)pt-ZQ3;}ti6bX z?U!wSzk;dyj#e^zk_BWOoML_OeR9j86(e^>J#``=RQB;a|NdkJ<%jfyY))^8nFi+J z&1Z@2F9?Qd%klei_UCuzQ-QTpO^yMUQ-=_XE^ciaK*Sgy# z0-fMyX7D;f(Euv_(Jqd@!u{Uq`42|1J70yvr1k{ZNa*S8x#6xcF-5Mdu@@#EEX}t} z3Xk2H=?7D6gifBieXw$ru_!rLGa~4>9ApC+u)~iQ*IZ)5hR-%b?Q-4XH+D~>dB@B) z{|jdDf^0dEbO9vLvkl;#={eaDd8G1}{9?lkGpMoP+ne&Yhm1rfy%4^w>7kQT&{~Rd v6-dO&?0VGXrNg#E<>cP>1F{#MbwM`#4W5ht9dj+YQcVQXvg0|Jw(%=aQ+45cldPT%}~ zzp&fwLQxcPyWI@GTrScNhlBY1{Im&^#p7{JRn@Z7=@f8UOAHv!p3i5o-|vMA@K`J+ z+-|q9*=*u^y&AyB<56x}tybdRy4`Lil}h1UIUEj)Kp-}K;IR|iWk$SURx9AaU{K1j-EO7Ckc;y0foC95?yvNY6^lhJ8jY4ip^z*LfRD#x(eL;5 zYPI@(Fc|2Q$wcN(F$2Ftg2*ZAvd`y}k)w=J2$Vm)*=$xg@pKy8%7~o&B{=M54k+=z2y}s{Q7vf3*=+U}_**yVbUM9cGMOexev>@kh)8d@ z+fTvs`TPy@2=-4Endgbw2(U++)0@raCzs+ggOq4KI0l~j4D``W=%@E;pTpshBrr6Z z%8|cI^fIYb!ua?Y>-+KgRYMtr08>E{FgTpA_7wvLJ~SBr#`l1)6^TSdsZ_e5)~yUc zmY5TaJYZDIGR2sNV*`CSjF(o%H>-fNtUm{+;woq$0Gj_*ST+79!NH+|poEHMpw5)c pATW<@D>pFzf&k#uH{!1V0|2@((t=5p(K!GB002ovPDHLkV1lw+W^Dif diff --git a/Lin/Resources/Media.xcassets/icon_minus.imageset/Contents.json b/Lin/Resources/Media.xcassets/icon_minus.imageset/Contents.json deleted file mode 100644 index 00dc3bb..0000000 --- a/Lin/Resources/Media.xcassets/icon_minus.imageset/Contents.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "scale" : "1x", - "filename" : "icon_minus.png" - }, - { - "idiom" : "universal", - "scale" : "2x", - "filename" : "icon_minus@2x.png" - }, - { - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Lin/Resources/Media.xcassets/icon_minus.imageset/icon_minus.png b/Lin/Resources/Media.xcassets/icon_minus.imageset/icon_minus.png deleted file mode 100644 index f84413dc0ed0a25be3534afd88773982cac97b94..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1871 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9Sn@U{T3*b`J1#c2)=|%1_J8No8QL z5Nr*-pMN_<#I7?xXo;A;LWFyJ*U|N%!O=UVrPdx}^PIf&t(Vx+mp8Ojo>-Z8u9RlK z{c_tX|LR6_wm*yxH<|f8Y!rFflB#chJFvwwxLs?Nr$_aRBm9bLZ&^bh?k-DG4?Ys} z_19_3`9az5 z2SvZ1d;L(hi{td$iSPdTeN*0F)qUq;r;`7HJW<(N$sas{XRc&#^A_39{`*JfcD6g8 zWjb8E0_MCkev|fv@<=De!v*$*d{`SOpW{DG%ABN^h?@~&e zxOwfQ#G>;L_4^CA8~*3ln_c?lO>A?-?>S3%Chy?yyr=ywWM8NK^{roIK6r14U%%5c zv7Yru|F26mOcnBhUsg`4ExGsHJwAS|$UU}utko9_mUH|5&MGymmXX+a@vG|V87Gu2 zu9v0@ZC)bY@ILIvmK(`0CayRUocSQ}!9lOuRWsvf6^1=)xqEtZ)XXzX%Ka((m!Eyo zz}{fLW$m67tY`{W&-owshKp!8HyL;-PDe|ZJc9kuZ zJT2yR?BYwc`n73Q>4LXzuvFBe*Ux+WOGCu0 z`~p7xaj4bk2t0T5z0|L>{r}o#ZSdCqqU?Xc&?Ne;umZbqMydHFyXD#0_HX!XPOmv%n9uL=n) zr~KLTXOoTe29cfda+8-o+56!Q=eM&we`WVdlyGg%^4(gk`;kS$gkP0yF5C5EAxB$Q zmxx8)oM;bXr%1)x0iskIwhq{zr~KGG^L7Z_kgoA8H$xF@OCx zS=hkJ>OroKkLn5IM{}(T!(6{`mCU|yHnxuKKHnnG)n(VrPKk!!T)%3)CTGp59Y(QN z-P=Xanuwl%s$o{XWACBv#VY%nmHJ*d-uu1Jwd^iW?z?E0_Wy^hUx#HxuMn<%EAVx{ z)UCD;el^dG7j?6L-L?18^Ti%d*d_*BZMgqi_NDiuyCvH%Ry2GMJ+JO!EpIOMf1SCM zb-dDlv5Tpn?IRfqD{`c@g@MHeXMsm#F#`iPkj*X3$S`Y;1Oo$8c4kOKNrbPDRdRl= zUSdjqQmS4>ZUIm=1A|S46_A;mT9T+xk(-lOY*k^a1Xf`MWP^nDl@!2AO0sR0B76fB zob!uP6-@OE^^BD4xD*r=Y>HCStb$zJpxS{vTcwPWk^(Dz{qpj1y>er{{GxPyLrY6b zeFGzXBO_g)3f zR+OiUV~B)gYo8(C0R~)>G$S3pupqe&bcC6|H)td$Cvo)ymZ9G#dc+j z*BW#?d^*8k|6X}c@m&dKr6z$#r~2;w_E;;rROE<+V^nrT_QEMrLYhy*4Em$9Pgp9q zFub?Tkg_}@eDKcmnL%F5GglTI*LukH=j3^D3l<3mw?{!fsh*$QfwnVvy85}Sb4q9e E0KMi(p#T5? diff --git a/Lin/Resources/Media.xcassets/icon_plus.imageset/Contents.json b/Lin/Resources/Media.xcassets/icon_plus.imageset/Contents.json deleted file mode 100644 index a21e529..0000000 --- a/Lin/Resources/Media.xcassets/icon_plus.imageset/Contents.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "scale" : "1x", - "filename" : "icon_plus.png" - }, - { - "idiom" : "universal", - "scale" : "2x", - "filename" : "icon_plus@2x.png" - }, - { - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Lin/Resources/Media.xcassets/icon_plus.imageset/icon_plus.png b/Lin/Resources/Media.xcassets/icon_plus.imageset/icon_plus.png deleted file mode 100644 index 37ea01eda5729425a8b4f620b94ba2f096035b36..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1954 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9Sn@U{T3*b`J1#c2)=|%1_J8No8QL z5Nr*-pMN_<#I7?xXo;A;LWFyJ*U|N%!O=UVrPdx}^PIf&t(Vx+mp8Ojo>-Z8u9RlK z{c_tX|LR6_wm*yxH<|f8Y!rFflB#chJFvwwxLs?Nr$_aRBm9bLZ&^bh?k-DG4?Ys} z_19_3`9az5 z2SvZ1d;L(hi{td$iSPdTeN*0F)qUq;r;`7HJW<(N$sas{XRc&#^A_39{`*JfcD6g8 zWjb8E0_MCkev|fv@<=De!v*$*d{`SOpW{DG%ABN^h?@~&e zxOwfQ#G>;L_4^CA8~*3ln_c?lO>A?-?>S3%Chy?yyr=ywWM8NK^{roIK6r14U%%5c zv7Yru|F26mOcnBhUsg`4ExGsHJwAS|$UU}utko9_mUH|5&MGymmXX+a@vG|V87Gu2 zu9v0@ZC)bY@ILIvmK(`0CayRUocSQ}!9lOuRWsvf6^1=)xqEtZ)XXzX%Ka((m!Eyo zz}{fLW$m67tY`{W&-owshKp!8HyL;-PDe|ZJc9kuZ zJT2yR?BYwc`n73Q>4LXzuvFBe*Ux+WOGCu0 z`~p7xaj4bk2t0T5z0|L>{r}o#ZSdCqqU?Xc&?Ne;umZbqMydHFyXD#0_HX!XPOmv%n9uL=n) zr~KLTXOoTe29cfda+8-o+56!Q=eM&we`WVdlyGg%^4(gk`;kS$gkP0yF5C5EAxB$Q zmxx8)oM;bXr%1)x0iskIwhq{zr~KGG^L7Z_kgoA8H$xF@OCx zS=hkJ>OroKkLn5IM{}(T!(6{`mCU|yHnxuKKHnnG)n(VrPKk!!T)%3)CTGp59Y(QN z-P=Xanuwl%s$o{XWACBv#VY%nmHJ*d-uu1Jwd^iW?z?E0_Wy^hUx#HxuMn<%EAVx{ z)UCD;el^dG7j?6L-L?18^Ti%d*d_*BZMgqi_NDiuyCvH%Ry2GMJ+JO!EpIOMf1SCM zb-dDlv5Tpn?IRfqD{`c@g@MHeXMsm#F#`iPkj*X3$S`Y;1Oo$8c4kOKNrbPDRdRl= zUSdjqQmS4>ZUIm=1A|S46_A;mT9T+xk(-lOY*k^a1Xf`MWP^nDl@!2AO0sR0B76fB zob!uP6-@OE^^BD4xD*r=Y>HCStb$zJpxS{vTcwPWk^(Dz{qpj1y>er{{GxPyLrY6b zeFGzXBO_g)3f z)>=;&#}ElgQ@`DO%?1LyFR+M&UQqQ8m-C+f?gMj=PL1vU0|BZ{I-x<*E7c>PZ+@@( zde^<8bCG)E6-(mBC;>c-}LB{3Zeim5Z xwc*<@v8U|*Zck1Kvv#%QJ^p+3^x8JHz4Adq-oN`ciROWFg{P~Z%Q~loCIE{PIqv`f diff --git a/Lin/Resources/Media.xcassets/icon_plus.imageset/icon_plus@2x.png b/Lin/Resources/Media.xcassets/icon_plus.imageset/icon_plus@2x.png deleted file mode 100644 index ac30f14d7bd86800d07f36ef95cd0153081f9f21..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 349 zcmV-j0iyniP)a2$sj>$AJ2BU>ry3``+&-(l5(?W$%B0+6V@K vlDz>0k@;@`A~7leoV@|`&vbri@D^YI`{c- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Lin/Resources/XIBs/MainViewController.xib b/Lin/Resources/XIBs/MainViewController.xib deleted file mode 100644 index 3529e5a..0000000 --- a/Lin/Resources/XIBs/MainViewController.xib +++ /dev/null @@ -1,227 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Lin/Shared/LNLocalizedStringCollectionOperation.h b/Lin/Shared/LNLocalizedStringCollectionOperation.h deleted file mode 100644 index 8e718f5..0000000 --- a/Lin/Shared/LNLocalizedStringCollectionOperation.h +++ /dev/null @@ -1,21 +0,0 @@ -// -// LNLocalizedStringCollectionOperation.h -// Lin -// -// Created by Wenbin Zhang on 3/7/14. -// Copyright (c) 2014 Tanaka Katsuma. All rights reserved. -// - -#import - -@class IDEIndex; - -typedef void(^LNLocalizedStringCollectionCompletionBlock)(NSString *workspacePath, NSArray *collections); - -@interface LNLocalizedStringCollectionOperation : NSOperation - -@property (nonatomic, strong) IDEIndex *index; -@property (nonatomic, copy) LNLocalizedStringCollectionCompletionBlock collectionCompletedBlock; - -- (instancetype)initWithIndex:(IDEIndex *)index NS_DESIGNATED_INITIALIZER; -@end diff --git a/Lin/Shared/LNLocalizedStringCollectionOperation.m b/Lin/Shared/LNLocalizedStringCollectionOperation.m deleted file mode 100644 index 637a445..0000000 --- a/Lin/Shared/LNLocalizedStringCollectionOperation.m +++ /dev/null @@ -1,95 +0,0 @@ -// -// LNLocalizedStringCollectionOperation.m -// Lin -// -// Created by Wenbin Zhang on 3/7/14. -// Copyright (c) 2014 Tanaka Katsuma. All rights reserved. -// - -#import "LNLocalizedStringCollectionOperation.h" -#import "IDEIndex.h" -#import "IDEWorkspace.h" -#import "IDEIndexCollection.h" -#import "DVTFilePath.h" -#import "LNLocalizationCollection.h" - -@interface LNLocalizedStringCollectionOperation () - -@property (nonatomic, strong) NSArray *collections; -@property (nonatomic, strong) NSString *workspaceFilePath; -@end - -@implementation LNLocalizedStringCollectionOperation - -- (instancetype)initWithIndex:(IDEIndex *)index -{ - self = [super init]; - if (self) { - self.index = index; - } - return self; -} - -- (void)main -{ - @autoreleasepool { - if (self.isCancelled) { - return; - } - - if (!self.index) { - return; - } - [self processLocalizedString]; - - if (self.isCancelled) { - return; - } - - if (self.collectionCompletedBlock) { - dispatch_async(dispatch_get_main_queue(), ^{ - self.collectionCompletedBlock(self.workspaceFilePath, self.collections); - }); - } - - [self cleanup]; - } -} - -- (void)processLocalizedString -{ - IDEWorkspace *workspace = [self.index valueForKey:@"_workspace"]; - DVTFilePath *representingFilePath = workspace.representingFilePath; - self.workspaceFilePath = representingFilePath.pathString; - NSMutableArray *mutableCollections = [[NSMutableArray alloc] init]; - - if (self.workspaceFilePath) { - NSString *projectRootPath = [[self.workspaceFilePath stringByDeletingLastPathComponent] stringByDeletingLastPathComponent]; - - // Find .strings files - IDEIndexCollection *indexCollection = [self.index filesContaining:@".strings" anchorStart:NO anchorEnd:NO subsequence:NO ignoreCase:YES cancelWhen:nil]; - - for (DVTFilePath *filePath in indexCollection) { - if (self.isCancelled) { - return; - } - NSString *pathString = filePath.pathString; - - BOOL parseStringsFilesOutsideWorkspaceProject = YES; - if (parseStringsFilesOutsideWorkspaceProject || - (!parseStringsFilesOutsideWorkspaceProject && [pathString rangeOfString:projectRootPath].location != NSNotFound)) { - // Create localization collection - LNLocalizationCollection *collection = [LNLocalizationCollection localizationCollectionWithContentsOfFile:pathString]; - [mutableCollections addObject:collection]; - } - } - self.collections = [mutableCollections copy]; - } -} - -- (void)cleanup -{ - self.index = nil; -} - -@end diff --git a/Lin/Shared/LNUserDefaultsManager.h b/Lin/Shared/LNUserDefaultsManager.h deleted file mode 100644 index f22f325..0000000 --- a/Lin/Shared/LNUserDefaultsManager.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// LNUserDefaultsManager.h -// Lin -// -// Created by Tanaka Katsuma on 2013/09/22. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import - -@interface LNUserDefaultsManager : NSObject - -@property (nonatomic, assign, getter = isEnabled) BOOL enabled; - -+ (instancetype)sharedManager; - -@end diff --git a/Lin/Shared/LNUserDefaultsManager.m b/Lin/Shared/LNUserDefaultsManager.m deleted file mode 100644 index 85a265c..0000000 --- a/Lin/Shared/LNUserDefaultsManager.m +++ /dev/null @@ -1,57 +0,0 @@ -// -// LNUserDefaultsManager.m -// Lin -// -// Created by Tanaka Katsuma on 2013/09/22. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import "LNUserDefaultsManager.h" - -static NSString * const LNUserDefaultManagerEnabledKey = @"jp.questbeat.Lin.enabled"; - -@implementation LNUserDefaultsManager - -+ (instancetype)sharedManager -{ - static id _sharedManager; - static dispatch_once_t _onceToken; - - dispatch_once(&_onceToken, ^{ - _sharedManager = [[self alloc] init]; - }); - - return _sharedManager; -} - -- (instancetype)init -{ - self = [super init]; - - if (self) { - // Register defaults - NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; - [userDefaults registerDefaults:@{LNUserDefaultManagerEnabledKey: @(YES)}]; - [userDefaults synchronize]; - } - - return self; -} - - -#pragma mark - Accessors - -- (void)setEnabled:(BOOL)enabled -{ - NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; - [userDefaults setBool:enabled forKey:LNUserDefaultManagerEnabledKey]; - [userDefaults synchronize]; -} - -- (BOOL)isEnabled -{ - NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; - return [userDefaults boolForKey:LNUserDefaultManagerEnabledKey]; -} - -@end diff --git a/Lin/Supporting Files/Lin-Info.plist b/Lin/Supporting Files/Lin-Info.plist deleted file mode 100644 index a6732bb..0000000 --- a/Lin/Supporting Files/Lin-Info.plist +++ /dev/null @@ -1,43 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIconFile - - CFBundleIdentifier - io.evolved.${PRODUCT_NAME:rfc1034identifier} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - BNDL - CFBundleShortVersionString - 3.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - DVTPlugInCompatibilityUUIDs - - C4A681B0-4A26-480E-93EC-1218098B9AA0 - FEC992CC-CA4A-4CFD-8881-77300FCB848A - - LSApplicationCategoryType - - NSHumanReadableCopyright - Copyright © 2014 Sascha Schwabbauer. All rights reserved. - NSPrincipalClass - Lin - XC4Compatible - - XC5Compatible - - XCPluginHasUI - - - diff --git a/Lin/Supporting Files/Lin-Prefix.pch b/Lin/Supporting Files/Lin-Prefix.pch deleted file mode 100644 index 35d7640..0000000 --- a/Lin/Supporting Files/Lin-Prefix.pch +++ /dev/null @@ -1,9 +0,0 @@ -// -// Prefix header -// -// The contents of this file are implicitly included at the beginning of every source file. -// - -#ifdef __OBJC__ - #import -#endif diff --git a/Lin/Supporting Files/en.lproj/InfoPlist.strings b/Lin/Supporting Files/en.lproj/InfoPlist.strings deleted file mode 100644 index 477b28f..0000000 --- a/Lin/Supporting Files/en.lproj/InfoPlist.strings +++ /dev/null @@ -1,2 +0,0 @@ -/* Localized versions of Info.plist keys */ - diff --git a/Lin/View Controllers/AddViewController.h b/Lin/View Controllers/AddViewController.h deleted file mode 100644 index c1ac9d3..0000000 --- a/Lin/View Controllers/AddViewController.h +++ /dev/null @@ -1,27 +0,0 @@ -// -// AddViewController.h -// Lin -// -// Created by Sascha Schwabbauer on 06/12/14. -// Copyright (c) 2014 evolved.io. All rights reserved. -// - -#import - -@class LNLocalizationCollection; -@class LNLocalization; -@class AddViewController; - -@protocol AddViewControllerDelegate - -- (void)addViewControllerDidCancel:(AddViewController *)addViewController; -- (void)addViewController:(AddViewController *)addViewController didFinishWithLocalization:(LNLocalization *)localization forCollection:(LNLocalizationCollection *)collection; - -@end - -@interface AddViewController : NSViewController - -@property (nonatomic, weak) id delegate; -@property (nonatomic, copy) NSArray *collections; - -@end diff --git a/Lin/View Controllers/AddViewController.m b/Lin/View Controllers/AddViewController.m deleted file mode 100644 index 8b6dcab..0000000 --- a/Lin/View Controllers/AddViewController.m +++ /dev/null @@ -1,133 +0,0 @@ -// -// AddViewController.m -// Lin -// -// Created by Sascha Schwabbauer on 06/12/14. -// Copyright (c) 2014 evolved.io. All rights reserved. -// - -#import "AddViewController.h" -#import "LNLocalization.h" -#import "LNLocalizationCollection.h" - -@interface AddViewController () - -@property (nonatomic, weak) IBOutlet NSPopUpButton *tableButton; -@property (nonatomic, weak) IBOutlet NSPopUpButton *languageButton; -@property (nonatomic, weak) IBOutlet NSTextField *keyTextField; -@property (nonatomic, weak) IBOutlet NSTextField *valueTextField; -@property (nonatomic, weak) IBOutlet NSButton *okButton; - -@end - -@implementation AddViewController - -#pragma mark - Accessors - -- (void)setCollections:(NSArray *)collections { - if (![_collections isEqual:collections]) { - _collections = collections; - - if (self.isViewLoaded) { - [self configureView]; - } - } -} - -#pragma mark - NSViewController - -- (void)viewDidLoad { - [super viewDidLoad]; - - [self configureView]; -} - -#pragma mark - Helpers - -- (LNLocalizationCollection *)collectionForCurrentSelection { - NSString *selectedFileName = [self.tableButton titleOfSelectedItem]; - NSString *selectedLanguageDesignations = [self.languageButton titleOfSelectedItem]; - - for (LNLocalizationCollection *collection in self.collections) { - if ([collection.fileName isEqualToString:selectedFileName] && [collection.languageDesignation isEqualToString:selectedLanguageDesignations]) { - return collection; - } - } - - return nil; -} - -#pragma mark - Actions - -- (IBAction)tableDidChange:(id)sender { - [self updateLanguages]; -} - -- (IBAction)okPressed:(id)sender { - LNLocalizationCollection *collection = [self collectionForCurrentSelection]; - NSString *key = self.keyTextField.stringValue; - NSString *value = self.valueTextField.stringValue; - - LNLocalization *localization = [LNLocalization localizationWithKey:key value:value entityRange:NSMakeRange(NSNotFound, 0) keyRange:NSMakeRange(NSNotFound, 0) valueRange:NSMakeRange(NSNotFound, 0) collection:collection]; - - if (self.delegate) { - [self.delegate addViewController:self didFinishWithLocalization:localization forCollection:collection]; - } -} - -- (IBAction)cancelPressed:(id)sender { - if (self.delegate) { - [self.delegate addViewControllerDidCancel:self]; - } -} - -#pragma mark - Updating the Views - -- (void)updateTables { - [self.tableButton removeAllItems]; - - NSMutableSet *tableFileNames = [NSMutableSet set]; - for (LNLocalizationCollection *collection in self.collections) { - [tableFileNames addObject:collection.fileName]; - } - - [self.tableButton addItemsWithTitles:[tableFileNames allObjects]]; -} - -- (void)updateLanguages { - [self.languageButton removeAllItems]; - - NSString *titleOfSelectedItem = [self.tableButton titleOfSelectedItem]; - - NSMutableSet *languageDesignations = [NSMutableSet set]; - for (LNLocalizationCollection *collection in self.collections) { - if ([titleOfSelectedItem isEqualToString:collection.fileName]) { - [languageDesignations addObject:collection.languageDesignation]; - } - } - - [self.languageButton addItemsWithTitles:[languageDesignations allObjects]]; -} - -- (void)configureView { - [self updateTables]; - [self updateLanguages]; - - [self configureButton]; -} - -- (void)configureButton { - NSString *key = self.keyTextField.stringValue; - NSString *value = self.valueTextField.stringValue; - - [self.okButton setEnabled:(self.collections.count > 0 && key.length > 0 && value.length > 0)]; -} - - -#pragma mark - NSTextFieldDelegate - -- (void)controlTextDidChange:(NSNotification *)obj { - [self configureButton]; -} - -@end diff --git a/Lin/View Controllers/MainViewController.h b/Lin/View Controllers/MainViewController.h deleted file mode 100644 index d81bede..0000000 --- a/Lin/View Controllers/MainViewController.h +++ /dev/null @@ -1,23 +0,0 @@ -// -// MainViewController.h -// Lin -// -// Created by Sascha Schwabbauer on 03/12/14. -// Copyright (c) 2014 evolved.io. All rights reserved. -// - -#import - -extern NSString * const LNPopoverContentViewLocalizationKey; - -extern NSString * const LNPopoverContentViewLocalizationDidSelectNotification; -extern NSString * const LNPopoverContentViewDetachButtonDidClickNotification; - -@interface MainViewController : NSViewController - -@property (nonatomic, assign, getter=isInPopover) BOOL inPopover; -@property (nonatomic, weak, readonly) NSTableView *tableView; -@property (nonatomic, copy) NSArray *collections; -@property (nonatomic, copy) NSString *searchString; - -@end diff --git a/Lin/View Controllers/MainViewController.m b/Lin/View Controllers/MainViewController.m deleted file mode 100644 index a94dd8e..0000000 --- a/Lin/View Controllers/MainViewController.m +++ /dev/null @@ -1,270 +0,0 @@ -// -// MainViewController.m -// Lin -// -// Created by Sascha Schwabbauer on 03/12/14. -// Copyright (c) 2014 evolved.io. All rights reserved. -// - -#import "MainViewController.h" -#import "LNLocalizationCollection.h" -#import "LNLocalization.h" -#import "AddViewController.h" - -NSString * const LNPopoverContentViewLocalizationKey = @"LNPopoverContentViewLocalizationKey"; - -NSString * const LNPopoverContentViewLocalizationDidSelectNotification = @"LNPopoverContentViewRowDidDoubleClickNotification"; -NSString * const LNPopoverContentViewDetachButtonDidClickNotification = @"LNPopoverContentViewDetachButtonDidClickNotification"; - -static NSString * const EVOPopoverContentViewCellReuseIdentifier = @"EVOPopoverContentViewCellReuseIdentifier"; - -@interface MainViewController () - -@property (nonatomic, weak) IBOutlet NSTableView *tableView; -@property (nonatomic, weak) IBOutlet NSButton *detachButton; - -@property (nonatomic, strong) NSMutableArray *localizations; -@property (nonatomic, strong) NSMutableArray *sortedLocalizations; - -@end - -@implementation MainViewController - -#pragma mark - NSViewController - -- (void)viewDidLoad { - [super viewDidLoad]; - - // Set default sort order - NSSortDescriptor *sortDescriptor = [NSSortDescriptor sortDescriptorWithKey:@"key" ascending:YES selector:@selector(compare:)]; - [self.tableView setSortDescriptors:@[sortDescriptor]]; - - self.tableView.target = self; - self.tableView.doubleAction = @selector(doubleClickedTableView:); - - [self configureForPresentationInPopover:self.isInPopover]; - [self configureView]; -} - -- (void)dealloc { - // Remove from notification center - [[NSNotificationCenter defaultCenter] removeObserver:self]; -} - -#pragma mark - Helper methods - -- (void)configureForPresentationInPopover:(BOOL)inPopover { - if (inPopover) { - self.tableView.selectionHighlightStyle = NSTableViewSelectionHighlightStyleSourceList; - } else { - self.detachButton.hidden = YES; - } -} - -#pragma mark - Accessors - -- (void)setInPopover:(BOOL)inPopover { - if (_inPopover != inPopover) { - _inPopover = inPopover; - - if (self.isViewLoaded) { - [self configureForPresentationInPopover:_inPopover]; - } - } -} - -- (void)setCollections:(NSArray *)collections { - if (![_collections isEqual:collections]) { - _collections = collections; - - if (self.isViewLoaded) { - [self configureView]; - } - } -} - -- (void)setSearchString:(NSString *)searchString { - if (![_searchString isEqualToString:searchString]) { - _searchString = searchString; - - if (self.isViewLoaded) { - [self configureView]; - } - } -} - -#pragma mark - Actions - -- (IBAction)textChanged:(id)sender { - NSInteger editedRowIndex = [self.tableView rowForView:sender]; - NSInteger editedColumnIndex = [self.tableView columnForView:sender]; - - if (editedRowIndex >= 0 && editedColumnIndex >= 0) { - NSTextField *textField = (NSTextField *)sender; - - // Create a new localization - LNLocalization *localization = self.sortedLocalizations[editedRowIndex]; - - NSString *key = localization.key; - NSString *value = localization.value; - - NSTableColumn *editedColumn = self.tableView.tableColumns[editedColumnIndex]; - - if ([editedColumn.identifier isEqualToString:@"key"]) { - key = textField.stringValue; - } else if ([editedColumn.identifier isEqualToString:@"value"]) { - value = textField.stringValue; - } - - LNLocalization *newLocalization = [LNLocalization localizationWithKey:key value:value entityRange:localization.entityRange keyRange:localization.keyRange valueRange:localization.valueRange collection:localization.collection]; - - // Replace in file - [localization.collection replaceLocalization:localization withLocalization:newLocalization]; - - // Update - [self configureView]; - } -} - -- (void)doubleClickedTableView:(id)sender { - NSInteger clickedRow = self.tableView.clickedRow; - - if (clickedRow >= 0) { - LNLocalization *localization = self.sortedLocalizations[clickedRow]; - - // Post notification - [[NSNotificationCenter defaultCenter] postNotificationName:LNPopoverContentViewLocalizationDidSelectNotification object:self userInfo:@{LNPopoverContentViewLocalizationKey: localization}]; - } -} - -- (IBAction)addLocalization:(id)sender { - // Create alert - NSBundle *bundle = [NSBundle bundleForClass:[self class]]; - AddViewController *addViewController = [[AddViewController alloc] initWithNibName:@"AddViewController" bundle:bundle]; - addViewController.delegate = self; - addViewController.collections = self.collections; - - [self presentViewController:addViewController asPopoverRelativeToRect:((NSView *)sender).bounds ofView:sender preferredEdge:NSMinYEdge behavior:NSPopoverBehaviorTransient]; -} - -- (IBAction)deleteLocalization:(id)sender { - NSInteger selectedRow = self.tableView.selectedRow; - - if (selectedRow >= 0) { - [self.tableView beginUpdates]; - - // Delete localization from array - LNLocalization *localization = self.sortedLocalizations[selectedRow]; - NSInteger index = [self.localizations indexOfObject:localization]; - [self.localizations removeObjectAtIndex:index]; - - // Filter localizations - [self filterLocalizations]; - - // Delete localization from file - LNLocalizationCollection *collection = localization.collection; - [collection deleteLocalization:localization]; - - // Delete localization from table view - [self.tableView removeRowsAtIndexes:[NSIndexSet indexSetWithIndex:selectedRow] withAnimation:NSTableViewAnimationEffectFade]; - - [self.tableView endUpdates]; - } -} - -- (IBAction)detachPopover:(id)sender { - // Post notification - [[NSNotificationCenter defaultCenter] postNotificationName:LNPopoverContentViewDetachButtonDidClickNotification object:self userInfo:nil]; -} - -#pragma mark - Updating and Drawing the View - -- (void)reloadLocalizations { - NSMutableArray *localizations = [NSMutableArray array]; - - for (LNLocalizationCollection *collection in self.collections) { - [localizations addObjectsFromArray:[collection.localizations allObjects]]; - } - - self.localizations = localizations; -} - -- (void)filterLocalizations { - // Filter localizations - NSArray *filteredLocalizations = self.localizations; - - if (self.searchString.length > 0) { - filteredLocalizations = [filteredLocalizations filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"key contains[c] %@", self.searchString]]; - } - - // Sort localizations - self.sortedLocalizations = [[filteredLocalizations sortedArrayUsingDescriptors:self.tableView.sortDescriptors] mutableCopy]; -} - -- (void)configureView { - // Reload localizations - [self reloadLocalizations]; - - // Filter localizations - [self filterLocalizations]; - - // Update table view - [self.tableView reloadData]; -} - - -#pragma mark - NSTableViewDataSource - -- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView { - return self.sortedLocalizations.count; -} - -- (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row { - NSTableCellView *cell = [tableView makeViewWithIdentifier:EVOPopoverContentViewCellReuseIdentifier owner:self]; - - NSString *identifier = tableColumn.identifier; - - LNLocalization *localization = self.sortedLocalizations[row]; - - if([identifier isEqualToString:@"table"]) { - cell.textField.stringValue = localization.collection.filePath.lastPathComponent; - cell.textField.editable = NO; - } - else if ([identifier isEqualToString:@"language"]) { - cell.textField.stringValue = localization.collection.languageDesignation; - cell.textField.editable = NO; - } - else if ([identifier isEqualToString:@"key"]) { - cell.textField.stringValue = localization.key; - cell.textField.editable = YES; - } - else if ([identifier isEqualToString:@"value"]) { - cell.textField.stringValue = localization.value; - cell.textField.editable = YES; - } - - return cell; -} - -- (void)tableView:(NSTableView *)tableView sortDescriptorsDidChange:(NSArray *)oldDescriptors { - // Update - [self configureView]; -} - -#pragma mark - AddViewControllerDelegate - -- (void)addViewControllerDidCancel:(AddViewController *)addViewController { - [self dismissViewController:addViewController]; -} - -- (void)addViewController:(AddViewController *)addViewController didFinishWithLocalization:(LNLocalization *)localization forCollection:(LNLocalizationCollection *)collection { - // Add localization to file - [collection addLocalization:localization]; - - // Update views - [self configureView]; - - [self dismissViewController:addViewController]; -} - -@end diff --git a/Lin/Views/LNHorizontalLine.h b/Lin/Views/LNHorizontalLine.h deleted file mode 100644 index 650721d..0000000 --- a/Lin/Views/LNHorizontalLine.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// LNHorizontalLine.h -// Lin -// -// Created by Tanaka Katsuma on 2013/09/21. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import - -@interface LNHorizontalLine : NSBox - -@end diff --git a/Lin/Views/LNHorizontalLine.m b/Lin/Views/LNHorizontalLine.m deleted file mode 100644 index 8e11362..0000000 --- a/Lin/Views/LNHorizontalLine.m +++ /dev/null @@ -1,20 +0,0 @@ -// -// LNHorizontalLine.m -// Lin -// -// Created by Tanaka Katsuma on 2013/09/21. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import "LNHorizontalLine.h" - -@implementation LNHorizontalLine - -- (void)drawRect:(NSRect)dirtyRect -{ - [[NSColor colorWithDeviceWhite:204.0/255.0 alpha:1.0] set]; - [NSBezierPath strokeLineFromPoint:NSMakePoint(dirtyRect.origin.x, 2.5) - toPoint:NSMakePoint(dirtyRect.origin.x + dirtyRect.size.width, 2.5)]; -} - -@end diff --git a/Lin/Views/PopoverWindow.h b/Lin/Views/PopoverWindow.h deleted file mode 100644 index 9f40fbc..0000000 --- a/Lin/Views/PopoverWindow.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// PopoverWindow.h -// Lin -// -// Created by Sascha Schwabbauer on 03/12/14. -// Copyright (c) 2014 evolved.io. All rights reserved. -// - -#import - -@interface PopoverWindow : NSWindow - -+ (instancetype)popoverWindow; - -@end diff --git a/Lin/Views/PopoverWindow.m b/Lin/Views/PopoverWindow.m deleted file mode 100644 index 709dda6..0000000 --- a/Lin/Views/PopoverWindow.m +++ /dev/null @@ -1,100 +0,0 @@ -// -// PopoverWindow.m -// Lin -// -// Created by Sascha Schwabbauer on 03/12/14. -// Copyright (c) 2014 evolved.io. All rights reserved. -// - -#import "PopoverWindow.h" -#import "PopoverWindowController.h" -#import "MainViewController.h" - -static NSString * const kEVOPopoverWindowToolbarSearchFieldIdentifier = @"Search"; - -@interface PopoverWindow () - -@property (nonatomic, strong) NSSearchField *searchField; - -@end - -@implementation PopoverWindow - -#pragma mark - Public API - -+ (instancetype)popoverWindow { - PopoverWindow *popoverWindow = [[PopoverWindow alloc] initWithContentRect:NSZeroRect styleMask:(NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask) backing:NSBackingStoreBuffered defer:NO]; - popoverWindow.title = @"Lin"; - popoverWindow.level = NSFloatingWindowLevel; - popoverWindow.backgroundColor = [NSColor whiteColor]; - [popoverWindow.contentView setAutoresizesSubviews:YES]; - - return popoverWindow; -} - -#pragma mark - Initializers - -- (instancetype)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)aStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)flag { - if ((self = [super initWithContentRect:contentRect styleMask:aStyle backing:bufferingType defer:flag])) { - // Create toolbar - NSToolbar *toolbar = [[NSToolbar alloc] initWithIdentifier:@"Toolbar"]; - toolbar.delegate = self; - toolbar.displayMode = NSToolbarDisplayModeIconOnly; - - self.toolbar = toolbar; - } - - return self; -} - -#pragma mark - Actions - -- (void)searchTextDidChange:(NSNotification *)note { - if (![self.searchField.stringValue isEqual:note.object]) { - self.searchField.stringValue = note.object; - } -} - -- (void)textFieldDidReturn:(id)sender { - [self controlTextDidChange:nil]; -} - -#pragma mark - NSToolbarDelegate - -- (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar *)toolbar { - return @[NSToolbarFlexibleSpaceItemIdentifier, kEVOPopoverWindowToolbarSearchFieldIdentifier]; -} - -- (NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar *)toolbar { - return @[NSToolbarFlexibleSpaceItemIdentifier, kEVOPopoverWindowToolbarSearchFieldIdentifier]; -} - -- (NSToolbarItem *)toolbar:(NSToolbar *)toolbar itemForItemIdentifier:(NSString *)itemIdentifier willBeInsertedIntoToolbar:(BOOL)flag { - NSToolbarItem *toolbarItem = nil; - - if ([itemIdentifier isEqualToString:kEVOPopoverWindowToolbarSearchFieldIdentifier]) { - toolbarItem = [[NSToolbarItem alloc] initWithItemIdentifier:itemIdentifier]; - - NSSearchField *searchField = [[NSSearchField alloc] init]; - searchField.delegate = self; - searchField.target = self; - searchField.action = @selector(textFieldDidReturn:); - - toolbarItem.view = searchField; - self.searchField = searchField; - } - - return toolbarItem; -} - - -#pragma mark - NSTextFieldDelegate - -- (void)controlTextDidChange:(NSNotification *)obj { - PopoverWindowController *popoverWindowController = (PopoverWindowController *)self.windowController; - MainViewController *mainViewController = (MainViewController *)popoverWindowController.contentViewController; - - mainViewController.searchString = self.searchField.stringValue; -} - -@end diff --git a/Lin/Window Controllers/PopoverWindowController.h b/Lin/Window Controllers/PopoverWindowController.h deleted file mode 100644 index 9ba1453..0000000 --- a/Lin/Window Controllers/PopoverWindowController.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// PopoverWindowController.h -// Lin -// -// Created by Sascha Schwabbauer on 03/12/14. -// Copyright (c) 2014 evolved.io. All rights reserved. -// - -#import - -@interface PopoverWindowController : NSWindowController - -- (instancetype)initWithContentViewController:(NSViewController *)contentViewController NS_DESIGNATED_INITIALIZER; - -@end diff --git a/Lin/Window Controllers/PopoverWindowController.m b/Lin/Window Controllers/PopoverWindowController.m deleted file mode 100644 index 95b8299..0000000 --- a/Lin/Window Controllers/PopoverWindowController.m +++ /dev/null @@ -1,30 +0,0 @@ -// -// LNPopoverWindowController.m -// Lin -// -// Created by Sascha Schwabbauer on 03/12/14. -// Copyright (c) 2014 evolved.io. All rights reserved. -// - -#import "PopoverWindowController.h" -#import "PopoverWindow.h" - -@implementation PopoverWindowController - -- (instancetype)initWithWindow:(NSWindow *)window { - return [self initWithContentViewController:nil]; -} - -- (instancetype)initWithCoder:(NSCoder *)coder { - return [self initWithContentViewController:nil]; -} - -- (instancetype)initWithContentViewController:(NSViewController *)contentViewController { - if ((self = [super initWithWindow:[PopoverWindow popoverWindow]])) { - self.contentViewController = contentViewController; - } - - return self; -} - -@end diff --git a/Lin/Xcode-Private-Classes/DVTFilePath.h b/Lin/Xcode-Private-Classes/DVTFilePath.h deleted file mode 100644 index 7df6e98..0000000 --- a/Lin/Xcode-Private-Classes/DVTFilePath.h +++ /dev/null @@ -1,18 +0,0 @@ -// -// DVTFilePath.h -// Lin -// -// Created by Tanaka Katsuma on 2013/08/23. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import - -@interface DVTFilePath : NSObject - -@property (readonly) NSString *fileName; -@property (readonly) NSURL *fileURL; -@property (readonly) NSArray *pathComponents; -@property (readonly) NSString *pathString; - -@end diff --git a/Lin/Xcode-Private-Classes/DVTSourceTextView.h b/Lin/Xcode-Private-Classes/DVTSourceTextView.h deleted file mode 100644 index 6c6a1a7..0000000 --- a/Lin/Xcode-Private-Classes/DVTSourceTextView.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// DVTSourceTextView.h -// Lin -// -// Created by Tanaka Katsuma on 2013/09/26. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import - -@interface DVTSourceTextView : NSTextView - -@end diff --git a/Lin/Xcode-Private-Classes/IDEEditorDocument.h b/Lin/Xcode-Private-Classes/IDEEditorDocument.h deleted file mode 100644 index ed2b539..0000000 --- a/Lin/Xcode-Private-Classes/IDEEditorDocument.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// IDEEditorDocument.h -// Lin -// -// Created by Tanaka Katsuma on 2013/08/24. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import - -@class DVTFilePath; - -@interface IDEEditorDocument : NSDocument - -@property (retain) DVTFilePath *filePath; - -@end diff --git a/Lin/Xcode-Private-Classes/IDEIndex.h b/Lin/Xcode-Private-Classes/IDEIndex.h deleted file mode 100644 index ca7263c..0000000 --- a/Lin/Xcode-Private-Classes/IDEIndex.h +++ /dev/null @@ -1,21 +0,0 @@ -// -// IDEIndex.h -// Lin -// -// Created by Tanaka Katsuma on 2013/08/23. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import - -@class DVTFilePath; - -@interface IDEIndex : NSObject - -@property (readonly, nonatomic) DVTFilePath *workspaceFile; -@property (readonly, nonatomic) NSString *workspaceName; - -- (void)close; -- (id)filesContaining:(id)arg1 anchorStart:(BOOL)arg2 anchorEnd:(BOOL)arg3 subsequence:(BOOL)arg4 ignoreCase:(BOOL)arg5 cancelWhen:(id)arg6; - -@end diff --git a/Lin/Xcode-Private-Classes/IDEIndexCollection.h b/Lin/Xcode-Private-Classes/IDEIndexCollection.h deleted file mode 100644 index c45c883..0000000 --- a/Lin/Xcode-Private-Classes/IDEIndexCollection.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// IDEIndexCollection.h -// Lin -// -// Created by Tanaka Katsuma on 2013/08/23. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import - -@interface IDEIndexCollection : NSObject - -@end diff --git a/Lin/Xcode-Private-Classes/IDEWorkspace.h b/Lin/Xcode-Private-Classes/IDEWorkspace.h deleted file mode 100644 index df86f5e..0000000 --- a/Lin/Xcode-Private-Classes/IDEWorkspace.h +++ /dev/null @@ -1,21 +0,0 @@ -// -// IDEWorkspace.h -// Lin -// -// Created by Tanaka Katsuma on 2013/08/21. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import - -@class IDEIndex; -@class DVTFilePath; - -@interface IDEWorkspace : NSObject - -@property (retain) IDEIndex *index; -@property (readonly) DVTFilePath *representingFilePath; - -- (void)_updateIndexableFiles:(id)arg1; - -@end diff --git a/Lin/Xcode-Private-Classes/IDEWorkspaceWindow.h b/Lin/Xcode-Private-Classes/IDEWorkspaceWindow.h deleted file mode 100644 index f7ff645..0000000 --- a/Lin/Xcode-Private-Classes/IDEWorkspaceWindow.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// IDEWorkspaceWindow.h -// Lin -// -// Created by Tanaka Katsuma on 2013/09/26. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import - -@interface IDEWorkspaceWindow : NSWindow - -@end diff --git a/LinTests/LNDetectorTestSet.h b/LinTests/LNDetectorTestSet.h deleted file mode 100644 index 487e2c8..0000000 --- a/LinTests/LNDetectorTestSet.h +++ /dev/null @@ -1,18 +0,0 @@ -// -// LNDetectorTestSet.h -// Lin -// -// Created by Tanaka Katsuma on 2013/08/21. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import - -@interface LNDetectorTestSet : NSObject - -@property (nonatomic, copy, readonly) NSString *string; -@property (nonatomic, copy, readonly) NSArray *keys; - -- (instancetype)initWithString:(NSString *)string keys:(NSString *)keyValue, ... NS_REQUIRES_NIL_TERMINATION NS_DESIGNATED_INITIALIZER; - -@end diff --git a/LinTests/LNDetectorTestSet.m b/LinTests/LNDetectorTestSet.m deleted file mode 100644 index f9ead12..0000000 --- a/LinTests/LNDetectorTestSet.m +++ /dev/null @@ -1,47 +0,0 @@ -// -// LNDetectorTestSet.m -// Lin -// -// Created by Tanaka Katsuma on 2013/08/21. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import "LNDetectorTestSet.h" - -@interface LNDetectorTestSet () - -@property (nonatomic, copy, readwrite) NSString *string; -@property (nonatomic, copy, readwrite) NSArray *keys; - -@end - -@implementation LNDetectorTestSet - -- (instancetype)initWithString:(NSString *)string keys:(NSString *)keyValue, ... -{ - self = [super init]; - - if (self) { - self.string = string; - - va_list arguments; - va_start(arguments, keyValue); - - NSString *key = keyValue; - NSMutableArray *keys = [NSMutableArray array]; - - while (key) { - [keys addObject:key]; - - key = va_arg(arguments, typeof(NSString *)); - } - - self.keys = [keys copy]; - - va_end(arguments); - } - - return self; -} - -@end diff --git a/LinTests/LNDetectorTests.m b/LinTests/LNDetectorTests.m deleted file mode 100644 index eecf8ff..0000000 --- a/LinTests/LNDetectorTests.m +++ /dev/null @@ -1,116 +0,0 @@ -// -// LNDetectorTests.m -// Lin -// -// Created by Tanaka Katsuma on 2013/08/21. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import - -// Models -#import "LNDetector.h" -#import "LNEntity.h" -#import "LNDetectorTestSet.h" - -@interface LNDetectorTests : XCTestCase - -@property (nonatomic, strong) LNDetector *detector; - -- (void)performTests:(LNDetectorTestSet *)testSetValue, ... NS_REQUIRES_NIL_TERMINATION; - -@end - -@implementation LNDetectorTests - -- (void)setUp -{ - [super setUp]; - - LNDetector *detector = [LNDetector detector]; - self.detector = detector; -} - -- (void)tearDown -{ - [super tearDown]; -} - -- (void)testLocalizedString -{ - [self performTests: - [[LNDetectorTestSet alloc] initWithString:@"NSLocalizedString(@\"key\", nil);" - keys:@"key", nil], - - [[LNDetectorTestSet alloc] initWithString:@"NSLocalizedString ( @\"key\" , nil );" - keys:@"key", nil], - [[LNDetectorTestSet alloc] initWithString:@"NSString *value = NSLocalizedString(@\"key\", nil);" - keys:@"key", nil], - [[LNDetectorTestSet alloc] initWithString:@"NSLog(@\"value1 = %@, value2 = %@\", NSLocalizedString(@\"key1\", nil), NSLocalizedString(@\"key2\", nil));" - keys:@"key1", @"key2", nil], - nil]; -} - -- (void)testLocalizedStringForKey -{ - [self performTests: - [[LNDetectorTestSet alloc] initWithString:@"[[NSBundle mainBundle] localizedStringForKey:@\"key\" value:@\"default_value\" table:@\"table_name\"];" - keys:@"key", nil], - nil]; -} - -- (void)testLocalizedStringFromTable -{ - [self performTests: - [[LNDetectorTestSet alloc] initWithString:@"NSLocalizedStringFromTable(@\"key\", @\"table_name\", @\"comment\");" - keys:@"key", nil], - nil]; -} - -- (void)testLocalizedStringFromTableInBundle -{ - [self performTests: - [[LNDetectorTestSet alloc] initWithString:@"NSLocalizedStringFromTableInBundle(@\"key\", @\"table_name\", [NSBundle mainBundle], @\"comment\");" - keys:@"key", nil], - nil]; -} - -- (void)testLocalizedStringWithDefaultValue -{ - [self performTests: - [[LNDetectorTestSet alloc] initWithString:@"NSLocalizedStringWithDefaultValue(@\"key\", @\"table_name\", [NSBundle mainBundle], @\"default_value\", @\"comment\");" - keys:@"key", nil], - nil]; -} - -- (void)performTests:(LNDetectorTestSet *)testSetValue, ... -{ - // Parse arguments - va_list arguments; - va_start(arguments, testSetValue); - - LNDetectorTestSet *testSet = testSetValue; - NSMutableArray *testSets = [NSMutableArray array]; - - while (testSet) { - [testSets addObject:testSet]; - - testSet = va_arg(arguments, typeof(LNDetectorTestSet *)); - } - - va_end(arguments); - - // Do tests - for (LNDetectorTestSet *testSet in testSets) { - NSArray *entities = [self.detector entitiesInString:testSet.string]; - XCTAssertTrue(entities.count == testSet.keys.count); // Number of detected entities and expected keys are equal. - - for (LNEntity *entity in entities) { - NSUInteger indexOfEntity = [entities indexOfObject:entity]; - NSString *keyString = [testSet.string substringWithRange:entity.keyRange]; - XCTAssertEqualObjects(keyString, testSet.keys[indexOfEntity]); // Extracted key is equal to expected key. - } - } -} - -@end diff --git a/LinTests/LNLocalizationTests.m b/LinTests/LNLocalizationTests.m deleted file mode 100644 index 2f54f6b..0000000 --- a/LinTests/LNLocalizationTests.m +++ /dev/null @@ -1,79 +0,0 @@ -// -// LNLocalizationTests.m -// Lin -// -// Created by Tanaka Katsuma on 2013/08/24. -// Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -// - -#import - -// Models -#import "LNLocalizationCollection.h" -#import "LNLocalization.h" - -@interface LNLocalizationTests : XCTestCase - -@end - -@implementation LNLocalizationTests - -- (NSBundle *)testBundle -{ - for (NSBundle *bundle in [NSBundle allBundles]) { - if ([[bundle bundleIdentifier] isEqualToString:@"jp.questbeat.LinTests"]) { - return bundle; - } - } - - return nil; -} - -- (void)testParsingPatterns -{ - NSString *filePath = [[self testBundle] pathForResource:@"Localizable" ofType:@"strings"]; - LNLocalizationCollection *collection = [LNLocalizationCollection localizationCollectionWithContentsOfFile:filePath]; - - struct LNLocalizationTestSet { - __unsafe_unretained NSString *key; - __unsafe_unretained NSString *value; - } testSets[] = { - {@"key0", @"value0"}, - {@"key1", @"value1"}, - {@"key2", @"value2"}, - {@"key3", @"value3"}, - {@"key4", @"value4"}, - {@"key5", @"value5"}, - {@"key6", @"value6"}, - {@"key7", @"value7"}, - {@"key8", @"value8"}, - {@"key 9", @"value9"}, - {@"key 10", @"value10"}, - {@"key 11", @"value11"}, - {@"key 12", @"value12"}, - {@"key 13", @"value13"}, - {@"key 14", @"value14"}, - {@"key 15", @"value15"}, - {@"key 16", @"value16"}, - {@"key.17", @"value17"}, - {@"key.18", @"value18"}, - {@"key.19", @"value19"}, - {@"key.20", @"value20"}, - {@"key.21", @"value21"} - }; - - NSInteger numberOfTestSets = sizeof(testSets) / sizeof(struct LNLocalizationTestSet); - - for (NSInteger i = 0; i < numberOfTestSets; i++) { - LNLocalization *localization = [LNLocalization localizationWithKey:testSets[i].key - value:testSets[i].value - entityRange:NSMakeRange(0, 0) - keyRange:NSMakeRange(0, 0) - valueRange:NSMakeRange(0, 0) - collection:nil]; - - XCTAssertTrue([collection.localizations containsObject:localization]); - } -} - -@end diff --git a/LinTests/LinTests-Info.plist b/LinTests/LinTests-Info.plist deleted file mode 100644 index 2922cc2..0000000 --- a/LinTests/LinTests-Info.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - jp.questbeat.${PRODUCT_NAME:rfc1034identifier} - CFBundleInfoDictionaryVersion - 6.0 - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - - diff --git a/LinTests/LinTests-Prefix.pch b/LinTests/LinTests-Prefix.pch deleted file mode 100644 index 8f82be2..0000000 --- a/LinTests/LinTests-Prefix.pch +++ /dev/null @@ -1,13 +0,0 @@ -// -// Prefix header -// -// The contents of this file are implicitly included at the beginning of every source file. -// - -#ifdef __OBJC__ - #import -#endif - -// Fix Xcode 5 confusion about #defines -#undef NULL -#define NULL ((void*)0) diff --git a/LinTests/Localizable.strings b/LinTests/Localizable.strings deleted file mode 100644 index bb52047..0000000 --- a/LinTests/Localizable.strings +++ /dev/null @@ -1,30 +0,0 @@ -/* - Localizable.strings - Lin - - Created by Tanaka Katsuma on 2013/09/22. - Copyright (c) 2013年 Tanaka Katsuma. All rights reserved. -*/ - -key0 = "value0"; - key1 = "value1"; -key2= "value2"; -key3="value3"; -"key4" = "value4"; -"key5" = "value5"; -"key6"= "value6"; -"key7"="value7"; -key8 = "value8"; -"key 9"="value9"; -"key 10" ="value10"; - "key 11"="value11"; - "key 12" ="value12"; -"key 13" = "value13"; -"key 14" = "value14"; - "key 15" ="value15"; - "key 16" = "value16"; -"key.17" = "value17"; -key.18 = "value18"; - key.19 = "value19"; - key.20="value20"; -key.21="value21"; diff --git a/LinTests/en.lproj/InfoPlist.strings b/LinTests/en.lproj/InfoPlist.strings deleted file mode 100644 index 477b28f..0000000 --- a/LinTests/en.lproj/InfoPlist.strings +++ /dev/null @@ -1,2 +0,0 @@ -/* Localized versions of Info.plist keys */ - diff --git a/Makefile b/Makefile deleted file mode 100644 index c766e8d..0000000 --- a/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -clean: - xcodebuild \ - -project Lin.xcodeproj \ - clean - -test: - xcodebuild \ - -project Lin.xcodeproj \ - -scheme LinTests \ - -configuration Debug \ - test - diff --git a/README.md b/README.md index 399be95..7f39176 100755 --- a/README.md +++ b/README.md @@ -1,69 +1 @@ -# Lin -Lin is a open source plug-in for **Xcode 6**. -It lets you search/manage localizations without opening the .strings files. - -[![Build Status](https://travis-ci.org/sascha/Lin-Xcode6.svg?branch=master)](https://travis-ci.org/sascha/Lin-Xcode6) - -![01.png](http://questbe.at/lin/img/screenshots/01.png) - -Lin for Xcode 5 -[questbeat/Lin](https://github.com/questbeat/Lin-Xcode5) - -Lin for Xcode 4 -[questbeat/Lin](https://github.com/questbeat/Lin) - -## Compatibility - -**This version of Lin requires Mac OS X 10.10 (Yosemite) and Xcode 6.1.1 (Build 6A2008a) or Xcode 6.2 beta (Build 6C86e).** - -## Features -When you are focusing on NSLocalizedString or other functions to get a localized version of a string, Lin shows the list of localizations that contains the inputted key string. - -![02.gif](http://questbe.at/lin/img/screenshots/02.gif) - -You can add a new localization or remove a localization from the popover. -(Click +/- button in the bottom left of the popover.) - -![03.gif](http://questbe.at/lin/img/screenshots/03.png) - -You can also edit key or value of a localization by clicking the row on the table. - -![04.png](http://questbe.at/lin/img/screenshots/04.png) - -Lin has not only popover mode, but also window mode. -The window will appear when you drag-and-drop the popover. -In window mode, the search field can be used to find the localization with a free keyword. - -![05.gif](http://questbe.at/lin/img/screenshots/05.gif) - - -## Installation - -1. [Download Lin-Xcode6 from GitHub](https://github.com/sascha/Lin-Xcode6/archive/master.zip) -2. Open Lin.xcodeproj and build (⌘B) -3. Relaunch Xcode - -Lin will be installed in `~/Library/Application Support/Developer/Shared/Xcode/Plug-ins` automatically. - -If you want to uninstall Lin, remove Lin.xcplugin in `Plug-ins` directory. - - -## Settings -You can enable/disable Lin or show window manually by opening the Lin menu in the Editor menu in Xcode. - -![06.png](http://questbe.at/lin/img/screenshots/06.png) - - -## Notes -* `.strings` files must be UTF-8 -* Supported functions: - * NSLocalizedString - * NSLocalizedStringFromTable - * NSLocalizedStringFromTableInBundle - * NSLocalizedStringWithDefaultValue - * localizedStringForKey:value:table: -* After modifying a `.string` file, don't forget to save otherwise new strings won't appear in completion popup - - -## License -*Lin* is released under the **MIT License**, see *LICENSE.txt*. +**The original author of Lin decided to update his version, so this fork is no longer maintained. Please take a look at [https://github.com/questbeat/Lin/](https://github.com/questbeat/Lin/) for the latest version.** \ No newline at end of file