New upstream version 18.0.1+dfsg1
This commit is contained in:
parent
6efda2859e
commit
f2cf6cce50
1337 changed files with 41178 additions and 84670 deletions
|
|
@ -20,6 +20,7 @@
|
|||
#include <util/util.hpp>
|
||||
#include <QMessageBox>
|
||||
#include <QVariant>
|
||||
#include <QFileDialog>
|
||||
#include "window-basic-main.hpp"
|
||||
#include "window-namedialog.hpp"
|
||||
#include "qt-wrappers.hpp"
|
||||
|
|
@ -448,6 +449,93 @@ void OBSBasic::on_actionRemoveProfile_triggered()
|
|||
}
|
||||
}
|
||||
|
||||
void OBSBasic::on_actionImportProfile_triggered()
|
||||
{
|
||||
char path[512];
|
||||
|
||||
QString home = QDir::homePath();
|
||||
|
||||
int ret = GetConfigPath(path, 512, "obs-studio/basic/profiles/");
|
||||
if (ret <= 0) {
|
||||
blog(LOG_WARNING, "Failed to get profile config path");
|
||||
return;
|
||||
}
|
||||
|
||||
QString dir = QFileDialog::getExistingDirectory(
|
||||
this,
|
||||
QTStr("Basic.MainMenu.Profile.Import"),
|
||||
home,
|
||||
QFileDialog::ShowDirsOnly |
|
||||
QFileDialog::DontResolveSymlinks);
|
||||
|
||||
if (!dir.isEmpty() && !dir.isNull()) {
|
||||
QString inputPath = QString::fromUtf8(path);
|
||||
QFileInfo finfo(dir);
|
||||
QString directory = finfo.fileName();
|
||||
QString profileDir = inputPath + directory;
|
||||
QDir folder(profileDir);
|
||||
|
||||
if (!folder.exists()) {
|
||||
folder.mkpath(profileDir);
|
||||
QFile::copy(dir + "/basic.ini",
|
||||
profileDir + "/basic.ini");
|
||||
QFile::copy(dir + "/service.json",
|
||||
profileDir + "/service.json");
|
||||
QFile::copy(dir + "/streamEncoder.json",
|
||||
profileDir + "/streamEncoder.json");
|
||||
QFile::copy(dir + "/recordEncoder.json",
|
||||
profileDir + "/recordEncoder.json");
|
||||
RefreshProfiles();
|
||||
} else {
|
||||
QMessageBox::information(this,
|
||||
QTStr("Basic.MainMenu.Profile.Import"),
|
||||
QTStr("Basic.MainMenu.Profile.Exists"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void OBSBasic::on_actionExportProfile_triggered()
|
||||
{
|
||||
char path[512];
|
||||
|
||||
QString home = QDir::homePath();
|
||||
|
||||
QString currentProfile =
|
||||
QString::fromUtf8(config_get_string(App()->GlobalConfig(),
|
||||
"Basic", "ProfileDir"));
|
||||
|
||||
int ret = GetConfigPath(path, 512, "obs-studio/basic/profiles/");
|
||||
if (ret <= 0) {
|
||||
blog(LOG_WARNING, "Failed to get profile config path");
|
||||
return;
|
||||
}
|
||||
|
||||
QString dir = QFileDialog::getExistingDirectory(
|
||||
this,
|
||||
QTStr("Basic.MainMenu.Profile.Export"),
|
||||
home,
|
||||
QFileDialog::ShowDirsOnly |
|
||||
QFileDialog::DontResolveSymlinks);
|
||||
|
||||
if (!dir.isEmpty() && !dir.isNull()) {
|
||||
QString outputDir = dir + "/" + currentProfile;
|
||||
QString inputPath = QString::fromUtf8(path);
|
||||
QDir folder(outputDir);
|
||||
|
||||
if (!folder.exists()) {
|
||||
folder.mkpath(outputDir);
|
||||
QFile::copy(inputPath + currentProfile + "/basic.ini",
|
||||
outputDir + "/basic.ini");
|
||||
QFile::copy(inputPath + currentProfile + "/service.json",
|
||||
outputDir + "/service.json");
|
||||
QFile::copy(inputPath + currentProfile + "/streamEncoder.json",
|
||||
outputDir + "/streamEncoder.json");
|
||||
QFile::copy(inputPath + currentProfile + "/recordEncoder.json",
|
||||
outputDir + "/recordEncoder.json");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void OBSBasic::ChangeProfile()
|
||||
{
|
||||
QAction *action = reinterpret_cast<QAction*>(sender());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue