Lockscreen fixes

This commit is contained in:
Nicolas Mailloux 2023-06-12 22:40:21 -04:00
parent ddf9be2edd
commit 20b6f7231a
4 changed files with 172 additions and 86 deletions

View file

@ -805,6 +805,10 @@ void settings::on_enableLockscreenCheckBox_toggled(bool checked)
if(checked == true) { if(checked == true) {
logEnabled(settingString, className); logEnabled(settingString, className);
writeFile(".config/12-lockscreen/config", "true"); writeFile(".config/12-lockscreen/config", "true");
// Launching passcode setup wizard if none seems to be set at the moment
if(!(QFile::exists(".config/12-lockscreen/passcode") && QFile::exists(".config/12-lockscreen/salt"))) {
ui->setPasscodeBtn->click();
}
} }
else { else {
logDisabled(settingString, className); logDisabled(settingString, className);

View file

@ -10,13 +10,33 @@ egg::egg(QWidget *parent) :
ui->previousBtn->setProperty("type", "borderless"); ui->previousBtn->setProperty("type", "borderless");
ui->nextBtn->setProperty("type", "borderless"); ui->nextBtn->setProperty("type", "borderless");
ui->quitBtn->setProperty("type", "borderless"); ui->quitBtn->setProperty("type", "borderless");
ui->previousBtn->setFont(QFont("u001")); ui->infoBtn->setProperty("type", "borderless");
ui->nextBtn->setFont(QFont("u001")); ui->previousBtn->setText("");
ui->quitBtn->setFont(QFont("u001")); ui->previousBtn->setIcon(QIcon(":/resources/arrow-left.png"));
ui->nextBtn->setText("");
ui->nextBtn->setIcon(QIcon(":/resources/arrow-right.png"));
ui->quitBtn->setText("");
ui->quitBtn->setIcon(QIcon(":/resources/close.png"));
ui->infoBtn->setText("");
ui->infoBtn->setIcon(QIcon(":/resources/info.png"));
ui->titleLabel->setFont(QFont("Inter")); ui->titleLabel->setFont(QFont("Inter"));
ui->contributorName->setFont(QFont("Inter")); ui->contributorName->setFont(QFont("Inter"));
if(global::deviceID == "n873\n") {
ui->nextBtn->setStyleSheet("padding: 13.5px");
ui->previousBtn->setStyleSheet("padding: 13.5px");
}
else if(global::deviceID == "n437\n") {
ui->nextBtn->setStyleSheet("padding: 12.5px");
ui->previousBtn->setStyleSheet("padding: 12.5px");
}
else {
ui->nextBtn->setStyleSheet("padding: 10px");
ui->previousBtn->setStyleSheet("padding: 10px");
}
graphicsScene = new QGraphicsScene(this); graphicsScene = new QGraphicsScene(this);
// Set first contributor name
ui->contributorName->setText("<div align='center'><b>Szybet<br>(Contributor)</b></div>");
QTimer::singleShot(500, this, SLOT(changeIndexSlot())); QTimer::singleShot(500, this, SLOT(changeIndexSlot()));
} }
@ -35,6 +55,23 @@ void egg::changeIndex(int index) {
tux-linux (3) tux-linux (3)
*/ */
// Contributor name
QString name = "<div align='center'><b>";
if(index == 0) {
name.append("Szybet<br>(Contributor)");
}
else if(index == 1) {
name.append("NiLuJe<br>(Contributor)");
}
else if(index == 2) {
name.append("akemnade<br>(Contributor)");
}
else if(index == 3) {
name.append("tux-linux<br>(Maintainer)");
}
name.append("</b></div>");
ui->contributorName->setText(name);
ui->graphicsView->items().clear(); ui->graphicsView->items().clear();
graphicsScene->clear(); graphicsScene->clear();
@ -45,23 +82,6 @@ void egg::changeIndex(int index) {
QRectF rect = graphicsScene->itemsBoundingRect(); QRectF rect = graphicsScene->itemsBoundingRect();
graphicsScene->setSceneRect(rect); graphicsScene->setSceneRect(rect);
ui->graphicsView->fitInView(graphicsScene->sceneRect(), Qt::KeepAspectRatio); ui->graphicsView->fitInView(graphicsScene->sceneRect(), Qt::KeepAspectRatio);
// Contributor name
QString name = "<div align='center'><b>";
if(index == 0) {
name.append("Szybet");
}
else if(index == 1) {
name.append("NiLuJe");
}
else if(index == 2) {
name.append("akemnade");
}
else if(index == 3) {
name.append("tux-linux (Maintainer)");
}
name.append("</b></div>");
ui->contributorName->setText(name);
} }
void egg::changeIndexSlot() { void egg::changeIndexSlot() {
@ -75,7 +95,7 @@ void egg::on_previousBtn_clicked()
changeIndex(index); changeIndex(index);
} }
else { else {
QMessageBox::critical(this, "Critical", "Index out of range"); QMessageBox::critical(this, "Critical", "<font face='u001'>Index out of range.</font>");
} }
} }
@ -86,7 +106,7 @@ void egg::on_nextBtn_clicked()
changeIndex(index); changeIndex(index);
} }
else { else {
QMessageBox::critical(this, "Critical", "Index out of range"); QMessageBox::critical(this, "Critical", "<font face='u001'>Index out of range.</font>");
} }
} }
@ -94,3 +114,8 @@ void egg::on_quitBtn_clicked()
{ {
this->close(); this->close();
} }
void egg::on_infoBtn_clicked()
{
QMessageBox::information(this, "Information", "<font face='u001'>Congratulations, you've found the easter egg!</font>");
}

