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);
#endif
ui->rbModern->setText(ui->rbModern->text().arg(GTA5SYNC_APPSTR));
ui->rbClassic->setText(ui->rbClassic->text().arg(GTA5SYNC_APPSTR));
setWindowTitle(windowTitle().arg(GTA5SYNC_APPSTR));
}
@ -285,14 +287,19 @@ void OptionsDialog::setupRadioButtons()
switch (contentMode)
{
case 0:
ui->rbOpenWithSC->setChecked(true);
case 20:
ui->rbModern->setChecked(true);
break;
case 1:
ui->rbOpenWithDC->setChecked(true);
break;
case 2:
ui->rbSelectWithSC->setChecked(true);
case 21:
ui->rbModern->setChecked(true);
ui->cbDoubleclick->setChecked(true);
break;
case 10:
ui->rbClassic->setChecked(true);
case 11:
ui->cbDoubleclick->setChecked(true);
}
}
}
@ -364,18 +371,18 @@ void OptionsDialog::applySettings()
settings->endGroup();
settings->beginGroup("Profile");
int newContentMode = 0;
if (ui->rbOpenWithSC->isChecked())
int newContentMode = 20;
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);
#if QT_VERSION >= 0x050000

View File

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

View File

@ -1470,7 +1470,7 @@ void ProfileInterface::exportSelected()
}
}
void ProfileInterface::deleteSelected()
void ProfileInterface::deleteSelectedL(bool isRemoteEmited)
{
if (selectedWidgts != 0)
{
@ -1485,7 +1485,7 @@ void ProfileInterface::deleteSelected()
SnapmaticWidget *picWidget = qobject_cast<SnapmaticWidget*>(widget);
if (picWidget->getPicture()->deletePictureFile())
{
pictureDeleted(picWidget);
pictureDeleted(picWidget, isRemoteEmited);
}
}
else if (widget->getWidgetType() == "SavegameWidget")
@ -1495,7 +1495,7 @@ void ProfileInterface::deleteSelected()
QString fileName = savegame->getSavegameFileName();
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()
{
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("Hide &In-game"), this, SLOT(disableSelected()), QKeySequence::fromString("Shift+D"));
contextMenu.addMenu(&editMenu);
contextMenu.addAction(SnapmaticWidget::tr("&Export"), this, SLOT(exportSelected()));
contextMenu.addAction(SnapmaticWidget::tr("&Remove"), this, SLOT(deleteSelected()));
contextMenu.addAction(SavegameWidget::tr("&Export"), this, SLOT(exportSelected()), QKeySequence::fromString("Ctrl+E"));
contextMenu.addAction(SavegameWidget::tr("&Remove"), this, SLOT(deleteSelectedR()), QKeySequence::fromString("Ctrl+Del"));
contextMenu.addSeparator();
if (!picWidget->isSelected())
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("Hide &In-game"), this, SLOT(disableSelected()), QKeySequence::fromString("Shift+D"));
contextMenu.addMenu(&editMenu);
contextMenu.addAction(SavegameWidget::tr("&Export"), this, SLOT(exportSelected()));
contextMenu.addAction(SavegameWidget::tr("&Remove"), this, SLOT(deleteSelected()));
contextMenu.addAction(SavegameWidget::tr("&Export"), this, SLOT(exportSelected()), QKeySequence::fromString("Ctrl+E"));
contextMenu.addAction(SavegameWidget::tr("&Remove"), this, SLOT(deleteSelectedR()), QKeySequence::fromString("Ctrl+Del"));
contextMenu.addSeparator();
if (!sgdWidget->isSelected())
contextMenu.addAction(SavegameWidget::tr("&Select"), sgdWidget, SLOT(savegameSelected()));

View File

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

View File

@ -186,17 +186,13 @@ void UserInterface::setupDirEnv(bool showFolderDialog)
bool folderExists;
GTAV_Folder = AppEnv::getGameFolder(&folderExists);
if (folderExists)
{
if (folderExists) {
QDir::setCurrent(GTAV_Folder);
}
else
{
if (showFolderDialog)
{
else {
if (showFolderDialog) {
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;
QDir::setCurrent(GTAV_Folder);
AppEnv::setGameFolder(GTAV_Folder);
@ -216,15 +212,15 @@ void UserInterface::setupDirEnv(bool showFolderDialog)
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 != 10 && contentMode != 11 && contentMode != 20 && contentMode != 21)
{
contentMode = 0;
contentMode = settings.value("ContentMode", 0).toInt();
if (contentMode == 1) {
contentMode = 21;
}
else if (contentMode != 10 && contentMode != 11 && contentMode != 20 && contentMode != 21) {
contentMode = 20;
}
if (folderExists)
{
if (folderExists) {
QDir GTAV_ProfilesDir;
GTAV_ProfilesFolder = GTAV_Folder % "/Profiles";
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);
setupProfileUi();
if (GTAV_Profiles.length() == 1)
{
if (GTAV_Profiles.length() == 1) {
openProfile(GTAV_Profiles.at(0));
}
else if(GTAV_Profiles.contains(defaultProfile))
{
else if(GTAV_Profiles.contains(defaultProfile)) {
openProfile(defaultProfile);
}
}
else
{
else {
GTAV_Profiles = QStringList();
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