mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-05 10:40:42 +00:00
Show graphics engine in about dialog and titlebar
This commit is contained in:
parent
42d29ae75c
commit
9aee5a328d
@ -179,11 +179,13 @@ int main(int argc, char *argv[])
|
|||||||
initializeStrings(); // Important, call this AFTER translator is installed.
|
initializeStrings(); // Important, call this AFTER translator is installed.
|
||||||
a.setApplicationName(STR_TR_SleepyHead);
|
a.setApplicationName(STR_TR_SleepyHead);
|
||||||
|
|
||||||
|
|
||||||
#if defined(Q_OS_WIN)
|
#if defined(Q_OS_WIN)
|
||||||
#ifndef BROKEN_OPENGL_BUILD
|
// True openGL will meanly return nothing here, but ANGLE will give useful info
|
||||||
QString glversion = (char *)glGetString(GL_VERSION);
|
QString glversion = (char *)glGetString(GL_VERSION);
|
||||||
qDebug() << "OpenGL Version detected:" << glversion;
|
|
||||||
// if (QSysInfo::windowsVersion() < QSysInfo::WV_VISTA) {
|
#ifndef BROKEN_OPENGL_BUILD
|
||||||
|
if (QSysInfo::windowsVersion() < QSysInfo::WV_VISTA) {
|
||||||
if (glversion.contains("ANGLE")) {
|
if (glversion.contains("ANGLE")) {
|
||||||
QMessageBox::warning(nullptr, QObject::tr("You have the wrong version of SleepyHead"),
|
QMessageBox::warning(nullptr, QObject::tr("You have the wrong version of SleepyHead"),
|
||||||
QObject::tr("This build of SleepyHead was designed to work with computers lacking full OpenGL 2.0 support, and only runs on (native) Windows Vista or higher.") + "<br/><br/>"+
|
QObject::tr("This build of SleepyHead was designed to work with computers lacking full OpenGL 2.0 support, and only runs on (native) Windows Vista or higher.") + "<br/><br/>"+
|
||||||
@ -191,18 +193,23 @@ int main(int argc, char *argv[])
|
|||||||
QObject::tr("Because graphs will not render correctly, this version will now exit."), QMessageBox::Ok, QMessageBox::Ok);
|
QObject::tr("Because graphs will not render correctly, this version will now exit."), QMessageBox::Ok, QMessageBox::Ok);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
// }
|
}
|
||||||
#else
|
#else
|
||||||
|
settings.remove("Settings/BrokenGL2");
|
||||||
if (QSysInfo::windowsVersion() > QSysInfo::WV_VISTA) {
|
if (QSysInfo::windowsVersion() > QSysInfo::WV_VISTA) {
|
||||||
QMessageBox::information(nullptr, QObject::tr("A faster build may be available"),
|
if (!settings.contains("Settings/BrokenGL2")) {
|
||||||
QObject::tr("This special build of SleepyHead was designed to work with computers lacking OpenGL 2.0 support.") + "<br/><br/>"+
|
QMessageBox::information(nullptr, QObject::tr("A faster build may be available"),
|
||||||
QObject::tr("There is another special build available for computers running Windows Vista or higher that do not support OpenGL 2.0, tagged 'ANGLE', which will work faster on your computer.")+"<br/><br/>"+
|
QObject::tr("This special build of SleepyHead was designed to work with older computers lacking OpenGL 2.0 support.") + "<br/><br/>"+
|
||||||
QObject::tr("If your running Windows in a Virutal machine, disregard this message, because the version you are running works best.")
|
QObject::tr("There is a <b>better build available</b> for computers running (native) Windows Vista or higher that do not support OpenGL 2.0, tagged '<b>-ANGLE</b>', which will work faster on your computer.")+"<br/><br/>"+
|
||||||
|
QObject::tr("If your running Windows in a Virutal Machine, like VirtualBox or VMware, disregard this message, because the version you are running works best.")+"<br/><br/>"+
|
||||||
|
QObject::tr("<b>There is no harm in running this version, it's just quite a bit slower.</b>")+"<br/><br/>"+
|
||||||
|
QObject::tr("You will not be shown this message again."),
|
||||||
QMessageBox::Ok, QMessageBox::Ok);
|
QMessageBox::Ok, QMessageBox::Ok);
|
||||||
|
settings.setValue("Settings/BrokenGL2", true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
@ -400,6 +407,7 @@ retry_directory:
|
|||||||
|
|
||||||
// Must be initialized AFTER profile creation
|
// Must be initialized AFTER profile creation
|
||||||
MainWindow w;
|
MainWindow w;
|
||||||
|
|
||||||
mainwin = &w;
|
mainwin = &w;
|
||||||
|
|
||||||
if (check_updates) { mainwin->CheckForUpdates(); }
|
if (check_updates) { mainwin->CheckForUpdates(); }
|
||||||
|
@ -109,7 +109,18 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
ui->warningLabel->hide();
|
ui->warningLabel->hide();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (QString(GIT_BRANCH) != "master") { version += " (" + QString(GIT_BRANCH)+" branch)"; }
|
#ifdef BROKEN_OPENGL_BUILD
|
||||||
|
version += " BrokenGL2";
|
||||||
|
#else
|
||||||
|
QString glversion = (char *)glGetString(GL_VERSION);
|
||||||
|
if (glversion.contains("ANGLE")) {
|
||||||
|
version += " ANGLE";
|
||||||
|
} else {
|
||||||
|
version += " OpenGL";
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
if (QString(GIT_BRANCH) != "master") { version += " [" + QString(GIT_BRANCH)+" branch]"; }
|
||||||
|
|
||||||
|
|
||||||
this->setWindowTitle(STR_TR_SleepyHead + QString(" v%1 (" + tr("Profile") + ": %2)").arg(version).arg(PREF[STR_GEN_Profile].toString()));
|
this->setWindowTitle(STR_TR_SleepyHead + QString(" v%1 (" + tr("Profile") + ": %2)").arg(version).arg(PREF[STR_GEN_Profile].toString()));
|
||||||
@ -406,7 +417,6 @@ void MainWindow::Startup()
|
|||||||
importCPAPBackups();
|
importCPAPBackups();
|
||||||
PROFILE.p_preferences[STR_PREF_ReimportBackup]=false;
|
PROFILE.p_preferences[STR_PREF_ReimportBackup]=false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int MainWindow::importCPAP(const QString &path, const QString &message)
|
int MainWindow::importCPAP(const QString &path, const QString &message)
|
||||||
@ -1051,87 +1061,100 @@ void MainWindow::aboutBoxLinkClicked(const QUrl &url)
|
|||||||
|
|
||||||
void MainWindow::on_action_About_triggered()
|
void MainWindow::on_action_About_triggered()
|
||||||
{
|
{
|
||||||
|
QString gfxengine;
|
||||||
|
#ifdef BROKEN_OPENGL_BUILD
|
||||||
|
gfxengine = "BrokenGL2";
|
||||||
|
#else
|
||||||
|
QString glversion = (char *)glGetString(GL_VERSION);
|
||||||
|
if (glversion.contains("ANGLE")) {
|
||||||
|
gfxengine = "ANGLE";
|
||||||
|
} else {
|
||||||
|
gfxengine = "OpenGL";
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
QString gitrev = QString(GIT_REVISION);
|
QString gitrev = QString(GIT_REVISION);
|
||||||
|
|
||||||
if (!gitrev.isEmpty()) { gitrev = tr("Revision:")+" " + gitrev + " (" + QString(GIT_BRANCH) + " " + tr("branch") + ")"; }
|
if (!gitrev.isEmpty()) { gitrev = tr("Revision:")+" " + gitrev + " (" + QString(GIT_BRANCH) + " " + tr("branch") + ")"; }
|
||||||
|
|
||||||
// "<style type=\"text/css\">body { margin:0; padding:0; } html, body, #bg { height:100%; width:100% } #bg { position: absolute; left:0; right:0; bottom:0; top:0; overflow:hidden; z-index:1; } #bg img { width:100%; min-width:100%; min-height:100%; } #content { z-index:0; }</style><body><div id=\"bg\"> <img style=\"display:block;\" src=\"qrc:/icons/Bob Strikes Back.png\"></div><div id=\"content\">"
|
// "<style type=\"text/css\">body { margin:0; padding:0; } html, body, #bg { height:100%; width:100% } #bg { position: absolute; left:0; right:0; bottom:0; top:0; overflow:hidden; z-index:1; } #bg img { width:100%; min-width:100%; min-height:100%; } #content { z-index:0; }</style><body><div id=\"bg\"> <img style=\"display:block;\" src=\"qrc:/icons/Bob Strikes Back.png\"></div><div id=\"content\">"
|
||||||
QString msg = QString("<html>"
|
QString msg = QString(
|
||||||
"<head><style type=\"text/css\">a:link, a:visited { color: #000044; text-decoration: underline; font-weight: normal;}"
|
"<html>"
|
||||||
"a:hover { background-color: inherit; color: #4444ff; text-decoration:none; font-weight: normal; }"
|
"<head><style type=\"text/css\">a:link, a:visited { color: #000044; text-decoration: underline; font-weight: normal;}"
|
||||||
"</style></head>"
|
"a:hover { background-color: inherit; color: #4444ff; text-decoration:none; font-weight: normal; }"
|
||||||
|
"</style></head>"
|
||||||
|
|
||||||
"<body>"
|
"<body>"
|
||||||
"<span style=\"color:#000000; font-weight:600; vertical-align:middle;\">"
|
"<span style=\"color:#000000; font-weight:600; vertical-align:middle;\">"
|
||||||
"<table width=100%><tr><td>"
|
"<table width=100%><tr><td>"
|
||||||
"<p><h1>" + STR_TR_SleepyHead + " v%1 (%2)</h1></p><font color=black><p>" +
|
"<p><h1>" + STR_TR_SleepyHead +
|
||||||
tr("Build Date") + ": %3 %4<br/>%5<br/>" + tr("Data Folder Location") + ": %6<hr/>" +
|
QString(" v%1 (%2)</h1></p><font color=black><p>").arg(VersionString).arg(ReleaseStatus) +
|
||||||
tr("Copyright") + " ©2011-2014 Mark Watkins (jedimark) <br/> \n" +
|
tr("Build Date: %1 %2").arg(__DATE__).arg(__TIME__) +
|
||||||
tr("This software is released under the GNU Public License v3.0<br/>") +
|
QString("<br/>%1<br/>").arg(gitrev) +
|
||||||
"<hr>"
|
tr("Graphics Engine: %1").arg(gfxengine)+
|
||||||
|
"<br/>" +
|
||||||
|
tr("Data Folder Location: %1").arg(QDir::toNativeSeparators(GetAppRoot()) +
|
||||||
|
"<hr/>"+tr("Copyright") + " ©2011-2014 Mark Watkins (jedimark) <br/> \n" +
|
||||||
|
tr("This software is released under the GNU Public License v3.0<br/>") +
|
||||||
|
"<hr>"
|
||||||
|
|
||||||
// Project links
|
// Project links
|
||||||
"<p>" +tr("SleepyHead Project Page") +
|
"<p>" +tr("SleepyHead Project Page") +
|
||||||
": <a href=\"http://sourceforge.net/projects/sleepyhead\">http://sourceforge.net/projects/sleepyhead</a><br/>"
|
": <a href=\"http://sourceforge.net/projects/sleepyhead\">http://sourceforge.net/projects/sleepyhead</a><br/>"
|
||||||
+
|
+
|
||||||
tr("SleepyHead Wiki") +
|
tr("SleepyHead Wiki") +
|
||||||
": <a href=\"http://sleepyhead.sourceforge.net\">http://sleepyhead.sourceforge.net</a><p/>" +
|
": <a href=\"http://sleepyhead.sourceforge.net\">http://sleepyhead.sourceforge.net</a><p/>" +
|
||||||
|
|
||||||
// Social media links.. (Dear Translators, if one of these isn't available in your country, it's ok to leave it out.)
|
// Social media links.. (Dear Translators, if one of these isn't available in your country, it's ok to leave it out.)
|
||||||
tr("Don't forget to Like/+1 SleepyHead on <a href=\"http://www.facebook.com/SleepyHeadCPAP\">Facebook</a> or <a href=\"http://plus.google.com/u/0/b/101426655252362287937\">Google+")
|
tr("Don't forget to Like/+1 SleepyHead on <a href=\"http://www.facebook.com/SleepyHeadCPAP\">Facebook</a> or <a href=\"http://plus.google.com/u/0/b/101426655252362287937\">Google+")
|
||||||
+ "</p>" +
|
+ "</p>" +
|
||||||
|
|
||||||
// Image
|
// Image
|
||||||
"</td><td align='center'><img src=\"qrc:/icons/Jedimark.png\" width=260px><br/> <br/><i>"
|
"</td><td align='center'><img src=\"qrc:/icons/Jedimark.png\" width=260px><br/> <br/><i>"
|
||||||
+tr("SleepyHead, brought to you by Jedimark") + "</i></td></tr><tr colspan><td colspan=2>" +
|
+tr("SleepyHead, brought to you by Jedimark") + "</i></td></tr><tr colspan><td colspan=2>" +
|
||||||
|
|
||||||
|
|
||||||
// Credits section
|
// Credits section
|
||||||
"<hr/><p><b><font size='+1'>" +tr("Kudos & Credits") + "</font></b></p><b>" +
|
"<hr/><p><b><font size='+1'>" +tr("Kudos & Credits") + "</font></b></p><b>" +
|
||||||
tr("Bugfixes, Patches and Platform Help:") + "</b> " +
|
tr("Bugfixes, Patches and Platform Help:") + "</b> " +
|
||||||
tr("James Marshall, Rich Freeman, John Masters, Keary Griffin, Patricia Shanahan, Alec Clews, manders99, Sean Stangl and Roy Stone.")
|
tr("James Marshall, Rich Freeman, John Masters, Keary Griffin, Patricia Shanahan, Alec Clews, manders99, Sean Stangl and Roy Stone.")
|
||||||
+ "</p>"
|
+ "</p>"
|
||||||
|
|
||||||
"<p><b>" + tr("Translators:") + "</b> " + tr("Arie Klerk (Dutch), Steffen Reitz (German), and others I've still to add here.") +
|
"<p><b>" + tr("Translators:") + "</b> " + tr("Arie Klerk (Dutch), Steffen Reitz (German), and others I've still to add here.") +
|
||||||
"</p>"
|
"</p>"
|
||||||
|
|
||||||
"<p><b>" + tr("3rd Party Libaries:") + "</b> " +
|
"<p><b>" + tr("3rd Party Libaries:") + "</b> " +
|
||||||
tr("SleepyHead is built using the <a href=\"http://qt-project.org\">Qt Application Framework</a>.")
|
tr("SleepyHead is built using the <a href=\"http://qt-project.org\">Qt Application Framework</a>.")
|
||||||
+ " " +
|
+ " " +
|
||||||
tr("It uses the cross platform <a href=\"http://code.google.com/p/qextserialport\">QExtSerialPort</a> library for serial port access in the Oximetry module.")
|
tr("It uses the cross platform <a href=\"http://code.google.com/p/qextserialport\">QExtSerialPort</a> library for serial port access in the Oximetry module.")
|
||||||
+ " " +
|
+ " " +
|
||||||
tr("In the updater code, SleepyHead uses <a href=\"http://sourceforge.net/projects/quazip\">QuaZip</a> by Sergey A. Tachenov, which is a C++ wrapper over Gilles Vollant's ZIP/UNZIP package.")
|
tr("In the updater code, SleepyHead uses <a href=\"http://sourceforge.net/projects/quazip\">QuaZip</a> by Sergey A. Tachenov, which is a C++ wrapper over Gilles Vollant's ZIP/UNZIP package.")
|
||||||
+ "<br/>"
|
+ "<br/>"
|
||||||
"<p>" + tr("Special thanks to Pugsy from <a href='http://cpaptalk.com'>CPAPTalk</a> for her help with documentation and tutorials, as well as everyone who helped out by testing and sharing their CPAP data.")
|
"<p>" + tr("Special thanks to Pugsy from <a href='http://cpaptalk.com'>CPAPTalk</a> for her help with documentation and tutorials, as well as everyone who helped out by testing and sharing their CPAP data.")
|
||||||
+ "</p>"
|
+ "</p>"
|
||||||
|
|
||||||
// Donations
|
// Donations
|
||||||
"<hr><p><font color=\"blue\">" +
|
"<hr><p><font color=\"blue\">" +
|
||||||
tr("Thanks for using SleepyHead. If you find it within your means, please consider encouraging future development by making a donation via Paypal.")
|
tr("Thanks for using SleepyHead. If you find it within your means, please consider encouraging future development by making a donation via Paypal.")
|
||||||
+ "</font>"
|
+ "</font>"
|
||||||
|
|
||||||
|
|
||||||
"<hr><p><b>Disclaimer</b><br/><i>" +
|
"<hr><p><b>Disclaimer</b><br/><i>" +
|
||||||
tr("This software comes with absolutely no warranty, either express of implied.") + " " +
|
tr("This software comes with absolutely no warranty, either express of implied.") + " " +
|
||||||
tr("It comes with no guarantee of fitness for any particular purpose.") + " " +
|
tr("It comes with no guarantee of fitness for any particular purpose.") + " " +
|
||||||
tr("No guarantees are made regarding the accuracy of any data this program displays.") + "</i></p>"
|
tr("No guarantees are made regarding the accuracy of any data this program displays.") + "</i></p>"
|
||||||
"<p><i>" +
|
"<p><i>" +
|
||||||
tr("This is NOT medical software, it is merely a research tool that provides a visual interpretation of data recorded by supported devices.")
|
tr("This is NOT medical software, it is merely a research tool that provides a visual interpretation of data recorded by supported devices.")
|
||||||
+
|
+
|
||||||
"<b> " + tr("This software is NOT suitable for medical diagnostics purposes, neither is it fit for CPAP complaince reporting purposes, or ANY other medical use for that matter.")
|
"<b> " + tr("This software is NOT suitable for medical diagnostics purposes, neither is it fit for CPAP complaince reporting purposes, or ANY other medical use for that matter.")
|
||||||
+ "</b></i></p>"
|
+ "</b></i></p>"
|
||||||
"<p><i>" +
|
"<p><i>" +
|
||||||
tr("The author and anyone associated with him accepts NO responsibilty for damages, issues or non-issues resulting from the use or mis-use of this software.")
|
tr("The author and anyone associated with him accepts NO responsibilty for damages, issues or non-issues resulting from the use or mis-use of this software.")
|
||||||
+ "</p><p><b>" +
|
+ "</p><p><b>" +
|
||||||
tr("Use this software entirely at your own risk.") + "</b></i></p>"
|
tr("Use this software entirely at your own risk.") + "</b></i></p>"
|
||||||
"</font></td></tr></table></span></body>"
|
"</font></td></tr></table></span></body>"
|
||||||
). arg(VersionString).
|
));
|
||||||
arg(ReleaseStatus).
|
|
||||||
arg(__DATE__).
|
|
||||||
arg(__TIME__).
|
|
||||||
arg(gitrev).
|
|
||||||
arg(QDir::toNativeSeparators(GetAppRoot()));
|
|
||||||
//"</div></body></html>"
|
//"</div></body></html>"
|
||||||
|
|
||||||
QDialog aboutbox;
|
QDialog aboutbox;
|
||||||
|
Loading…
Reference in New Issue
Block a user