diff --git a/src/settings/settings.cpp b/src/settings/settings.cpp index 26930b4..fc99d20 100644 --- a/src/settings/settings.cpp +++ b/src/settings/settings.cpp @@ -805,6 +805,10 @@ void settings::on_enableLockscreenCheckBox_toggled(bool checked) if(checked == true) { logEnabled(settingString, className); 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 { logDisabled(settingString, className); diff --git a/src/widgets/misc/egg.cpp b/src/widgets/misc/egg.cpp index 91a1d1f..db3e847 100644 --- a/src/widgets/misc/egg.cpp +++ b/src/widgets/misc/egg.cpp @@ -10,13 +10,33 @@ egg::egg(QWidget *parent) : ui->previousBtn->setProperty("type", "borderless"); ui->nextBtn->setProperty("type", "borderless"); ui->quitBtn->setProperty("type", "borderless"); - ui->previousBtn->setFont(QFont("u001")); - ui->nextBtn->setFont(QFont("u001")); - ui->quitBtn->setFont(QFont("u001")); + ui->infoBtn->setProperty("type", "borderless"); + ui->previousBtn->setText(""); + 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->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); + // Set first contributor name + ui->contributorName->setText("
Szybet
(Contributor)
"); QTimer::singleShot(500, this, SLOT(changeIndexSlot())); } @@ -35,6 +55,23 @@ void egg::changeIndex(int index) { tux-linux (3) */ + // Contributor name + QString name = "
"; + if(index == 0) { + name.append("Szybet
(Contributor)"); + } + else if(index == 1) { + name.append("NiLuJe
(Contributor)"); + } + else if(index == 2) { + name.append("akemnade
(Contributor)"); + } + else if(index == 3) { + name.append("tux-linux
(Maintainer)"); + } + name.append("
"); + ui->contributorName->setText(name); + ui->graphicsView->items().clear(); graphicsScene->clear(); @@ -45,23 +82,6 @@ void egg::changeIndex(int index) { QRectF rect = graphicsScene->itemsBoundingRect(); graphicsScene->setSceneRect(rect); ui->graphicsView->fitInView(graphicsScene->sceneRect(), Qt::KeepAspectRatio); - - // Contributor name - QString name = "
"; - 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("
"); - ui->contributorName->setText(name); } void egg::changeIndexSlot() { @@ -75,7 +95,7 @@ void egg::on_previousBtn_clicked() changeIndex(index); } else { - QMessageBox::critical(this, "Critical", "Index out of range"); + QMessageBox::critical(this, "Critical", "Index out of range."); } } @@ -86,7 +106,7 @@ void egg::on_nextBtn_clicked() changeIndex(index); } else { - QMessageBox::critical(this, "Critical", "Index out of range"); + QMessageBox::critical(this, "Critical", "Index out of range."); } } @@ -94,3 +114,8 @@ void egg::on_quitBtn_clicked() { this->close(); } + +void egg::on_infoBtn_clicked() +{ + QMessageBox::information(this, "Information", "Congratulations, you've found the easter egg!"); +} diff --git a/src/widgets/misc/egg.h b/src/widgets/misc/egg.h index 351122a..5dfc6ad 100644 --- a/src/widgets/misc/egg.h +++ b/src/widgets/misc/egg.h @@ -29,6 +29,7 @@ private slots: void on_nextBtn_clicked(); void changeIndexSlot(); void on_quitBtn_clicked(); + void on_infoBtn_clicked(); private: Ui::egg *ui; diff --git a/src/widgets/misc/egg.ui b/src/widgets/misc/egg.ui index fde90ac..5cd8d58 100644 --- a/src/widgets/misc/egg.ui +++ b/src/widgets/misc/egg.ui @@ -15,71 +15,80 @@ - - - - - - - - 0 - - - - - Next - - - - - - - Contributor - - - Qt::AlignCenter|Qt::AlignHCenter|Qt::AlignLeading|Qt::AlignVCenter - - - - - - - Previous - - - - - - - QFrame::Plain - - - Qt::Vertical - - - - - - - QFrame::Plain - - - Qt::Vertical - - - - - + + + 0 + - + - <b>InkBox OS project - People</b> - - - Qt::AlignCenter|Qt::AlignHCenter|Qt::AlignLeading|Qt::AlignVCenter + Quit + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + <html><head/><body><p><span style=" font-weight:700;">InkBox OS project – People</span></p></body></html> + + + Qt::AlignCenter|Qt::AlignHCenter|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + Info + + + + + + + + + + + QFrame::Plain + + + 2 + + + Qt::Horizontal + + + + + + @@ -87,17 +96,64 @@ QFrame::Plain + + 2 + Qt::Horizontal - - - Quit + + + 0 - + + + + Next + + + + + + + QFrame::Plain + + + Qt::Vertical + + + + + + + QFrame::Plain + + + Qt::Vertical + + + + + + + Previous + + + + + + + + + + Qt::AlignCenter|Qt::AlignHCenter|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + +