Commit Graph

28 Commits

Author SHA1 Message Date
Ryan Foster
a1fbf1015f clang-format: Increase column limit from 80 to 120 2024-10-04 18:19:27 -04:00
Suman Manjunath
9b8fa0f0ca UI: Enable first-party YouTube Chat features in OBS
Unlock the full feature set of the YouTube Chat dock in OBS by removing
custom scripting/CSS logic. Enable the signed-in experience for live
streaming content creators while also sharing login credentials with the
YouTube Control panel dock.

This will allow OBS users to utilize features _already_ supported in the
YouTube Chat plugin, such as

* creating polls
* managing Q&A sessions
* a rich emoji set in the input panel
* emoji fountains
* moderation tools

and many more. These features are available to users who are logged-in
to YouTube Chat and/or the YouTube Control panel.
2024-10-04 16:14:38 -04:00
Suman Manjunath
492309c504 UI: Use shared cookie manager for YT Control Panel
Use the cookie manager shared by service integration browser docks for
YouTube Control Panel.

This will enable users of the YouTube Chat panel have a better (creator
facing) experience for observed chat message latency, for those users
who sign-in to the YouTube Control Panel or YouTube Live Chat.

NOTE: This commit does not have any migration logic for existing
logged-in users of YTCP, they will need to sign-in again. Based on usage
stats, this is not going to affect a large fraction of OBS users.
2024-10-04 16:14:38 -04:00
PatTheMav
710d99ef4d UI: Improve incremental compile times via explicit file includes
When a source file contains an explicit include with a filename
following the "moc_<actual-filename>.cpp" pattern, then CMake's
AUTOMOC generation tool will recognize the matching pair and generate
the replacement header file and add the required include directory
entries.

For all files which do contain Q_OBJECT or similar declarations but do
not have an explicit include directive, the global mocs_compilation.cpp
file will still be generated (which groups all "missing" generated
headers).

The larger this global file is, the more expensive incremental
compilation will be as this file (and all its contained generated
headers) will be re-generated regardless of whether actual changes
occurred.
2024-08-22 16:45:12 -04:00
tytan652
48f139729f UI,shared: Move Qt Wrappers to its own directory 2024-07-27 07:38:36 +02:00
gxalpha
7cd5ede1e0 UI: Initialize YoutubeChatDock chat input members in constructor
Currently, the chat input elements (lineEdit, sendButton, and
chatLayout) are initialized when the QCefWidget gets set. This is
problematic behavior that only happened to work because we're a bit
lucky: The chat is only enabled after a widget is set, and it's only set
once. Without those conditions, the chat dock would crash when enabling
the chat before a widget is set, and the elements would get recreated if
the widget is set a second time, resulting in the original elements not
getting freed and leaking.
Moving the element creation to the constructor fixes both of these
problems, as now they're created immediately and only once.

Detected by PVS-Studio.
2024-06-15 16:06:38 -07:00
gxalpha
839461dc9b UI: Don't show native popup for YouTube auth message box
The native popup has the problem that it doesn't work for links, leaving
us with an unclickable text where a link should be. Qt 6.6 has an option
to disable the native dialog, so let's add this to make the link
clickable again.

Co-authored-by: derrod <dennis@obsproject.com>
2023-09-11 10:07:16 -07:00
Matt Gajownik
7d9f8e7cac UI: Set browser dock title in constructor
Works around a bug in Qt where setWindowTitle called on a native window
that hasn't been initialised yet causes the title data to be lost,
resulting in the window's title never being set.
2023-08-15 12:27:18 -04:00
tytan652
049f4454d4 UI: Fix YouTubeAppDock restore dock state 2023-08-05 16:44:16 -07:00
gxalpha
fc07e59754 UI: Replace SIGNAL and SLOT macros in auth 2023-07-21 13:16:04 +02:00
derrod
593664dcdb clang-format: Set AllowShortLambdasOnASingleLine to Inline 2023-07-15 16:14:55 -07:00
derrod
dcc07cfe4e clang-format: Set AllowAllConstructorInitializersOnNextLine to false 2023-07-15 16:14:55 -07:00
tytan652
e6873d3278 UI: Refactor integration and browser docks
Use the QAction provided by QDockWidget with new Qt connection rather
than creating a new one for each dock.

Separate extra browser docks from extra docks, the latter is meant for
plugin/integration docks.
2023-03-17 20:21:08 +11:00
derrod
3dcf68f8ed UI: Work around Qt dock restore crash 2023-01-24 18:43:38 -08:00
derrod
5620a469a9 UI: Remove compatibility for QT < 5.10 2022-07-31 21:47:01 -07:00
gxalpha
2dd1a3fc6f UI: Fix compilation with browser disabled 2022-07-06 19:48:27 +02:00
gxalpha
cf0275e00d UI: Fix YouTube Chat build failure with Qt 6 2022-06-29 18:32:09 -04:00
gxalpha
3513c78be2 UI: Add ability to send messages to YouTube chat 2022-06-27 14:35:01 -04:00
tytan652
f4809b614e UI: Fix unused-parameter warnings 2022-05-04 01:37:10 -07:00
Matt Gajownik
1acc14e189 UI: Fix service integration with older Qt versions 2021-12-01 18:53:11 +11:00
Matt Gajownik
bc9911f5a6 UI: Pass parent QWidget to Browser Docks 2021-11-30 23:28:20 -08:00
jp9000
a73586b8b1 UI: Use STL random as fallback
For Linux distros still living in the stone ages, use the old
randomization code. Fixes CI not building. We can change it later when
we finalize good random stuff.
2021-09-17 02:59:21 -07:00
derrod
37ab69aa46 UI: Abort YouTube login on cancel or listener fail 2021-09-16 14:56:46 +02:00
Richard Stanway
4687e99563 UI: Use secure RNG for generating YouTube state parameter
mt19937 is a deterministic RNG and was not seeded, so the state
parameter was identical for all runs. Switch to using Qt's
QRandomGenerator::system() which is implemented as a CSPRNG on
all platforms we care about.
2021-09-15 06:16:29 -07:00
Richard Stanway
0a13ce851d UI: Properly verify state parameter for YouTube auth
Very low risk of anything bad here since we use a random port and the
chance of a CSRF attack is tiny, but this is a best practie to do when
using OAuth.
2021-09-15 06:16:29 -07:00
jp9000
a6fdc47535 UI: Cache YouTube channel name
This prevents having to look up the YouTube channel every time the
settings window is opened.

Closes obsproject/obs-studio#5154
2021-08-24 18:44:34 -07:00
derrod
18f40be820 UI: Add YouTube Chat Dock
Since embedded browsers are no longer allowed to log into Google from the chat
dock is effectively read-only.
To prevent users from even trying to log in the input field is hidden
via custom CSS.
2021-08-23 18:28:23 -07:00
Yuriy Chumak
e6f1daab8c UI: Add YouTube integration 2021-08-07 01:07:04 -07:00