Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 25 additions & 7 deletions frontend/OBSApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <dialogs/LogUploadDialog.hpp>
#include <plugin-manager/PluginManager.hpp>
#include <utility/CrashHandler.hpp>
#include <utility/HealthCheckService.hpp>
#include <utility/OBSEventFilter.hpp>
#include <utility/OBSProxyStyle.hpp>
#if defined(_WIN32) || defined(ENABLE_SPARKLE_UPDATER)
Expand Down Expand Up @@ -71,7 +72,6 @@ extern bool safe_mode;
extern bool multi;
extern bool disable_3p_plugins;
extern bool opt_disable_updater;
extern bool opt_disable_missing_files_check;
extern string opt_starting_collection;
extern string opt_starting_profile;

Expand Down Expand Up @@ -1266,7 +1266,6 @@ bool OBSApp::OBSInit()
thumbnailManager = new ThumbnailManager(this);

mainWindow = new OBSBasic();

mainWindow->setAttribute(Qt::WA_DeleteOnClose, true);

#ifndef __APPLE__
Expand Down Expand Up @@ -1342,11 +1341,6 @@ bool OBSApp::IsUpdaterDisabled()
return opt_disable_updater;
}

bool OBSApp::IsMissingFilesCheckDisabled()
{
return opt_disable_missing_files_check;
}

#ifdef __APPLE__
#define INPUT_AUDIO_SOURCE "coreaudio_input_capture"
#define OUTPUT_AUDIO_SOURCE "coreaudio_output_capture"
Expand Down Expand Up @@ -1997,6 +1991,30 @@ void OBSApp::loadAppModules(struct obs_module_failure_info &mfi)
pluginManager_->postLoad();
}

OBS::HealthCheckService *OBSApp::healthService()
{
if (healthService_.isNull()) {
healthService_ = new OBS::HealthCheckService(this);
}

return healthService_;
}

void OBSApp::openHealthCheckDialog()
{
if (!mainWindow) {
return;
}

if (!healthCheckDialog) {
healthCheckDialog = new HealthCheckDialog(mainWindow);
healthCheckDialog->setAttribute(Qt::WA_DeleteOnClose);
healthCheckDialog->show();
} else {
healthCheckDialog->raise();
}
}

void OBSApp::pluginManagerOpenDialog()
{
pluginManager_->open();
Expand Down
8 changes: 7 additions & 1 deletion frontend/OBSApp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#pragma once

#include <dialogs/HealthCheckDialog.hpp>
#include <utility/NativeEventFilter.hpp>
#include <utility/OBSTheme.hpp>
#include <utility/ThumbnailManager.hpp>
Expand Down Expand Up @@ -51,6 +52,7 @@ class CrashHandler;

enum class LogFileType { NoType, CurrentAppLog, LastAppLog, CrashLog };
enum class LogFileState { NoState, New, Uploaded };
class HealthCheckService;
class PluginManager;
} // namespace OBS

