Picture Settings added
This commit is contained in:
parent
556eb1b640
commit
25502d903e
5 changed files with 294 additions and 5 deletions
|
@ -39,7 +39,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="gbSnapmaticFormat">
|
<widget class="QGroupBox" name="gbSnapmaticFormat">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Format</string>
|
<string>Export Format</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
|
@ -62,7 +62,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="gbSnapmaticResolution">
|
<widget class="QGroupBox" name="gbSnapmaticResolution">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Resolution</string>
|
<string>Export Size</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
<item>
|
<item>
|
||||||
|
@ -90,6 +90,9 @@
|
||||||
<layout class="QHBoxLayout" name="hlSnapmaticResolution">
|
<layout class="QHBoxLayout" name="hlSnapmaticResolution">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="labSnapmaticResolutionSize">
|
<widget class="QLabel" name="labSnapmaticResolutionSize">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Custom Size:</string>
|
<string>Custom Size:</string>
|
||||||
</property>
|
</property>
|
||||||
|
|
|
@ -20,6 +20,8 @@
|
||||||
#include "ui_OptionsDialog.h"
|
#include "ui_OptionsDialog.h"
|
||||||
#include "AppEnv.h"
|
#include "AppEnv.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
#include <QDesktopWidget>
|
||||||
|
#include <QApplication>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <QLocale>
|
#include <QLocale>
|
||||||
|
@ -34,13 +36,27 @@ OptionsDialog::OptionsDialog(ProfileDatabase *profileDB, QWidget *parent) :
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
ui->tabWidget->setCurrentIndex(0);
|
ui->tabWidget->setCurrentIndex(0);
|
||||||
|
|
||||||
|
QRect desktopResolution = QApplication::desktop()->screenGeometry();
|
||||||
|
int desktopSizeWidth = desktopResolution.width();
|
||||||
|
int desktopSizeHeight = desktopResolution.height();
|
||||||
|
defExportSize = QSize(960, 536);
|
||||||
|
cusExportSize = defExportSize;
|
||||||
|
defaultQuality = 100;
|
||||||
|
customQuality = 100;
|
||||||
contentMode = 0;
|
contentMode = 0;
|
||||||
settings = new QSettings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR);
|
settings = new QSettings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR);
|
||||||
|
|
||||||
|
percentString = ui->labPicQuality->text();
|
||||||
|
ui->labPicQuality->setText(percentString.arg(QString::number(defaultQuality)));
|
||||||
|
ui->rbPicDesktopRes->setText(ui->rbPicDesktopRes->text().arg(QString::number(desktopSizeWidth), QString::number(desktopSizeHeight)));
|
||||||
|
ui->rbPicDefaultRes->setText(ui->rbPicDefaultRes->text().arg(QString::number(defExportSize.width()), QString::number(defExportSize.height())));
|
||||||
|
|
||||||
setupTreeWidget();
|
setupTreeWidget();
|
||||||
setupLanguageBox();
|
setupLanguageBox();
|
||||||
setupRadioButtons();
|
setupRadioButtons();
|
||||||
setupDefaultProfile();
|
setupDefaultProfile();
|
||||||
|
setupPictureSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
OptionsDialog::~OptionsDialog()
|
OptionsDialog::~OptionsDialog()
|
||||||
|
@ -198,6 +214,25 @@ void OptionsDialog::applySettings()
|
||||||
#endif
|
#endif
|
||||||
settings->endGroup();
|
settings->endGroup();
|
||||||
|
|
||||||
|
settings->beginGroup("Pictures");
|
||||||
|
if (ui->cbPicCustomQuality->isChecked())
|
||||||
|
{
|
||||||
|
settings->setValue("CustomQuality", ui->hsPicQuality->value());
|
||||||
|
}
|
||||||
|
settings->setValue("CustomQualityEnabled", ui->cbPicCustomQuality->isChecked());
|
||||||
|
QString sizeMode = "Default";
|
||||||
|
if (ui->rbPicDesktopRes->isChecked())
|
||||||
|
{
|
||||||
|
sizeMode = "Desktop";
|
||||||
|
}
|
||||||
|
else if (ui->rbPicCustomRes->isChecked())
|
||||||
|
{
|
||||||
|
sizeMode = "Custom";
|
||||||
|
settings->setValue("CustomSize", QSize(ui->sbPicExportWidth->value(), ui->sbPicExportHeight->value()));
|
||||||
|
}
|
||||||
|
settings->setValue("ExportSizeMode", sizeMode);
|
||||||
|
settings->endGroup();
|
||||||
|
|
||||||
#if QT_VERSION >= 0x050000
|
#if QT_VERSION >= 0x050000
|
||||||
emit settingsApplied(newContentMode, ui->cbLanguage->currentData().toString());
|
emit settingsApplied(newContentMode, ui->cbLanguage->currentData().toString());
|
||||||
#else
|
#else
|
||||||
|
@ -241,3 +276,59 @@ void OptionsDialog::commitProfiles(QStringList profiles)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OptionsDialog::on_rbPicCustomRes_toggled(bool checked)
|
||||||
|
{
|
||||||
|
ui->labPicCustomRes->setEnabled(checked);
|
||||||
|
ui->sbPicExportWidth->setEnabled(checked);
|
||||||
|
ui->sbPicExportHeight->setEnabled(checked);
|
||||||
|
ui->labPicXDescription->setEnabled(checked);
|
||||||
|
}
|
||||||
|
|
||||||
|
void OptionsDialog::on_cbPicCustomQuality_toggled(bool checked)
|
||||||
|
{
|
||||||
|
ui->hsPicQuality->setEnabled(checked);
|
||||||
|
ui->labPicQuality->setEnabled(checked);
|
||||||
|
ui->labPicQualityDescription->setEnabled(checked);
|
||||||
|
}
|
||||||
|
|
||||||
|
void OptionsDialog::on_hsPicQuality_valueChanged(int value)
|
||||||
|
{
|
||||||
|
customQuality = value;
|
||||||
|
ui->labPicQuality->setText(percentString.arg(QString::number(value)));
|
||||||
|
}
|
||||||
|
|
||||||
|
void OptionsDialog::setupPictureSettings()
|
||||||
|
{
|
||||||
|
settings->beginGroup("Pictures");
|
||||||
|
|
||||||
|
// Quality Settings
|
||||||
|
customQuality = settings->value("CustomQuality", defaultQuality).toInt();
|
||||||
|
if (customQuality < 1 || customQuality > 100)
|
||||||
|
{
|
||||||
|
customQuality = 100;
|
||||||
|
}
|
||||||
|
ui->hsPicQuality->setValue(customQuality);
|
||||||
|
ui->cbPicCustomQuality->setChecked(settings->value("CustomQualityEnabled", false).toBool());
|
||||||
|
|
||||||
|
// Size Settings
|
||||||
|
cusExportSize = settings->value("CustomSize", defExportSize).toSize();
|
||||||
|
ui->sbPicExportWidth->setValue(cusExportSize.width());
|
||||||
|
ui->sbPicExportHeight->setValue(cusExportSize.height());
|
||||||
|
|
||||||
|
QString sizeMode = settings->value("ExportSizeMode", "Default").toString();
|
||||||
|
if (sizeMode == "Desktop")
|
||||||
|
{
|
||||||
|
ui->rbPicDesktopRes->setChecked(true);
|
||||||
|
}
|
||||||
|
else if (sizeMode == "Custom")
|
||||||
|
{
|
||||||
|
ui->rbPicCustomRes->setChecked(true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ui->rbPicDefaultRes->setChecked(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
settings->endGroup();
|
||||||
|
}
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
#ifndef OPTIONSDIALOG_H
|
#ifndef OPTIONSDIALOG_H
|
||||||
#define OPTIONSDIALOG_H
|
#define OPTIONSDIALOG_H
|
||||||
|
|
||||||
|
#include <QSize>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
|
@ -40,6 +41,9 @@ public:
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void on_cmdOK_clicked();
|
void on_cmdOK_clicked();
|
||||||
|
void on_rbPicCustomRes_toggled(bool checked);
|
||||||
|
void on_cbPicCustomQuality_toggled(bool checked);
|
||||||
|
void on_hsPicQuality_valueChanged(int value);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void settingsApplied(int contentMode, QString language);
|
void settingsApplied(int contentMode, QString language);
|
||||||
|
@ -50,12 +54,18 @@ private:
|
||||||
QList<QTreeWidgetItem*> playerItems;
|
QList<QTreeWidgetItem*> playerItems;
|
||||||
QString currentLanguage;
|
QString currentLanguage;
|
||||||
QString defaultProfile;
|
QString defaultProfile;
|
||||||
|
QString percentString;
|
||||||
QSettings *settings;
|
QSettings *settings;
|
||||||
int contentMode;
|
int contentMode;
|
||||||
|
int customQuality;
|
||||||
|
int defaultQuality;
|
||||||
|
QSize defExportSize;
|
||||||
|
QSize cusExportSize;
|
||||||
void setupTreeWidget();
|
void setupTreeWidget();
|
||||||
void setupLanguageBox();
|
void setupLanguageBox();
|
||||||
void setupRadioButtons();
|
void setupRadioButtons();
|
||||||
void setupDefaultProfile();
|
void setupDefaultProfile();
|
||||||
|
void setupPictureSettings();
|
||||||
void applySettings();
|
void applySettings();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
188
OptionsDialog.ui
188
OptionsDialog.ui
|
@ -6,8 +6,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>400</width>
|
<width>435</width>
|
||||||
<height>350</height>
|
<height>375</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
@ -87,6 +87,190 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QWidget" name="tabPictures">
|
||||||
|
<attribute name="title">
|
||||||
|
<string>Pictures</string>
|
||||||
|
</attribute>
|
||||||
|
<layout class="QVBoxLayout" name="vlTabPictures">
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="gbPicResolution">
|
||||||
|
<property name="title">
|
||||||
|
<string>Export Size</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="vlGbPicRes">
|
||||||
|
<item>
|
||||||
|
<widget class="QRadioButton" name="rbPicDefaultRes">
|
||||||
|
<property name="text">
|
||||||
|
<string>Default Size: %1x%2</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QRadioButton" name="rbPicDesktopRes">
|
||||||
|
<property name="text">
|
||||||
|
<string>Desktop Size: %1x%2</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QRadioButton" name="rbPicCustomRes">
|
||||||
|
<property name="text">
|
||||||
|
<string>Custom Size</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="hlCustomRes">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="labPicCustomRes">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Custom Size:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QSpinBox" name="sbPicExportWidth">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>3840</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>960</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="labPicXDescription">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>x</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QSpinBox" name="sbPicExportHeight">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>2160</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>536</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="hsPicCustomSize">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="gbPicQuality">
|
||||||
|
<property name="title">
|
||||||
|
<string>Export Quality</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="vlHlPicQuality">
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="cbPicCustomQuality">
|
||||||
|
<property name="text">
|
||||||
|
<string>Enable Custom Quality</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="hlPicQuality">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="labPicQualityDescription">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Quality:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QSlider" name="hsPicQuality">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>100</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>100</number>
|
||||||
|
</property>
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="labPicQuality">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>%1%</string>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="vsTabPictures">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
<widget class="QWidget" name="tabPlayers">
|
<widget class="QWidget" name="tabPlayers">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
<string>Players</string>
|
<string>Players</string>
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
|
|
||||||
#include <QDesktopWidget>
|
#include <QDesktopWidget>
|
||||||
#include <QJsonDocument>
|
#include <QJsonDocument>
|
||||||
|
#include <QApplication>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
|
|
Loading…
Reference in a new issue