Changed Updates in Preferences to General, Reordered some stuff, Added Skip Login Screen option in General.

This commit is contained in:
Mark Watkins 2011-11-18 19:05:22 +10:00
parent f13bfd8d77
commit 16cb50cbb2
3 changed files with 120 additions and 102 deletions

View File

@ -79,7 +79,14 @@ int main(int argc, char *argv[])
#endif
QGL::setPreferredPaintEngine(QPaintEngine::OpenGL);
bool force_login_screen=false;
QApplication a(argc, argv);
QStringList args=QCoreApplication::arguments();
for (int i=1;i<args.size();i++) {
if (args[i]=="-l") force_login_screen=true;
}
a.setApplicationName("SleepyHead");
initialize();
@ -89,7 +96,7 @@ int main(int argc, char *argv[])
ResmedLoader::Register();
Profiles::Scan();
PREF["AppName"]="SleepyHead";
bool skip_login=(!PREF.ExistsAndTrue("SkipLoginScreen")) || force_login_screen;
QString Version=QString("%1.%2.%3").arg(major_version).arg(minor_version).arg(revision_number);
@ -132,9 +139,14 @@ int main(int argc, char *argv[])
check_updates=false;
}
}
ProfileSelect profsel(0);
if (profsel.exec()==ProfileSelect::Rejected) {
exit(1);
if (skip_login) {
p_profile=Profiles::Get(PREF["Profile"].toString());
} else p_profile=NULL;
if (p_profile) {
ProfileSelect profsel(0);
if (profsel.exec()==ProfileSelect::Rejected) {
exit(1);
}
}
}
PREF["VersionString"]=Version;

View File

@ -81,6 +81,9 @@ PreferencesDialog::PreferencesDialog(QWidget *parent,Profile * _profile) :
if (!PREF.Exists("Updates_AutoCheck")) PREF["Updates_AutoCheck"]=true;
ui->automaticallyCheckUpdates->setChecked(PREF["Updates_AutoCheck"].toBool());
if (!PREF.Exists("SkipLoginScreen")) PREF["SkipLoginScreen"]=false;
ui->skipLoginScreen->setChecked(PREF["SkipLoginScreen"].toBool());
if (!PREF.Exists("Updates_CheckFrequency")) PREF["Updates_CheckFrequency"]=3;
ui->updateCheckEvery->setValue(PREF["Updates_CheckFrequency"].toInt());
if (PREF.Exists("Updates_LastChecked")) {
@ -213,6 +216,8 @@ void PreferencesDialog::Save()
(*profile)["SyncOximetry"]=ui->oximetrySync->isChecked();
(*profile)["OximeterType"]=ui->oximetryType->currentText();
PREF["SkipLoginScreen"]=ui->skipLoginScreen->isChecked();
(*profile)["EventWindowSize"]=ui->eventWindowSlider->value();
if (ui->squareWavePlots->isChecked() != (*profile)["SquareWavePlots"].toBool()) {

View File

@ -9,7 +9,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>500</width>
<width>599</width>
<height>330</height>
</rect>
</property>
@ -179,40 +179,6 @@ This takes extra space, and has been known to cause problems on certain computer
</property>
</widget>
</item>
<item row="9" column="2">
<widget class="QCheckBox" name="useMultithreading">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>You may need to disable this if your experiencing crashes.
It has no effect on single cpu machines.</string>
</property>
<property name="text">
<string>Use Multi-Threading</string>
</property>
</widget>
</item>
<item row="10" column="2">
<widget class="QCheckBox" name="skipEmptyDays">
<property name="toolTip">
<string>Skip empty days with Prev &amp; Next buttons above daily view calendar</string>
</property>
<property name="text">
<string>Skip Empty Days</string>
</property>
</widget>
</item>
<item row="11" column="2">
<widget class="QCheckBox" name="squareWavePlots">
<property name="text">
<string>Square Wave Plots</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_24">
<property name="text">
@ -265,6 +231,23 @@ It has no effect on single cpu machines.</string>
</item>
</layout>
</item>
<item row="9" column="2">
<widget class="QCheckBox" name="squareWavePlots">
<property name="text">
<string>Square Wave Plots</string>
</property>
</widget>
</item>
<item row="12" column="2">
<widget class="QCheckBox" name="skipEmptyDays">
<property name="toolTip">
<string>Skip empty days with Prev &amp; Next buttons above daily view calendar</string>
</property>
<property name="text">
<string>Skip Empty Days</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="sessionTab">
@ -648,19 +631,6 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_11">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Graph Text</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QFontComboBox" name="graphFont"/>
</item>
@ -677,19 +647,6 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_12">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Graph Titles</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QFontComboBox" name="titleFont"/>
</item>
@ -706,29 +663,9 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_13">
<property name="text">
<string>Big Text</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QFontComboBox" name="bigFont"/>
</item>
<item row="4" column="2">
<widget class="QSpinBox" name="bigFontSize">
<property name="minimum">
<number>6</number>
</property>
<property name="maximum">
<number>72</number>
</property>
<property name="value">
<number>18</number>
</property>
</widget>
</item>
<item row="1" column="4">
<widget class="QCheckBox" name="applicationFontItalic">
<property name="sizePolicy">
@ -917,6 +854,52 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_11">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Graph Text</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_12">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Graph Titles</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_13">
<property name="text">
<string>Big Text</string>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QSpinBox" name="bigFontSize">
<property name="minimum">
<number>6</number>
</property>
<property name="maximum">
<number>72</number>
</property>
<property name="value">
<number>18</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
@ -1015,26 +998,11 @@ p, li { white-space: pre-wrap; }
</item>
</layout>
</widget>
<widget class="QWidget" name="tab">
<widget class="QWidget" name="updatesTab">
<attribute name="title">
<string>&amp;Updates</string>
<string>&amp;General</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_7">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>4</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QGroupBox" name="automaticallyCheckUpdates">
<property name="sizePolicy">
@ -1200,6 +1168,39 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>General Preferences</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_8">
<item>
<widget class="QCheckBox" name="useMultithreading">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>You may need to disable this if your experiencing crashes.
It has no effect on single cpu machines.</string>
</property>
<property name="text">
<string>Use Multi-Threading</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="skipLoginScreen">
<property name="text">
<string>Skip Login Screen</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer_3">
<property name="orientation">