Skip to content

Commit 52c8d70

Browse files
Release/1.0.0 rc7 (#19)
* Update text for Update modal. * Fixes double checkbox in config screen. * Updates utm parameters for outgoing marketplace web store link. * Fixes camera selection of 'None' crashing setup wizard. * Remove debug logging.
1 parent df2cf66 commit 52c8d70

File tree

9 files changed

+82
-76
lines changed

9 files changed

+82
-76
lines changed

buildspec.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"versionMinor": 0,
4343
"versionPatch": 0,
4444
"buildNumber": 0,
45-
"releaseType": "rc6",
45+
"releaseType": "rc7",
4646
"author": "Elgato",
4747
"website": "https://elgato.com",
4848
"email": "support@elgato.com",

data/locale/en-US.ini

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,8 @@ SetupWizard.Loading.Title="Loading Collection..."
6666
SetupWizard.Loading.Text="Note: this can take some time for scene collections with large files."
6767
SetupWizard.IncompatibleFile.Title="Incompatible file"
6868
SetupWizard.IncompatibleFile.Text="Error: This download did not contain a valid bundleInfo.json file and cannot be installed. (note: this is a problem with the submitted scene collection file on the server)"
69-
7069
UpdateModal.Title="Update available"
71-
UpdateModal.SkipVersionButton="Skip this verison"
72-
UpdateModal.LaterButton="Remind me later"
73-
UpdateModal.DownloadUpdateButton="Download Update"
74-
UpdateModal.Description="A new version of the Marketplace Direct to OBS is available to download, please download to maintain functionality!
70+
UpdateModal.SkipVersionButton="No thanks"
71+
UpdateModal.LaterButton="Ask me later"
72+
UpdateModal.DownloadUpdateButton="Update now"
73+
UpdateModal.Description="Get the latest version of Elgato Marketplace Connect to access new features and improvements"

src/elgato-cloud-data.cpp

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,7 @@ void ElgatoCloud::_TokenRefresh(bool loadData, bool loadUserDetails)
132132
if (mainWindowOpen && window) {
133133
QMetaObject::invokeMethod(
134134
QCoreApplication::instance()->thread(),
135-
[this]() {
136-
window->setLoggedIn();
137-
});
135+
[this]() { window->setLoggedIn(); });
138136
}
139137
}
140138
}
@@ -198,14 +196,17 @@ void ElgatoCloud::_Listen()
198196
auto response = fetch_string_from_post(
199197
url, encodeddata);
200198

201-
auto responseJson = nlohmann::json::parse(response);
199+
auto responseJson =
200+
nlohmann::json::parse(response);
202201

