From 841647a3ed94528886b9c7ba203e5a73d9c2ae55 Mon Sep 17 00:00:00 2001 From: michael starke Date: Mon, 25 Feb 2013 03:31:55 +0100 Subject: [PATCH] Fixed deallocation cleanup Minor view changes Sketching path bar to use for search as hint to where the entries are Some experiments with the filter bar (extracted the view to a separate nib) --- MacPass.xcodeproj/project.pbxproj | 16 + MacPass/EntryView.xib | 775 ++------------------------ MacPass/FilterBar.xib | 622 +++++++++++++++++++++ MacPass/GeneralSettings.xib | 121 ++-- MacPass/MPAppDelegate.m | 5 + MacPass/MPDatabaseController.m | 5 + MacPass/MPDatabaseDocument.h | 2 +- MacPass/MPDatabaseDocument.m | 1 + MacPass/MPEntryViewController.h | 3 + MacPass/MPEntryViewController.m | 84 ++- MacPass/MPGeneralSettingsController.h | 2 +- MacPass/MPGeneralSettingsController.m | 5 +- MacPass/MPGradientView.m | 10 + MacPass/MPMainWindowController.m | 16 +- MacPass/MPOutlineViewController.m | 3 + MacPass/MPPasswordInputController.m | 5 + MacPass/MPPathBar.h | 32 ++ MacPass/MPPathBar.m | 92 +++ MacPass/MPPathBarItemView.h | 18 + MacPass/MPPathBarItemView.m | 100 ++++ MacPass/MPSettingsController.m | 5 + MacPass/MPToolbarDelegate.m | 31 +- MacPass/MacPass-Info.plist | 2 +- MacPass/MainWindow.xib | 22 +- MacPass/SettingsWindow.xib | 26 +- 25 files changed, 1151 insertions(+), 852 deletions(-) create mode 100644 MacPass/FilterBar.xib create mode 100644 MacPass/MPPathBar.h create mode 100644 MacPass/MPPathBar.m create mode 100644 MacPass/MPPathBarItemView.h create mode 100644 MacPass/MPPathBarItemView.m diff --git a/MacPass.xcodeproj/project.pbxproj b/MacPass.xcodeproj/project.pbxproj index 1f7eb149..766be986 100644 --- a/MacPass.xcodeproj/project.pbxproj +++ b/MacPass.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 4C16854416D704980027ECBC /* MPPathBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C16854316D704980027ECBC /* MPPathBar.m */; }; 4C25D58516CF0F8800F6806C /* WelcomeView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4C25D58416CF0F8800F6806C /* WelcomeView.xib */; }; 4C25D58716CF0FAA00F6806C /* EntryView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4C25D58616CF0FAA00F6806C /* EntryView.xib */; }; 4C2C4C2C16D3BE3700D49295 /* KdbGroup+MPAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C2C4C2B16D3BE3700D49295 /* KdbGroup+MPAdditions.m */; }; @@ -17,6 +18,7 @@ 4C2E382616D1470200037A9D /* MPViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C2E382516D1470200037A9D /* MPViewController.m */; }; 4C37A84015B8B474005EF8EE /* MPOutlineDataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C37A83F15B8B474005EF8EE /* MPOutlineDataSource.m */; }; 4C3BD51516D276F800389F1F /* MPToolbarDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C3BD51416D276F800389F1F /* MPToolbarDelegate.m */; }; + 4C3FFD9E16DAF60600DF9186 /* FilterBar.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4C3FFD9D16DAF60600DF9186 /* FilterBar.xib */; }; 4C586F9E16D07ABD00E7DB57 /* 00_PasswordTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 4C586F9D16D07ABD00E7DB57 /* 00_PasswordTemplate.pdf */; }; 4C586FA016D07D7200E7DB57 /* 01_PackageNetworkTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 4C586F9F16D07D7200E7DB57 /* 01_PackageNetworkTemplate.pdf */; }; 4C586FA216D07F6A00E7DB57 /* 02_MessageBoxWarningTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 4C586FA116D07F6A00E7DB57 /* 02_MessageBoxWarningTemplate.pdf */; }; @@ -60,6 +62,7 @@ 4C669BA216760ED100DD0774 /* UUID.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C669B7B16760ED100DD0774 /* UUID.m */; }; 4C69A73A16D589DF00EC1B1A /* MPGradientView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C69A73916D589DF00EC1B1A /* MPGradientView.m */; }; 4C6B0E8C16C9B99B00A9ED23 /* PasswordInputView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4C6B0E8B16C9B99B00A9ED23 /* PasswordInputView.xib */; }; + 4C6DA0F916D81B8A0011224B /* MPPathBarItemView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C6DA0F816D81B8A0011224B /* MPPathBarItemView.m */; }; 4C75CE3C16CB128700F61A4D /* MPDatabaseController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C75CE3B16CB128700F61A4D /* MPDatabaseController.m */; }; 4C77E36715B84A240093A587 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C77E36615B84A240093A587 /* Cocoa.framework */; }; 4C77E37115B84A240093A587 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 4C77E36F15B84A240093A587 /* InfoPlist.strings */; }; @@ -96,6 +99,8 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 4C16854216D704980027ECBC /* MPPathBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPPathBar.h; sourceTree = ""; }; + 4C16854316D704980027ECBC /* MPPathBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPPathBar.m; sourceTree = ""; }; 4C25D58416CF0F8800F6806C /* WelcomeView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = WelcomeView.xib; sourceTree = ""; }; 4C25D58616CF0FAA00F6806C /* EntryView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = EntryView.xib; sourceTree = ""; }; 4C2C4C2A16D3BE3700D49295 /* KdbGroup+MPAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "KdbGroup+MPAdditions.h"; sourceTree = ""; }; @@ -111,6 +116,7 @@ 4C37A83F15B8B474005EF8EE /* MPOutlineDataSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPOutlineDataSource.m; sourceTree = ""; }; 4C3BD51316D276F800389F1F /* MPToolbarDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPToolbarDelegate.h; sourceTree = ""; }; 4C3BD51416D276F800389F1F /* MPToolbarDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPToolbarDelegate.m; sourceTree = ""; }; + 4C3FFD9D16DAF60600DF9186 /* FilterBar.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = FilterBar.xib; sourceTree = ""; }; 4C586F9D16D07ABD00E7DB57 /* 00_PasswordTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = 00_PasswordTemplate.pdf; sourceTree = ""; }; 4C586F9F16D07D7200E7DB57 /* 01_PackageNetworkTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = 01_PackageNetworkTemplate.pdf; sourceTree = ""; }; 4C586FA116D07F6A00E7DB57 /* 02_MessageBoxWarningTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = 02_MessageBoxWarningTemplate.pdf; sourceTree = ""; }; @@ -195,6 +201,8 @@ 4C69A73816D589DF00EC1B1A /* MPGradientView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPGradientView.h; sourceTree = ""; }; 4C69A73916D589DF00EC1B1A /* MPGradientView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPGradientView.m; sourceTree = ""; }; 4C6B0E8B16C9B99B00A9ED23 /* PasswordInputView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PasswordInputView.xib; sourceTree = ""; }; + 4C6DA0F716D81B8A0011224B /* MPPathBarItemView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPPathBarItemView.h; sourceTree = ""; }; + 4C6DA0F816D81B8A0011224B /* MPPathBarItemView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPPathBarItemView.m; sourceTree = ""; }; 4C75CE3A16CB128700F61A4D /* MPDatabaseController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPDatabaseController.h; sourceTree = ""; }; 4C75CE3B16CB128700F61A4D /* MPDatabaseController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPDatabaseController.m; sourceTree = ""; }; 4C77E36215B84A240093A587 /* MacPass.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MacPass.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -282,8 +290,13 @@ 4CA0B2EC15BCADAC00654E32 /* SettingsWindow.xib */, 4C6B0E8B16C9B99B00A9ED23 /* PasswordInputView.xib */, 4C25D58416CF0F8800F6806C /* WelcomeView.xib */, + 4C3FFD9D16DAF60600DF9186 /* FilterBar.xib */, 4C69A73816D589DF00EC1B1A /* MPGradientView.h */, 4C69A73916D589DF00EC1B1A /* MPGradientView.m */, + 4C16854216D704980027ECBC /* MPPathBar.h */, + 4C16854316D704980027ECBC /* MPPathBar.m */, + 4C6DA0F716D81B8A0011224B /* MPPathBarItemView.h */, + 4C6DA0F816D81B8A0011224B /* MPPathBarItemView.m */, ); name = Views; sourceTree = ""; @@ -686,6 +699,7 @@ 4C61EA0516D2FFE200AC519E /* OutlineView.xib in Resources */, 4CB9339916D3A0DD00A13B5D /* Credits.rtf in Resources */, 4CF5D49716D5B6E900CB78BD /* EntryEditView.xib in Resources */, + 4C3FFD9E16DAF60600DF9186 /* FilterBar.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -772,6 +786,8 @@ 4CC1AEBE16D4467C006D2AAB /* KdbTree+MPAdditions.m in Sources */, 4C69A73A16D589DF00EC1B1A /* MPGradientView.m in Sources */, 4CF5D49616D5B6E900CB78BD /* MPEntryEditController.m in Sources */, + 4C16854416D704980027ECBC /* MPPathBar.m in Sources */, + 4C6DA0F916D81B8A0011224B /* MPPathBarItemView.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/MacPass/EntryView.xib b/MacPass/EntryView.xib index bc5c0351..5adfc785 100644 --- a/MacPass/EntryView.xib +++ b/MacPass/EntryView.xib @@ -12,13 +12,10 @@ IBNSLayoutConstraint - NSButton - NSButtonCell NSCustomObject NSCustomView NSImageCell NSImageView - NSProgressIndicator NSScrollView NSScroller NSTableCellView @@ -49,149 +46,6 @@ 268 - - - 268 - - - - 268 - {{593, 6}, {16, 16}} - - - _NS:945 - 28938 - 100 - - - - 268 - {{198, 5}, {38, 17}} - - - - _NS:9 - YES - - -2080374784 - 134348800 - URL - - LucidaGrande-Bold - 12 - 16 - - _NS:9 - - -1232846848 - 173 - - - 400 - 75 - - NO - - - - 268 - - {{114, 5}, {76, 17}} - - - - _NS:9 - YES - - -2080374784 - 134348800 - Username - - _NS:9 - - -1232846848 - 173 - - - 400 - 75 - - NO - - - - 268 - {{64, 5}, {42, 17}} - - - - _NS:9 - YES - - -2080374784 - 142737408 - Title - - _NS:9 - - -1232846848 - 173 - - - 400 - 75 - - NO - - - - 268 - {{7, 7}, {52, 17}} - - - - _NS:1535 - YES - - 68157504 - 272630784 - Search: - - LucidaGrande-Bold - 13 - 2072 - - _NS:1535 - - - 6 - System - controlColor - - 3 - MC42NjY2NjY2NjY3AA - - - - 6 - System - disabledControlTextColor - - 3 - MC4zMzMzMzMzMzMzAA - - - - NO - - - {{0, 450}, {615, 30}} - - - - _NS:9 - MPGradientView - 4364 @@ -204,10 +58,10 @@ 256 - {615, 433} + {624, 346} - + _NS:13 YES NO @@ -215,7 +69,7 @@ 256 - {615, 17} + {624, 17} @@ -277,7 +131,10 @@ 6 System controlBackgroundColor - + + 3 + MC42NjY2NjY2NjY3AA + 6 @@ -373,7 +230,7 @@ - 128 + 137 10 3.4028234663852886e+38 @@ -423,7 +280,7 @@ 1 - {{0, 17}, {615, 433}} + {{0, 17}, {624, 346}} @@ -449,7 +306,7 @@ -2147483392 - {{0, 434}, {619, 16}} + {{0, 509}, {490, 16}} _NS:60 @@ -457,7 +314,7 @@ 1 _doScroller: - 0.9935794542536116 + 0.9859154929577465 @@ -465,7 +322,7 @@ - {615, 17} + {624, 17} @@ -475,10 +332,10 @@ 4 - {615, 450} + {624, 363} - + _NS:9 133680 @@ -491,10 +348,10 @@ 1 - {615, 480} + {624, 363} - + _NS:9 NSView @@ -517,22 +374,6 @@ 395 - - - searchLabelTextField - - - - 437 - - - - statusBar - - - - 520 - entryTableScrollView @@ -543,10 +384,10 @@ - statusBarToTop + tableToTop - - + + 3 0 @@ -562,86 +403,7 @@ 3 - 575 - - - - tableToTop - - - - 3 - 0 - - 3 - 1 - - 30 - - 1000 - - 9 - 40 - 3 - - - 577 - - - - searchTitleButton - - - - 605 - - - - searchURLButton - - - - 609 - - - - searchUsernameButton - - - - 610 - - - - toggleFilterSpace: - - - - 611 - - - - toggleFilterSpace: - - - - 612 - - - - toggleFilterSpace: - - - - 613 - - - - progressIndicator - - - - 626 + 671 @@ -664,7 +426,12 @@ Table View Cell - + + 6 + System + controlColor + + NO @@ -833,7 +600,7 @@ 266 - {128, 17} + {137, 17} {250, 750} @@ -850,7 +617,7 @@ NO - {{485, 1}, {128, 17}} + {{485, 1}, {137, 17}} @@ -888,7 +655,23 @@ 336 - + + + + 4 + 0 + + 4 + 1 + + 0.0 + + 1000 + + 8 + 29 + 3 + 6 @@ -921,266 +704,10 @@ 29 3 - - - 4 - 0 - - 4 - 1 - - 0.0 - - 1000 - - 8 - 29 - 3 - - - - 5 - 0 - - 5 - 1 - - 0.0 - - 1000 - - 8 - 29 - 3 - - - - - 6 - 0 - - 6 - 1 - - 0.0 - - 1000 - - 8 - 29 - 3 - - - - 349 - - - - - 3 - 0 - - 3 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - - - - 6 - 0 - - 6 - 1 - - 6 - - 1000 - - 3 - 9 - 3 - - - - 11 - 0 - - 11 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - - - - 5 - 0 - - 6 - 1 - - 8 - - 1000 - - 6 - 24 - 3 - - - - 5 - 0 - - 6 - 1 - - 8 - - 1000 - - 6 - 24 - 3 - - - - 11 - 0 - - 11 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - - - - 11 - 0 - - 11 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - - - - 5 - 0 - - 6 - 1 - - 8 - - 1000 - - 6 - 24 - 3 - - - - 10 - 0 - - 10 - 1 - - 0.0 - - 1000 - - 5 - 22 - 2 - - - - 5 - 0 - - 5 - 1 - - 10 - - 1000 - - 9 - 40 - 3 - - - - 8 - 0 - - 0 - 1 - - 30 - - 1000 - - 9 - 40 - 1 - - - - - - - - - - - 357 - - - - - 370 - - - - - - - - 371 - - - 54 @@ -1558,11 +1085,6 @@ - - 418 - - - 419 @@ -1745,105 +1267,6 @@ - - 442 - - - - - - - - 443 - - - - - 478 - - - - - 484 - - - - - 344 - - - - - 576 - - - - - 572 - - - - - 561 - - - - - 581 - - - - - 582 - - - - - 594 - - - - - - - - 595 - - - - - 597 - - - - - 598 - - - - - 599 - - - - - - - - 600 - - - - - 601 - - - - - 602 - - - 614 @@ -1943,19 +1366,14 @@ - 623 - - + 666 + + - 624 - - - - - 625 - - + 670 + + @@ -2022,47 +1440,16 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - - - - - + - + + com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - - - - - - - - - - - - - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - - 1 - MSAxIDEAA - - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -2095,33 +1482,13 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -2140,16 +1507,14 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin - 626 + 671 @@ -2169,13 +1534,11 @@ NSTableView - NSProgressIndicator + NSView NSTextField NSButton NSButton NSButton - NSView - NSLayoutConstraint NSLayoutConstraint @@ -2183,9 +1546,9 @@ entryTable NSTableView - - progressIndicator - NSProgressIndicator + + filterBar + NSView searchLabelTextField @@ -2203,14 +1566,6 @@ searchUsernameButton NSButton - - statusBar - NSView - - - statusBarToTop - NSLayoutConstraint - tableToTop NSLayoutConstraint @@ -2221,14 +1576,6 @@ ./Classes/MPEntryViewController.h - - MPGradientView - NSView - - IBProjectSource - ./Classes/MPGradientView.h - - MPViewController NSViewController diff --git a/MacPass/FilterBar.xib b/MacPass/FilterBar.xib new file mode 100644 index 00000000..ee0bfeaa --- /dev/null +++ b/MacPass/FilterBar.xib @@ -0,0 +1,622 @@ + + + + 1080 + 12C60 + 3084 + 1187.34 + 625.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 3084 + + + IBNSLayoutConstraint + NSButton + NSButtonCell + NSCustomObject + NSCustomView + NSTextField + NSTextFieldCell + + + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + + MPEntryViewController + + + FirstResponder + + + NSApplication + + + + 268 + + + + 268 + {{188, 6}, {38, 17}} + + + _NS:9 + YES + + -2080374784 + 134348800 + URL + + LucidaGrande-Bold + 12 + 16 + + _NS:9 + + -1232846848 + 173 + + + 400 + 75 + + NO + + + + 268 + {{104, 6}, {76, 17}} + + + + _NS:9 + YES + + -2080374784 + 134348800 + Username + + _NS:9 + + -1232846848 + 173 + + + 400 + 75 + + NO + + + + 268 + {{5, 7}, {44, 14}} + + + + _NS:1535 + YES + + 68157504 + 272761856 + Search: + + LucidaGrande-Bold + 11 + 3357 + + _NS:1535 + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + disabledControlTextColor + + 3 + MC4zMzMzMzMzMzMzAA + + + + NO + + + + 268 + {{54, 5}, {42, 17}} + + + + _NS:9 + YES + + -2080374784 + 134348800 + Title + + _NS:9 + + -1232846848 + 173 + + + 400 + 75 + + NO + + + {483, 28} + + + + MPGradientView + + + + + + + searchTitleButton + + + + 45 + + + + searchUsernameButton + + + + 46 + + + + searchURLButton + + + + 47 + + + + filterBar + + + + 48 + + + + toggleFilterSpace: + + + + 49 + + + + toggleFilterSpace: + + + + 50 + + + + toggleFilterSpace: + + + + 51 + + + + + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 1 + + + + + 5 + 0 + + 6 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + + + + 11 + 0 + + 11 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 4 + 0 + + 4 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 5 + 0 + + 6 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + + + + 5 + 0 + + 6 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + + + + 10 + 0 + + 10 + 1 + + 0.0 + + 1000 + + 5 + 22 + 2 + + + + 11 + 0 + + 11 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 5 + 0 + + 5 + 1 + + 8 + + 1000 + + 3 + 9 + 3 + + + + + + + + + + 2 + + + + + + + + 3 + + + + + 6 + + + + + + + + 7 + + + + + 30 + + + + + 32 + + + + + 34 + + + + + 35 + + + + + + + + 36 + + + + + 38 + + + + + 39 + + + + + 40 + + + + + + + + 41 + + + + + 42 + + + + + 43 + + + + + 44 + + + + + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + + + + + + + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + + + 51 + + + + + MPEntryViewController + MPViewController + + toggleFilterSpace: + id + + + toggleFilterSpace: + + toggleFilterSpace: + id + + + + NSTableView + NSView + NSTextField + NSButton + NSButton + NSButton + NSLayoutConstraint + + + + entryTable + NSTableView + + + filterBar + NSView + + + searchLabelTextField + NSTextField + + + searchTitleButton + NSButton + + + searchURLButton + NSButton + + + searchUsernameButton + NSButton + + + tableToTop + NSLayoutConstraint + + + + IBProjectSource + ./Classes/MPEntryViewController.h + + + + MPGradientView + NSView + + IBProjectSource + ./Classes/MPGradientView.h + + + + MPViewController + NSViewController + + IBProjectSource + ./Classes/MPViewController.h + + + + NSLayoutConstraint + NSObject + + IBProjectSource + ./Classes/NSLayoutConstraint.h + + + + + 0 + IBCocoaFramework + YES + 3 + YES + + diff --git a/MacPass/GeneralSettings.xib b/MacPass/GeneralSettings.xib index a49d9f9d..f398a4a4 100644 --- a/MacPass/GeneralSettings.xib +++ b/MacPass/GeneralSettings.xib @@ -18,7 +18,6 @@ NSMenuItem NSPopUpButton NSPopUpButtonCell - NSProgressIndicator NSTextField NSTextFieldCell @@ -43,21 +42,12 @@ 268 - - - 268 - {{129, 93}, {32, 32}} - - _NS:945 - 20490 - 100 - 268 {{146, 174}, {127, 26}} - + _NS:9 {750, 751} YES @@ -137,6 +127,7 @@ 268 {{17, 180}, {127, 17}} + _NS:1505 YES @@ -171,6 +162,7 @@ {290, 218} + NSView @@ -193,14 +185,6 @@ 83 - - - spinner - - - - 174 - @@ -234,38 +218,6 @@ - - - 10 - 0 - - 10 - 1 - - 0.0 - - 1000 - - 5 - 22 - 2 - - - - 9 - 0 - - 9 - 1 - - 0.0 - - 1000 - - 5 - 22 - 2 - 11 @@ -394,7 +346,6 @@ 40 3 - @@ -492,21 +443,6 @@ - - 155 - - - - - 168 - - - - - 167 - - - @@ -522,8 +458,6 @@ - - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -533,11 +467,7 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -553,9 +483,50 @@ - 174 + 338 + + + + + MPGeneralSettingsController + MPViewController + + NSPopUpButton + NSImageView + + + + encodingPopup + NSPopUpButton + + + imageView + NSImageView + + + + IBProjectSource + ./Classes/MPGeneralSettingsController.h + + + + MPViewController + NSViewController + + IBProjectSource + ./Classes/MPViewController.h + + + + NSLayoutConstraint + NSObject + + IBProjectSource + ./Classes/NSLayoutConstraint.h + + + - 0 IBCocoaFramework YES diff --git a/MacPass/MPAppDelegate.m b/MacPass/MPAppDelegate.m index 61c55e12..629aed12 100644 --- a/MacPass/MPAppDelegate.m +++ b/MacPass/MPAppDelegate.m @@ -28,6 +28,11 @@ [self.mainWindowController showWindow:[self.mainWindowController window]]; } +- (void)dealloc { + self.settingsController = nil; + self.mainWindowController = nil; +} + #pragma mark Menu Actions - (void)showMainWindow:(id)sender { diff --git a/MacPass/MPDatabaseController.m b/MacPass/MPDatabaseController.m index f276a5a6..84a7f9cc 100644 --- a/MacPass/MPDatabaseController.m +++ b/MacPass/MPDatabaseController.m @@ -40,6 +40,11 @@ NSString *const MPDatabaseControllerDatabaseKey = @"MPDatabaseControllerDatabase return self; } +- (void)dealloc { + self.database = nil; + [super dealloc]; +} + - (MPDatabaseDocument *)createDatabase:(MPDatabaseVersion)version password:(NSString *)password keyfile:(NSURL *)key { return self.database; } diff --git a/MacPass/MPDatabaseDocument.h b/MacPass/MPDatabaseDocument.h index 9062b9d8..c2de7736 100644 --- a/MacPass/MPDatabaseDocument.h +++ b/MacPass/MPDatabaseDocument.h @@ -21,7 +21,7 @@ typedef enum { @interface MPDatabaseDocument : NSObject -@property (retain, readonly) KdbGroup *root; +@property (assign, readonly) KdbGroup *root; @property (retain, readonly) NSURL *file; @property (nonatomic,retain) NSString *password; @property (nonatomic, retain) NSURL *key; diff --git a/MacPass/MPDatabaseDocument.m b/MacPass/MPDatabaseDocument.m index ecc24843..0ceb845a 100644 --- a/MacPass/MPDatabaseDocument.m +++ b/MacPass/MPDatabaseDocument.m @@ -91,6 +91,7 @@ NSString *const MPDidLoadDataBaseNotification = @"DidLoadDataBaseNotification"; self.tree = nil; self.file = nil; self.password = nil; + self.key = nil; [super dealloc]; } diff --git a/MacPass/MPEntryViewController.h b/MacPass/MPEntryViewController.h index 523c429c..3f2cc8a7 100644 --- a/MacPass/MPEntryViewController.h +++ b/MacPass/MPEntryViewController.h @@ -24,4 +24,7 @@ APPKIT_EXTERN NSString *const MPEntryTableURLColumnIdentifier; @property (readonly, retain) NSArrayController *entryArrayController; @property (nonatomic, retain) NSString *filter; +/* Clear the Search filter*/ +- (void)clearFilter; + @end diff --git a/MacPass/MPEntryViewController.m b/MacPass/MPEntryViewController.m index 29e269fb..e67881f0 100644 --- a/MacPass/MPEntryViewController.m +++ b/MacPass/MPEntryViewController.m @@ -42,13 +42,11 @@ NSString *const _toggleSearchUsernameButton = @"SearchUsername"; @property (retain) NSArrayController *entryArrayController; @property (retain) NSArray *filteredEntries; +@property (retain) IBOutlet NSView *filterBar; @property (assign) IBOutlet NSTableView *entryTable; -@property (assign) IBOutlet NSView *statusBar; @property (assign) IBOutlet NSTextField *searchLabelTextField; @property (assign) BOOL isStatusBarVisible; -@property (retain) IBOutlet NSLayoutConstraint *statusBarToTop; @property (retain) IBOutlet NSLayoutConstraint *tableToTop; -@property (assign) IBOutlet NSProgressIndicator *progressIndicator; @property (assign) IBOutlet NSButton *searchTitleButton; @property (assign) IBOutlet NSButton *searchUsernameButton; @@ -65,8 +63,9 @@ NSString *const _toggleSearchUsernameButton = @"SearchUsername"; - (BOOL)hasFilter; - (void)updateFilter; +- (void)setupFilterBar; - (void)didChangeGroupSelectionInOutlineView:(NSNotification *)notification; -- (void)showStatusBarAnimated:(BOOL)animate; +- (void)showFilterBarAnimated:(BOOL)animate; - (void)hideStatusBarAnimated:(BOOL)animate; @end @@ -96,15 +95,20 @@ NSString *const _toggleSearchUsernameButton = @"SearchUsername"; return self; } +- (void)dealloc { + self.entryArrayController = nil; + self.filteredEntries = nil; + self.filterBar = nil; + self.tableToTop = nil; + self.filterButtonToMode = nil; + [super dealloc]; +} + - (void)didLoadView { [self.view setWantsLayer:YES]; [self hideStatusBarAnimated:NO]; [[self.searchLabelTextField cell] setBackgroundStyle:NSBackgroundStyleRaised]; - [self.searchURLButton setIdentifier:_toggleSearchURLButton]; - [self.searchUsernameButton setIdentifier:_toggleSearchUsernameButton]; - [self.searchTitleButton setIdentifier:_toggleSearchTitleButton]; - [self.entryTable setDelegate:self]; NSTableColumn *parentColumn = [self.entryTable tableColumns][0]; @@ -172,8 +176,10 @@ NSString *const _toggleSearchUsernameButton = @"SearchUsername"; #pragma mark Notifications - (void)didChangeGroupSelectionInOutlineView:(NSNotification *)notification { - self.filter = @""; // will update the reast automatically - + if([self hasFilter]) { + return; + } + [self clearFilter]; MPOutlineViewDelegate *delegate = [notification object]; KdbGroup *group = delegate.selectedGroup; if(group) { @@ -198,11 +204,16 @@ NSString *const _toggleSearchUsernameButton = @"SearchUsername"; } } +- (void)clearFilter { + self.filter = nil; + [[self.entryTable tableColumnWithIdentifier:MPEntryTableParentColumnIdentifier] setHidden:YES]; + [self hideStatusBarAnimated:YES]; +} + - (void)updateFilter { MPDatabaseDocument *openDatabase = [MPDatabaseController defaultController].database; - if(openDatabase && [self hasFilter]) { - [self showStatusBarAnimated:YES]; - + if(openDatabase) { + [self showFilterBarAnimated:YES]; dispatch_queue_t backgroundQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); dispatch_async(backgroundQueue, ^{ @@ -229,26 +240,47 @@ NSString *const _toggleSearchUsernameButton = @"SearchUsername"; else { [self.entryArrayController setContent:nil]; self.filteredEntries = nil; - [[self.entryTable tableColumnWithIdentifier:MPEntryTableParentColumnIdentifier] setHidden:YES]; - [self hideStatusBarAnimated:YES]; + } +} + +- (void)setupFilterBar { + if(!self.filterBar) { + [[NSBundle mainBundle] loadNibNamed:@"FilterBar" owner:self topLevelObjects:nil]; + [self.filterBar setAutoresizingMask:NSViewWidthSizable|NSViewMinYMargin]; + [self.searchURLButton setIdentifier:_toggleSearchURLButton]; + [self.searchUsernameButton setIdentifier:_toggleSearchUsernameButton]; + [self.searchTitleButton setIdentifier:_toggleSearchTitleButton]; } } #pragma mark Animation -- (void)showStatusBarAnimated:(BOOL)animate { +- (void)showFilterBarAnimated:(BOOL)animate { + + animate = NO; + + if(!self.filterBar) { + [self setupFilterBar]; + } + /* + Make sure the buttons are set correctyl every time + */ + [self.searchTitleButton setState:[self shouldFilterTitles] ? NSOnState : NSOffState]; + [self.searchURLButton setState:[self shouldFilterURLs] ? NSOnState : NSOffState ]; + [self.searchUsernameButton setState:[self shouldFilterUsernames] ? NSOnState : NSOffState]; if(self.isStatusBarVisible) { return; // nothign to to } - [self.searchTitleButton setState:[self shouldFilterTitles] ? NSOnState : NSOffState]; - [self.searchURLButton setState:[self shouldFilterURLs] ? NSOnState : NSOffState ]; - [self.searchUsernameButton setState:[self shouldFilterUsernames] ? NSOnState : NSOffState]; - self.isStatusBarVisible = YES; - self.statusBarToTop.constant = 0; - self.tableToTop.constant = [self.statusBar frame].size.height; + self.tableToTop.constant = [self.filterBar frame].size.height; + + [self.view addSubview:self.filterBar]; + NSRect filterFrame = [self.filterBar frame]; + filterFrame.origin.y = [self.view frame].size.height - filterFrame.size.height; + filterFrame.size.width = [self.view frame].size.width; + [self.filterBar setFrame:filterFrame]; if(animate) { [NSAnimationContext runAnimationGroup:^(NSAnimationContext* context) { @@ -264,13 +296,15 @@ NSString *const _toggleSearchUsernameButton = @"SearchUsername"; - (void)hideStatusBarAnimated:(BOOL)animate { + animate = NO; + if(!self.isStatusBarVisible) { return; // nothing to do; } self.isStatusBarVisible = NO; - self.statusBarToTop.constant = -[self.statusBar frame].size.height; self.tableToTop.constant = -1; + [self.filterBar removeFromSuperview]; if(animate) { [NSAnimationContext runAnimationGroup:^(NSAnimationContext* context) { @@ -302,10 +336,14 @@ NSString *const _toggleSearchUsernameButton = @"SearchUsername"; default: break; } + } - (void)setFilterMode:(MPFilterModeType)newFilterMode { if(_filterMode != newFilterMode) { + if(newFilterMode == MPFilterNone) { + newFilterMode = MPFilterTitles; + } _filterMode = newFilterMode; [self updateFilter]; } diff --git a/MacPass/MPGeneralSettingsController.h b/MacPass/MPGeneralSettingsController.h index 804e7e2a..8de18047 100644 --- a/MacPass/MPGeneralSettingsController.h +++ b/MacPass/MPGeneralSettingsController.h @@ -11,6 +11,6 @@ #import "MPViewController.h" @interface MPGeneralSettingsController : MPViewController -@property (assign) IBOutlet NSProgressIndicator *spinner; +@property (assign) IBOutlet NSImageView *imageView; @end diff --git a/MacPass/MPGeneralSettingsController.m b/MacPass/MPGeneralSettingsController.m index bab707cc..123807ab 100644 --- a/MacPass/MPGeneralSettingsController.m +++ b/MacPass/MPGeneralSettingsController.m @@ -29,8 +29,7 @@ NSString *const MPGeneralSetingsIdentifier = @"GeneralSettingsTab"; return [self initWithNibName:@"GeneralSettings" bundle:[NSBundle mainBundle]]; } -- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil -{ +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; return self; } @@ -39,7 +38,7 @@ NSString *const MPGeneralSetingsIdentifier = @"GeneralSettingsTab"; // setup connections NSMenu *encodingMenu = [[NSMenu allocWithZone:[NSMenu menuZone]] init]; NSMenuItem *item; - + item = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:@"UTF8 Encoding" action:NULL keyEquivalent:@""]; [item setRepresentedObject:[NSNumber numberWithInt:NSUTF8StringEncoding]]; [encodingMenu addItem:item]; diff --git a/MacPass/MPGradientView.m b/MacPass/MPGradientView.m index cb134a80..d0167dbf 100644 --- a/MacPass/MPGradientView.m +++ b/MacPass/MPGradientView.m @@ -39,6 +39,12 @@ return self; } +- (void)dealloc { + self.activeGradient = nil; + self.inactiveGradient = nil; + [super dealloc]; +} + #pragma mark Drawing - (void)drawRect:(NSRect)dirtyRect { @@ -49,6 +55,10 @@ [gradient drawInRect:self.bounds angle:90]; } +- (BOOL)isOpaque { + return YES; +} + #pragma mark State Refresh - (void)_registerWindow:(NSWindow *)newWindow { if([self window]) { diff --git a/MacPass/MPMainWindowController.m b/MacPass/MPMainWindowController.m index 2cb3733b..b4adccd7 100644 --- a/MacPass/MPMainWindowController.m +++ b/MacPass/MPMainWindowController.m @@ -58,6 +58,16 @@ - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; + self.welcomeView = nil; + self.welcomeText = nil; + self.toolbar = nil; + + self.passwordInputController = nil; + self.entryViewController = nil; + self.outlineViewController = nil; + + self.toolbarDelegate = nil; + self.splitViewDelegate = nil; [super dealloc]; } @@ -172,8 +182,10 @@ self.entryViewController.filter = [searchField stringValue]; } -- (void)cancelFilter:(id)sender { - NSLog(@"Whooo"); +- (void)clearFilter:(id)sender { + NSSearchField *searchField = sender; + [searchField setStringValue:@""]; + [self.entryViewController clearFilter]; } #pragma mark Notifications diff --git a/MacPass/MPOutlineViewController.m b/MacPass/MPOutlineViewController.m index 2928237d..6e4a5a06 100644 --- a/MacPass/MPOutlineViewController.m +++ b/MacPass/MPOutlineViewController.m @@ -52,6 +52,9 @@ - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; + self.datasource = nil; + self.outlineDelegate = nil; + self.menu = nil; [super dealloc]; } diff --git a/MacPass/MPPasswordInputController.m b/MacPass/MPPasswordInputController.m index 34c31276..531febcd 100644 --- a/MacPass/MPPasswordInputController.m +++ b/MacPass/MPPasswordInputController.m @@ -25,6 +25,11 @@ return [[MPPasswordInputController alloc] initWithNibName:@"PasswordInputView" bundle:nil]; } +- (void)dealloc { + self.fileURL = nil; + [super dealloc]; +} + - (NSResponder *)reconmendedFirstResponder { return self.passwordTextField; } diff --git a/MacPass/MPPathBar.h b/MacPass/MPPathBar.h new file mode 100644 index 00000000..a41043d2 --- /dev/null +++ b/MacPass/MPPathBar.h @@ -0,0 +1,32 @@ +// +// MPPathBar.h +// MacPass +// +// Created by michael starke on 22.02.13. +// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. +// + +#import "MPGradientView.h" + +@class MPPathBar; +/* + Delegate protocoll + */ +@protocol MPPathBarDelegateProtocoll + +@required +- (NSUInteger)numberOfItemsInPathBar:(MPPathBar *)pathBar; +- (NSString *)pathbar:(MPPathBar *)pathbar stringAtIndex:(NSUInteger)index; + +@optional +- (NSImage *)pathbar:(MPPathBar *)pathbar imageAtIndex:(NSUInteger)index; + +@end + + +@interface MPPathBar : MPGradientView + +@property (assign, nonatomic) id delegate; + +@end + diff --git a/MacPass/MPPathBar.m b/MacPass/MPPathBar.m new file mode 100644 index 00000000..3db32d55 --- /dev/null +++ b/MacPass/MPPathBar.m @@ -0,0 +1,92 @@ +// +// MPPathBar.m +// MacPass +// +// Created by michael starke on 22.02.13. +// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. +// + +#import "MPPathBar.h" +#import "MPPathBarItemView.h" + +#define INTER_BUTTON_SPACING 5.0 + +@interface MPPathBar () + +@property (retain) NSMutableArray *itemViews; +@property (assign) BOOL delegateSupportsImage; + +- (void)update; +- (void)createViews; +- (MPPathBarItemView *)viewForIndex:(NSUInteger)index; + +@end + +@implementation MPPathBar + +- (id)initWithFrame:(NSRect)frame activeGradient:(NSGradient *)activeGradient inactiveGradient:(NSGradient *)inactiveGradient { + self = [super initWithFrame:frame activeGradient:activeGradient inactiveGradient:inactiveGradient]; + if(self) { + _itemViews = [[NSMutableArray alloc] initWithCapacity:5]; + _delegateSupportsImage = NO; + [self createViews]; + } + return self; +} + +- (void)dealloc { + self.itemViews = nil; + [super dealloc]; +} + +- (void)drawRect:(NSRect)dirtyRect { + [super drawRect:dirtyRect]; + [self update]; +} + +- (void)createViews { + NSUInteger items = 5;//[self.delegate numberOfItemsInPathBar:self]; + CGFloat startPosition = 0; + for (NSUInteger iIndex = 0; iIndex < items; iIndex++) { + MPPathBarItemView *textField = [self viewForIndex:iIndex]; + [textField setFrame:NSMakeRect(startPosition, 0, 20, 20)]; + [self addSubview:textField]; + } + [self update]; +} + +- (void)update { + CGFloat startPosition = 0; + for(MPPathBarItemView *view in self.itemViews) { + [view sizeToFit]; + NSRect newFrame = [view frame]; + newFrame.origin.x = startPosition; + [view setFrame:newFrame]; + startPosition += newFrame.size.width + INTER_BUTTON_SPACING; + } +} + +- (void)setDelegate:(id)delegate { + if(_delegate != delegate) { + _delegate = delegate; + self.delegateSupportsImage = [_delegate respondsToSelector:@selector(pathbar:imageAtIndex:)]; + [self update]; + } +} + + +- (MPPathBarItemView *)viewForIndex:(NSUInteger)index { + MPPathBarItemView *itemView = nil; + if([self.itemViews count] > index) { + itemView = self.itemViews[index]; + } + if(!itemView) { + itemView = [[MPPathBarItemView alloc] initWithFrame:NSMakeRect(0, 0, 50, 24)]; + } + itemView.text = [NSString stringWithFormat:@"Button %ld", (unsigned long)index ]; + itemView.image = [NSImage imageNamed:NSImageNameActionTemplate]; + //[itemView setStringValue:[self.delegate pathbar:self stringAtIndex:index]]; + [self.itemViews addObject:itemView]; + return itemView; +} +@end diff --git a/MacPass/MPPathBarItemView.h b/MacPass/MPPathBarItemView.h new file mode 100644 index 00000000..ff97825b --- /dev/null +++ b/MacPass/MPPathBarItemView.h @@ -0,0 +1,18 @@ +// +// MPPathBarItemView.h +// MacPass +// +// Created by michael starke on 22.02.13. +// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. +// + +#import + +@interface MPPathBarItemView : NSView + +@property (retain, nonatomic) NSImage *image; +@property (retain, nonatomic) NSString *text; + +- (void)sizeToFit; + +@end diff --git a/MacPass/MPPathBarItemView.m b/MacPass/MPPathBarItemView.m new file mode 100644 index 00000000..6d70fba9 --- /dev/null +++ b/MacPass/MPPathBarItemView.m @@ -0,0 +1,100 @@ +// +// MPPathBarItemView.m +// MacPass +// +// Created by michael starke on 22.02.13. +// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. +// + +#import "MPPathBarItemView.h" + +@interface MPPathBarItemView () + +@property (retain) NSImageView *imageView; +@property (retain) NSTextField *textField; + +@end + +@implementation MPPathBarItemView + +- (id)initWithFrame:(NSRect)frameRect { + self = [super initWithFrame:frameRect]; + if(self) { + + _imageView = [[NSImageView alloc] initWithFrame:NSMakeRect(0, 0, 20, 24)]; + [[_imageView cell] setImageAlignment:NSImageAlignCenter]; + [[_imageView cell] setBackgroundStyle:NSBackgroundStyleRaised]; + [[_imageView cell] setBordered:NO]; + [[_imageView cell] setDrawsBackground:NO]; + [_imageView setImage:[NSImage imageNamed:NSImageNameActionTemplate ]]; + + _textField = [[NSTextField alloc] initWithFrame:NSMakeRect([_imageView frame].size.width + 5, 0, 20, 24)]; + [_textField setBordered:NO]; + [_textField setFont:[NSFont systemFontOfSize:13]]; + [_textField setDrawsBackground:NO]; + [_textField setEditable:NO]; + [_textField setSelectable:NO]; + [[_textField cell] setBackgroundStyle:NSBackgroundStyleRaised]; + [_textField setStringValue:@"Boo"]; + [_textField sizeToFit]; + [self addSubview:_textField]; + [self addSubview:_imageView]; + +// NSDictionary *viewDictionary = NSDictionaryOfVariableBindings(_imageView, _textField); +// [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-[_imageView(24)]-|" +// options:0 +// metrics:nil +// views:viewDictionary]]; +// [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-[_imageView(24)]-|" +// options:0 +// metrics:nil +// views:viewDictionary]]; +// [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-[_imageView]-|" +// options:0 +// metrics:nil +// views:viewDictionary]]; +// +// [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-[_textField]-|" +// options:0 +// metrics:nil +// views:viewDictionary]]; + + + [self needsLayout]; + } + return self; +} + +- (void)setText:(NSString *)text { + if(_text != text) { + [_text release]; + _text = [text retain]; + [self.textField setStringValue:text]; + [self sizeToFit]; + } +} + +- (void)setImage:(NSImage *)image { + if(_image != image) { + [_image release]; + _image = [image retain]; + [_imageView setImage:image]; + [self sizeToFit]; + } +} + +- (void)sizeToFit { + [self.textField sizeToFit]; + [self.imageView sizeToFit]; + NSRect textFrame = [self.textField frame]; + NSRect imageFrame = [self.imageView frame]; + + // nudge the textframe + textFrame.origin.x = imageFrame.size.width; + [self.textField setFrame:textFrame]; + + NSRect frame = NSMakeRect(0, 0,textFrame.size.width + imageFrame.size.width, textFrame.size.height); + [self setFrame:frame]; +} + +@end diff --git a/MacPass/MPSettingsController.m b/MacPass/MPSettingsController.m index 7d7bd4ed..194ab2ed 100644 --- a/MacPass/MPSettingsController.m +++ b/MacPass/MPSettingsController.m @@ -22,6 +22,11 @@ NSString const* kMPPasswordEnvodingSettingsKey = @"PasswordEncoding"; return self; } +- (void)dealloc { + self.generalController = nil; + [super dealloc]; +} + - (void)windowDidLoad { _generalController = [[MPGeneralSettingsController alloc] init]; [_generalController loadView]; diff --git a/MacPass/MPToolbarDelegate.m b/MacPass/MPToolbarDelegate.m index d9db2430..106504ba 100644 --- a/MacPass/MPToolbarDelegate.m +++ b/MacPass/MPToolbarDelegate.m @@ -39,6 +39,14 @@ NSString *const MPToolbarItemSearch = @"Search"; return self; } +- (void)dealloc +{ + self.toolbarItems = nil; + self.toolbarIdentifiers = nil; + self.toolbarImages = nil; + [super dealloc]; +} + - (NSToolbarItem *)toolbar:(NSToolbar *)toolbar itemForItemIdentifier:(NSString *)itemIdentifier willBeInsertedIntoToolbar:(BOOL)flag { NSToolbarItem *item = self.toolbarItems[ itemIdentifier ]; if( !item ) { @@ -49,20 +57,25 @@ NSString *const MPToolbarItemSearch = @"Search"; NSString *label = NSLocalizedString(itemIdentifier, @""); [item setLabel:label]; [item release]; - + if([itemIdentifier isEqualToString:MPToolbarItemSearch]) { NSSearchField *searchfield = [[NSSearchField alloc] initWithFrame:NSMakeRect(0, 0, 70, 32)]; [item setView:searchfield]; [searchfield setAction:@selector(updateFilter:)]; [[searchfield cell] setSendsSearchStringImmediately:NO]; + [[searchfield cell] addObserver:self forKeyPath:@"controlSize" options:0 context:NULL]; + [[[searchfield cell] cancelButtonCell] setTarget:nil]; + [[[searchfield cell] cancelButtonCell] setAction:@selector(clearFilter:)]; [searchfield release]; self.searchItem = item; } else if([itemIdentifier isEqualToString:MPToolbarItemAction]) { NSPopUpButton *popupButton = [[NSPopUpButton alloc] initWithFrame:NSMakeRect(0, 0, 50, 32) pullsDown:YES]; + [[popupButton cell] addObserver:self forKeyPath:@"controlSize" options:0 context:NULL]; [[popupButton cell] setBezelStyle:NSTexturedRoundedBezelStyle]; [[popupButton cell] setImageScaling:NSImageScaleProportionallyDown]; [popupButton setTitle:@""]; + [popupButton sizeToFit]; /* Built menu */ @@ -72,14 +85,17 @@ NSString *const MPToolbarItemSearch = @"Search"; [menu addItem:menuItem]; [menu addItemWithTitle:@"Foo" action:NULL keyEquivalent:@""]; [menu addItemWithTitle:@"Bar" action:NULL keyEquivalent:@""]; - [popupButton setMenu:menu]; + NSRect newFrame = [popupButton frame]; + newFrame.size.width += 20; + [popupButton setFrame:newFrame]; + [popupButton setMenu:menu]; /* Cleanup */ [menuItem release]; [menu release]; - [popupButton sizeToFit]; + [item setView:popupButton]; [popupButton release]; @@ -88,13 +104,16 @@ NSString *const MPToolbarItemSearch = @"Search"; NSButton *button = [[NSButton alloc] initWithFrame:NSMakeRect(0, 0, 32, 32)]; [[button cell] setBezelStyle:NSTexturedRoundedBezelStyle]; [[button cell] setImageScaling:NSImageScaleProportionallyDown]; - [button setTitle:@""]; + [button setTitle:itemIdentifier]; [button setButtonType:NSMomentaryPushInButton]; NSImage *image = self.toolbarImages[itemIdentifier]; [button setImage:image]; [button setImagePosition:NSImageOnly]; [button sizeToFit]; + NSRect fittingRect = [button frame]; + fittingRect.size.width = MAX( (CGFloat)32.0,fittingRect.size.width); + [button setFrame:fittingRect]; [item setView:button]; [button release]; } @@ -123,5 +142,9 @@ NSString *const MPToolbarItemSearch = @"Search"; return imageDict; } +- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { + NSLog(@"Path:%@: Objecte:%@", keyPath, object); +} + @end diff --git a/MacPass/MacPass-Info.plist b/MacPass/MacPass-Info.plist index a31aaf9d..25363c46 100644 --- a/MacPass/MacPass-Info.plist +++ b/MacPass/MacPass-Info.plist @@ -21,7 +21,7 @@ CFBundleSignature ???? CFBundleVersion - 201 + 2BF LSMinimumSystemVersion ${MACOSX_DEPLOYMENT_TARGET} NSHumanReadableCopyright diff --git a/MacPass/MainWindow.xib b/MacPass/MainWindow.xib index df42a85d..9bb3f927 100644 --- a/MacPass/MainWindow.xib +++ b/MacPass/MainWindow.xib @@ -37,7 +37,7 @@ 15 2 - {{196, 240}, {727, 630}} + {{196, 240}, {727, 449}} 544735232 Window NSWindow @@ -56,7 +56,7 @@ 268 - {256, 630} + {256, 449} @@ -67,24 +67,14 @@ 256 - {{257, 0}, {470, 630}} + {{257, 0}, {470, 449}} - YES - - subviews - - fade - - type - - - _NS:13 NSView - {727, 630} + {727, 449} @@ -93,12 +83,12 @@ 2 - {727, 630} + {727, 449} - {{0, 0}, {1680, 1028}} + {{0, 0}, {1920, 1058}} {400, 422} {10000000000000, 10000000000000} YES diff --git a/MacPass/SettingsWindow.xib b/MacPass/SettingsWindow.xib index 4901f8e6..3e04de8e 100644 --- a/MacPass/SettingsWindow.xib +++ b/MacPass/SettingsWindow.xib @@ -1,19 +1,19 @@ - 1070 - 11E53 - 2182 - 1138.47 - 569.00 + 1080 + 12C60 + 3084 + 1187.34 + 625.00 com.apple.InterfaceBuilder.CocoaPlugin - 2182 + 3084 - NSWindowTemplate - NSView NSCustomObject + NSView + NSWindowTemplate com.apple.InterfaceBuilder.CocoaPlugin @@ -35,7 +35,7 @@ 15 2 - {{196, 240}, {473, 232}} + {{196, 240}, {473, 263}} 544735232 Window NSWindow @@ -44,11 +44,12 @@ 256 - {473, 232} + + {473, 263} - {{0, 0}, {1680, 1050}} + {{0, 0}, {1920, 1058}} {10000000000000, 10000000000000} YES @@ -101,6 +102,7 @@ 2 + @@ -118,7 +120,7 @@ - 3 + 80