Commit Graph

937 Commits

Author SHA1 Message Date
PatTheMav
1cf6b3d45e UI: Restore frontend API events being dispatched during initialization
The frontend API events "OBS_FRONTEND_EVENT_SCENE_CHANGED" and
"OBS_FRONTEND_EVENT_PREVIEW_SCENE_CHANGED" are not dispatched if
disableSaving has a value > 0. Prior code decremented disableSaving to
0 globally (regardless of whether saving was necessary, which is only
the case if a new collection is created as a fallback for a missing
scene collection).

Thus the updated code exhibits different event dispatch behavior then
old code which some plugins might have relied on. To avoid introducing
new behavior, explicitly create the environment to allow the dispatch
to take place and remove/refactor the events in a later version.
2024-10-30 13:46:36 -04:00
Matt Gajownik
0eef4e25ee UI: Split out Whats New dialog, fix crash on shutdown
CEF crashes on shutdown if any browser window remains open during the
shutdown flow. Reproducible 100% of the time on Linux with What's New.
The previous implementation of the What's New dialog correctly deleted
all the Qt widgets, but the CEF internal event flow would only call the
"preparing to close" function, and never the "window safely closed"
function. Moving the code (practically unchanged) to a custom QDialog
solves the problem entirely, and is more consistent with other uses.
2024-10-24 16:01:46 -04:00
PatTheMav
ca4bc1ad36 UI: Fix initialization bug when launching without existing profile
SetupNewProfile is used to create new profiles when OBS is already
running, which requires resetting program state for the new profile.

This function cannot be used to create a new profile as a fallback
for either a non-existing profile or for a fresh installation of OBS
Studio because by the point this is called from OBSBasic::OBSInit, the
runtime modules are not loaded yet and as such no services exist.

Activating the new profile without a profile reset fixes this issue
as the reset will be done explicitly by OBSBasic::OBSInit later.
2024-10-15 14:28:43 -04:00
PatTheMav
3995b4662d UI: Fix crash when providing scene collection or profile via CLI
When a starting scene collection or profile is provided, current code
would crash as the corresponding collections and management functions
do not exist yet (they are tied to OBSBasic, which is not initialized
that early in the program execution).

This change moves the checks for command line arguments into OBSBasic
into the parts responsible for initializing profiles and scene
collections and check for arguments provided via command line there.
2024-10-10 16:38:33 -04:00
test
15cd31fdbd UI: Fix settings mismatch 2024-10-07 14:13:25 -04:00
Ryan Foster
a1fbf1015f clang-format: Increase column limit from 80 to 120 2024-10-04 18:19:27 -04:00
gxalpha
ad5040cfd2 UI: Fix What's New increment settings mismatch
The InfoIncrement key in the application config everywhere else. This
mismatch caused the "What's New" menu entry to stop functioning.
2024-10-03 10:44:46 -04:00
PatTheMav
b4137fa65a UI: Fix crash when creating scene collections with "unsafe" names
Scene collection names that are not considered "safe" by OBS Studio
get a changed JSON file name with incompatible characters replaced.

The refactored scene collection implementation uses the Load function to
either activate an existing scene collection or create a new one if it
does not exist.

The Load function however overwrote the scene collection name set in
the profile with its own variant based off the "safe" file name, which
created a mismatch with the code that created the collection data
model.

As the Load function is only called by ActivateSceneCollection (which
itself already sets the name and filename for the collection), removal
of this superfluous code in the Load function also fixes the issue.
2024-09-27 14:01:38 -04:00
PatTheMav
3e0592dc20 UI: Rewrite scene collection system to enable user-provided storage
This change enables loading scene collections from locations different
than OBS' own configuration directory.

It also rewrites profile management in the app to work off an in-memory
collection of profiles found on disk and does not require iterating
over directory contents for most profile interactions by the app.
2024-09-12 16:18:46 -04:00
PatTheMav
607d37b423 UI: Rewrite profile system to enable user-provided storage location
This change enables loading profiles from locations different than
OBS' own configuration directory.

It also rewrites profile management in the app to work off an in-memory
collection of profiles found on disk and does not require iterating
over directory contents for most profile interactions by the app.
2024-09-12 16:18:46 -04:00
PatTheMav
2635cf3a2a UI: Split global config into app and user config
This introduces a split of the current single ConfigFile instance for
all configuration into two separate instances.

The app config instance contains system-wide settings that mainly
concern the working of the app itself, whereas the user config instance
contains settings actually exposed to the user for the configuration.
2024-09-12 16:18:46 -04:00
gxalpha
7b0e154245 UI: Replace remaining SIGNAL/SLOT macros 2024-08-31 11:39:08 -04:00
derrod
8251005ad3 UI: Add migration for relative coordinate system 2024-08-27 23:58:51 +02:00
gxalpha
ec5f499cb3 UI: Inline macOS 13 check 2024-08-23 22:09:48 -04:00
Exeldro
200abd3af0 UI: Force UpdateEditMenu on UI Thread 2024-08-23 21:27:43 -04:00
derrod
3ebe071c7b UI: Remove compatibility with FFmpeg < 6.1 2024-08-23 13:44:04 -04:00
derrod
834c15e717 UI: Remove legacy Qt workarounds (Ubuntu 22.04) 2024-08-23 13:44:04 -04:00
derrod
8758ece291 UI: Remove now unused GetMonitorName for Qt < 6.4 2024-08-20 18:03:37 -04:00
Warchamp7
81fa608cde UI: Add preview scrollbars
This adds scrollbars to the preview, so users can move around the
preview without using the spacebar + clicking.

