diff --git a/MacPass/Base.lproj/MainMenu.xib b/MacPass/Base.lproj/MainMenu.xib
index 14c56992..71331c71 100644
--- a/MacPass/Base.lproj/MainMenu.xib
+++ b/MacPass/Base.lproj/MainMenu.xib
@@ -788,11 +788,11 @@
@@ -1298,7 +1298,7 @@
- 1232
+ 1233
@@ -1357,18 +1357,18 @@
MPDocumentWindowController
NSWindowController
- id
id
+ id
-
- documentSettings:
- id
-
editPassword:
id
+
+ showDocumentSettings:
+ id
+
splitView
diff --git a/MacPass/DocumentSettingsWindow.xib b/MacPass/DocumentSettingsWindow.xib
index 80c1d39e..2519f4a8 100644
--- a/MacPass/DocumentSettingsWindow.xib
+++ b/MacPass/DocumentSettingsWindow.xib
@@ -21,12 +21,15 @@
NSPathControl
NSPopUpButton
NSPopUpButtonCell
+ NSScrollView
+ NSScroller
NSStepper
NSStepperCell
NSTabView
NSTabViewItem
NSTextField
NSTextFieldCell
+ NSTextView
NSView
NSWindowTemplate
@@ -57,19 +60,17 @@
-
+
256
-
+
268
{{378, 13}, {75, 32}}
-
-
_NS:9
YES
-
+
67108864
134217728
Close
@@ -79,7 +80,7 @@
1044
_NS:9
-
+
-2038284288
129
@@ -89,44 +90,40 @@
NO
-
+
12
{{13, 41}, {441, 246}}
-
-
_NS:9
-
+
1
-
-
+
+
256
-
-
+
+
268
- {{136, 25}, {210, 113}}
-
-
-
+ {{136, 148}, {210, 22}}
+
+
_NS:9
- {250, 750}
YES
-
- -1805647871
- 272629760
+
+ -1804599231
+ 272630784
_NS:9
-
+
YES
6
System
textBackgroundColor
-
+
3
MQA
@@ -143,35 +140,12 @@
NO
-
-
- 268
- {{136, 148}, {210, 22}}
-
-
-
- _NS:9
- YES
-
- -1804599231
- 272630784
-
-
- _NS:9
-
- YES
-
-
-
- NO
-
-
+
268
{{50, 121}, {81, 17}}
-
-
-
+
+
_NS:1535
YES
@@ -185,7 +159,7 @@
6
System
controlColor
-
+
3
MC42NjY2NjY2NjY3AA
@@ -200,11 +174,10 @@
NO
-
+
268
{{25, 151}, {106, 17}}
-
-
+
_NS:1535
YES
@@ -220,76 +193,213 @@
NO
+
+
+ 256
+
+
+
+ 2304
+
+
+
+ 2322
+ {208, 121}
+
+
+ _NS:13
+
+
+
+
+
+
+
+
+
+
+
+ 166
+
+
+
+ 208
+ 1
+
+
+ 100667267
+ 0
+
+
+
+
+ 6
+ System
+ selectedTextBackgroundColor
+
+
+
+ 6
+ System
+ selectedTextColor
+
+
+
+
+
+
+ 1
+ MCAwIDEAA
+
+
+ {8, -8}
+ 13
+
+
+
+
+
+ 2
+
+ 6
+ {463, 10000000}
+
+
+
+ {{1, 1}, {208, 121}}
+
+
+ _NS:11
+
+
+
+ {4, 5}
+
+ 79691776
+
+
+
+
+
+ file://localhost/Applications/Xcode.app/Contents/SharedFrameworks/DVTKit.framework/Resources/DVTIbeamCursor.tiff
+
+
+
+
+ 3
+ MCAwAA
+
+
+
+ 4
+
+
+
+ 256
+ {{193, 1}, {16, 121}}
+
+ _NS:83
+ NO
+
+ _doScroller:
+ 0.99242424242424243
+
+
+
+ -2147483392
+ {{-100, -100}, {87, 18}}
+
+
+ _NS:33
+ NO
+ 1
+
+ _doScroller:
+ 1
+ 0.94565218687057495
+
+
+ {{136, 17}, {210, 123}}
+
+
+ _NS:9
+ 133138
+
+
+
+ 0.25
+ 4
+ 1
+
{{10, 33}, {421, 200}}
-
-
+
_NS:11
General
-
+
-
-
+
+
256
-
-
+
+
268
{{69, 119}, {68, 17}}
-
-
+
+
_NS:1535
YES
-
+
68157504
272630784
Password:
_NS:1535
-
+
NO
-
-
+
+
268
{{142, 117}, {164, 22}}
-
-
+
+
_NS:9
YES
-
+
-1804599231
272630784
_NS:9
-
+
YES
NO
-
-
+
+
268
Apple URL pasteboard type
NSFilenamesPboardType
{{139, 88}, {170, 22}}
-
-
+
+
_NS:9
YES
-
+
337641473
131072
@@ -302,14 +412,14 @@
3100
_NS:9
-
+
67108928
132096
Leopard
-
+
@@ -322,7 +432,7 @@
132096
Applications
-
+
@@ -332,25 +442,25 @@
2
-
+
NO
-
-
+
+
268
{{86, 92}, {51, 17}}
-
-
+
+
_NS:1535
YES
-
+
68157504
272630784
Keyfile:
_NS:1535
-
+
@@ -358,39 +468,39 @@
{{10, 33}, {421, 200}}
-
+
Protection
-
+
-
-
+
+
256
-
-
+
+
268
{{138, 154}, {98, 18}}
-
-
+
+
_NS:9
YES
-
+
-2080374784
268435456
Protect Title
_NS:9
-
+
1211912448
2
-
+
NSImage
NSSwitch
-
+
NSSwitch
@@ -400,25 +510,25 @@
NO
-
-
+
+
268
{{138, 125}, {133, 18}}
-
-
+
+
_NS:9
YES
-
+
-2080374784
268435456
Protect Username
_NS:9
-
+
1211912448
2
-
-
+
+
200
@@ -426,25 +536,25 @@
NO
-
-
+
+
268
{{138, 96}, {130, 18}}
-
-
+
+
_NS:9
YES
-
+
-2080374784
268435456
Protect Password
_NS:9
-
+
1211912448
2
-
-
+
+
200
@@ -452,25 +562,25 @@
NO
-
-
+
+
268
{{138, 67}, {95, 18}}
-
-
+
+
_NS:9
YES
-
+
-2080374784
268435456
Protect URL
_NS:9
-
+
1211912448
2
-
-
+
+
200
@@ -478,25 +588,25 @@
NO
-
-
+
+
268
{{138, 38}, {107, 18}}
-
-
+
+
_NS:9
YES
-
+
-2080374784
268435456
Protect Notes
_NS:9
-
+
1211912448
2
-
-
+
+
200
@@ -506,36 +616,36 @@
{{10, 33}, {421, 200}}
-
+
Display
-
+
-
-
+
+
256
-
-
+
+
268
{{15, 154}, {149, 18}}
-
-
+
+
_NS:9
YES
-
+
-2080374784
268435456
Enable Entry History
_NS:9
-
+
1211912448
2
-
-
+
+
200
@@ -543,25 +653,25 @@
NO
-
-
+
+
268
{{15, 55}, {138, 18}}
-
-
+
+
_NS:9
YES
-
+
-2080374784
268435456
Enable Recycle Bin
_NS:9
-
+
1211912448
2
-
-
+
+
200
@@ -569,25 +679,25 @@
NO
-
-
+
+
268
{{43, 35}, {187, 18}}
-
-
+
+
_NS:9
YES
-
+
-2080374784
268435456
Empty Recycle Bin on Quit
_NS:9
-
+
1211912448
2
-
-
+
+
200
@@ -595,110 +705,110 @@
NO
-
-
+
+
268
{{42, 131}, {94, 17}}
-
-
+
+
_NS:1535
YES
-
+
68157504
272630784
Maxium Items
_NS:1535
-
+
NO
-
-
+
+
268
{{42, 106}, {142, 17}}
-
-
+
+
_NS:1535
YES
-
+
68157504
272630784
Maintainance Intervall
_NS:1535
-
+
NO
-
{{10, 33}, {421, 200}}
-
+
Advanced
-
+
-
+
0
YES
YES
-
+
{467, 293}
-
-
-
+
{{0, 0}, {1920, 1058}}
{10000000000000, 10000000000000}
@@ -793,10 +901,82 @@
saveChanges:
-
+
296
+
+
+ databaseNameTextField
+
+
+
+ 655
+
+
+
+ passwordTextField
+
+
+
+ 658
+
+
+
+ keyfilePathControl
+
+
+
+ 659
+
+
+
+ protectTitleCheckButton
+
+
+
+ 660
+
+
+
+ protectUserNameCheckButton
+
+
+
+ 661
+
+
+
+ protectPasswortCheckButton
+
+
+
+ 662
+
+
+
+ protectURLCheckButton
+
+
+
+ 663
+
+
+
+ databaseDescriptionTextView
+
+
+
+ 676
+
+
+
+ protectNotesCheckButton
+
+
+
+ 677
+
@@ -836,11 +1016,11 @@
2
-
-
+
+
3
0
-
+
4
1
@@ -856,7 +1036,7 @@
4
0
-
+
4
1
@@ -872,7 +1052,7 @@
6
0
-
+
6
1
@@ -884,8 +1064,8 @@
29
3
-
-
+
+
3
0
@@ -900,11 +1080,11 @@
40
3
-
+
6
0
-
+
6
1
@@ -917,7 +1097,7 @@
3
-
+
5
0
@@ -932,23 +1112,23 @@
29
3
-
-
+
+
288
-
+
-
+
289
-
-
+
+
290
@@ -957,29 +1137,77 @@
357
-
+
-
-
-
-
+
+
+
+
358
-
+
-
+
-
+
361
-
+
+
+
+ 4
+ 0
+
+ 4
+ 1
+
+ 17
+
+ 1000
+
+ 8
+ 29
+ 3
+
+
+
+ 6
+ 0
+
+ 6
+ 1
+
+ 0.0
+
+ 1000
+
+ 6
+ 24
+ 2
+
+
+
+ 5
+ 0
+
+ 5
+ 1
+
+ 0.0
+
+ 1000
+
+ 6
+ 24
+ 2
+
-
+
5
0
@@ -989,28 +1217,28 @@
8
1000
-
+
6
24
3
-
-
+
+
3
0
4
1
- 10
+ 8
1000
-
- 9
- 40
+
+ 6
+ 24
3
-
+
5
0
@@ -1021,92 +1249,60 @@
8
1000
-
+
6
24
3
-
-
- 5
- 0
-
- 5
- 1
-
- 0.0
-
- 1000
-
- 6
- 24
- 2
-
-
-
- 6
- 0
-
- 6
- 1
-
- 0.0
-
- 1000
-
- 6
- 24
- 2
-
-
+
3
0
-
+
3
1
30
1000
-
+
9
40
3
-
+
3
0
-
+
3
1
- 0.0
+ 62
1000
-
- 6
- 24
- 2
+
+ 3
+ 9
+ 3
-
+
5
0
-
+
5
1
28
1000
-
+
3
9
3
-
+
10
0
@@ -1117,528 +1313,499 @@
0.0
1000
-
+
6
24
2
-
+
-
+
368
-
+
-
+
-
+
369
-
+
-
-
-
+
+
+
5
0
-
+
6
1
8
1000
-
+
6
24
3
-
-
+
+
3
0
-
+
3
1
0.0
1000
-
+
6
24
2
-
-
+
+
6
0
-
+
6
1
0.0
1000
-
+
6
24
2
-
-
+
+
10
0
-
+
10
1
0.0
1000
-
+
6
24
2
-
-
+
+
5
0
-
+
6
1
8
1000
-
+
6
24
3
-
+
11
0
-
+
11
1
0.0
1000
-
+
6
24
2
-
-
+
+
5
0
-
+
5
1
0.0
1000
-
+
6
24
2
-
-
+
+
4
0
-
+
4
1
37
1000
-
+
3
9
3
-
-
+
+
3
0
-
+
4
1
6
1000
-
+
6
24
3
-
-
+
+
5
0
-
+
5
1
17
1000
-
+
8
29
3
-
-
+
+
3
0
-
+
4
1
8
1000
-
+
6
24
3
-
-
+
+
5
0
-
+
5
1
0.0
1000
-
+
6
24
2
-
-
+
+
5
0
-
+
5
1
0.0
1000
-
+
6
24
2
-
-
+
+
3
0
-
+
4
1
8
1000
-
+
6
24
3
-
-
+
+
9
0
-
+
9
1
0.0
1000
-
+
6
24
2
-
-
+
+
5
0
-
+
5
1
17
1000
-
+
8
29
3
-
-
+
+
3
0
-
+
3
1
30
1000
-
+
9
40
3
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
+
370
-
+
-
+
-
+
371
-
+
-
-
+
+
3
0
-
+
4
1
15
1000
-
+
9
40
3
-
-
+
+
5
0
-
+
5
1
0.0
1000
-
+
6
24
2
-
-
+
+
3
0
-
+
4
1
15
1000
-
+
9
40
3
-
-
+
+
5
0
-
+
5
1
0.0
1000
-
+
6
24
2
-
-
+
+
3
0
-
+
3
1
88
1000
-
+
3
9
3
-
-
+
+
5
0
-
+
5
1
0.0
1000
-
+
6
24
2
-
-
+
+
3
0
-
+
3
1
59
1000
-
+
3
9
3
-
-
+
+
3
0
-
+
3
1
30
1000
-
+
3
9
3
-
-
+
+
5
0
-
+
5
1
0.0
1000
-
+
6
24
2
-
-
+
+
5
0
-
+
5
1
140
1000
-
+
3
9
3
-
-
-
-
-
+
+
+
+
+
-
-
-
- 247
-
-
-
-
- 8
- 0
-
- 0
- 1
-
- 113
-
- 1000
-
- 3
- 9
- 1
-
-
-
-
-
-
- 248
-
-
+
231
-
+
7
0
@@ -1655,7 +1822,7 @@
1
-
+
232
@@ -1668,7 +1835,7 @@
-
+
257
@@ -1681,7 +1848,7 @@
-
+
190
@@ -1695,212 +1862,182 @@
374
-
+
425
-
+
435
-
-
-
-
- 436
-
-
-
-
- 437
-
-
+
+
434
-
-
-
-
- 438
-
-
-
-
- 454
-
-
-
-
- 455
-
-
+
+
457
-
-
-
-
- 458
-
-
+
+
462
-
-
+
+
463
-
+
-
+
-
+
464
-
-
+
+
476
-
+
-
+
-
+
477
-
-
+
+
490
-
-
+
+
504
-
+
-
+
-
+
505
-
-
+
+
506
-
-
+
+
509
-
+
-
+
-
+
510
-
-
+
+
511
-
-
+
+
513
-
+
-
+
-
+
514
-
-
+
+
516
-
-
+
+
525
-
-
+
+
529
-
-
+
+
531
-
+
-
+
-
+
532
-
-
+
+
533
-
-
+
+
534
-
-
+
+
535
-
+
-
+
-
+
536
-
-
+
+
538
-
-
+
+
539
-
+
-
+
-
+
540
-
-
+
+
291
@@ -1909,128 +2046,128 @@
390
-
+
552
-
-
+
+
557
-
+
-
+
-
+
558
-
-
+
+
561
-
-
+
+
562
-
-
+
+
564
-
+
-
+
-
+
565
-
-
+
+
566
-
-
+
+
567
-
-
+
+
568
-
-
+
+
579
-
+
-
+
-
+
581
-
+
-
+
-
+
582
-
+
-
-
-
+
+
+
-
+
583
-
-
+
+
584
-
-
+
+
585
-
-
+
+
586
-
-
+
+
587
-
-
+
+
591
-
+
593
-
+
-
-
-
+
+
+
7
0
@@ -2040,265 +2177,265 @@
96
1000
-
+
3
9
1
-
+
594
-
-
+
+
595
-
-
+
+
596
-
-
+
+
598
-
+
599
-
+
-
+
-
+
600
-
-
+
+
601
-
-
+
+
602
-
-
+
+
603
-
-
+
+
527
-
-
+
+
521
-
-
+
+
520
-
-
+
+
488
-
-
+
+
619
-
+
-
+
-
+
620
-
+
-
-
+
+
5
0
-
+
6
1
8
1000
-
+
6
24
3
-
-
+
+
6
0
-
+
6
1
0.0
1000
-
+
6
24
2
-
-
+
+
3
0
-
+
4
1
8
1000
-
+
6
24
3
-
-
+
+
5
0
-
+
5
1
0.0
1000
-
+
6
24
2
-
-
+
+
3
0
-
+
3
1
61
1000
-
+
3
9
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
-
+
5
1
72
1000
-
+
3
9
3
-
-
-
-
+
+
+
+
-
+
621
-
+
-
+
-
+
622
-
-
+
+
625
-
+
-
-
-
+
+
+
7
0
@@ -2308,99 +2445,154 @@
164
1000
-
+
3
9
1
-
+
626
-
-
+
+
634
-
-
+
+
635
-
-
+
+
636
-
-
+
+
637
-
-
+
+
638
-
+
-
+
-
+
639
-
-
+
+
646
-
-
+
+
647
-
-
+
+
648
-
-
+
+
649
-
-
+
+
650
-
+
-
+
-
+
651
-
-
+
+
652
-
-
+
+
653
-
-
+
+
556
-
-
+
+
+
+
+ 657
+
+
+
+
+ 665
+
+
+
+
+
+
+
+
+
+ 666
+
+
+
+
+ 667
+
+
+
+
+ 668
+
+
+
+
+ 671
+
+
+
+
+ 672
+
+
+
+
+ 673
+
+
+
+
+ 674
+
+
+
+
+ 675
+
+
@@ -2416,25 +2608,19 @@
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
@@ -2447,51 +2633,52 @@
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
@@ -2499,13 +2686,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
- com.apple.InterfaceBuilder.CocoaPlugin
com.apple.InterfaceBuilder.CocoaPlugin
com.apple.InterfaceBuilder.CocoaPlugin
@@ -2568,7 +2749,7 @@
com.apple.InterfaceBuilder.CocoaPlugin
com.apple.InterfaceBuilder.CocoaPlugin
-
+
com.apple.InterfaceBuilder.CocoaPlugin
@@ -2584,22 +2765,22 @@
com.apple.InterfaceBuilder.CocoaPlugin
com.apple.InterfaceBuilder.CocoaPlugin
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
com.apple.InterfaceBuilder.CocoaPlugin
com.apple.InterfaceBuilder.CocoaPlugin
com.apple.InterfaceBuilder.CocoaPlugin
-
+
com.apple.InterfaceBuilder.CocoaPlugin
@@ -2620,44 +2801,25 @@
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
- 654
-
-
-
-
- MPDocumentSettingsWindowController
- NSWindowController
-
- saveChanges:
- id
-
-
- saveChanges:
-
- saveChanges:
- id
-
-
-
- IBProjectSource
- ./Classes/MPDocumentSettingsWindowController.h
-
-
-
- NSLayoutConstraint
- NSObject
-
- IBProjectSource
- ./Classes/NSLayoutConstraint.h
-
-
-
+ 677
+
0
IBCocoaFramework
YES
diff --git a/MacPass/MPConstants.h b/MacPass/MPConstants.h
index 69c418ab..d3134db3 100644
--- a/MacPass/MPConstants.h
+++ b/MacPass/MPConstants.h
@@ -12,5 +12,6 @@
#import
FOUNDATION_EXPORT NSString *const MPPasteBoardType;
+FOUNDATION_EXPORT NSString *const MPErrorDomain;
#endif
diff --git a/MacPass/MPConstants.m b/MacPass/MPConstants.m
index a4c3e061..d5e12304 100644
--- a/MacPass/MPConstants.m
+++ b/MacPass/MPConstants.m
@@ -8,4 +8,5 @@
#import "MPConstants.h"
-NSString *const MPPasteBoardType = @"com.hicknhack.macpass.pasteboard";
+NSString *const MPPasteBoardType = @"com.hicknhack.macpass.pasteboard";
+NSString *const MPErrorDomain = @"com.hicknhack.macpass.error";
\ No newline at end of file
diff --git a/MacPass/MPDocumentSettingsWindowController.h b/MacPass/MPDocumentSettingsWindowController.h
index 8e81306d..d6d6c269 100644
--- a/MacPass/MPDocumentSettingsWindowController.h
+++ b/MacPass/MPDocumentSettingsWindowController.h
@@ -8,8 +8,26 @@
#import
+@class MPDocument;
+
@interface MPDocumentSettingsWindowController : NSWindowController
+/* General */
+@property (assign) IBOutlet NSTextField *databaseNameTextField;
+@property (assign) IBOutlet NSTextView *databaseDescriptionTextView;
+/* Protection */
+@property (assign) IBOutlet NSTextField *passwordTextField;
+@property (assign) IBOutlet NSPathControl *keyfilePathControl;
+
+/* Display */
+@property (assign) IBOutlet NSButton *protectTitleCheckButton;
+@property (assign) IBOutlet NSButton *protectUserNameCheckButton;
+@property (assign) IBOutlet NSButton *protectPasswortCheckButton;
+@property (assign) IBOutlet NSButton *protectURLCheckButton;
+@property (assign) IBOutlet NSButton *protectNotesCheckButton;
+
+- (id)initWithDocument:(MPDocument *)document;
+
- (IBAction)saveChanges:(id)sender;
@end
diff --git a/MacPass/MPDocumentSettingsWindowController.m b/MacPass/MPDocumentSettingsWindowController.m
index 60fa333c..f13586c3 100644
--- a/MacPass/MPDocumentSettingsWindowController.m
+++ b/MacPass/MPDocumentSettingsWindowController.m
@@ -7,56 +7,47 @@
//
#import "MPDocumentSettingsWindowController.h"
+#import "MPDocument.h"
+#import "MPDatabaseVersion.h"
+#import "Kdb4Node.h"
-@interface MPDocumentSettingsWindowController ()
+@interface MPDocumentSettingsWindowController () {
+ MPDocument *_document;
+}
@end
@implementation MPDocumentSettingsWindowController
- (id)init {
- return [self initWithWindowNibName:@"DocumentSettingsWindow"];
+ return [self initWithDocument:nil];
}
-- (id)initWithWindow:(NSWindow *)window {
- self = [super initWithWindow:window];
- if (self) {
-// @property(nonatomic, copy) NSString *databaseName;
-// @property(nonatomic, retain) NSDate *databaseNameChanged;
-// @property(nonatomic, copy) NSString *databaseDescription;
-// @property(nonatomic, retain) NSDate *databaseDescriptionChanged;
-// @property(nonatomic, copy) NSString *defaultUserName;
-// @property(nonatomic, retain) NSDate *defaultUserNameChanged;
-//
-// @property(nonatomic, assign) NSInteger maintenanceHistoryDays;
-//
-// @property(nonatomic, copy) NSString *color;
-//
-// @property(nonatomic, retain) NSDate *masterKeyChanged;
-// @property(nonatomic, assign) NSInteger masterKeyChangeRec;
-// @property(nonatomic, assign) NSInteger masterKeyChangeForce;
-//
-// @property(nonatomic, assign) BOOL protectTitle;
-// @property(nonatomic, assign) BOOL protectUserName;
-// @property(nonatomic, assign) BOOL protectPassword;
-// @property(nonatomic, assign) BOOL protectUrl;
-// @property(nonatomic, assign) BOOL protectNotes;
-//
-// @property(nonatomic, readonly) NSMutableArray *customIcons;
-// @property(nonatomic, assign) BOOL recycleBinEnabled;
-// @property(nonatomic, retain) UUID *recycleBinUuid;
-// @property(nonatomic, retain) NSDate *recycleBinChanged;
-// @property(nonatomic, retain) UUID *entryTemplatesGroup;
-// @property(nonatomic, retain) NSDate *entryTemplatesGroupChanged;
-// @property(nonatomic, assign) NSInteger historyMaxItems;
-// @property(nonatomic, assign) NSInteger historyMaxSize;
-// @property(nonatomic, retain) UUID *lastSelectedGroup;
-// @property(nonatomic, retain) UUID *lastTopVisibleGroup;
-// @property(nonatomic, readonly) NSMutableArray *binaries;
-// @property(nonatomic, readonly) NSMutableArray *customData;
- }
+- (id)initWithDocument:(MPDocument *)document {
+ self = [super initWithWindowNibName:@"DocumentSettingsWindow"];
+ if(self) {
+ _document = document;
+ }
+ return self;
+}
+
+- (void)windowDidLoad {
+ [super windowDidLoad];
+ NSAssert(_document != nil, @"Document needs to be present");
+ if( _document.version == MPDatabaseVersion4 ) {
+ Kdb4Tree *tree = (Kdb4Tree *)_document.tree;
+ [self.databaseNameTextField bind:NSValueBinding toObject:tree withKeyPath:@"databaseName" options:nil];
+ [self.databaseDescriptionTextView bind:NSValueBinding toObject:tree withKeyPath:@"databaseDescription" options:nil];
- return self;
+ [self.protectNotesCheckButton bind:NSValueBinding toObject:tree withKeyPath:@"protectNotes" options:nil];
+ [self.protectPasswortCheckButton bind:NSValueBinding toObject:tree withKeyPath:@"protectPassword" options:nil];
+ [self.protectTitleCheckButton bind:NSValueBinding toObject:tree withKeyPath:@"protectTitle" options:nil];
+ [self.protectURLCheckButton bind:NSValueBinding toObject:tree withKeyPath:@"protectUrl" options:nil];
+ [self.protectUserNameCheckButton bind:NSValueBinding toObject:tree withKeyPath:@"protectUserName" options:nil];
+ }
+ else {
+ // Switch to KdbV3 View
+ }
}
- (void)saveChanges:(id)sender {
diff --git a/MacPass/MPDocumentWindowController.h b/MacPass/MPDocumentWindowController.h
index 1e01b5e8..78e8622f 100644
--- a/MacPass/MPDocumentWindowController.h
+++ b/MacPass/MPDocumentWindowController.h
@@ -39,7 +39,7 @@ APPKIT_EXTERN NSString *const MPCurrentItemChangedNotification;
- (void)showPasswordInput;
- (void)performFindPanelAction:(id)sender;
- (IBAction)editPassword:(id)sender;
-- (IBAction)documentSettings:(id)sender;
+- (IBAction)showDocumentSettings:(id)sender;
- (void)lock:(id)sender;
- (void)createGroup:(id)sender;
diff --git a/MacPass/MPDocumentWindowController.m b/MacPass/MPDocumentWindowController.m
index cb9e91c0..5c67b0a9 100644
--- a/MacPass/MPDocumentWindowController.m
+++ b/MacPass/MPDocumentWindowController.m
@@ -17,6 +17,7 @@
#import "MPAppDelegate.h"
#import "MPActionHelper.h"
#import "MPDocumentSettingsWindowController.h"
+#import "MPConstants.h"
NSString *const MPCurrentItemChangedNotification = @"com.hicknhack.macpass.MPCurrentItemChangedNotification";
@@ -64,7 +65,7 @@ NSString *const MPCurrentItemChangedNotification = @"com.hicknhack.macpass.MPCur
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
-
+
[_toolbar release];
[_passwordInputController release];
@@ -80,7 +81,7 @@ NSString *const MPCurrentItemChangedNotification = @"com.hicknhack.macpass.MPCur
#pragma mark View Handling
- (void)windowDidLoad {
-
+
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_didRevertDocument:) name:MPDocumentDidRevertNotifiation object:[self document]];
[_entryViewController setupNotifications:self];
@@ -151,7 +152,7 @@ NSString *const MPCurrentItemChangedNotification = @"com.hicknhack.macpass.MPCur
#pragma mark Notification handling
- (void)_updateCurrentItem:(NSNotification *)notification {
id sender = [notification object];
-
+
self.currentGroup = _outlineViewController.selectedGroup;
self.currentEntry = _entryViewController.selectedEntry;
@@ -219,9 +220,9 @@ NSString *const MPCurrentItemChangedNotification = @"com.hicknhack.macpass.MPCur
[self _setContentViewController:self.passwordEditController];
}
-- (void)documentSettings:(id)sender {
+- (void)showDocumentSettings:(id)sender {
if(!self.documentSettingsWindowController) {
- _documentSettingsWindowController = [[MPDocumentSettingsWindowController alloc] init];
+ _documentSettingsWindowController = [[MPDocumentSettingsWindowController alloc] initWithDocument:[self document]];
}
[[NSApplication sharedApplication] beginSheet:[_documentSettingsWindowController window] modalForWindow:[self window] modalDelegate:nil didEndSelector:NULL contextInfo:NULL];
}
@@ -279,7 +280,7 @@ NSString *const MPCurrentItemChangedNotification = @"com.hicknhack.macpass.MPCur
/*
The current easy way to prevent layout hickups is to add the inspect
Add all neded contraints an then remove it again, if it was hidden
- */
+ */
BOOL removeInspector = NO;
if(![inspectorView superview]) {
[_splitView addSubview:inspectorView];
diff --git a/MacPass/MPPasswordInputController.m b/MacPass/MPPasswordInputController.m
index 3c0b1c95..b066d2e7 100644
--- a/MacPass/MPPasswordInputController.m
+++ b/MacPass/MPPasswordInputController.m
@@ -45,6 +45,7 @@
}
- (void)requestPassword {
+ // show Warnign if read-only mode!
[self _reset];
}
diff --git a/MacPass/MacPass-Info.plist b/MacPass/MacPass-Info.plist
index 1534fefb..37a508b6 100644
--- a/MacPass/MacPass-Info.plist
+++ b/MacPass/MacPass-Info.plist
@@ -48,7 +48,7 @@
CFBundleSignature
????
CFBundleVersion
- 1289
+ 1324
LSMinimumSystemVersion
${MACOSX_DEPLOYMENT_TARGET}
NSHumanReadableCopyright