Finish translation stuff, add new GFX Engine switcher

This commit is contained in:
Mark Watkins 2018-06-12 22:55:44 +10:00
parent 39f7ab18bf
commit 66b8a39f53
15 changed files with 209 additions and 96 deletions

View File

@ -14,6 +14,7 @@
#include <QDebug> #include <QDebug>
#include <QDir> #include <QDir>
#include <QCoreApplication> #include <QCoreApplication>
#include <QSettings>
#include "SleepLib/common.h" #include "SleepLib/common.h"
@ -66,6 +67,35 @@ const QString getDefaultAppRoot()
return approot; return approot;
} }
unsigned int currentGFXEngine()
{
QSettings settings;
return qMin(settings.value(GFXEngineSetting, 2).toUInt(), (unsigned int) 2);
}
void setCurrentGFXEngine(unsigned int r)
{
QSettings settings;
settings.setValue(GFXEngineSetting, qMin(r, (unsigned int)2));
}
QString GFXEngineName(unsigned int r)
{
switch (r) {
case 0:
return STR_GFXEngine_Software;
case 1:
return STR_GFXEngine_ANGLE;
case 2:
default:
return STR_GFXEngine_OpenGL;
}
}
QString getOpenGLVersionString() QString getOpenGLVersionString()
{ {
static QString glversion; static QString glversion;
@ -237,6 +267,9 @@ void copyPath(QString src, QString dst)
} }
} }
QString STR_GFXEngine_Software;
QString STR_GFXEngine_ANGLE;
QString STR_GFXEngine_OpenGL;
QString STR_UNIT_M; QString STR_UNIT_M;
QString STR_UNIT_CM; QString STR_UNIT_CM;
@ -440,6 +473,10 @@ QString STR_TR_WAvg; // Short form of Weighted Average
void initializeStrings() void initializeStrings()
{ {
STR_GFXEngine_Software = QObject::tr("Software Engine");
STR_GFXEngine_ANGLE = QObject::tr("ANGLE / OpenGLES");
STR_GFXEngine_OpenGL = QObject::tr("Desktop OpenGL");
STR_UNIT_M = QObject::tr(" m"); STR_UNIT_M = QObject::tr(" m");
STR_UNIT_CM = QObject::tr(" cm"); STR_UNIT_CM = QObject::tr(" cm");
STR_UNIT_INCH = QObject::tr("\""); STR_UNIT_INCH = QObject::tr("\"");

View File

@ -19,14 +19,24 @@
#include <QLocale> #include <QLocale>
#include "Graphs/glcommon.h" #include "Graphs/glcommon.h"
const QString GFXEngineSetting = "GFXEngine";
const QString CSTR_GFX_ANGLE = "ANGLE"; const QString CSTR_GFX_ANGLE = "ANGLE";
const QString CSTR_GFX_OpenGL = "OpenGL"; const QString CSTR_GFX_OpenGL = "OpenGL";
const QString CSTR_GFX_BrokenGL = "LegacyGFX"; const QString CSTR_GFX_BrokenGL = "LegacyGFX";
//! \brief Gets the first day of week from the system locale, to show in the calendars. //! \brief Gets the first day of week from the system locale, to show in the calendars.
Qt::DayOfWeek firstDayOfWeekFromLocale(); Qt::DayOfWeek firstDayOfWeekFromLocale();
QString getBranchVersion(); QString getBranchVersion();
QString getGFXEngine();
unsigned int currentGFXEngine();
void setCurrentGFXEngine(unsigned int r);
QString GFXEngineName(unsigned int r);
QString appResourcePath(); QString appResourcePath();
QString getGraphicsEngine(); QString getGraphicsEngine();
@ -162,6 +172,11 @@ const QString STR_AppRoot = "SleepyHeadData";
// Commonly used translatable text strings // Commonly used translatable text strings
/////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////
extern QString STR_GFXEngine_Software;
extern QString STR_GFXEngine_ANGLE;
extern QString STR_GFXEngine_OpenGL;
extern QString STR_UNIT_M; extern QString STR_UNIT_M;
extern QString STR_UNIT_CM; extern QString STR_UNIT_CM;
extern QString STR_UNIT_INCH; extern QString STR_UNIT_INCH;

View File

@ -25,7 +25,7 @@ Help::Help(QWidget *parent) :
ui->setupUi(this); ui->setupUi(this);
QString helpRoot = appResourcePath() + "/Help/"; QString helpRoot = appResourcePath() + "/Help/";
QString helpIndex = helpRoot + "help.qhc"; QString helpIndex = helpRoot + "index.qhc";
QDir dir(helpRoot); QDir dir(helpRoot);
QStringList nameFilters = QStringList("*.qch"); QStringList nameFilters = QStringList("*.qch");
@ -61,7 +61,7 @@ Help::Help(QWidget *parent) :
// Delete the crappy qhc so we can generate our own. // Delete the crappy qhc so we can generate our own.
if (QFile::exists(helpIndex)) QFile::remove(helpIndex); if (QFile::exists(helpIndex)) QFile::remove(helpIndex);
helpEngine = new QHelpEngine(helpRoot + "help.qhc"); helpEngine = new QHelpEngine(helpIndex);
helpNamespace = "jedimark.net.SleepyHeadGuide"; helpNamespace = "jedimark.net.SleepyHeadGuide";
if (!helpFile.isEmpty()) { if (!helpFile.isEmpty()) {

View File

@ -66,9 +66,8 @@
<keyword name="VS" ref="glossary.html#Vibratory_Snore_.28VS.29_Index"/> <keyword name="VS" ref="glossary.html#Vibratory_Snore_.28VS.29_Index"/>
</keywords> </keywords>
<files> <files>
<file>../default.css</file> <file>default.css</file>
<file>*.html</file> <file>*.html</file>
<file>*.png</file>
</files> </files>
</filterSection> </filterSection>
</QtHelpProject> </QtHelpProject>

View File

@ -66,9 +66,8 @@
<keyword name="VS" ref="glossary.html#Vibratory_Snore_.28VS.29_Index"/> <keyword name="VS" ref="glossary.html#Vibratory_Snore_.28VS.29_Index"/>
</keywords> </keywords>
<files> <files>
<file>../default.css</file> <file>default.css</file>
<file>*.html</file> <file>*.html</file>
<file>*.png</file>
</files> </files>
</filterSection> </filterSection>
</QtHelpProject> </QtHelpProject>

View File

@ -11,5 +11,8 @@
<output>SleepyHeadGuide.nl.qch</output> <output>SleepyHeadGuide.nl.qch</output>
</file> </file>
</generate> </generate>
<register>
<file>SleepyHeadGuide.en_US.qch</file>
</register>
</docFiles> </docFiles>
</QHelpCollectionProject> </QHelpCollectionProject>

View File

@ -41,32 +41,50 @@ MainWindow *mainwin = nullptr;
int compareVersion(QString version); int compareVersion(QString version);
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
#ifdef Q_WS_X11 #ifdef Q_WS_X11
XInitThreads(); XInitThreads();
#endif #endif
QCoreApplication::setApplicationName(getAppName());
QCoreApplication::setOrganizationName(getDeveloperName());
QSettings settings;
unsigned int gfxEngine = qMin(settings.value(GFXEngineSetting, 0).toUInt(), (unsigned int)2);
switch (gfxEngine) {
case 0:
QCoreApplication::setAttribute(Qt::AA_UseDesktopOpenGL);
break;
case 1:
QCoreApplication::setAttribute(Qt::AA_UseOpenGLES);
break;
case 2:
default:
QCoreApplication::setAttribute(Qt::AA_UseSoftwareOpenGL);
}
QString lastlanguage = settings.value(LangSetting, "").toString();
bool dont_load_profile = false; bool dont_load_profile = false;
bool force_data_dir = false; bool force_data_dir = false;
bool changing_language = false; bool changing_language = false;
QString load_profile = ""; QString load_profile = "";
QApplication a(argc, argv); QApplication a(argc, argv);
a.setApplicationName(getAppName());
a.setOrganizationName(getDeveloperName());
QStringList args = a.arguments(); QStringList args = a.arguments();
QSettings settings;
QString lastlanguage = settings.value(LangSetting, "").toString();
if (lastlanguage.isEmpty()) if (lastlanguage.isEmpty())
changing_language = true; changing_language = true;
for (int i = 1; i < args.size(); i++) { for (int i = 1; i < args.size(); i++) {
if (args[i] == "-l") { dont_load_profile = true; } if (args[i] == "-l") { dont_load_profile = true; }
else if (args[i] == "-d") { force_data_dir = true; } else if (args[i] == "-d") { force_data_dir = true; }
else if (args[i] == "-language") { else if (args[i] == "--language") {
changing_language = true; changing_language = true;
// reset to force language dialog // reset to force language dialog
@ -127,10 +145,12 @@ int main(int argc, char *argv[])
bool opengl2supported = glversion >= 2.0; bool opengl2supported = glversion >= 2.0;
bool bad_graphics = !opengl2supported; bool bad_graphics = !opengl2supported;
bool intel_graphics = false; bool intel_graphics = false;
#ifndef NO_OPENGL_BUILD //#ifndef NO_OPENGL_BUILD
getOpenGLVersionString().contains("INTEL", Qt::CaseInsensitive);
#endif
getOpenGLVersionString().contains("INTEL", Qt::CaseInsensitive);
//#endif
/*
#ifdef BROKEN_OPENGL_BUILD #ifdef BROKEN_OPENGL_BUILD
Q_UNUSED(bad_graphics) Q_UNUSED(bad_graphics)
Q_UNUSED(intel_graphics) Q_UNUSED(intel_graphics)
@ -159,7 +179,7 @@ int main(int argc, char *argv[])
exit(1); exit(1);
} }
#endif #endif
*/
//////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////
// Datafolder location Selection // Datafolder location Selection
//////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////

View File

@ -1653,7 +1653,8 @@ void MainWindow::reloadProfile()
void MainWindow::RestartApplication(bool force_login, QString cmdline) void MainWindow::RestartApplication(bool force_login, QString cmdline)
{ {
if (p_profile) p_profile->removeLock(); CloseProfile();
PREF.Save();
QString apppath; QString apppath;
#ifdef Q_OS_MAC #ifdef Q_OS_MAC
@ -2225,10 +2226,10 @@ void MainWindow::on_actionChange_Language_triggered()
return; return;
} }
p_profile->Save(); CloseProfile();
PREF.Save(); PREF.Save();
RestartApplication(true, "-language"); RestartApplication(true, "--language");
} }
void MainWindow::on_actionChange_Data_Folder_triggered() void MainWindow::on_actionChange_Data_Folder_triggered()

View File

@ -130,7 +130,7 @@ class MainWindow : public QMainWindow
If force_login is set, it will return to the login menu even if it's set to skip If force_login is set, it will return to the login menu even if it's set to skip
*/ */
static void RestartApplication(bool force_login = false, QString cmdline = QString()); void RestartApplication(bool force_login = false, QString cmdline = QString());
void JumpDaily(); void JumpDaily();
void JumpOverview(); void JumpOverview();

View File

@ -87,6 +87,8 @@ PreferencesDialog::PreferencesDialog(QWidget *parent, Profile *_profile) :
ui->resmedPrefCalcsNotice->setVisible(haveResMed); ui->resmedPrefCalcsNotice->setVisible(haveResMed);
#endif #endif
ui->gfxEngineCombo->setCurrentIndex(currentGFXEngine());
ui->culminativeIndices->setEnabled(false); ui->culminativeIndices->setEnabled(false);
QLocale locale = QLocale::system(); QLocale locale = QLocale::system();
@ -664,42 +666,48 @@ bool PreferencesDialog::Save()
bool recompress_events = false; bool recompress_events = false;
bool recalc_events = false; bool recalc_events = false;
bool needs_restart = false; bool needs_restart = false;
bool needs_reload = false;
if (ui->ahiGraphZeroReset->isChecked() != profile->cpap->AHIReset()) { recalc_events = true; } if (ui->ahiGraphZeroReset->isChecked() != profile->cpap->AHIReset()) { recalc_events = true; }
if (ui->useSquareWavePlots->isChecked() != AppSetting->squareWavePlots()) { if (ui->useSquareWavePlots->isChecked() != AppSetting->squareWavePlots()) {
needs_restart = true; needs_reload = true;
} }
if ((profile->session->daySplitTime() != ui->timeEdit->time()) || if ((profile->session->daySplitTime() != ui->timeEdit->time()) ||
(profile->session->combineCloseSessions() != ui->combineSlider->value()) || (profile->session->combineCloseSessions() != ui->combineSlider->value()) ||
(profile->session->ignoreShortSessions() != ui->IgnoreSlider->value())) { (profile->session->ignoreShortSessions() != ui->IgnoreSlider->value())) {
needs_restart = true; needs_reload = true;
} }
if (profile->session->lockSummarySessions() != ui->LockSummarySessionSplitting->isChecked()) { if (profile->session->lockSummarySessions() != ui->LockSummarySessionSplitting->isChecked()) {
needs_restart = true; needs_reload = true;
} }
if (AppSetting->userEventPieChart() != ui->showUserFlagsInPie->isChecked()) { if (AppSetting->userEventPieChart() != ui->showUserFlagsInPie->isChecked()) {
// lazy.. fix me // lazy.. fix me
needs_reload = true;
}
if (ui->gfxEngineCombo->currentIndex() != currentGFXEngine()) {
setCurrentGFXEngine(ui->gfxEngineCombo->currentIndex());
needs_restart = true; needs_restart = true;
} }
int rdi_set = profile->general->calculateRDI() ? 1 : 0; int rdi_set = profile->general->calculateRDI() ? 1 : 0;
if (rdi_set != ui->eventIndexCombo->currentIndex()) { if (rdi_set != ui->eventIndexCombo->currentIndex()) {
//recalc_events=true; //recalc_events=true;
needs_restart = true; needs_reload = true;
} }
if ((profile->general->prefCalcMiddle() != ui->prefCalcMiddle->currentIndex()) if ((profile->general->prefCalcMiddle() != ui->prefCalcMiddle->currentIndex())
|| (profile->general->prefCalcMax() != ui->prefCalcMax->currentIndex()) || (profile->general->prefCalcMax() != ui->prefCalcMax->currentIndex())
|| (profile->general->prefCalcPercentile() != ui->prefCalcPercentile->value())) { || (profile->general->prefCalcPercentile() != ui->prefCalcPercentile->value())) {
needs_restart = true; needs_reload = true;
} }
if (profile->cpap->leakRedline() != ui->leakRedlineSpinbox->value()) { if (profile->cpap->leakRedline() != ui->leakRedlineSpinbox->value()) {
recalc_events = true; needs_reload = true;
} }
@ -716,7 +724,7 @@ bool PreferencesDialog::Save()
if (profile->cpap->userEventFlagging() != ui->customEventGroupbox->isChecked()) { if (profile->cpap->userEventFlagging() != ui->customEventGroupbox->isChecked()) {
// if (profile->cpap->userEventFlagging()) { // if (profile->cpap->userEventFlagging()) {
// Don't bother recalculating, just switch off // Don't bother recalculating, just switch off
needs_restart = true; needs_reload = true;
//} else //} else
recalc_events = true; recalc_events = true;
} }
@ -742,13 +750,13 @@ bool PreferencesDialog::Save()
return false; return false;
} }
} else { recalc_events = false; } } else { recalc_events = false; }
} /*else if (needs_restart) { } else if (needs_restart) {
if (QMessageBox::question(this, tr("Restart Required"), if (QMessageBox::question(this, tr("Restart Required"),
tr("One or more of the changes you have made will require this application to be restarted,\nin order for these changes to come into effect.\n\nWould you like do this now?"), tr("One or more of the changes you have made will require this application to be restarted,\nin order for these changes to come into effect.\n\nWould you like do this now?"),
QMessageBox::Yes, QMessageBox::No) == QMessageBox::No) { QMessageBox::Yes, QMessageBox::No) == QMessageBox::No) {
return false; return false;
} }
}*/ }
schema::channel[OXI_SPO2].setLowerThreshold(ui->oxiDesaturationThreshold->value()); schema::channel[OXI_SPO2].setLowerThreshold(ui->oxiDesaturationThreshold->value());
schema::channel[OXI_Pulse].setLowerThreshold(ui->flagPulseBelow->value()); schema::channel[OXI_Pulse].setLowerThreshold(ui->flagPulseBelow->value());
@ -913,10 +921,10 @@ bool PreferencesDialog::Save()
} else if (recalc_events) { } else if (recalc_events) {
// send a signal instead? // send a signal instead?
mainwin->reprocessEvents(needs_restart); mainwin->reprocessEvents(needs_restart);
} else if (needs_restart) { } else if (needs_reload) {
QTimer::singleShot(0, mainwin, SLOT(reloadProfile())); QTimer::singleShot(0, mainwin, SLOT(reloadProfile()));
// profile->removeLock(); } else if (needs_restart) {
// mainwin->RestartApplication(); mainwin->RestartApplication();
} else { } else {
mainwin->getDaily()->LoadDate(mainwin->getDaily()->getDate()); mainwin->getDaily()->LoadDate(mainwin->getDaily()->getDate());
// Save early.. just in case.. // Save early.. just in case..

View File

@ -1,4 +1,4 @@
/* SleepyHead Preferences Dialog Headers /* SleepyHead Preferences Dialog Headers
* *
* Copyright (c) 2011-2018 Mark Watkins <mark@jedimark.net> * Copyright (c) 2011-2018 Mark Watkins <mark@jedimark.net>
* *
@ -34,7 +34,6 @@ class MySortFilterProxyModel: public QSortFilterProxyModel
protected: protected:
//! \brief Simply extends filterAcceptRow to scan children as well //! \brief Simply extends filterAcceptRow to scan children as well
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const; bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const;
}; };
/*! \class PreferencesDialog /*! \class PreferencesDialog

View File

@ -9,8 +9,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>848</width> <width>696</width>
<height>646</height> <height>610</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
@ -57,7 +57,7 @@
</sizepolicy> </sizepolicy>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>2</number> <number>6</number>
</property> </property>
<widget class="QWidget" name="importTab"> <widget class="QWidget" name="importTab">
<attribute name="title"> <attribute name="title">
@ -2225,11 +2225,8 @@ p, li { white-space: pre-wrap; }
<number>2</number> <number>2</number>
</property> </property>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_13"> <layout class="QGridLayout" name="gridLayout_16">
<property name="spacing"> <item row="1" column="0">
<number>8</number>
</property>
<item>
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="groupBox">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum"> <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
@ -2614,39 +2611,10 @@ p, li { white-space: pre-wrap; }
</property> </property>
</widget> </widget>
</item> </item>
<item row="11" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
<item> <item row="0" column="1" rowspan="3">
<widget class="Line" name="line_2">
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<property name="lineWidth">
<number>1</number>
</property>
<property name="midLineWidth">
<number>0</number>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2"> <widget class="QGroupBox" name="groupBox_2">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum"> <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
@ -2736,6 +2704,57 @@ this application to be unstable with this feature enabled.</string>
</property> </property>
</widget> </widget>
</item> </item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="0" column="0">
<widget class="QGroupBox" name="groupBox_6">
<property name="title">
<string>Graphics Engine (Requires Restart)</string>
</property>
<layout class="QGridLayout" name="gridLayout_12">
<item row="0" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Try changing this from the default setting (Desktop OpenGL) if you experience rendering problems with SleepyHead's graphs.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QComboBox" name="gfxEngineCombo">
<item>
<property name="text">
<string>Desktop OpenGL</string>
</property>
</item>
<item>
<property name="text">
<string>ANGLE / OpenGLES</string>
</property>
</item>
<item>
<property name="text">
<string>MESA (Software Renderer)</string>
</property>
</item>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
@ -2774,7 +2793,7 @@ this application to be unstable with this feature enabled.</string>
<item row="0" column="1"> <item row="0" column="1">
<widget class="QLabel" name="label_19"> <widget class="QLabel" name="label_19">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -2793,7 +2812,7 @@ this application to be unstable with this feature enabled.</string>
<item row="0" column="2"> <item row="0" column="2">
<widget class="QLabel" name="label_14"> <widget class="QLabel" name="label_14">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -2812,7 +2831,7 @@ this application to be unstable with this feature enabled.</string>
<item row="0" column="3"> <item row="0" column="3">
<widget class="QLabel" name="label_15"> <widget class="QLabel" name="label_15">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -3099,6 +3118,12 @@ this application to be unstable with this feature enabled.</string>
</item> </item>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label_30"> <widget class="QLabel" name="label_30">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font"> <property name="font">
<font> <font>
<weight>75</weight> <weight>75</weight>

View File

@ -24,6 +24,8 @@
#include "newprofile.h" #include "newprofile.h"
#include "mainwindow.h" #include "mainwindow.h"
extern MainWindow * mainwin;
ProfileSelect::ProfileSelect(QWidget *parent) : ProfileSelect::ProfileSelect(QWidget *parent) :
QDialog(parent), QDialog(parent),
ui(new Ui::ProfileSelect) ui(new Ui::ProfileSelect)
@ -356,7 +358,7 @@ void ProfileSelect::on_listView_customContextMenuRequested(const QPoint &pos)
void ProfileSelect::on_pushButton_clicked() void ProfileSelect::on_pushButton_clicked()
{ {
MainWindow::RestartApplication(false, "-d"); mainwin->RestartApplication(false, "-d");
} }
void ProfileSelect::on_filter_textChanged(const QString &arg1) void ProfileSelect::on_filter_textChanged(const QString &arg1)

View File

@ -15,16 +15,18 @@ DEFINES += QT_DEPRECATED_WARNINGS
#SleepyHead requires OpenGL 2.0 support to run smoothly #SleepyHead requires OpenGL 2.0 support to run smoothly
#On platforms where it's not available, it can still be built to work #On platforms where it's not available, it can still be built to work
#provided the BrokenGL DEFINES flag is passed to qmake (eg, qmake [specs] /path/to/SleepyHeadQT.pro DEFINES+=BrokenGL) #provided the BrokenGL DEFINES flag is passed to qmake (eg, qmake [specs] /path/to/SleepyHeadQT.pro DEFINES+=BrokenGL)
contains(DEFINES, BrokenGL) { #contains(DEFINES, BrokenGL) {
message("Building with QWidget gGraphView") # message("Building with QWidget gGraphView")
DEFINES += BROKEN_OPENGL_BUILD # DEFINES += BROKEN_OPENGL_BUILD
} else:contains(DEFINES, NoGL) { #} else:contains(DEFINES, NoGL) {
message("Building with QWidget gGraphView (No GL at all)") # message("Building with QWidget gGraphView (No GL at all)")
DEFINES += BROKEN_OPENGL_BUILD # DEFINES += BROKEN_OPENGL_BUILD
DEFINES += NO_OPENGL_BUILD # DEFINES += NO_OPENGL_BUILD
} else { #} else {
message("Building with QGLWidget gGraphView") # message("Building with QGLWidget gGraphView")
} #}
DEFINES -= BrokenGL
QT += opengl QT += opengl
DEFINES += LOCK_RESMED_SESSIONS DEFINES += LOCK_RESMED_SESSIONS
@ -65,12 +67,16 @@ win32 {
PRE_TARGETDEPS += git_info.h PRE_TARGETDEPS += git_info.h
QMAKE_EXTRA_TARGETS += gitinfotarget QMAKE_EXTRA_TARGETS += gitinfotarget
#Comment out for official builds #Comment out for official builds
DEFINES += BETA_BUILD DEFINES += BETA_BUILD
#Build the help documentation #Build the help documentation
system(qcollectiongenerator help/help.qhcp -o help/help.qhc) message("Generating help files");
qtPrepareTool(QCOLGENERATOR, qcollectiongenerator)
command=$$QCOLGENERATOR $$PWD/help/index.qhcp -o $$PWD/help/index.qhc
system($$command)|error("Failed to run: $$command")
message("Finished generating help files");
unix:!macx:!haiku { unix:!macx:!haiku {
LIBS += -lX11 -lz -lGLU LIBS += -lX11 -lz -lGLU
@ -141,10 +147,7 @@ for(file, TRANSLATIONS) {
#copy the Translation and Help files to where the test binary wants them #copy the Translation and Help files to where the test binary wants them
macx { macx {
TransFiles.files = $$files(../Translations/*.qm) HelpFiles.files = $$files($$PWD/help/*.qch)
TransFiles.path = Contents/Resources/Translations
HelpFiles.files = $$files(help/*.qch)
HelpFiles.files += $$files(help/help.qhc)
HelpFiles.path = Contents/Resources/Help HelpFiles.path = Contents/Resources/Help
QMAKE_BUNDLE_DATA += TransFiles QMAKE_BUNDLE_DATA += TransFiles
QMAKE_BUNDLE_DATA += HelpFiles QMAKE_BUNDLE_DATA += HelpFiles
@ -153,7 +156,7 @@ macx {
DDIR = $$OUT_PWD/Translations DDIR = $$OUT_PWD/Translations
HELPDIR = $$OUT_PWD/Help HELPDIR = $$OUT_PWD/Help
TRANS_FILES += $$PWD/../Translations/*.qm TRANS_FILES += $$PWD/translations/*.qm
HELP_FILES += $$PWD/help/*.qch HELP_FILES += $$PWD/help/*.qch
win32 { win32 {
@ -164,8 +167,8 @@ macx {
DDIR ~= s,/,\\,g DDIR ~= s,/,\\,g
HELPDIR ~= s,/,\\,g HELPDIR ~= s,/,\\,g
system(mkdir $$quote($$HELPDIR)) !exists($$quote($$HELPDIR)): system(mkdir $$quote($$HELPDIR))
system(mkdir $$quote($$DDIR)) !exists($$quote($$DDIR)): system(mkdir $$quote($$DDIR))
for(FILE,TRANS_FILES_WIN) { for(FILE,TRANS_FILES_WIN) {
system(xcopy /y $$quote($$FILE) $$quote($$DDIR)) system(xcopy /y $$quote($$FILE) $$quote($$DDIR))
@ -375,7 +378,6 @@ DISTFILES += \
help/help_en/gettingstarted.html \ help/help_en/gettingstarted.html \
help/help_en/tipsntricks.html \ help/help_en/tipsntricks.html \
help/help_en/faq.html \ help/help_en/faq.html \
help/help.qhcp \
help/help_nl/daily.html \ help/help_nl/daily.html \
help/help_nl/faq.html \ help/help_nl/faq.html \
help/help_nl/gettingstarted.html \ help/help_nl/gettingstarted.html \
@ -390,4 +392,5 @@ DISTFILES += \
help/help_en/reportingbugs.html \ help/help_en/reportingbugs.html \
win_icon.rc \ win_icon.rc \
help/help_nl/SleepyHeadGuide_nl.qhp \ help/help_nl/SleepyHeadGuide_nl.qhp \
help/help_en/SleepyHeadGuide_en.qhp help/help_en/SleepyHeadGuide_en.qhp \
help/index.qhcp

View File

@ -98,6 +98,8 @@ void initTranslations()
langFiles[code] = fi.fileName(); langFiles[code] = fi.fileName();
langPaths[code] = externalPath; langPaths[code] = externalPath;
} }
std::sort(replaced.begin(), replaced.end());
std::sort(extratrans.begin(), extratrans.end());
if (replaced.size()>0) qDebug() << "Overridden Tranlsations:" << QString(replaced.join(", ")).toLocal8Bit().data(); if (replaced.size()>0) qDebug() << "Overridden Tranlsations:" << QString(replaced.join(", ")).toLocal8Bit().data();
if (extratrans.size()>0) qDebug() << "Extra Translations:" << QString(extratrans.join(", ")).toLocal8Bit().data(); if (extratrans.size()>0) qDebug() << "Extra Translations:" << QString(extratrans.join(", ")).toLocal8Bit().data();