Browse Source

Small Flatpak fixes, Qt6 beta build fix

1.8.x
Syping 1 year ago
parent
commit
fcbe264d63
  1. 2
      PictureWidget.cpp
  2. 27
      UserInterface.cpp
  3. 2
      UserInterface.h
  4. 6
      main.cpp
  5. 8
      res/de.syping.gta5view.metainfo.xml

2
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);
}

27
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();
}
}

2
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:

6
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("<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)
{
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

8
res/de.syping.gta5view.metainfo.xml

@ -17,13 +17,17 @@
<p>Open Source Snapmatic picture and Savegame viewer/editor for GTA V</p>
<p>Features</p>
<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>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>
</ul>
</description>
<categories>
<category>Utility</category>
</categories>
<developer_name>Syping</developer_name>
<releases>

Loading…
Cancel
Save