UI: Add remember settings checkbox to YT broadcast setup
Co-authored-by: cg2121 <claytong1214@gmail.com>master
parent
ca3f244584
commit
35602e3249
|
@ -1220,6 +1220,8 @@ YouTube.Actions.EnableDVR="Enable DVR"
|
|||
YouTube.Actions.360Video="360 video"
|
||||
YouTube.Actions.360Video.Help="<a href='https://vr.youtube.com/create/360/'>(?)</a>"
|
||||
YouTube.Actions.ScheduleForLater="Schedule for later"
|
||||
YouTube.Actions.RememberSettings="Remember these settings"
|
||||
|
||||
YouTube.Actions.Create_Ready="Create broadcast"
|
||||
YouTube.Actions.Create_GoLive="Create broadcast and start streaming"
|
||||
YouTube.Actions.Choose_Ready="Select broadcast"
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>584</width>
|
||||
<height>510</height>
|
||||
<width>585</width>
|
||||
<height>536</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
|
@ -228,6 +228,113 @@
|
|||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<spacer name="horizontalSpacer_14">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkDVR">
|
||||
<property name="text">
|
||||
<string>YouTube.Actions.EnableDVR</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="9" column="0">
|
||||
<spacer name="horizontalSpacer_8">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="9" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_7">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="check360Video">
|
||||
<property name="text">
|
||||
<string>YouTube.Actions.360Video</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="help360Video">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>YouTube.Actions.360Video.Help</string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::RichText</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_10">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="10" column="0">
|
||||
<spacer name="horizontalSpacer_12">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="10" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_9">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkScheduledLater">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>YouTube.Actions.ScheduleForLater</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="11" column="0">
|
||||
<spacer name="horizontalSpacer_6">
|
||||
<property name="orientation">
|
||||
|
@ -320,33 +427,6 @@
|
|||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="10" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_9">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkScheduledLater">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>YouTube.Actions.ScheduleForLater</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="10" column="0">
|
||||
<spacer name="horizontalSpacer_12">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="13" column="0">
|
||||
<spacer name="horizontalSpacer_13">
|
||||
<property name="orientation">
|
||||
|
@ -380,22 +460,19 @@
|
|||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item row="14" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_12">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkDVR">
|
||||
<widget class="QCheckBox" name="checkRememberSettings">
|
||||
<property name="text">
|
||||
<string>YouTube.Actions.EnableDVR</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
<string>YouTube.Actions.RememberSettings</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<spacer name="horizontalSpacer_14">
|
||||
<item row="14" column="0">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
|
@ -407,59 +484,6 @@
|
|||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="9" column="0">
|
||||
<spacer name="horizontalSpacer_8">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="9" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_7">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="check360Video">
|
||||
<property name="text">
|
||||
<string>YouTube.Actions.360Video</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="help360Video">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>YouTube.Actions.360Video.Help</string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::RichText</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_10">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="ytEventList">
|
||||
|
@ -480,7 +504,7 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>179</width>
|
||||
<width>524</width>
|
||||
<height>192</height>
|
||||
</rect>
|
||||
</property>
|
||||
|
|
|
@ -170,6 +170,7 @@ class OBSBasic : public OBSMainWindow {
|
|||
friend class DeviceCaptureToolbar;
|
||||
friend class DeviceToolbarPropertiesThread;
|
||||
friend class OBSBasicSourceSelect;
|
||||
friend class OBSYoutubeActions;
|
||||
friend struct BasicOutputHandler;
|
||||
friend struct OBSStudioAPI;
|
||||
|
||||
|
|
|
@ -232,6 +232,12 @@ OBSYoutubeActions::OBSYoutubeActions(QWidget *parent, Auth *auth,
|
|||
});
|
||||
workerThread->start();
|
||||
|
||||
OBSBasic *main = OBSBasic::Get();
|
||||
bool rememberSettings = config_get_bool(main->basicConfig, "YouTube",
|
||||
"RememberSettings");
|
||||
if (rememberSettings)
|
||||
LoadSettings();
|
||||
|
||||
#ifdef __APPLE__
|
||||
// MacOS theming issues
|
||||
this->resize(this->width() + 200, this->height() + 120);
|
||||
|
@ -628,6 +634,96 @@ void OBSYoutubeActions::UiToBroadcast(BroadcastDescription &broadcast)
|
|||
broadcast.schedul_for_later = ui->checkScheduledLater->isChecked();
|
||||
broadcast.projection = ui->check360Video->isChecked() ? "360"
|
||||
: "rectangular";
|
||||
|
||||
if (ui->checkRememberSettings->isChecked())
|
||||
SaveSettings(broadcast);
|
||||
}
|
||||
|
||||
void OBSYoutubeActions::SaveSettings(BroadcastDescription &broadcast)
|
||||
{
|
||||
OBSBasic *main = OBSBasic::Get();
|
||||
|
||||
config_set_string(main->basicConfig, "YouTube", "Title",
|
||||
QT_TO_UTF8(broadcast.title));
|
||||
config_set_string(main->basicConfig, "YouTube", "Description",
|
||||
QT_TO_UTF8(broadcast.description));
|
||||
config_set_string(main->basicConfig, "YouTube", "Privacy",
|
||||
QT_TO_UTF8(broadcast.privacy));
|
||||
config_set_string(main->basicConfig, "YouTube", "CategoryID",
|
||||
QT_TO_UTF8(broadcast.category.id));
|
||||
config_set_string(main->basicConfig, "YouTube", "Latency",
|
||||
QT_TO_UTF8(broadcast.latency));
|
||||
config_set_bool(main->basicConfig, "YouTube", "MadeForKids",
|
||||
broadcast.made_for_kids);
|
||||
config_set_bool(main->basicConfig, "YouTube", "AutoStart",
|
||||
broadcast.auto_start);
|
||||
config_set_bool(main->basicConfig, "YouTube", "AutoStop",
|
||||
broadcast.auto_start);
|
||||
config_set_bool(main->basicConfig, "YouTube", "DVR", broadcast.dvr);
|
||||
config_set_bool(main->basicConfig, "YouTube", "ScheduleForLater",
|
||||
broadcast.schedul_for_later);
|
||||
config_set_string(main->basicConfig, "YouTube", "Projection",
|
||||
QT_TO_UTF8(broadcast.projection));
|
||||
config_set_bool(main->basicConfig, "YouTube", "RememberSettings", true);
|
||||
}
|
||||
|
||||
void OBSYoutubeActions::LoadSettings()
|
||||
{
|
||||
OBSBasic *main = OBSBasic::Get();
|
||||
|
||||
const char *title =
|
||||
config_get_string(main->basicConfig, "YouTube", "Title");
|
||||
ui->title->setText(QT_UTF8(title));
|
||||
|
||||
const char *desc =
|
||||
config_get_string(main->basicConfig, "YouTube", "Description");
|
||||
ui->description->setPlainText(QT_UTF8(desc));
|
||||
|
||||
const char *priv =
|
||||
config_get_string(main->basicConfig, "YouTube", "Privacy");
|
||||
int index = ui->privacyBox->findData(priv);
|
||||
ui->privacyBox->setCurrentIndex(index);
|
||||
|
||||
const char *catID =
|
||||
config_get_string(main->basicConfig, "YouTube", "CategoryID");
|
||||
index = ui->categoryBox->findData(catID);
|
||||
ui->categoryBox->setCurrentIndex(index);
|
||||
|
||||
const char *latency =
|
||||
config_get_string(main->basicConfig, "YouTube", "Latency");
|
||||
index = ui->latencyBox->findData(latency);
|
||||
ui->latencyBox->setCurrentIndex(index);
|
||||
|
||||
bool dvr = config_get_bool(main->basicConfig, "YouTube", "DVR");
|
||||
ui->checkDVR->setChecked(dvr);
|
||||
|
||||
bool forKids =
|
||||
config_get_bool(main->basicConfig, "YouTube", "MadeForKids");
|
||||
if (forKids)
|
||||
ui->yesMakeForKids->setChecked(true);
|
||||
else
|
||||
ui->notMakeForKids->setChecked(true);
|
||||
|
||||
bool autoStart =
|
||||
config_get_bool(main->basicConfig, "YouTube", "AutoStart");
|
||||
ui->checkAutoStart->setChecked(autoStart);
|
||||
|
||||
bool autoStop =
|
||||
config_get_bool(main->basicConfig, "YouTube", "AutoStop");
|
||||
ui->checkAutoStop->setChecked(autoStop);
|
||||
|
||||
bool schedLater = config_get_bool(main->basicConfig, "YouTube",
|
||||
"ScheduleForLater");
|
||||
ui->checkScheduledLater->setChecked(schedLater);
|
||||
|
||||
const char *projection =
|
||||
config_get_string(main->basicConfig, "YouTube", "Projection");
|
||||
if (projection && *projection) {
|
||||
if (strcmp(projection, "360") == 0)
|
||||
ui->check360Video->setChecked(true);
|
||||
else
|
||||
ui->check360Video->setChecked(false);
|
||||
}
|
||||
}
|
||||
|
||||
void OBSYoutubeActions::OpenYouTubeDashboard()
|
||||
|
|
|
@ -62,6 +62,8 @@ private:
|
|||
void OpenYouTubeDashboard();
|
||||
void Cancel();
|
||||
void Accept();
|
||||
void SaveSettings(BroadcastDescription &broadcast);
|
||||
void LoadSettings();
|
||||
|
||||
QString selectedBroadcast;
|
||||
bool autostart, autostop;
|
||||
|
|
Loading…
Reference in New Issue