View file

@ -29,6 +29,7 @@ private slots:
void on_nextBtn_clicked(); void on_nextBtn_clicked();
void changeIndexSlot(); void changeIndexSlot();
void on_quitBtn_clicked(); void on_quitBtn_clicked();
void on_infoBtn_clicked();
private: private:
Ui::egg *ui; Ui::egg *ui;

View file

@ -14,51 +14,109 @@
<string>Dialog</string> <string>Dialog</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QGridLayout" name="gridLayout_3">
<property name="rightMargin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QPushButton" name="quitBtn">
<property name="text">
<string>Quit</string>
</property>
</widget>
</item>
<item row="0" column="1">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="3">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="2">
<widget class="QLabel" name="titleLabel">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:700;&quot;&gt;InkBox OS project People&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter|Qt::AlignHCenter|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QPushButton" name="infoBtn">
<property name="text">
<string>Info</string>
</property>
</widget>
</item>
</layout>
</item>
<item> <item>
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout">
<item row="1" column="0"> <item row="1" column="1">
<widget class="Line" name="line_5">
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="lineWidth">
<number>2</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QGraphicsView" name="graphicsView"/> <widget class="QGraphicsView" name="graphicsView"/>
</item> </item>
<item row="3" column="0"> </layout>
</item>
<item>
<widget class="Line" name="line">
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="lineWidth">
<number>2</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<layout class="QGridLayout" name="gridLayout_2"> <layout class="QGridLayout" name="gridLayout_2">
<property name="bottomMargin"> <property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
<item row="0" column="4"> <item row="1" column="4">
<widget class="QPushButton" name="nextBtn"> <widget class="QPushButton" name="nextBtn">
<property name="text"> <property name="text">
<string>Next</string> <string>Next</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="2"> <item row="1" column="3">
<widget class="QLabel" name="contributorName">
<property name="text">
<string>Contributor</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter|Qt::AlignHCenter|Qt::AlignLeading|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QPushButton" name="previousBtn">
<property name="text">
<string>Previous</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="Line" name="line_2">
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="Line" name="line_3"> <widget class="Line" name="line_3">
<property name="frameShadow"> <property name="frameShadow">
<enum>QFrame::Plain</enum> <enum>QFrame::Plain</enum>
@ -68,37 +126,35 @@
</property> </property>
</widget> </widget>
</item> </item>
</layout> <item row="1" column="1">
</item> <widget class="Line" name="line_2">
<item row="0" column="0">
<widget class="QLabel" name="titleLabel">
<property name="text">
<string>&lt;b&gt;InkBox OS project - People&lt;/b&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter|Qt::AlignHCenter|Qt::AlignLeading|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line">
<property name="frameShadow"> <property name="frameShadow">
<enum>QFrame::Plain</enum> <enum>QFrame::Plain</enum>
</property> </property>
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Vertical</enum>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="1" column="0">
<widget class="QPushButton" name="quitBtn"> <widget class="QPushButton" name="previousBtn">
<property name="text"> <property name="text">
<string>Quit</string> <string>Previous</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="2">
<widget class="QLabel" name="contributorName">
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter|Qt::AlignHCenter|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</item>
</layout> </layout>
</widget> </widget>
<resources/> <resources/>