added default profile, added contentMode for selection/open
This commit is contained in:
parent
0e8b86abc5
commit
a81e2e142e
13 changed files with 218 additions and 67 deletions
|
@ -34,12 +34,18 @@ OptionsDialog::OptionsDialog(ProfileDatabase *profileDB, QWidget *parent) :
|
|||
{
|
||||
ui->setupUi(this);
|
||||
ui->tabWidget->setCurrentIndex(0);
|
||||
contentMode = 0;
|
||||
settings = new QSettings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR);
|
||||
|
||||
setupTreeWidget();
|
||||
setupLanguageBox();
|
||||
setupRadioButtons();
|
||||
setupDefaultProfile();
|
||||
}
|
||||
|
||||
OptionsDialog::~OptionsDialog()
|
||||
{
|
||||
delete settings;
|
||||
foreach(QTreeWidgetItem *playerItem, playerItems)
|
||||
{
|
||||
delete playerItem;
|
||||
|
@ -71,10 +77,9 @@ void OptionsDialog::setupTreeWidget()
|
|||
|
||||
void OptionsDialog::setupLanguageBox()
|
||||
{
|
||||
QSettings settings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR);
|
||||
settings.beginGroup("Interface");
|
||||
currentLanguage = settings.value("Language","System").toString();
|
||||
settings.endGroup();
|
||||
settings->beginGroup("Interface");
|
||||
currentLanguage = settings->value("Language","System").toString();
|
||||
settings->endGroup();
|
||||
|
||||
QString cbSysStr = tr("%1 (%2 if available) [sys]", "System like PC System = %1, System Language like Deutsch = %2").arg(tr("System",
|
||||
"System like PC System"), QLocale::system().nativeLanguageName());
|
||||
|
@ -117,6 +122,30 @@ void OptionsDialog::setupLanguageBox()
|
|||
}
|
||||
}
|
||||
|
||||
void OptionsDialog::setupRadioButtons()
|
||||
{
|
||||
bool contentModeOk;
|
||||
settings->beginGroup("Profile");
|
||||
contentMode = settings->value("ContentMode", 0).toInt(&contentModeOk);
|
||||
settings->endGroup();
|
||||
|
||||
if (contentModeOk)
|
||||
{
|
||||
if (contentMode == 0)
|
||||
{
|
||||
ui->rbOpenWithSC->setChecked(true);
|
||||
}
|
||||
else if (contentMode == 1)
|
||||
{
|
||||
ui->rbOpenWithDC->setChecked(true);
|
||||
}
|
||||
else if (contentMode == 2)
|
||||
{
|
||||
ui->rbSelectWithSC->setChecked(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void OptionsDialog::on_cmdOK_clicked()
|
||||
{
|
||||
applySettings();
|
||||
|
@ -125,13 +154,54 @@ void OptionsDialog::on_cmdOK_clicked()
|
|||
|
||||
void OptionsDialog::applySettings()
|
||||
{
|
||||
QSettings settings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR);
|
||||
settings.beginGroup("Interface");
|
||||
settings.setValue("Language", ui->cbLanguage->currentData());
|
||||
settings.endGroup();
|
||||
settings->beginGroup("Interface");
|
||||
settings->setValue("Language", ui->cbLanguage->currentData());
|
||||
settings->endGroup();
|
||||
|
||||
settings->beginGroup("Profile");
|
||||
int newContentMode = 0;
|
||||
if (ui->rbOpenWithSC->isChecked())
|
||||
{
|
||||
newContentMode = 0;
|
||||
}
|
||||
else if (ui->rbOpenWithDC->isChecked())
|
||||
{
|
||||
newContentMode = 1;
|
||||
}
|
||||
else if (ui->rbSelectWithSC->isChecked())
|
||||
{
|
||||
newContentMode = 2;
|
||||
}
|
||||
settings->setValue("ContentMode", newContentMode);
|
||||
settings->setValue("Default", ui->cbProfiles->currentData());
|
||||
settings->endGroup();
|
||||
|
||||
emit settingsApplied(newContentMode, ui->cbLanguage->currentData().toString());
|
||||
|
||||
if (ui->cbLanguage->currentData().toString() != currentLanguage)
|
||||
{
|
||||
QMessageBox::information(this, tr("%1", "%1").arg(GTA5SYNC_APPSTR), tr("The language change will take effect after you restart %1.").arg(GTA5SYNC_APPSTR));
|
||||
}
|
||||
}
|
||||
|
||||
void OptionsDialog::setupDefaultProfile()
|
||||
{
|
||||
settings->beginGroup("Profile");
|
||||
defaultProfile = settings->value("Default", "").toString();
|
||||
settings->endGroup();
|
||||
|
||||
QString cbNoneStr = tr("No Profile", "No Profile, as default");
|
||||
ui->cbProfiles->addItem(cbNoneStr, "");
|
||||
}
|
||||
|
||||
void OptionsDialog::commitProfiles(QStringList profiles)
|
||||
{
|
||||
foreach(const QString &profile, profiles)
|
||||
{
|
||||
ui->cbProfiles->addItem(tr("Profile: %1").arg(profile), profile);
|
||||
if (defaultProfile == profile)
|
||||
{
|
||||
ui->cbProfiles->setCurrentText(tr("Profile: %1").arg(profile));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
#include <QList>
|
||||
#include <QDialog>
|
||||
#include <QSettings>
|
||||
#include <QTreeWidgetItem>
|
||||
#include "ProfileDatabase.h"
|
||||
|
||||
|
@ -34,18 +35,27 @@ class OptionsDialog : public QDialog
|
|||
|
||||
public:
|
||||
explicit OptionsDialog(ProfileDatabase *profileDB, QWidget *parent = 0);
|
||||
void commitProfiles(QStringList profiles);
|
||||
~OptionsDialog();
|
||||
|
||||
private slots:
|
||||
void on_cmdOK_clicked();
|
||||
|
||||
signals:
|
||||
void settingsApplied(int contentMode, QString language);
|
||||
|
||||
private:
|
||||
ProfileDatabase *profileDB;
|
||||
Ui::OptionsDialog *ui;
|
||||
QList<QTreeWidgetItem*> playerItems;
|
||||
QString currentLanguage;
|
||||
QString defaultProfile;
|
||||
QSettings *settings;
|
||||
int contentMode;
|
||||
void setupTreeWidget();
|
||||
void setupLanguageBox();
|
||||
void setupRadioButtons();
|
||||
void setupDefaultProfile();
|
||||
void applySettings();
|
||||
};
|
||||
|
||||
|
|
|
@ -60,6 +60,18 @@
|
|||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="gbDefaultProfile">
|
||||
<property name="title">
|
||||
<string>Default Profile</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="vlDefaultProfile">
|
||||
<item>
|
||||
<widget class="QComboBox" name="cbProfiles"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="vsProfile">
|
||||
<property name="orientation">
|
||||
|
|
|
@ -117,9 +117,10 @@ void ProfileInterface::savegameLoaded_f(SavegameData *savegame, QString savegame
|
|||
{
|
||||
SavegameWidget *sgdWidget = new SavegameWidget();
|
||||
sgdWidget->setSavegameData(savegame, savegamePath);
|
||||
sgdWidget->setContentMode(contentMode);
|
||||
widgets[sgdWidget] = "SGD" + QFileInfo(savegamePath).fileName();
|
||||
savegames.append(savegame);
|
||||
if (selectedWidgts != 0) { sgdWidget->setSelectionMode(true); }
|
||||
if (selectedWidgts != 0 || contentMode == 2) { sgdWidget->setSelectionMode(true); }
|
||||
QObject::connect(sgdWidget, SIGNAL(savegameDeleted()), this, SLOT(savegameDeleted()));
|
||||
QObject::connect(sgdWidget, SIGNAL(widgetSelected()), this, SLOT(profileWidgetSelected()));
|
||||
QObject::connect(sgdWidget, SIGNAL(widgetDeselected()), this, SLOT(profileWidgetDeselected()));
|
||||
|
@ -137,9 +138,10 @@ void ProfileInterface::pictureLoaded_f(SnapmaticPicture *picture, QString pictur
|
|||
{
|
||||
SnapmaticWidget *picWidget = new SnapmaticWidget(profileDB, threadDB);
|
||||
picWidget->setSnapmaticPicture(picture, picturePath);
|
||||
picWidget->setContentMode(contentMode);
|
||||
widgets[picWidget] = "PIC" + picture->getPictureSortStr();
|
||||
pictures.append(picture);
|
||||
if (selectedWidgts != 0) { picWidget->setSelectionMode(true); }
|
||||
if (selectedWidgts != 0 || contentMode == 2) { picWidget->setSelectionMode(true); }
|
||||
QObject::connect(picWidget, SIGNAL(pictureDeleted()), this, SLOT(pictureDeleted()));
|
||||
QObject::connect(picWidget, SIGNAL(widgetSelected()), this, SLOT(profileWidgetSelected()));
|
||||
QObject::connect(picWidget, SIGNAL(widgetDeselected()), this, SLOT(profileWidgetDeselected()));
|
||||
|
@ -560,9 +562,12 @@ void ProfileInterface::profileWidgetDeselected()
|
|||
{
|
||||
int scrollBarValue = ui->saProfile->verticalScrollBar()->value();
|
||||
foreach(ProfileWidget *widget, widgets.keys())
|
||||
{
|
||||
if (contentMode != 2)
|
||||
{
|
||||
widget->setSelectionMode(false);
|
||||
}
|
||||
}
|
||||
ui->saProfile->verticalScrollBar()->setValue(scrollBarValue);
|
||||
}
|
||||
selectedWidgts--;
|
||||
|
@ -780,3 +785,29 @@ void ProfileInterface::importFiles()
|
|||
{
|
||||
on_cmdImport_clicked();
|
||||
}
|
||||
|
||||
void ProfileInterface::settingsApplied(int _contentMode, QString language)
|
||||
{
|
||||
Q_UNUSED(language)
|
||||
contentMode = _contentMode;
|
||||
|
||||
if (contentMode == 2)
|
||||
{
|
||||
foreach(ProfileWidget *widget, widgets.keys())
|
||||
{
|
||||
widget->setSelectionMode(true);
|
||||
widget->setContentMode(contentMode);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach(ProfileWidget *widget, widgets.keys())
|
||||
{
|
||||
if (selectedWidgts == 0)
|
||||
{
|
||||
widget->setSelectionMode(false);
|
||||
}
|
||||
widget->setContentMode(contentMode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,6 +45,7 @@ class ProfileInterface : public QWidget
|
|||
public:
|
||||
explicit ProfileInterface(ProfileDatabase *profileDB, CrewDatabase *crewDB, DatabaseThread *threadDB, QWidget *parent = 0);
|
||||
void setProfileFolder(QString folder, QString profile);
|
||||
void settingsApplied(int contentMode, QString language);
|
||||
void setupProfileInterface();
|
||||
~ProfileInterface();
|
||||
|
||||
|
@ -84,6 +85,7 @@ private:
|
|||
QString profileName;
|
||||
QString loadingStr;
|
||||
int selectedWidgts;
|
||||
int contentMode;
|
||||
|
||||
bool importFile(QString selectedFile, bool warn);
|
||||
bool importSnapmaticPicture(SnapmaticPicture *picture, QString picPath, bool warn = true);
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
ProfileWidget::ProfileWidget(QWidget *parent) : QWidget(parent)
|
||||
{
|
||||
|
||||
contentMode = 0;
|
||||
}
|
||||
|
||||
ProfileWidget::~ProfileWidget()
|
||||
|
@ -49,3 +49,13 @@ QString ProfileWidget::getWidgetType()
|
|||
qDebug() << "ProfileWidget::getWidgetType got used without overwrite";
|
||||
return "ProfileWidget";
|
||||
}
|
||||
|
||||
int ProfileWidget::getContentMode()
|
||||
{
|
||||
return contentMode;
|
||||
}
|
||||
|
||||
void ProfileWidget::setContentMode(int _contentMode)
|
||||
{
|
||||
contentMode = _contentMode;
|
||||
}
|
||||
|
|
|
@ -27,11 +27,16 @@ class ProfileWidget : public QWidget
|
|||
public:
|
||||
explicit ProfileWidget(QWidget *parent = 0);
|
||||
virtual void setSelectionMode(bool selectionMode);
|
||||
virtual void setContentMode(int contentMode);
|
||||
virtual void setSelected(bool isSelected);
|
||||
virtual bool isSelected();
|
||||
virtual QString getWidgetType();
|
||||
virtual int getContentMode();
|
||||
~ProfileWidget();
|
||||
|
||||
private:
|
||||
int contentMode;
|
||||
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
|
|
|
@ -53,7 +53,6 @@ SavegameWidget::SavegameWidget(QWidget *parent) :
|
|||
highlightBackColor = palette.highlight().color();
|
||||
highlightTextColor = palette.highlightedText().color();
|
||||
|
||||
clkIssued = 0;
|
||||
sgdPath = "";
|
||||
sgdStr = "";
|
||||
sgdata = 0;
|
||||
|
@ -131,8 +130,7 @@ void SavegameWidget::on_cmdView_clicked()
|
|||
|
||||
void SavegameWidget::mousePressEvent(QMouseEvent *ev)
|
||||
{
|
||||
ProfileWidget::mouseReleaseEvent(ev);
|
||||
clkIssued = true;
|
||||
ProfileWidget::mousePressEvent(ev);
|
||||
}
|
||||
|
||||
void SavegameWidget::mouseReleaseEvent(QMouseEvent *ev)
|
||||
|
@ -142,14 +140,12 @@ void SavegameWidget::mouseReleaseEvent(QMouseEvent *ev)
|
|||
{
|
||||
if (rect().contains(ev->pos()) && ev->button() == Qt::LeftButton)
|
||||
{
|
||||
clkIssued = false;
|
||||
//QTimer::singleShot(QApplication::doubleClickInterval(), this, SLOT(changeCheckedState()));
|
||||
ui->cbSelected->setChecked(!ui->cbSelected->isChecked());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (rect().contains(ev->pos()) && ev->button() == Qt::LeftButton)
|
||||
if (getContentMode() == 0 && rect().contains(ev->pos()) && ev->button() == Qt::LeftButton)
|
||||
{
|
||||
on_cmdView_clicked();
|
||||
}
|
||||
|
@ -158,20 +154,11 @@ void SavegameWidget::mouseReleaseEvent(QMouseEvent *ev)
|
|||
|
||||
void SavegameWidget::mouseDoubleClickEvent(QMouseEvent *ev)
|
||||
{
|
||||
QWidget::mouseDoubleClickEvent(ev);
|
||||
ProfileWidget::mouseDoubleClickEvent(ev);
|
||||
|
||||
// if (ev->button() == Qt::LeftButton)
|
||||
// {
|
||||
// clkIssued = true;
|
||||
// on_cmdView_clicked();
|
||||
// }
|
||||
}
|
||||
|
||||
void SavegameWidget::changeCheckedState()
|
||||
{
|
||||
if (!clkIssued)
|
||||
if (!ui->cbSelected->isVisible() && getContentMode() == 1 && ev->button() == Qt::LeftButton)
|
||||
{
|
||||
ui->cbSelected->setChecked(!ui->cbSelected->isChecked());
|
||||
on_cmdView_clicked();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -50,7 +50,6 @@ private slots:
|
|||
void on_cmdCopy_clicked();
|
||||
void on_cmdDelete_clicked();
|
||||
void on_cbSelected_stateChanged(int arg1);
|
||||
void changeCheckedState();
|
||||
void savegameSelected();
|
||||
void selectAllWidgets();
|
||||
void deselectAllWidgets();
|
||||
|
@ -69,7 +68,6 @@ private:
|
|||
QColor highlightTextColor;
|
||||
QString sgdPath;
|
||||
QString sgdStr;
|
||||
bool clkIssued;
|
||||
|
||||
signals:
|
||||
void savegameDeleted();
|
||||
|
|
|
@ -45,7 +45,6 @@ SnapmaticWidget::SnapmaticWidget(ProfileDatabase *profileDB, DatabaseThread *thr
|
|||
highlightBackColor = palette.highlight().color();
|
||||
highlightTextColor = palette.highlightedText().color();
|
||||
|
||||
clkIssued = 0;
|
||||
picPath = "";
|
||||
picStr = "";
|
||||
smpic = 0;
|
||||
|
@ -156,14 +155,12 @@ void SnapmaticWidget::mouseReleaseEvent(QMouseEvent *ev)
|
|||
{
|
||||
if (rect().contains(ev->pos()) && ev->button() == Qt::LeftButton)
|
||||
{
|
||||
clkIssued = false;
|
||||
//QTimer::singleShot(QApplication::doubleClickInterval(), this, SLOT(changeCheckedState()));
|
||||
ui->cbSelected->setChecked(!ui->cbSelected->isChecked());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (rect().contains(ev->pos()) && ev->button() == Qt::LeftButton)
|
||||
if (getContentMode() == 0 && rect().contains(ev->pos()) && ev->button() == Qt::LeftButton)
|
||||
{
|
||||
on_cmdView_clicked();
|
||||
}
|
||||
|
@ -172,20 +169,11 @@ void SnapmaticWidget::mouseReleaseEvent(QMouseEvent *ev)
|
|||
|
||||
void SnapmaticWidget::mouseDoubleClickEvent(QMouseEvent *ev)
|
||||
{
|
||||
QWidget::mouseDoubleClickEvent(ev);
|
||||
ProfileWidget::mouseDoubleClickEvent(ev);
|
||||
|
||||
// if (ev->button() == Qt::LeftButton)
|
||||
// {
|
||||
// clkIssued = true;
|
||||
// on_cmdView_clicked();
|
||||
// }
|
||||
}
|
||||
|
||||
void SnapmaticWidget::changeCheckedState()
|
||||
{
|
||||
if (!clkIssued)
|
||||
if (!ui->cbSelected->isVisible() && getContentMode() == 1 && ev->button() == Qt::LeftButton)
|
||||
{
|
||||
ui->cbSelected->setChecked(!ui->cbSelected->isChecked());
|
||||
on_cmdView_clicked();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -223,9 +211,7 @@ void SnapmaticWidget::contextMenuEvent(QContextMenuEvent *ev)
|
|||
contextMenu.addAction(tr("&Select"), this, SLOT(pictureSelected()));
|
||||
contextMenu.addAction(QIcon::fromTheme("edit-select-all"), tr("Select &All"), this, SLOT(selectAllWidgets()), QKeySequence::fromString("Ctrl+A"));
|
||||
}
|
||||
//ui->SnapmaticFrame->setStyleSheet(QString("QFrame#SnapmaticFrame{background-color: rgb(%1, %2, %3)}QLabel#labPicStr{color: rgb(%4, %5, %6)}").arg(QString::number(highlightBackColor.red()), QString::number(highlightBackColor.green()), QString::number(highlightBackColor.blue()), QString::number(highlightTextColor.red()), QString::number(highlightTextColor.green()), QString::number(highlightTextColor.blue())));
|
||||
contextMenu.exec(ev->globalPos());
|
||||
//ui->SnapmaticFrame->setStyleSheet("");
|
||||
}
|
||||
|
||||
void SnapmaticWidget::dialogNextPictureRequested()
|
||||
|
|
|
@ -54,7 +54,6 @@ private slots:
|
|||
void on_cmdExport_clicked();
|
||||
void on_cmdDelete_clicked();
|
||||
void on_cbSelected_stateChanged(int arg1);
|
||||
void changeCheckedState();
|
||||
void pictureSelected();
|
||||
void selectAllWidgets();
|
||||
void deselectAllWidgets();
|
||||
|
@ -78,7 +77,6 @@ private:
|
|||
QString picPath;
|
||||
QString picTitl;
|
||||
QString picStr;
|
||||
bool clkIssued;
|
||||
|
||||
signals:
|
||||
void pictureDeleted();
|
||||
|
|
|
@ -48,6 +48,7 @@ UserInterface::UserInterface(ProfileDatabase *profileDB, CrewDatabase *crewDB, D
|
|||
ui(new Ui::UserInterface)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
contentMode = 0;
|
||||
profileOpen = 0;
|
||||
profileUI = 0;
|
||||
ui->menuProfile->setEnabled(false);
|
||||
|
@ -78,9 +79,16 @@ void UserInterface::setupDirEnv()
|
|||
}
|
||||
|
||||
// profiles init
|
||||
QSettings SyncSettings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR);
|
||||
SyncSettings.beginGroup("Profile");
|
||||
QString defaultProfile = SyncSettings.value("Default", "").toString();
|
||||
QSettings settings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR);
|
||||
settings.beginGroup("Profile");
|
||||
QString defaultProfile = settings.value("Default", "").toString();
|
||||
|
||||
bool contentModeOk;
|
||||
contentMode = settings.value("ContentMode", 0).toInt(&contentModeOk);
|
||||
if (contentMode != 0 || contentMode != 1 || contentMode != 2)
|
||||
{
|
||||
contentMode = 0;
|
||||
}
|
||||
|
||||
if (folderExists)
|
||||
{
|
||||
|
@ -88,8 +96,8 @@ void UserInterface::setupDirEnv()
|
|||
GTAV_ProfilesFolder = GTAV_Folder + QDir::separator() + "Profiles";
|
||||
GTAV_ProfilesDir.setPath(GTAV_ProfilesFolder);
|
||||
|
||||
QStringList GTAV_Profiles = GTAV_ProfilesDir.entryList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::NoSort);
|
||||
setupProfileUi(GTAV_Profiles);
|
||||
GTAV_Profiles = GTAV_ProfilesDir.entryList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::NoSort);
|
||||
setupProfileUi();
|
||||
|
||||
if (GTAV_Profiles.length() == 1)
|
||||
{
|
||||
|
@ -102,11 +110,13 @@ void UserInterface::setupDirEnv()
|
|||
}
|
||||
else
|
||||
{
|
||||
setupProfileUi(QStringList());
|
||||
GTAV_Profiles = QStringList();
|
||||
setupProfileUi();
|
||||
}
|
||||
settings.endGroup();
|
||||
}
|
||||
|
||||
void UserInterface::setupProfileUi(QStringList GTAV_Profiles)
|
||||
void UserInterface::setupProfileUi()
|
||||
{
|
||||
if (GTAV_Profiles.length() == 0)
|
||||
{
|
||||
|
@ -167,7 +177,8 @@ void UserInterface::openProfile(QString profileName)
|
|||
profileUI = new ProfileInterface(profileDB, crewDB, threadDB);
|
||||
ui->swProfile->addWidget(profileUI);
|
||||
ui->swProfile->setCurrentWidget(profileUI);
|
||||
profileUI->setProfileFolder(GTAV_ProfilesFolder + "/" + profileName, profileName);
|
||||
profileUI->setProfileFolder(GTAV_ProfilesFolder + QDir::separator() + profileName, profileName);
|
||||
profileUI->settingsApplied(contentMode, language);
|
||||
profileUI->setupProfileInterface();
|
||||
QObject::connect(profileUI, SIGNAL(profileClosed()), this, SLOT(closeProfile()));
|
||||
QObject::connect(profileUI, SIGNAL(profileLoaded()), this, SLOT(profileLoaded()));
|
||||
|
@ -232,38 +243,55 @@ void UserInterface::profileLoaded()
|
|||
|
||||
void UserInterface::on_actionSelect_all_triggered()
|
||||
{
|
||||
if (profileOpen)
|
||||
{
|
||||
profileUI->selectAllWidgets();
|
||||
}
|
||||
}
|
||||
|
||||
void UserInterface::on_actionDeselect_all_triggered()
|
||||
{
|
||||
if (profileOpen)
|
||||
{
|
||||
profileUI->deselectAllWidgets();
|
||||
}
|
||||
}
|
||||
|
||||
void UserInterface::on_actionExport_selected_triggered()
|
||||
{
|
||||
if (profileOpen)
|
||||
{
|
||||
profileUI->exportSelected();
|
||||
}
|
||||
}
|
||||
|
||||
void UserInterface::on_actionDelete_selected_triggered()
|
||||
{
|
||||
if (profileOpen)
|
||||
{
|
||||
profileUI->deleteSelected();
|
||||
}
|
||||
}
|
||||
|
||||
void UserInterface::on_actionOptions_triggered()
|
||||
{
|
||||
OptionsDialog *optionsDialog = new OptionsDialog(profileDB, this);
|
||||
optionsDialog->setWindowFlags(optionsDialog->windowFlags()^Qt::WindowContextHelpButtonHint);
|
||||
optionsDialog->commitProfiles(GTAV_Profiles);
|
||||
QObject::connect(optionsDialog, SIGNAL(settingsApplied(int,QString)), this, SLOT(settingsApplied(int,QString)));
|
||||
|
||||
optionsDialog->setModal(true);
|
||||
optionsDialog->show();
|
||||
optionsDialog->exec();
|
||||
optionsDialog->deleteLater();
|
||||
delete optionsDialog;
|
||||
}
|
||||
|
||||
void UserInterface::on_action_Import_triggered()
|
||||
{
|
||||
if (profileOpen)
|
||||
{
|
||||
profileUI->importFiles();
|
||||
}
|
||||
}
|
||||
|
||||
void UserInterface::on_actionOpen_File_triggered()
|
||||
|
@ -401,3 +429,13 @@ void UserInterface::openSavegameFile(SavegameData *savegame)
|
|||
sgdDialog->exec();
|
||||
delete sgdDialog;
|
||||
}
|
||||
|
||||
void UserInterface::settingsApplied(int _contentMode, QString _language)
|
||||
{
|
||||
language = _language;
|
||||
contentMode = _contentMode;
|
||||
if (profileOpen)
|
||||
{
|
||||
profileUI->settingsApplied(contentMode, language);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,6 +57,7 @@ private slots:
|
|||
void on_actionOptions_triggered();
|
||||
void on_action_Import_triggered();
|
||||
void on_actionOpen_File_triggered();
|
||||
void settingsApplied(int contentMode, QString language);
|
||||
|
||||
private:
|
||||
ProfileDatabase *profileDB;
|
||||
|
@ -66,10 +67,13 @@ private:
|
|||
ProfileInterface *profileUI;
|
||||
QList<QPushButton*> profileBtns;
|
||||
bool profileOpen;
|
||||
int contentMode;
|
||||
QString language;
|
||||
QString defaultWindowTitle;
|
||||
QString GTAV_Folder;
|
||||
QString GTAV_ProfilesFolder;
|
||||
void setupProfileUi(QStringList GTAV_Profiles);
|
||||
QStringList GTAV_Profiles;
|
||||
void setupProfileUi();
|
||||
void openProfile(QString profileName);
|
||||
void openSelectProfile();
|
||||
|
||||
|
|
Loading…
Reference in a new issue