Small Flatpak fixes, Qt6 beta build fix
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Syping 2020-10-21 19:14:20 +02:00
parent f8049c8178
commit fcbe264d63
5 changed files with 29 additions and 16 deletions

View file

@ -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(mouseDoubleClicked(Qt::MouseButton)), this, SLOT(pictureDoubleClicked(Qt::MouseButton)));
QObject::connect(pictureLabel, SIGNAL(customContextMenuRequested(QPoint)), parent, SLOT(exportCustomContextMenuRequested(QPoint))); 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))); QObject::connect(QApplication::desktop(), SIGNAL(resized(int)), this, SLOT(updateWindowSize(int)));
#endif
setLayout(widgetLayout); setLayout(widgetLayout);
} }

View file

@ -179,7 +179,7 @@ UserInterface::UserInterface(ProfileDatabase *profileDB, CrewDatabase *crewDB, D
ui->vlUserInterface->setContentsMargins(9 * screenRatio, 9 * screenRatio, 9 * screenRatio, 9 * screenRatio); ui->vlUserInterface->setContentsMargins(9 * screenRatio, 9 * screenRatio, 9 * screenRatio, 9 * screenRatio);
} }
void UserInterface::setupDirEnv() void UserInterface::setupDirEnv(bool showFolderDialog)
{ {
// settings init // settings init
QSettings settings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR); QSettings settings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR);
@ -192,20 +192,23 @@ void UserInterface::setupDirEnv()
} }
else else
{ {
GTAV_Folder = QFileDialog::getExistingDirectory(this, tr("Select GTA V Folder..."), StandardPaths::documentsLocation(), QFileDialog::ShowDirsOnly); if (showFolderDialog)
if (QFileInfo(GTAV_Folder).exists())
{ {
folderExists = true; GTAV_Folder = QFileDialog::getExistingDirectory(this, tr("Select GTA V Folder..."), StandardPaths::documentsLocation(), QFileDialog::ShowDirsOnly);
QDir::setCurrent(GTAV_Folder); if (QFileInfo(GTAV_Folder).exists())
AppEnv::setGameFolder(GTAV_Folder);
// First time folder selection save
settings.beginGroup("dir");
if (settings.value("dir", "").toString().isEmpty())
{ {
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();
} }
} }

View file

@ -48,7 +48,7 @@ public:
#else #else
explicit UserInterface(ProfileDatabase *profileDB, CrewDatabase *crewDB, DatabaseThread *threadDB, QWidget *parent = 0); explicit UserInterface(ProfileDatabase *profileDB, CrewDatabase *crewDB, DatabaseThread *threadDB, QWidget *parent = 0);
#endif #endif
void setupDirEnv(); void setupDirEnv(bool showFolderDialog = true);
~UserInterface(); ~UserInterface();
private slots: private slots:

View file

@ -133,7 +133,7 @@ int main(int argc, char *argv[])
{ {
if (isFirstStart) if (isFirstStart)
{ {
QMessageBox::StandardButton button = QMessageBox::information(a.desktop(), QString("%1 %2").arg(GTA5SYNC_APPSTR, GTA5SYNC_APPVER), QApplication::tr("<h4>Welcome to %1!</h4>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("<h4>Welcome to %1!</h4>You want to configure %1 before you start using it?").arg(GTA5SYNC_APPSTR), QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
if (button == QMessageBox::Yes) if (button == QMessageBox::Yes)
{ {
ProfileDatabase profileDB; ProfileDatabase profileDB;
@ -320,7 +320,11 @@ int main(int argc, char *argv[])
UserInterface uiWindow(&profileDB, &crewDB, &threadDB); UserInterface uiWindow(&profileDB, &crewDB, &threadDB);
#endif #endif
uiWindow.setWindowIcon(IconLoader::loadingAppIcon()); uiWindow.setWindowIcon(IconLoader::loadingAppIcon());
#ifdef GTA5SYNC_FLATPAK
uiWindow.setupDirEnv(false);
#else
uiWindow.setupDirEnv(); uiWindow.setupDirEnv();
#endif
#ifdef Q_OS_ANDROID #ifdef Q_OS_ANDROID
uiWindow.showMaximized(); uiWindow.showMaximized();
#else #else

View file

@ -17,13 +17,17 @@
<p>Open Source Snapmatic picture and Savegame viewer/editor for GTA V</p> <p>Open Source Snapmatic picture and Savegame viewer/editor for GTA V</p>
<p>Features</p> <p>Features</p>
<ul> <ul>
<li>View Snapmatics with the ability to disable them in-game*</li> <li>View Snapmatics with the ability to disable them in-game</li>
<li>Edit Snapmatic pictures and properties in multiple ways</li> <li>Edit Snapmatic pictures and properties in multiple ways</li>
<li>Import**/Export Snapmatics, Savegames and pictures</li> <li>Import/Export Snapmatics, Savegames and pictures</li>
<li>Choose between multiple Social Club accounts as GTA V profiles IDs</li> <li>Choose between multiple Social Club accounts as GTA V profiles IDs</li>
</ul> </ul>
</description> </description>
<categories>
<category>Utility</category>
</categories>
<developer_name>Syping</developer_name> <developer_name>Syping</developer_name>
<releases> <releases>