obs-aitum-multistream/output-dialog.cpp

173 lines
3.6 KiB
C++
Raw Normal View History

#include "output-dialog.hpp"
#include <QDialog>
2024-07-16 18:41:19 +02:00
#include <QVBoxLayout>
#include <QLabel>
#include <QStackedWidget>
2024-07-16 20:52:59 +02:00
#include "obs-module.h"
2024-07-16 18:41:19 +02:00
OutputDialog::OutputDialog(QDialog *parent) : QDialog(parent) {
2024-07-16 20:52:59 +02:00
setModal(true);
2024-07-16 18:41:19 +02:00
stackedWidget = new QStackedWidget;
2024-07-16 18:41:19 +02:00
// Service selection page
stackedWidget->addWidget(WizardServicePage());
2024-07-16 18:41:19 +02:00
// Pages for each service
stackedWidget->addWidget(WizardInfoKick());
stackedWidget->addWidget(WizardInfoYouTube());
stackedWidget->addWidget(WizardInfoTwitter());
stackedWidget->addWidget(WizardInfoUnknown());
stackedWidget->addWidget(WizardInfoTwitch());
stackedWidget->addWidget(WizardInfoTrovo());
stackedWidget->addWidget(WizardInfoTikTok());
stackedWidget->addWidget(WizardInfoFacebook());
stackedWidget->setCurrentIndex(0);
2024-07-16 20:52:59 +02:00
setWindowTitle(obs_module_text("NewOutputWindowTitle"));
2024-07-16 18:41:19 +02:00
auto stackedLayout = new QVBoxLayout;
stackedLayout->addWidget(stackedWidget);
stackedLayout->setAlignment(stackedWidget, Qt::AlignTop);
stackedLayout->setContentsMargins(4, 4, 4, 4);
setMinimumSize(650, 400);
setLayout(stackedLayout);
show();
}
2024-07-16 18:41:19 +02:00
QWidget *OutputDialog::WizardServicePage() {
auto page = new QWidget(this);
auto pageLayout = new QVBoxLayout;
2024-07-16 20:52:59 +02:00
auto description = new QLabel(QString::fromUtf8(obs_module_text("NewOutputSelectService")));
pageLayout->addWidget(description);
// layout for service selection
auto gap = 8;
auto selectionLayout = new QVBoxLayout;
selectionLayout->setSpacing(gap);
// row 1
auto rowOne = new QHBoxLayout;
// row 2
2024-07-16 18:41:19 +02:00
page->setLayout(pageLayout);
return page;
}
QWidget *OutputDialog::WizardInfoKick() {
auto page = new QWidget(this);
auto pageLayout = new QVBoxLayout;
auto title = new QLabel(QString("Kick Service page"));
pageLayout->addWidget(title);
page->setLayout(pageLayout);
return page;
}
QWidget *OutputDialog::WizardInfoYouTube() {
auto page = new QWidget(this);
auto pageLayout = new QVBoxLayout;
auto title = new QLabel(QString("YouTube Service page"));
pageLayout->addWidget(title);
page->setLayout(pageLayout);
return page;
}
QWidget *OutputDialog::WizardInfoTwitter() {
auto page = new QWidget(this);
auto pageLayout = new QVBoxLayout;
auto title = new QLabel(QString("Twitter Service page"));
pageLayout->addWidget(title);
2024-07-16 18:41:19 +02:00
page->setLayout(pageLayout);
return page;
}
2024-07-16 18:41:19 +02:00
QWidget *OutputDialog::WizardInfoUnknown() {
auto page = new QWidget(this);
auto pageLayout = new QVBoxLayout;
auto title = new QLabel(QString("Unknown Service page"));
pageLayout->addWidget(title);
2024-07-16 18:41:19 +02:00
page->setLayout(pageLayout);
return page;
}
2024-07-16 18:41:19 +02:00
QWidget *OutputDialog::WizardInfoTwitch() {
auto page = new QWidget(this);
auto pageLayout = new QVBoxLayout;
2024-07-16 18:41:19 +02:00
auto title = new QLabel(QString("Twitch Service page"));
pageLayout->addWidget(title);
page->setLayout(pageLayout);
return page;
}
2024-07-16 18:41:19 +02:00
QWidget *OutputDialog::WizardInfoTrovo() {
auto page = new QWidget(this);
auto pageLayout = new QVBoxLayout;
auto title = new QLabel(QString("Trovo Service page"));
pageLayout->addWidget(title);
page->setLayout(pageLayout);
return page;
}
QWidget *OutputDialog::WizardInfoTikTok() {
auto page = new QWidget(this);
auto pageLayout = new QVBoxLayout;
auto title = new QLabel(QString("Tiktok Service page"));
pageLayout->addWidget(title);
page->setLayout(pageLayout);
return page;
}
QWidget *OutputDialog::WizardInfoFacebook() {
auto page = new QWidget(this);
auto pageLayout = new QVBoxLayout;
auto title = new QLabel(QString("Facebook Service page"));
pageLayout->addWidget(title);
page->setLayout(pageLayout);
return page;
}