Open DanRathbun opened 3 years ago
With the release of SketchUp 2021.0 the user's global setting for Scene Tab display is finally being honored.
I'm not sure what we're talking about here. Is there a new preference? Can you screenshot the UI setting this refer to?
Sketchup.preferences
Yes, I've been wanting to get something like this into the API.
Another use case is to read the axes colors (no, they are not necessarily red, green and blue).
That and Click-style, template locations. Generally what the preferences dialog offers.
Generally what the preferences dialog offers.
Yes, ... and as I said most of the attributes in the "Preferences" sub key in the "Shared_Preferences.json"
file, but also most of it's sibling objects.
You mention "File Locations" and templates. These are in the other "Private_Preferences.json"
file (which also has a "Preferences" key.)
Anyway yes at the least read access to many and write privilege for some. (Meaning that the access needs to be live. Code needs to read or write the current values, not the static on disk values which are not updated until the shutdown cycle.)
Dan: With the release of SketchUp 2021.0 the user's global setting for Scene Tab display is finally being honored.
Thomas: I'm not sure what we're talking about here. Is there a new preference?
The global View > Scene Tabs menu toggle. (If you look at the menu, you'll see that it is separate from the other Style-based display toggles.)
SketchUp 2021.0 Release Notes : Miscellaneous says:
* (Win) Scene Tabs visibility setting is now saved as a user preference.
Previously (and for years) users have complained that their scene tab toggle setting has not been honored, and whenever they open a model file with scene pages, SketchUp would default to activating the scene tabs display regardless of what the application setting was. (If you need to understand, test it out in 2020 or prior releases.)
Attempts to override this behavior with an extension are generally fragile because of the lack of API exposure to the setting. (As I explain in the initial post.)
I also don't think that there is any observer that fires when this setting is changed (as it would likely need to be a callback for the AppObserver
interface or perhaps OptionsProviderObserver
if these kind of preferences were exposed via a OptionsProvider
.)
Anyway, ... would you like to change the issue to a more general "Expose Application Preferences to an OptionsProvider Interface" rather than specific to the DisplayTabs setting ?
Yea, this would have to fall under a general Application Preferences API - not just this one by itself.
@thomthom Do you need any more info, or did I answer it and can this be made ready for logging ?
OptionsProvider
are for model properties. We'd need a separate interface for application settings.
You don't have any classing or otherwise way to reuse code for another interface that just has different set of keys and values ?
It looks (from the outside) like OptionsManager
is a generic hash-like data interface, that should allow access to a different set of OptionsProviders
depending upon whether model.options
or Sketchup.preferences
is called.
Likewise, OptionsProviders
looks like a generic hash-like data interface, that should allow access to a different set of keys and values, depending upon what provider the manager was asked for.
Call the interfaces whatever you like, subclass or just copy code and edit. (But I would think that a C++ superclass for both would make future maintenance easier and less error prone.)
Perhaps call them PreferenceManager
and PreferenceProvider
?
Well, that's a technical detail we'll resolve at the time of implementation.
Okay, can we please get this logged ? (I know I've been talking about this feature since the v8 days.)
Feature requests are logged separately internally. So there's no bot posting back references to internal tracker.
OH, I thought you at least tagged them as "logged" ? Otherwise how are we to know that they are getting their fare share of lovin' ?
;)
SketchUp Ruby API (and "Live" C API) Issue
Formerly: Get (and possibly set) the global Scene Tabs display.
Changed to: Expose Application Preferences to an OptionsProvider Interface.
(Only 1 example of an application preference exposure needed.)
With the release of SketchUp 2021.0 the user's global setting for Scene Tab display is finally being honored. There is no dedicated API method to see what the setting is (and therefore whether scene tabs are displayed) nor to set it.
There is a setter workaround using
Sketchup.send_action
and a "magic number" (10534
) on Windows and a string action ("togglePageTabsDsiplay:"
) on Mac.Reading the saved value from the "Shared_Preferences.json" file and then tracking the change would only work if changes were done via an extension's button or menu interface. Using the native menu toggle would defeat such a workaround.
This optional toggle is a good candidate for an application level
OptionsProvider
instance.See the "Preferences" sub object in the
"Shared_Preferences.json"
file for possible keys to this provider.The ability to read the "ClickStyle" preference has also been long requested.