diff --git a/PictureWidget.cpp b/PictureWidget.cpp index 75c5001..889b28c 100644 --- a/PictureWidget.cpp +++ b/PictureWidget.cpp @@ -47,7 +47,9 @@ PictureWidget::PictureWidget(QWidget *parent) : QDialog(parent) QObject::connect(pictureLabel, SIGNAL(mouseDoubleClicked(Qt::MouseButton)), this, SLOT(pictureDoubleClicked(Qt::MouseButton))); QObject::connect(pictureLabel, SIGNAL(customContextMenuRequested(QPoint)), parent, SLOT(exportCustomContextMenuRequested(QPoint))); +#if QT_VERSION < 0x060000 QObject::connect(QApplication::desktop(), SIGNAL(resized(int)), this, SLOT(updateWindowSize(int))); +#endif setLayout(widgetLayout); } diff --git a/UserInterface.cpp b/UserInterface.cpp index 78476ea..5d81bfa 100644 --- a/UserInterface.cpp +++ b/UserInterface.cpp @@ -179,7 +179,7 @@ UserInterface::UserInterface(ProfileDatabase *profileDB, CrewDatabase *crewDB, D ui->vlUserInterface->setContentsMargins(9 * screenRatio, 9 * screenRatio, 9 * screenRatio, 9 * screenRatio); } -void UserInterface::setupDirEnv() +void UserInterface::setupDirEnv(bool showFolderDialog) { // settings init QSettings settings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR); @@ -192,20 +192,23 @@ void UserInterface::setupDirEnv() } else { - GTAV_Folder = QFileDialog::getExistingDirectory(this, tr("Select GTA V Folder..."), StandardPaths::documentsLocation(), QFileDialog::ShowDirsOnly); - if (QFileInfo(GTAV_Folder).exists()) + if (showFolderDialog) { - folderExists = true; - QDir::setCurrent(GTAV_Folder); - AppEnv::setGameFolder(GTAV_Folder); - - // First time folder selection save - settings.beginGroup("dir"); - if (settings.value("dir", "").toString().isEmpty()) + GTAV_Folder = QFileDialog::getExistingDirectory(this, tr("Select GTA V Folder..."), StandardPaths::documentsLocation(), QFileDialog::ShowDirsOnly); + if (QFileInfo(GTAV_Folder).exists()) { - settings.setValue("dir", GTAV_Folder); + folderExists = true; + QDir::setCurrent(GTAV_Folder); + AppEnv::setGameFolder(GTAV_Folder); + + // First time folder selection save + settings.beginGroup("dir"); + if (settings.value("dir", "").toString().isEmpty()) + { + settings.setValue("dir", GTAV_Folder); + } + settings.endGroup(); } - settings.endGroup(); } } diff --git a/UserInterface.h b/UserInterface.h index 7e5259d..08c22ef 100644 --- a/UserInterface.h +++ b/UserInterface.h @@ -48,7 +48,7 @@ public: #else explicit UserInterface(ProfileDatabase *profileDB, CrewDatabase *crewDB, DatabaseThread *threadDB, QWidget *parent = 0); #endif - void setupDirEnv(); + void setupDirEnv(bool showFolderDialog = true); ~UserInterface(); private slots: diff --git a/main.cpp b/main.cpp index 02887d2..32e5de8 100644 --- a/main.cpp +++ b/main.cpp @@ -133,7 +133,7 @@ int main(int argc, char *argv[]) { if (isFirstStart) { - QMessageBox::StandardButton button = QMessageBox::information(a.desktop(), QString("%1 %2").arg(GTA5SYNC_APPSTR, GTA5SYNC_APPVER), QApplication::tr("

Welcome to %1!

You want to configure %1 before you start using it?").arg(GTA5SYNC_APPSTR), QMessageBox::Yes | QMessageBox::No, QMessageBox::No); + QMessageBox::StandardButton button = QMessageBox::information(nullptr, QString("%1 %2").arg(GTA5SYNC_APPSTR, GTA5SYNC_APPVER), QApplication::tr("

Welcome to %1!

You want to configure %1 before you start using it?").arg(GTA5SYNC_APPSTR), QMessageBox::Yes | QMessageBox::No, QMessageBox::No); if (button == QMessageBox::Yes) { ProfileDatabase profileDB; @@ -320,7 +320,11 @@ int main(int argc, char *argv[]) UserInterface uiWindow(&profileDB, &crewDB, &threadDB); #endif uiWindow.setWindowIcon(IconLoader::loadingAppIcon()); +#ifdef GTA5SYNC_FLATPAK + uiWindow.setupDirEnv(false); +#else uiWindow.setupDirEnv(); +#endif #ifdef Q_OS_ANDROID uiWindow.showMaximized(); #else diff --git a/res/de.syping.gta5view.metainfo.xml b/res/de.syping.gta5view.metainfo.xml index f84a2ee..9d4edfa 100644 --- a/res/de.syping.gta5view.metainfo.xml +++ b/res/de.syping.gta5view.metainfo.xml @@ -17,13 +17,17 @@

Open Source Snapmatic picture and Savegame viewer/editor for GTA V

Features

+ + Utility + + Syping