Co-Authored-By: Clayton Groeneveld <19962531+cg2121@users.noreply.github.com>
2024-08-18 03:18:03 +02:00
jcm
1b25acd184 UI: Don't create default desktop audio source on macOS 13+ 2024-08-12 22:45:16 +02:00
cg2121
89554112c1 UI: Cleanup frontend event handling
This adds a function to OBSBasic to call on_event, so every
time a event is called, the api variable doesn't have to be
checked everytime.
2024-08-10 17:35:22 -07:00
derrod
6d20327bbc UI: Rename existing (corrupt) collection file if loading fails 2024-08-05 20:07:38 -04:00
derrod
c723b3ba04 UI: Ensure collection name is set before creating default scene 2024-08-05 20:07:38 -04:00
tytan652
3b266fec22 UI,docs: Send a custom event to the dock widget when closing 2024-08-04 10:18:59 +10:00
Norihiro Kamae
58a8d79be1 UI: Remove min and max macro workaround 2024-08-03 16:57:17 -07:00
derrod
f6097cacfb UI: Remove legacy migrations 2024-07-29 18:54:01 -04:00
Ryan Foster
b9f63632a1 Merge pull request #10019 from derrod/remove-ftl
Remove FTL.
2024-07-29 16:41:31 -04:00
tytan652
48f139729f UI,shared: Move Qt Wrappers to its own directory 2024-07-27 07:38:36 +02:00
Norihiro Kamae
2fa77c4021 UI: Fix cast of pointer type at invalid current scene setting on load 2024-07-20 16:49:21 -07:00
derrod
1206870cef UI: Remove FTL support 2024-07-14 06:09:49 +02:00
Ruwen Hahn
7327663112 UI: Remove QFuture usage
`QFuture`s are broken on older Qt versions, even with the deadlock
workaround (see <https://github.com/obsproject/obs-studio/issues/10929>)
2024-07-10 16:12:53 -04:00
Ruwen Hahn
b74e7ede0e UI: Move code out of unnamed lambdas
This is in preparation of the next change, to hopefully minimize
the resulting diff
2024-07-10 16:12:53 -04:00
derrod
608d3bfc26 UI: Set default container for beta builds to hybrid MP4 2024-06-17 12:12:20 -04:00
cg2121
dcd2f19c83 UI: Remove redundant addAction call
This removes a redundant addAction call in the studio mode program
context menu.
2024-06-15 16:08:24 -07:00
derrod
0680b642e9 UI: Always show chapter marker hotkey 2024-06-08 17:03:09 -07:00
Richard Stanway
f9f4171d56 UI: Add null checks before doing some API calls
Harmless, but generated a debug warning for null pointers passed into
the API.
2024-06-08 15:25:04 -04:00
Ryan Foster
da8fc0d516 UI: Disable Multitrack Video by default 2024-06-06 14:00:34 -04:00
tytan652
511385891c UI: Separate controls dock from the main window 2024-06-05 17:39:54 -04:00
tytan652
eed5578e4c UI: Remove setStreamText lambda
Avoid tangling controls dock stream button to OBSBasic with a lambda.
2024-06-05 17:39:54 -04:00
tytan652
178205257e UI: Set system tray text explicitly
Avoid using controls dock buttons as a source for text for system tray
elements.
2024-06-05 17:39:54 -04:00
tytan652
d23b65a2bf UI: Track streaming state in OBSBasic
Avoid using controls dock buttons for streaming state. Use signals and
OBSBasic member variables instead.
2024-06-05 17:39:54 -04:00
tytan652
9093275336 UI: Track recording state in OBSBasic
Avoid using controls dock buttons for recording states. Use signals and
OBSBasic member variables instead.
2024-06-05 17:39:54 -04:00
tytan652
cb024a0696 UI: Use connection with modeSwitch button 2024-06-05 17:39:54 -04:00
derrod
29994afe7f UI: Retain existing last output resolution 2024-06-05 13:44:24 -07:00
Ruwen Hahn
c8950900c3 UI: Add eRTMP Multitrack Video Output 2024-06-04 20:50:46 -04:00
derrod
8ac8118b7f UI: Add chapter frontend API and hotkey 2024-05-26 23:11:48 +02:00
gxalpha
175b0cbc83 UI: Update edit menu on source filter changes
Currently, when adding a filter to a source and then right-clicking it
or using the menu bar edit menu, it's not possible to copy the source's
filters. This is because the edit menu does not update on filter
changes.
Listening to the new global filters add/remove signal and updating the
edit menu will enable the copy option if a filter get added or disable
the option if the last filter gets removed.
2024-05-25 17:08:42 -07:00
gxalpha
4cf18a9abf UI: Add undo/redo to Paste Filters on audio mixer and scenes
Copy-Pasting filters on a scene or on a source via the audio mixer
context menu would not add an undo/redo action. This commit factors the
undo/redo logic out into a generic paste filters function that can be
used for pasting filters everywhere.
2024-05-25 17:06:21 -07:00
gxalpha
8184fa10a3 UI: Inline OBSBasic::ThemeChanged()
The majority of this method got removed in a prior commit [1]. Let's
inline the rest.

[1] 8dcfae9a39
2024-05-25 17:04:58 -07:00
Ryan Foster
cffdc15aac UI: Fix Grid Mode not persisting from View Menu
When clicking Grid Mode or List Mode from the context menu within the
Scenes list, whether or not Grid Mode is enabled persists between OBS
sessions. When clicking Grid or List from the View Menu, the setting
does not persist between OBS sessions. This seems to be a regression
from fc8c428521.

Previously, SceneTree's SetGridMode would set this config value. If the
intent is to not have SetGridMode directly set the config value, then
any function that calls SetGridMode other than the OBSBasic constructor
must instead set the config value.
2024-05-25 16:12:39 -07:00