-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UI: PreStream Wizard add completion page
Adds a completion page with content that depends on destinations. Back button is disabled on the last page where application will take place since updating settings is undoable. Various code fixes.
- Loading branch information
Showing
16 changed files
with
153 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#include "page-completed.hpp" | ||
|
||
#include <QVBoxLayout> | ||
#include <QLabel> | ||
#include <QPushButton> | ||
#include <QUrl> | ||
#include <QSpacerItem> | ||
#include <QDesktopServices> | ||
|
||
#include "obs-app.hpp" | ||
|
||
namespace StreamWizard { | ||
|
||
CompletedPage::CompletedPage(Destination destination, | ||
LaunchContext launchContext, QWidget *parent) | ||
: QWizardPage(parent) | ||
{ | ||
destination_ = destination; | ||
launchContext_ = launchContext; | ||
|
||
setTitle(QTStr("PreLiveWizard.Completed.Title")); | ||
|
||
QVBoxLayout *mainlayout = new QVBoxLayout(this); | ||
setLayout(mainlayout); | ||
|
||
// Later will suggest starting stream if launchContext is PreStream | ||
QLabel *closeLabel = | ||
new QLabel(QTStr("PreLiveWizard.Completed.BodyText"), this); | ||
closeLabel->setWordWrap(true); | ||
mainlayout->addWidget(closeLabel); | ||
|
||
if (destination_ == Destination::Facebook) { | ||
mainlayout->addSpacerItem(new QSpacerItem(12, 12)); | ||
|
||
QLabel *facebookGoLiveLabel = new QLabel( | ||
QTStr("PreLiveWizard.Completed.FacebookOnly"), this); | ||
facebookGoLiveLabel->setWordWrap(true); | ||
QPushButton *launchButton = new QPushButton( | ||
QTStr("PreLiveWizard.Prompt.FBResolutionHelpButton.FB"), | ||
this); | ||
launchButton->setToolTip(QTStr( | ||
"PreLiveWizard.Prompt.FBResolutionHelpButton.FB.ToolTip")); | ||
connect(launchButton, &QPushButton::clicked, this, | ||
&CompletedPage::didPushOpenWebsite); | ||
|
||
mainlayout->addWidget(facebookGoLiveLabel); | ||
mainlayout->addWidget(launchButton); | ||
} | ||
} | ||
|
||
void CompletedPage::didPushOpenWebsite() | ||
{ | ||
QUrl helpUrl; | ||
|
||
// Prepare per-destination | ||
if (destination_ == Destination::Facebook) { | ||
helpUrl = QUrl( | ||
"https://www.facebook.com/live/producer/?ref=OBS_Wizard", | ||
QUrl::TolerantMode); | ||
} else { | ||
return; | ||
} | ||
// Launch | ||
if (helpUrl.isValid()) { | ||
QDesktopServices::openUrl(helpUrl); | ||
} | ||
} | ||
|
||
} // namespace StreamWizard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#pragma once | ||
|
||
#include <QWizardPage> | ||
|
||
#include "pre-stream-current-settings.hpp" | ||
|
||
namespace StreamWizard { | ||
|
||
// Last Page | ||
class CompletedPage : public QWizardPage { | ||
Q_OBJECT | ||
|
||
public: | ||
CompletedPage(Destination destination, LaunchContext launchContext, | ||
QWidget *parent = nullptr); | ||
|
||
private: | ||
Destination destination_; | ||
LaunchContext launchContext_; | ||
|
||
private slots: | ||
void didPushOpenWebsite(); | ||
|
||
}; // class CompletedPage | ||
|
||
} // namespace StreamWizard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.