Skip to content

Commit 79a244e

Browse files
Release/1.0.0 rc2 (#12)
* Adds handler for auth code timeout on login. * Fixes saving of scene collection immediately before export. * Updates UI strings. * Replaces install type step in setup wizard with 'Start Install' screen. * Fixes typo in name-in-use error dialog.
1 parent 021337a commit 79a244e

10 files changed

+202
-74
lines changed

data/locale/en-US.ini

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,66 @@
11
General.SaveButton="Save"
2+
General.SaveChangesButton="Save Changes"
23
General.CancelButton="Cancel"
3-
MarketplaceWindow.LoginButton.LogIn="Log In"
4+
MarketplaceWindow.LoginButton.LogIn="Sign In"
45
MarketplaceWindow.LoginButton.LogOut="Sign Out"
56
MarketplaceWindow.OpenSettingsButton.Tooltip="Open Settings"
67
MarketplaceWindow.StoreButton.Tooltip="Go to Elgato Marketplace"
78
MarketplaceWindow.DownloadButton.Tooltip="Click to Download"
8-
MarketplaceWindow.PurchasedTab="Purchased"
9+
MarketplaceWindow.PurchasedTab="Products"
910
MarketplaceWindow.Purchased.NoPurchasesTitle="You don't own any scene collection products yet"
1011
MarketplaceWindow.Purchased.NoPurchasesSubtitle="Your digital assets from Marketplace will appear here"
11-
MarketplaceWindow.LoginNeeded.Title="Please Log In"
12-
MarketplaceWindow.LoginNeeded.Subtitle="Click the Log In button above to log into your account and begin using the Elgato Marketplace plugin."
12+
MarketplaceWindow.LoginNeeded.Title="Sign in to get started"
13+
MarketplaceWindow.LoginNeeded.Subtitle="First off, let's connect your Marketplace account with OBS Studio"
14+
MarketplaceWindow.LoginError.Title="Login Error"
15+
MarketplaceWindow.LoginError.Subtitle="There was an error logging you in. Please click the Log In button above to try again."
1316
MarketplaceWindow.ConnectionError.Title="Connection Error"
1417
MarketplaceWindow.ConnectionError.Subtitle="Could not connect to the server. (please check your network connection)"
1518
MarketplaceWindow.Loading.Title="Loading Your Purchased Products..."
1619
MarketplaceWindow.Settings.Title="Settings"
17-
MarketplaceWindow.Settings.DefaultVideoDevice.Label="Default Video Device"
20+
MarketplaceWindow.Settings.DefaultVideoDevice.Label="Default camera"
1821
MarketplaceWindow.Settings.DefaultVideoDevice.NoneSelected="None Selected"
1922
MarketplaceWindow.Settings.DefaultVideoDevice.SettingsButton.Tooltip="Video Capture Device Settings"
20-
MarketplaceWindow.Settings.DefaultAudioDevice.Label="Default Audio Device"
23+
MarketplaceWindow.Settings.DefaultAudioDevice.Label="Default microphone"
2124
MarketplaceWindow.Settings.InstallLocation="Medial File Install Location"
22-
MarketplaceWindow.Settings.EnableMakerTools="Enable Maker Tools"
25+
MarketplaceWindow.Settings.EnableMakerTools="Turn on Maker tools"
2326
MarketplaceWindow.Settings.MakerToolsRestartWarning.Disabled="Maker tools will be disabled after restarting OBS."
2427
MarketplaceWindow.Settings.MakerToolsRestartWarning.Enabled="Maker tools will be enabled after restarting OBS."
2528
MarketplaceWindow.DownloadProduct.NetworkError.Title="Network Connection Error"
2629
MarketplaceWindow.DownloadProduct.NetworkError.Subtitle="Could not connect to the Marketplace. Please try again."
2730
MarketplaceWindow.DownloadProduct.InvalidFiletype.Title="Invalid File Type"
2831
MarketplaceWindow.DownloadProduct.InvalidFiletype.Subtitle="File is not an .elgatoscene file."
29-
ExportWizard.NextButton="Next"
32+
ExportWizard.NextButton="Continue"
3033
ExportWizard.BackButton="Back"
31-
ExportWizard.CloseButton="Close"
32-
ExportWizard.MediaFileCheck.Title="Media File Check"
33-
ExportWizard.MediaFileCheck.Text=" media files were found to bundle.\nIf this is correct, click 'Next' below."
34-
ExportWizard.VideoSourceLabels.Title="Video Source Labels"
35-
ExportWizard.VideoSourceLabels.Text="Now go ahead and label your video sources."
34+
ExportWizard.SaveAsButton="Save as"
35+
ExportWizard.CloseButton="Done"
36+
ExportWizard.MediaFileCheck.Title="Review your export"
37+
ExportWizard.MediaFileCheck.Text=" media files were found to bundle."
38+
ExportWizard.VideoSourceLabels.Title="Name video sources"
39+
ExportWizard.VideoSourceLabels.Text="Choose how your video sources will appear for users"
3640
ExportWizard.VideoSourceLabels.InputPlaceholder="Description text goes here"
3741
ExportWizard.VideoSourceLabels.NoCaptureSourcesText="No video capture sources found."
38-
ExportWizard.RequiredPlugins.Title="Required Plug-ins"
39-
ExportWizard.RequiredPlugins.Text="Please select all plugins that are required to use this scene collection."
42+
ExportWizard.RequiredPlugins.Title="Add required plugins"
43+
ExportWizard.RequiredPlugins.Text="Select any plugins needed to run this asset"
4044
ExportWizard.RequiredPlugins.NoPluginsFound="No installed plugins found."
41-
ExportWizard.ExportComplete.Title="Scene Bundle Exported"
42-
ExportWizard.ExportComplete.Text="Bundle successfully exported. Click 'Close' below to close this window."
45+
ExportWizard.ExportComplete.Title="Export complete"
46+
ExportWizard.ExportComplete.Text="Bundle successfully exported. Click 'Done' below to close this window."
4347
ExportWizard.Exporting.Title="Exporting Bundle..."
4448
ExportWizard.Exporting.Text="Note: this can take a few minutes for scene collections with large files."
4549
SetupWizard.WindowTitle="Install Scene Collection"
46-
SetupWizard.NextButton="Next"
50+
SetupWizard.NextButton="Continue"
4751
SetupWizard.BackButton="Back"
48-
SetupWizard.MissingPlugins.Title="Missing Plugins"
49-
SetupWizard.MissingPlugins.Text="The following plugins are required to use this scene collection, but are not installed. Please install these plugins, restart OBS and attempt to install again."
50-
SetupWizard.MissingPlugins.DownloadButton="Download"
51-
SetupWizard.SelectInstall.Title="Select Install"
52+
SetupWizard.StartInstall.Title="Start install"
53+
SetupWizard.MissingPlugins.Title="You're missing something"
54+
SetupWizard.MissingPlugins.Text="To continue, download the following free plugins, then restart OBS and try again"
55+
SetupWizard.MissingPlugins.DownloadButton="Get"
56+
SetupWizard.SelectInstall.Title="How do you want to install this?"
5257
SetupWizard.SelectInstall.NewInstallButton="New"
53-
SetupWizard.SelectInstall.ExistingInstallButton="New"
58+
SetupWizard.SelectInstall.ExistingInstallButton="Add"
5459
SetupWizard.CreateCollection.Title="Create Scene Collection"
5560
SetupWizard.CreateCollection.NewNamePlaceholder="Collection Name"
56-
SetupWziard.NameInUseError.Title="Name in use."
61+
SetupWizard.NameInUseError.Title="Name in use."
5762
SetupWizard.NameInUseError.Text="A scene collection already exists with this name. Please provide another name."
58-
SetupWizard.AudioSetup.Device.Text="Audio Device"
63+
SetupWizard.AudioSetup.Device.Text="Select a microphone"
5964
SetupWizard.Loading.Title="Loading Collection..."
6065
SetupWizard.Loading.Text="Note: this can take some time for scene collections with large files."
6166
SetupWizard.IncompatibleFile.Title="Incompatible file"

src/elgato-cloud-data.cpp

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -182,13 +182,21 @@ void ElgatoCloud::_Listen()
182182
auto response = fetch_string_from_post(
183183
url, encodeddata);
184184

185-
auto responseJson =
186-
nlohmann::json::parse(response);
187-
obs_log(LOG_INFO,
188-
"Access and refresh token fetched from login.");
189-
190-
_ProcessLogin(responseJson);
191-
185+
auto responseJson = nlohmann::json::parse(response);
186+
187+
if (responseJson.contains("error")) {
188+
if (mainWindowOpen && window) {
189+
QMetaObject::invokeMethod(
190+
QCoreApplication::instance()->thread(),
191+
[this]() {
192+
loginError = true;
193+
window->setLoggedIn();
194+
});
195+
}
196+
} else {
197+
loginError = false;
198+
_ProcessLogin(responseJson);
199+
}
192200
authorizing = false;
193201
return;
194202
}
@@ -344,6 +352,7 @@ void ElgatoCloud::_ProcessLogin(nlohmann::json &loginData, bool loadData)
344352
{
345353
try {
346354
connectionError = false;
355+
loginError = false;
347356
const auto now = std::chrono::system_clock::now();
348357
const auto epoch = now.time_since_epoch();
349358
const auto seconds =
@@ -371,9 +380,11 @@ void ElgatoCloud::_ProcessLogin(nlohmann::json &loginData, bool loadData)
371380
} catch (const nlohmann::json::out_of_range &e) {
372381
obs_log(LOG_INFO, "Bad Login, %i not found", e.id);
373382
connectionError = true;
383+
return;
374384
} catch (...) {
375385
obs_log(LOG_INFO, "Some other issue occurred");
376386
connectionError = true;
387+
return;
377388
}
378389
_LoadUserData(loadData);
379390
}