203202
if (responseJson.contains("error")) {
204203
if (mainWindowOpen && window) {
205204
QMetaObject::invokeMethod(
206-
QCoreApplication::instance()->thread(),
205+
QCoreApplication::instance()
206+
->thread(),
207207
[this]() {
208-
loginError = true;
208+
loginError =
209+
true;
209210
window->setLoggedIn();
210211
});
211212
}
@@ -289,31 +290,32 @@ void ElgatoCloud::LogOut()
289290
void ElgatoCloud::CheckUpdates(bool forceCheck)
290291
{
291292
try {
292-
std::string updateUrl = "https://gc-updates.elgato.com/windows/marketplace-plugin-for-obs/final/app-version-check.json.php";
293+
std::string updateUrl =
294+
"https://gc-updates.elgato.com/windows/marketplace-plugin-for-obs/final/app-version-check.json.php";
293295
auto response = fetch_string_from_get(updateUrl, "");
294-
blog(LOG_INFO, response.c_str());
295296
auto responseJson = nlohmann::json::parse(response);
296297
if (responseJson.contains("Automatic")) {
297298
auto details = responseJson["Automatic"];
298299
std::string version = details["Version"];
299300
std::string downloadUrl = details["downloadURL"];
300-
auto updateVersion = QVersionNumber::fromString(version);
301-
auto currentVersion = QVersionNumber::fromString(PLUGIN_VERSION);
302-
std::string skip = _skipUpdate == "" ? "0.0.0" : _skipUpdate;
303-
blog(LOG_INFO, "update: %s, current: %s, skip: %s", version.c_str(), PLUGIN_VERSION, skip.c_str());
301+
auto updateVersion =
302+
QVersionNumber::fromString(version);
303+
auto currentVersion =
304+
QVersionNumber::fromString(PLUGIN_VERSION);
305+
std::string skip = _skipUpdate == "" ? "0.0.0"
306+
: _skipUpdate;
304307
auto skipVersion = QVersionNumber::fromString(skip);
305-
if ((forceCheck || skipVersion != updateVersion) && updateVersion > currentVersion) {
308+
if ((forceCheck || skipVersion != updateVersion) &&
309+
updateVersion > currentVersion) {
306310
// Reset the "skip this update" flag because we now have a
307311
// new update.
308-
_skipUpdate = !forceCheck ? "" : _skipUpdate;
309-
blog(LOG_INFO, "UPDATE FOUND.");
312+
_skipUpdate = !forceCheck ? "" : _skipUpdate;
310313
openUpdateModal(version, downloadUrl);
311314
}
312315
} else {
313316
throw("Error");
314317
}
315-
}
316-
catch (...) {
318+
} catch (...) {
317319
blog(LOG_INFO, "Unable to contact update server.");
318320
}
319321
}
@@ -391,9 +393,6 @@ nlohmann::json ElgatoCloud::GetPurchaseDownloadLink(std::string variantId)
391393
auto response = fetch_string_from_get(api_url, _accessToken);
392394
// Todo- Error checking
393395
try {
394-
blog(LOG_INFO,
395-
"============= DOWNLOAD REQUEST API RESPONSE =============\nURL: %s\nResponse: %s",
396-
api_url.c_str(), response.c_str());
397396
auto responseJson = nlohmann::json::parse(response);
398397
return responseJson;
399398
} catch (...) {
@@ -453,7 +452,6 @@ void ElgatoCloud::_LoadUserData(bool loadData)
453452
fetch_string_from_get(api_url, _accessToken);
454453
auto userData = nlohmann::json::parse(userResponse);
455454
api->setUserDetails(userData);
456-
blog(LOG_INFO, "User Response:\n%s", userResponse.c_str());
457455
if (mainWindowOpen && window) {
458456
QMetaObject::invokeMethod(
459457
QCoreApplication::instance()->thread(),
@@ -494,6 +492,7 @@ void ElgatoCloud::_GetSavedState()
494492
_refreshTokenExpiration =
495493
obs_data_get_int(_config, "RefreshTokenExpiration");
496494
_skipUpdate = obs_data_get_string(_config, "SkipUpdate");
495+
_skipUpdate = "";
497496
}
498497

499498
} // namespace elgatocloud

src/elgato-cloud-window.cpp

Lines changed: 32 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,10 @@ DownloadButton::DownloadButton(QWidget *parent) : QWidget(parent)
100100
QSizePolicy::Preferred);
101101

102102
_downloadButton = new QPushButton(this);
103-
_downloadButton->setToolTip(obs_module_text("MarketplaceWindow.DownloadButton.Tooltip"));
103+
_downloadButton->setToolTip(
104+
obs_module_text("MarketplaceWindow.DownloadButton.Tooltip"));
104105
std::string downloadIconPath = imageBaseDir + "download.svg";
105106
std::string downloadIconHoverPath = imageBaseDir + "download_hover.svg";
106-
blog(LOG_INFO, "download img: ", downloadIconPath.c_str());
107107
std::string downloadIconDisabledPath =
108108
imageBaseDir + "download_hover.svg";
109109
QString buttonStyle = EIconHoverDisabledButtonStyle;
@@ -226,7 +226,9 @@ WindowToolBar::WindowToolBar(QWidget *parent) : QWidget(parent)
226226
imageBaseDir += "/images/";
227227

228228
auto api = MarketplaceApi::getInstance();
229-
std::string storeUrl = api->storeUrl() + "/obs/scene-collections?utm_source=mp_connect";
229+
std::string storeUrl =
230+
api->storeUrl() +
231+
"/obs/scene-collections?utm_source=mp_connect&utm_medium=direct_software&utm_campaign=v_1.0";
230232

231233
QPalette pal = QPalette();
232234
pal.setColor(QPalette::Window, "#151515");
@@ -245,7 +247,8 @@ WindowToolBar::WindowToolBar(QWidget *parent) : QWidget(parent)
245247
_layout->addStretch();
246248

247249
_settingsButton = new QPushButton(this);
248-
_settingsButton->setToolTip(obs_module_text("MarketplaceWindow.OpenSettingsButton.Tooltip"));
250+
_settingsButton->setToolTip(obs_module_text(
251+
"MarketplaceWindow.OpenSettingsButton.Tooltip"));
249252
std::string settingsIconPath = imageBaseDir + "settings.svg";
250253
std::string settingsIconHoverPath = imageBaseDir + "settings_hover.svg";
251254
QString settingsButtonStyle = EIconHoverButtonStyle;
@@ -262,7 +265,8 @@ WindowToolBar::WindowToolBar(QWidget *parent) : QWidget(parent)
262265
_layout->addWidget(_settingsButton);
263266

264267
_storeButton = new QPushButton(this);
265-
_storeButton->setToolTip(obs_module_text("MarketplaceWindow.StoreButton.Tooltip"));
268+
_storeButton->setToolTip(
269+
obs_module_text("MarketplaceWindow.StoreButton.Tooltip"));
266270
std::string storeIconPath = imageBaseDir + "marketplace-logo.svg";
267271
std::string storeIconHoverPath =
268272
imageBaseDir + "marketplace-logo_hover.svg";
@@ -281,7 +285,8 @@ WindowToolBar::WindowToolBar(QWidget *parent) : QWidget(parent)
281285
_layout->addWidget(_storeButton);
282286

283287
_logInButton = new QPushButton(this);
284-
_logInButton->setText(obs_module_text("MarketplaceWindow.LoginButton.LogIn"));
288+
_logInButton->setText(
289+
obs_module_text("MarketplaceWindow.LoginButton.LogIn"));
285290
_logInButton->setHidden(elgatoCloud->loggedIn);
286291
_logInButton->setStyleSheet(
287292
"QPushButton {font-size: 12pt; border-radius: 8px; padding: 8px; background-color: #232323; border: none; } "
@@ -291,7 +296,8 @@ WindowToolBar::WindowToolBar(QWidget *parent) : QWidget(parent)
291296
[this]() { elgatoCloud->StartLogin(); });
292297

293298
_logOutButton = new QPushButton(this);
294-
_logOutButton->setText(obs_module_text("MarketplaceWindow.LoginButton.LogOut"));
299+
_logOutButton->setText(
300+
obs_module_text("MarketplaceWindow.LoginButton.LogOut"));
295301
_logOutButton->setHidden(!elgatoCloud->loggedIn);
296302
_logOutButton->setStyleSheet(
297303
"QPushButton {font-size: 12pt; border-radius: 8px; padding: 8px; background-color: #232323; border: none; } "
@@ -396,7 +402,8 @@ OwnedProducts::OwnedProducts(QWidget *parent) : QWidget(parent)
396402
connect(_sideMenu, &QListWidget::itemPressed, this,
397403
[this](QListWidgetItem *item) {
398404
QString val = item->text();
399-
if (val == obs_module_text("MarketplaceWindow.PurchasedTab")) {
405+
if (val ==
406+
obs_module_text("MarketplaceWindow.PurchasedTab")) {
400407
if (_numProducts > 0)
401408
_content->setCurrentIndex(0);
402409
else
@@ -422,12 +429,14 @@ OwnedProducts::OwnedProducts(QWidget *parent) : QWidget(parent)
422429
auto npLayout = new QVBoxLayout(noProducts);
423430
npLayout->addStretch();
424431
auto npTitle = new QLabel(
425-
obs_module_text("MarketplaceWindow.Purchased.NoPurchasesTitle"), noProducts);
432+
obs_module_text("MarketplaceWindow.Purchased.NoPurchasesTitle"),
433+
noProducts);
426434
npTitle->setStyleSheet("QLabel {font-size: 18pt;}");
427435
npTitle->setAlignment(Qt::AlignCenter);
428436
npLayout->addWidget(npTitle);
429437
auto npSubTitle = new QLabel(
430-
obs_module_text("MarketplaceWindow.Purchased.NoPurchasesSubtitle"),
438+
obs_module_text(
439+
"MarketplaceWindow.Purchased.NoPurchasesSubtitle"),
431440
noProducts);
432441
npSubTitle->setStyleSheet("QLabel {font-size: 13pt;}");
433442
npSubTitle->setAlignment(Qt::AlignCenter);
@@ -515,7 +524,8 @@ void ElgatoCloudWindow::initialize()
515524
auto loadingWidget = new LoadingWidget(this); // Loading widget, id: 3
516525
_stackedContent->addWidget(loadingWidget);
517526

518-
auto loginErrorWidget = new LoginError(this); // Login error widget, id: 4
527+
auto loginErrorWidget =
528+
new LoginError(this); // Login error widget, id: 4
519529
_stackedContent->addWidget(loginErrorWidget);
520530

521531
mainLayout->addWidget(_stackedContent);
@@ -709,13 +719,15 @@ LoginNeeded::LoginNeeded(QWidget *parent) : QWidget(parent)
709719
login->setAlignment(Qt::AlignCenter);
710720

711721
auto loginSub = new QLabel(this);
712-
loginSub->setText(obs_module_text("MarketplaceWindow.LoginNeeded.Subtitle"));
722+
loginSub->setText(
723+
obs_module_text("MarketplaceWindow.LoginNeeded.Subtitle"));
713724
loginSub->setWordWrap(true);
714725
loginSub->setAlignment(Qt::AlignCenter);
715726

716727
auto hLayout = new QHBoxLayout();
717728
auto loginButton = new QPushButton(this);
718-
loginButton->setText(obs_module_text("MarketplaceWindow.LoginButton.LogIn"));
729+
loginButton->setText(
730+
obs_module_text("MarketplaceWindow.LoginButton.LogIn"));
719731
loginButton->setHidden(elgatoCloud->loggedIn);
720732
loginButton->setStyleSheet(
721733
"QPushButton {font-size: 12pt; border-radius: 8px; padding: 8px; background-color: #232323; border: none; } "
@@ -732,7 +744,7 @@ LoginNeeded::LoginNeeded(QWidget *parent) : QWidget(parent)
732744
layout->addStretch();
733745
}
734746

735-
LoginError::LoginError(QWidget* parent) : QWidget(parent)
747+
LoginError::LoginError(QWidget *parent) : QWidget(parent)
736748
{
737749
auto layout = new QVBoxLayout(this);
738750

@@ -742,7 +754,8 @@ LoginError::LoginError(QWidget* parent) : QWidget(parent)
742754
login->setAlignment(Qt::AlignCenter);
743755

744756
auto loginSub = new QLabel(this);
745-
loginSub->setText(obs_module_text("MarketplaceWindow.LoginError.Subtitle"));
757+
loginSub->setText(
758+
obs_module_text("MarketplaceWindow.LoginError.Subtitle"));
746759
loginSub->setWordWrap(true);
747760
loginSub->setAlignment(Qt::AlignCenter);
748761

@@ -878,10 +891,12 @@ extern void CheckForUpdates(bool forceCheck)
878891
elgatoCloud->CheckUpdates(forceCheck);
879892
}
880893

881-
extern void CheckForUpdatesOnLaunch(enum obs_frontend_event event, void* private_data)
894+
extern void CheckForUpdatesOnLaunch(enum obs_frontend_event event,
895+
void *private_data)
882896
{
883897
if (event == OBS_FRONTEND_EVENT_FINISHED_LOADING) {
884-
obs_frontend_remove_event_callback(CheckForUpdatesOnLaunch, nullptr);
898+
obs_frontend_remove_event_callback(CheckForUpdatesOnLaunch,
899+
nullptr);
885900
CheckForUpdates(false);
886901
}
887902
}

src/elgato-styles.hpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,16 +147,12 @@ inline const QString ECheckBoxStyle =
147147
"QCheckBox::indicator {"
148148
"width: 20px;"
149149
"height: 20px;"
150-
"background-image: none;"
151-
"border: none;"
152150
"}"
153151
"QCheckBox::indicator:checked {"
154-
"border: none;"
155-
"background-image: url('${checked-img}')"
152+
"image: url('${checked-img}')"
156153
"}"
157154
"QCheckBox::indicator:unchecked {"
158-
"border: none;"
159-
"background-image: url('${unchecked-img}')"
155+
"image: url('${unchecked-img}')"
160156
"}";
161157

162158
inline const QString EComboBoxStyle = "QComboBox {"

src/elgato-update-modal.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ ElgatoUpdateModal* updateModal = nullptr;
2121
ElgatoUpdateModal::ElgatoUpdateModal(QWidget* parent, std::string version, std::string downloadUrl)
2222
: QDialog(parent)
2323
{
24+
setWindowTitle(QString("Elgato Marketplace Connect Update Available"));
2425
setFixedSize(QSize(680, 300));
2526
setAttribute(Qt::WA_DeleteOnClose);
2627

src/elgato-widgets.cpp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ VideoCaptureSourceSelector::VideoCaptureSourceSelector(QWidget *parent,
6363
_videoPreview->hide();
6464

6565
_blank = new QLabel(this);
66-
_blank->setText(
67-
obs_module_text("MarketplaceWindow.Settings.DefaultVideoDevice.NoneSelected"));
66+
_blank->setText(obs_module_text(
67+
"MarketplaceWindow.Settings.DefaultVideoDevice.NoneSelected"));
6868
_blank->setAlignment(Qt::AlignCenter);
6969
_blank->setFixedHeight(144);
7070

@@ -97,8 +97,8 @@ VideoCaptureSourceSelector::VideoCaptureSourceSelector(QWidget *parent,
9797
auto vSettings = obs_data_create();
9898
std::string id = _videoSourceIds[index];
9999
obs_data_set_string(vSettings,
100-
"video_device_id",
101-
id.c_str());
100+
"video_device_id",
101+
id.c_str());
102102
_changeSource(vSettings);
103103
obs_data_release(vSettings);
104104
} else {
@@ -163,15 +163,14 @@ void VideoCaptureSourceSelector::_setupTempSource(obs_data_t *videoData)
163163
void VideoCaptureSourceSelector::_changeSource(obs_data_t *vSettings)
164164
{
165165
if (vSettings != nullptr) {
166-
blog(LOG_INFO, "_changeSource called.");
167166
if (_videoCaptureSource) {
168-
obs_source_t* tmp = _videoCaptureSource;
167+
obs_source_t *tmp = _videoCaptureSource;
169168
_videoCaptureSource = nullptr;
170169
obs_source_release(tmp);
171170
}
172171

173-
const char* videoSourceId = "dshow_input";
174-
const char* vId = obs_get_latest_input_type_id(videoSourceId);
172+
const char *videoSourceId = "dshow_input";
173+
const char *vId = obs_get_latest_input_type_id(videoSourceId);
175174
_videoCaptureSource = obs_source_create_private(
176175
vId, "elgato-cloud-video-config", vSettings);
177176

@@ -183,12 +182,11 @@ void VideoCaptureSourceSelector::_changeSource(obs_data_t *vSettings)
183182
this->_videoPreview->hide();
184183
this->_blank->show();
185184
if (_videoCaptureSource) {
186-
obs_source_t* tmp = _videoCaptureSource;
185+
obs_source_t *tmp = _videoCaptureSource;
187186
_videoCaptureSource = nullptr;
188187
obs_source_release(tmp);
189188
}
190189
}
191-
192190
}
193191

194192
void VideoCaptureSourceSelector::DrawVideoPreview(void *data, uint32_t cx,
@@ -230,6 +228,9 @@ void VideoCaptureSourceSelector::DrawVideoPreview(void *data, uint32_t cx,
230228

231229
std::string VideoCaptureSourceSelector::GetSettings() const
232230
{
231+
if (!_videoCaptureSource) {
232+
return "{}";
233+
}
233234
obs_data_t *vSettings = obs_source_get_settings(_videoCaptureSource);
234235
std::string vJson = obs_data_get_json(vSettings);
235236
obs_data_release(vSettings);

0 commit comments

Comments
 (0)