mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-22 05:30:44 +00:00
Skip login screen take #2
This commit is contained in:
parent
16cb50cbb2
commit
9094888227
11
main.cpp
11
main.cpp
@ -96,7 +96,8 @@ int main(int argc, char *argv[])
|
|||||||
ResmedLoader::Register();
|
ResmedLoader::Register();
|
||||||
Profiles::Scan();
|
Profiles::Scan();
|
||||||
PREF["AppName"]="SleepyHead";
|
PREF["AppName"]="SleepyHead";
|
||||||
bool skip_login=(!PREF.ExistsAndTrue("SkipLoginScreen")) || force_login_screen;
|
bool skip_login=(PREF.ExistsAndTrue("SkipLoginScreen"));
|
||||||
|
if (force_login_screen) skip_login=false;
|
||||||
|
|
||||||
QString Version=QString("%1.%2.%3").arg(major_version).arg(minor_version).arg(revision_number);
|
QString Version=QString("%1.%2.%3").arg(major_version).arg(minor_version).arg(revision_number);
|
||||||
|
|
||||||
@ -139,11 +140,15 @@ int main(int argc, char *argv[])
|
|||||||
check_updates=false;
|
check_updates=false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ProfileSelect profsel(0);
|
||||||
if (skip_login) {
|
if (skip_login) {
|
||||||
|
profsel.QuickLogin();
|
||||||
|
if (profsel.result()==ProfileSelect::Rejected) {
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
p_profile=Profiles::Get(PREF["Profile"].toString());
|
p_profile=Profiles::Get(PREF["Profile"].toString());
|
||||||
} else p_profile=NULL;
|
} else p_profile=NULL;
|
||||||
if (p_profile) {
|
if (!p_profile) {
|
||||||
ProfileSelect profsel(0);
|
|
||||||
if (profsel.exec()==ProfileSelect::Rejected) {
|
if (profsel.exec()==ProfileSelect::Rejected) {
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
@ -159,6 +159,10 @@ void ProfileSelect::deleteProfile()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
void ProfileSelect::QuickLogin()
|
||||||
|
{
|
||||||
|
on_listView_activated(ui->listView->currentIndex());
|
||||||
|
}
|
||||||
|
|
||||||
void ProfileSelect::on_selectButton_clicked()
|
void ProfileSelect::on_selectButton_clicked()
|
||||||
{
|
{
|
||||||
|
@ -18,6 +18,7 @@ public:
|
|||||||
~ProfileSelect();
|
~ProfileSelect();
|
||||||
|
|
||||||
QString selectedProfile();
|
QString selectedProfile();
|
||||||
|
void QuickLogin();
|
||||||
private slots:
|
private slots:
|
||||||
void on_selectButton_clicked();
|
void on_selectButton_clicked();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user