src/elgato-cloud-data.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ class ElgatoCloud {
6161
bool loading = false;
6262
bool authorizing = false;
6363
bool connectionError = false;
64+
bool loginError = false;
6465

6566
void Thread();
6667
bool mainWindowOpen = false;

src/elgato-cloud-window.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,9 @@ void ElgatoCloudWindow::initialize()
510510
auto loadingWidget = new LoadingWidget(this); // Loading widget, id: 3
511511
_stackedContent->addWidget(loadingWidget);
512512

513+
auto loginErrorWidget = new LoginError(this); // Login error widget, id: 4
514+
_stackedContent->addWidget(loginErrorWidget);
515+
513516
mainLayout->addWidget(_stackedContent);
514517
_mainWidget->setLayout(mainLayout);
515518

@@ -537,6 +540,8 @@ void ElgatoCloudWindow::setLoggedIn()
537540
{
538541
if (elgatoCloud->connectionError) {
539542
_stackedContent->setCurrentIndex(2);
543+
} else if (elgatoCloud->loginError) {
544+
_stackedContent->setCurrentIndex(4);
540545
} else if (!elgatoCloud->loggedIn) {
541546
_stackedContent->setCurrentIndex(1);
542547
} else if (elgatoCloud->loading) {
@@ -706,6 +711,26 @@ LoginNeeded::LoginNeeded(QWidget *parent) : QWidget(parent)
706711
layout->addStretch();
707712
}
708713

714+
LoginError::LoginError(QWidget* parent) : QWidget(parent)
715+
{
716+
auto layout = new QVBoxLayout(this);
717+
718+
auto login = new QLabel(this);
719+
login->setText(obs_module_text("MarketplaceWindow.LoginError.Title"));
720+
login->setStyleSheet("QLabel {font-size: 18pt;}");
721+
login->setAlignment(Qt::AlignCenter);
722+
723+
auto loginSub = new QLabel(this);
724+
loginSub->setText(obs_module_text("MarketplaceWindow.LoginError.Subtitle"));
725+
loginSub->setWordWrap(true);
726+
loginSub->setAlignment(Qt::AlignCenter);
727+
728+
layout->addStretch();
729+
layout->addWidget(login);
730+
layout->addWidget(loginSub);
731+
layout->addStretch();
732+
}
733+
709734
ConnectionError::ConnectionError(QWidget *parent) : QWidget(parent)
710735
{
711736
auto layout = new QVBoxLayout(this);

src/elgato-cloud-window.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,12 @@ class LoginNeeded : public QWidget {
177177
LoginNeeded(QWidget *parent);
178178
};
179179

180+
class LoginError : public QWidget {
181+
Q_OBJECT
182+
public:
183+
LoginError(QWidget* parent);
184+
};
185+
180186
class ConnectionError : public QWidget {
181187
Q_OBJECT
182188
public:

src/export-wizard.cpp

Lines changed: 55 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*
2+
Elgato Deep-Linking OBS Plug-In
3+
Copyright (C) 2024 Corsair Memory Inc. oss.elgato@corsair.com
4+
5+
This program is free software; you can redistribute it and/or modify
6+
it under the terms of the GNU General Public License as published by
7+
the Free Software Foundation; either version 2 of the License, or
8+
(at your option) any later version.
9+
10+
This program is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
GNU General Public License for more details.
14+
15+
You should have received a copy of the GNU General Public License along
16+
with this program. If not, see <https://www.gnu.org/licenses/>
17+
*/
18+
119
#include <algorithm>
220

321
#include "export-wizard.hpp"
@@ -387,13 +405,23 @@ Exporting::~Exporting() {}
387405
StreamPackageExportWizard::StreamPackageExportWizard(QWidget *parent)
388406
: QDialog(parent),
389407
_steps(nullptr)
408+
{
409+
// Save the current scene collection to ensure our output is the latest
410+
obs_frontend_save();
411+
412+
// Since scene collection save is threaded as a Queued connection
413+
// queue the SetupUI to execute *after* the frontend is completely saved.
414+
QMetaObject::invokeMethod(this, "SetupUI", Qt::QueuedConnection);
415+
}
416+
417+
void StreamPackageExportWizard::SetupUI()
390418
{
391419
obs_enum_modules(StreamPackageExportWizard::AddModule, this);
392420
setWindowTitle("Elgato Marketplace Scene Collection Export");
393421
setStyleSheet("background-color: #232323");
394422
std::string homeDir = QDir::homePath().toStdString();
395423

396-
char *currentCollection = obs_frontend_get_current_scene_collection();
424+
char* currentCollection = obs_frontend_get_current_scene_collection();
397425
std::string collectionName = currentCollection;
398426
bfree(currentCollection);
399427

@@ -404,7 +432,7 @@ StreamPackageExportWizard::StreamPackageExportWizard(QWidget *parent)
404432
std::map<std::string, std::string> vidDevs =
405433
bundle->VideoCaptureDevices();
406434

407-
QVBoxLayout *layout = new QVBoxLayout(this);
435+
QVBoxLayout* layout = new QVBoxLayout(this);
408436
_steps = new QStackedWidget(this);
409437

410438
// Step 1- check the media files to be bundled (step index: 0)
@@ -428,7 +456,7 @@ StreamPackageExportWizard::StreamPackageExportWizard(QWidget *parent)
428456
connect(reqPlugins, &RequiredPlugins::continuePressed, this, [this, videoLabels, reqPlugins]() {
429457
auto vidDevLabels = videoLabels->Labels();
430458
auto plugins = reqPlugins->RequiredPluginList();
431-
QWidget *window = (QWidget *)obs_frontend_get_main_window();
459+
QWidget* window = (QWidget*)obs_frontend_get_main_window();
432460
QString filename = QFileDialog::getSaveFileName(
433461
window, "Save As...", QString(), "*.elgatoscene");
434462
if (filename == "") {
@@ -445,33 +473,34 @@ StreamPackageExportWizard::StreamPackageExportWizard(QWidget *parent)
445473
// installer handler thread handling object.
446474
_future =
447475
QtConcurrent::run(createBundle, filename_utf8, plugins,
448-
vidDevLabels)
449-
.then([this](SceneBundleStatus status) {
450-
// We are now in a different thread, so we need to execute this
451-
// back in the gui thread. See, threading hell.
452-
QMetaObject::invokeMethod(
453-
QCoreApplication::instance()
454-
->thread(), // main GUI thread
455-
[this, status]() {
456-
if (status ==
457-
SceneBundleStatus::
458-
Success) {
459-
_steps->setCurrentIndex(
460-
4);
461-
} else if (
462-
status ==
463-
SceneBundleStatus::
464-
Cancelled) {
465-
_steps->setCurrentIndex(
466-
2);
467-
}
468-
});
476+
vidDevLabels)
477+
.then([this](SceneBundleStatus status) {
478+
// We are now in a different thread, so we need to execute this
479+
// back in the gui thread. See, threading hell.
480+
QMetaObject::invokeMethod(
481+
QCoreApplication::instance()
482+
->thread(), // main GUI thread
483+
[this, status]() {
484+
if (status ==
485+
SceneBundleStatus::
486+
Success) {
487+
_steps->setCurrentIndex(
488+
4);
489+
}
490+
else if (
491+
status ==
492+
SceneBundleStatus::
493+
Cancelled) {
494+
_steps->setCurrentIndex(
495+
2);
496+
}
497+
});
469498
})
470-
.onCanceled([]() {
499+
.onCanceled([]() {
471500

472501
});
473502
//createBundle(filename_utf8, plugins, vidDevLabels);
474-
});
503+
});
475504
connect(reqPlugins, &RequiredPlugins::backPressed, this,
476505
[this]() { _steps->setCurrentIndex(1); });
477506
_steps->addWidget(reqPlugins);

src/export-wizard.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,15 @@ class StreamPackageExportWizard : public QDialog {
110110

111111
static void AddModule(void *data, obs_module_t *module);
112112

113+
public slots:
114+
void SetupUI();
115+
113116
private:
114117
QStackedWidget *_steps;
115118
SceneBundle _bundle;
116119
std::vector<obs_module_t *> _modules;
117120
QFuture<void> _future;
121+
bool _waiting;
118122
};
119123

120124
void OpenExportWizard();

src/scene-bundle.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ bool SceneBundle::FromCollection(std::string collection_name)
7171
std::string collection_file_path = scene_collections_path + file_name;
7272
blog(LOG_INFO, "COLLECTION FILE PATH: %s",
7373
collection_file_path.c_str());
74-
// Save the current scene collection to ensure our output is the latest
75-
obs_frontend_save();
7674

7775
// Load the current collection file into a json object
7876
char *collection_str =
@@ -127,7 +125,7 @@ std::string SceneBundle::ExtractBundleInfo(std::string filePath)
127125
void SceneBundle::SceneCollectionCreated(enum obs_frontend_event event,
128126
void *obj)
129127
{
130-
if (event == OBS_FRONTEND_EVENT_SCENE_COLLECTION_LIST_CHANGED) {
128+
if (event == OBS_FRONTEND_EVENT_SCENE_COLLECTION_CHANGED) {
131129
auto inst = static_cast<SceneBundle *>(obj);
132130
if (inst) {
133131
inst->_waiting = false;
@@ -205,6 +203,9 @@ void SceneBundle::ToCollection(std::string collection_name,
205203
newCollectionFileName =
206204
get_scene_collections_path() + newCollectionFileName;
207205

206+
//config_set_string(userConf, "Basic", "SceneCollection", "elgatompplugintemp");
207+
//config_set_string(userConf, "Basic", "SceneCollectionFile", "elgatompplugintemp");
208+
208209
// 7. Set waiting to true to block execution until we switch back to the old scene collection
209210
_waiting = true;
210211

0 commit comments

Comments
 (0)