Skip to content

Commit

Permalink
Merge pull request #203 from SubmarinerApp/picker-inspector
Browse files Browse the repository at this point in the history
Inspector improvements
  • Loading branch information
NattyNarwhal authored Apr 8, 2024
2 parents a1d05d0 + 1c8dcbe commit e134238
Show file tree
Hide file tree
Showing 10 changed files with 333 additions and 106 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ Doing so isn't fatal (it's not a secret), but it is annoying for other contribut

## Release Notes

### Not yet released

* Inspector window has been improved
* You can now switch between now playing and current selection with a tab view.
* Playlist information can be viewed and edited.

### Version 3.1 for Workgroups

* Artists, albums, and tracks can be favourited ("starred" in Subsonic parlance; we use a heart to avoid being confused with ratings).
Expand Down
12 changes: 12 additions & 0 deletions Submariner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@
3EC5A6452A019B5C00025812 /* SBRepeatModeButtonStateTransformer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EC5A6442A019B5C00025812 /* SBRepeatModeButtonStateTransformer.swift */; };
3ECF63FA280362BA004F9176 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3ECF63F9280362BA004F9176 /* Assets.xcassets */; };
3ED4C4D42AC0E25400649FB2 /* SBLibraryPurgeOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3ED4C4D32AC0E25400649FB2 /* SBLibraryPurgeOperation.swift */; };
3EF978022BC3C4E300C986E9 /* SBMessageTextView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EF978012BC3C4E300C986E9 /* SBMessageTextView.swift */; };
3EF978042BC4659B00C986E9 /* Binding+Nil.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EF978032BC4659B00C986E9 /* Binding+Nil.swift */; };
3EF978062BC49A9100C986E9 /* SBPropertyFieldView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EF978052BC49A9100C986E9 /* SBPropertyFieldView.swift */; };
4C4DE62413A200AD006A1EC1 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C4DE62213A200AA006A1EC1 /* Carbon.framework */; };
4C4DE62513A200AD006A1EC1 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C4DE62313A200AC006A1EC1 /* Security.framework */; };
4C56868514050B9A00BE3478 /* SBPodcastItemView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C56868414050B9A00BE3478 /* SBPodcastItemView.m */; };
Expand Down Expand Up @@ -254,6 +257,9 @@
3EC5A6442A019B5C00025812 /* SBRepeatModeButtonStateTransformer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SBRepeatModeButtonStateTransformer.swift; sourceTree = "<group>"; };
3ECF63F9280362BA004F9176 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
3ED4C4D32AC0E25400649FB2 /* SBLibraryPurgeOperation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SBLibraryPurgeOperation.swift; sourceTree = "<group>"; };
3EF978012BC3C4E300C986E9 /* SBMessageTextView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SBMessageTextView.swift; sourceTree = "<group>"; };
3EF978032BC4659B00C986E9 /* Binding+Nil.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Binding+Nil.swift"; sourceTree = "<group>"; };
3EF978052BC49A9100C986E9 /* SBPropertyFieldView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SBPropertyFieldView.swift; sourceTree = "<group>"; };
4C4DE62213A200AA006A1EC1 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = System/Library/Frameworks/Carbon.framework; sourceTree = SDKROOT; };
4C4DE62313A200AC006A1EC1 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
4C56868314050B9A00BE3478 /* SBPodcastItemView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SBPodcastItemView.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -517,6 +523,8 @@
3E94E5F92915AB130080FDF6 /* SBRoutePickerView.swift */,
3EB2BCCE2992F3CA00DC5056 /* SBVolumeButton.swift */,
3EB2BCD02992FD5A00DC5056 /* SBTracklistButton.swift */,
3EF978012BC3C4E300C986E9 /* SBMessageTextView.swift */,
3EF978052BC49A9100C986E9 /* SBPropertyFieldView.swift */,
);
name = Views;
sourceTree = "<group>";
Expand Down Expand Up @@ -569,6 +577,7 @@
4C87EDAC139CD9E90064DE2E /* Additions */ = {
isa = PBXGroup;
children = (
3EF978032BC4659B00C986E9 /* Binding+Nil.swift */,
3E87E90F2B4364CF00E85000 /* Collection+IndexSet.swift */,
3E04F63A2B7CA48400E24E56 /* Data+Random.swift */,
3EB2BCC22992D94E00DC5056 /* Data+Type.swift */,
Expand Down Expand Up @@ -834,6 +843,7 @@
3E7491972B6A1AE00052CBCE /* SBTracklistController.swift in Sources */,
3E32BE522B8D9FDE00E77CF0 /* SBLibraryItemPasteboardWriter.swift in Sources */,
3E1B785E2ACE5039008927C6 /* SBInspectorController.swift in Sources */,
3EF978022BC3C4E300C986E9 /* SBMessageTextView.swift in Sources */,
3E70B2DF2A2BDC55002C0B93 /* SBApplication.swift in Sources */,
3E702DE72A428A1B005F7184 /* Synchronized.swift in Sources */,
3EC03B4029F4F2E0001FDE50 /* SBDownloads.swift in Sources */,
Expand All @@ -846,6 +856,7 @@
3E94E5F62912EEC40080FDF6 /* SBNavigationItem.swift in Sources */,
3EB2BCC12992D28A00DC5056 /* String+Hex.swift in Sources */,
3E0DAD5C29CA2A5600D895E2 /* SBTrackListLengthTransformer.swift in Sources */,
3EF978062BC49A9100C986E9 /* SBPropertyFieldView.swift in Sources */,
3E32BE552B8E500500E77CF0 /* NSPasteboard+Library.swift in Sources */,
3E45201829F5DBDC00604079 /* SBTrackArtistNameTransformer.swift in Sources */,
3E04F6112B783BEC00E24E56 /* SBPreferencesController.swift in Sources */,
Expand Down Expand Up @@ -884,6 +895,7 @@
3E32BE502B8D9A5C00E77CF0 /* SBTableView+DragImage.swift in Sources */,
4C7AA24D139D64930050BE95 /* SBServerLibraryController.m in Sources */,
4CFAFC2C139EF08800E82B57 /* SBServerHomeController.m in Sources */,
3EF978042BC4659B00C986E9 /* Binding+Nil.swift in Sources */,
3E04F5F22B71E33000E24E56 /* SBServerDirectoryController.swift in Sources */,
4CFAFC37139EF20600E82B57 /* MGScopeBar.m in Sources */,
4CFAFC38139EF20600E82B57 /* MGRecessedPopUpButtonCell.m in Sources */,
Expand Down
27 changes: 27 additions & 0 deletions Submariner/Binding+Nil.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//
// Binding+Nil.swift
// Submariner
//
// Created by Calvin Buckley on 2024-04-08.
//
// Copyright (c) 2024 Calvin Buckley
// SPDX-License-Identifier: BSD-3-Clause
//

import SwiftUI

// https://alanquatermain.me/programming/swiftui/2019-11-15-CoreData-and-bindings/
extension Binding {
init(_ source: Binding<Value?>, replacingNilWith nilValue: Value) where Value: Equatable {
self.init(
get: { source.wrappedValue ?? nilValue },
set: { newValue in
if newValue == nilValue {
source.wrappedValue = nil
}
else {
source.wrappedValue = newValue
}
})
}
}
6 changes: 6 additions & 0 deletions Submariner/SBDatabaseController.m
Original file line number Diff line number Diff line change
Expand Up @@ -1844,6 +1844,12 @@ - (void)pageController:(NSPageController *)pageController didTransitionToObject:
[playlist.server getPlaylistTracks:playlist];
}
[self updateSourceListSelection: playlistNavItem.playlist];
// Sidebar for playlist; update the current playlist in inspector sidebar.
[[NSNotificationCenter defaultCenter] postNotificationName: @"SBPlaylistSelectionChanged"
object: playlistNavItem.playlist];
} else {
[[NSNotificationCenter defaultCenter] postNotificationName: @"SBPlaylistSelectionChanged"
object: nil];
}
// Selected item
// XXX: Kinda messed up by the fact the controllers and nav item don't have a common ancestor for music item
Expand Down
Loading

0 comments on commit e134238

Please sign in to comment.