Expand Down Expand Up @@ -92,6 +94,8 @@ class OBSApp : public QApplication {
std::deque<obs_frontend_translate_ui_cb> translatorHooks;

ThumbnailManager *thumbnailManager = nullptr;
QPointer<OBS::HealthCheckService> healthService_;
QPointer<HealthCheckDialog> healthCheckDialog;

std::unique_ptr<OBS::PluginManager> pluginManager_;

Expand Down Expand Up @@ -195,7 +199,6 @@ private slots:
std::string GetVersionString(bool platform = true) const;
bool IsPortableMode();
bool IsUpdaterDisabled();
bool IsMissingFilesCheckDisabled();

const char *InputAudioSource() const;
const char *OutputAudioSource() const;
Expand Down Expand Up @@ -232,6 +235,9 @@ private slots:

void loadAppModules(struct obs_module_failure_info &mfi);

OBS::HealthCheckService *healthService();
void openHealthCheckDialog();

ThumbnailManager *thumbnails() const { return thumbnailManager; }

// Plugin Manager Accessors
Expand Down
8 changes: 8 additions & 0 deletions frontend/cmake/ui-components.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ target_sources(
components/FocusList.hpp
components/GameCaptureToolbar.cpp
components/GameCaptureToolbar.hpp
components/HealthCheckInfoRow.cpp
components/HealthCheckInfoRow.hpp
components/HealthCheckStatusLabel.cpp
components/HealthCheckStatusLabel.hpp
components/ImageSourceToolbar.cpp
components/ImageSourceToolbar.hpp
components/MediaControls.cpp
Expand All @@ -55,6 +59,10 @@ target_sources(
components/Multiview.cpp
components/Multiview.hpp
components/MuteCheckBox.hpp
components/NoticeButton.cpp
components/NoticeButton.hpp
components/NoticeLabel.cpp
components/NoticeLabel.hpp
components/OBSAdvAudioCtrl.cpp
components/OBSAdvAudioCtrl.hpp
components/OBSPreviewScalingComboBox.cpp
Expand Down
2 changes: 2 additions & 0 deletions frontend/cmake/ui-dialogs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ target_link_libraries(obs-studio PRIVATE OBS::properties-view)
target_sources(
obs-studio
PRIVATE
dialogs/HealthCheckDialog.cpp
dialogs/HealthCheckDialog.hpp
dialogs/LogUploadDialog.cpp
dialogs/LogUploadDialog.hpp
dialogs/NameDialog.cpp
Expand Down
6 changes: 6 additions & 0 deletions frontend/cmake/ui-utility.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ target_sources(
utility/GoLiveAPI_Network.hpp
utility/GoLiveAPI_PostData.cpp
utility/GoLiveAPI_PostData.hpp
utility/HealthCheckAction.cpp
utility/HealthCheckAction.hpp
utility/HealthCheckItem.cpp
utility/HealthCheckItem.hpp
utility/HealthCheckService.cpp
utility/HealthCheckService.hpp
utility/MissingFilesModel.cpp
utility/MissingFilesModel.hpp
utility/MissingFilesPathItemDelegate.cpp
Expand Down
2 changes: 2 additions & 0 deletions frontend/cmake/ui-widgets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ target_sources(
widgets/AudioMixer.hpp
widgets/ColorSelect.cpp
widgets/ColorSelect.hpp
widgets/HealthCheckWidget.cpp
widgets/HealthCheckWidget.hpp
widgets/OBSBasic.cpp
widgets/OBSBasic.hpp
widgets/OBSBasic_Browser.cpp
Expand Down
45 changes: 45 additions & 0 deletions frontend/components/HealthCheckInfoRow.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/******************************************************************************
Copyright (C) 2026 by Taylor Giampaolo <warchamp7@obsproject.com>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/

#include "HealthCheckInfoRow.hpp"

#include <utility/HealthCheckItem.hpp>

#include <Idian/RowInfo.hpp>

#include <QPushButton>

HealthCheckInfoRow::HealthCheckInfoRow(QWidget *parent, OBS::HealthCheckItem *item) : idian::Row(parent)
{
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum);

auto *rowInfo = new idian::RowInfo(this, "", item->message());
addWidget(rowInfo);

rowInfo->description()->setWordWrap(true);
rowInfo->description()->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum);

if (item->action() == nullptr) {
return;
}

QPushButton *healthActionButton = new QPushButton(this);
healthActionButton->setText(item->action()->text());

addWidget(healthActionButton);
connect(healthActionButton, &QPushButton::pressed, item->action(), &OBS::HealthCheckAction::trigger);
}
32 changes: 32 additions & 0 deletions frontend/components/HealthCheckInfoRow.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/******************************************************************************
Copyright (C) 2026 by Taylor Giampaolo <warchamp7@obsproject.com>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/

#pragma once

#include <Idian/Row.hpp>

namespace OBS {
class HealthCheckItem;
}

class HealthCheckInfoRow : public idian::Row {
Q_OBJECT

public:
HealthCheckInfoRow(QWidget *parent, OBS::HealthCheckItem *item);
~HealthCheckInfoRow() = default;
};
39 changes: 39 additions & 0 deletions frontend/components/HealthCheckStatusLabel.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/******************************************************************************
Copyright (C) 2026 by Taylor Giampaolo <warchamp7@obsproject.com>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/

#include "HealthCheckStatusLabel.hpp"

#include <utility/HealthCheckItem.hpp>

#include <Idian/Utils.hpp>

HealthCheckStatusLabel::HealthCheckStatusLabel(QWidget *parent, OBS::HealthCheckItem *item) : OBS::NoticeLabel(parent)
{
setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
setText(item->statusText());

switch (item->status()) {
case OBS::HealthStatus::Warning:
setStyle(OBS::NoticeStyle::Warning);
break;
case OBS::HealthStatus::Critical:
setStyle(OBS::NoticeStyle::Danger);
break;
default:
break;
}
}
34 changes: 34 additions & 0 deletions frontend/components/HealthCheckStatusLabel.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/******************************************************************************
Copyright (C) 2026 by Taylor Giampaolo <warchamp7@obsproject.com>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/

#pragma once

#include <components/NoticeLabel.hpp>

#include <QLabel>

namespace OBS {
class HealthCheckItem;
}

class HealthCheckStatusLabel : public OBS::NoticeLabel {
Q_OBJECT

public:
HealthCheckStatusLabel(QWidget *parent, OBS::HealthCheckItem *item);
~HealthCheckStatusLabel() = default;
};
68 changes: 68 additions & 0 deletions frontend/components/NoticeButton.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/******************************************************************************
Copyright (C) 2026 by Taylor Giampaolo <warchamp7@obsproject.com>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/

#include "NoticeButton.hpp"

#include <Idian/Utils.hpp>

namespace OBS {
NoticeButton::NoticeButton(QWidget *parent) : QPushButton(parent), idian::Utils(this)
{
setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
idian::Utils::addClass("text-bold");
}

NoticeButton::NoticeButton(QWidget *parent, QString text, OBS::NoticeStyle style) : NoticeButton(parent)
{
setText(text);
setStyle(style);
}

void NoticeButton::setStyle(NoticeStyle style)
{
applyStyle(currentStyle, false);
applyStyle(style, true);

currentStyle = style;
}

void NoticeButton::applyStyle(NoticeStyle style, bool enable)
{
switch (style) {
case NoticeStyle::Primary:
idian::Utils::toggleClass("primary", enable);
break;
case NoticeStyle::Secondary:
idian::Utils::toggleClass("secondary", enable);
break;
case NoticeStyle::Info:
idian::Utils::toggleClass("info", enable);
break;
case NoticeStyle::Success:
idian::Utils::toggleClass("success", enable);
break;
case NoticeStyle::Warning:
idian::Utils::toggleClass("warning", enable);
break;
case NoticeStyle::Danger:
idian::Utils::toggleClass("danger", enable);
break;
default:
break;
}
}
} // namespace OBS
Loading
Loading