mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-17 02:49:23 +00:00
Fixed regression in Preferences preventing willShowTab and didShowTab from being called.
This commit is contained in:
@@ -52,6 +52,18 @@
|
|||||||
|
|
||||||
self.contentViewController = self.tabViewController;
|
self.contentViewController = self.tabViewController;
|
||||||
|
|
||||||
|
_tabViewController.willSelectTabHandler = ^void(NSTabViewItem *item) {
|
||||||
|
if([item.viewController respondsToSelector:@selector(willShowTab)]) {
|
||||||
|
[(id<MPPreferencesTab>)item.viewController willShowTab];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
_tabViewController.didSelectTabHandler = ^void(NSTabViewItem *item) {
|
||||||
|
if([item.viewController respondsToSelector:@selector(didShowTab)]) {
|
||||||
|
[(id<MPPreferencesTab>)item.viewController didShowTab];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
[self _setupDefaultPreferencesTabs];
|
[self _setupDefaultPreferencesTabs];
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
|
|||||||
@@ -12,6 +12,9 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
|
|
||||||
@interface MPTabViewController : NSTabViewController
|
@interface MPTabViewController : NSTabViewController
|
||||||
|
|
||||||
|
@property (nonatomic, copy, nullable) void (^willSelectTabHandler)(NSTabViewItem *item);
|
||||||
|
@property (nonatomic, copy, nullable) void (^didSelectTabHandler)(NSTabViewItem *item);
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
NS_ASSUME_NONNULL_END
|
||||||
|
|||||||
@@ -33,6 +33,9 @@
|
|||||||
- (void)tabView:(NSTabView *)tabView didSelectTabViewItem:(NSTabViewItem *)tabViewItem {
|
- (void)tabView:(NSTabView *)tabView didSelectTabViewItem:(NSTabViewItem *)tabViewItem {
|
||||||
[super tabView:tabView didSelectTabViewItem:tabViewItem];
|
[super tabView:tabView didSelectTabViewItem:tabViewItem];
|
||||||
[self _resizeWindowToFitTabView:tabViewItem];
|
[self _resizeWindowToFitTabView:tabViewItem];
|
||||||
|
if(self.didSelectTabHandler) {
|
||||||
|
self.didSelectTabHandler(tabViewItem);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)tabView:(NSTabView *)tabView willSelectTabViewItem:(NSTabViewItem *)tabViewItem {
|
- (void)tabView:(NSTabView *)tabView willSelectTabViewItem:(NSTabViewItem *)tabViewItem {
|
||||||
@@ -40,6 +43,10 @@
|
|||||||
if(tabViewItem.view) {
|
if(tabViewItem.view) {
|
||||||
self.tabViewSizes[tabViewItem.identifier] = @(tabViewItem.view.frame.size);
|
self.tabViewSizes[tabViewItem.identifier] = @(tabViewItem.view.frame.size);
|
||||||
}
|
}
|
||||||
|
if(self.willSelectTabHandler) {
|
||||||
|
self.willSelectTabHandler(tabViewItem);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -63,6 +63,8 @@
|
|||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>UNDEFINED</string>
|
<string>UNDEFINED</string>
|
||||||
|
<key>LSApplicationCategoryType</key>
|
||||||
|
<string>public.app-category.productivity</string>
|
||||||
<key>LSMinimumSystemVersion</key>
|
<key>LSMinimumSystemVersion</key>
|
||||||
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
|
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
|
||||||
<key>MPHelpURL</key>
|
<key>MPHelpURL</key>
|
||||||
@@ -77,16 +79,16 @@
|
|||||||
<string>MacPass accesses the Documents folder to load and save your databases and/or key files there</string>
|
<string>MacPass accesses the Documents folder to load and save your databases and/or key files there</string>
|
||||||
<key>NSDownloadsFolderUsageDescription</key>
|
<key>NSDownloadsFolderUsageDescription</key>
|
||||||
<string>MacPass accesses the Downloads folder to load and save your databases and/or key files there</string>
|
<string>MacPass accesses the Downloads folder to load and save your databases and/or key files there</string>
|
||||||
<key>NSNetworkVolumesUsageDescription</key>
|
|
||||||
<string>MacPass need access to Network Volumes to load and save your databases and/or key files there</string>
|
|
||||||
<key>NSRemovableVolumesUsageDescription</key>
|
|
||||||
<string>MacPass need access to Removable Volumes to load and save your databases and/or key files there</string>
|
|
||||||
<key>NSHumanReadableCopyright</key>
|
<key>NSHumanReadableCopyright</key>
|
||||||
<string>Copyright © 2012-2020 HicknHack Software GmbH. All rights reserved.</string>
|
<string>Copyright © 2012-2020 HicknHack Software GmbH. All rights reserved.</string>
|
||||||
<key>NSMainNibFile</key>
|
<key>NSMainNibFile</key>
|
||||||
<string>MainMenu</string>
|
<string>MainMenu</string>
|
||||||
|
<key>NSNetworkVolumesUsageDescription</key>
|
||||||
|
<string>MacPass need access to Network Volumes to load and save your databases and/or key files there</string>
|
||||||
<key>NSPrincipalClass</key>
|
<key>NSPrincipalClass</key>
|
||||||
<string>NSApplication</string>
|
<string>NSApplication</string>
|
||||||
|
<key>NSRemovableVolumesUsageDescription</key>
|
||||||
|
<string>MacPass need access to Removable Volumes to load and save your databases and/or key files there</string>
|
||||||
<key>NSSupportsAutomaticGraphicsSwitching</key>
|
<key>NSSupportsAutomaticGraphicsSwitching</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>NSUserNotificationAlertStyle</key>
|
<key>NSUserNotificationAlertStyle</key>
|
||||||
|
|||||||
Reference in New Issue
Block a user