fix telemetry window crash
This commit is contained in:
parent
3a00e9b5b0
commit
c6e66b26f5
3 changed files with 35 additions and 33 deletions
2
config.h
2
config.h
|
@ -49,7 +49,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef GTA5SYNC_APPVER
|
#ifndef GTA5SYNC_APPVER
|
||||||
#define GTA5SYNC_APPVER "1.5.0-dev9"
|
#define GTA5SYNC_APPVER "1.5.0-rc1"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef GTA5SYNC_BUILDTYPE_REL
|
#ifdef GTA5SYNC_BUILDTYPE_REL
|
||||||
|
|
62
main.cpp
62
main.cpp
|
@ -151,36 +151,37 @@ int main(int argc, char *argv[])
|
||||||
bool telemetryWindowLaunched = settings.value("TelemetryWindowLaunched", false).toBool();
|
bool telemetryWindowLaunched = settings.value("TelemetryWindowLaunched", false).toBool();
|
||||||
if (!telemetryWindowLaunched && !Telemetry->isEnabled() && !Telemetry->isStateForced())
|
if (!telemetryWindowLaunched && !Telemetry->isEnabled() && !Telemetry->isStateForced())
|
||||||
{
|
{
|
||||||
QDialog telemetryDialog;
|
QDialog *telemetryDialog = new QDialog();
|
||||||
telemetryDialog.setObjectName(QStringLiteral("TelemetryDialog"));
|
telemetryDialog->setObjectName(QStringLiteral("TelemetryDialog"));
|
||||||
telemetryDialog.setWindowTitle(QString("%1 %2").arg(GTA5SYNC_APPSTR, GTA5SYNC_APPVER));
|
telemetryDialog->setWindowTitle(QString("%1 %2").arg(GTA5SYNC_APPSTR, GTA5SYNC_APPVER));
|
||||||
telemetryDialog.setWindowFlags(telemetryDialog.windowFlags()^Qt::WindowContextHelpButtonHint^Qt::WindowCloseButtonHint);
|
telemetryDialog->setWindowFlags(telemetryDialog->windowFlags()^Qt::WindowContextHelpButtonHint^Qt::WindowCloseButtonHint);
|
||||||
telemetryDialog.setWindowIcon(IconLoader::loadingAppIcon());
|
telemetryDialog->setWindowIcon(IconLoader::loadingAppIcon());
|
||||||
QVBoxLayout telemetryLayout;
|
QVBoxLayout *telemetryLayout = new QVBoxLayout(telemetryDialog);
|
||||||
telemetryLayout.setObjectName(QStringLiteral("TelemetryLayout"));
|
telemetryLayout->setObjectName(QStringLiteral("TelemetryLayout"));
|
||||||
telemetryDialog.setLayout(&telemetryLayout);
|
telemetryDialog->setLayout(telemetryLayout);
|
||||||
UiModLabel telemetryLabel(&telemetryDialog);
|
UiModLabel *telemetryLabel = new UiModLabel(telemetryDialog);
|
||||||
telemetryLabel.setObjectName(QStringLiteral("TelemetryLabel"));
|
telemetryLabel->setObjectName(QStringLiteral("TelemetryLabel"));
|
||||||
telemetryLabel.setText(QString("<h4>%2</h4>%1").arg(QApplication::translate("TelemetryDialog", "You want help %1 to improve in the future by collection of data?").arg(GTA5SYNC_APPSTR), QApplication::translate("TelemetryDialog", "%1 User Statistics").arg(GTA5SYNC_APPSTR)));
|
telemetryLabel->setText(QString("<h4>%2</h4>%1").arg(QApplication::translate("TelemetryDialog", "You want help %1 to improve in the future by collection of data?").arg(GTA5SYNC_APPSTR), QApplication::translate("TelemetryDialog", "%1 User Statistics").arg(GTA5SYNC_APPSTR)));
|
||||||
telemetryLayout.addWidget(&telemetryLabel);
|
telemetryLayout->addWidget(telemetryLabel);
|
||||||
QCheckBox telemetryCheckBox(&telemetryDialog);
|
QCheckBox *telemetryCheckBox = new QCheckBox(telemetryDialog);
|
||||||
telemetryCheckBox.setObjectName(QStringLiteral("TelemetryCheckBox"));
|
telemetryCheckBox->setObjectName(QStringLiteral("TelemetryCheckBox"));
|
||||||
telemetryCheckBox.setText(QApplication::translate("TelemetryDialog", "Yes, I would like to take part."));
|
telemetryCheckBox->setText(QApplication::translate("TelemetryDialog", "Yes, I would like to take part."));
|
||||||
telemetryCheckBox.setChecked(true);
|
telemetryCheckBox->setChecked(true);
|
||||||
telemetryLayout.addWidget(&telemetryCheckBox);
|
telemetryLayout->addWidget(telemetryCheckBox);
|
||||||
QHBoxLayout telemetryButtonLayout;
|
QHBoxLayout *telemetryButtonLayout = new QHBoxLayout();
|
||||||
telemetryButtonLayout.setObjectName(QStringLiteral("TelemetryButtonLayout"));
|
telemetryButtonLayout->setObjectName(QStringLiteral("TelemetryButtonLayout"));
|
||||||
telemetryLayout.addLayout(&telemetryButtonLayout);
|
telemetryLayout->addLayout(telemetryButtonLayout);
|
||||||
QSpacerItem telemetryButtonSpacer(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
|
QSpacerItem *telemetryButtonSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
|
||||||
telemetryButtonLayout.addSpacerItem(&telemetryButtonSpacer);
|
telemetryButtonLayout->addSpacerItem(telemetryButtonSpacer);
|
||||||
QPushButton telemetryButton(&telemetryDialog);
|
QPushButton *telemetryButton = new QPushButton(telemetryDialog);
|
||||||
telemetryButton.setObjectName(QStringLiteral("TelemetryButton"));
|
telemetryButton->setObjectName(QStringLiteral("TelemetryButton"));
|
||||||
telemetryButton.setText(QApplication::translate("TelemetryDialog", "&OK"));
|
telemetryButton->setText(QApplication::translate("TelemetryDialog", "&OK"));
|
||||||
telemetryButtonLayout.addWidget(&telemetryButton);
|
telemetryButtonLayout->addWidget(telemetryButton);
|
||||||
QObject::connect(&telemetryButton, SIGNAL(clicked(bool)), &telemetryDialog, SLOT(close()));
|
QObject::connect(telemetryButton, SIGNAL(clicked(bool)), telemetryDialog, SLOT(close()));
|
||||||
telemetryDialog.setFixedSize(telemetryDialog.sizeHint());
|
telemetryDialog->setFixedSize(telemetryDialog->sizeHint());
|
||||||
telemetryDialog.exec();
|
telemetryDialog->exec();
|
||||||
if (telemetryCheckBox.isChecked())
|
QObject::disconnect(telemetryButton, SIGNAL(clicked(bool)), telemetryDialog, SLOT(close()));
|
||||||
|
if (telemetryCheckBox->isChecked())
|
||||||
{
|
{
|
||||||
QSettings telemetrySettings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR);
|
QSettings telemetrySettings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR);
|
||||||
telemetrySettings.beginGroup("Telemetry");
|
telemetrySettings.beginGroup("Telemetry");
|
||||||
|
@ -190,6 +191,7 @@ int main(int argc, char *argv[])
|
||||||
Telemetry->work();
|
Telemetry->work();
|
||||||
}
|
}
|
||||||
settings.setValue("TelemetryWindowLaunched", true);
|
settings.setValue("TelemetryWindowLaunched", true);
|
||||||
|
delete telemetryDialog;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -25,12 +25,12 @@ BEGIN
|
||||||
BEGIN
|
BEGIN
|
||||||
VALUE "CompanyName", "Syping"
|
VALUE "CompanyName", "Syping"
|
||||||
VALUE "FileDescription", "gta5view"
|
VALUE "FileDescription", "gta5view"
|
||||||
VALUE "FileVersion", "1.5.0-dev9"
|
VALUE "FileVersion", "1.5.0-rc1"
|
||||||
VALUE "InternalName", "gta5view"
|
VALUE "InternalName", "gta5view"
|
||||||
VALUE "LegalCopyright", "Copyright © 2016-2018 Syping"
|
VALUE "LegalCopyright", "Copyright © 2016-2018 Syping"
|
||||||
VALUE "OriginalFilename", "gta5view.exe"
|
VALUE "OriginalFilename", "gta5view.exe"
|
||||||
VALUE "ProductName", "gta5view"
|
VALUE "ProductName", "gta5view"
|
||||||
VALUE "ProductVersion", "1.5.0-dev9"
|
VALUE "ProductVersion", "1.5.0-rc1"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
|
|
Loading…
Reference in a new issue