content mode now in options
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Syping 2020-11-23 03:47:17 +01:00
parent 099400b439
commit e448bd4f63
19 changed files with 1977 additions and 1789 deletions

View File

@ -124,6 +124,8 @@ OptionsDialog::OptionsDialog(ProfileDatabase *profileDB, QWidget *parent) :
resize(435 * screenRatio, 405 * screenRatio); resize(435 * screenRatio, 405 * screenRatio);
#endif #endif
ui->rbModern->setText(ui->rbModern->text().arg(GTA5SYNC_APPSTR));
ui->rbClassic->setText(ui->rbClassic->text().arg(GTA5SYNC_APPSTR));
setWindowTitle(windowTitle().arg(GTA5SYNC_APPSTR)); setWindowTitle(windowTitle().arg(GTA5SYNC_APPSTR));
} }
@ -285,14 +287,19 @@ void OptionsDialog::setupRadioButtons()
switch (contentMode) switch (contentMode)
{ {
case 0: case 0:
ui->rbOpenWithSC->setChecked(true); case 20:
ui->rbModern->setChecked(true);
break; break;
case 1: case 1:
ui->rbOpenWithDC->setChecked(true);
break;
case 2: case 2:
ui->rbSelectWithSC->setChecked(true); case 21:
ui->rbModern->setChecked(true);
ui->cbDoubleclick->setChecked(true);
break; break;
case 10:
ui->rbClassic->setChecked(true);
case 11:
ui->cbDoubleclick->setChecked(true);
} }
} }
} }
@ -364,18 +371,18 @@ void OptionsDialog::applySettings()
settings->endGroup(); settings->endGroup();
settings->beginGroup("Profile"); settings->beginGroup("Profile");
int newContentMode = 0; int newContentMode = 20;
if (ui->rbOpenWithSC->isChecked()) if (ui->rbModern->isChecked())
{ {
newContentMode = 0; newContentMode = 20;
} }
else if (ui->rbOpenWithDC->isChecked()) else if (ui->rbClassic->isChecked())
{ {
newContentMode = 1; newContentMode = 10;
} }
else if (ui->rbSelectWithSC->isChecked()) if (ui->cbDoubleclick->isChecked())
{ {
newContentMode = 2; newContentMode++;
} }
settings->setValue("ContentMode", newContentMode); settings->setValue("ContentMode", newContentMode);
#if QT_VERSION >= 0x050000 #if QT_VERSION >= 0x050000

View File

@ -34,9 +34,9 @@
</property> </property>
<layout class="QVBoxLayout" name="vlProfileContentMode"> <layout class="QVBoxLayout" name="vlProfileContentMode">
<item> <item>
<widget class="QRadioButton" name="rbOpenWithSC"> <widget class="QRadioButton" name="rbModern">
<property name="text"> <property name="text">
<string>Open with Singleclick</string> <string notr="true">%1 1.9+</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>true</bool> <bool>true</bool>
@ -44,16 +44,16 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QRadioButton" name="rbOpenWithDC"> <widget class="QRadioButton" name="rbClassic">
<property name="text"> <property name="text">
<string>Open with Doubleclick</string> <string notr="true">%1 1.0-1.8</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QRadioButton" name="rbSelectWithSC"> <widget class="QCheckBox" name="cbDoubleclick">
<property name="text"> <property name="text">
<string>Select with Singleclick</string> <string>Open with Doubleclick</string>
</property> </property>
</widget> </widget>
</item> </item>

View File

