Option to export selected items
This commit is contained in:
@@ -14,6 +14,7 @@ and this project does NOT adhere to [Semantic Versioning](https://semver.org/spe
|
||||
- Settings, Feeds: Right click menu with edit actions
|
||||
- Settings, Feeds: Drag & Drop feeds from / to OPML file
|
||||
- Settings, Feeds: Drag & Drop feed titles and urls as text
|
||||
- Settings, Feeds: OPML export with selected items only
|
||||
- Accessibility hints for most UI elements
|
||||
- Associate OPML files (double click and right click actions in Finder)
|
||||
|
||||
|
||||
@@ -68,8 +68,6 @@
|
||||
[self reopenPreferencesIfOpen];
|
||||
}];
|
||||
}
|
||||
// TODO: handle other app schemes like configuration export / import
|
||||
// NSURLComponents *comp = [NSURLComponents componentsWithString:url];
|
||||
}
|
||||
|
||||
/// Handle opml file imports
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>9639</string>
|
||||
<string>9654</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
|
||||
<key>LSUIElement</key>
|
||||
|
||||
@@ -212,14 +212,24 @@ NS_INLINE NSInteger RadioGroupSelection(NSView *view) {
|
||||
sp.nameFieldStringValue = [NSString stringWithFormat:@"baRSS feeds %@", [NSDate dayStringLocalized]];
|
||||
sp.allowedFileTypes = @[UTI_OPML];
|
||||
sp.allowsOtherFileTypes = YES;
|
||||
NSView *radioView = [NSView radioGroup:@[NSLocalizedString(@"Hierarchical", nil),
|
||||
NSLocalizedString(@"Flattened", nil)]];
|
||||
sp.accessoryView = [NSView wrapView:radioView withLabel:NSLocalizedString(@"Export format:", nil) padding:PAD_M];
|
||||
NSView *select = [NSView radioGroup:@[NSLocalizedString(@"Everything", nil),
|
||||
NSLocalizedString(@"Selection", nil)]];
|
||||
NSView *nested = [NSView radioGroup:@[NSLocalizedString(@"Hierarchical", nil),
|
||||
NSLocalizedString(@"Flattened", nil)]];
|
||||
NSView *v1 = [NSView wrapView:select withLabel:NSLocalizedString(@"Export:", nil) padding:PAD_M];
|
||||
NSView *v2 = [NSView wrapView:nested withLabel:NSLocalizedString(@"Format:", nil) padding:PAD_M];
|
||||
NSView *final = [[NSView alloc] init];
|
||||
[v1 placeIn:final x:0 yTop:0];
|
||||
[v2 placeIn:final x:NSWidth(v1.frame) + 100 yTop:0];
|
||||
[final setFrameSize:NSMakeSize(NSMaxX(v2.frame), NSHeight(v2.frame))];
|
||||
sp.accessoryView = final;
|
||||
|
||||
[sp beginSheetModalForWindow:window completionHandler:^(NSModalResponse result) {
|
||||
if (result == NSModalResponseOK) {
|
||||
OpmlFileExportOptions opt = OpmlFileExportOptionFullBackup;
|
||||
if (RadioGroupSelection(radioView) == 1)
|
||||
OpmlFileExportOptions opt = 0;
|
||||
if (RadioGroupSelection(select) == 0)
|
||||
opt |= OpmlFileExportOptionFullBackup;
|
||||
if (RadioGroupSelection(nested) == 1)
|
||||
opt |= OpmlFileExportOptionFlattened;
|
||||
[self writeOPMLFile:sp.URL withOptions:opt];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user