Skip to content

Commit

Permalink
feat: add tips for login selections
Browse files Browse the repository at this point in the history
Log:
  • Loading branch information
Decodetalkers committed Oct 16, 2023
1 parent f509ebe commit 0467f93
Showing 1 changed file with 36 additions and 2 deletions.
38 changes: 36 additions & 2 deletions src/plugin-accounts/window/accountsmodule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#include "widgets/horizontalmodule.h"
#include "widgets/itemmodule.h"
#include "widgets/dcclistview.h"
#include "widgets/widgetmodule.h"
#include "widgets/settingsgroupmodule.h"

#include <QStringList>
#include <QTimer>
Expand All @@ -42,6 +44,7 @@
#include <DFloatingButton>
#include <DBlurEffectWidget>
#include <DIconTheme>
#include <DTipLabel>

#include <polkit-qt5-1/PolkitQt1/Authority>

Expand Down Expand Up @@ -148,13 +151,44 @@ AccountsModule::AccountsModule(QObject *parent)
m_accountTypeModule = accountTypeModule;
appendChild(m_accountTypeModule);

SettingsGroupModule *loginmodule = new SettingsGroupModule("loginModule", tr("loginModule"));
loginmodule->setBackgroundStyle(SettingsGroup::BackgroundStyle::NoneBackground);
appendChild(loginmodule);

ListViewModule *listViewModule = new ListViewModule("autoLogin", tr("Auto Login"));
connect(listViewModule, &ListViewModule::clicked, this, &AccountsModule::onLoginModule);
appendChild(listViewModule);
loginmodule->appendChild(listViewModule);
m_autoLoginModule = new ModuleObjectItem("autoLogin", tr("Auto Login"));
listViewModule->appendChild(m_autoLoginModule);
auto autoLoginTip = new WidgetModule<DTipLabel>(
"autoLoginTip",
tr(""),
[](DTipLabel *autoLoginLabel) {
autoLoginLabel->setWordWrap(true);
autoLoginLabel->setAlignment(Qt::AlignLeft);
autoLoginLabel->setContentsMargins(10, 0, 10, 0);
autoLoginLabel->setText(tr("You can directly login to computer when computer is powered on or when computer is waken up"));
});

loginmodule->appendChild(autoLoginTip);

ListViewModule *noPasslistViewModule = new ListViewModule("noPassword", tr("noPassword"));
connect(noPasslistViewModule, &ListViewModule::clicked, this, &AccountsModule::onLoginModule);
loginmodule->appendChild(noPasslistViewModule);
m_loginWithoutPasswordModule = new ModuleObjectItem("loginWithoutPassword", tr("Login Without Password"));
listViewModule->appendChild(m_loginWithoutPasswordModule);
noPasslistViewModule->appendChild(m_loginWithoutPasswordModule);

auto noPasswordTip = new WidgetModule<DTipLabel>(
"noPasswordTip",
tr("ss"),
[](DTipLabel *noPasswordLabel) {
noPasswordLabel->setWordWrap(true);
noPasswordLabel->setAlignment(Qt::AlignLeft);
noPasswordLabel->setContentsMargins(10, 0, 10, 0);
noPasswordLabel->setText(tr("You can login to computer without password when computer is powered on or when computer in waken up"));
});

loginmodule->appendChild(noPasswordTip);

ItemModule *validityDaysModule = new ItemModule("validityDays", tr("Validity Days"), this, &AccountsModule::initValidityDays);
validityDaysModule->setBackground(true);
Expand Down

0 comments on commit 0467f93

Please sign in to comment.