@ -1470,7 +1470,7 @@ void ProfileInterface::exportSelected()
} }
} }
void ProfileInterface::deleteSelected() void ProfileInterface::deleteSelectedL(bool isRemoteEmited)
{ {
if (selectedWidgts != 0) if (selectedWidgts != 0)
{ {
@ -1485,7 +1485,7 @@ void ProfileInterface::deleteSelected()
SnapmaticWidget *picWidget = qobject_cast<SnapmaticWidget*>(widget); SnapmaticWidget *picWidget = qobject_cast<SnapmaticWidget*>(widget);
if (picWidget->getPicture()->deletePictureFile()) if (picWidget->getPicture()->deletePictureFile())
{ {
pictureDeleted(picWidget); pictureDeleted(picWidget, isRemoteEmited);
} }
} }
else if (widget->getWidgetType() == "SavegameWidget") else if (widget->getWidgetType() == "SavegameWidget")
@ -1495,7 +1495,7 @@ void ProfileInterface::deleteSelected()
QString fileName = savegame->getSavegameFileName(); QString fileName = savegame->getSavegameFileName();
if (!QFile::exists(fileName) || QFile::remove(fileName)) if (!QFile::exists(fileName) || QFile::remove(fileName))
{ {
savegameDeleted(sgdWidget); savegameDeleted(sgdWidget, isRemoteEmited);
} }
} }
} }
@ -1512,6 +1512,16 @@ void ProfileInterface::deleteSelected()
} }
} }
void ProfileInterface::deleteSelected()
{
deleteSelectedL(false);
}
void ProfileInterface::deleteSelectedR()
{
deleteSelectedL(true);
}
void ProfileInterface::massToolQualify() void ProfileInterface::massToolQualify()
{ {
massTool(MassTool::Qualify); massTool(MassTool::Qualify);
@ -1710,8 +1720,8 @@ void ProfileInterface::contextMenuTriggeredPIC(QContextMenuEvent *ev)
editMenu.addAction(SnapmaticWidget::tr("Show &In-game"), this, SLOT(enableSelected()), QKeySequence::fromString("Shift+E")); editMenu.addAction(SnapmaticWidget::tr("Show &In-game"), this, SLOT(enableSelected()), QKeySequence::fromString("Shift+E"));
editMenu.addAction(SnapmaticWidget::tr("Hide &In-game"), this, SLOT(disableSelected()), QKeySequence::fromString("Shift+D")); editMenu.addAction(SnapmaticWidget::tr("Hide &In-game"), this, SLOT(disableSelected()), QKeySequence::fromString("Shift+D"));
contextMenu.addMenu(&editMenu); contextMenu.addMenu(&editMenu);
contextMenu.addAction(SnapmaticWidget::tr("&Export"), this, SLOT(exportSelected())); contextMenu.addAction(SavegameWidget::tr("&Export"), this, SLOT(exportSelected()), QKeySequence::fromString("Ctrl+E"));
contextMenu.addAction(SnapmaticWidget::tr("&Remove"), this, SLOT(deleteSelected())); contextMenu.addAction(SavegameWidget::tr("&Remove"), this, SLOT(deleteSelectedR()), QKeySequence::fromString("Ctrl+Del"));
contextMenu.addSeparator(); contextMenu.addSeparator();
if (!picWidget->isSelected()) if (!picWidget->isSelected())
contextMenu.addAction(SnapmaticWidget::tr("&Select"), picWidget, SLOT(pictureSelected())); contextMenu.addAction(SnapmaticWidget::tr("&Select"), picWidget, SLOT(pictureSelected()));
@ -1775,8 +1785,8 @@ void ProfileInterface::contextMenuTriggeredSGD(QContextMenuEvent *ev)
editMenu.addAction(SnapmaticWidget::tr("Show &In-game"), this, SLOT(enableSelected()), QKeySequence::fromString("Shift+E")); editMenu.addAction(SnapmaticWidget::tr("Show &In-game"), this, SLOT(enableSelected()), QKeySequence::fromString("Shift+E"));
editMenu.addAction(SnapmaticWidget::tr("Hide &In-game"), this, SLOT(disableSelected()), QKeySequence::fromString("Shift+D")); editMenu.addAction(SnapmaticWidget::tr("Hide &In-game"), this, SLOT(disableSelected()), QKeySequence::fromString("Shift+D"));
contextMenu.addMenu(&editMenu); contextMenu.addMenu(&editMenu);
contextMenu.addAction(SavegameWidget::tr("&Export"), this, SLOT(exportSelected())); contextMenu.addAction(SavegameWidget::tr("&Export"), this, SLOT(exportSelected()), QKeySequence::fromString("Ctrl+E"));
contextMenu.addAction(SavegameWidget::tr("&Remove"), this, SLOT(deleteSelected())); contextMenu.addAction(SavegameWidget::tr("&Remove"), this, SLOT(deleteSelectedR()), QKeySequence::fromString("Ctrl+Del"));
contextMenu.addSeparator(); contextMenu.addSeparator();
if (!sgdWidget->isSelected()) if (!sgdWidget->isSelected())
contextMenu.addAction(SavegameWidget::tr("&Select"), sgdWidget, SLOT(savegameSelected())); contextMenu.addAction(SavegameWidget::tr("&Select"), sgdWidget, SLOT(savegameSelected()));

View File

@ -66,6 +66,7 @@ public slots:
void enableSelected(); void enableSelected();
void exportSelected(); void exportSelected();
void deleteSelected(); void deleteSelected();
void deleteSelectedR();
void updatePalette(); void updatePalette();
void importFiles(); void importFiles();
@ -128,6 +129,7 @@ private:
void savegameLoaded(SavegameData *savegame, QString savegamePath, bool inserted); void savegameLoaded(SavegameData *savegame, QString savegamePath, bool inserted);
void savegameDeleted(SavegameWidget *sgdWidget, bool isRemoteEmited = false); void savegameDeleted(SavegameWidget *sgdWidget, bool isRemoteEmited = false);
void pictureDeleted(SnapmaticWidget *picWidget, bool isRemoteEmited = false); void pictureDeleted(SnapmaticWidget *picWidget, bool isRemoteEmited = false);
void deleteSelectedL(bool isRemoteEmited = false);
void insertSnapmaticIPI(QWidget *widget); void insertSnapmaticIPI(QWidget *widget);
void insertSavegameIPI(QWidget *widget); void insertSavegameIPI(QWidget *widget);
void sortingProfileInterface(); void sortingProfileInterface();

View File

@ -186,17 +186,13 @@ void UserInterface::setupDirEnv(bool showFolderDialog)
bool folderExists; bool folderExists;
GTAV_Folder = AppEnv::getGameFolder(&folderExists); GTAV_Folder = AppEnv::getGameFolder(&folderExists);
if (folderExists) if (folderExists) {
{
QDir::setCurrent(GTAV_Folder); QDir::setCurrent(GTAV_Folder);
} }
else else {
{ if (showFolderDialog) {
if (showFolderDialog)
{
GTAV_Folder = QFileDialog::getExistingDirectory(this, tr("Select GTA V Folder..."), StandardPaths::documentsLocation(), QFileDialog::ShowDirsOnly); GTAV_Folder = QFileDialog::getExistingDirectory(this, tr("Select GTA V Folder..."), StandardPaths::documentsLocation(), QFileDialog::ShowDirsOnly);
if (QFileInfo(GTAV_Folder).exists()) if (QFileInfo(GTAV_Folder).exists()) {
{
folderExists = true; folderExists = true;
QDir::setCurrent(GTAV_Folder); QDir::setCurrent(GTAV_Folder);
AppEnv::setGameFolder(GTAV_Folder); AppEnv::setGameFolder(GTAV_Folder);
@ -216,15 +212,15 @@ void UserInterface::setupDirEnv(bool showFolderDialog)
settings.beginGroup("Profile"); settings.beginGroup("Profile");
QString defaultProfile = settings.value("Default", "").toString(); QString defaultProfile = settings.value("Default", "").toString();
bool contentModeOk; contentMode = settings.value("ContentMode", 0).toInt();
contentMode = settings.value("ContentMode", 0).toInt(&contentModeOk); if (contentMode == 1) {
if (contentMode != 0 && contentMode != 1 && contentMode != 2 && contentMode != 10 && contentMode != 11 && contentMode != 20 && contentMode != 21) contentMode = 21;
{ }
contentMode = 0; else if (contentMode != 10 && contentMode != 11 && contentMode != 20 && contentMode != 21) {
contentMode = 20;
} }
if (folderExists) if (folderExists) {
{
QDir GTAV_ProfilesDir; QDir GTAV_ProfilesDir;
GTAV_ProfilesFolder = GTAV_Folder % "/Profiles"; GTAV_ProfilesFolder = GTAV_Folder % "/Profiles";
GTAV_ProfilesDir.setPath(GTAV_ProfilesFolder); GTAV_ProfilesDir.setPath(GTAV_ProfilesFolder);
@ -232,17 +228,14 @@ void UserInterface::setupDirEnv(bool showFolderDialog)
GTAV_Profiles = GTAV_ProfilesDir.entryList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::NoSort); GTAV_Profiles = GTAV_ProfilesDir.entryList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::NoSort);
setupProfileUi(); setupProfileUi();
if (GTAV_Profiles.length() == 1) if (GTAV_Profiles.length() == 1) {
{
openProfile(GTAV_Profiles.at(0)); openProfile(GTAV_Profiles.at(0));
} }
else if(GTAV_Profiles.contains(defaultProfile)) else if(GTAV_Profiles.contains(defaultProfile)) {
{
openProfile(defaultProfile); openProfile(defaultProfile);
} }
} }
else else {
{
GTAV_Profiles = QStringList(); GTAV_Profiles = QStringList();
setupProfileUi(); setupProfileUi();
} }

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff