feat(login plugin&dynamicScreensaver): Provide login lock screen authentication plugin interface to third-party authentication vendors&Dynamic screensaver

Description: 提供登录锁屏认证插件接口给到第三方认证厂商&动态屏保

Log: 需求21475提供登录锁屏认证插件接口给到第三方认证厂商迁移;需求 21340屏保支持视频格式和动态格式迁移
This commit is contained in:
winnerym 2023-08-29 16:36:10 +08:00
parent 1b641888a4
commit a79b9bb0e8
72 changed files with 6344 additions and 1123 deletions

View File

@ -67,7 +67,7 @@ QString DeviceType::getDeviceType_tr(int deviceType)
case VoicePrint:
return tr("VoicePrint");
case LOGINOPT_TYPE_GENERAL_UKEY:
return tr("ukey");
return tr("Ukey");
case REMOTE_QRCODE_TYPE:
return tr("QRCode");
default:

View File

@ -283,6 +283,7 @@ enum LOGINOPT_TYPE {
LOGINOPT_TYPE_GENERAL_UKEY, // 普通的ukey
LOGINOPT_TYPE_ADVANCED_UKEY, // 高阶的ukey
LOGINOPT_TYPE_QRCODE, // 二维码
LOGINOPT_TYPE_CUSTOM, // 第三方
LOGINOPT_TYPE_OTHERS, // 其他
LOGINOPT_TYPE_COUNT
};

View File

@ -50,6 +50,7 @@ UniAuthService::UniAuthService(QObject *parent)
m_isActivatable = true;
}
}
delete dbusService;
}
}

View File

@ -1,12 +1,13 @@
cmake_minimum_required(VERSION 2.6)
project(ukui-screensaver)
find_package(Qt5 COMPONENTS Core Widgets DBus X11Extras Xml Network Svg)
find_package(Qt5 COMPONENTS Core Widgets DBus X11Extras Xml Network Svg Multimedia MultimediaWidgets)
find_package(PkgConfig REQUIRED)
find_package(OpenCV REQUIRED)
find_package(PkgConfig)
find_package(KF5Screen REQUIRED)
find_package(KF5Wayland REQUIRED)
find_package(LayerShellQt REQUIRED)
pkg_check_modules(GIOUNIX2 REQUIRED gio-unix-2.0)
pkg_check_modules(GLIB2 REQUIRED glib-2.0 gio-2.0)
@ -34,6 +35,7 @@ set(TS_FILES
${CMAKE_CURRENT_SOURCE_DIR}/i18n_ts/pt.ts
${CMAKE_CURRENT_SOURCE_DIR}/i18n_ts/ru.ts
${CMAKE_CURRENT_SOURCE_DIR}/i18n_ts/tr.ts
${CMAKE_CURRENT_SOURCE_DIR}/i18n_ts/nm.ts
)
add_custom_command(
OUTPUT ${TS_FILES}

View File

@ -28,4 +28,4 @@ set(Common_SRC
)
add_library(Common STATIC ${Common_SRC})
target_link_libraries(Common Qt5::Core Qt5::DBus Qt5::Widgets ${GIOUNIX2_LIBRARIES} ${KF5Wayland_LIBRARIES} -lKF5WaylandClient -lKF5WaylandServer KF5::WindowSystem)
target_link_libraries(Common Qt5::Core Qt5::DBus Qt5::Widgets Qt5::X11Extras ${GIOUNIX2_LIBRARIES} ${KF5Wayland_LIBRARIES} -lKF5WaylandClient -lKF5WaylandServer KF5::WindowSystem)

View File

@ -18,13 +18,53 @@
#include <QMimeType>
#include <QSettings>
#include <QPainterPath>
#include <QMimeDatabase>
#include <QPainter>
#include <QPainterPath>
#include <QFileInfo>
#include <QFontMetrics>
#include <QDir>
#include <QTextStream>
#include <QtX11Extras/QX11Info>
#include <X11/XKBlib.h>
#include "commonfunc.h"
#define DRM_DIR "/sys/class/leds/"
/**
* @brief
* @return true:
*/
bool checkCapsLockState()
{
QDir ledDir(DRM_DIR);
QStringList leds = ledDir.entryList(QDir::Dirs);
QString capsFile;
for(int i = 0;i<leds.count();i++){
if(leds.at(i).contains("capslock"))
capsFile = leds.at(i);
}
QFile drmStatusFile(DRM_DIR + capsFile + "/brightness");
if(drmStatusFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
QTextStream in(&drmStatusFile);
QString status = in.readLine();
if(status == "0") {
return false;
}else{
return true;
}
}
bool capsState = false;
unsigned int n;
XkbGetIndicatorState(QX11Info::display(), XkbUseCoreKbd, &n);
capsState = (n & 0x01) == 1;
return capsState;
}
bool ispicture(QString filepath)
{
QFileInfo file(filepath);

View File

@ -25,6 +25,7 @@
#define G_FONT_SIZE (11.0)
bool checkCapsLockState();
bool ispicture(QString filepath);
QString getSystemVersion();
QString getSystemDistrib();

View File

@ -27,22 +27,22 @@ double getDefaultFontSize()
{
GSettingsSchemaSource *schema_source = NULL;
GSettingsSchema *schema = NULL;
double defaultFontSize = DEFAULT_FONT_SIZE;
schema_source = g_settings_schema_source_get_default();
if(schema_source){
schema = g_settings_schema_source_lookup (schema_source,KEY_SYSTEM_FONT_SIZE,TRUE);
if(schema){
GVariant *size;
unsigned long length;
GSettings *gs;
gs = g_settings_new(STYLE_TYPE_SCHEMA);
size = g_settings_get_default_value(gs, KEY_SYSTEM_FONT_SIZE);
QString fontsize(g_variant_get_string(size,&length));
g_object_unref(gs);
return fontsize.toDouble();
}
if (schema_source) {
schema = g_settings_schema_source_lookup(schema_source,STYLE_TYPE_SCHEMA,TRUE);
if (schema) {
GSettings *gs = g_settings_new(STYLE_TYPE_SCHEMA);
if (gs) {
GVariant *size = g_settings_get_default_value(gs, KEY_SYSTEM_FONT_SIZE);
QString fontsize(g_variant_get_string(size, NULL));
g_variant_unref(size);
g_object_unref(gs);
defaultFontSize = fontsize.toDouble();
}
g_settings_schema_unref(schema);
}
}
return DEFAULT_FONT_SIZE;
return defaultFontSize;
}

View File

@ -19,6 +19,7 @@
#include "plasma-shell-manager.h"
#include <QApplication>
#include <QX11Info>
#include <KWayland/Client/connection_thread.h>
#include <KWayland/Client/registry.h>
@ -31,6 +32,9 @@ static PlasmaShellManager* global_instance = nullptr;
PlasmaShellManager *PlasmaShellManager::getInstance()
{
if(QString(qgetenv("XDG_SESSION_TYPE")) != "wayland" || QX11Info::isPlatformX11()){
return nullptr;
}
if (!global_instance)
{
global_instance = new PlasmaShellManager;

View File

@ -43,9 +43,9 @@ BackThread::~BackThread()
}
//get the connection state of wired and wireles network
IFace* BackThread::execGetIface()
IFace BackThread::execGetIface()
{
IFace *iface = new IFace();
IFace iface;
QString tmpPath = "/tmp/kylin-nm-iface-" + QDir::home().dirName();
QString cmd = "export LANG='en_US.UTF-8';export LANGUAGE='en_US';nmcli -f TYPE,DEVICE,STATE device > " + tmpPath;
@ -64,8 +64,8 @@ IFace* BackThread::execGetIface()
QStringList txtList = txt.split("\n");
file.close();
iface->lstate = 2;
iface->wstate = 2;
iface.lstate = 2;
iface.wstate = 2;
for (int i = 1; i < txtList.size(); i ++) {
QString line = txtList.at(i);
@ -77,32 +77,32 @@ IFace* BackThread::execGetIface()
QString iname = lastStr.left(index2);
QString istateStr = lastStr.mid(index2).trimmed();
if (type == "ethernet" && iface->lstate != 0) {
if (type == "ethernet" && iface.lstate != 0) {
// if type is wired network
iface->lname = iname;
iface.lname = iname;
if (istateStr == "unmanaged") {
iface->lstate = 2; //switch of wired device is off
iface.lstate = 2; //switch of wired device is off
}
if (istateStr == "disconnected" || istateStr == "unavailable") {
iface->lstate = 1; //wired network is disconnected
iface.lstate = 1; //wired network is disconnected
}
if (istateStr == "connected") {
iface->lstate = 0; //wired network is connected
iface.lstate = 0; //wired network is connected
}
}
if (type == "wifi" && iface->wstate != 0) {
if (type == "wifi" && iface.wstate != 0) {
// if type is wireless network
iface->wname = iname;
iface.wname = iname;
if (istateStr == "unmanaged" || istateStr == "unavailable") {
iface->wstate = 2; //switch of wireless device is off
iface.wstate = 2; //switch of wireless device is off
}
if (istateStr == "disconnected") {
iface->wstate = 1; //wireless network is disconnected
iface.wstate = 1; //wireless network is disconnected
}
if (istateStr == "connected") {
iface->wstate = 0; //wireless network is connected
iface.wstate = 0; //wireless network is connected
}
}
}
@ -120,7 +120,7 @@ void BackThread::execEnNet()
// int status = system("nmcli networking on");
// if (status != 0){ syslog(LOG_ERR, "execute 'nmcli networking on' in function 'execEnNet' failed");}
while (1) {
if (execGetIface()->lstate != 2) {
if (execGetIface().lstate != 2) {
sleep(3);
emit enNetDone();
emit btFinish();
@ -133,14 +133,14 @@ void BackThread::execEnNet()
//turn off the switch of wireless network first, then turn off the switch of network
void BackThread::execDisNet()
{
if (execGetIface()->wstate != 2) {
if (execGetIface().wstate != 2) {
char *chr = "nmcli radio wifi off";
Utils::m_system(chr);
// int status = system("nmcli radio wifi off");
// if (status != 0){ syslog(LOG_ERR, "execute 'nmcli radio wifi off' in function 'execDisNet' failed");}
while (1) {
if (execGetIface()->wstate == 2) {
if (execGetIface().wstate == 2) {
emit disWifiDone();
emit btFinish();
break;
@ -154,7 +154,7 @@ void BackThread::execDisNet()
// int status1 = system("nmcli networking off");
// if (status1 != 0){ syslog(LOG_ERR, "execute 'nmcli networking off' in function 'execDisNet' failed");}
while (1) {
if (execGetIface()->lstate == 2) {
if (execGetIface().lstate == 2) {
emit disNetDone();
emit btFinish();
break;
@ -185,7 +185,7 @@ void BackThread::execEnWifi()
//int status1 = system("nmcli radio wifi on");
//if (status1 != 0){ syslog(LOG_ERR, "execute 'nmcli radio wifi on' in function 'execEnWifi' failed");}
while (1) {
if (execGetIface()->wstate != 2) {
if (execGetIface().wstate != 2) {
KylinDBus objKyDbus;
while (1) {
if (objKyDbus.getAccessPointsNumber() > 0) {
@ -211,7 +211,7 @@ void BackThread::execDisWifi()
// int status = system("nmcli radio wifi off");
// if (status != 0){ syslog(LOG_ERR, "execute 'nmcli radio wifi off' in function 'execDisWifi' failed");}
while (1) {
if (execGetIface()->wstate == 2) {
if (execGetIface().wstate == 2) {
KylinNM::reflashWifiUi();
emit disWifiDone();
emit btFinish();
@ -233,8 +233,8 @@ void BackThread::execConnLan(QString connName)
Utils::m_system(cmd.toUtf8().data());
// int status = system(cmd.toUtf8().data());
// if (status != 0){ syslog(LOG_ERR, "execute 'nmcli connection up' in function 'execConnLan' failed");}
qDebug()<<"debug: in function execConnLan, wired net state is: "<<QString::number(execGetIface()->lstate);
syslog(LOG_DEBUG, "In function execConnLan, wired net state is: %d", execGetIface()->lstate);
qDebug()<<"debug: in function execConnLan, wired net state is: "<<QString::number(execGetIface().lstate);
syslog(LOG_DEBUG, "In function execConnLan, wired net state is: %d", execGetIface().lstate);
emit connDone(0);
} else {
qDebug()<<"connect wired network failed for without wired cable plug in.";
@ -263,8 +263,8 @@ void BackThread::execConnWifiPWD(QString connName, QString password)
file.close();
if (line.indexOf("successfully") != -1) {
emit connDone(0);
qDebug()<<"debug: in function execConnWifiPWD, wireless net state is: "<<QString::number(execGetIface()->wstate);
syslog(LOG_DEBUG, "In function execConnWifiPWD, wireless net state is: %d", execGetIface()->wstate);
qDebug()<<"debug: in function execConnWifiPWD, wireless net state is: "<<QString::number(execGetIface().wstate);
syslog(LOG_DEBUG, "In function execConnWifiPWD, wireless net state is: %d", execGetIface().wstate);
} else {
emit connDone(1);
}
@ -293,8 +293,8 @@ void BackThread::on_readoutput()
qDebug()<<"on_readoutput: "<< str;
if (str.indexOf("successfully") != -1) {
emit connDone(0); //send this signal if connect net successfully
qDebug()<<"debug: in function on_readoutput, wireless net state is: "<<QString::number(execGetIface()->wstate);
syslog(LOG_DEBUG, "In function on_readoutput, wireless net state is: %d", execGetIface()->wstate);
qDebug()<<"debug: in function on_readoutput, wireless net state is: "<<QString::number(execGetIface().wstate);
syslog(LOG_DEBUG, "In function on_readoutput, wireless net state is: %d", execGetIface().wstate);
} else if(str.indexOf("unknown") != -1) {
emit connDone(2);
} else {

View File

@ -32,10 +32,10 @@
class IFace{
public:
QString lname;
QString wname;
int lstate; // 0已连接 1未连接 2已关闭
int wstate; // 0已连接 1未连接 2已关闭
QString lname = "";
QString wname = "";
int lstate = 2; // 0已连接 1未连接 2已关闭
int wstate = 2; // 0已连接 1未连接 2已关闭
};
class BackThread : public QObject
@ -45,7 +45,7 @@ public:
explicit BackThread(QObject *parent = nullptr);
~BackThread();
IFace* execGetIface();
IFace execGetIface();
QString getConnProp(QString connName);
QString execChkLanWidth(QString ethName);
QProcess *cmdConnWifi = nullptr;

View File

@ -187,8 +187,11 @@ conlist *kylin_network_get_conlist_info()
}
//获取当前活动网络连接
activecon *kylin_network_get_activecon_info()
int kylin_network_get_activecon_info(activecon** activelist, int* count)
{
if (*activelist != NULL || !count) {
return -1;
}
struct passwd *pwd;
pwd = getpwuid(getuid());
char *name = pwd->pw_name;
@ -213,6 +216,7 @@ activecon *kylin_network_get_activecon_info()
if((activefp=fopen(filename,"r"))==NULL)
{
printf("error!");
return -1;
}
fgets(activeStrLine,1024,activefp);
while(!feof(activefp))
@ -222,22 +226,22 @@ activecon *kylin_network_get_activecon_info()
}
// printf("%d\n",activenum);
fclose(activefp);
activecon *activelist=(activecon *)malloc(sizeof(activecon)*activenum);
*activelist=(activecon *)malloc(sizeof(activecon)*activenum);
int count=0;
*count=0;
FILE *fp;
char StrLine[1024];
if((fp=fopen(filename,"r"))==NULL)
{
printf("error!");
return -1;
}
free(path);
fgets(StrLine,1024,fp);
while(!feof(fp))
{
if(count==activenum-1)break;
if(*count==activenum-1)break;
fgets(StrLine,1024,fp);
@ -257,10 +261,9 @@ activecon *kylin_network_get_activecon_info()
}
// printf("连接名称长度:%d\n",num);
activelist[count].con_name=(char *)malloc(sizeof(char)*(num+1));
strncpy(conname,StrLine,num+1);
conname[num]='\0';
strncpy(activelist[count].con_name,conname,num+1);
strncpy((*activelist)[*count].con_name,conname,num+1);
// printf("%s\n",activelist[count].con_name);
//截取连接类型
@ -291,10 +294,9 @@ activecon *kylin_network_get_activecon_info()
if(*index2==' ')break;
num1++;
}
activelist[count].type=(char *)malloc(sizeof(char)*(num1+1));
strncpy(type,index1+2,num1+1);
type[num1]='\0';
strncpy(activelist[count].type,type,num1+1);
strncpy((*activelist)[*count].type,type,num1+1);
// printf("%s\n",activelist[count].type);
//截取连接所属设备
@ -315,20 +317,14 @@ activecon *kylin_network_get_activecon_info()
if(*index4==' ')break;
num2++;
}
activelist[count].dev=(char *)malloc(sizeof(char)*(num2+1));
strncpy(dev,index3+1,num2+1);
dev[num2]='\0';
strncpy(activelist[count].dev,dev,num2+1);
strncpy((*activelist)[*count].dev,dev,num2+1);
// printf("%s\n",activelist[count].dev);
count++;
(*count)++;
}
fclose(fp);
activelist[count].con_name=NULL;
activelist[count].type=NULL;
activelist[count].dev=NULL;
return activelist;
return 0;
}
//创建新的以太网连接
@ -829,6 +825,7 @@ long *kylin_network_get_bytes(char *if_name)
if(i == 10)
{
rtbyt[1] = atol(value);
free(value);
break;
}
free(value);
@ -869,6 +866,7 @@ long *kylin_network_get_packets(char *if_name)
if(i == 11)
{
rtpkt[1] = atol(value);
free(value);
break;
}
free(value);
@ -909,6 +907,7 @@ long *kylin_network_get_errs(char *if_name)
if(i == 12)
{
rterrs[1] = atol(value);
free(value);
break;
}
free(value);
@ -949,6 +948,7 @@ long *kylin_network_get_drop(char *if_name)
if(i == 13)
{
rtdrop[1] = atol(value);
free(value);
break;
}
free(value);
@ -989,6 +989,7 @@ long *kylin_network_get_fifo(char *if_name)
if(i == 14)
{
rtfifo[1] = atol(value);
free(value);
break;
}
free(value);

View File

@ -52,9 +52,9 @@ typedef struct
typedef struct
{
char *con_name;//活动网络连接名称
char *type;//活动网络连接类型
char *dev;//活动网络所属设备
char con_name[128];//活动网络连接名称
char type[128];//活动网络连接类型
char dev[128];//活动网络所属设备
}activecon;//存放当前活动网络连接
/*
@ -71,9 +71,9 @@ conlist *kylin_network_get_conlist_info();
/*
* Get the active network connection.
* return the struct pointer.
* return the struct pointer and list count.
*/
activecon *kylin_network_get_activecon_info();
int kylin_network_get_activecon_info(activecon** activelist, int* count);
/*
* Create a new Ethernet connection.

View File

@ -489,26 +489,26 @@ void KylinNM::getInitLanSlist()
// 初始化网络
void KylinNM::initNetwork()
{
BackThread *bt = new BackThread();
IFace *iface = bt->execGetIface();
BackThread bt;
IFace iface = bt.execGetIface();
wname = iface->wname;
lwname = iface->wname;
lname = iface->lname;
llname = iface->lname;
wname = iface.wname;
lwname = iface.wname;
lname = iface.lname;
llname = iface.lname;
mwBandWidth = bt->execChkLanWidth(lname);
mwBandWidth = bt.execChkLanWidth(lname);
// 开关状态
qDebug()<<"===";
qDebug()<<"state of network: '0' is connected, '1' is disconnected, '2' is net device switch off";
syslog(LOG_DEBUG, "state of network: '0' is connected, '1' is disconnected, '2' is net device switch off");
qDebug()<<"current network state: lan state ="<<iface->lstate<<", wifi state ="<<iface->wstate ;
syslog(LOG_DEBUG, "current network state: wired state =%d, wifi state =%d", iface->lstate, iface->wstate);
qDebug()<<"current network state: lan state ="<<iface.lstate<<", wifi state ="<<iface.wstate ;
syslog(LOG_DEBUG, "current network state: wired state =%d, wifi state =%d", iface.lstate, iface.wstate);
qDebug()<<"===";
//ui->lbBtnNetBG->setStyleSheet(btnOnQss);
if (iface->wstate == 0 || iface->wstate == 1 || iface->wstate == 3) {
if (iface.wstate == 0 || iface.wstate == 1 || iface.wstate == 3) {
// ui->lbBtnWifiBG->setStyleSheet(btnBgOnQss);
//ui->lbBtnWifiBall->move(X_RIGHT_WIFI_BALL, Y_WIFI_BALL);
btnWireless->setSwitchStatus(true);
@ -519,11 +519,11 @@ void KylinNM::initNetwork()
}
// 初始化网络列表
if (iface->wstate != 2) {
if (iface->wstate == 0) {
if (iface.wstate != 2) {
if (iface.wstate == 0) {
connWifiDone(3);
} else {
if (iface->lstate == 0) {
if (iface.lstate == 0) {
connLanDone(3);
}
}
@ -533,8 +533,8 @@ void KylinNM::initNetwork()
ui->btnWifiList->setStyleSheet("QPushButton{border:none;}");
} else {
objKyDBus->setWifiSwitchState(false); //通知控制面板wifi未开启
if (iface->lstate != 2) {
if (iface->lstate == 0) {
if (iface.lstate != 2) {
if (iface.lstate == 0) {
connLanDone(3);
}
onBtnNetListClicked();
@ -544,7 +544,7 @@ void KylinNM::initNetwork()
} else {
/*没看懂这段断开连接是什么意思,暂时关闭这段操作,会导致页面卡顿、某些情景还会自动断开网络
// BackThread *m_bt = new BackThread();
// IFace *m_iface = m_bt->execGetIface();
// m_bt->execGetIface();
// m_bt->disConnLanOrWifi("ethernet");
// sleep(1);
@ -552,7 +552,6 @@ void KylinNM::initNetwork()
// sleep(1);
// m_bt->disConnLanOrWifi("ethernet");
// delete m_iface;
// m_bt->deleteLater();
*/
@ -683,16 +682,13 @@ void KylinNM::updateNetList()
}
is_stop_check_net_state = 1;
if (is_btnWifiList_clicked == 1) {
BackThread *loop_bt = new BackThread();
IFace *loop_iface = loop_bt->execGetIface();
BackThread loop_bt;
IFace loop_iface = loop_bt.execGetIface();
if (loop_iface->wstate != 2) {
if (loop_iface.wstate != 2) {
is_update_wifi_list = 1;
this->ksnm->execGetWifiList(); //更新wifi列表
}
delete loop_iface;
loop_bt->deleteLater();
}
is_stop_check_net_state = 0;
}
@ -724,16 +720,13 @@ void KylinNM::iconActivated(QSystemTrayIcon::ActivationReason reason)
}
is_stop_check_net_state = 1;
if (is_btnWifiList_clicked == 1) {
BackThread *loop_bt = new BackThread();
IFace *loop_iface = loop_bt->execGetIface();
BackThread loop_bt;
IFace loop_iface = loop_bt.execGetIface();
if (loop_iface->wstate != 2) {
if (loop_iface.wstate != 2) {
is_update_wifi_list = 1;
this->ksnm->execGetWifiList(); //更新wifi列表
}
delete loop_iface;
loop_bt->deleteLater();
}
is_stop_check_net_state = 0;
} else {
@ -912,9 +905,13 @@ void KylinNM::getActiveInfo()
QString actLanName = "--";
QString actWifiName = "--";
activecon *act = kylin_network_get_activecon_info();
activecon *act = NULL;
int count = 0;
kylin_network_get_activecon_info(&act, &count);
if(!act)
return ;
int index = 0;
while (act[index].con_name != NULL) {
while (act && index < count) {
if (QString(act[index].type) == "ethernet" || QString(act[index].type) == "802-3-ethernet") {
actLanName = QString(act[index].con_name);
}
@ -923,7 +920,9 @@ void KylinNM::getActiveInfo()
}
index ++;
}
if (act) {
free(act);
}
//ukui3.0中获取currentActWifiSignalLv的值
if (activeWifiSignalLv > 75) {
@ -979,14 +978,12 @@ void KylinNM::onPhysicalCarrierChanged(bool flag)
qDebug()<<"拔出了有线网的网线";
syslog(LOG_DEBUG,"wired physical cable is already plug out");
BackThread *bt = new BackThread();
IFace *iface = bt->execGetIface();
if (iface->lstate != 0) {
BackThread bt;
IFace iface = bt.execGetIface();
if (iface.lstate != 0) {
is_stop_check_net_state = 1;
wiredCableDownTimer->start(2000);
}
delete iface;
bt->deleteLater();
}
}
@ -1017,13 +1014,12 @@ void KylinNM::onCarrierDownHandle()
void KylinNM::onDeleteLan()
{
deleteLanTimer->stop();
BackThread *btn_bt = new BackThread();
btn_bt->disConnLanOrWifi("ethernet");
BackThread btn_bt;
btn_bt.disConnLanOrWifi("ethernet");
sleep(1);
btn_bt->disConnLanOrWifi("ethernet");
btn_bt.disConnLanOrWifi("ethernet");
sleep(1);
btn_bt->disConnLanOrWifi("ethernet");
btn_bt->deleteLater();
btn_bt.disConnLanOrWifi("ethernet");
this->stopLoading();
onBtnNetListClicked(0);
@ -1079,42 +1075,36 @@ void KylinNM::checkIsWirelessDeviceOn()
void KylinNM::getLanBandWidth()
{
BackThread *bt = new BackThread();
IFace *iface = bt->execGetIface();
BackThread bt;
IFace iface = bt.execGetIface();
lname = iface->lname;
lname = iface.lname;
mwBandWidth = bt->execChkLanWidth(lname);
mwBandWidth = bt.execChkLanWidth(lname);
}
//检测网络设备状态
bool KylinNM::checkLanOn()
{
BackThread *bt = new BackThread();
IFace *iface = bt->execGetIface();
BackThread bt;
IFace iface = bt.execGetIface();
if (iface->lstate == 2) {
if (iface.lstate == 2) {
return false;
} else {
return true;
}
delete iface;
bt->deleteLater();
}
bool KylinNM::checkWlOn()
{
BackThread *bt = new BackThread();
IFace *iface = bt->execGetIface();
BackThread bt;
IFace iface = bt.execGetIface();
bool ret = true;
if (iface->wstate == 2) {
if (iface.wstate == 2) {
ret = false;
}
delete iface;
bt->deleteLater();
return ret;
}
@ -1307,14 +1297,14 @@ void KylinNM::onBtnNetListClicked(int flag)
ui->lbNetListBG->setStyleSheet(btnOnQss);
ui->lbWifiListBG->setStyleSheet(btnOffQss);
BackThread *bt = new BackThread();
IFace *iface = bt->execGetIface();
BackThread bt;
IFace iface = bt.execGetIface();
lbLoadDown->show();
lbLoadUp->show();
lbLoadDownImg->show();
lbLoadUpImg->show();
if (iface->lstate != 0) {
if (iface.lstate != 0) {
lbLoadDown->hide();
lbLoadUp->hide();
lbLoadDownImg->hide();
@ -1340,7 +1330,7 @@ void KylinNM::onBtnNetListClicked(int flag)
return;
}
if (iface->lstate != 2) {
if (iface.lstate != 2) {
this->startLoading();
this->ksnm->execGetLanList();
} else {
@ -1360,10 +1350,6 @@ void KylinNM::onBtnNetListClicked(int flag)
ui->lbWifiListImg->setStyleSheet("QLabel{border-image:url(:/res/x/pb-wifi-n.png);background-position:center;background-repeat:no-repeat;}");
lbNetListText->setStyleSheet("QLabel{color:rgba(47, 179, 232, 1);background-color:transparent;}");
lbWifiListText->setStyleSheet("QLabel{color:rgba(38, 38, 38, 0.75);background-color:transparent;}");
delete iface;
bt->deleteLater();
}
// 当点击wifi标题的时候执行
@ -1372,14 +1358,14 @@ void KylinNM::on_btnWifiList_clicked()
this->is_btnWifiList_clicked = 1;
this->is_btnNetList_clicked = 0;
BackThread *bt = new BackThread();
IFace *iface = bt->execGetIface();
BackThread bt;
IFace iface = bt.execGetIface();
lbLoadDown->show();
lbLoadUp->show();
lbLoadDownImg->show();
lbLoadUpImg->show();
if (iface->wstate != 0) {
if (iface.wstate != 0) {
lbLoadDown->hide();
lbLoadUp->hide();
lbLoadDownImg->hide();
@ -1394,7 +1380,7 @@ void KylinNM::on_btnWifiList_clicked()
btnWireless->show();
//ui->lbBtnWifiBG->show();
//ui->lbBtnWifiBall->show();
if (iface->wstate == 0 || iface->wstate == 1 || iface->wstate == 3) {
if (iface.wstate == 0 || iface.wstate == 1 || iface.wstate == 3) {
//ui->lbBtnWifiBG->setStyleSheet(btnBgOnQss);
//ui->lbBtnWifiBall->move(X_RIGHT_WIFI_BALL, Y_WIFI_BALL);
btnWireless->setSwitchStatus(true);
@ -1404,7 +1390,7 @@ void KylinNM::on_btnWifiList_clicked()
btnWireless->setSwitchStatus(false);
}
if (iface->wstate != 2) {
if (iface.wstate != 2) {
//ui->lbBtnWifiBG->setStyleSheet(btnBgOnQss);
//ui->lbBtnWifiBall->move(X_RIGHT_WIFI_BALL, Y_WIFI_BALL);
btnWireless->setSwitchStatus(true);
@ -1462,9 +1448,6 @@ void KylinNM::on_btnWifiList_clicked()
this->scrollAreaw->show();
this->topWifiListWidget->show();
on_btnWifiList_pressed();
delete iface;
bt->deleteLater();
}
void KylinNM::on_btnNetList_pressed()
@ -1516,16 +1499,20 @@ void KylinNM::getLanListDone(QStringList slist)
// 获取当前连接的lan name
QString actLanName = "--";
activecon *act = kylin_network_get_activecon_info();
activecon *act = NULL;
int count = 0;
kylin_network_get_activecon_info(&act, &count);
int index = 0;
while (act[index].con_name != NULL) {
while (act && index < count) {
if (QString(act[index].type) == "ethernet" || QString(act[index].type) == "802-3-ethernet") {
actLanName = QString(act[index].con_name);
break;
}
index ++;
}
if (act) {
free(act);
}
// 若当前lan name为"--"设置OneConnForm
OneLancForm *ccf = new OneLancForm(topLanListWidget, this, confForm, ksnm);
@ -1686,15 +1673,21 @@ void KylinNM::loadWifiListDone(QStringList slist)
actWifiBssidList.append("--");
}
activecon *act = kylin_network_get_activecon_info();
activecon *act = NULL;
int wifiCount = 0;
kylin_network_get_activecon_info(&act, &wifiCount);
int index = 0;
while (act[index].con_name != NULL) {
while (act && index < wifiCount) {
if (QString(act[index].type) == "wifi" || QString(act[index].type) == "802-11-wireless") {
actWifiName = QString(act[index].con_name);
break;
}
index ++;
}
if (act) {
free(act);
}
// 根据当前连接的wifi 设置OneConnForm
OneConnForm *ccf = new OneConnForm(topWifiListWidget, this, confForm, ksnm);
if (actWifiName == "--" && actWifiBssidList.at(0) == "--") {
@ -2381,8 +2374,8 @@ void KylinNM::activeGetWifiList()
//网络开关处理,打开与关闭网络
void KylinNM::enNetDone()
{
BackThread *bt = new BackThread();
mwBandWidth = bt->execChkLanWidth(lname);
BackThread bt;
mwBandWidth = bt.execChkLanWidth(lname);
ui->lbBtnNetBG->setStyleSheet(btnOnQss);
@ -2470,7 +2463,6 @@ void KylinNM::enWifiDone()
qDebug()<<"debug: already turn on the switch of wifi network";
syslog(LOG_DEBUG, "Already turn on the switch of wifi network");
QTimer::singleShot(200, this, &KylinNM::onConnectChanged);
}
void KylinNM::disWifiDone()
{
@ -2606,16 +2598,13 @@ void KylinNM::onExternalWifiSwitchChange(bool wifiEnabled)
void KylinNM::on_checkWifiListChanged()
{
if (is_stop_check_net_state==0 && this->is_btnWifiList_clicked==1 && this->isVisible()) {
BackThread *loop_bt = new BackThread();
IFace *loop_iface = loop_bt->execGetIface();
BackThread loop_bt;
IFace loop_iface = loop_bt.execGetIface();
if (loop_iface->wstate != 2) {
if (loop_iface.wstate != 2) {
is_update_wifi_list = 1;
this->ksnm->execGetWifiList(); //更新wifi列表
}
delete loop_iface;
loop_bt->deleteLater();
}
}
@ -2766,9 +2755,14 @@ int KylinNM::getConnectStatus()
QString actLanName = "--";
QString actWifiName = "--";
activecon *act = kylin_network_get_activecon_info();
activecon *act = NULL;
int count = 0;
kylin_network_get_activecon_info(&act, &count);
int index = 0;
while (act[index].con_name != NULL) {
if(!act){
return -1;
}
while (act && index < count) {
if (QString(act[index].type) == "ethernet" || QString(act[index].type) == "802-3-ethernet") {
actLanName = QString(act[index].con_name);
}
@ -2777,6 +2771,9 @@ int KylinNM::getConnectStatus()
}
index ++;
}
if (act) {
free(act);
}
//ukui3.0中获取currentActWifiSignalLv的值
if (activeWifiSignalLv > 75) {

View File

@ -37,13 +37,14 @@ KBTitle::~KBTitle()
void KBTitle::initUI()
{
setFixedHeight(KEYBOARD_TITLE_DEFAULT_HEIGHT);
QString strBtnStyle = "QPushButton{ text-align:center; color: rgb(255, 255, 255, 255); border: none; border-radius: 4px; outline: none;}"
"QPushButton:hover{ background-color: rgb(255,255,255,15%); }"
QString strBtnStyle = "QPushButton{ text-align:center; color: rgba(255, 255, 255, 255); border: none; border-radius: 4px; outline: none;}"
"QPushButton:hover{ background-color: rgba(255,255,255,15%); }"
"QPushButton::pressed { background-color: rgba(255,255,255,40%); }"
"QPushButton::checked { background-color: rgba(255,255,255,40%); }";
m_btnFloat = new QPushButton(this);
m_btnFloat->setFlat(true);
m_btnFloat->setFocusPolicy(Qt::NoFocus);
m_btnFloat->setIcon(QIcon(":/images/images/float.svg"));
m_btnFloat->setObjectName("btn_float");
m_btnFloat->setIconSize(KEYBOARD_FIXED_DEFAULT_ICONSIZE);
@ -53,6 +54,7 @@ void KBTitle::initUI()
m_btnClose = new QPushButton(this);
m_btnClose->setFlat(true);
m_btnClose->setFocusPolicy(Qt::NoFocus);
m_btnClose->setIcon(QIcon(":/images/images/close.svg"));
m_btnClose->setIconSize(KEYBOARD_FIXED_DEFAULT_ICONSIZE);
m_btnClose->setObjectName("btn_close");

View File

@ -18,6 +18,7 @@
#include "letterswidget.h"
#include "commondef.h"
#include "plasma-shell-manager.h"
#include "commonfunc.h"
#include <QDebug>
#include <QX11Info>
#include <KWayland/Client/keystate.h>
@ -28,18 +29,20 @@ LettersWidget::LettersWidget(QWidget *parent/* = nullptr*/)
this->setAttribute(Qt::WA_TranslucentBackground);//背景透明
initUI();
if(QString(qgetenv("XDG_SESSION_TYPE")) == "wayland") {
isWayland = true;
}
if(isWayland){
connect(PlasmaShellManager::getInstance(), &PlasmaShellManager::keyStateChanged,
this, &LettersWidget::onCapsChanged);
}else{
settings = new QGSettings("org.ukui.peripherals-keyboard", "", this);
connect(settings, &QGSettings::changed,
this, &LettersWidget::onCapsChanged);
}
//990上XDG_SESSION_TYPE环境变量为wayland,但是走的是x11,这里判断纯wayland环境
// if(QString(qgetenv("XDG_SESSION_TYPE")) == "wayland" && !QX11Info::isPlatformX11()) {
// isWayland = true;
// }
// if(isWayland){
// connect(PlasmaShellManager::getInstance(), &PlasmaShellManager::keyStateChanged,
// this, &LettersWidget::onCapsChanged);
// }else{
// settings = new QGSettings("org.ukui.peripherals-keyboard", "", this);
// connect(settings, &QGSettings::changed,
// this, &LettersWidget::onCapsChanged);
// }
//这里不再判断是否是wayland环境不在调用gsettings获取大写锁定状态而通过读取文件去获取
onCapsChanged();
}
@ -192,7 +195,7 @@ void LettersWidget::initUI()
KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH,
KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
ctrlBtn->setObjectName("btn_ctrl");
ctrlBtn->setText(tr("Ctrl"));
ctrlBtn->setText("Ctrl");
ctrlBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
KEYBOARD_OTHER_COLOR_BORDER_PRESSED,
@ -220,7 +223,7 @@ void LettersWidget::initUI()
KEYBOARD_FIXED_DEFAULT_LETTER_WIDTH,
KEYBOARD_FIXED_DEFAULT_LETTER_HEIGHT);
altBtn->setObjectName("btn_alt");
altBtn->setText(tr("Alt"));
altBtn->setText("Alt");
altBtn->updateStyleSheet(KEYBOARD_OTHER_COLOR_NORMAL,KEYBOARD_OTHER_COLOR_PRESSED,
KEYBOARD_OTHER_COLOR_PRESSED,KEYBOARD_OTHER_COLOR_BORDER_NORMAL,
KEYBOARD_OTHER_COLOR_BORDER_PRESSED,
@ -331,12 +334,12 @@ void LettersWidget::onBtnClicked(QChar charId)
void LettersWidget::onCapsChanged()
{
if(isWayland){
capsState = PlasmaShellManager::getInstance()->getKeyState(KWayland::Client::Keystate::Key::CapsLock);
}else{
capsState = settings->get("capslock-state").toBool();
}
// if(isWayland){
// capsState = PlasmaShellManager::getInstance()->getKeyState(KWayland::Client::Keystate::Key::CapsLock);
// }else{
// capsState = settings->get("capslock-state").toBool();
// }
capsState = checkCapsLockState();
isShift = capsState;
for (int i = 97; i < 123; i++) { //大小写切换
QString objName = QString("btn_%1").arg(QString::number(i));

View File

@ -21,6 +21,7 @@
#include <QPainter>
#include <QX11Info>
#include <QMouseEvent>
#include <QGuiApplication>
#include "commondef.h"
#include <QDebug>
#include <QVBoxLayout>
@ -57,6 +58,7 @@ VirtualKeyboardWidget::VirtualKeyboardWidget(QWidget *parent)
connect(this, SIGNAL(keyPressed(FuncKey::FUNCKEY)),
vKeyboard, SLOT(onKeyPressed(FuncKey::FUNCKEY)));
initUI();
qApp->installNativeEventFilter(this);
initConnections();
}
@ -65,6 +67,24 @@ VirtualKeyboardWidget::~VirtualKeyboardWidget()
}
bool VirtualKeyboardWidget::nativeEventFilter(const QByteArray &eventType, void *message, long *result)
{
if (qstrcmp(eventType, "xcb_generic_event_t") != 0) {
return false;
}
xcb_generic_event_t *event = reinterpret_cast<xcb_generic_event_t*>(message);
const uint8_t responseType = event->response_type & ~0x80;
if (responseType == XCB_KEY_PRESS) {
xcb_key_press_event_t *xc = reinterpret_cast<xcb_key_press_event_t*>(event);
} else if (responseType == XCB_KEY_RELEASE) {
xcb_key_release_event_t *xc = reinterpret_cast<xcb_key_release_event_t*>(event);
if (xc->detail == 66 /*&& QString(qgetenv("XDG_SESSION_TYPE")) == "wayland"*/) {
m_lettersWidget->onCapsChanged();
}
}
return false;
}
void VirtualKeyboardWidget::initUI()
{
QVBoxLayout *layoutMain = new QVBoxLayout(this);

View File

@ -22,6 +22,7 @@
#include <QStackedWidget>
#include <QList>
#include <QMap>
#include <QAbstractNativeEventFilter>
#include "fakekeyboard.h"
#include "plasma-shell-manager.h"
@ -31,7 +32,7 @@ class LettersWidget;
class NumbersWidget;
class CharsWidget;
class CharsMoreWidget;
class VirtualKeyboardWidget : public QWidget
class VirtualKeyboardWidget : public QWidget, public QAbstractNativeEventFilter
{
Q_OBJECT
public:
@ -44,6 +45,8 @@ public:
VirtualKeyboardWidget(QWidget *parent = nullptr);
virtual ~VirtualKeyboardWidget();
bool getFloatStatus();
void adjustGeometry();
virtual bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) override;
public Q_SLOTS:
void onNormalBtnClicked(QChar c);
@ -63,7 +66,6 @@ protected:
private:
void initUI();
void initConnections();
void adjustGeometry();
void onMouseEvents(int type);
void clearModifier();

View File

@ -32,7 +32,6 @@
<summary>show rest time on ukui screensaver</summary>
<description>Set this to TRUE to show rest time on ukui screensaver.</description>
</key>
<key name="mytext" type="s">
<default>""</default>
<summary>set user text on screensaver.</summary>
@ -53,6 +52,31 @@
<summary>Time to update background on ukui-screensavaer-default</summary>
<description>The number of seconds to change screensaver background.</description>
</key>
<key name="video-path" type="s">
<default>"/usr/share/backgrounds/video/dynamicsaver.mp4"</default>
<summary>The path to the dynamic screensaver video</summary>
<description>The path to the dynamic screensaver video.</description>
</key>
<key name="video-size" type="i">
<default>100</default>
<summary>The maximum size of the dynamic screensaver video</summary>
<description>The maximum size of the dynamic screensaver video.</description>
</key>
<key name="video-format" type="s">
<default>"mp4,webm"</default>
<summary>The format of the dynamic screensaver video</summary>
<description>The format of the dynamic screensaver video.</description>
</key>
<key name="video-width" type="i">
<default>1920</default>
<summary>The maximum width of a dynamic screensaver video</summary>
<description>The maximum width of a dynamic screensaver video</description>
</key>
<key name="video-height" type="i">
<default>1080</default>
<summary>The maximum height of a dynamic screensaver video</summary>
<description>The maximum height of a dynamic screensaver video</description>
</key>
</schema>
<schema id="org.ukui.screensaver" path="/org/ukui/screensaver/">
<key name="idle-activation-enabled" type="b">

View File

@ -4,119 +4,119 @@
<context>
<name>AuthDialog</name>
<message>
<location filename="../src/authdialog.cpp" line="912"/>
<location filename="../src/authdialog.cpp" line="985"/>
<source>Authentication failure, Please try again</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="326"/>
<location filename="../src/authdialog.cpp" line="327"/>
<location filename="../src/authdialog.cpp" line="396"/>
<location filename="../src/authdialog.cpp" line="397"/>
<location filename="../src/authdialog.cpp" line="339"/>
<location filename="../src/authdialog.cpp" line="340"/>
<location filename="../src/authdialog.cpp" line="409"/>
<location filename="../src/authdialog.cpp" line="410"/>
<source>Please try again in %1 minutes.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="223"/>
<location filename="../src/authdialog.cpp" line="229"/>
<source>Enter the ukey password</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="240"/>
<location filename="../src/authdialog.cpp" line="246"/>
<source>Insert the ukey into the USB port</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="336"/>
<location filename="../src/authdialog.cpp" line="337"/>
<location filename="../src/authdialog.cpp" line="405"/>
<location filename="../src/authdialog.cpp" line="406"/>
<location filename="../src/authdialog.cpp" line="349"/>
<location filename="../src/authdialog.cpp" line="350"/>
<location filename="../src/authdialog.cpp" line="418"/>
<location filename="../src/authdialog.cpp" line="419"/>
<source>Please try again in %1 seconds.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="346"/>
<location filename="../src/authdialog.cpp" line="347"/>
<location filename="../src/authdialog.cpp" line="414"/>
<location filename="../src/authdialog.cpp" line="415"/>
<location filename="../src/authdialog.cpp" line="359"/>
<location filename="../src/authdialog.cpp" line="360"/>
<location filename="../src/authdialog.cpp" line="427"/>
<location filename="../src/authdialog.cpp" line="428"/>
<source>Account locked permanently.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="566"/>
<location filename="../src/authdialog.cpp" line="620"/>
<source>Verify face recognition or enter password to unlock</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="571"/>
<location filename="../src/authdialog.cpp" line="625"/>
<source>Press fingerprint or enter password to unlock</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="576"/>
<location filename="../src/authdialog.cpp" line="630"/>
<source>Verify voiceprint or enter password to unlock</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="581"/>
<location filename="../src/authdialog.cpp" line="635"/>
<source>Verify finger vein or enter password to unlock</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="586"/>
<location filename="../src/authdialog.cpp" line="640"/>
<source>Verify iris or enter password to unlock</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="591"/>
<location filename="../src/authdialog.cpp" line="645"/>
<source>Use the bound wechat scanning code or enter the password to unlock</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="649"/>
<location filename="../src/authdialog.cpp" line="650"/>
<location filename="../src/authdialog.cpp" line="714"/>
<location filename="../src/authdialog.cpp" line="715"/>
<source>Password cannot be empty</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="871"/>
<source>Password </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="873"/>
<source>Input Password</source>
<location filename="../src/authdialog.cpp" line="938"/>
<source>Password: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="940"/>
<source>Input Password</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="1025"/>
<source>Login</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="957"/>
<location filename="../src/authdialog.cpp" line="1042"/>
<source>Retry</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="1260"/>
<location filename="../src/authdialog.cpp" line="1356"/>
<source>Failed to verify %1, please enter password to unlock</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="1264"/>
<location filename="../src/authdialog.cpp" line="1266"/>
<location filename="../src/authdialog.cpp" line="1360"/>
<location filename="../src/authdialog.cpp" line="1362"/>
<source>Unable to verify %1, please enter password to unlock</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="1279"/>
<location filename="../src/authdialog.cpp" line="1283"/>
<location filename="../src/authdialog.cpp" line="1375"/>
<location filename="../src/authdialog.cpp" line="1379"/>
<source>Failed to verify %1, you still have %2 verification opportunities</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="1296"/>
<location filename="../src/authdialog.cpp" line="1392"/>
<source>Abnormal network</source>
<translation type="unfinished"></translation>
</message>
@ -124,22 +124,22 @@
<context>
<name>BatteryWidget</name>
<message>
<location filename="../src/batterywidget.cpp" line="163"/>
<location filename="../src/batterywidget.cpp" line="180"/>
<source>Charging...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/batterywidget.cpp" line="165"/>
<location filename="../src/batterywidget.cpp" line="182"/>
<source>fully charged</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/batterywidget.cpp" line="169"/>
<location filename="../src/batterywidget.cpp" line="186"/>
<source>PowerMode</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/batterywidget.cpp" line="172"/>
<location filename="../src/batterywidget.cpp" line="189"/>
<source>BatteryMode</source>
<translation type="unfinished"></translation>
</message>
@ -147,12 +147,12 @@
<context>
<name>BiometricAuthWidget</name>
<message>
<location filename="../BiometricAuth/biometricauthwidget.cpp" line="119"/>
<location filename="../BiometricAuth/biometricauthwidget.cpp" line="118"/>
<source>Current device: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../BiometricAuth/biometricauthwidget.cpp" line="185"/>
<location filename="../BiometricAuth/biometricauthwidget.cpp" line="184"/>
<source>Identify failed, Please retry.</source>
<translation type="unfinished"></translation>
</message>
@ -160,22 +160,22 @@
<context>
<name>BiometricDevicesWidget</name>
<message>
<location filename="../BiometricAuth/biometricdeviceswidget.cpp" line="48"/>
<location filename="../BiometricAuth/biometricdeviceswidget.cpp" line="47"/>
<source>Please select the biometric device</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../BiometricAuth/biometricdeviceswidget.cpp" line="53"/>
<location filename="../BiometricAuth/biometricdeviceswidget.cpp" line="52"/>
<source>Device type:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../BiometricAuth/biometricdeviceswidget.cpp" line="69"/>
<location filename="../BiometricAuth/biometricdeviceswidget.cpp" line="68"/>
<source>Device name:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../BiometricAuth/biometricdeviceswidget.cpp" line="79"/>
<location filename="../BiometricAuth/biometricdeviceswidget.cpp" line="78"/>
<source>OK</source>
<translation type="unfinished"></translation>
</message>
@ -183,7 +183,7 @@
<context>
<name>CharsMoreWidget</name>
<message>
<location filename="../VirtualKeyboard/src/charsmorewidget.cpp" line="166"/>
<location filename="../VirtualKeyboard/src/charsmorewidget.cpp" line="183"/>
<source>&amp;&amp;?!</source>
<translation type="unfinished"></translation>
</message>
@ -191,17 +191,17 @@
<context>
<name>CharsWidget</name>
<message>
<location filename="../VirtualKeyboard/src/charswidget.cpp" line="97"/>
<location filename="../VirtualKeyboard/src/charswidget.cpp" line="114"/>
<source>More</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../VirtualKeyboard/src/charswidget.cpp" line="111"/>
<location filename="../VirtualKeyboard/src/charswidget.cpp" line="128"/>
<source>ABC</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../VirtualKeyboard/src/charswidget.cpp" line="124"/>
<location filename="../VirtualKeyboard/src/charswidget.cpp" line="141"/>
<source>123</source>
<translation type="unfinished"></translation>
</message>
@ -314,37 +314,37 @@
<context>
<name>DeviceType</name>
<message>
<location filename="../BiometricAuth/biometricdeviceinfo.cpp" line="61"/>
<location filename="../BiometricAuth/biometricdeviceinfo.cpp" line="60"/>
<source>FingerPrint</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../BiometricAuth/biometricdeviceinfo.cpp" line="63"/>
<location filename="../BiometricAuth/biometricdeviceinfo.cpp" line="62"/>
<source>FingerVein</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../BiometricAuth/biometricdeviceinfo.cpp" line="65"/>
<location filename="../BiometricAuth/biometricdeviceinfo.cpp" line="64"/>
<source>Iris</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../BiometricAuth/biometricdeviceinfo.cpp" line="67"/>
<location filename="../BiometricAuth/biometricdeviceinfo.cpp" line="66"/>
<source>Face</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../BiometricAuth/biometricdeviceinfo.cpp" line="69"/>
<location filename="../BiometricAuth/biometricdeviceinfo.cpp" line="68"/>
<source>VoicePrint</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../BiometricAuth/biometricdeviceinfo.cpp" line="71"/>
<source>ukey</source>
<location filename="../BiometricAuth/biometricdeviceinfo.cpp" line="70"/>
<source>Ukey</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../BiometricAuth/biometricdeviceinfo.cpp" line="73"/>
<location filename="../BiometricAuth/biometricdeviceinfo.cpp" line="72"/>
<source>QRCode</source>
<translation type="unfinished"></translation>
</message>
@ -1608,36 +1608,44 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>IconEdit</name>
<message>
<location filename="../src/iconedit.cpp" line="114"/>
<source>OK</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>InputInfos</name>
<message>
<location filename="../src/verificationwidget.cpp" line="141"/>
<location filename="../src/verificationwidget.cpp" line="318"/>
<location filename="../src/verificationwidget.cpp" line="158"/>
<location filename="../src/verificationwidget.cpp" line="335"/>
<source>Get code</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/verificationwidget.cpp" line="288"/>
<location filename="../src/verificationwidget.cpp" line="305"/>
<source>Recapture(60s)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/verificationwidget.cpp" line="312"/>
<location filename="../src/verificationwidget.cpp" line="329"/>
<source>Recapture(%1s)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/verificationwidget.cpp" line="338"/>
<location filename="../src/verificationwidget.cpp" line="355"/>
<source>Service exception...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/verificationwidget.cpp" line="341"/>
<location filename="../src/verificationwidget.cpp" line="358"/>
<source>Invaild parameters...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/verificationwidget.cpp" line="344"/>
<location filename="../src/verificationwidget.cpp" line="361"/>
<source>Unknown fault:%1</source>
<translation type="unfinished"></translation>
</message>
@ -1688,90 +1696,90 @@
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="456"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="611"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="610"/>
<source>Advanced</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="610"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="609"/>
<source>Show KylinNM</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="1289"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1279"/>
<source>No wireless card detected</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="1326"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1316"/>
<source>Activated LAN</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="1393"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1379"/>
<source>Activated WLAN</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="1437"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1535"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1701"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2426"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2518"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1423"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1522"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1694"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2419"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2510"/>
<source>Not connected</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="1440"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1537"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1607"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1608"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1704"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1828"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1995"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2428"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2520"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1426"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1524"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1594"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1595"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1697"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1821"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1988"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2421"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2512"/>
<source>Disconnected</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="1588"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1798"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1575"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1791"/>
<source>NetOn,</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="1633"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1620"/>
<source>No Other Wired Network Scheme</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="1849"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1842"/>
<source>No Other Wireless Network Scheme</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="2335"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2328"/>
<source>Wired net is disconnected</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="2706"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2695"/>
<source>Conn Ethernet Success</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="2718"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2707"/>
<source>Conn Ethernet Fail</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="2743"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2732"/>
<source>Conn Wifi Success</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="2752"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2741"/>
<source>Confirm your Wi-Fi password or usable of wireless card</source>
<translation type="unfinished"></translation>
</message>
@ -1779,25 +1787,15 @@
<context>
<name>LettersWidget</name>
<message>
<location filename="../VirtualKeyboard/src/letterswidget.cpp" line="138"/>
<location filename="../VirtualKeyboard/src/letterswidget.cpp" line="170"/>
<source>&amp;&amp;?!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../VirtualKeyboard/src/letterswidget.cpp" line="152"/>
<location filename="../VirtualKeyboard/src/letterswidget.cpp" line="184"/>
<source>123</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../VirtualKeyboard/src/letterswidget.cpp" line="166"/>
<source>Ctrl</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../VirtualKeyboard/src/letterswidget.cpp" line="194"/>
<source>Alt</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LockWidget</name>
@ -1817,17 +1815,37 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/lockwidget.cpp" line="1135"/>
<location filename="../src/lockwidget.cpp" line="762"/>
<source>PowerInfo</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/lockwidget.cpp" line="785"/>
<source>Power</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/lockwidget.cpp" line="814"/>
<source>VirtualKeyboard</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/lockwidget.cpp" line="827"/>
<source>SwitchUser</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/lockwidget.cpp" line="1109"/>
<source>Multiple users are logged in at the same time.Are you sure you want to reboot this system?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/lockwidget.cpp" line="1445"/>
<location filename="../src/lockwidget.cpp" line="1410"/>
<source>LAN</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/lockwidget.cpp" line="1447"/>
<location filename="../src/lockwidget.cpp" line="1412"/>
<source>WLAN</source>
<translation type="unfinished"></translation>
</message>
@ -1835,17 +1853,22 @@
<context>
<name>LoginOptionsWidget</name>
<message>
<location filename="../src/loginoptionswidget.cpp" line="73"/>
<location filename="../src/loginoptionswidget.cpp" line="96"/>
<source>Login Options</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/loginoptionswidget.cpp" line="270"/>
<location filename="../src/loginoptionswidget.cpp" line="324"/>
<source>Password</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/loginoptionswidget.cpp" line="664"/>
<location filename="../src/loginoptionswidget.cpp" line="350"/>
<source>Other</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/loginoptionswidget.cpp" line="762"/>
<source>Identify device removed!</source>
<translation type="unfinished"></translation>
</message>
@ -1853,9 +1876,9 @@
<context>
<name>MyLineEdit</name>
<message>
<location filename="../src/verificationwidget.cpp" line="599"/>
<location filename="../src/verificationwidget.cpp" line="605"/>
<location filename="../src/verificationwidget.cpp" line="616"/>
<location filename="../src/verificationwidget.cpp" line="622"/>
<location filename="../src/verificationwidget.cpp" line="639"/>
<source>Verification code</source>
<translation type="unfinished"></translation>
</message>
@ -1863,12 +1886,12 @@
<context>
<name>NumbersWidget</name>
<message>
<location filename="../VirtualKeyboard/src/numberswidget.cpp" line="143"/>
<location filename="../VirtualKeyboard/src/numberswidget.cpp" line="160"/>
<source>&amp;&amp;?!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../VirtualKeyboard/src/numberswidget.cpp" line="157"/>
<location filename="../VirtualKeyboard/src/numberswidget.cpp" line="174"/>
<source>Return</source>
<translation type="unfinished"></translation>
</message>
@ -1983,7 +2006,7 @@
<name>PhoneAuthWidget</name>
<message>
<location filename="../src/permissioncheck.cpp" line="236"/>
<location filename="../src/verificationwidget.cpp" line="375"/>
<location filename="../src/verificationwidget.cpp" line="392"/>
<source>Verification by phoneNum</source>
<translation type="unfinished"></translation>
</message>
@ -1994,43 +2017,43 @@
</message>
<message>
<location filename="../src/permissioncheck.cpp" line="259"/>
<location filename="../src/verificationwidget.cpp" line="399"/>
<location filename="../src/verificationwidget.cpp" line="416"/>
<source>commit</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/verificationwidget.cpp" line="381"/>
<location filename="../src/verificationwidget.cpp" line="398"/>
<source> Use SMS to verification </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/verificationwidget.cpp" line="484"/>
<location filename="../src/verificationwidget.cpp" line="524"/>
<location filename="../src/verificationwidget.cpp" line="501"/>
<location filename="../src/verificationwidget.cpp" line="541"/>
<source>Network not connected~</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/verificationwidget.cpp" line="487"/>
<location filename="../src/verificationwidget.cpp" line="504"/>
<source>Verification Code invalid!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/verificationwidget.cpp" line="490"/>
<location filename="../src/verificationwidget.cpp" line="507"/>
<source>Verification Code incorrect.Please retry!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/verificationwidget.cpp" line="493"/>
<location filename="../src/verificationwidget.cpp" line="510"/>
<source>Failed time over limit!Retry after 1 hour!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/verificationwidget.cpp" line="497"/>
<location filename="../src/verificationwidget.cpp" line="514"/>
<source>verifaction failed!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/verificationwidget.cpp" line="530"/>
<location filename="../src/verificationwidget.cpp" line="547"/>
<source>Network unavailable~</source>
<translation type="unfinished"></translation>
</message>
@ -2038,38 +2061,58 @@
<context>
<name>PowerManager</name>
<message>
<location filename="../src/powermanager.cpp" line="316"/>
<location filename="../src/powermanager.cpp" line="317"/>
<source>Log Out</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="299"/>
<location filename="../src/powermanager.cpp" line="300"/>
<source>lock</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="334"/>
<location filename="../src/powermanager.cpp" line="673"/>
<location filename="../src/powermanager.cpp" line="335"/>
<location filename="../src/powermanager.cpp" line="676"/>
<source>Restart</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="354"/>
<location filename="../src/powermanager.cpp" line="355"/>
<source>Power Off</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="694"/>
<location filename="../src/powermanager.cpp" line="674"/>
<source>Close all apps, turn off your computer, and then turn your computer back on</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="697"/>
<source>Close all apps, and then shut down your computer</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="700"/>
<source>Shut Down</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="722"/>
<location filename="../src/powermanager.cpp" line="729"/>
<source>Turn off your computer, but the app stays open. When the computer is turned on, it can be restored to the state you left</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="731"/>
<source>Hibernate</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="751"/>
<location filename="../src/powermanager.cpp" line="760"/>
<source>The computer stays on, but consumes less power. The app stays open and can quickly wake up and revert to where you left off</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="763"/>
<source>Suspend</source>
<translation type="unfinished"></translation>
</message>
@ -2099,17 +2142,17 @@
<context>
<name>Screensaver</name>
<message>
<location filename="../screensaver/screensaver.cpp" line="145"/>
<location filename="../screensaver/screensaver.cpp" line="167"/>
<source>Picture does not exist</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../screensaver/screensaver.cpp" line="1205"/>
<location filename="../screensaver/screensaver.cpp" line="170"/>
<source>View</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../screensaver/screensaver.cpp" line="1374"/>
<location filename="../screensaver/screensaver.cpp" line="1461"/>
<source>You have new notification</source>
<translation type="unfinished"></translation>
</message>
@ -2135,32 +2178,32 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/surewindow.ui" line="157"/>
<location filename="../src/surewindow.ui" line="160"/>
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/surewindow.ui" line="176"/>
<location filename="../src/surewindow.ui" line="179"/>
<source>Confirm</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/surewindow.cpp" line="47"/>
<location filename="../src/surewindow.cpp" line="67"/>
<source>The following program is running to prevent the system from reboot!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/surewindow.cpp" line="50"/>
<location filename="../src/surewindow.cpp" line="70"/>
<source>The following program is running to prevent the system from shutting down!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/surewindow.cpp" line="53"/>
<location filename="../src/surewindow.cpp" line="73"/>
<source>The following program is running to prevent the system from suspend!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/surewindow.cpp" line="56"/>
<location filename="../src/surewindow.cpp" line="76"/>
<source>The following program is running to prevent the system from hibernate!</source>
<translation type="unfinished"></translation>
</message>
@ -2228,7 +2271,7 @@
<context>
<name>VerificationWidget</name>
<message>
<location filename="../src/verificationwidget.cpp" line="55"/>
<location filename="../src/verificationwidget.cpp" line="72"/>
<source>Please scan by bound WeChat</source>
<translation type="unfinished"></translation>
</message>
@ -2236,7 +2279,7 @@
<context>
<name>VerticalVerificationWidget</name>
<message>
<location filename="../src/verticalVerificationwidget.cpp" line="52"/>
<location filename="../src/verticalVerificationwidget.cpp" line="69"/>
<source>Please scan by bound WeChat</source>
<translation type="unfinished"></translation>
</message>
@ -2300,7 +2343,7 @@
<context>
<name>delay</name>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="179"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="209"/>
<source>how long to show lock</source>
<translation type="unfinished"></translation>
</message>
@ -2308,7 +2351,7 @@
<context>
<name>has-lock</name>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="182"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="212"/>
<source>if show lock</source>
<translation type="unfinished"></translation>
</message>
@ -2316,22 +2359,22 @@
<context>
<name>main</name>
<message>
<location filename="../screensaver/main.cpp" line="65"/>
<location filename="../screensaver/main.cpp" line="66"/>
<source>Screensaver for ukui-screensaver</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../screensaver/main.cpp" line="69"/>
<location filename="../screensaver/main.cpp" line="70"/>
<source>show on root window</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../screensaver/main.cpp" line="71"/>
<location filename="../screensaver/main.cpp" line="72"/>
<source>show on window.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../screensaver/main.cpp" line="72"/>
<location filename="../screensaver/main.cpp" line="73"/>
<source>window id</source>
<translation type="unfinished"></translation>
</message>
@ -2342,8 +2385,8 @@
</message>
<message>
<location filename="../src/ukui-screensaver-command.cpp" line="48"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="166"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="168"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="196"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="198"/>
<source>lock the screen immediately</source>
<translation type="unfinished"></translation>
</message>
@ -2368,33 +2411,33 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="160"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="190"/>
<source>Dialog for the ukui ScreenSaver.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="170"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="200"/>
<source>activated by session idle signal</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="172"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="176"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="202"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="206"/>
<source>lock the screen and show screensaver immediately</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="174"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="204"/>
<source>show screensaver immediately</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="178"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="208"/>
<source>show blank screensaver immediately and delay time to show lock</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="181"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="211"/>
<source>show blank screensaver immediately and if lock</source>
<translation type="unfinished"></translation>
</message>

View File

@ -21,7 +21,7 @@
</message>
<message>
<source>Password: </source>
<translation type="vanished"></translation>
<translation></translation>
</message>
<message>
<source>Biometric Authentication</source>
@ -75,10 +75,6 @@
<source>Password cannot be empty</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Password </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Login</source>
<translation type="unfinished"></translation>
@ -297,7 +293,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<source>ukey</source>
<source>Ukey</source>
<translation type="unfinished"></translation>
</message>
</context>
@ -1308,6 +1304,13 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>IconEdit</name>
<message>
<source>OK</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>InputInfos</name>
<message>
@ -1440,14 +1443,6 @@
<source>123</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Ctrl</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Alt</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LockWidget</name>
@ -1469,11 +1464,11 @@
</message>
<message>
<source>SwitchUser</source>
<translation type="vanished"></translation>
<translation></translation>
</message>
<message>
<source>Multiple users are logged in at the same time.Are you sure you want to reboot this system?</source>
<translation type="unfinished"></translation>
<translation> </translation>
</message>
<message>
<source>LAN</source>
@ -1483,6 +1478,18 @@
<source>WLAN</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>PowerInfo</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Power</source>
<translation></translation>
</message>
<message>
<source>VirtualKeyboard</source>
<translation></translation>
</message>
</context>
<context>
<name>LoginOptionsWidget</name>
@ -1498,6 +1505,10 @@
<source>Password</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Other</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MyLineEdit</name>
@ -1684,6 +1695,22 @@
<source>Hibernate</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Close all apps, turn off your computer, and then turn your computer back on</source>
<translation> </translation>
</message>
<message>
<source>Close all apps, and then shut down your computer</source>
<translation></translation>
</message>
<message>
<source>Turn off your computer, but the app stays open. When the computer is turned on, it can be restored to the state you left</source>
<translation> </translation>
</message>
<message>
<source>The computer stays on, but consumes less power. The app stays open and can quickly wake up and revert to where you left off</source>
<translation> </translation>
</message>
</context>
<context>
<name>QObject</name>

View File

@ -59,10 +59,6 @@
<source>Login</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Password </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Verify face recognition or enter password to unlock</source>
<translation type="unfinished"></translation>
@ -115,6 +111,10 @@
<source>Insert the ukey into the USB port</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Password: </source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>BatteryWidget</name>
@ -362,7 +362,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<source>ukey</source>
<source>Ukey</source>
<translation type="unfinished"></translation>
</message>
</context>
@ -1373,6 +1373,13 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>IconEdit</name>
<message>
<source>OK</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>InputInfos</name>
<message>
@ -1512,14 +1519,6 @@
<source>123</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Ctrl</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Alt</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LockWidget</name>
@ -1541,7 +1540,7 @@
</message>
<message>
<source>SwitchUser</source>
<translation type="vanished">Cambiar de usuario</translation>
<translation>Cambiar de usuario</translation>
</message>
<message>
<source>Multiple users are logged in at the same time.Are you sure you want to reboot this system?</source>
@ -1555,6 +1554,18 @@
<source>WLAN</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>PowerInfo</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Power</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>VirtualKeyboard</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LoginOptionsWidget</name>
@ -1570,6 +1581,10 @@
<source>Identify device removed!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Other</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MyLineEdit</name>
@ -1748,6 +1763,22 @@
<source>Restart</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Close all apps, turn off your computer, and then turn your computer back on</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Close all apps, and then shut down your computer</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Turn off your computer, but the app stays open. When the computer is turned on, it can be restored to the state you left</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>The computer stays on, but consumes less power. The app stays open and can quickly wake up and revert to where you left off</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QObject</name>

View File

@ -59,10 +59,6 @@
<source>Login</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Password </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Verify face recognition or enter password to unlock</source>
<translation type="unfinished"></translation>
@ -115,6 +111,10 @@
<source>Insert the ukey into the USB port</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Password: </source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>BatteryWidget</name>
@ -362,7 +362,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<source>ukey</source>
<source>Ukey</source>
<translation type="unfinished"></translation>
</message>
</context>
@ -1373,6 +1373,13 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>IconEdit</name>
<message>
<source>OK</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>InputInfos</name>
<message>
@ -1512,14 +1519,6 @@
<source>123</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Ctrl</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Alt</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LockWidget</name>
@ -1541,7 +1540,7 @@
</message>
<message>
<source>SwitchUser</source>
<translation type="vanished">Changer d&apos;utilisateur</translation>
<translation>Changer d&apos;utilisateur</translation>
</message>
<message>
<source>Multiple users are logged in at the same time.Are you sure you want to reboot this system?</source>
@ -1555,6 +1554,18 @@
<source>WLAN</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>PowerInfo</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Power</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>VirtualKeyboard</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LoginOptionsWidget</name>
@ -1570,6 +1581,10 @@
<source>Identify device removed!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Other</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MyLineEdit</name>
@ -1748,6 +1763,22 @@
<source>Restart</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Close all apps, turn off your computer, and then turn your computer back on</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Close all apps, and then shut down your computer</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Turn off your computer, but the app stays open. When the computer is turned on, it can be restored to the state you left</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>The computer stays on, but consumes less power. The app stays open and can quickly wake up and revert to where you left off</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QObject</name>

2937
i18n_ts/mn.ts Normal file

File diff suppressed because it is too large Load Diff

View File

@ -59,10 +59,6 @@
<source>Login</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Password </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Verify face recognition or enter password to unlock</source>
<translation type="unfinished"></translation>
@ -115,6 +111,10 @@
<source>Insert the ukey into the USB port</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Password: </source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>BatteryWidget</name>
@ -362,7 +362,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<source>ukey</source>
<source>Ukey</source>
<translation type="unfinished"></translation>
</message>
</context>
@ -1373,6 +1373,13 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>IconEdit</name>
<message>
<source>OK</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>InputInfos</name>
<message>
@ -1512,14 +1519,6 @@
<source>123</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Ctrl</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Alt</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LockWidget</name>
@ -1541,7 +1540,7 @@
</message>
<message>
<source>SwitchUser</source>
<translation type="vanished">Mudar de utilizador</translation>
<translation>Mudar de utilizador</translation>
</message>
<message>
<source>Multiple users are logged in at the same time.Are you sure you want to reboot this system?</source>
@ -1555,6 +1554,18 @@
<source>WLAN</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>PowerInfo</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Power</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>VirtualKeyboard</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LoginOptionsWidget</name>
@ -1570,6 +1581,10 @@
<source>Identify device removed!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Other</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MyLineEdit</name>
@ -1748,6 +1763,22 @@
<source>Restart</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Close all apps, turn off your computer, and then turn your computer back on</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Close all apps, and then shut down your computer</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Turn off your computer, but the app stays open. When the computer is turned on, it can be restored to the state you left</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>The computer stays on, but consumes less power. The app stays open and can quickly wake up and revert to where you left off</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QObject</name>

View File

@ -59,10 +59,6 @@
<source>Login</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Password </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Verify face recognition or enter password to unlock</source>
<translation type="unfinished"></translation>
@ -115,6 +111,10 @@
<source>Insert the ukey into the USB port</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Password: </source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>BatteryWidget</name>
@ -362,7 +362,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<source>ukey</source>
<source>Ukey</source>
<translation type="unfinished"></translation>
</message>
</context>
@ -1373,6 +1373,13 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>IconEdit</name>
<message>
<source>OK</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>InputInfos</name>
<message>
@ -1512,14 +1519,6 @@
<source>123</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Ctrl</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Alt</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LockWidget</name>
@ -1541,7 +1540,7 @@
</message>
<message>
<source>SwitchUser</source>
<translation type="vanished">Сменить пользователя</translation>
<translation>Сменить пользователя</translation>
</message>
<message>
<source>Multiple users are logged in at the same time.Are you sure you want to reboot this system?</source>
@ -1555,6 +1554,18 @@
<source>WLAN</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>PowerInfo</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Power</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>VirtualKeyboard</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LoginOptionsWidget</name>
@ -1570,6 +1581,10 @@
<source>Identify device removed!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Other</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MyLineEdit</name>
@ -1748,6 +1763,22 @@
<source>Restart</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Close all apps, turn off your computer, and then turn your computer back on</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Close all apps, and then shut down your computer</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Turn off your computer, but the app stays open. When the computer is turned on, it can be restored to the state you left</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>The computer stays on, but consumes less power. The app stays open and can quickly wake up and revert to where you left off</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QObject</name>

View File

@ -16,7 +16,7 @@
<translation type="obsolete">Parola</translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="957"/>
<location filename="../src/authdialog.cpp" line="1042"/>
<source>Retry</source>
<translation type="unfinished">Yeniden Dene</translation>
</message>
@ -25,8 +25,9 @@
<translation type="obsolete">Kilidi </translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="938"/>
<source>Password: </source>
<translation type="obsolete">Parola</translation>
<translation type="unfinished">Parola</translation>
</message>
<message>
<source>Account locked %1 minutes due to %2 fail attempts</source>
@ -41,114 +42,109 @@
<translation type="vanished">Kimlik doğrulama hatası, hala %1 kalan denemen var</translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="912"/>
<location filename="../src/authdialog.cpp" line="985"/>
<source>Authentication failure, Please try again</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="326"/>
<location filename="../src/authdialog.cpp" line="327"/>
<location filename="../src/authdialog.cpp" line="396"/>
<location filename="../src/authdialog.cpp" line="397"/>
<location filename="../src/authdialog.cpp" line="339"/>
<location filename="../src/authdialog.cpp" line="340"/>
<location filename="../src/authdialog.cpp" line="409"/>
<location filename="../src/authdialog.cpp" line="410"/>
<source>Please try again in %1 minutes.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="223"/>
<location filename="../src/authdialog.cpp" line="229"/>
<source>Enter the ukey password</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="240"/>
<location filename="../src/authdialog.cpp" line="246"/>
<source>Insert the ukey into the USB port</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="336"/>
<location filename="../src/authdialog.cpp" line="337"/>
<location filename="../src/authdialog.cpp" line="405"/>
<location filename="../src/authdialog.cpp" line="406"/>
<location filename="../src/authdialog.cpp" line="349"/>
<location filename="../src/authdialog.cpp" line="350"/>
<location filename="../src/authdialog.cpp" line="418"/>
<location filename="../src/authdialog.cpp" line="419"/>
<source>Please try again in %1 seconds.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="346"/>
<location filename="../src/authdialog.cpp" line="347"/>
<location filename="../src/authdialog.cpp" line="414"/>
<location filename="../src/authdialog.cpp" line="415"/>
<location filename="../src/authdialog.cpp" line="359"/>
<location filename="../src/authdialog.cpp" line="360"/>
<location filename="../src/authdialog.cpp" line="427"/>
<location filename="../src/authdialog.cpp" line="428"/>
<source>Account locked permanently.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="566"/>
<location filename="../src/authdialog.cpp" line="620"/>
<source>Verify face recognition or enter password to unlock</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="571"/>
<location filename="../src/authdialog.cpp" line="625"/>
<source>Press fingerprint or enter password to unlock</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="576"/>
<location filename="../src/authdialog.cpp" line="630"/>
<source>Verify voiceprint or enter password to unlock</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="581"/>
<location filename="../src/authdialog.cpp" line="635"/>
<source>Verify finger vein or enter password to unlock</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="586"/>
<location filename="../src/authdialog.cpp" line="640"/>
<source>Verify iris or enter password to unlock</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="591"/>
<location filename="../src/authdialog.cpp" line="645"/>
<source>Use the bound wechat scanning code or enter the password to unlock</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="649"/>
<location filename="../src/authdialog.cpp" line="650"/>
<location filename="../src/authdialog.cpp" line="714"/>
<location filename="../src/authdialog.cpp" line="715"/>
<source>Password cannot be empty</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="871"/>
<source>Password </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="873"/>
<location filename="../src/authdialog.cpp" line="940"/>
<source>Input Password</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="940"/>
<location filename="../src/authdialog.cpp" line="1025"/>
<source>Login</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="1260"/>
<location filename="../src/authdialog.cpp" line="1356"/>
<source>Failed to verify %1, please enter password to unlock</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="1264"/>
<location filename="../src/authdialog.cpp" line="1266"/>
<location filename="../src/authdialog.cpp" line="1360"/>
<location filename="../src/authdialog.cpp" line="1362"/>
<source>Unable to verify %1, please enter password to unlock</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="1279"/>
<location filename="../src/authdialog.cpp" line="1283"/>
<location filename="../src/authdialog.cpp" line="1375"/>
<location filename="../src/authdialog.cpp" line="1379"/>
<source>Failed to verify %1, you still have %2 verification opportunities</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="1296"/>
<location filename="../src/authdialog.cpp" line="1392"/>
<source>Abnormal network</source>
<translation type="unfinished"></translation>
</message>
@ -168,22 +164,22 @@
<context>
<name>BatteryWidget</name>
<message>
<location filename="../src/batterywidget.cpp" line="163"/>
<location filename="../src/batterywidget.cpp" line="180"/>
<source>Charging...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/batterywidget.cpp" line="165"/>
<location filename="../src/batterywidget.cpp" line="182"/>
<source>fully charged</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/batterywidget.cpp" line="169"/>
<location filename="../src/batterywidget.cpp" line="186"/>
<source>PowerMode</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/batterywidget.cpp" line="172"/>
<location filename="../src/batterywidget.cpp" line="189"/>
<source>BatteryMode</source>
<translation type="unfinished"></translation>
</message>
@ -229,12 +225,12 @@
<context>
<name>BiometricAuthWidget</name>
<message>
<location filename="../BiometricAuth/biometricauthwidget.cpp" line="119"/>
<location filename="../BiometricAuth/biometricauthwidget.cpp" line="118"/>
<source>Current device: </source>
<translation type="unfinished">Şuanki aygıt:</translation>
</message>
<message>
<location filename="../BiometricAuth/biometricauthwidget.cpp" line="185"/>
<location filename="../BiometricAuth/biometricauthwidget.cpp" line="184"/>
<source>Identify failed, Please retry.</source>
<translation type="unfinished">Tanımlama başarısız, Lütfen tekrar deneyin.</translation>
</message>
@ -242,22 +238,22 @@
<context>
<name>BiometricDevicesWidget</name>
<message>
<location filename="../BiometricAuth/biometricdeviceswidget.cpp" line="48"/>
<location filename="../BiometricAuth/biometricdeviceswidget.cpp" line="47"/>
<source>Please select the biometric device</source>
<translation type="unfinished">Lütfen biyometrik aygıtı seçin</translation>
</message>
<message>
<location filename="../BiometricAuth/biometricdeviceswidget.cpp" line="53"/>
<location filename="../BiometricAuth/biometricdeviceswidget.cpp" line="52"/>
<source>Device type:</source>
<translation type="unfinished">Aygıt türü:</translation>
</message>
<message>
<location filename="../BiometricAuth/biometricdeviceswidget.cpp" line="69"/>
<location filename="../BiometricAuth/biometricdeviceswidget.cpp" line="68"/>
<source>Device name:</source>
<translation type="unfinished">Aygıt adı:</translation>
</message>
<message>
<location filename="../BiometricAuth/biometricdeviceswidget.cpp" line="79"/>
<location filename="../BiometricAuth/biometricdeviceswidget.cpp" line="78"/>
<source>OK</source>
<translation type="unfinished">Tamam</translation>
</message>
@ -265,7 +261,7 @@
<context>
<name>CharsMoreWidget</name>
<message>
<location filename="../VirtualKeyboard/src/charsmorewidget.cpp" line="166"/>
<location filename="../VirtualKeyboard/src/charsmorewidget.cpp" line="183"/>
<source>&amp;&amp;?!</source>
<translation type="unfinished"></translation>
</message>
@ -273,17 +269,17 @@
<context>
<name>CharsWidget</name>
<message>
<location filename="../VirtualKeyboard/src/charswidget.cpp" line="97"/>
<location filename="../VirtualKeyboard/src/charswidget.cpp" line="114"/>
<source>More</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../VirtualKeyboard/src/charswidget.cpp" line="111"/>
<location filename="../VirtualKeyboard/src/charswidget.cpp" line="128"/>
<source>ABC</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../VirtualKeyboard/src/charswidget.cpp" line="124"/>
<location filename="../VirtualKeyboard/src/charswidget.cpp" line="141"/>
<source>123</source>
<translation type="unfinished"></translation>
</message>
@ -396,37 +392,37 @@
<context>
<name>DeviceType</name>
<message>
<location filename="../BiometricAuth/biometricdeviceinfo.cpp" line="61"/>
<location filename="../BiometricAuth/biometricdeviceinfo.cpp" line="60"/>
<source>FingerPrint</source>
<translation type="unfinished">Parmak İzi</translation>
</message>
<message>
<location filename="../BiometricAuth/biometricdeviceinfo.cpp" line="63"/>
<location filename="../BiometricAuth/biometricdeviceinfo.cpp" line="62"/>
<source>FingerVein</source>
<translation type="unfinished">Parmak Damarı</translation>
</message>
<message>
<location filename="../BiometricAuth/biometricdeviceinfo.cpp" line="65"/>
<location filename="../BiometricAuth/biometricdeviceinfo.cpp" line="64"/>
<source>Iris</source>
<translation type="unfinished">Göz</translation>
</message>
<message>
<location filename="../BiometricAuth/biometricdeviceinfo.cpp" line="67"/>
<location filename="../BiometricAuth/biometricdeviceinfo.cpp" line="66"/>
<source>Face</source>
<translation type="unfinished">Yüz</translation>
</message>
<message>
<location filename="../BiometricAuth/biometricdeviceinfo.cpp" line="69"/>
<location filename="../BiometricAuth/biometricdeviceinfo.cpp" line="68"/>
<source>VoicePrint</source>
<translation type="unfinished">Ses İzi</translation>
</message>
<message>
<location filename="../BiometricAuth/biometricdeviceinfo.cpp" line="71"/>
<source>ukey</source>
<location filename="../BiometricAuth/biometricdeviceinfo.cpp" line="70"/>
<source>Ukey</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../BiometricAuth/biometricdeviceinfo.cpp" line="73"/>
<location filename="../BiometricAuth/biometricdeviceinfo.cpp" line="72"/>
<source>QRCode</source>
<translation type="unfinished"></translation>
</message>
@ -1690,36 +1686,44 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>IconEdit</name>
<message>
<location filename="../src/iconedit.cpp" line="114"/>
<source>OK</source>
<translation type="unfinished">Tamam</translation>
</message>
</context>
<context>
<name>InputInfos</name>
<message>
<location filename="../src/verificationwidget.cpp" line="141"/>
<location filename="../src/verificationwidget.cpp" line="318"/>
<location filename="../src/verificationwidget.cpp" line="158"/>
<location filename="../src/verificationwidget.cpp" line="335"/>
<source>Get code</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/verificationwidget.cpp" line="288"/>
<location filename="../src/verificationwidget.cpp" line="305"/>
<source>Recapture(60s)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/verificationwidget.cpp" line="312"/>
<location filename="../src/verificationwidget.cpp" line="329"/>
<source>Recapture(%1s)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/verificationwidget.cpp" line="338"/>
<location filename="../src/verificationwidget.cpp" line="355"/>
<source>Service exception...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/verificationwidget.cpp" line="341"/>
<location filename="../src/verificationwidget.cpp" line="358"/>
<source>Invaild parameters...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/verificationwidget.cpp" line="344"/>
<location filename="../src/verificationwidget.cpp" line="361"/>
<source>Unknown fault:%1</source>
<translation type="unfinished"></translation>
</message>
@ -1770,90 +1774,90 @@
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="456"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="611"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="610"/>
<source>Advanced</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="610"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="609"/>
<source>Show KylinNM</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="1289"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1279"/>
<source>No wireless card detected</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="1326"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1316"/>
<source>Activated LAN</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="1393"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1379"/>
<source>Activated WLAN</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="1437"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1535"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1701"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2426"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2518"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1423"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1522"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1694"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2419"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2510"/>
<source>Not connected</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="1440"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1537"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1607"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1608"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1704"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1828"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1995"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2428"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2520"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1426"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1524"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1594"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1595"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1697"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1821"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1988"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2421"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2512"/>
<source>Disconnected</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="1588"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1798"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1575"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1791"/>
<source>NetOn,</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="1633"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1620"/>
<source>No Other Wired Network Scheme</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="1849"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1842"/>
<source>No Other Wireless Network Scheme</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="2335"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2328"/>
<source>Wired net is disconnected</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="2706"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2695"/>
<source>Conn Ethernet Success</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="2718"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2707"/>
<source>Conn Ethernet Fail</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="2743"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2732"/>
<source>Conn Wifi Success</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="2752"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2741"/>
<source>Confirm your Wi-Fi password or usable of wireless card</source>
<translation type="unfinished"></translation>
</message>
@ -1861,25 +1865,15 @@
<context>
<name>LettersWidget</name>
<message>
<location filename="../VirtualKeyboard/src/letterswidget.cpp" line="138"/>
<location filename="../VirtualKeyboard/src/letterswidget.cpp" line="170"/>
<source>&amp;&amp;?!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../VirtualKeyboard/src/letterswidget.cpp" line="152"/>
<location filename="../VirtualKeyboard/src/letterswidget.cpp" line="184"/>
<source>123</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../VirtualKeyboard/src/letterswidget.cpp" line="166"/>
<source>Ctrl</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../VirtualKeyboard/src/letterswidget.cpp" line="194"/>
<source>Alt</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LockWidget</name>
@ -1903,21 +1897,37 @@
<translation type="obsolete">Misafir</translation>
</message>
<message>
<source>SwitchUser</source>
<translation type="vanished">Kullanıcı Değiştir</translation>
<location filename="../src/lockwidget.cpp" line="762"/>
<source>PowerInfo</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/lockwidget.cpp" line="1135"/>
<location filename="../src/lockwidget.cpp" line="785"/>
<source>Power</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/lockwidget.cpp" line="814"/>
<source>VirtualKeyboard</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/lockwidget.cpp" line="827"/>
<source>SwitchUser</source>
<translation>Kullanıcı Değiştir</translation>
</message>
<message>
<location filename="../src/lockwidget.cpp" line="1109"/>
<source>Multiple users are logged in at the same time.Are you sure you want to reboot this system?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/lockwidget.cpp" line="1445"/>
<location filename="../src/lockwidget.cpp" line="1410"/>
<source>LAN</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/lockwidget.cpp" line="1447"/>
<location filename="../src/lockwidget.cpp" line="1412"/>
<source>WLAN</source>
<translation type="unfinished"></translation>
</message>
@ -1925,17 +1935,22 @@
<context>
<name>LoginOptionsWidget</name>
<message>
<location filename="../src/loginoptionswidget.cpp" line="73"/>
<location filename="../src/loginoptionswidget.cpp" line="96"/>
<source>Login Options</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/loginoptionswidget.cpp" line="270"/>
<location filename="../src/loginoptionswidget.cpp" line="324"/>
<source>Password</source>
<translation type="unfinished">Parola</translation>
</message>
<message>
<location filename="../src/loginoptionswidget.cpp" line="664"/>
<location filename="../src/loginoptionswidget.cpp" line="350"/>
<source>Other</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/loginoptionswidget.cpp" line="762"/>
<source>Identify device removed!</source>
<translation type="unfinished"></translation>
</message>
@ -1943,9 +1958,9 @@
<context>
<name>MyLineEdit</name>
<message>
<location filename="../src/verificationwidget.cpp" line="599"/>
<location filename="../src/verificationwidget.cpp" line="605"/>
<location filename="../src/verificationwidget.cpp" line="616"/>
<location filename="../src/verificationwidget.cpp" line="622"/>
<location filename="../src/verificationwidget.cpp" line="639"/>
<source>Verification code</source>
<translation type="unfinished"></translation>
</message>
@ -1953,12 +1968,12 @@
<context>
<name>NumbersWidget</name>
<message>
<location filename="../VirtualKeyboard/src/numberswidget.cpp" line="143"/>
<location filename="../VirtualKeyboard/src/numberswidget.cpp" line="160"/>
<source>&amp;&amp;?!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../VirtualKeyboard/src/numberswidget.cpp" line="157"/>
<location filename="../VirtualKeyboard/src/numberswidget.cpp" line="174"/>
<source>Return</source>
<translation type="unfinished"></translation>
</message>
@ -2073,7 +2088,7 @@
<name>PhoneAuthWidget</name>
<message>
<location filename="../src/permissioncheck.cpp" line="236"/>
<location filename="../src/verificationwidget.cpp" line="375"/>
<location filename="../src/verificationwidget.cpp" line="392"/>
<source>Verification by phoneNum</source>
<translation type="unfinished"></translation>
</message>
@ -2084,43 +2099,43 @@
</message>
<message>
<location filename="../src/permissioncheck.cpp" line="259"/>
<location filename="../src/verificationwidget.cpp" line="399"/>
<location filename="../src/verificationwidget.cpp" line="416"/>
<source>commit</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/verificationwidget.cpp" line="381"/>
<location filename="../src/verificationwidget.cpp" line="398"/>
<source> Use SMS to verification </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/verificationwidget.cpp" line="484"/>
<location filename="../src/verificationwidget.cpp" line="524"/>
<location filename="../src/verificationwidget.cpp" line="501"/>
<location filename="../src/verificationwidget.cpp" line="541"/>
<source>Network not connected~</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/verificationwidget.cpp" line="487"/>
<location filename="../src/verificationwidget.cpp" line="504"/>
<source>Verification Code invalid!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/verificationwidget.cpp" line="490"/>
<location filename="../src/verificationwidget.cpp" line="507"/>
<source>Verification Code incorrect.Please retry!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/verificationwidget.cpp" line="493"/>
<location filename="../src/verificationwidget.cpp" line="510"/>
<source>Failed time over limit!Retry after 1 hour!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/verificationwidget.cpp" line="497"/>
<location filename="../src/verificationwidget.cpp" line="514"/>
<source>verifaction failed!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/verificationwidget.cpp" line="530"/>
<location filename="../src/verificationwidget.cpp" line="547"/>
<source>Network unavailable~</source>
<translation type="unfinished"></translation>
</message>
@ -2128,7 +2143,7 @@
<context>
<name>PowerManager</name>
<message>
<location filename="../src/powermanager.cpp" line="299"/>
<location filename="../src/powermanager.cpp" line="300"/>
<source>lock</source>
<translation>kilit</translation>
</message>
@ -2157,33 +2172,53 @@
<translation type="obsolete">Kullanıcı Değiştir</translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="316"/>
<location filename="../src/powermanager.cpp" line="317"/>
<source>Log Out</source>
<translation type="unfinished">Çıkış</translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="334"/>
<location filename="../src/powermanager.cpp" line="673"/>
<location filename="../src/powermanager.cpp" line="335"/>
<location filename="../src/powermanager.cpp" line="676"/>
<source>Restart</source>
<translation type="unfinished">Yeniden Başlat</translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="354"/>
<location filename="../src/powermanager.cpp" line="355"/>
<source>Power Off</source>
<translation type="unfinished">Bilgisayarı Kapat</translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="694"/>
<location filename="../src/powermanager.cpp" line="674"/>
<source>Close all apps, turn off your computer, and then turn your computer back on</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="697"/>
<source>Close all apps, and then shut down your computer</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="700"/>
<source>Shut Down</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="722"/>
<location filename="../src/powermanager.cpp" line="729"/>
<source>Turn off your computer, but the app stays open. When the computer is turned on, it can be restored to the state you left</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="731"/>
<source>Hibernate</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="751"/>
<location filename="../src/powermanager.cpp" line="760"/>
<source>The computer stays on, but consumes less power. The app stays open and can quickly wake up and revert to where you left off</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="763"/>
<source>Suspend</source>
<translation type="unfinished"></translation>
</message>
@ -2221,17 +2256,17 @@
<translation type="obsolete">çıkış</translation>
</message>
<message>
<location filename="../screensaver/screensaver.cpp" line="145"/>
<location filename="../screensaver/screensaver.cpp" line="167"/>
<source>Picture does not exist</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../screensaver/screensaver.cpp" line="1205"/>
<location filename="../screensaver/screensaver.cpp" line="170"/>
<source>View</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../screensaver/screensaver.cpp" line="1374"/>
<location filename="../screensaver/screensaver.cpp" line="1461"/>
<source>You have new notification</source>
<translation type="unfinished"></translation>
</message>
@ -2265,32 +2300,32 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/surewindow.ui" line="157"/>
<location filename="../src/surewindow.ui" line="160"/>
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/surewindow.ui" line="176"/>
<location filename="../src/surewindow.ui" line="179"/>
<source>Confirm</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/surewindow.cpp" line="47"/>
<location filename="../src/surewindow.cpp" line="67"/>
<source>The following program is running to prevent the system from reboot!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/surewindow.cpp" line="50"/>
<location filename="../src/surewindow.cpp" line="70"/>
<source>The following program is running to prevent the system from shutting down!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/surewindow.cpp" line="53"/>
<location filename="../src/surewindow.cpp" line="73"/>
<source>The following program is running to prevent the system from suspend!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/surewindow.cpp" line="56"/>
<location filename="../src/surewindow.cpp" line="76"/>
<source>The following program is running to prevent the system from hibernate!</source>
<translation type="unfinished"></translation>
</message>
@ -2358,7 +2393,7 @@
<context>
<name>VerificationWidget</name>
<message>
<location filename="../src/verificationwidget.cpp" line="55"/>
<location filename="../src/verificationwidget.cpp" line="72"/>
<source>Please scan by bound WeChat</source>
<translation type="unfinished"></translation>
</message>
@ -2366,7 +2401,7 @@
<context>
<name>VerticalVerificationWidget</name>
<message>
<location filename="../src/verticalVerificationwidget.cpp" line="52"/>
<location filename="../src/verticalVerificationwidget.cpp" line="69"/>
<source>Please scan by bound WeChat</source>
<translation type="unfinished"></translation>
</message>
@ -2430,7 +2465,7 @@
<context>
<name>delay</name>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="179"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="209"/>
<source>how long to show lock</source>
<translation type="unfinished"></translation>
</message>
@ -2438,7 +2473,7 @@
<context>
<name>has-lock</name>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="182"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="212"/>
<source>if show lock</source>
<translation type="unfinished"></translation>
</message>
@ -2452,8 +2487,8 @@
</message>
<message>
<location filename="../src/ukui-screensaver-command.cpp" line="48"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="166"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="168"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="196"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="198"/>
<source>lock the screen immediately</source>
<translation type="unfinished">Ekranı hemen kilitle</translation>
</message>
@ -2478,53 +2513,53 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="160"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="190"/>
<source>Dialog for the ukui ScreenSaver.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="170"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="200"/>
<source>activated by session idle signal</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="172"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="176"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="202"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="206"/>
<source>lock the screen and show screensaver immediately</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="174"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="204"/>
<source>show screensaver immediately</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="178"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="208"/>
<source>show blank screensaver immediately and delay time to show lock</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="181"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="211"/>
<source>show blank screensaver immediately and if lock</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../screensaver/main.cpp" line="65"/>
<location filename="../screensaver/main.cpp" line="66"/>
<source>Screensaver for ukui-screensaver</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../screensaver/main.cpp" line="69"/>
<location filename="../screensaver/main.cpp" line="70"/>
<source>show on root window</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../screensaver/main.cpp" line="71"/>
<location filename="../screensaver/main.cpp" line="72"/>
<source>show on window.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../screensaver/main.cpp" line="72"/>
<location filename="../screensaver/main.cpp" line="73"/>
<source>window id</source>
<translation type="unfinished"></translation>
</message>

View File

@ -16,7 +16,7 @@
<translation type="obsolete">使</translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="957"/>
<location filename="../src/authdialog.cpp" line="1042"/>
<source>Retry</source>
<translation></translation>
</message>
@ -37,80 +37,81 @@
<translation type="obsolete"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="938"/>
<source>Password: </source>
<translation type="vanished"></translation>
<translation></translation>
</message>
<message>
<source>Account locked %1 minutes due to %2 fail attempts</source>
<translation type="vanished">%1%2</translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="326"/>
<location filename="../src/authdialog.cpp" line="327"/>
<location filename="../src/authdialog.cpp" line="396"/>
<location filename="../src/authdialog.cpp" line="397"/>
<location filename="../src/authdialog.cpp" line="339"/>
<location filename="../src/authdialog.cpp" line="340"/>
<location filename="../src/authdialog.cpp" line="409"/>
<location filename="../src/authdialog.cpp" line="410"/>
<source>Please try again in %1 minutes.</source>
<translation>%1</translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="336"/>
<location filename="../src/authdialog.cpp" line="337"/>
<location filename="../src/authdialog.cpp" line="405"/>
<location filename="../src/authdialog.cpp" line="406"/>
<location filename="../src/authdialog.cpp" line="349"/>
<location filename="../src/authdialog.cpp" line="350"/>
<location filename="../src/authdialog.cpp" line="418"/>
<location filename="../src/authdialog.cpp" line="419"/>
<source>Please try again in %1 seconds.</source>
<translation>%1</translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="346"/>
<location filename="../src/authdialog.cpp" line="347"/>
<location filename="../src/authdialog.cpp" line="414"/>
<location filename="../src/authdialog.cpp" line="415"/>
<location filename="../src/authdialog.cpp" line="359"/>
<location filename="../src/authdialog.cpp" line="360"/>
<location filename="../src/authdialog.cpp" line="427"/>
<location filename="../src/authdialog.cpp" line="428"/>
<source>Account locked permanently.</source>
<translation></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="566"/>
<location filename="../src/authdialog.cpp" line="620"/>
<source>Verify face recognition or enter password to unlock</source>
<translation></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="571"/>
<location filename="../src/authdialog.cpp" line="625"/>
<source>Press fingerprint or enter password to unlock</source>
<translation></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="576"/>
<location filename="../src/authdialog.cpp" line="630"/>
<source>Verify voiceprint or enter password to unlock</source>
<translation></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="581"/>
<location filename="../src/authdialog.cpp" line="635"/>
<source>Verify finger vein or enter password to unlock</source>
<translation></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="586"/>
<location filename="../src/authdialog.cpp" line="640"/>
<source>Verify iris or enter password to unlock</source>
<translation></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="873"/>
<location filename="../src/authdialog.cpp" line="940"/>
<source>Input Password</source>
<translation></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="1260"/>
<location filename="../src/authdialog.cpp" line="1356"/>
<source>Failed to verify %1, please enter password to unlock</source>
<translation>%1</translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="1264"/>
<location filename="../src/authdialog.cpp" line="1266"/>
<location filename="../src/authdialog.cpp" line="1360"/>
<location filename="../src/authdialog.cpp" line="1362"/>
<source>Unable to verify %1, please enter password to unlock</source>
<translation>%1</translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="1296"/>
<location filename="../src/authdialog.cpp" line="1392"/>
<source>Abnormal network</source>
<translation></translation>
</message>
@ -119,8 +120,8 @@
<translation type="vanished">使</translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="649"/>
<location filename="../src/authdialog.cpp" line="650"/>
<location filename="../src/authdialog.cpp" line="714"/>
<location filename="../src/authdialog.cpp" line="715"/>
<source>Password cannot be empty</source>
<translation></translation>
</message>
@ -133,8 +134,8 @@
<translation type="vanished">%1.</translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="1279"/>
<location filename="../src/authdialog.cpp" line="1283"/>
<location filename="../src/authdialog.cpp" line="1375"/>
<location filename="../src/authdialog.cpp" line="1379"/>
<source>Failed to verify %1, you still have %2 verification opportunities</source>
<translation>%1%2</translation>
</message>
@ -163,32 +164,31 @@
<translation type="vanished"></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="912"/>
<location filename="../src/authdialog.cpp" line="985"/>
<source>Authentication failure, Please try again</source>
<translation></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="591"/>
<location filename="../src/authdialog.cpp" line="645"/>
<source>Use the bound wechat scanning code or enter the password to unlock</source>
<translation>使</translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="223"/>
<location filename="../src/authdialog.cpp" line="229"/>
<source>Enter the ukey password</source>
<translation></translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="240"/>
<location filename="../src/authdialog.cpp" line="246"/>
<source>Insert the ukey into the USB port</source>
<translation>USB端口</translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="871"/>
<source>Password </source>
<translation> </translation>
<translation type="vanished"> </translation>
</message>
<message>
<location filename="../src/authdialog.cpp" line="940"/>
<location filename="../src/authdialog.cpp" line="1025"/>
<source>Login</source>
<translation></translation>
</message>
@ -216,22 +216,22 @@
<context>
<name>BatteryWidget</name>
<message>
<location filename="../src/batterywidget.cpp" line="172"/>
<location filename="../src/batterywidget.cpp" line="189"/>
<source>BatteryMode</source>
<translation></translation>
</message>
<message>
<location filename="../src/batterywidget.cpp" line="169"/>
<location filename="../src/batterywidget.cpp" line="186"/>
<source>PowerMode</source>
<translation></translation>
</message>
<message>
<location filename="../src/batterywidget.cpp" line="163"/>
<location filename="../src/batterywidget.cpp" line="180"/>
<source>Charging...</source>
<translation>...</translation>
</message>
<message>
<location filename="../src/batterywidget.cpp" line="165"/>
<location filename="../src/batterywidget.cpp" line="182"/>
<source>fully charged</source>
<translation></translation>
</message>
@ -277,12 +277,12 @@
<context>
<name>BiometricAuthWidget</name>
<message>
<location filename="../BiometricAuth/biometricauthwidget.cpp" line="119"/>
<location filename="../BiometricAuth/biometricauthwidget.cpp" line="118"/>
<source>Current device: </source>
<translation></translation>
</message>
<message>
<location filename="../BiometricAuth/biometricauthwidget.cpp" line="185"/>
<location filename="../BiometricAuth/biometricauthwidget.cpp" line="184"/>
<source>Identify failed, Please retry.</source>
<translation></translation>
</message>
@ -290,22 +290,22 @@
<context>
<name>BiometricDevicesWidget</name>
<message>
<location filename="../BiometricAuth/biometricdeviceswidget.cpp" line="48"/>
<location filename="../BiometricAuth/biometricdeviceswidget.cpp" line="47"/>
<source>Please select the biometric device</source>
<translation></translation>
</message>
<message>
<location filename="../BiometricAuth/biometricdeviceswidget.cpp" line="53"/>
<location filename="../BiometricAuth/biometricdeviceswidget.cpp" line="52"/>
<source>Device type:</source>
<translation></translation>
</message>
<message>
<location filename="../BiometricAuth/biometricdeviceswidget.cpp" line="69"/>
<location filename="../BiometricAuth/biometricdeviceswidget.cpp" line="68"/>
<source>Device name:</source>
<translation></translation>
</message>
<message>
<location filename="../BiometricAuth/biometricdeviceswidget.cpp" line="79"/>
<location filename="../BiometricAuth/biometricdeviceswidget.cpp" line="78"/>
<source>OK</source>
<translation></translation>
</message>
@ -317,7 +317,7 @@
<translation type="vanished"></translation>
</message>
<message>
<location filename="../VirtualKeyboard/src/charsmorewidget.cpp" line="166"/>
<location filename="../VirtualKeyboard/src/charsmorewidget.cpp" line="183"/>
<source>&amp;&amp;?!</source>
<translation type="unfinished"></translation>
</message>
@ -325,17 +325,17 @@
<context>
<name>CharsWidget</name>
<message>
<location filename="../VirtualKeyboard/src/charswidget.cpp" line="97"/>
<location filename="../VirtualKeyboard/src/charswidget.cpp" line="114"/>
<source>More</source>
<translation></translation>
</message>
<message>
<location filename="../VirtualKeyboard/src/charswidget.cpp" line="111"/>
<location filename="../VirtualKeyboard/src/charswidget.cpp" line="128"/>
<source>ABC</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../VirtualKeyboard/src/charswidget.cpp" line="124"/>
<location filename="../VirtualKeyboard/src/charswidget.cpp" line="141"/>
<source>123</source>
<translation type="unfinished"></translation>
</message>
@ -468,37 +468,37 @@
<context>
<name>DeviceType</name>
<message>
<location filename="../BiometricAuth/biometricdeviceinfo.cpp" line="61"/>
<location filename="../BiometricAuth/biometricdeviceinfo.cpp" line="60"/>
<source>FingerPrint</source>
<translation></translation>
</message>
<message>
<location filename="../BiometricAuth/biometricdeviceinfo.cpp" line="63"/>
<location filename="../BiometricAuth/biometricdeviceinfo.cpp" line="62"/>
<source>FingerVein</source>
<translation></translation>
</message>
<message>
<location filename="../BiometricAuth/biometricdeviceinfo.cpp" line="65"/>
<location filename="../BiometricAuth/biometricdeviceinfo.cpp" line="64"/>
<source>Iris</source>
<translation></translation>
</message>
<message>
<location filename="../BiometricAuth/biometricdeviceinfo.cpp" line="67"/>
<location filename="../BiometricAuth/biometricdeviceinfo.cpp" line="66"/>
<source>Face</source>
<translation></translation>
</message>
<message>
<location filename="../BiometricAuth/biometricdeviceinfo.cpp" line="69"/>
<location filename="../BiometricAuth/biometricdeviceinfo.cpp" line="68"/>
<source>VoicePrint</source>
<translation></translation>
</message>
<message>
<location filename="../BiometricAuth/biometricdeviceinfo.cpp" line="71"/>
<source>ukey</source>
<location filename="../BiometricAuth/biometricdeviceinfo.cpp" line="70"/>
<source>Ukey</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../BiometricAuth/biometricdeviceinfo.cpp" line="73"/>
<location filename="../BiometricAuth/biometricdeviceinfo.cpp" line="72"/>
<source>QRCode</source>
<translation></translation>
</message>
@ -1802,36 +1802,44 @@
<translation></translation>
</message>
</context>
<context>
<name>IconEdit</name>
<message>
<location filename="../src/iconedit.cpp" line="114"/>
<source>OK</source>
<translation></translation>
</message>
</context>
<context>
<name>InputInfos</name>
<message>
<location filename="../src/verificationwidget.cpp" line="338"/>
<location filename="../src/verificationwidget.cpp" line="355"/>
<source>Service exception...</source>
<translation>...</translation>
</message>
<message>
<location filename="../src/verificationwidget.cpp" line="341"/>
<location filename="../src/verificationwidget.cpp" line="358"/>
<source>Invaild parameters...</source>
<translation>...</translation>
</message>
<message>
<location filename="../src/verificationwidget.cpp" line="344"/>
<location filename="../src/verificationwidget.cpp" line="361"/>
<source>Unknown fault:%1</source>
<translation>:%1</translation>
</message>
<message>
<location filename="../src/verificationwidget.cpp" line="288"/>
<location filename="../src/verificationwidget.cpp" line="305"/>
<source>Recapture(60s)</source>
<translation>(60s)</translation>
</message>
<message>
<location filename="../src/verificationwidget.cpp" line="312"/>
<location filename="../src/verificationwidget.cpp" line="329"/>
<source>Recapture(%1s)</source>
<translation>(%1s)</translation>
</message>
<message>
<location filename="../src/verificationwidget.cpp" line="141"/>
<location filename="../src/verificationwidget.cpp" line="318"/>
<location filename="../src/verificationwidget.cpp" line="158"/>
<location filename="../src/verificationwidget.cpp" line="335"/>
<source>Get code</source>
<translation></translation>
</message>
@ -1878,7 +1886,7 @@
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="456"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="611"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="610"/>
<source>Advanced</source>
<translation></translation>
</message>
@ -1937,49 +1945,49 @@
<translation>线</translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="610"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="609"/>
<source>Show KylinNM</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="1289"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1279"/>
<source>No wireless card detected</source>
<translation type="unfinished">线</translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="1326"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1316"/>
<source>Activated LAN</source>
<translation></translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="1393"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1379"/>
<source>Activated WLAN</source>
<translation></translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="1437"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1535"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1701"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2426"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2518"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1423"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1522"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1694"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2419"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2510"/>
<source>Not connected</source>
<translation></translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="1440"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1537"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1607"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1608"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1704"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1828"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1995"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2428"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2520"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1426"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1524"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1594"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1595"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1697"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1821"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1988"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2421"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2512"/>
<source>Disconnected</source>
<translation></translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="1633"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1620"/>
<source>No Other Wired Network Scheme</source>
<translation type="unfinished">线</translation>
</message>
@ -1996,12 +2004,12 @@
<translation type="obsolete"></translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="1849"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1842"/>
<source>No Other Wireless Network Scheme</source>
<translation type="unfinished">线</translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="2335"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2328"/>
<source>Wired net is disconnected</source>
<translation type="unfinished">线</translation>
</message>
@ -2010,7 +2018,7 @@
<translation type="obsolete">线</translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="2752"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2741"/>
<source>Confirm your Wi-Fi password or usable of wireless card</source>
<translation type="unfinished">Wi-Fi密码或无线设备</translation>
</message>
@ -2032,8 +2040,8 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="1588"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1798"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1575"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="1791"/>
<source>NetOn,</source>
<translation></translation>
</message>
@ -2066,17 +2074,17 @@
<translation type="vanished"> Wi-Fi列表</translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="2706"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2695"/>
<source>Conn Ethernet Success</source>
<translation>线</translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="2718"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2707"/>
<source>Conn Ethernet Fail</source>
<translation>线</translation>
</message>
<message>
<location filename="../KylinNM/src/kylinnm.cpp" line="2743"/>
<location filename="../KylinNM/src/kylinnm.cpp" line="2732"/>
<source>Conn Wifi Success</source>
<translation>线</translation>
</message>
@ -2092,22 +2100,22 @@
<translation type="vanished"></translation>
</message>
<message>
<location filename="../VirtualKeyboard/src/letterswidget.cpp" line="138"/>
<location filename="../VirtualKeyboard/src/letterswidget.cpp" line="170"/>
<source>&amp;&amp;?!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../VirtualKeyboard/src/letterswidget.cpp" line="152"/>
<location filename="../VirtualKeyboard/src/letterswidget.cpp" line="184"/>
<source>123</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../VirtualKeyboard/src/letterswidget.cpp" line="166"/>
<location filename="../VirtualKeyboard/src/letterswidget.cpp" line="198"/>
<source>Ctrl</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../VirtualKeyboard/src/letterswidget.cpp" line="194"/>
<location filename="../VirtualKeyboard/src/letterswidget.cpp" line="226"/>
<source>Alt</source>
<translation type="unfinished"></translation>
</message>
@ -2134,21 +2142,37 @@
<translation type="vanished"></translation>
</message>
<message>
<source>SwitchUser</source>
<translation type="vanished"></translation>
<location filename="../src/lockwidget.cpp" line="762"/>
<source>PowerInfo</source>
<translation></translation>
</message>
<message>
<location filename="../src/lockwidget.cpp" line="1135"/>
<location filename="../src/lockwidget.cpp" line="785"/>
<source>Power</source>
<translation></translation>
</message>
<message>
<location filename="../src/lockwidget.cpp" line="814"/>
<source>VirtualKeyboard</source>
<translation></translation>
</message>
<message>
<location filename="../src/lockwidget.cpp" line="827"/>
<source>SwitchUser</source>
<translation></translation>
</message>
<message>
<location filename="../src/lockwidget.cpp" line="1109"/>
<source>Multiple users are logged in at the same time.Are you sure you want to reboot this system?</source>
<translation>退</translation>
</message>
<message>
<location filename="../src/lockwidget.cpp" line="1445"/>
<location filename="../src/lockwidget.cpp" line="1410"/>
<source>LAN</source>
<translation type="unfinished">线</translation>
</message>
<message>
<location filename="../src/lockwidget.cpp" line="1447"/>
<location filename="../src/lockwidget.cpp" line="1412"/>
<source>WLAN</source>
<translation type="unfinished">线</translation>
</message>
@ -2156,21 +2180,26 @@
<context>
<name>LoginOptionsWidget</name>
<message>
<location filename="../src/loginoptionswidget.cpp" line="73"/>
<location filename="../src/loginoptionswidget.cpp" line="96"/>
<source>Login Options</source>
<translation></translation>
</message>
<message>
<location filename="../src/loginoptionswidget.cpp" line="270"/>
<location filename="../src/loginoptionswidget.cpp" line="324"/>
<source>Password</source>
<translation></translation>
</message>
<message>
<location filename="../src/loginoptionswidget.cpp" line="350"/>
<source>Other</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Wechat</source>
<translation type="vanished"></translation>
</message>
<message>
<location filename="../src/loginoptionswidget.cpp" line="664"/>
<location filename="../src/loginoptionswidget.cpp" line="762"/>
<source>Identify device removed!</source>
<translation>!</translation>
</message>
@ -2178,9 +2207,9 @@
<context>
<name>MyLineEdit</name>
<message>
<location filename="../src/verificationwidget.cpp" line="599"/>
<location filename="../src/verificationwidget.cpp" line="605"/>
<location filename="../src/verificationwidget.cpp" line="616"/>
<location filename="../src/verificationwidget.cpp" line="622"/>
<location filename="../src/verificationwidget.cpp" line="639"/>
<source>Verification code</source>
<translation></translation>
</message>
@ -2192,12 +2221,12 @@
<translation type="vanished"></translation>
</message>
<message>
<location filename="../VirtualKeyboard/src/numberswidget.cpp" line="143"/>
<location filename="../VirtualKeyboard/src/numberswidget.cpp" line="160"/>
<source>&amp;&amp;?!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../VirtualKeyboard/src/numberswidget.cpp" line="157"/>
<location filename="../VirtualKeyboard/src/numberswidget.cpp" line="174"/>
<source>Return</source>
<translation></translation>
</message>
@ -2340,7 +2369,7 @@
<name>PhoneAuthWidget</name>
<message>
<location filename="../src/permissioncheck.cpp" line="236"/>
<location filename="../src/verificationwidget.cpp" line="375"/>
<location filename="../src/verificationwidget.cpp" line="392"/>
<source>Verification by phoneNum</source>
<translation></translation>
</message>
@ -2350,44 +2379,44 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/verificationwidget.cpp" line="381"/>
<location filename="../src/verificationwidget.cpp" line="398"/>
<source> Use SMS to verification </source>
<translation> 使 </translation>
</message>
<message>
<location filename="../src/permissioncheck.cpp" line="259"/>
<location filename="../src/verificationwidget.cpp" line="399"/>
<location filename="../src/verificationwidget.cpp" line="416"/>
<source>commit</source>
<translation></translation>
</message>
<message>
<location filename="../src/verificationwidget.cpp" line="484"/>
<location filename="../src/verificationwidget.cpp" line="524"/>
<location filename="../src/verificationwidget.cpp" line="501"/>
<location filename="../src/verificationwidget.cpp" line="541"/>
<source>Network not connected~</source>
<translation>~</translation>
</message>
<message>
<location filename="../src/verificationwidget.cpp" line="530"/>
<location filename="../src/verificationwidget.cpp" line="547"/>
<source>Network unavailable~</source>
<translation>~</translation>
</message>
<message>
<location filename="../src/verificationwidget.cpp" line="487"/>
<location filename="../src/verificationwidget.cpp" line="504"/>
<source>Verification Code invalid!</source>
<translation></translation>
</message>
<message>
<location filename="../src/verificationwidget.cpp" line="490"/>
<location filename="../src/verificationwidget.cpp" line="507"/>
<source>Verification Code incorrect.Please retry!</source>
<translation>!</translation>
</message>
<message>
<location filename="../src/verificationwidget.cpp" line="493"/>
<location filename="../src/verificationwidget.cpp" line="510"/>
<source>Failed time over limit!Retry after 1 hour!</source>
<translation>10,1</translation>
</message>
<message>
<location filename="../src/verificationwidget.cpp" line="497"/>
<location filename="../src/verificationwidget.cpp" line="514"/>
<source>verifaction failed!</source>
<translation></translation>
</message>
@ -2395,7 +2424,7 @@
<context>
<name>PowerManager</name>
<message>
<location filename="../src/powermanager.cpp" line="299"/>
<location filename="../src/powermanager.cpp" line="300"/>
<source>lock</source>
<translation></translation>
</message>
@ -2424,13 +2453,13 @@
<translation type="vanished"></translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="316"/>
<location filename="../src/powermanager.cpp" line="317"/>
<source>Log Out</source>
<translation></translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="334"/>
<location filename="../src/powermanager.cpp" line="673"/>
<location filename="../src/powermanager.cpp" line="335"/>
<location filename="../src/powermanager.cpp" line="676"/>
<source>Restart</source>
<translation></translation>
</message>
@ -2439,22 +2468,42 @@
<translation type="vanished"></translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="354"/>
<location filename="../src/powermanager.cpp" line="355"/>
<source>Power Off</source>
<translation></translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="694"/>
<location filename="../src/powermanager.cpp" line="674"/>
<source>Close all apps, turn off your computer, and then turn your computer back on</source>
<translation></translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="697"/>
<source>Close all apps, and then shut down your computer</source>
<translation></translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="700"/>
<source>Shut Down</source>
<translation></translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="722"/>
<location filename="../src/powermanager.cpp" line="729"/>
<source>Turn off your computer, but the app stays open. When the computer is turned on, it can be restored to the state you left</source>
<translation></translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="731"/>
<source>Hibernate</source>
<translation></translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="751"/>
<location filename="../src/powermanager.cpp" line="760"/>
<source>The computer stays on, but consumes less power. The app stays open and can quickly wake up and revert to where you left off</source>
<translation></translation>
</message>
<message>
<location filename="../src/powermanager.cpp" line="763"/>
<source>Suspend</source>
<translation></translation>
</message>
@ -2496,7 +2545,7 @@
<translation type="vanished">退</translation>
</message>
<message>
<location filename="../screensaver/screensaver.cpp" line="145"/>
<location filename="../screensaver/screensaver.cpp" line="167"/>
<source>Picture does not exist</source>
<translation></translation>
</message>
@ -2513,12 +2562,12 @@
<translation type="obsolete">%1</translation>
</message>
<message>
<location filename="../screensaver/screensaver.cpp" line="1374"/>
<location filename="../screensaver/screensaver.cpp" line="1461"/>
<source>You have new notification</source>
<translation></translation>
</message>
<message>
<location filename="../screensaver/screensaver.cpp" line="1205"/>
<location filename="../screensaver/screensaver.cpp" line="170"/>
<source>View</source>
<translation></translation>
</message>
@ -2548,12 +2597,12 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/surewindow.ui" line="157"/>
<location filename="../src/surewindow.ui" line="160"/>
<source>Cancel</source>
<translation></translation>
</message>
<message>
<location filename="../src/surewindow.ui" line="176"/>
<location filename="../src/surewindow.ui" line="179"/>
<source>Confirm</source>
<translation></translation>
</message>
@ -2562,22 +2611,22 @@
<translation type="vanished">退</translation>
</message>
<message>
<location filename="../src/surewindow.cpp" line="53"/>
<location filename="../src/surewindow.cpp" line="73"/>
<source>The following program is running to prevent the system from suspend!</source>
<translation></translation>
</message>
<message>
<location filename="../src/surewindow.cpp" line="56"/>
<location filename="../src/surewindow.cpp" line="76"/>
<source>The following program is running to prevent the system from hibernate!</source>
<translation></translation>
</message>
<message>
<location filename="../src/surewindow.cpp" line="50"/>
<location filename="../src/surewindow.cpp" line="70"/>
<source>The following program is running to prevent the system from shutting down!</source>
<translation></translation>
</message>
<message>
<location filename="../src/surewindow.cpp" line="47"/>
<location filename="../src/surewindow.cpp" line="67"/>
<source>The following program is running to prevent the system from reboot!</source>
<translation></translation>
</message>
@ -2664,7 +2713,7 @@
<context>
<name>VerificationWidget</name>
<message>
<location filename="../src/verificationwidget.cpp" line="55"/>
<location filename="../src/verificationwidget.cpp" line="72"/>
<source>Please scan by bound WeChat</source>
<translation>使</translation>
</message>
@ -2672,7 +2721,7 @@
<context>
<name>VerticalVerificationWidget</name>
<message>
<location filename="../src/verticalVerificationwidget.cpp" line="52"/>
<location filename="../src/verticalVerificationwidget.cpp" line="69"/>
<source>Please scan by bound WeChat</source>
<translation type="unfinished">使</translation>
</message>
@ -2740,7 +2789,7 @@
<context>
<name>delay</name>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="179"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="209"/>
<source>how long to show lock</source>
<translation type="unfinished"></translation>
</message>
@ -2748,7 +2797,7 @@
<context>
<name>has-lock</name>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="182"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="212"/>
<source>if show lock</source>
<translation type="unfinished"></translation>
</message>
@ -2762,8 +2811,8 @@
</message>
<message>
<location filename="../src/ukui-screensaver-command.cpp" line="48"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="166"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="168"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="196"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="198"/>
<source>lock the screen immediately</source>
<translation></translation>
</message>
@ -2788,53 +2837,53 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="160"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="190"/>
<source>Dialog for the ukui ScreenSaver.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="170"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="200"/>
<source>activated by session idle signal</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="172"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="176"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="202"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="206"/>
<source>lock the screen and show screensaver immediately</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="174"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="204"/>
<source>show screensaver immediately</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="178"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="208"/>
<source>show blank screensaver immediately and delay time to show lock</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ukui-screensaver-dialog.cpp" line="181"/>
<location filename="../src/ukui-screensaver-dialog.cpp" line="211"/>
<source>show blank screensaver immediately and if lock</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../screensaver/main.cpp" line="65"/>
<location filename="../screensaver/main.cpp" line="66"/>
<source>Screensaver for ukui-screensaver</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../screensaver/main.cpp" line="69"/>
<location filename="../screensaver/main.cpp" line="70"/>
<source>show on root window</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../screensaver/main.cpp" line="71"/>
<location filename="../screensaver/main.cpp" line="72"/>
<source>show on window.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../screensaver/main.cpp" line="72"/>
<location filename="../screensaver/main.cpp" line="73"/>
<source>window id</source>
<translation type="unfinished"></translation>
</message>

View File

@ -1,3 +1,4 @@
pkg_check_modules(KYSDKSYSTIME_PKG kysdk-systime)
pkg_check_modules(X11 REQUIRED x11)
pkg_check_modules(XTST REQUIRED xtst)
pkg_check_modules(QGS REQUIRED gsettings-qt)
@ -36,6 +37,7 @@ qt5_wrap_cpp(screensaver_SRC
cyclelabel.h
scconfiguration.h
sleeptime.h
videoplayer.h
../src/weathermanager.h
../src/networkwatcher.h
)
@ -48,11 +50,15 @@ set(screensaver_SRC
cyclelabel.cpp
scconfiguration.cpp
sleeptime.cpp
videoplayer.cpp
../src/weathermanager.cpp
../src/networkwatcher.cpp
)
add_executable(ukui-screensaver-default ${screensaver_SRC})
target_link_libraries(ukui-screensaver-default Qt5::Core Qt5::Widgets Qt5::X11Extras Qt5::Xml Qt5::Network ${EXTRA_LIBS})
target_include_directories(ukui-screensaver-default PRIVATE ${KYSDKSYSTIME_PKG_INCLUDE_DIRS})
target_link_directories(ukui-screensaver-default PRIVATE ${KYSDKSYSTIME_PKG_LIBRARY_DIRS})
target_link_libraries(ukui-screensaver-default Qt5::Core Qt5::Widgets Qt5::X11Extras Qt5::Xml Qt5::Network ${KYSDKSYSTIME_PKG_LIBRARIES} Qt5::Multimedia Qt5::MultimediaWidgets avformat avcodec ukui-log4qt ${EXTRA_LIBS})
qt5_add_resources(screensaver_Plugin_SRC
default.qrc
@ -65,6 +71,7 @@ qt5_wrap_cpp(screensaver_Plugin_SRC
cyclelabel.h
scconfiguration.h
sleeptime.h
videoplayer.h
../src/weathermanager.h
../src/networkwatcher.h
customplugin.h
@ -78,13 +85,16 @@ set(screensaver_Plugin_SRC
cyclelabel.cpp
scconfiguration.cpp
sleeptime.cpp
videoplayer.cpp
../src/weathermanager.cpp
../src/networkwatcher.cpp
customplugin.cpp
)
add_library(screensaver-default SHARED ${screensaver_Plugin_SRC})
target_link_libraries(screensaver-default Qt5::Core Qt5::Widgets Qt5::X11Extras Qt5::Xml Qt5::Network ${EXTRA_LIBS})
target_include_directories(screensaver-default PRIVATE ${KYSDKSYSTIME_PKG_INCLUDE_DIRS})
target_link_directories(screensaver-default PRIVATE ${KYSDKSYSTIME_PKG_LIBRARY_DIRS})
target_link_libraries(screensaver-default Qt5::Core Qt5::Widgets Qt5::X11Extras Qt5::Xml Qt5::Network ${KYSDKSYSTIME_PKG_LIBRARIES} Qt5::Multimedia Qt5::MultimediaWidgets avformat avcodec ${EXTRA_LIBS})
qt5_add_resources(Screensaver_SRC
default.qrc
@ -97,6 +107,7 @@ qt5_wrap_cpp(Screensaver_SRC
cyclelabel.h
scconfiguration.h
sleeptime.h
videoplayer.h
../src/weathermanager.h
../src/networkwatcher.h
)
@ -108,12 +119,15 @@ set(Screensaver_SRC
cyclelabel.cpp
scconfiguration.cpp
sleeptime.cpp
videoplayer.cpp
../src/weathermanager.cpp
../src/networkwatcher.cpp
)
add_library(Screensaver STATIC ${Screensaver_SRC})
target_link_libraries(Screensaver Qt5::Core Qt5::Widgets Qt5::X11Extras Qt5::Xml Qt5::Network ${EXTRA_LIBS})
target_include_directories(Screensaver PRIVATE ${KYSDKSYSTIME_PKG_INCLUDE_DIRS})
target_link_directories(Screensaver PRIVATE ${KYSDKSYSTIME_PKG_LIBRARY_DIRS})
target_link_libraries(Screensaver Qt5::Core Qt5::Widgets Qt5::X11Extras Qt5::Xml Qt5::Network ${KYSDKSYSTIME_PKG_LIBRARIES} Qt5::Multimedia Qt5::MultimediaWidgets avformat avcodec ${EXTRA_LIBS})
install(TARGETS
ukui-screensaver-default

View File

@ -17,6 +17,11 @@
**/
#include "customplugin.h"
#include "screensaver.h"
#include <QTranslator>
#include <QApplication>
#include <QDebug>
#define WORKING_DIRECTORY "/usr/share/ukui-screensaver"
CustomPlugin::CustomPlugin(QObject *parent):QObject(parent)
{
@ -30,6 +35,13 @@ QString CustomPlugin::name() const
QWidget* CustomPlugin::createWidget(bool isScreensaver,QWidget* parent)
{
//加载翻译文件
QString locale = QLocale::system().name();
QTranslator translator;
QString qmFile = QString(WORKING_DIRECTORY"/i18n_qm/%1.qm").arg(locale);
translator.load(qmFile);
qApp->installTranslator(&translator);
qDebug() << "load translation file " << qmFile;
return new Screensaver(isScreensaver,parent);
}

View File

@ -31,6 +31,7 @@
#include <sys/prctl.h>
#include <signal.h>
#include <syslog.h>
#include <ukui-log4qt.h>
#include "config.h"
@ -44,7 +45,8 @@ int main(int argc, char *argv[])
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
#endif
QApplication a(argc, argv);
prctl(PR_SET_PDEATHSIG, SIGHUP);
prctl(PR_SET_PDEATHSIG, SIGHUP);
initUkuiLog4qt("ukui-screensaver-default");
//加载翻译文件
QString locale = QLocale::system().name();
QTranslator translator;
@ -53,10 +55,9 @@ int main(int argc, char *argv[])
a.installTranslator(&translator);
qDebug() << "load translation file " << qmFile;
QCommandLineParser parser;
QString windowId;
Screensaver s(false);
Screensaver s(true);
XWindowAttributes xwa;
parser.setApplicationDescription("Test helper");

View File

@ -40,7 +40,8 @@ SCConfiguration::SCConfiguration(QObject *parent) :
ukgsettings(nullptr),
udgsettings(nullptr),
timegsettings(nullptr),
stygsettings(nullptr)
stygsettings(nullptr),
vdgsettings(nullptr)
{
initGsettings();
}
@ -62,6 +63,9 @@ void SCConfiguration::initGsettings()
if(QGSettings::isSchemaInstalled(GSETTINGS_SCHEMA_SCREENSAVER_DEFAULT))
udgsettings = new QGSettings(GSETTINGS_SCHEMA_SCREENSAVER_DEFAULT,"",this);
if(QGSettings::isSchemaInstalled(GSETTINGS_SCHEMA_SCREENSAVER_DEFAULT))
vdgsettings = new QGSettings(GSETTINGS_SCHEMA_SCREENSAVER_DEFAULT,"",this);
if(QGSettings::isSchemaInstalled(TIME_TYPE_SCHEMA))
timegsettings = new QGSettings(TIME_TYPE_SCHEMA,"",this);
@ -73,6 +77,8 @@ void SCConfiguration::initGsettings()
this, &SCConfiguration::onConfigurationChanged);
connect(ukgsettings, &QGSettings::changed,
this, &SCConfiguration::onConfigurationChanged);
connect(vdgsettings, &QGSettings::changed,
this, &SCConfiguration::onConfigurationChanged);
connect(timegsettings, &QGSettings::changed,
this, &SCConfiguration::onConfigurationChanged);
connect(stygsettings, &QGSettings::changed,
@ -317,3 +323,49 @@ QString SCConfiguration::getcurStyle()
}
return curStyle;
}
QString SCConfiguration::getVideoPath()
{
QString videoPath;
if(vdgsettings){
videoPath = vdgsettings->get("video-path").toString();
}
return videoPath;
}
QString SCConfiguration::getVideoFormat()
{
QString videoFormat;
if(vdgsettings){
videoFormat = vdgsettings->get("video-format").toString();
}
return videoFormat;
}
int SCConfiguration::getVideoSize()
{
int videoSize;
if(vdgsettings){
videoSize = vdgsettings->get("video-size").toInt();
}
return videoSize;
}
int SCConfiguration::getVideoWidth()
{
int videoWidth;
if(vdgsettings){
videoWidth = vdgsettings->get("video-width").toInt();
}
return videoWidth;
}
int SCConfiguration::getVideoHeight()
{
int videoHeight;
if(vdgsettings){
videoHeight = vdgsettings->get("video-height").toInt();
}
return videoHeight;
}

View File

@ -52,6 +52,11 @@ public:
int getMessageNumber(); //获取消息数量
int getBlurNumber();
QString getcurStyle();
QString getVideoPath();
QString getVideoFormat();
int getVideoSize();
int getVideoWidth();
int getVideoHeight();
public:
public Q_SLOTS:
@ -82,6 +87,7 @@ private:
QGSettings *udgsettings;
QGSettings *timegsettings;
QGSettings *stygsettings;
QGSettings *vdgsettings;
static SCConfiguration *instance_;
};

View File

@ -58,8 +58,14 @@
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include "commonfunc.h"
#include "config.h"
extern "C" {
#include "libavformat/avformat.h"
#include "libavcodec/avcodec.h"
}
#define TIME_TYPE_SCHEMA "org.ukui.control-center.panel.plugins"
#define THEME_TYPE_SCHENA "org.ukui.style"
@ -68,6 +74,7 @@
#define KEY_MESSAGE_SHOW_ENABLED "show-message-enabled"
#define KEY_HOURSYSTEM "hoursystem"
#define KEY_DATE_FORMAT "date"
#define WORKING_DIRECTORY "/usr/share/ukui-screensaver"
QTime Screensaver::m_currentTime = QTime::currentTime();
extern bool bControlFlg;
@ -116,6 +123,13 @@ Screensaver::Screensaver(bool isscreensaver,QWidget *parent):
isUShowRestTime = configuration->getUShowRestTime();
curFontSize = configuration->getFontSize();
m_ptToPx = configuration->getPtToPx();
videoPath = configuration->getVideoPath();
videoFormat = configuration->getVideoFormat();
videoSize = configuration->getVideoSize();
videoWidth = configuration->getVideoWidth();
videoHeight = configuration->getVideoHeight();
initUI();
m_background = new MBackground();
@ -145,7 +159,7 @@ Screensaver::Screensaver(bool isscreensaver,QWidget *parent):
screenLabel->setText(tr("Picture does not exist"));
screenLabel->adjustSize();
screenLabel->hide();
m_strPreViewTrans = tr("View");
}
Screensaver::~Screensaver()
@ -213,6 +227,8 @@ void Screensaver::connectSingles()
void Screensaver::onBlurNumChanged(int num)
{
if (m_isDynamicSaver)
return ;
blur_Num = num;
if(curStyle == "ukui-dark" || curStyle == "ukui-black"){
myTextLabel->setStyleSheet(QString("QLabel{background: rgba(0, 0, 0, %1); color:#FFFFFF; border-radius:16px}").arg(blur_Num * 0.01));
@ -225,6 +241,9 @@ void Screensaver::onBlurNumChanged(int num)
void Screensaver::onStyleChanged(QString style)
{
if (m_isDynamicSaver)
return ;
curStyle = style;
if(curStyle == "ukui-dark" || curStyle == "ukui-black"){
myTextLabel->setStyleSheet(QString("QLabel{background: rgba(0, 0, 0, %1); color:#FFFFFF; border-radius:16px}").arg(blur_Num * 0.01));
@ -262,7 +281,7 @@ void Screensaver::onMessageShowEnabledChanged(bool enabled)
void Screensaver::autoSwitchChanged(bool isSwitch)
{
if(!isCustom)
if(!isCustom || m_isDynamicSaver)
return ;
isAutoSwitch = isSwitch;
if(!isSwitch){
@ -277,7 +296,7 @@ void Screensaver::autoSwitchChanged(bool isSwitch)
void Screensaver::backgroundPathChanged(QString path)
{
backgroundPath = path;
if(!isCustom)
if(!isCustom || m_isDynamicSaver)
return ;
updateBackgroundPath();//更新图片路径
stopSwitchImages();
@ -287,7 +306,7 @@ void Screensaver::backgroundPathChanged(QString path)
void Screensaver::cycleTimeChanged(int cTime)
{
cycleTime = cTime;
if(!isCustom || !autoSwitch)
if(!isCustom || !autoSwitch || m_isDynamicSaver)
return ;
stopSwitchImages();
startSwitchImages();
@ -295,7 +314,7 @@ void Screensaver::cycleTimeChanged(int cTime)
void Screensaver::myTextChanged(QString text)
{
if(!isCustom)
if(!isCustom || m_isDynamicSaver)
return ;
myText = text;
@ -330,7 +349,7 @@ void Screensaver::myTextChanged(QString text)
void Screensaver::showCRestTimeChanged(bool isShow)
{
isCShowRestTime = isShow;
if(!isCustom)
if(!isCustom || m_isDynamicSaver)
return;
setSleeptime(isCShowRestTime);
@ -339,7 +358,7 @@ void Screensaver::showCRestTimeChanged(bool isShow)
void Screensaver::showURestTimeChanged(bool isShow)
{
isUShowRestTime = isShow;
if(isCustom)
if(isCustom || m_isDynamicSaver)
return;
setSleeptime(isUShowRestTime);
@ -348,7 +367,7 @@ void Screensaver::showURestTimeChanged(bool isShow)
void Screensaver::textIsCenterChanged(bool isCenter)
{
textIsCenter = isCenter;
if(!isCustom)
if(!isCustom || m_isDynamicSaver)
return ;
if(isCenter){
@ -408,7 +427,9 @@ void Screensaver::paintEvent(QPaintEvent *event)
painter.setBrush(cor);
painter.drawRect(-1,-1,this->width()+1,this->height()+1);
} else {
painter.drawPixmap(0,0,this->width(),this->height(), getPaddingPixmap());
painter.setRenderHint(QPainter::Antialiasing);
painter.setRenderHint(QPainter::SmoothPixmapTransform);
painter.drawPixmap(this->rect(), background, background.rect());
QPainterPath path;
QPainter painter1(this);
painter1.setOpacity(0.25);
@ -497,10 +518,16 @@ QPixmap Screensaver::getPaddingPixmap()
void Screensaver::addClickedEvent(){
respondClick = true;
isScreensaver = false;
}
void Screensaver::resizeEvent(QResizeEvent */*event*/)
{
if (m_isDynamicSaver) {
playerView->setFixedSize(this->size());
playerItem->setSize(this->size());
return;
}
float scale = 1.0;
scale = (float)width()/1920;
if((width() < 600 || height()<400) && !isScreensaver){//当显示在控制面板上时,字体缩小三倍。
@ -877,19 +904,69 @@ void Screensaver::initUI()
connect(m_weatherManager, &WeatherManager::onWeatherUpdate,
this, &Screensaver::getWeatherFinish);
#else
if(isCustom)
setSleeptime(isCShowRestTime);
else
setSleeptime(isUShowRestTime);
setDatelayout();
setCenterWidget();
setRandomText();
if(textIsCenter || myText == ""){
myTextWidget->hide();
centerWidget->show();
}else{
centerWidget->hide();
myTextWidget->show();
qDebug() << "videoPath = " << videoPath << "videoSize = " << videoSize << "videoFormat = " << videoFormat;
QFileInfo fileInfo(videoPath);
//视频文件是否存在
if (fileInfo.isFile()) {
//视频文件大小限制
if (fileInfo.size() <= videoSize * 1024 * 1024) {
getVideoFormat(videoPath);
QStringList formatList = videoFormat.split(',');
//视频格式限制
bool m_rightFormat = false;
for (int formatAt = 0; formatAt < formatList.count(); formatAt++) {
if (cur_video_format.contains(formatList.at(formatAt))) {
m_rightFormat = true;
break;
}
}
if (m_rightFormat) {
//分辨率限制
if (cur_video_Width <= videoWidth && cur_video_Height <= videoHeight) {
m_isDynamicSaver = true;
} else {
qInfo() << "High video resolution!!! resolution = " << cur_video_Width << "x" << cur_video_Height;
}
} else {
qInfo() << "The video format is not supported!!! format = " << cur_video_format << "video_Codetype = " << video_Codetype;
}
} else {
qInfo() << "Video file too large!!!" ;
}
} else {
qInfo() << "The video file does not exist!!!";
}
if (m_isDynamicSaver) {
m_pVideoPlayer = new VideoPlayer();
playerScene = new QGraphicsScene(this);
playerView = new QGraphicsView(this);
playerView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
playerView->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
playerView->setStyleSheet("border: none; border-radius: 0px;");
playerItem = new QGraphicsVideoItem;
playerScene->addItem(playerItem);
m_pVideoPlayer->setMediaFile(videoPath);
playerView->setScene(playerScene);
m_pVideoPlayer->setOutput(playerItem, video_Duration);
playerView->show();
} else {
if (isCustom)
setSleeptime(isCShowRestTime);
else
setSleeptime(isUShowRestTime);
setDatelayout();
setCenterWidget();
setRandomText();
if(centerWidget) {
if (textIsCenter || myText == "") {
myTextWidget->hide();
centerWidget->show();
}else{
centerWidget->hide();
myTextWidget->show();
}
}
}
#endif
}
@ -971,12 +1048,12 @@ void Screensaver::setDatelayout()
this->dateOfLocaltime = new QLabel(this);
sysFont= qApp->font();
sysFont.setPointSize((58 + curFontSize) *m_ptToPx);
sysFont.setPointSize((36 + curFontSize) *m_ptToPx);
this->dateOfLocaltime->setFont(sysFont);
if(timeType == 12)
this->dateOfLocaltime->setText(QDateTime::currentDateTime().toString("A hh:mm"));
this->dateOfLocaltime->setText(getLongFormatDate(TIME));
else
this->dateOfLocaltime->setText(QDateTime::currentDateTime().toString("hh:mm"));
this->dateOfLocaltime->setText(getLongFormatDate(TIME));
this->dateOfLocaltime->setObjectName("dateOfLocaltime");
this->dateOfLocaltime->setAlignment(Qt::AlignCenter);
@ -984,12 +1061,13 @@ void Screensaver::setDatelayout()
vtimeLayout->addWidget(dateOfLocaltime);
this->dateOfDay = new QLabel(this);
sysFont.setPointSize((16 + curFontSize) *m_ptToPx);
sysFont.setPointSize((18 + curFontSize) *m_ptToPx);
this->dateOfDay->setFont(sysFont);
if(dateType == "cn")
this->dateOfDay->setText(QDate::currentDate().toString("yyyy/MM/dd ddd").replace("","星期"));
else
this->dateOfDay->setText(QDate::currentDate().toString("yyyy-MM-dd ddd").replace("","星期"));
// if(dateType == "cn")
// this->dateOfDay->setText(QDate::currentDate().toString("yyyy/MM/dd ddd").replace("周","星期"));
// else
// this->dateOfDay->setText(QDate::currentDate().toString("yyyy-MM-dd ddd").replace("周","星期"));
this->dateOfDay->setText(getLongFormatDate(DATE));
this->dateOfDay->setObjectName("dateOfDay");
this->dateOfDay->setAlignment(Qt::AlignCenter);
this->dateOfDay->adjustSize();
@ -1098,14 +1176,15 @@ void Screensaver::updateTime()
QDateTime curDateTime = QDateTime::currentDateTime();
if (m_lastDateTime.isNull() || qAbs(curDateTime.secsTo(m_lastDateTime)) >=1) {
if(timeType == 12)
this->dateOfLocaltime->setText(curDateTime.toString("A hh:mm"));
this->dateOfLocaltime->setText(getLongFormatDate(TIME));
else
this->dateOfLocaltime->setText(curDateTime.toString("hh:mm"));
this->dateOfLocaltime->setText(getLongFormatDate(TIME));
if(dateType == "cn")
this->dateOfDay->setText(curDateTime.date().toString("yyyy/MM/dd ddd").replace("","星期"));
else
this->dateOfDay->setText(curDateTime.date().toString("yyyy-MM-dd ddd").replace("","星期"));
// if(dateType == "cn")
// this->dateOfDay->setText(curDateTime.date().toString("yyyy/MM/dd ddd").replace("周","星期"));
// else
// this->dateOfDay->setText(curDateTime.date().toString("yyyy-MM-dd ddd").replace("周","星期"));
this->dateOfDay->setText(getLongFormatDate(DATE));
m_lastDateTime = curDateTime;
}
@ -1202,7 +1281,7 @@ void Screensaver::setPreviewText(bool bVisible)
myPreviewLabel->setAlignment(Qt::AlignCenter);
}
myPreviewLabel->setText(tr("View"));
myPreviewLabel->setText(m_strPreViewTrans);
myPreviewLabel->adjustSize();
myPreviewLabel->setVisible(bVisible);
@ -1400,6 +1479,70 @@ QPixmap Screensaver::loadFromFile(QString strPath)
reader.setDecideFormatFromContent(true);
return QPixmap::fromImageReader(&reader);
}
void Screensaver::getVideoFormat(QString fileName)
{
char* ch;
QByteArray ba = fileName.toLatin1();
ch=ba.data();
int ret;
int streams;
char buf[256];
AVFormatContext *fmt_ctx = NULL;
AVCodecContext *avctx = NULL;
AVInputFormat *fmt = NULL;
ret = avformat_open_input(&fmt_ctx, ch, fmt, NULL);
if (ret < 0)
{
return ;
}
//获取封装格式
cur_video_format = fmt_ctx->iformat->name;
//通过上下文获取视频时长
video_Duration = fmt_ctx->duration / 1000;
//获取视频帧率fps
const AVStream *stream = fmt_ctx->streams[0];
double fps = av_q2d(stream->avg_frame_rate);
//获取视频编码类型(h264/h265)
avctx = avcodec_alloc_context3(NULL);
ret = avcodec_parameters_to_context(avctx, stream->codecpar);
video_Codetype = avcodec_get_name(avctx->codec_id);
//获取视频的分辨率
cur_video_Width = (avctx->width >= avctx->height ? avctx->width : avctx->height);
cur_video_Height = (avctx->width >= avctx->height ? avctx->height : avctx->width);
avcodec_free_context(&avctx);
//关闭上下文
avformat_close_input(&fmt_ctx);
return ;
}
QString Screensaver::getLongFormatDate(int type)
{
kdk_logn_dateinfo *dateInfo = kdk_system_login_lock_dateinfo(getenv("USER"));
if (type == DATE) {
QString date = dateInfo->date;
QString week = dateInfo->week;
if (dateInfo) {
kdk_free_logn_dateinfo(dateInfo);
}
return date + " " + week;
} else if (type == TIME) {
QString time = dateInfo->time;
if (dateInfo) {
kdk_free_logn_dateinfo(dateInfo);
}
return time;
}
}
/*
void Screensaver::setDesktopBackground()
{

View File

@ -30,6 +30,7 @@
#include <QSplitterHandle>
#include <QSplitter>
#include <QTime>
#include <libkydate.h>
#include "sleeptime.h"
#include "chinesedate.h"
@ -37,8 +38,14 @@
#include "checkbutton.h"
#include "scconfiguration.h"
#include "cyclelabel.h"
#include "videoplayer.h"
class WeatherManager;
class WeatherManager;
enum dateinfo {
DATE,
TIME,
};
class Screensaver : public QWidget
{
@ -71,6 +78,8 @@ private:
void leaveEvent(QEvent*);
void isMovie();
QPixmap loadFromFile(QString strPath);
void getVideoFormat(QString fileName);//获取视频格式(视频格式、编码格式、分辨率)
QString getLongFormatDate(int type);
QTimer *switchTimer;
QTimer *fadeTimer;
@ -159,7 +168,25 @@ private:
QTimer *movieTimer = nullptr;
int currentCount = 0;
QDateTime m_lastDateTime;
bool isScreensaver = false;
bool isScreensaver = false;
QString m_strPreViewTrans;
//动态屏保
bool m_isDynamicSaver = false;
VideoPlayer *m_pVideoPlayer;
QGraphicsScene *playerScene;
QGraphicsView *playerView;
QGraphicsVideoItem *playerItem;
int video_Duration = 0;
QString cur_video_format;
QString video_Codetype;
int cur_video_Width;
int cur_video_Height;
QString videoPath;
QString videoFormat;
int videoSize;
int videoWidth;
int videoHeight;
protected:
void paintEvent(QPaintEvent *event);
void resizeEvent(QResizeEvent *event);

View File

@ -150,7 +150,7 @@ void SleepTime::setMinute(int minutes)
void SleepTime::setSmallMode()
{
for(int i = 0;i<5;i++)
list.at(i)->setFixedSize(8,8);
list.at(i)->setFixedSize(10,10);
adjustSize();
}

129
screensaver/videoplayer.cpp Normal file
View File

@ -0,0 +1,129 @@
#include "videoplayer.h"
#include <QDir>
#include <QTimer>
VideoPlayer::VideoPlayer(QWidget *parent) :
QWidget(parent)
{
player = new QMediaPlayer(this);
connect(player, &QMediaPlayer::positionChanged,
this, &VideoPlayer::updatePosition);
connect(player, &QMediaPlayer::mediaStatusChanged,
this, &VideoPlayer::mediaStatusChanged);
connect(player, static_cast<void(QMediaPlayer::*)(QMediaPlayer::Error)>
(&QMediaPlayer::error), this, &VideoPlayer::showError);
}
VideoPlayer::~VideoPlayer()
{
if(player != nullptr)
{
player->stop();
player->deleteLater();
player = nullptr;
}
}
void VideoPlayer::setOutput(QGraphicsVideoItem *videoWidget, int duration)
{
video_Duration = duration;
player->setVideoOutput(videoWidget);
player->setMuted(true); //视频静音
player->setPosition(1); //避免首次打开视频是黑屏
player->play();
}
void VideoPlayer::setMediaFile(QString filePath)
{
m_filePath = filePath;
player->setMedia(QMediaContent(QUrl::fromLocalFile(filePath)));
}
void VideoPlayer::updatePosition(qint64 position)
{
//因为用wps制作的视频用qmediaplayer去获取视频时长有问题会在视频最后一帧停留很长时间所以用ffmpeg获取视频时长手动循环播放视频
qDebug() << "position =" << position << "player->duration() = " << player->duration() << "duration = " << video_Duration;
if (video_Duration || player->duration()) {
if (position && position > (video_Duration > 0 ? video_Duration : player->duration())) {
player->setMedia(QMediaContent(QUrl::fromLocalFile(m_filePath)));
player->setPosition(1);
player->play();
} else if (position == 0 && player->duration()) { //有些wps做的视频播放到最后一帧会自己跳到0
player->setMedia(QMediaContent(QUrl::fromLocalFile(m_filePath)));
player->setPosition(1);
player->play();
} else if (position && position == video_Duration) {//视频当前播放帧数 = 视频总时长
player->setMedia(QMediaContent(QUrl::fromLocalFile(m_filePath)));
player->setPosition(1);
player->play();
}
}
}
void VideoPlayer::mediaStatusChanged(QMediaPlayer::MediaStatus status)
{
switch (status) {
case QMediaPlayer::UnknownMediaStatus:
qDebug() << "UnknownMediaStatus!!!" ;
break;
case QMediaPlayer::NoMedia:
qDebug() << "NoMedia!!!" ;
break;
case QMediaPlayer::BufferingMedia:
qDebug() << "BufferingMedia!!!" ;
break;
case QMediaPlayer::BufferedMedia:
qDebug() << "The player has fully buffered the current media!!!" ;
break;
case QMediaPlayer::LoadingMedia:
qDebug() << "LoadingMedia!!!" ;
break;
case QMediaPlayer::StalledMedia:
qDebug() << "StalledMedia!!!" ;
break;
case QMediaPlayer::EndOfMedia:
qDebug() << "EndOfMedia!!!" ;
// player->setPosition(0);
// player->play();
break;
case QMediaPlayer::LoadedMedia:
qDebug() << "LoadedMedia!!!" ;
break;
case QMediaPlayer::InvalidMedia:
qDebug() << "InvalidMedia!!!" ;
break;
default: break;
}
}
void VideoPlayer::showError(QMediaPlayer::Error error)
{
switch (error) {
case QMediaPlayer::NoError:
qDebug() << "没有错误!" ;
break;
case QMediaPlayer::ResourceError:
qDebug() << "媒体资源无法被解析!";
break;
case QMediaPlayer::FormatError:
qDebug() << "不支持该媒体格式!";
break;
case QMediaPlayer::NetworkError:
qDebug() << "发生了一个网络错误!";
break;
case QMediaPlayer::AccessDeniedError:
qDebug() << "没有播放权限!";
break;
case QMediaPlayer::ServiceMissingError:
qDebug() << "没有发现有效的播放服务!";
break;
default: break;
}
}

33
screensaver/videoplayer.h Normal file
View File

@ -0,0 +1,33 @@
#ifndef VIDEOPLAYER_H
#define VIDEOPLAYER_H
#include <QWidget>
#include <QMediaPlayer>
#include <QGraphicsView>
#include <QGraphicsVideoItem>
class VideoPlayer : public QWidget
{
Q_OBJECT
public:
explicit VideoPlayer(QWidget *parent = 0);
~VideoPlayer();
void setOutput(QGraphicsVideoItem *videoWidget, int duration);
void setMediaFile(QString filePath);
private:
QMediaPlayer *player;
int video_Duration = 0;
QString m_filePath;
private slots:
void updatePosition(qint64 position);
void mediaStatusChanged(QMediaPlayer::MediaStatus status);
void showError(QMediaPlayer::Error error);
private:
int playerFlag = 0;
};
#endif // VIDEOPLAYER_H

View File

@ -1,5 +1,5 @@
find_package(X11 REQUIRED)
pkg_check_modules(KYSDKSYSTIME_PKG kysdk-systime)
pkg_check_modules(XTST REQUIRED xtst)
pkg_check_modules(XCB REQUIRED xcb)
pkg_check_modules(QGS REQUIRED gsettings-qt)
@ -91,6 +91,7 @@ qt5_wrap_cpp(dialog_SRC
hoverwidget.h
displaymanager.h
iconedit.h
iconbutton.h
imageutil.h
powermanager.h
logind.h
@ -113,7 +114,12 @@ qt5_wrap_cpp(dialog_SRC
servicemanager.h
mytabwidget.h
modebutton.h
iconbutton.h
klabel.h
greeterservice.h
loginplugininterface.h
loginauthinterface.h
pluginsloader.h
PhysicalDeviceSet/brightnessdeviceset.h
PhysicalDeviceSet/flightmodeset.h
PhysicalDeviceSet/sounddeviceset.h
@ -145,6 +151,7 @@ set(dialog_SRC
utils.cpp
users.cpp
displaymanager.cpp
iconbutton.cpp
iconedit.cpp
imageutil.cpp
logind.cpp
@ -167,8 +174,11 @@ set(dialog_SRC
servicemanager.cpp
mytabwidget.cpp
modebutton.cpp
iconbutton.cpp
klabel.cpp
greeterservice.cpp
rootWindowBackground.cpp
pluginsloader.cpp
PhysicalDeviceSet/brightnessdeviceset.cpp
PhysicalDeviceSet/flightmodeset.cpp
PhysicalDeviceSet/sounddeviceset.cpp
@ -181,7 +191,8 @@ set(dialog_SRC
)
add_executable(ukui-screensaver-dialog ${dialog_SRC})
add_definitions(-DAPP_API_MAJOR=0 -DAPP_API_MINOR=11 -DAPP_API_FUNC=0)
target_include_directories(ukui-screensaver-dialog PRIVATE ${KYSDKSYSTIME_PKG_INCLUDE_DIRS})
target_link_directories(ukui-screensaver-dialog PRIVATE ${KYSDKSYSTIME_PKG_LIBRARY_DIRS})
target_link_libraries(ukui-screensaver-dialog
Qt5::Core
Qt5::Widgets
@ -189,6 +200,8 @@ target_link_libraries(ukui-screensaver-dialog
Qt5::Svg
Qt5::X11Extras
Qt5::Network
Qt5::Widgets
${KYSDKSYSTIME_PKG_LIBRARIES}
${EXTRA_LIBS}
BiometricAuth
VirtualKeyboard
@ -199,6 +212,8 @@ target_link_libraries(ukui-screensaver-dialog
opencv_imgcodecs
opencv_imgproc
opencv_core
LayerShellQt::Interface
-ldl
)
link_libraries(libmatemixer.so glib-2.0.so)

View File

@ -113,6 +113,7 @@
<file>assets/ukui-loginopt-face.svg</file>
<file>assets/ukui-loginopt-password.svg</file>
<file>assets/ukui-loginopt-ukey.svg</file>
<file>assets/ukui-loginopt-custom.svg</file>
<file>assets/selected.svg</file>
<file>assets/keyboard.svg</file>
<file>assets/ukui-loginopt-smile.svg</file>

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_2" opacity="0.8" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
x="0px" y="0px" viewBox="0 0 16 16" style="enable-background:new 0 0 16 16;" xml:space="preserve">
<style type="text/css">
.st0{fill:none;stroke:#1F2022;stroke-linecap:round;stroke-miterlimit:10;}
.st1{fill:#1F2022;}
.st2{fill:none;stroke:#1F2022;stroke-miterlimit:10;}
</style>
<path class="st0" d="M13.5,7.5c1.1,0,2,0.9,2,2v3c0,1.1-0.9,2-2,2h-11c-1.1,0-2-0.9-2-2v-3c0-1.1,0.9-2,2-2"/>
<circle class="st1" cx="12" cy="12" r="1"/>
<circle class="st1" cx="8" cy="12" r="1"/>
<circle class="st1" cx="4" cy="12" r="1"/>
<g>
<path class="st1" d="M11,5v4H5V5H11 M11,4H5C4.4,4,4,4.4,4,5v4c0,0.6,0.4,1,1,1h6c0.6,0,1-0.4,1-1V5C12,4.4,11.6,4,11,4L11,4z"/>
</g>
<path class="st2" d="M5.5,4.8V4c0-1.4,1.1-2.5,2.5-2.5h0c1.4,0,2.5,1.1,2.5,2.5v0.8"/>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -1 +1 @@
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M13.58,9H13V7.15A1.16,1.16,0,0,0,11.85,6h-1.7A1.16,1.16,0,0,0,9,7.15V9H8.42A1.43,1.43,0,0,0,7,10.42v3.16A1.43,1.43,0,0,0,8.42,15h5.16A1.43,1.43,0,0,0,15,13.58V10.42A1.43,1.43,0,0,0,13.58,9ZM10,7.15A.15.15,0,0,1,10.15,7h1.7a.15.15,0,0,1,.15.15V9H10Zm4,6.43a.42.42,0,0,1-.42.42H8.42A.42.42,0,0,1,8,13.58V10.42A.42.42,0,0,1,8.42,10h5.16a.42.42,0,0,1,.42.42Z" fill="#262626"/><path d="M12.16,4.53a.65.65,0,0,1,.34-.11.54.54,0,0,1,.22,0,.61.61,0,0,1,.41.58s0,0,0,.06a1.68,1.68,0,0,1,.38,1h0A1.45,1.45,0,0,0,14,5.05a1.5,1.5,0,0,0-2.89-.55h.74A1.63,1.63,0,0,1,12.16,4.53Z" fill="#262626"/><path d="M6.53,6.92A1.47,1.47,0,0,1,7,6.65a1.3,1.3,0,0,1,1,0,1.31,1.31,0,0,1,.36.21c0-.06.1-.1.14-.15V6.15a2,2,0,0,1,0-.35A2,2,0,0,0,8,5.61V3.46A1.49,1.49,0,0,0,9,2.05a1.5,1.5,0,1,0-3,0A1.49,1.49,0,0,0,7,3.46V5.61a2.45,2.45,0,0,0-1.36.79L4,5.43a1.58,1.58,0,0,0,0-.38,1.5,1.5,0,1,0-1.5,1.5,1.53,1.53,0,0,0,.89-.29l1.75,1A2.56,2.56,0,0,0,5,8.05a2.57,2.57,0,0,0,.14.79l-1.75,1a1.54,1.54,0,0,0-.89-.3A1.5,1.5,0,1,0,4,11.05a1.57,1.57,0,0,0,0-.37l1.69-1a2.57,2.57,0,0,0,.39.35,2.46,2.46,0,0,1,.4-1A1.42,1.42,0,0,1,6,8.33a1.27,1.27,0,0,1,0-.28,1.24,1.24,0,0,1,0-.27A1.51,1.51,0,0,1,6.53,6.92Zm.34-4.87A.62.62,0,0,1,7,1.68a.8.8,0,0,1,.13-.13.59.59,0,0,1,.74,0A.8.8,0,0,1,8,1.68a.62.62,0,0,1,.13.37A.62.62,0,0,1,8,2.43a.61.61,0,0,1-1,0A.62.62,0,0,1,6.87,2.05ZM2.5,5.69l-.15,0A.68.68,0,0,1,2,5.48a.65.65,0,0,1-.16-.43.61.61,0,0,1,.41-.58.54.54,0,0,1,.22,0,.62.62,0,0,1,.61.52.52.52,0,0,1,0,.11A.64.64,0,0,1,2.5,5.69Zm.61,5.48a.62.62,0,0,1-.61.52.54.54,0,0,1-.22,0,.61.61,0,0,1-.41-.59A.65.65,0,0,1,2,10.63a.68.68,0,0,1,.32-.18l.15,0a.63.63,0,0,1,.63.63A.5.5,0,0,1,3.11,11.17Z" fill="#262626"/></svg>
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M4.5,5A2.5,2.5,0,0,1,7,7.14L7,7.5l0,.36A2.49,2.49,0,1,1,4.5,5m0-1A3.5,3.5,0,1,0,8,8h6.58A.47.47,0,0,0,15,7.53V7.47A.47.47,0,0,0,14.53,7H8A3.49,3.49,0,0,0,4.5,4Z" fill="#262626"/><rect x="9" y="7" width="1" height="3" rx="0.5" fill="#262626"/><rect x="12" y="7" width="1" height="3" rx="0.5" fill="#262626"/></svg>

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 417 B

View File

@ -27,6 +27,11 @@
#include <QBitmap>
#include <QFont>
#include <QIcon>
#include <QJsonValue>
#include <QJsonObject>
#include <QJsonDocument>
#include <QJsonArray>
#include <QJsonParseError>
#include "users.h"
#include "iconedit.h"
@ -39,6 +44,7 @@
#include "uniauthservice.h"
#include "imageutil.h"
#include "klabel.h"
#include "loginauthinterface.h"
AuthDialog::AuthDialog(const UserItem &user, QWidget *parent) :
QWidget(parent),
@ -258,6 +264,13 @@ void AuthDialog::initUI()
font.setPointSize((14 + curFontSize) *m_ptToPx);
m_messageButton->setFont(font);
m_messageButton->hide();
m_customWidget = new QWidget(this);
m_layoutCustom = new QHBoxLayout();
m_layoutCustom->setSpacing(0);
m_layoutCustom->setContentsMargins(0,0,0,0);
m_customWidget->setLayout(m_layoutCustom);
m_customWidget->hide();
}
@ -300,7 +313,7 @@ void AuthDialog::updateLoadingPixmap()
m_loadingButton->setIcon(QIcon(m_loadingPixmap));
}
void AuthDialog::unlock_countdown()
bool AuthDialog::unlock_countdown()
{
int failed_count = 0;
int time_left = 0;
@ -329,7 +342,7 @@ void AuthDialog::unlock_countdown()
m_passwordEdit->readOnly(true);
m_passwordEdit->setLocked(true);
isLockingFlg = true;
return ;
return true;
}
else if(time_left > 0 && time_left < 60)//请多少秒后重试
{
@ -339,7 +352,7 @@ void AuthDialog::unlock_countdown()
m_passwordEdit->readOnly(true);
m_passwordEdit->setLocked(true);
isLockingFlg = true;
return ;
return true;
}
else if (failed_count == 0xFFFF)//账号被永久锁定
{
@ -349,7 +362,7 @@ void AuthDialog::unlock_countdown()
m_passwordEdit->readOnly(true);
m_passwordEdit->setLocked(true);
isLockingFlg = true;
return ;
return true;
}
else
{
@ -365,10 +378,10 @@ void AuthDialog::unlock_countdown()
isLockingFlg = false;
m_passwordEdit->setLocked(false);
}
m_timer->stop();
if (m_timer)
m_timer->stop();
}
return ;
return false;
}
void AuthDialog::root_unlock_countdown()
@ -431,8 +444,8 @@ void AuthDialog::root_unlock_countdown()
onShowMessage("",Auth::MessageTypeError);
isLockingFlg = false;
}
m_timer->stop();
if (m_timer)
m_timer->stop();
}
return ;
}
@ -451,9 +464,9 @@ void AuthDialog::setChildrenGeometry()
width(), 376*scale);
m_labelLoginTypeTip->setGeometry(0,0,m_userWidget->width(), 30);
m_labelLoginTypeTip->setAlignment(Qt::AlignCenter);
m_labelLoginTypeTip->setText(m_labelLoginTypeTip->text());
m_labelHeadImg->setStyleSheet(QString("border-radius: %1px; border:0px solid white;").arg((int)(77*scale)));
m_labelHeadImg->setGeometry((width() - 154*scale) / 2 , m_labelLoginTypeTip->geometry().bottom()+24*scale, 154*scale, 154*scale);
QPixmap facePixmap = makeRoundLogo(user.icon, 154*scale, 154*scale, 77*scale);
m_labelHeadImg->setPixmap(facePixmap);
@ -490,6 +503,8 @@ void AuthDialog::setChildrenGeometry()
// "QPushButton:!checked:!pressed:hover{background-color: rgba(255,255,255,100)}"
// "QPushButton:pressed{background-color: rgba(255,255,255,40)}");
m_customWidget->setGeometry(0, 0,
width(), 376*scale+100);
setBiometricWidgetGeometry();
}
@ -500,19 +515,23 @@ void AuthDialog::switchLoginOptType(unsigned uLoginOptType)
switch(uLoginOptType) {
case LOGINOPT_TYPE_PASSWORD:
{
m_userWidget->show();
m_labelHeadImg->show();
m_labelQRCode->hide();
m_labelFace->hide();
m_passwdWidget->show();
m_customWidget->hide();
m_ukeyPasswdWidget->hide();
}
break;
case LOGINOPT_TYPE_FACE:
{
m_userWidget->show();
m_labelHeadImg->hide();
m_labelQRCode->hide();
m_labelFace->show();
m_passwdWidget->show();
m_customWidget->hide();
m_ukeyPasswdWidget->hide();
}
break;
@ -521,33 +540,67 @@ void AuthDialog::switchLoginOptType(unsigned uLoginOptType)
case LOGINOPT_TYPE_FINGERVEIN:
case LOGINOPT_TYPE_IRIS:
{
m_userWidget->show();
m_labelHeadImg->show();
m_labelQRCode->hide();
m_labelFace->hide();
m_passwdWidget->show();
m_customWidget->hide();
m_ukeyPasswdWidget->hide();
}
break;
case LOGINOPT_TYPE_QRCODE:
{
m_userWidget->show();
m_labelHeadImg->hide();
setQRCodeMsg("");
m_labelQRCode->show();
m_labelFace->hide();
m_passwdWidget->show();
m_customWidget->hide();
m_ukeyPasswdWidget->hide();
}
break;
case LOGINOPT_TYPE_GENERAL_UKEY:
{
m_userWidget->show();
m_labelHeadImg->show();
m_labelQRCode->hide();
m_labelFace->hide();
m_passwdWidget->hide();
m_customWidget->hide();
m_ukeyPasswdWidget->show();
// setFocusProxy(m_ukeyPasswordEdit);
// m_ukeyPasswordEdit->setFocusPolicy(Qt::StrongFocus);
// m_ukeyPasswordEdit->setFocus();
}
break;
case LOGINOPT_TYPE_CUSTOM:
{
m_userWidget->hide();
m_passwdWidget->hide();
m_labelHeadImg->hide();
setQRCodeMsg("");
m_labelQRCode->hide();
m_labelFace->hide();
m_ukeyPasswdWidget->hide();
LoginAuthInterface* plugin = m_widgetLoginOpts->getCustomLoginAuth();
if (plugin) {
QWidget *authWidget = plugin->getPluginMainWnd();
if (authWidget) {
if (m_customWidget != authWidget->parent()) {
m_layoutCustom->addWidget(authWidget);
qDebug()<<"CustomWidget Size:"<<authWidget->size();
QObject *obj = dynamic_cast<QObject*>(plugin);
connect(obj, SIGNAL(requestAuthAccount(QString)), this, SLOT(onCustomRequestAccount(QString)));
connect(obj, SIGNAL(authenticateResult(int, QString)), this, SLOT(onCustomAuthResult(int, QString)));
connect(obj, SIGNAL(onRequest(QString)), this, SLOT(onCustomRequest(QString)));
connect(obj, SIGNAL(getLoginPluginEnv()), this, SLOT(onCustomPlugEnv()));
}
authWidget->show();
}
}
m_customWidget->show();
}
break;
default:
@ -592,6 +645,11 @@ void AuthDialog::switchLoginOptType(unsigned uLoginOptType)
}
break;
case LOGINOPT_TYPE_GENERAL_UKEY:
{
setLoginTypeTip("");
}
break;
case LOGINOPT_TYPE_CUSTOM:
{
setLoginTypeTip("");
}
@ -639,12 +697,18 @@ void AuthDialog::onShowMessage(const QString &message, Auth::MessageType type)
if (message.indexOf("account locked") != -1 || message.indexOf("账户已锁定") != -1
|| message.indexOf("Account locked") != -1 || message.indexOf("永久锁定") != -1)
{
if(!m_timer){
m_timer = new QTimer(this);
m_timer->setInterval(800);
connect(m_timer, &QTimer::timeout, this, &AuthDialog::unlock_countdown);
if (unlock_countdown()) {
if(!m_timer){
m_timer = new QTimer(this);
m_timer->setInterval(500);
connect(m_timer, &QTimer::timeout, this, &AuthDialog::unlock_countdown);
} else {
if(m_timer->isActive()) {
m_timer->stop();
}
}
m_timer->start();
}
m_timer->start();
}else if (message.indexOf("No password received, please input password") != -1){
m_messageLabel->setText(tr("Password cannot be empty"));
m_messageLabel->setToolTip(tr("Password cannot be empty"));
@ -863,12 +927,14 @@ void AuthDialog::onShowPrompt(const QString &prompt, Auth::PromptType type)
prompted = true;
unacknowledged_messages = false;
m_preStrMessage = "";
if (!m_deviceInfo) {
if (!m_biometricProxy || !m_biometricProxy->isValid() || !m_deviceInfo) {
switchLoginOptType(LOGINOPT_TYPE_PASSWORD);
if (m_widgetLoginOpts)
m_widgetLoginOpts->setSelectedPassword();
}
if(text == "Password: " || text == "密码:"){
text = tr("Password ");
text = tr("Password: ");
} else if (text == "Input password" || text == "Input Password" || text == "输入密码") {
text = tr("Input Password");
}
@ -878,12 +944,18 @@ void AuthDialog::onShowPrompt(const QString &prompt, Auth::PromptType type)
m_passwordEdit->show();
if (m_passwordEdit->isVisible())
m_passwordEdit->setFocus();
if(!m_timer){
m_timer = new QTimer(this);
m_timer->setInterval(200);
connect(m_timer, &QTimer::timeout, this, &AuthDialog::unlock_countdown);
if (unlock_countdown()) {
if(!m_timer){
m_timer = new QTimer(this);
m_timer->setInterval(500);
connect(m_timer, &QTimer::timeout, this, &AuthDialog::unlock_countdown);
} else {
if(m_timer->isActive()) {
m_timer->stop();
}
}
m_timer->start();
}
m_timer->start();
}
}
@ -912,6 +984,18 @@ void AuthDialog::onAuthComplete()
onShowMessage(tr("Authentication failure, Please try again"),
Auth::MessageTypeError);
authMode = PASSWORD;
if (unlock_countdown()) {
if(!m_timer){
m_timer = new QTimer(this);
m_timer->setInterval(500);
connect(m_timer, &QTimer::timeout, this, &AuthDialog::unlock_countdown);
} else {
if(m_timer->isActive()) {
m_timer->stop();
}
}
m_timer->start();
}
startAuth();
// }
// else
@ -1086,6 +1170,9 @@ void AuthDialog::performBiometricAuth()
//获取默认设备
if (m_widgetLoginOpts) {
m_deviceName = m_widgetLoginOpts->getDefaultDevice(user.name);
if (m_isCustomDefault) {
m_deviceName = m_widgetLoginOpts->getCustomDevName();
}
}
qDebug() << m_deviceName;
if (m_deviceInfo) {
@ -1154,6 +1241,7 @@ void AuthDialog::initBiometricWidget()
this, &AuthDialog::onLoginOptsCount);
connect(m_widgetLoginOpts, &LoginOptionsWidget::updateAuthMsg,
this, &AuthDialog::setLoginMsg);
m_widgetLoginOpts->setUser(user.uid);
}
qDebug()<<"----------DeviceCount:"<<m_widgetLoginOpts->getLoginOptCount();
@ -1228,6 +1316,7 @@ void AuthDialog::onDeviceChanged(unsigned uCurLoginOptType, const DeviceInfoPtr
if(m_bioTimer && m_bioTimer->isActive())
m_bioTimer->stop();
authMode = BIOMETRIC;
m_deviceInfo = deviceInfo;
switchLoginOptType(uCurLoginOptType);
if(!isBioPassed && deviceInfo)
@ -1437,7 +1526,8 @@ void AuthDialog::setLoginTypeTip(QString strLoginTypeTip)
QFontMetrics font(m_labelLoginTypeTip->font());
QString strDisplay = font.elidedText(m_strLoginTypeTip, Qt::ElideRight, m_messageLabel->width()-8);
m_labelLoginTypeTip->setText(strDisplay);
m_labelLoginTypeTip->setToolTip(m_strLoginTypeTip);
if (strDisplay != strLoginTypeTip)
m_labelLoginTypeTip->setToolTip(m_strLoginTypeTip);
m_labelLoginTypeTip->show();
} else {
m_labelLoginTypeTip->hide();
@ -1639,6 +1729,93 @@ void AuthDialog::onBiometricDbusChanged(bool bActive)
}
}
QString AuthDialog::getCurAuthUserName()
{
return user.name;
}
void AuthDialog::onCustomRequestAccount(QString strName)
{
qDebug()<<"onCustomRequestAccount:"<<strName;
Q_EMIT customRequestAccount(strName);
}
void AuthDialog::onCustomAuthResult(int nResult, QString strMsg)
{
if (m_uCurLoginOptType != LOGINOPT_TYPE_CUSTOM) {
qDebug()<<"onCustomAuthResult error Current Auth type is not costom!!";
return ;
}
if(nResult) {
if(!isBioPassed) {
qDebug()<<"onCustomAuthResult:"<<nResult<<strMsg;
startBioAuth();
}
} else {
qDebug()<<"onCustomAuthResult success!!";
direct_login = true;
isBioPassed = true;
onBiometricButtonClicked();
}
}
QString AuthDialog::onCustomRequest(QString strReqJson)
{
qDebug()<<"onCustomRequest:"<<strReqJson;
QJsonParseError jsonParseError;
QJsonObject retObj;
retObj["Ret"] = 0;
retObj["Message"] = "Success";
const QJsonDocument jsonDoc = QJsonDocument::fromJson(strReqJson.toUtf8(), &jsonParseError);
if (jsonParseError.error != QJsonParseError::NoError) {
retObj["Ret"] = -1;
retObj["Message"] = "Parse request json failed!!";
qWarning()<<"Parse request json failed!!";
return QString(QJsonDocument(retObj).toJson());
} else {
QJsonObject rootObj = jsonDoc.object();
if (rootObj.isEmpty()) {
qWarning()<<"JSON串为空";
retObj["Ret"] = -1;
retObj["Message"] = "Request Json is null!!";
qWarning()<<"Request Json is null!!";
return QString(QJsonDocument(retObj).toJson());
} else {
QJsonObject contentObj;
QString reqType = rootObj.value("ReqType").toString();
qInfo() << "Req type: " << reqType;
if (reqType == "GetInformations") {
QString strType = rootObj.value("Type").toString();
if (strType.contains("CurrentUser")) {
if (user.uid >= 0 && !user.name.isEmpty() && !user.name.startsWith("*")) {
QJsonObject jsonUser;
jsonUser["Name"] = user.name;
jsonUser["Id"] = (double)user.uid;
jsonUser["HeadImg"] = user.icon;
jsonUser["RealName"] = user.realName.isEmpty() ? user.name : user.realName;
contentObj["CurrentUser"] = jsonUser;
} else {
retObj["Ret"] = -1;
retObj["Message"] = "Current user is invalid!";
}
}
}
retObj["Content"] = contentObj;
return QString(QJsonDocument(retObj).toJson());
}
}
}
int AuthDialog::onCustomPlugEnv()
{
return LoginPluginInterface::LOGINPLUGINENV_LOCKSCREEN;
}
void AuthDialog::setCustomAuthDefault(bool isDefault)
{
m_isCustomDefault = isDefault;
}
QPixmap AuthDialog::makeRoundLogo(QString logo, int wsize, int hsize, int radius)
{
QPixmap rectPixmap;

View File

@ -31,6 +31,7 @@
#include "biometricdeviceinfo.h"
#include "pam-tally.h"
#include "uniauthservice.h"
#include "pluginsloader.h"
namespace Ui {
class AuthDialog;
@ -45,6 +46,7 @@ class Auth;
class BiometricProxy;
class PamTally;
class LoginOptionsWidget;
class QHBoxLayout;
enum FOCUS {
REMOVE = 0,
@ -71,6 +73,14 @@ public:
void checkPassword();
int getBioNum();
bool getLineeditStatus();
QString getCurAuthUserName();
/**
* @brief setCustomAuthDefault
* @param isDefault true
*/
void setCustomAuthDefault(bool isDefault);
void setChildrenGeometry();
private:
void initUI();
void startWaiting();
@ -79,7 +89,7 @@ private:
void performBiometricAuth();
void skipBiometricAuth();
void initBiometricWidget();
void setChildrenGeometry();
void setBiometricWidgetGeometry();
void startBioAuth(unsigned uTimeout = 1000);
void show_authenticated (bool successful = true);
@ -127,12 +137,39 @@ public Q_SLOTS:
// void onCapsLockChanged();
void startAuth();
void stopAuth();
/**
* @brief onCustomRequestAccount
* @param strName
*/
void onCustomRequestAccount(QString strName);
/**
* @brief onCustomAuthResult
* @param nResult 0
* @param strMsg
*/
void onCustomAuthResult(int nResult, QString strMsg);
/**
* @brief onCustomRequest
* @param strReqJson json
* @return
*/
QString onCustomRequest(QString strReqJson);
/**
* @brief onCustomPlugEnv
* @return
*/
int onCustomPlugEnv();
Q_SIGNALS:
void authenticateCompete(bool result);
void clickPassword(bool clicked);
void loginOptionClicked();
void showMessageBtn(bool is_show);
/**
* @brief customRequestAccount
* @param account
*/
void customRequestAccount(QString account);
private:
UserItem user;
Auth *auth;
@ -198,7 +235,7 @@ private:
int m_preStrMessageType = -1;
void root_unlock_countdown();
void unlock_countdown();
bool unlock_countdown();
QTimer *m_timer;
QImage m_imgQRCode;
@ -212,6 +249,12 @@ private:
double curFontSize = 0;
double m_ptToPx = 1.0;
bool isLoadingUkey = false;
QString m_strRealName;
QWidget *m_customWidget; //放置第三方认证界面
QHBoxLayout *m_layoutCustom;
bool m_isCustomDefault = false; /** 是否默认使用第三方认证 */
PluginsLoader *m_pluginsLoader = nullptr; /** 插件加载器 */
};
#endif // AUTHDIALOG_H

View File

@ -30,6 +30,11 @@
#include <QScreen>
#include <QApplication>
#include "glibinterface.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <dlfcn.h>
#include <string.h>
#include "commonfunc.h"
#define GSETTINGS_SCHEMA_SCREENSAVER "org.ukui.screensaver"
@ -269,3 +274,17 @@ double Configuration::getPtToPx()
m_pxToPt = 72/(QApplication::primaryScreen()->logicalDotsPerInch());
return m_pxToPt;
}
QString Configuration::getHostCloudPlatform()
{
static QString strPlatform = "";
if (strPlatform.isEmpty()) {
char *platForm = kdk_system_get_hostCloudPlatform();
if (platForm) {
strPlatform = platForm;
free(platForm);
platForm = NULL;
}
}
return strPlatform;
}

View File

@ -46,6 +46,7 @@ public:
int locktimeout();
double getFontSize();
double getPtToPx();
QString getHostCloudPlatform();
public Q_SLOTS:
void onConfigurationChanged(QString key);

View File

@ -234,23 +234,18 @@ FullBackgroundWidget::FullBackgroundWidget(QWidget *parent)
this);
connect(iface, SIGNAL(PrepareForSleep(bool)), this, SLOT(onPrepareForSleep(bool)));
QDBusInterface *interfaceScreensaver = new QDBusInterface(
SS_DBUS_SERVICE,
SS_DBUS_PATH,
SS_DBUS_INTERFACE,
QDBusConnection::sessionBus());
QString strHostCloundPlatform = Configuration::instance()->getHostCloudPlatform();
if (strHostCloundPlatform != "ctyun") { // 天翼云不允许锁屏/屏保
QDBusInterface *interfaceScreensaver = new QDBusInterface(
SS_DBUS_SERVICE,
SS_DBUS_PATH,
SS_DBUS_INTERFACE,
QDBusConnection::sessionBus());
connect(interfaceScreensaver, SIGNAL(SecondRunParam(QString)),
connect(interfaceScreensaver, SIGNAL(SecondRunParam(QString)),
this, SLOT(onSecondRunParam(QString)));
// 闲置不会主动锁住
// QDBusInterface *interfaceLock = new QDBusInterface(
// SS_DBUS_SERVICE,
// SS_DBUS_PATH,
// SS_DBUS_INTERFACE,
// QDBusConnection::sessionBus());
}
// connect(interfaceLock, SIGNAL(SessionLockIdle()),
// this, SLOT(showLock()));
#ifdef USE_INTEL
QDBusConnection::systemBus().connect("org.freedesktop.UPower", "/org/freedesktop/UPower", "org.freedesktop.DBus.Properties", "PropertiesChanged",
this, SLOT(propertiesChangedSlot(QString, QMap<QString, QVariant>, QStringList)));
@ -260,15 +255,6 @@ FullBackgroundWidget::FullBackgroundWidget(QWidget *parent)
qApp->installNativeEventFilter(this);
installEventFilter(this);
QTimer::singleShot(500,this,SLOT(switchToLinux()));
LogindIntegration *m_logind = new LogindIntegration(this);
connect(m_logind, &LogindIntegration::requestUnlock, this,
[this]() {
closeScreensaver();
});
}
#ifdef USE_INTEL
@ -365,9 +351,9 @@ bool FullBackgroundWidget::eventFilter(QObject *obj, QEvent *event)
if(event->type() == QEvent::WindowDeactivate){
QTimer::singleShot(50,this,SLOT(laterActivate()));
}else if(event->type() == QEvent::WindowActivate){
if(QString(qgetenv("XDG_SESSION_TYPE")) == "wayland") {
PlasmaShellManager::getInstance()->setAppWindowKeepAbove(true);
}
// if(QString(qgetenv("XDG_SESSION_TYPE")) == "wayland" && !QX11Info::isPlatformX11()) {
// PlasmaShellManager::getInstance()->setAppWindowKeepAbove(true);
// }
QTimer::singleShot(500,this,SLOT(setLockState()));
QTimer::singleShot(200,this,SLOT(killWindow()));
@ -438,8 +424,20 @@ void FullBackgroundWidget::paintEvent(QPaintEvent *event)
void FullBackgroundWidget::closeEvent(QCloseEvent *event)
{
qDebug() << "FullBackgroundWidget::closeEvent";
if (isStartup)
// 处理认证完成后收到屏幕变化信号调用lockWidget指针崩溃问题
QDesktopWidget *desktop = QApplication::desktop();
disconnect(desktop, &QDesktopWidget::resized,
this, &FullBackgroundWidget::onDesktopResized);
disconnect(desktop, &QDesktopWidget::workAreaResized,
this, &FullBackgroundWidget::onDesktopResized);
disconnect(desktop, &QDesktopWidget::primaryScreenChanged,
this, &FullBackgroundWidget::onDesktopResized);
disconnect(desktop, &QDesktopWidget::screenCountChanged,
this, &FullBackgroundWidget::onDesktopResized);
if (isStartup){
killWindow();
setIsStartup(false);
}
if(future.isRunning()){
future.cancel();
future.waitForFinished();
@ -466,7 +464,6 @@ void FullBackgroundWidget::closeEvent(QCloseEvent *event)
if(widget)
widget->close();
}
if(QX11Info::isPlatformX11()){
closeGrab();
}
@ -930,6 +927,13 @@ int FullBackgroundWidget::onSessionStatusChanged(uint status)
return 0;
}
void FullBackgroundWidget::onSessionActiveChanged(bool isActive)
{
if (lockWidget) {
lockWidget->onSessionActiveChanged(isActive);
}
}
void FullBackgroundWidget::delayLockScreen()
{
if (!m_timerLock) {
@ -1098,23 +1102,40 @@ void FullBackgroundWidget::onGlobalKeyRelease(int key)
// 键盘上的num_lock生效、不需要登录界面进行管理
}
#else
if (key == 65) { // "Space"
if (lockWidget && lockWidget->isVisible()) {/*keyReleaseEvent有时候监听不到Space的按键事件 原因未知
Space按键放到nativeEventFilter里面*/
lockWidget->key_enter_release(Qt::Key_Space);
if (QX11Info::isPlatformX11()) {
if (key == 65) { // "Space"
if (lockWidget && lockWidget->isVisible()) {/*keyReleaseEvent有时候监听不到Space的按键事件 原因未知
Space按键放到nativeEventFilter里面*/
lockWidget->key_enter_release(Qt::Key_Space);
}
}
if (key == 9 && screenStatus == SCREEN_LOCK) { // "escape"
bool canShow = true;
if (lockWidget && !lockWidget->exitSubWidget())
canShow = false;
if (configuration && configuration->idledelay() == -1)
canShow = false;
if (!m_isAlreadyShowSaver)
canShow = false;
if (canShow)
showScreensaver();
} else if (screenStatus & SCREEN_SAVER && !isBlank) {
clearScreensavers();
}
} else {
if (key == Qt::Key_Escape && screenStatus == SCREEN_LOCK) { // "escape"
bool canShow = true;
if (lockWidget && !lockWidget->exitSubWidget())
canShow = false;
if (configuration && configuration->idledelay() == -1)
canShow = false;
if (!m_isAlreadyShowSaver)
canShow = false;
if (canShow)
showScreensaver();
} else if (screenStatus & SCREEN_SAVER && !isBlank) {
clearScreensavers();
}
} else if (key == Qt::Key_Escape && screenStatus == SCREEN_LOCK) { // "escape"
bool canShow = true;
if (lockWidget && !lockWidget->exitSubWidget())
canShow = false;
if (configuration && configuration->idledelay() == -1)
canShow = false;
if (!m_isAlreadyShowSaver)
canShow = false;
if (canShow)
showScreensaver();
} else if (screenStatus & SCREEN_SAVER && !isBlank) {
clearScreensavers();
}
#endif
}
@ -1222,9 +1243,9 @@ void FullBackgroundWidget::onDesktopResized()
update();
#endif
if(QString(qgetenv("XDG_SESSION_TYPE")) == "wayland") {
PlasmaShellManager::getInstance()->setPos(this->windowHandle(),QPoint(0,0));
}
// if(QString(qgetenv("XDG_SESSION_TYPE")) == "wayland" && !QX11Info::isPlatformX11() ) {
// PlasmaShellManager::getInstance()->setPos(this->windowHandle(),QPoint(0,0));
// }
}
void FullBackgroundWidget::laterInhibit(bool val)

View File

@ -75,6 +75,7 @@ public Q_SLOTS:
void propertiesChangedSlot(QString, QMap<QString, QVariant>, QStringList);
void onShowBlackBackGround();
#endif
void onSessionActiveChanged(bool isActive);
Q_SIGNALS:
void StartupModeChanged(bool isStartup);

142
src/greeterservice.cpp Normal file
View File

@ -0,0 +1,142 @@
/*
* Copyright (C) 2023 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*
**/
#include "greeterservice.h"
#include <QDebug>
#include <pwd.h>
#define GREETERDAEMON_DBUS_SERVICE "org.ukui.GreeterDaemon"
#define GREETERDAEMON_DBUS_PATH "/org/ukui/GreeterDaemon"
#define GREETERDAEMON_DBUS_INTERFACE "org.ukui.GreeterDaemon"
#define FD_DBUS_SERVICE "org.freedesktop.DBus"
#define FD_DBUS_PATH "/org/freedesktop/DBus"
#define FD_DBUS_INTERFACE "org.freedesktop.DBus"
/* For the type WillLoginUserInfo */
QDBusArgument &operator<<(QDBusArgument &argument, const WillLoginUserInfo &willLoginUserInfo)
{
argument.beginStructure();
argument << willLoginUserInfo.strUserName << willLoginUserInfo.isOneKeyLogin;
argument.endStructure();
return argument;
}
const QDBusArgument &operator>>(const QDBusArgument &argument, WillLoginUserInfo &willLoginUserInfo)
{
argument.beginStructure();
argument >> willLoginUserInfo.strUserName >> willLoginUserInfo.isOneKeyLogin;
argument.endStructure();
return argument;
}
QDebug operator <<(QDebug stream, const WillLoginUserInfo &willLoginUserInfo)
{
stream << "WillLogUser ["
<< willLoginUserInfo.strUserName
<< willLoginUserInfo.isOneKeyLogin
<< "]";
return stream;
}
GreeterService* GreeterService::m_instance = nullptr;
GreeterService::GreeterService(QObject *parent)
: QDBusAbstractInterface(GREETERDAEMON_DBUS_SERVICE,
GREETERDAEMON_DBUS_PATH,
GREETERDAEMON_DBUS_INTERFACE,
QDBusConnection::systemBus(),
parent)
{
qRegisterMetaType<WillLoginUserInfo>("WillLoginUserInfo");
qDBusRegisterMetaType<WillLoginUserInfo>();
setTimeout(2147483647);
QDBusInterface *dbusService = new QDBusInterface(FD_DBUS_SERVICE,
FD_DBUS_PATH,
FD_DBUS_INTERFACE,
QDBusConnection::systemBus());
if (dbusService) {
QDBusReply<QStringList> result = dbusService->call(QStringLiteral("ListActivatableNames"));
if(!result.isValid()) {
qWarning() << "ListActivatableNames error:" << result.error().message();
} else {
QStringList listNames = result.value();
if (listNames.contains(GREETERDAEMON_DBUS_SERVICE)) {
m_isActivatable = true;
}
}
delete dbusService;
}
}
GreeterService* GreeterService::instance(QObject *parent)
{
if (!m_instance) {
m_instance = new GreeterService(parent);
}
return m_instance;
}
void GreeterService::SwitchToUser(QString strUserName)
{
QDBusReply<int> reply = call(QStringLiteral("SwitchToUser"), strUserName);
if(!reply.isValid())
{
qWarning() << "SwitchToUser error:" << reply.error();
return ;
}
return ;
}
void GreeterService::SwitchToGreeterUser(QString strUserName)
{
QDBusReply<int> reply = call(QStringLiteral("SwitchToGreeterUser"), strUserName);
if(!reply.isValid())
{
qWarning() << "SwitchToGreeterUser error:" << reply.error();
return ;
}
return ;
}
WillLoginUserInfo GreeterService::getWillSwitchUser()
{
WillLoginUserInfo willLoginUserInfo;
QDBusMessage result = call(QStringLiteral("getWillSwitchUser"));
if(result.type() == QDBusMessage::ErrorMessage) {
qWarning() << "getWillSwitchUser error:" << result.errorMessage();
return willLoginUserInfo;
}
if (result.arguments().size() > 0) {
QDBusArgument argInfo = result.arguments().at(0).value<QDBusArgument>();
argInfo >> willLoginUserInfo;
}
qDebug()<<"getUserInfo:"<<willLoginUserInfo;
return willLoginUserInfo;
}
bool GreeterService::isUserNameValid(QString strUserName)
{
struct passwd* userInfo = nullptr;
userInfo = getpwnam(strUserName.toLatin1().data());
if (userInfo) {
return true;
}
return false;
}

109
src/greeterservice.h Normal file
View File

@ -0,0 +1,109 @@
/*
* Copyright (C) 2023 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*
**/
#ifndef GREETERSERVICE_H
#define GREETERSERVICE_H
#include <QtDBus>
#include <QDBusAbstractInterface>
/**
* @brief
*/
struct WillLoginUserInfo
{
QString strUserName = "";
bool isOneKeyLogin = false;
};
QDBusArgument &operator <<(QDBusArgument &arg, const WillLoginUserInfo &willLoginUserInfo);
const QDBusArgument &operator >>(const QDBusArgument &arg, WillLoginUserInfo &willLoginUserInfo);
QDebug operator <<(QDebug stream, const WillLoginUserInfo &willLoginUserInfo);
Q_DECLARE_METATYPE(WillLoginUserInfo)
/**
* @brief
*
*/
class GreeterService : public QDBusAbstractInterface
{
Q_OBJECT
private:
/**
* @brief
*
* @param parent
*/
explicit GreeterService(QObject *parent = nullptr);
public:
/**
* @brief
*
* @param parent
* @return GreeterService
*/
static GreeterService *instance(QObject *parent = nullptr);
/**
* @brief
*
* @param strUserName
* @return bool true
*/
bool isUserNameValid(QString strUserName);
/**
* @brief
* @return true
*/
bool isServiceActivatable() { return m_isActivatable; }
public Q_SLOTS:
/**
* @brief
*
* @param strUserName
*/
void SwitchToUser(QString strUserName);
/**
* @brief
*
* @param strUserName
*/
void SwitchToGreeterUser(QString strUserName);
/**
* @brief
*
* @return WillLoginUserInfo
*/
WillLoginUserInfo getWillSwitchUser();
Q_SIGNALS:
/**
* @brief
*
* @param strUserName
* @param isOneKeyLogin
*/
void userChanged(WillLoginUserInfo willLoginUser);
private:
static GreeterService *m_instance; /** 登录服务单实例指针 */
bool m_isActivatable = false; /** 服务是否可启动 */
};
#endif // GREETERSERVICE_H

112
src/iconbutton.cpp Normal file
View File

@ -0,0 +1,112 @@
/*
* Copyright (C) 2018 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*
**/
#include "iconbutton.h"
#include <QPainter>
#include <QStyleOptionButton>
#include <QPainterPath>
#include <QPixmap>
#include <QDebug>
static inline qreal mixQreal(qreal a, qreal b, qreal bias)
{
return a + (b - a) * bias;
}
IconButton::IconButton(QWidget *parent)
:QPushButton(parent)
{
}
IconButton::~IconButton()
{
}
QColor IconButton::mixColor(const QColor &c1, const QColor &c2, qreal bias)
{
if (bias <= 0.0) {
return c1;
}
if (bias >= 1.0) {
return c2;
}
if (qIsNaN(bias)) {
return c1;
}
qreal r = mixQreal(c1.redF(), c2.redF(), bias);
qreal g = mixQreal(c1.greenF(), c2.greenF(), bias);
qreal b = mixQreal(c1.blueF(), c2.blueF(), bias);
qreal a = mixQreal(c1.alphaF(), c2.alphaF(), bias);
return QColor::fromRgbF(r, g, b, a);
}
void IconButton::paintEvent(QPaintEvent *event){
Q_UNUSED(event)
QStyleOptionButton option;
initStyleOption(&option);
QPainter p(this);
p.setRenderHint(QPainter::HighQualityAntialiasing);
p.setRenderHint(QPainter::Antialiasing);
p.setRenderHint(QPainter::TextAntialiasing);
p.setRenderHint(QPainter::SmoothPixmapTransform);
QColor backgroundColor;
QColor mix = option.palette.brightText().color();
QColor highlight = option.palette.highlight().color();
if(option.state.testFlag(QStyle::State_MouseOver)) /*鼠标在按钮上(hover状态)*/
{
if(option.state.testFlag(QStyle::State_Sunken)) { /*按钮被选中clicked*/
backgroundColor = mixColor(highlight,mix,0.2);
} else {
backgroundColor = mixColor(highlight,mix,0.1);
}
} else {
backgroundColor = mixColor(highlight,mix,0.05);
}
/*绘制背景色和rect*/
p.save();
p.setPen(Qt::NoPen);
QPoint point;
QRect ir = option.rect;
if(option.state.testFlag(QStyle::State_HasFocus)) {
p.setBrush(QColor("#3D6BE5"));
p.drawRoundedRect(option.rect, 12, 12);
p.setBrush(backgroundColor);
p.drawRoundedRect(option.rect.adjusted(2, 2, -2, -2), 12, 12);
} else {
p.setBrush(backgroundColor);
p.drawRoundedRect(option.rect, 12, 12);
}
QPixmap pixmap = option.icon.pixmap(option.iconSize, QIcon::Active, QIcon::On);
point = QPoint(ir.x() + ir.width() / 2 - (pixmap.width() + 1) / 2,
ir.y() + ir.height() / 2 - (pixmap.height() + 2)/ 2);
// qDebug() << "point = " << point;
p.drawPixmap(this->style()->visualPos(option.direction, option.rect, point), pixmap);
p.restore();
}

41
src/iconbutton.h Normal file
View File

@ -0,0 +1,41 @@
/*
* Copyright (C) 2018 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*
**/
#ifndef ICONBUTTON_H
#define ICONBUTTON_H
#include <QWidget>
#include <QPushButton>
#include <QGSettings>
class IconButton:public QPushButton
{
Q_OBJECT
public:
IconButton(QWidget* parent = nullptr);
~IconButton();
protected:
void paintEvent(QPaintEvent * event);
private:
static QColor mixColor(const QColor &c1, const QColor &c2, qreal bias = 0.5);
private:
};
#endif // ICONBUTTON_H

View File

@ -18,6 +18,7 @@
#include "iconedit.h"
#include "imageutil.h"
#include "configuration.h"
#include "commonfunc.h"
#include <QGSettings>
#include <QHBoxLayout>
#include <QWidget>
@ -28,8 +29,10 @@
#include <QTimer>
#include <QDir>
#include <QtX11Extras/QX11Info>
#include <X11/Xutil.h>
#include <X11/Xlib.h>
#include <X11/XKBlib.h>
#include <QBitmap>
#define DRM_DIR "/sys/class/leds/"
@ -39,35 +42,35 @@
* @brief
* @return true:
*/
bool checkCapsLockState()
{
QDir ledDir(DRM_DIR);
QStringList leds = ledDir.entryList(QDir::Dirs);
QString capsFile;
//bool checkCapsLockState()
//{
// QDir ledDir(DRM_DIR);
// QStringList leds = ledDir.entryList(QDir::Dirs);
// QString capsFile;
for(int i = 0;i<leds.count();i++){
if(leds.at(i).contains("capslock"))
capsFile = leds.at(i);
}
QFile drmStatusFile(DRM_DIR + capsFile + "/brightness");
if(drmStatusFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
QTextStream in(&drmStatusFile);
QString status = in.readLine();
// for(int i = 0;i<leds.count();i++){
// if(leds.at(i).contains("capslock"))
// capsFile = leds.at(i);
// }
// QFile drmStatusFile(DRM_DIR + capsFile + "/brightness");
// if(drmStatusFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
// QTextStream in(&drmStatusFile);
// QString status = in.readLine();
if(status == "0") {
return false;
}else{
return true;
}
}
// if(status == "0") {
// return false;
// }else{
// return true;
// }
// }
bool capsState = false;
unsigned int n;
XkbGetIndicatorState(QX11Info::display(), XkbUseCoreKbd, &n);
capsState = (n & 0x01) == 1;
// bool capsState = false;
// unsigned int n;
// XkbGetIndicatorState(QX11Info::display(), XkbUseCoreKbd, &n);
// capsState = (n & 0x01) == 1;
return capsState;
}
// return capsState;
//}
IconEdit::IconEdit(QWidget *parent)
@ -101,20 +104,20 @@ IconEdit::IconEdit(QWidget *parent)
m_capsIcon->setVisible(capsState);
m_capsIcon->load(QString(":/image/assets/capslock.svg"));
m_iconButton = new QPushButton(this);
m_iconButton = new IconButton(this);
m_iconButton->setFixedSize(24, 24);
m_iconButton->setIconSize(QSize(24, 24));
m_iconButton->setObjectName(QStringLiteral("loginButton"));
m_iconButton->setCursor(QCursor(Qt::PointingHandCursor));
//m_iconButton->setCursor(QCursor(Qt::PointingHandCursor));
m_iconButton->installEventFilter(this);
m_iconButton->setFocusPolicy(Qt::FocusPolicy::NoFocus);
m_iconButton->setStyleSheet("border-radius:12px; border:2px solid #3D6BE5;");
m_iconButton->setToolTip(tr("OK"));
m_modeButton = new ModeButton(this);
m_modeButton->setObjectName(QStringLiteral("echoModeButton"));
m_modeButton->setIcon(QIcon::fromTheme("ukui-eye-display-symbolic"));
m_modeButton->setFocusPolicy(Qt::FocusPolicy::NoFocus);
m_modeButton->setCursor(Qt::PointingHandCursor);
//m_modeButton->setCursor(Qt::PointingHandCursor);
m_modeButton->installEventFilter(this);
m_modeButton->setFixedSize(24, 14);
m_modeButton->setIconSize(QSize(16, 16));
@ -287,10 +290,13 @@ void IconEdit::setIcon(const QString &text)
void IconEdit::setIcon(const QIcon &icon)
{
m_iconButton->setIcon(icon);
//这里将QIcon转QPixmap传入(24,24)时实际得到的pixmap大小为(24,24)乘上缩放比例导致计算pixmap位置错误因此需要重新设置一次大小
//更好的解决方案应该是重写IconButton的setIcon函数?直接处理图片大小与icon大小一致?
QPixmap pixmap = icon.pixmap(24, 24).scaled(24,24, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
m_icon = ImageUtil::drawSymbolicColoredPixmap(pixmap, "white");
m_iconButton->setIcon(m_icon);
m_iconButton->setIconSize(QSize(12,12));
m_iconButton->setText("");
m_icon = icon;
m_iconText = "";
}
@ -348,10 +354,12 @@ void IconEdit::startWaiting()
// m_waitingPixmap = ImageUtil::loadSvg(":/image/assets/ukui-loginopt-face.svg", "white", 24);
// m_iconButton->setIcon(QIcon(m_waitingPixmap));
QPixmap icon = QIcon::fromTheme("ukui-loading-0-symbolic").pixmap(16,16);
//这里将QIcon转QPixmap传入(24,24)时实际得到的pixmap大小为(24,24)乘上缩放比例导致计算pixmap位置错误因此需要重新设置一次大小
//更好的解决方案应该是重写IconButton的setIcon函数?直接处理图片大小与icon大小一致?
QPixmap icon = QIcon::fromTheme("ukui-loading-0-symbolic").pixmap(16,16).scaled(16,16, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
m_waitingPixmap = ImageUtil::drawSymbolicColoredPixmap(icon, "white");
m_iconButton->setIcon(m_waitingPixmap);
m_iconButton->setIconSize(QSize(16,16));
m_iconButton->setIconSize(QSize(16, 16));
m_timer->start();
}

View File

@ -27,6 +27,7 @@
#include <QSettings>
#include <QPixmap>
#include "modebutton.h"
#include "iconbutton.h"
class Configuration;
@ -71,7 +72,7 @@ public Q_SLOTS:
private:
QLineEdit *m_edit;
QSvgWidget *m_capsIcon;
QPushButton *m_iconButton;
IconButton *m_iconButton;
ModeButton *m_modeButton;
QTimer *m_timer;
QPixmap m_waitingPixmap;

View File

@ -29,6 +29,7 @@
#include <QFileInfo>
#include <unistd.h>
#include <fcntl.h>
#include "types.h"
Interface::Interface(QObject *parent)
: QObject(parent),
@ -113,10 +114,25 @@ bool Interface::GetSlpState()
bool Interface::GetLockState()
{
if(process.state() != QProcess::NotRunning)
if(process.state() != QProcess::NotRunning){
return lockState;
else
return checkScreenDialogRunning();
}else{
if(!checkScreenDialogRunning()){
return false;
}
QDBusInterface iface("org.freedesktop.DBus",
"/org/freedesktop/DBus",
"org.freedesktop.DBus",
QDBusConnection::sessionBus());
QDBusReply<bool> stateReply = iface.call("NameHasOwner",SSWND_DBUS_SERVICE);
if(!stateReply.isValid()){
return false;
}
qDebug()<<"stateReply = "<<stateReply.value();
return stateReply.value();
}
}
bool Interface::GetBlankState()
@ -300,22 +316,20 @@ void Interface::onPrepareForSleep(bool sleep)
return;
}
if (checkScreenDialogRunning()) {
if (checkScreenDialogRunning()
|| GetLockState()
|| GetSlpState()) {
QDBusMessage message;
message = QDBusMessage::createSignal(SS_DBUS_PATH,
SS_DBUS_INTERFACE,
"SecondRunParam");
message<<"SleepLock";
QDBusConnection::sessionBus().send(message);
uninhibit();
return;
}
if(GetLockState()){
uninhibit();
return;
}
if(GetSlpState()){
uninhibit();
return;
}
blankState = true;
blankState = true;
this->onShowBlankScreensaver();
if(!m_timer){
@ -335,7 +349,7 @@ void Interface::onPrepareForSleep(bool sleep)
else
{
m_nStatus &= ~SESSION_STATUS_SLEEPED;
blankState = false;
blankState = false;
inhibit();
}
}

View File

@ -32,11 +32,17 @@
#include <QScrollBar>
#include <QMenu>
#include <QWidgetAction>
#include <QJsonValue>
#include <QJsonObject>
#include <QJsonDocument>
#include <QJsonArray>
#include <QJsonParseError>
#include <imageutil.h>
#include <QtX11Extras/QX11Info>
#include <kylin-nm/kynetworkicon.h>
#include <QGSettings>
#include "authdialog.h"
#include "loginauthinterface.h"
#include "virtualkeyboardwidget.h"
#include "configuration.h"
#include "users.h"
@ -49,6 +55,7 @@
#include "klabel.h"
#include "rootWindowBackground.h"
#include "configuration.h"
#include "greeterservice.h"
#include <QtX11Extras/QX11Info>
#include <X11/Xlib.h>
@ -60,6 +67,8 @@
#define KEY_PRIMARY_COLOR "primaryColor"
#define TIME_TYPE_SCHEMA "org.ukui.control-center.panel.plugins"
#define CONFIG_FILE "/etc/lightdm/ukui-greeter.conf"
#define ON_TAB_SHEET_WIDGET "#widgetNetworkManager{background-color: rgba(255,255,255,15%); border-radius: 4px; border: 2px solid #2C73C8;}"
#define ON_NORMAL_SHEET_WIDGET "#widgetNetworkManager{text-align:center;color: rgba(255, 255, 255, 255);border: none;border-radius: 4px;outline: none;}"
#define ON_TAB_SHEET "QPushButton{background-color: rgba(255,255,255,15%); border-radius: 4px; border: 2px solid #2C73C8;}"
#define ON_NORMAL_SHEET "QPushButton{text-align:center;color: rgba(255, 255, 255, 255);border: none;border-radius: 4px;outline: none;} \
QPushButton::hover{background-color: rgba(255,255,255,15%);} \
@ -98,9 +107,6 @@ LockWidget::LockWidget(QWidget *parent)
// connect(this, &LockWidget::capsLockChanged,
// authDialog, &AuthDialog::onCapsLockChanged);
// connect(m_kylinNM, &KylinNM::onConnectChanged, this,[=](){
// updateNetIcon(m_kylinNM->getConnectStatus());
// });
curFontSize = configuration->getFontSize();
this->installEventFilter(this);
initUI();
@ -191,25 +197,6 @@ bool LockWidget::eventFilter(QObject *obj, QEvent *event)
//qDebug()<<"````````````````````````````````````````````"<<event->type();
}
}
/*
if(event->type() == QEvent::WindowActivate){
if(!isNetFinished){
isNetFinished = true;
QTimer::singleShot(1000, this, [=](){
loadNetPlugin();
// m_kylinNM = new KylinNM(this);
// m_kylinNM->installEventFilter(this);
// connect(m_kylinNM, &KylinNM::onConnectChanged, this,[=](){
// updateNetIcon(m_kylinNM->getConnectStatus());
// });
// m_kylinNM->hide();
// QtConcurrent::run([=](){
// updateNetIcon(getNetStatus());
// });
});
}
}
*/
return false;
}
@ -236,24 +223,7 @@ void LockWidget::key_enter_release(int key)
break;
case SWITCHBTN:
if(scrollArea && scrollArea->isVisible()) {
if(authDialog)
{
if(list.at(nowAt)->objectName() != getenv("USER"))
authDialog->stopAuth();
}
if(list.at(nowAt)->objectName() == "Guest")
{
displayManager->switchToGuest();
}
else if(list.at(nowAt)->objectName() == "SwitchUser")
{
displayManager->switchToGreeter();
}
else
{
if(list.at(nowAt)->objectName() != getenv("USER"))
displayManager->switchToUser(list.at(nowAt)->objectName());
}
SwitchToUser(list.at(nowAt)->objectName());
} else {
ui->btnSwitchUser->setStyleSheet(ON_NORMAL_SHEET);
showUserMenu();
@ -262,7 +232,7 @@ void LockWidget::key_enter_release(int key)
case NETWORKBTN:
if(!m_kylinNM || !(m_kylinNM && m_kylinNM->isVisible()))
showNetManager(true);
btnNetworkManager->setStyleSheet(ON_NORMAL_SHEET);
widgetNetworkManager->setStyleSheet(ON_NORMAL_SHEET_WIDGET);
authDialog->setFocusin(REMOVE);
break;
case KEYBOARDBTN:
@ -559,19 +529,19 @@ void LockWidget::setBottomBtnSheet()
case BATTERYBTN:
ui->btnBatteryStatus->setStyleSheet(ON_TAB_SHEET);
ui->btnSwitchUser->setStyleSheet(ON_NORMAL_SHEET);
btnNetworkManager->setStyleSheet(ON_NORMAL_SHEET);
widgetNetworkManager->setStyleSheet(ON_NORMAL_SHEET_WIDGET);
ui->btnKeyboard->setStyleSheet(ON_NORMAL_SHEET);
ui->btnPowerManager->setStyleSheet(ON_NORMAL_SHEET);
break;
case SWITCHBTN:
ui->btnSwitchUser->setStyleSheet(ON_TAB_SHEET);
btnNetworkManager->setStyleSheet(ON_NORMAL_SHEET);
widgetNetworkManager->setStyleSheet(ON_NORMAL_SHEET_WIDGET);
ui->btnKeyboard->setStyleSheet(ON_NORMAL_SHEET);
ui->btnPowerManager->setStyleSheet(ON_NORMAL_SHEET);
ui->btnBatteryStatus->setStyleSheet(ON_NORMAL_SHEET);
break;
case NETWORKBTN:
btnNetworkManager->setStyleSheet(ON_TAB_SHEET);
widgetNetworkManager->setStyleSheet(ON_TAB_SHEET_WIDGET);
ui->btnKeyboard->setStyleSheet(ON_NORMAL_SHEET);
ui->btnPowerManager->setStyleSheet(ON_NORMAL_SHEET);
ui->btnSwitchUser->setStyleSheet(ON_NORMAL_SHEET);
@ -581,19 +551,19 @@ void LockWidget::setBottomBtnSheet()
ui->btnKeyboard->setStyleSheet(ON_TAB_SHEET);
ui->btnPowerManager->setStyleSheet(ON_NORMAL_SHEET);
ui->btnSwitchUser->setStyleSheet(ON_NORMAL_SHEET);
btnNetworkManager->setStyleSheet(ON_NORMAL_SHEET);
widgetNetworkManager->setStyleSheet(ON_NORMAL_SHEET_WIDGET);
ui->btnBatteryStatus->setStyleSheet(ON_NORMAL_SHEET);
break;
case POWERBTN:
ui->btnPowerManager->setStyleSheet(ON_TAB_SHEET);
ui->btnSwitchUser->setStyleSheet(ON_NORMAL_SHEET);
btnNetworkManager->setStyleSheet(ON_NORMAL_SHEET);
widgetNetworkManager->setStyleSheet(ON_NORMAL_SHEET_WIDGET);
ui->btnKeyboard->setStyleSheet(ON_NORMAL_SHEET);
ui->btnBatteryStatus->setStyleSheet(ON_NORMAL_SHEET);
break;
default:
ui->btnSwitchUser->setStyleSheet(ON_NORMAL_SHEET);
btnNetworkManager->setStyleSheet(ON_NORMAL_SHEET);
widgetNetworkManager->setStyleSheet(ON_NORMAL_SHEET_WIDGET);
ui->btnKeyboard->setStyleSheet(ON_NORMAL_SHEET);
ui->btnPowerManager->setStyleSheet(ON_NORMAL_SHEET);
ui->btnBatteryStatus->setStyleSheet(ON_NORMAL_SHEET);
@ -601,7 +571,7 @@ void LockWidget::setBottomBtnSheet()
}
} else {
ui->btnSwitchUser->setStyleSheet(ON_NORMAL_SHEET);
btnNetworkManager->setStyleSheet(ON_NORMAL_SHEET);
widgetNetworkManager->setStyleSheet(ON_NORMAL_SHEET_WIDGET);
ui->btnKeyboard->setStyleSheet(ON_NORMAL_SHEET);
ui->btnPowerManager->setStyleSheet(ON_NORMAL_SHEET);
ui->btnBatteryStatus->setStyleSheet(ON_NORMAL_SHEET);
@ -657,14 +627,33 @@ void LockWidget::resetNavigation()
authDialog->setFocusin(IN_LINEEDIT);
}
QString LockWidget::getLongFormatDate(int type)
{
kdk_logn_dateinfo *dateInfo = kdk_system_login_lock_dateinfo(getenv("USER"));
if (type == DATE) {
QString date = dateInfo->date;
QString week = dateInfo->week;
if (dateInfo) {
kdk_free_logn_dateinfo(dateInfo);
}
return date + " " + week;
} else if (type == TIME) {
QString time = dateInfo->time;
if (dateInfo) {
kdk_free_logn_dateinfo(dateInfo);
}
return time;
}
}
void LockWidget::startAuth()
{
if(authDialog)
{
authDialog->startAuth();
if (isTableMode && !(vKeyboard && vKeyboard->isVisible())) {
showVirtualKeyboard();
}
// if (isTableMode && !(vKeyboard && vKeyboard->isVisible())) {
// showVirtualKeyboard();
// }
}
}
@ -686,6 +675,19 @@ void LockWidget::setX11Focus()
void LockWidget::initUI()
{
setFocusProxy(authDialog);
// 检查并获取第三方认证插件配置信息
if (PluginsLoader::instance().findModulesByType(LoginPluginInterface::MODULETYPE_AUTH).size() > 0) {
LoginAuthInterface *plugin = dynamic_cast<LoginAuthInterface *>(PluginsLoader::instance() \
.findModulesByType(LoginPluginInterface::MODULETYPE_AUTH) \
.values().first());
QJsonObject rootObj;
rootObj["MsgType"] = "GetInformations";
rootObj["Key"] = "Configures";
QString strMsg = plugin->onMessage(QJsonDocument(rootObj).toJson());
onGetCustomPluginMsg(strMsg);
}
if (authDialog)
authDialog->setCustomAuthDefault(m_isCustomDefault);
if(QGSettings::isSchemaInstalled(TIME_TYPE_SCHEMA)){
QGSettings *time_type = new QGSettings(TIME_TYPE_SCHEMA);
@ -701,34 +703,21 @@ void LockWidget::initUI()
//显示系统时间
timer = new QTimer(this);
connect(timer, &QTimer::timeout, this, [&]{
if(timeType == 12)
ui->lblTime->setText(QDateTime::currentDateTime().toString("A hh:mm"));
else
ui->lblTime->setText(QDateTime::currentDateTime().toString("hh:mm"));
if(dateType == "cn")
ui->lblDate->setText(QDate::currentDate().toString("yyyy/MM/dd ddd").replace("","星期"));
else
ui->lblDate->setText(QDate::currentDate().toString("yyyy-MM-dd ddd").replace("","星期"));
ui->lblTime->setText(getLongFormatDate(TIME));
ui->lblDate->setText(getLongFormatDate(DATE));
});
if(timeType == 12)
ui->lblTime->setText(QDateTime::currentDateTime().toString("A hh:mm"));
else
ui->lblTime->setText(QDateTime::currentDateTime().toString("hh:mm"));
ui->lblTime->setText(getLongFormatDate(TIME));
ui->lblTime->setFontSize(36);
ui->lblTime->setAlignment(Qt::AlignCenter);
ui->lblTime->adjustSize();
timer->start(1000);
// QString date = QDate::currentDate().toString("yyyy/MM/dd ddd");
// qDebug() << "current date: " << date;
// ui->lblDate->setText(date);
if(dateType == "cn")
ui->lblDate->setText(QDate::currentDate().toString("yyyy/MM/dd ddd").replace("","星期"));
ui->lblDate->setText(getLongFormatDate(DATE));
else
ui->lblDate->setText(QDate::currentDate().toString("yyyy-MM-dd ddd").replace("","星期"));
ui->lblDate->setText(getLongFormatDate(DATE));
ui->lblDate->setFontSize(18);
ui->lblDate->setAlignment(Qt::AlignCenter);
@ -767,6 +756,7 @@ void LockWidget::initUI()
ui->btnBatteryStatus->setFocusPolicy(Qt::NoFocus);
ui->btnBatteryStatus->installEventFilter(this);
ui->btnBatteryStatus->setCheckable(true);
ui->btnBatteryStatus->setToolTip(tr("PowerInfo"));
ui->btnBatteryStatus->raise();
mBatteryWidget = new BatteryWidget(QPoint(ui->btnBatteryStatus->x(), ui->btnBatteryStatus->y()), this);
mBatteryWidget->hide();
@ -789,30 +779,23 @@ void LockWidget::initUI()
ui->btnPowerManager->setIcon(QIcon(":/image/assets/shutdown.svg"));
ui->btnPowerManager->setFixedSize(48,48);
ui->btnPowerManager->setIconSize(QSize(24,24));
ui->btnPowerManager->setToolTip(tr("Power"));
ui->btnPowerManager->setFocusPolicy(Qt::NoFocus);
ui->btnPowerManager->installEventFilter(this);
connect(ui->btnPowerManager,&QPushButton::clicked
,this,&LockWidget::showPowerManager);
// QtConcurrent::run([=](){
// updateNetIcon(getNetStatus());
// });
btnNetworkManager = new KyNetworkIcon(this);
btnNetworkManager->setStyleSheet("QPushButton{text-align:center;color: rgba(255, 255, 255, 255);border: none;border-radius: 4px;outline: none;} \
QPushButton::hover{background-color: rgba(255,255,255,15%);} \
QPushButton::pressed {background-color: rgba(255,255,255,40%);}\
QPushButton::checked {background-color: rgba(255, 255, 255, 40%);}");
widgetNetworkManager = new QWidget(this);
widgetNetworkManager->setObjectName("widgetNetworkManager");
widgetNetworkManager->setFixedSize(48,48);
btnNetworkManager = new KyNetworkIcon(widgetNetworkManager);
btnNetworkManager->setCheckable(true);
btnNetworkManager->setFixedSize(48,48);
btnNetworkManager->setIconSize(QSize(24,24));
btnNetworkManager->setFocusPolicy(Qt::NoFocus);
// ui->btnNetworkManager->setStyleSheet("QPushButton:Hover{border-radius:24px;background-color:rgba(255, 255, 255, 0.15);}"
// "QPushButton:Pressed{border-radius:24px;background-color:rgba(255, 255, 255, 0.05);}");
btnNetworkManager->installEventFilter(this);
btnNetworkManager->setCursor(Qt::PointingHandCursor);
btnNetworkManager->setCursor(Qt::ArrowCursor);
connect(btnNetworkManager,&QPushButton::clicked
,this, [&,this](){
@ -823,6 +806,7 @@ void LockWidget::initUI()
ui->btnKeyboard->setIcon(QIcon(":/image/assets/keyboard.svg"));
ui->btnKeyboard->setFixedSize(48, 48);
ui->btnKeyboard->setIconSize(QSize(24, 24));
ui->btnKeyboard->setToolTip(tr("VirtualKeyboard"));
ui->btnKeyboard->setFocusPolicy(Qt::NoFocus);
ui->btnKeyboard->installEventFilter(this);
@ -835,6 +819,7 @@ void LockWidget::initUI()
//initUserMenu();
ui->btnSwitchUser->setIcon(QIcon(":/image/assets/switchuser.svg"));
ui->btnSwitchUser->setIconSize(QSize(24, 24));
ui->btnSwitchUser->setToolTip(tr("SwitchUser"));
ui->btnSwitchUser->setFixedSize(48, 48);
ui->btnSwitchUser->setFocusPolicy(Qt::NoFocus);
ui->btnSwitchUser->setCheckable(true);
@ -846,9 +831,9 @@ void LockWidget::initUI()
//监听物理键盘插拔
libswitch = new LibinputSwitchEvent;
isTableMode = libswitch->geInitDevicesStatus();
if(isTableMode && !(vKeyboard && vKeyboard->isVisible())) {
showVirtualKeyboard();
}
// if(isTableMode && !(vKeyboard && vKeyboard->isVisible())) {
// showVirtualKeyboard();
// }
connect(libswitch , &LibinputSwitchEvent::tabletModeStatusChanged, this, [ = ](int tablet_mode) {
isTableMode = tablet_mode;
qInfo()<<"TableMode:"<<isTableMode;
@ -1004,9 +989,9 @@ void LockWidget::showPowerManager(bool keynavigation)
if(!authDialog->getLineeditStatus()) {
tabAt = LINEEDIT;
authDialog->setFocusin(IN_LINEEDIT);
if (m_isShowKeyboard && isTableMode && !(vKeyboard && vKeyboard->isVisible())) {
showVirtualKeyboard();
}
// if (m_isShowKeyboard && isTableMode && !(vKeyboard && vKeyboard->isVisible())) {
// showVirtualKeyboard();
// }
} else {
tabAt = MESSAGEBTN;
authDialog->setFocusin(ON_MESSAGEBTN);
@ -1087,7 +1072,8 @@ void LockWidget::showWarning(QVector<InhibitInfo::InhibitorInfo> &wlist, int typ
sureWidget->setFocus();
ui->widgetTime->hide();
ui->btnPowerManager->hide();
btnNetworkManager->hide();
//btnNetworkManager->hide();
widgetNetworkManager->hide();
ui->btnSwitchUser->hide();
ui->btnKeyboard->hide();
ui->btnBatteryStatus->hide();
@ -1109,7 +1095,8 @@ void LockWidget::switchToSureDialog(int type)
sureWidget->setFocus();
ui->widgetTime->hide();
ui->btnPowerManager->hide();
btnNetworkManager->hide();
widgetNetworkManager->hide();
//btnNetworkManager->hide();
ui->btnSwitchUser->hide();
ui->btnKeyboard->hide();
ui->btnBatteryStatus->hide();
@ -1123,7 +1110,8 @@ void LockWidget::hideSureDialog()
powermanager->show();
ui->widgetTime->show();
ui->btnPowerManager->show();
btnNetworkManager->show();
widgetNetworkManager->show();
//btnNetworkManager->show();
ui->btnSwitchUser->show();
ui->btnKeyboard->show();
ui->btnBatteryStatus->show();
@ -1142,7 +1130,8 @@ void LockWidget::confirmClicked()
authDialog->show();
ui->widgetTime->show();
ui->btnPowerManager->show();
btnNetworkManager->show();
widgetNetworkManager->show();
//btnNetworkManager->show();
ui->btnSwitchUser->show();
ui->btnKeyboard->show();
ui->btnBatteryStatus->show();
@ -1310,9 +1299,16 @@ int LockWidget::getNetStatus()
QString actLanName = "--";
QString actWifiName = "--";
activecon *act = kylin_network_get_activecon_info();
qInfo()<<"getNetStatus start";
activecon *act = NULL;
int count = 0;
kylin_network_get_activecon_info(&act, &count);
qInfo()<<"getNetStatus end";
if(!act)
return -1;
int index = 0;
while (act[index].con_name != NULL) {
while (act && index < count) {
if (QString(act[index].type) == "ethernet" || QString(act[index].type) == "802-3-ethernet") {
actLanName = QString(act[index].con_name);
}
@ -1321,6 +1317,9 @@ int LockWidget::getNetStatus()
}
index ++;
}
if (act) {
free(act);
}
// 设置图标
if (actLanName != "--") {
@ -1335,27 +1334,6 @@ int LockWidget::getNetStatus()
return ret;
}
void LockWidget::updateNetIcon(int status)
{
switch(status) {
case 0:
//有线
btnNetworkManager->setIcon(QIcon(":/image/assets/intel/icon-wired.png"));
break;
case 1:
//无线
btnNetworkManager->setIcon(QIcon(":/image/assets/intel/icon-wifi.png"));
break;
case 2:
//有线+无线
btnNetworkManager->setIcon(QIcon(":/image/assets/intel/icon-wired.png"));
break;
default:
//无连接
btnNetworkManager->setIcon(QIcon(":/image/assets/intel/icon-no-signal.png"));
}
}
void LockWidget::loadNetPlugin()
{
m_kylinNM = new QWidget(this);
@ -1458,13 +1436,79 @@ void LockWidget::setVirkeyboardPos()
{
if(vKeyboard)
{
vKeyboard->setGeometry(0,
height() - height()/3,
width(), height()/3);
// vKeyboard->setGeometry(0,
// height() - height()/3,
// width(), height()/3);
vKeyboard->adjustGeometry();
}
}
void LockWidget::SwitchToUser(QString strUserName)
{
bool isSwitchSelf = false;
if(authDialog) {
if (strUserName == authDialog->getCurAuthUserName()) {
isSwitchSelf = true;
} else {
authDialog->stopAuth();
}
}
if (!isSwitchSelf) {
this->hide();
if (!m_timerChkActive) {
m_timerChkActive = new QTimer(this);
m_timerChkActive->setInterval(10*1000);
connect(m_timerChkActive, &QTimer::timeout, this, [&,this](){
if (this->isHidden()) {
this->show();
}
m_timerChkActive->stop();
});
} else {
if (m_timerChkActive->isActive()) {
m_timerChkActive->stop();
}
}
m_timerChkActive->start();
}
QTimer::singleShot(10,this, [&,this, isSwitchSelf, strUserName](){
if(strUserName == "*Guest")
{
this->displayManager->switchToGuest();
}
else if(strUserName == "*SwitchUser")
{
this->displayManager->switchToGreeter();
}
else
{
if (!isSwitchSelf) {
if (GreeterService::instance()->isServiceActivatable()) {
GreeterService::instance()->SwitchToGreeterUser(strUserName);
displayManager->switchToGreeter();
} else {
displayManager->switchToUser(strUserName);
}
}
}
});
}
void LockWidget::onSessionActiveChanged(bool isActive)
{
if (isActive) {
if (m_timerChkActive && m_timerChkActive->isActive()) {
m_timerChkActive->stop();
}
if (this->isHidden()) {
this->show();
}
} else {
if (m_timerChkActive && m_timerChkActive->isActive()) {
m_timerChkActive->stop();
}
}
}
void LockWidget::initUserMenu()
{
@ -1508,7 +1552,7 @@ void LockWidget::initUserMenu()
QWidgetAction *action = new QWidgetAction(usersMenu);
HoverWidget *widget = new HoverWidget("");
widget->setStyleSheet("HoverWidget:hover{background-color:rgb(255,255,255,15%);border-radius: 6px;}");
widget->setObjectName("SwitchUser");
widget->setObjectName("*SwitchUser");
list.append(widget);
widget->setFixedSize(240, 40);
QLabel *iconlabel =new QLabel(widget);
@ -1522,7 +1566,7 @@ void LockWidget::initUserMenu()
textlabel->setFontSize(16);
textlabel->setGeometry(48,4,190,30);
action->setToolTip("SwitchUser");
action->setData("SwitchUser");
action->setData("*SwitchUser");
usersMenu->addAction(action);
list.append(widget);
}
@ -1543,7 +1587,7 @@ void LockWidget::initUserMenu()
QWidgetAction *action = new QWidgetAction(usersMenu);
HoverWidget *widget = new HoverWidget("");
widget->setStyleSheet("HoverWidget:hover{background-color:rgb(255,255,255,15%);border-radius: 6px;}");
widget->setObjectName("Guest");
widget->setObjectName("*Guest");
list.append(widget);
widget->setFixedSize(240, 40);
QLabel *iconlabel =new QLabel(widget);
@ -1556,7 +1600,7 @@ void LockWidget::initUserMenu()
KLabel *textlabel =new KLabel(widget);
textlabel->setFontSize(16);
textlabel->setGeometry(48,4,190,30);
action->setData("Guest");
action->setData("*Guest");
action->setToolTip("Guest");
usersMenu->addAction(action);
list.append(widget);
@ -1603,7 +1647,8 @@ void LockWidget::initUserMenu()
void LockWidget::keyReleaseEvent(QKeyEvent *e)
{
Q_EMIT keyGlobalRelease(e->key());
if (!QX11Info::isPlatformX11())
Q_EMIT keyGlobalRelease(e->key());
/* if (e->key() == 9) { // "Escape"
@ -1665,8 +1710,8 @@ void LockWidget::resizeEvent(QResizeEvent *event)
ui->btnKeyboard->move(width() - x, height() - y);
}
x = x + btnNetworkManager->width()+16;
btnNetworkManager->move(width() - x, height() - y);
x = x + widgetNetworkManager->width()+16;
widgetNetworkManager->move(width() - x, height() - y);
if(!ui->btnSwitchUser->isHidden()) {
x = x + ui->btnSwitchUser->width()+16;
@ -1830,11 +1875,6 @@ void LockWidget::onUserMenuTrigged(QAction *action)
{
qDebug() << action->data().toString() << "selected";
if(authDialog)
{
authDialog->stopAuth();
}
QString userName = action->data().toString();
for (int i =0; i < list.count(); i++)
{
@ -1846,18 +1886,7 @@ void LockWidget::onUserMenuTrigged(QAction *action)
"HoverWidget:hover:!pressed{background-color:rgb(255,255,255,15%);border-radius: 6px;}");
}
}
if(userName == "Guest")
{
displayManager->switchToGuest();
}
else if(userName == "SwitchUser")
{
displayManager->switchToGreeter();
}
else
{
displayManager->switchToUser(userName);
}
SwitchToUser(userName);
}
bool LockWidget::exitSubWidget()
@ -1878,7 +1907,7 @@ bool LockWidget::exitSubWidget()
setCheckedSheet(NETWORKBTN, false);
at_plugins = false;
if(tabAt == BOTTMBTN && horAT == NETWORKBTN)
btnNetworkManager->setStyleSheet(ON_TAB_SHEET);
widgetNetworkManager->setStyleSheet(ON_TAB_SHEET_WIDGET);
allExited = false;
} else if(vKeyboard && vKeyboard->isVisible()) {
vKeyboard->hide();
@ -2079,3 +2108,57 @@ void LockWidget::onAuthenticateCompete()
Q_EMIT closed();
}
void LockWidget::onCustomRequestAccount(QString account)
{
if (!displayManager)
return ;
bool isSwitchSelf = false;
if(authDialog) {
if (account == authDialog->getCurAuthUserName()) {
isSwitchSelf = true;
} else {
authDialog->stopAuth();
}
}
if(account == "*Guest") {
displayManager->switchToGuest();
} else if(account == "*SwitchUser") {
displayManager->switchToGreeter();
} else {
if (!isSwitchSelf) {
if (GreeterService::instance()->isValid()) {
GreeterService::instance()->SwitchToGreeterUser(account);
displayManager->switchToGreeter();
} else {
displayManager->switchToUser(account);
}
}
}
}
void LockWidget::onGetCustomPluginMsg(QString strMsg)
{
QJsonParseError jsonParseError;
const QJsonDocument jsonDoc = QJsonDocument::fromJson(strMsg.toUtf8(), &jsonParseError);
if (jsonParseError.error != QJsonParseError::NoError) {
qWarning()<<"Parse message json failed!!";
return ;
} else {
QJsonObject rootObj = jsonDoc.object();
if (rootObj.isEmpty()) {
qWarning()<<"Message Json is null!!";
return ;
} else {
QJsonObject contentObj = rootObj.value("Content").toObject();
if (!contentObj.isEmpty()) {
QJsonObject configObj = contentObj.value("Configures").toObject();
if (!configObj.isEmpty()) {
m_isCustomDefault = configObj.value("DefaultAuth").toBool(false);
m_isShowNetwork = configObj.value("ShowNetwork").toBool(true);
m_isShowUserSwitch = configObj.value("ShowUserSwitch").toBool(true);
}
}
}
}
}

View File

@ -35,6 +35,7 @@
#include "xeventmonitor.h"
#include "batterywidget.h"
#include "libinputswitchevent.h"
#include <libkydate.h>
namespace Ui {
class LockWidget;
@ -47,6 +48,11 @@ struct userInfo {
QDBusObjectPath userPath;
};
enum dateinfo {
DATE,
TIME,
};
QDBusArgument &operator <<(QDBusArgument &arg, const userInfo &usersInfo);
const QDBusArgument &operator >>(const QDBusArgument &arg, userInfo &usersInfo);
@ -95,6 +101,7 @@ public:
void onActiveLineedit();
QString getBatteryIconName();
void key_enter_release(int key);
void onSessionActiveChanged(bool isActive);
Q_SIGNALS:
void closed();
@ -105,7 +112,6 @@ private:
void initUI();
void initUserMenu();
void setVirkeyboardPos();
void updateNetIcon(int status);
bool getLoadStatus(const QString &name);
int getNetStatus();
void key_OB_release(int key);
@ -117,6 +123,7 @@ private:
void setBottomBtnSheet();
void setCheckedSheet(int type, bool show);
void netResetLocation();
QString getLongFormatDate(int type);
/**
* @brief IsDesktopStarted
@ -129,6 +136,8 @@ private:
*/
void setRootWindow();
void SwitchToUser(QString strUserName);
private Q_SLOTS:
void onUserAdded(const UserItem &user);
void onUserDeleted(const UserItem &user);
@ -155,6 +164,17 @@ private Q_SLOTS:
*/
void onAuthenticateCompete();
/**
* @brief onCustomRequestAccount
* @param account
*/
void onCustomRequestAccount(QString account);
/**
* @brief onGetCustomPluginMsg
* @param strMsg json
*/
void onGetCustomPluginMsg(QString strMsg);
protected:
bool eventFilter(QObject *obj, QEvent *event);
void resizeEvent(QResizeEvent *event);
@ -162,7 +182,7 @@ protected:
private:
Ui::LockWidget *ui;
AuthDialog *authDialog;
AuthDialog *authDialog = nullptr;
Configuration *configuration;
VirtualKeyboardWidget *vKeyboard = nullptr;
PowerManager *powermanager = nullptr;
@ -180,12 +200,13 @@ private:
QWidget *m_kylinNM = nullptr;
BatteryWidget *mBatteryWidget = nullptr;
QTabWidget *mkylinNM = nullptr;
QWidget *m_NetManagerWidget;
QWidget *m_NetManagerWidget = nullptr;
QStringList m_loginedUser;
bool isNetFinished = false;
int powermanagerType;
int nowAt = -1;
int loginedNum = 0;
QWidget *widgetNetworkManager = nullptr;
QPushButton *btnNetworkManager = nullptr;
bool m_isStartupMode = false;
bool is_switchBtn = true;
@ -208,6 +229,11 @@ private:
double curFontSize = 0;
QFuture<void> m_futureLoadDeskBg;
QTimer *m_timerChkActive = nullptr;
bool m_isCustomDefault = false; /** 是否默认使用第三方认证 */
bool m_isShowNetwork = true; /** 是否显示网络插件 */
bool m_isShowUserSwitch = true; /** 是否显示用户切换 */
};
#endif // LOCKWIDGET_H

View File

@ -23,7 +23,7 @@
</rect>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
<cursorShape>ArrowCursor</cursorShape>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
@ -85,7 +85,7 @@ QPushButton::pressed {
</rect>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
<cursorShape>ArrowCursor</cursorShape>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
@ -121,7 +121,7 @@ QPushButton::pressed {
</rect>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
<cursorShape>ArrowCursor</cursorShape>
</property>
<property name="styleSheet">
<string notr="true">QPushButton{
@ -154,7 +154,7 @@ QPushButton::pressed {
</rect>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
<cursorShape>ArrowCursor</cursorShape>
</property>
<property name="styleSheet">
<string notr="true">QPushButton::menu-indicator{

91
src/loginauthinterface.h Normal file
View File

@ -0,0 +1,91 @@
/*
* Copyright (C) 2023 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*
**/
#ifndef LOGIN_AUTH_INTERFACE_H
#define LOGIN_AUTH_INTERFACE_H
#include "loginplugininterface.h"
#define LOGINAUTH_CUSTOM_ID (0xFFFF)
/**
* @brief
*
*/
class LoginAuthInterface : public LoginPluginInterface
{
public:
/**
* @brief
*
*/
LoginAuthInterface(){}
/**
* @brief
*
*/
virtual ~LoginAuthInterface(){}
/**
* @brief
* @return
*/
int getPluginType() { return MODULETYPE_AUTH; }
/**
* @brief
* @return
*/
virtual void returnCommAuth() {}
/**
* @brief
* @param strName
* @return
*/
virtual void requestAuthAccount(QString strName) = 0;
/**
* @brief
* @param nUid id
* @param strName
* @return
*/
virtual void startAuthenticate(int nUid, QString strName) = 0;
/**
* @brief
* @param nUid id
* @param strName
* @return
*/
virtual void stopAuthenticate(int nUid, QString strName) = 0;
/**
* @brief authenticateResult
* @param nResult 0
* @param strMsg
*/
virtual void authenticateResult(int nResult, QString strMsg) = 0;
};
#define LoginAuthInterfaceIID "org.ukui.LoginAuthInterface"
Q_DECLARE_INTERFACE(LoginAuthInterface, LoginAuthInterfaceIID)
#endif // LOGIN_AUTH_INTERFACE_H

View File

@ -24,6 +24,7 @@
const static QString login1Service = QStringLiteral("org.freedesktop.login1");
const static QString login1Path = QStringLiteral("/org/freedesktop/login1");
const static QString propertiesInterface = QStringLiteral("org.freedesktop.DBus.Properties");
const static QString login1ManagerInterface = QStringLiteral("org.freedesktop.login1.Manager");
const static QString login1SessionInterface = QStringLiteral("org.freedesktop.login1.Session");
@ -34,12 +35,11 @@ LogindIntegration::LogindIntegration(QObject *parent)
login1Path,
login1ManagerInterface,
QDBusConnection::systemBus());
QDBusReply<QDBusObjectPath> sessionPath = loginInterface.call("GetSessionByPID",(quint32) QCoreApplication::applicationPid());
QDBusReply<QDBusObjectPath> sessionPath = loginInterface.call("GetSession", "auto");
if(!sessionPath.isValid()){
qWarning()<< "Get session error:" << sessionPath.error();
}
else{
QString session = sessionPath.value().path();
QDBusConnection::systemBus().connect(login1Service,
session,
@ -53,9 +53,56 @@ LogindIntegration::LogindIntegration(QObject *parent)
QStringLiteral("Unlock"),
this,
SIGNAL(requestUnlock()));
// 获取会话激活状态
QDBusInterface iface(login1Service,
session,
propertiesInterface,
QDBusConnection::systemBus());
QDBusReply<QVariant> reply = iface.call("Get", login1SessionInterface, "Active");
if (reply.isValid()) {
m_isSessionActive = reply.value().toBool();
qDebug()<<"Session is active:"<<m_isSessionActive;
} else {
qDebug() << "Failed to get session active state!";
}
// 监听属性变化
QDBusConnection::systemBus().connect(login1Service,
session,
propertiesInterface,
"PropertiesChanged",
this,
SLOT(onSessionPropChanged(QString, QVariantMap, QStringList)));
}
return;
}
LogindIntegration::~LogindIntegration() = default;
LogindIntegration::~LogindIntegration()
{
}
void LogindIntegration::onSessionPropChanged(QString strInterface, QVariantMap mapVar, QStringList listValue)
{
if (login1SessionInterface == strInterface) {
qDebug()<<"onSessionPropChanged:"<<strInterface<<mapVar<<listValue;
QVariantMap::iterator itVar = mapVar.begin();
for ( ; itVar != mapVar.end(); itVar++) {
if (itVar.key() == "Active") {
QVariant varValue = itVar.value();
m_isSessionActive = varValue.toBool();
if (!m_isSessionActive) {
Q_EMIT requestLock();
}
Q_EMIT sessionActiveChanged(m_isSessionActive);
break;
}
}
}
}
bool LogindIntegration::isSessionActive()
{
return m_isSessionActive;
}

View File

@ -19,6 +19,7 @@
#define LOGIND_H
#include <QDBusConnection>
#include <QVariantMap>
#include <QObject>
class QDBusServiceWatcher;
@ -28,15 +29,20 @@ class LogindIntegration : public QObject
Q_OBJECT
public:
explicit LogindIntegration(QObject *parent = nullptr);
~LogindIntegration() override;
virtual ~LogindIntegration();
bool isSessionActive();
public Q_SLOTS:
void onSessionPropChanged(QString, QVariantMap, QStringList);
Q_SIGNALS:
void requestLock();
void requestUnlock();
void connectedChanged();
void sessionActiveChanged(bool isActive);
private:
bool m_isSessionActive = false;
};
#endif

View File

@ -26,6 +26,7 @@
#include "configuration.h"
#include "klabel.h"
#include <imageutil.h>
#include "pluginsloader.h"
#include <QLabel>
#include <QVBoxLayout>
@ -39,6 +40,11 @@
#include <QImage>
#include <QApplication>
#include <QToolTip>
#include <QJsonValue>
#include <QJsonObject>
#include <QJsonDocument>
#include <QJsonArray>
#include <QJsonParseError>
#define ON_TAB_SHEET "QPushButton{background-color: rgba(255,255,255,15%); border-radius: 4px; border: 2px solid #2C73C8;}"
#define ON_NORMAL_SHEET "QPushButton{background-color: rgba(255,255,255,15%); border-radius: 4px; border: none;}\
@ -112,7 +118,6 @@ void LoginOptionsWidget::initConnections()
this, &LoginOptionsWidget::onFrameWritten);
connect(m_biomericProxy, &BiometricProxy::USBDeviceHotPlug,
this, &LoginOptionsWidget::onUSBDeviceHotPlug);
readDevicesInfo();
}
connect(m_btnGroup, SIGNAL(buttonClicked(int)), this, SLOT(onOptionSelected(int)));
}
@ -153,7 +158,7 @@ DeviceInfoPtr LoginOptionsWidget::getFirstDevInfo()
DeviceMap::iterator itDevInfo = m_mapDevices.begin();
for (; itDevInfo != m_mapDevices.end(); itDevInfo++) {
for (auto devinfo : itDevInfo.value()) {
if (devinfo && devinfo->id == nDrvId) {
if (devinfo && devinfo->id == nDrvId && devinfo->deviceType != UniT_Custom) {
if (!isDeviceDisable(devinfo->id)) {
devInfo = devinfo;
break;
@ -169,7 +174,7 @@ DeviceInfoPtr LoginOptionsWidget::getFirstDevInfo()
DeviceMap::iterator itDevInfo = m_mapDevices.begin();
for (; itDevInfo != m_mapDevices.end(); itDevInfo++) {
for (auto devinfo : itDevInfo.value()) {
if (devinfo && !isDeviceDisable(devinfo->id)) {
if (devinfo && !isDeviceDisable(devinfo->id) && devinfo->deviceType != UniT_Custom) {
devInfo = devinfo;
break;
}
@ -179,7 +184,7 @@ DeviceInfoPtr LoginOptionsWidget::getFirstDevInfo()
}
}
}
return devInfo;
return DeviceInfoPtr(devInfo);
}
DeviceInfoPtr LoginOptionsWidget::getWechatDevice()
@ -199,7 +204,7 @@ DeviceInfoPtr LoginOptionsWidget::getWechatDevice()
break;
}
}
return devInfo;
return DeviceInfoPtr(devInfo);
}
void LoginOptionsWidget::addOptionButton(unsigned uLoginOptType, int nDrvId, QString strDrvName)
@ -252,9 +257,28 @@ void LoginOptionsWidget::addOptionButton(unsigned uLoginOptType, int nDrvId, QSt
case LOGINOPT_TYPE_QRCODE:
iconPixmap = loadSvg(":/image/assets/ukui-loginopt-qrcode.svg", "white", 16);
break;
case LOGINOPT_TYPE_CUSTOM:
{
LoginAuthInterface *plugin = dynamic_cast<LoginAuthInterface *>(PluginsLoader::instance().findModulesByType(LoginPluginInterface::MODULETYPE_AUTH).values().first());
QString strIcon = plugin->icon();
if (strIcon.startsWith("/")) {
if (strIcon.endsWith(".svg")) {
iconPixmap = loadSvg(strIcon, "white", 16);
} else {
iconPixmap.load(strIcon);
iconPixmap.scaled(40, 40);
}
} else {
iconPixmap = QIcon::fromTheme(strIcon).pixmap(48,48).scaled(40, 40);
}
if (iconPixmap.isNull()) {
iconPixmap = loadSvg(":/image/assets/ukui-loginopt-custom.svg", "white", 16);
}
}
break;
}
newButton->setIcon(iconPixmap);
//newLabel->setPixmap(iconPixmap);
newButton->setIcon(iconPixmap);
newButton->setToolTip(strDrvName);
sysFont.setPointSize((14 + curFontSize) *m_ptToPx);
QToolTip::setFont(sysFont);
@ -295,16 +319,20 @@ bool LoginOptionsWidget::getHasUkeyOptions()
void LoginOptionsWidget::updateOptionButtons()
{
isShowUkey = false;
bool hasCustom = false;
clearOptionButtons();
addOptionButton(LOGINOPT_TYPE_PASSWORD, -1, tr("Password"));
DeviceMap::iterator itMapDev = m_mapDevices.begin();
for ( ; itMapDev != m_mapDevices.end(); itMapDev++) {
for (DeviceInfoPtr devPtr : itMapDev.value()) {
if (devPtr) {
if(devPtr->deviceType == LOGINOPT_TYPE_GENERAL_UKEY){
if(devPtr->deviceType == UniT_General_Ukey){
//ukey 设备类型排在二维码前,但实际上应该显示在二维码之后,因此暂时不添加
isShowUkey = true;
continue;
} else if (devPtr->deviceType == UniT_Custom) {
hasCustom = true;
continue;
}
addOptionButton(itMapDev.key(), devPtr->id, DeviceType::getDeviceType_tr(devPtr->deviceType));
}
@ -312,12 +340,14 @@ void LoginOptionsWidget::updateOptionButtons()
}
itMapDev = m_mapDevices.begin();
if(isShowUkey){
if(isShowUkey || hasCustom){
for ( ; itMapDev != m_mapDevices.end(); itMapDev++) {
for (DeviceInfoPtr devPtr : itMapDev.value()) {
if(devPtr && devPtr->deviceType == LOGINOPT_TYPE_GENERAL_UKEY){
if(devPtr && devPtr->deviceType == UniT_General_Ukey){
//此处才添加ukey
addOptionButton(itMapDev.key(), devPtr->id, DeviceType::getDeviceType_tr(devPtr->deviceType));
} else if (devPtr && devPtr->deviceType == UniT_Custom) {
addOptionButton(itMapDev.key(), devPtr->id, tr("Other"));
}
}
}
@ -330,7 +360,7 @@ void LoginOptionsWidget::updateOptionButtons()
}
qDebug()<<"m_mapOptBtns.size():"<<m_mapOptBtns.size();
if (m_mapOptBtns.size() <= 2 && !isShowUkey) {
if (m_mapOptBtns.size() <= 2 && (!isShowUkey && !m_mapDevices.contains(LOGINOPT_TYPE_CUSTOM))) {
//因为默认添加一个密码选项因此当ukey没有显示出来时按钮数小于等于2时就隐藏选项界面
m_labelOptTitle->hide();
QMap<int, QPushButton*>::iterator itMapBtn = m_mapOptBtns.begin();
@ -349,7 +379,9 @@ void LoginOptionsWidget::updateOptionButtons()
}
}
m_mapOptBtns[-1]->hide();
if(m_mapOptBtns.size() == 2 && isShowUkey) {
if(m_mapOptBtns.size() == 2 && (isShowUkey || m_mapDevices.contains(LOGINOPT_TYPE_CUSTOM))) {
m_mapOptBtns[-1]->show();
} else if (m_mapOptBtns.size() == 3 && isShowUkey && m_mapDevices.contains(LOGINOPT_TYPE_CUSTOM)) {
m_mapOptBtns[-1]->show();
}
}
@ -390,10 +422,28 @@ void LoginOptionsWidget::readDevicesInfo()
}
}
}
// 检查是否有第三方认证插件
if (PluginsLoader::instance().findModulesByType(LoginPluginInterface::MODULETYPE_AUTH).size() > 0) {
LoginAuthInterface *plugin = dynamic_cast<LoginAuthInterface *>(PluginsLoader::instance() \
.findModulesByType(LoginPluginInterface::MODULETYPE_AUTH) \
.values().first());
DeviceInfoPtr deviceInfoPtr = std::make_shared<DeviceInfo>();
deviceInfoPtr->id = LOGINAUTH_CUSTOM_ID;
deviceInfoPtr->shortName = CUSTOM_PLUGIN_DEV_PREFIX+plugin->name();
deviceInfoPtr->deviceType = UniT_Custom;
m_mapDevices[LOGINOPT_TYPE_CUSTOM].push_back(deviceInfoPtr);
}
updateOptionButtons();
}
QString LoginOptionsWidget::getCustomDevName()
{
if (m_mapDevices.contains(LOGINOPT_TYPE_CUSTOM)) {
return m_mapDevices[LOGINOPT_TYPE_CUSTOM].first()->shortName;
}
return "";
}
void LoginOptionsWidget::SetExtraInfo(QString extra_info, QString info_type)
{
if(!m_biomericProxy)
@ -461,12 +511,22 @@ void LoginOptionsWidget::startAuth_()
m_isInAuth = true;
m_dupFD = -1;
Q_EMIT setLoadingImage();
m_biomericProxy->StopOps(m_curDevInfo->id);
QDBusPendingCall call = m_biomericProxy->Identify(m_curDevInfo->id, m_uid);
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(call, this);
connect(watcher, &QDBusPendingCallWatcher::finished,
this, &LoginOptionsWidget::onIdentifyComplete);
if (m_curDevInfo->deviceType == UniT_Custom) {
LoginAuthInterface *authPlugin = getCustomLoginAuth();
if (authPlugin) {
struct passwd *pwdInfo = getpwuid(m_uid);
if (pwdInfo) {
authPlugin->startAuthenticate(m_uid, pwdInfo->pw_name);
}
}
} else {
Q_EMIT setLoadingImage();
m_biomericProxy->StopOps(m_curDevInfo->id);
QDBusPendingCall call = m_biomericProxy->Identify(m_curDevInfo->id, m_uid);
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(call, this);
connect(watcher, &QDBusPendingCallWatcher::finished,
this, &LoginOptionsWidget::onIdentifyComplete);
}
}
void LoginOptionsWidget::stopAuth()
@ -476,7 +536,17 @@ void LoginOptionsWidget::stopAuth()
{
return;
}
m_biomericProxy->StopOps(m_curDevInfo->id);
if (m_curDevInfo->deviceType == UniT_Custom) {
LoginAuthInterface *authPlugin = getCustomLoginAuth();
if (authPlugin) {
struct passwd *pwdInfo = getpwuid(m_uid);
if (pwdInfo) {
authPlugin->stopAuthenticate(m_uid, pwdInfo->pw_name);
}
}
} else {
m_biomericProxy->StopOps(m_curDevInfo->id);
}
if(m_retrytimer&&m_retrytimer->isActive()){
m_retrytimer->stop();
delete m_retrytimer;
@ -563,7 +633,7 @@ void LoginOptionsWidget::onIdentifyComplete(QDBusPendingCallWatcher *watcher)
void LoginOptionsWidget::onFrameWritten(int drvid)
{
if ((m_curDevInfo && m_curDevInfo->id != drvid) || !m_isInAuth) {
if (!m_curDevInfo || m_curDevInfo->id != drvid || !m_isInAuth) {
return ;
}
if(m_dupFD == -1){
@ -577,7 +647,7 @@ void LoginOptionsWidget::onFrameWritten(int drvid)
lseek(m_dupFD, 0, SEEK_SET);
char base64_bufferData[1024*1024];
int rc = read(m_dupFD, base64_bufferData, 1024*1024);
printf("rc = %d\n", rc);
// printf("rc = %d\n", rc);
cv::Mat mat2(1, sizeof(base64_bufferData), CV_8U, base64_bufferData);
img = cv::imdecode(mat2, cv::IMREAD_COLOR);
@ -914,6 +984,9 @@ int LoginOptionsWidget::convertDeviceType(int nDevType)
case UniT_Remote:
nLoginOptType = LOGINOPT_TYPE_QRCODE;
break;
case UniT_Custom:
nLoginOptType = LOGINOPT_TYPE_CUSTOM;
break;
default:
nLoginOptType = LOGINOPT_TYPE_OTHERS;
break;
@ -1069,7 +1142,7 @@ QString LoginOptionsWidget::getDefaultDevice(QString strUserName)
}
}
}
return defaultDeviceName;
return QString(defaultDeviceName);
} else {
return GetDefaultDevice(strUserName);
}
@ -1102,6 +1175,13 @@ QStringList LoginOptionsWidget::getAllDefDevices()
listDefDevices.push_back(defaultDeviceName);
}
}
return listDefDevices;
return QStringList(listDefDevices);
}
LoginAuthInterface* LoginOptionsWidget::getCustomLoginAuth()
{
if (PluginsLoader::instance().findModulesByType(LoginPluginInterface::MODULETYPE_AUTH).values().size() <= 0) {
return nullptr;
}
return dynamic_cast<LoginAuthInterface *>(PluginsLoader::instance().findModulesByType(LoginPluginInterface::MODULETYPE_AUTH).values().first());
}

View File

@ -22,6 +22,7 @@
#include "biometricproxy.h"
#include "biometricdeviceinfo.h"
#include "uniauthservice.h"
#include "loginauthinterface.h"
class QLabel;
class KLabel;
@ -44,6 +45,7 @@ typedef enum {
UniT_General_Ukey, /** 普通的Ukey **/
UniT_Advanced_Ukey, /** 高阶的Ukey **/
UniT_Remote, /** 远程账户 **/
UniT_Custom = 0xFFFF /** 第三方 **/
}BioType;
enum OPTION{
@ -54,6 +56,8 @@ enum OPTION{
FirstDevice,
};
#define CUSTOM_PLUGIN_DEV_PREFIX ("Custom:")
class LoginOptionsWidget : public QWidget
{
Q_OBJECT
@ -85,6 +89,7 @@ public:
void setSelectedPassword();
void updateUIStatus();
int getVisibleLoginOptCount();
QString getCustomDevName();
/**
* @brief
@ -106,6 +111,8 @@ public:
return m_isInAuth;
}
LoginAuthInterface* getCustomLoginAuth();
QPixmap loadSvg(QString path, QString color, int size);
public Q_SLOTS:
void readDevicesInfo();
@ -125,6 +132,8 @@ Q_SIGNALS:
void updateAuthMsg(QString strMsg);
void setLoadingImage();
void deviceCountChanged(int num);
void customPluginMsg(QString strMsg);
private:
void initUI();
void initConnections();

137
src/loginplugininterface.h Normal file
View File

@ -0,0 +1,137 @@
/*
* Copyright (C) 2023 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*
**/
#ifndef LOGINPLUGININTERFACE_H
#define LOGINPLUGININTERFACE_H
#include <QString>
#include <QWidget>
#include <QStringLiteral>
#define LOGINPLUGIN_VERSION "1.0.0"
/**
* @brief
*
*/
class LoginPluginInterface
{
public:
/**
* @brief
*
*/
enum ModuleType{
MODULETYPE_AUTH,
MODULETYPE_TOOL,
MODULETYPE_MAX
};
/**
* @brief
*
*/
enum LoginPluginEnv {
LOGINPLUGINENV_LOGIN, // 登录
LOGINPLUGINENV_LOCKSCREEN, // 锁屏
};
/**
* @brief
*
*/
LoginPluginInterface(){}
/**
* @brief
*
*/
virtual ~LoginPluginInterface(){}
/**
* @brief
* @return
*/
virtual QString getPluginName() = 0;
/**
* @brief
* @return
*/
virtual QString name() = 0;
/**
* @brief
* @return
*/
virtual int getPluginType() = 0;
/**
* @brief
* @return
*/
virtual QString icon() = 0;
/**
* @brief
* @param
* @return
*/
virtual QWidget* getPluginMainWnd(QWidget *parent = nullptr) = 0;
/**
* @brief
* @return true false
*/
virtual bool needLoad() = 0;
/**
* @brief
* @param
* @return
*/
virtual void setBackground(QString strPicPath) {}
/**
* @brief
* @return LoginPluginEnv
*/
virtual int getLoginPluginEnv() = 0;
/**
* @brief
* @return version
*/
QString getVersion() { return LOGINPLUGIN_VERSION; }
/**
* @brief onMessage
* @param strMsgJson json格式数据
* @return json格式数据
*/
virtual QString onMessage(QString strMsgJson) = 0;
/**
* @brief onRequest
* @param strReqJson json格式数据
* @return json格式数据
*/
virtual QString onRequest(QString strReqJson) = 0;
};
#define LoginPluginInterfaceIID "org.ukui.LoginPluginInterface"
Q_DECLARE_INTERFACE(LoginPluginInterface, LoginPluginInterfaceIID)
#endif // LOGINPLUGININTERFACE_H

113
src/pluginsloader.cpp Normal file
View File

@ -0,0 +1,113 @@
/*
* Copyright (C) 2023 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*
**/
#include "pluginsloader.h"
#include "loginplugininterface.h"
#include <QDebug>
#include <QDir>
#include <QLibrary>
#include <QPluginLoader>
#include <QApplication>
const QString gPluginDir = "/usr/lib/ukui-greeter/plugins";
PluginsLoader::PluginsLoader(QObject *parent)
: QThread(parent)
{
}
PluginsLoader::~PluginsLoader()
{
}
PluginsLoader &PluginsLoader::instance()
{
static PluginsLoader pluginsLoader;
return pluginsLoader;
}
LoginPluginInterface *PluginsLoader::findModuleByName(const QString &name) const
{
return m_plugins.value(name, nullptr).data();
}
QMap<QString, LoginPluginInterface*> PluginsLoader::findModulesByType(const int type) const
{
QMap<QString, LoginPluginInterface *> modules;
for (QSharedPointer<LoginPluginInterface> module : m_plugins.values()) {
if (module.isNull()) {
continue;
}
if (module->getPluginType() == type) {
modules.insert(module->name(), module.data());
}
}
return modules;
}
void PluginsLoader::run()
{
findModule(gPluginDir);
}
void PluginsLoader::findModule(const QString &path)
{
QDir dir(path);
if (!dir.exists()) {
qInfo() << path << "is not exists.";
return;
}
const QFileInfoList modules = dir.entryInfoList();
for (QFileInfo module : modules) {
const QString path = module.absoluteFilePath();
if (!QLibrary::isLibrary(path)) {
continue;
}
qInfo() << module << "is found";
QPluginLoader loader(path);
LoginPluginInterface *moduleInstance = dynamic_cast<LoginPluginInterface *>(loader.instance());
if (!moduleInstance) {
qWarning() << loader.errorString();
continue;
}
if (!moduleInstance->needLoad()) {
continue;
}
if (m_plugins.contains(moduleInstance->name())) {
continue;
}
QObject *obj = dynamic_cast<QObject*>(moduleInstance);
if (obj)
obj->moveToThread(qApp->thread());
m_plugins.insert(moduleInstance->name(), QSharedPointer<LoginPluginInterface>(moduleInstance));
emit moduleFound(moduleInstance);
}
}
void PluginsLoader::removeModule(const QString &moduleKey)
{
if (!m_plugins.contains(moduleKey))
return;
m_plugins.remove(moduleKey);
}

108
src/pluginsloader.h Normal file
View File

@ -0,0 +1,108 @@
/*
* Copyright (C) 2023 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*
**/
#ifndef PLUGINSLOADER_H
#define PLUGINSLOADER_H
#include <QThread>
#include <QMap>
#include <QSharedPointer>
class LoginPluginInterface;
/**
* @brief
*
*/
class PluginsLoader : public QThread
{
Q_OBJECT
public:
/**
* @brief
*
* @return PluginsLoader
*/
static PluginsLoader &instance();
/**
* @brief
*
* @return QMap<QString, QSharedPointer<LoginPluginInterface> >
*/
inline QMap<QString, QSharedPointer<LoginPluginInterface>> moduleList() { return m_plugins; }
/**
* @brief
*
* @param name
* @return LoginPluginInterface
*/
LoginPluginInterface *findModuleByName(const QString &name) const;
/**
* @brief
*
* @param type
* @return QMap<QString, LoginPluginInterface *>
*/
QMap<QString, LoginPluginInterface *> findModulesByType(const int type) const;
/**
* @brief
*
* @param moduleName
*/
void removeModule(const QString &moduleName);
Q_SIGNALS:
/**
* @brief
*
* @param
*/
void moduleFound(LoginPluginInterface *);
protected:
/**
* @brief
*
*/
void run() override;
private:
/**
* @brief
*
* @param parent
*/
explicit PluginsLoader(QObject *parent = nullptr);
/**
* @brief
*
*/
virtual ~PluginsLoader();
/**
* @brief
*
* @param path
*/
void findModule(const QString &path);
private:
QMap<QString, QSharedPointer<LoginPluginInterface>> m_plugins; /** 插件实例列表 */
};
#endif // PLUGINSLOADER_H

View File

@ -92,7 +92,8 @@ PowerManager::PowerManager(int num, QWidget *parent)
}
initUI();
resize((ITEM_WIDTH+ITEM_SPACING*2)*this->count()-ITEM_SPACING*2, ITEM_HEIGHT+ITEM_SPACING*2);
//resize((ITEM_WIDTH+ITEM_SPACING*2)*this->count()-ITEM_SPACING*2, ITEM_HEIGHT+ITEM_SPACING*2);
resize((ITEM_WIDTH)*this->count(), ITEM_HEIGHT);
//setCurrentRow(0);
loginedNum = num;
}
@ -598,12 +599,13 @@ void PowerManager::showNormalSize()
}
// resize(ITEM_WIDTH*this->count(),ITEM_HEIGHT);
// resize((ITEM_WIDTH+ITEM_SPACING)*this->count(), ITEM_HEIGHT+ITEM_SPACING);
resize((ITEM_WIDTH+ITEM_SPACING*2)*this->count()-ITEM_SPACING*2, ITEM_HEIGHT+ITEM_SPACING*2);
// resize((ITEM_WIDTH+ITEM_SPACING*2)*this->count()-ITEM_SPACING*2, ITEM_HEIGHT+ITEM_SPACING*2);
resize((ITEM_WIDTH)*this->count(), ITEM_HEIGHT);
}
void PowerManager::initUI()
{
setSpacing(30);
// setSpacing(30);
// actService = new QDBusInterface("org.freedesktop.Accounts",
// "/org/freedesktop/Accounts",
@ -669,10 +671,13 @@ void PowerManager::initUI()
rebootLabel->setAlignment(Qt::AlignCenter);
rebootFace->setIcon(QIcon(":/image/assets/reboot.svg"));
rebootFace->setIconSize(QSize(48, 48));
rebootFace->setToolTip(tr("Close all apps, turn off your computer, and then turn your computer back on"));
rebootLabel->setFontSize(16);
rebootLabel->setText(tr("Restart"));
rebootLabel->setElideText(tr("Restart"), 130);
//rebootLabel->setText(tr("Restart"));
rebootWidget->setFixedSize(ITEM_WIDTH,ITEM_HEIGHT);
QVBoxLayout *rebootlayout = new QVBoxLayout(rebootWidget);
rebootlayout->setAlignment(Qt::AlignHCenter);
rebootlayout->addWidget(rbLabelWidget);
rebootlayout->addWidget(rebootLabel);
//rebootWidget->installEventFilter(this);
@ -689,11 +694,14 @@ void PowerManager::initUI()
shutdownFace->installEventFilter(this);
shutdownFace->setIcon(QIcon(":/image/assets/shutdown.svg"));
shutdownFace->setIconSize(QSize(48, 48));
shutdownFace->setToolTip(tr("Close all apps, and then shut down your computer"));
//sysFont.setPointSize(20);
shutdownLabel->setFontSize(16);
shutdownLabel->setText(tr("Shut Down"));
shutdownLabel->setElideText(tr("Shut Down"), 130);
//shutdownLabel->setText(tr("Shut Down"));
shutdownWidget->setFixedSize(ITEM_WIDTH, ITEM_HEIGHT);
QVBoxLayout *shutdownlayout = new QVBoxLayout(shutdownWidget);
shutdownlayout->setAlignment(Qt::AlignHCenter);
shutdownlayout->addWidget(shLabelWidget);
shutdownlayout->addWidget(shutdownLabel);
//shutdownWidget->installEventFilter(this);
@ -718,10 +726,12 @@ void PowerManager::initUI()
hibernateFace->installEventFilter(this);
hibernateFace->setIcon(QIcon(":/image/assets/hibernate.svg"));
hibernateFace->setIconSize(QSize(48, 48));
hibernateFace->setToolTip(tr("Turn off your computer, but the app stays open. When the computer is turned on, it can be restored to the state you left"));
hibernateLabel->setFontSize(16);
hibernateLabel->setText(tr("Hibernate"));
hibernateLabel->setElideText(tr("Hibernate"), 130);
hibernateWidget->setFixedSize(ITEM_WIDTH,ITEM_HEIGHT);
QVBoxLayout *hibernatelayout = new QVBoxLayout(hibernateWidget);
hibernatelayout->setAlignment(Qt::AlignHCenter);
hibernatelayout->addWidget(hbLabelWidget);
hibernatelayout->addWidget(hibernateLabel);
//hibernateWidget->installEventFilter(this);
@ -747,10 +757,12 @@ void PowerManager::initUI()
suspendFace->installEventFilter(this);
suspendFace->setIcon(QIcon(":/image/assets/suspend.svg"));
suspendFace->setIconSize(QSize(48, 48));
suspendLabel->setFontSize(16);
suspendLabel->setText(tr("Suspend"));
suspendFace->setToolTip(tr("The computer stays on, but consumes less power. The app stays open and can quickly wake up and revert to where you left off"));
suspendWidget->setFixedSize(ITEM_WIDTH,ITEM_HEIGHT);
suspendLabel->setFontSize(16);
suspendLabel->setElideText(tr("Suspend"), 130);
QVBoxLayout *suspendlayout = new QVBoxLayout(suspendWidget);
suspendlayout->setAlignment(Qt::AlignHCenter);
suspendlayout->addWidget(spLabelWidget);
suspendlayout->addWidget(suspendLabel);
//suspendWidget->installEventFilter(this);

View File

@ -32,7 +32,7 @@
class QWidget;
class PowerManager:public QWidget
#else
#define ITEM_WIDTH 144
#define ITEM_WIDTH 204
#define ITEM_HEIGHT 200
#define ITEM_SPACING 30
@ -41,7 +41,7 @@ enum stateType {
SHUTDOWN,
SLEEP,
HIBERNATE,
NOTHING,
NOTHING
};
class QLabel;

View File

@ -166,6 +166,8 @@ SessionWatcher::SessionWatcher(QObject *parent) : QObject(parent)
stylesettings = new QGSettings(STYLE_TYPE_SCHEMA,"",this);
double fontSize = stylesettings->get("systemFontSize").toDouble();
setValue("fontSize",fontSize - defaultFontSize);
QString themeColor = stylesettings->get("themeColor").toString();
setValue("themeColor", themeColor);
connect(stylesettings, &QGSettings::changed,
this, &SessionWatcher::onConfigurationTimeTpChanged);
}
@ -197,6 +199,9 @@ void SessionWatcher::onConfigurationTimeTpChanged(QString key)
} else if (key == "systemFontSize") {
double fontSize = stylesettings->get("systemFontSize").toDouble() - defaultFontSize;
setValue("fontSize", fontSize);
} else if (key == "themeColor") {
QString themeColor = stylesettings->get("themeColor").toString();
setValue("themeColor", themeColor);
}
}

View File

@ -30,6 +30,7 @@ SureWindow::SureWindow(QWidget *parent) :
curFontSize = configuration->getFontSize();
m_ptToPx = configuration->getPtToPx();
ui->tipLabel->setFontSize(14 + curFontSize);
ui->tipLabel->setFixedWidth(this->width() - 20);
//ui->tipLabel->setWordWrap(true);
connect(ui->cancelBtn, &QPushButton::clicked, this, [&]() { emit cantelButtonclicked(); });
connect(ui->confirmBtn, &QPushButton::clicked, this, [&]() { emit confirmButtonclicked(); });
@ -42,6 +43,7 @@ SureWindow::~SureWindow()
void SureWindow::setTips(const QString tips)
{
ui->tipLabel->setFixedWidth(this->width());
ui->cancelBtn->setStyleSheet("QPushButton{background: rgba(255, 255, 255, 0.2);border-radius: 8px;color: white;}"
"QPushButton:hover{background: rgba(255, 255, 255, 0.4);border-radius: 8px;}"
"QPushButton:pressed {background: rgba(255, 255, 255, 0.3);border-radius: 8px;}");
@ -54,29 +56,28 @@ void SureWindow::setTips(const QString tips)
ui->confirmBtn->show();
ui->tipLabel->show();
ui->listView->hide();
ui->tipLabel->setText(tips);
ui->tipLabel->setElideText(tips, this->width());
}
void SureWindow::setWarning(QVector<InhibitInfo::InhibitorInfo> &list, int type)
{
ui->tipLabel->setFixedWidth(this->width());
switch (type) {
case 0:
ui->tipLabel->setText(tr("The following program is running to prevent the system from reboot!"));
ui->tipLabel->setElideText(tr("The following program is running to prevent the system from reboot!"), this->width() - 20);
break;
case 1:
ui->tipLabel->setText(tr("The following program is running to prevent the system from shutting down!"));
ui->tipLabel->setElideText(tr("The following program is running to prevent the system from shutting down!"), this->width() - 20);
break;
case 2:
ui->tipLabel->setText(tr("The following program is running to prevent the system from suspend!"));
ui->tipLabel->setElideText(tr("The following program is running to prevent the system from suspend!"), this->width() - 20);
break;
case 3:
ui->tipLabel->setText(tr("The following program is running to prevent the system from hibernate!"));
ui->tipLabel->setElideText(tr("The following program is running to prevent the system from hibernate!"), this->width() - 20);
break;
default:
break;
}
ui->tipLabel->adjustSize();
adjustSize();
ui->listView->show();
QStandardItemModel *model = new QStandardItemModel(this);
@ -101,7 +102,6 @@ void SureWindow::setWarning(QVector<InhibitInfo::InhibitorInfo> &list, int type)
ui->listView->setIconSize(QSize(32,32));
ui->listView->setModel(model);
ui->listView->setFixedSize(520, 320);
adjustSize();
ui->cancelBtn->setFixedSize(120, 48);
ui->confirmBtn->hide();

View File

@ -55,6 +55,9 @@
<property name="text">
<string>TextLabel</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>

View File

@ -26,8 +26,10 @@
#include <QDateTime>
#include <QWidget>
#include <QDebug>
#include <QX11Info>
#include <QDesktopWidget>
#include <QDBusInterface>
#include <QEventLoop>
#include "plasma-shell-manager.h"
#include <signal.h>
#include <unistd.h>
@ -39,11 +41,13 @@
#include <ukui-log4qt.h>
#include "fullbackgroundwidget.h"
#include "configuration.h"
#include "pluginsloader.h"
#define CACHE_DIR "/.cache/ukui-screensaver/"
#define DOUBLE 2
#define MAX_FILE_SIZE 1024 * 1024
#define LOG_FILE0 "screensaver_0.log"
#define LOG_FILE1 "screensaver_1.log"
#include <LayerShellQt/Shell>
#define GSETTINGS_SCHEMA_SCREENSAVER "org.ukui.screensaver"
#define KEY_LOCK_ENABLED "lock-enabled"
@ -130,6 +134,8 @@ void handler(int signum)
#define WORKING_DIRECTORY "/usr/share/ukui-screensaver"
int main(int argc, char *argv[])
{
LayerShellQt::Shell::useLayerShell();
if(argc < 2)
return 0;
@ -154,6 +160,30 @@ int main(int argc, char *argv[])
QApplication a(argc, argv);
QApplication::setSetuidAllowed(true);
LogindIntegration *m_logind = new LogindIntegration(&a);
QObject::connect(m_logind, &LogindIntegration::requestUnlock, [=]() {
if (window) {
window->closeScreensaver();
} else {
exit(0);
}
});
if (!m_logind->isSessionActive()) {
QEventLoop *loopTemp = new QEventLoop(&a);
QObject::connect(m_logind, &LogindIntegration::sessionActiveChanged, [loopTemp](bool isActive) {
qDebug()<<"sessionActiveChanged:"<<isActive;
if (isActive && loopTemp->isRunning()) {
loopTemp->quit();
}
});
QObject::connect(m_logind, &LogindIntegration::requestLock, [loopTemp]() {
qDebug()<<"session requestLock!";
if (loopTemp->isRunning()) {
loopTemp->quit();
}
});
loopTemp->exec();
}
//命令行参数解析
QCommandLineParser parser;
@ -183,16 +213,24 @@ int main(int argc, char *argv[])
parser.addOptions({lockOption, lstOption,sessionIdleOption , screensaverOption,blankOption,lscreensaverOption,delayOption,hasLockOption});
parser.process(a);
if(!parser.isSet(sessionIdleOption)
&& !parser.isSet(lockOption)
&& !parser.isSet(lstOption)
&& !parser.isSet(screensaverOption)
&& !parser.isSet(lscreensaverOption)
&& !parser.isSet(blankOption))
{
return 0;
QString strHostCloundPlatform = Configuration::instance()->getHostCloudPlatform();
qDebug()<<"HostCloundPlatform:"<<strHostCloundPlatform;
if (strHostCloundPlatform == "ctyun") { // 天翼云不允许锁屏
if(!parser.isSet(lstOption)) {
return 0;
}
} else {
if(!parser.isSet(sessionIdleOption)
&& !parser.isSet(lockOption)
&& !parser.isSet(lstOption)
&& !parser.isSet(screensaverOption)
&& !parser.isSet(lscreensaverOption)
&& !parser.isSet(blankOption))
{
return 0;
}
}
qInfo()<<"Start "<<a.arguments();
//qInstallMessageHandler(messageOutput);
//加载翻译文件
@ -210,6 +248,8 @@ int main(int argc, char *argv[])
// a.setStyleSheet(qssFile.readAll());
// }
// qssFile.close();
// 监听会话active状态
QObject::connect(m_logind, &LogindIntegration::sessionActiveChanged, window, &FullBackgroundWidget::onSessionActiveChanged);
// 注册DBus
ScreenSaverWndAdaptor adaptorWnd(window);
@ -231,6 +271,9 @@ int main(int argc, char *argv[])
}
qDebug() << service.baseService();
PluginsLoader *pluginsLoader = &PluginsLoader::instance();
pluginsLoader->start(QThread::HighestPriority);
pluginsLoader->wait();
if(parser.isSet(blankOption))
{
@ -253,11 +296,10 @@ int main(int argc, char *argv[])
}
#ifndef USE_INTEL
if (QString(qgetenv("XDG_SESSION_TYPE")) == "wayland")
window->show();
else
window->show();
syslog(LOG_INFO, "[ukui-screensaver-dialog] window show!!");
window->show();
window->activateWindow();
syslog(LOG_INFO, "[ukui-screensaver-dialog] window show done!!");
#endif
if(parser.isSet(lockOption))
{
@ -300,14 +342,20 @@ int main(int argc, char *argv[])
bool isWayland = false;
if(QString(qgetenv("XDG_SESSION_TYPE")) == "wayland") {
if(QString(qgetenv("XDG_SESSION_TYPE")) == "wayland" && !QX11Info::isPlatformX11()) {
isWayland = true;
}
if (isWayland){
PlasmaShellManager::getInstance();
PlasmaShellManager::getInstance()->setAppWindowKeepAbove(true);
// if (isWayland){
// PlasmaShellManager::getInstance();
// PlasmaShellManager::getInstance()->setAppWindowKeepAbove(true);
// }
if (isWayland) {
if (auto layerShellWindow = LayerShellQt::Window::get(window->windowHandle())) {
layerShellWindow->setExclusiveZone(-1);
layerShellWindow->setLayer(LayerShellQt::Window::LayerOverlay);
layerShellWindow->setKeyboardInteractivity(LayerShellQt::Window::KeyboardInteractivityExclusive);
}
}
QString username = getenv("USER");
int uid = getuid();
QDBusInterface *interface = new QDBusInterface("cn.kylinos.Kydroid2",