修复部分自测bug

This commit is contained in:
liudun 2023-12-12 16:48:05 +08:00
parent 10760e68e4
commit 31d4b8751a
8 changed files with 103 additions and 82 deletions

View File

@ -158,12 +158,12 @@
<message>
<location filename="../src/widgets/authdialog.cpp" line="1988"/>
<source>Face</source>
<translation type="unfinished"></translation>
<translation></translation>
</message>
<message>
<location filename="../src/widgets/authdialog.cpp" line="1990"/>
<source>VoicePrint</source>
<translation type="unfinished"></translation>
<translation></translation>
</message>
<message>
<location filename="../src/widgets/authdialog.cpp" line="1992"/>

View File

@ -101,17 +101,17 @@
<message>
<location filename="../src/widgets/authdialog.cpp" line="865"/>
<source>Username</source>
<translation type="unfinished">:</translation>
<translation>:</translation>
</message>
<message>
<location filename="../src/widgets/authdialog.cpp" line="928"/>
<source>User name input error!</source>
<translation type="unfinished"></translation>
<translation></translation>
</message>
<message>
<location filename="../src/widgets/authdialog.cpp" line="1005"/>
<source>login</source>
<translation type="unfinished"></translation>
<translation></translation>
</message>
<message>
<location filename="../src/widgets/authdialog.cpp" line="1382"/>
@ -143,37 +143,37 @@
<message>
<location filename="../src/widgets/authdialog.cpp" line="1982"/>
<source>FingerPrint</source>
<translation type="unfinished"></translation>
<translation></translation>
</message>
<message>
<location filename="../src/widgets/authdialog.cpp" line="1984"/>
<source>FingerVein</source>
<translation type="unfinished"></translation>
<translation></translation>
</message>
<message>
<location filename="../src/widgets/authdialog.cpp" line="1986"/>
<source>Iris</source>
<translation type="unfinished"></translation>
<translation></translation>
</message>
<message>
<location filename="../src/widgets/authdialog.cpp" line="1988"/>
<source>Face</source>
<translation type="unfinished"></translation>
<translation></translation>
</message>
<message>
<location filename="../src/widgets/authdialog.cpp" line="1990"/>
<source>VoicePrint</source>
<translation type="unfinished"></translation>
<translation></translation>
</message>
<message>
<location filename="../src/widgets/authdialog.cpp" line="1992"/>
<source>Ukey</source>
<translation type="unfinished"></translation>
<translation></translation>
</message>
<message>
<location filename="../src/widgets/authdialog.cpp" line="1994"/>
<source>QRCode</source>
<translation type="unfinished"></translation>
<translation></translation>
</message>
<message>
<source>Use the bound wechat scanning code or enter the password to log in</source>
@ -276,25 +276,25 @@
<context>
<name>BatteryWidget</name>
<message>
<location filename="../src/batterywidget.cpp" line="189"/>
<source>BatteryMode</source>
<translation></translation>
</message>
<message>
<location filename="../src/batterywidget.cpp" line="186"/>
<source>PowerMode</source>
<translation></translation>
</message>
<message>
<location filename="../src/batterywidget.cpp" line="180"/>
<location filename="../src/widgets/batterywidget.cpp" line="113"/>
<source>Charging...</source>
<translation>...</translation>
</message>
<message>
<location filename="../src/batterywidget.cpp" line="182"/>
<location filename="../src/widgets/batterywidget.cpp" line="115"/>
<source>fully charged</source>
<translation></translation>
</message>
<message>
<location filename="../src/widgets/batterywidget.cpp" line="119"/>
<source>PowerMode</source>
<translation></translation>
</message>
<message>
<location filename="../src/widgets/batterywidget.cpp" line="122"/>
<source>BatteryMode</source>
<translation></translation>
</message>
</context>
<context>
<name>BioDevices</name>
@ -369,32 +369,32 @@
<message>
<location filename="../src/widgets/blockwidget.cpp" line="40"/>
<source>Cancel</source>
<translation type="unfinished"></translation>
<translation></translation>
</message>
<message>
<location filename="../src/widgets/blockwidget.cpp" line="44"/>
<source>Confrim</source>
<translation type="unfinished"></translation>
<translation></translation>
</message>
<message>
<location filename="../src/widgets/blockwidget.cpp" line="89"/>
<source>The following program is running to prevent the system from reboot!</source>
<translation type="unfinished"></translation>
<translation></translation>
</message>
<message>
<location filename="../src/widgets/blockwidget.cpp" line="92"/>
<source>The following program is running to prevent the system from shutting down!</source>
<translation type="unfinished"></translation>
<translation></translation>
</message>
<message>
<location filename="../src/widgets/blockwidget.cpp" line="95"/>
<source>The following program is running to prevent the system from suspend!</source>
<translation type="unfinished"></translation>
<translation></translation>
</message>
<message>
<location filename="../src/widgets/blockwidget.cpp" line="98"/>
<source>The following program is running to prevent the system from hibernate!</source>
<translation type="unfinished"></translation>
<translation></translation>
</message>
</context>
<context>
@ -1910,7 +1910,7 @@
</message>
<message>
<source>Multiple users are logged in at the same time.Are you sure you want to reboot this system?</source>
<translation type="vanished">退</translation>
<translation>退</translation>
</message>
<message>
<source>LAN</source>
@ -1921,7 +1921,7 @@
<translation type="vanished">线</translation>
</message>
<message>
<location filename="../src/widgets/lockwidget.cpp" line="923"/>
<location filename="../src/widgets/lockwidget.cpp" line="931"/>
<source>Multiple users are logged in at the same time.Are you sure you want to %1 this system?</source>
<translation type="unfinished"></translation>
</message>

View File

@ -278,22 +278,22 @@
<message>
<location filename="../src/widgets/batterywidget.cpp" line="113"/>
<source>Charging...</source>
<translation type="unfinished">...</translation>
<translation>...</translation>
</message>
<message>
<location filename="../src/widgets/batterywidget.cpp" line="115"/>
<source>fully charged</source>
<translation type="unfinished">滿</translation>
<translation>滿</translation>
</message>
<message>
<location filename="../src/widgets/batterywidget.cpp" line="119"/>
<source>PowerMode</source>
<translation type="unfinished"></translation>
<translation></translation>
</message>
<message>
<location filename="../src/widgets/batterywidget.cpp" line="122"/>
<source>BatteryMode</source>
<translation type="unfinished"></translation>
<translation></translation>
</message>
</context>
<context>

View File

@ -47,7 +47,10 @@ void LockDialogPerformer::initConnections()
connect(m_bdHelper, &BackendDbusHelper::currentUserChanged, m_modelLockDialog, &LockDialogModel::onCurUserChanged);
connect(m_bdHelper, &BackendDbusHelper::currentSessionChanged, m_modelLockDialog, &LockDialogModel::onCurSessionChanged);
connect(m_bdHelper, &BackendDbusHelper::lidstateChanged, m_modelLockDialog, &LockDialogModel::onLidstateChanged);
connect(m_bdHelper, &BackendDbusHelper::lidstateChanged, this, [=](const QString &lidStatus){
m_modelLockDialog->updateSleepLockcheck(m_bdHelper->getSleepLockcheck());
m_modelLockDialog->updateShutdownLockcheck(m_bdHelper->getShutdownLockcheck());
});
connect(m_bdHelper, &BackendDbusHelper::capslockConfChanged, m_modelLockDialog, &LockDialogModel::onCapslockStateChanged);
connect(m_bdHelper, &BackendDbusHelper::batteryStatusChanged, m_modelLockDialog, &LockDialogModel::onBatteryStatusChanged);

View File

@ -132,6 +132,12 @@ bool IconEdit::eventFilter(QObject *obj, QEvent *event)
}
}
if (obj == m_iconButton && event->type() == QEvent::KeyRelease) {
QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
if (keyEvent->key() == Qt::Key_Enter || keyEvent->key() == Qt::Key_Return) {
clicked_cb();
}
}
return false;
}

View File

@ -232,48 +232,45 @@ void LockWidget::keyReleaseEvent(QKeyEvent *e)
onShowVirtualKeyboard();
}
// 监听按键事件实现快捷键功能
switch (e->key()) {
case Qt::Key_VolumeMute:
Q_EMIT m_modelLockDialog->usdExternalDoAction(MIC_MUTE_KEY);
break;
case Qt::Key_VolumeDown:
Q_EMIT m_modelLockDialog->usdExternalDoAction(VOLUME_DOWN_KEY);
break;
case Qt::Key_VolumeUp:
Q_EMIT m_modelLockDialog->usdExternalDoAction(VOLUME_UP_KEY);
break;
case Qt::Key_MonBrightnessUp:
Q_EMIT m_modelLockDialog->usdExternalDoAction(BRIGHT_UP_KEY);
break;
case Qt::Key_MonBrightnessDown:
Q_EMIT m_modelLockDialog->usdExternalDoAction(BRIGHT_DOWN_KEY);
break;
case Qt::Key_TouchpadOn:
Q_EMIT m_modelLockDialog->usdExternalDoAction(TOUCHPAD_ON_KEY);
break;
case Qt::Key_TouchpadOff:
Q_EMIT m_modelLockDialog->usdExternalDoAction(TOUCHPAD_OFF_KEY);
break;
default:
break;
}
if (m_modelLockDialog->isUseWayland()) {
// 监听按键事件实现快捷键功能
switch (e->key()) {
case Qt::Key_VolumeMute:
Q_EMIT m_modelLockDialog->usdExternalDoAction(MIC_MUTE_KEY);
break;
case Qt::Key_VolumeDown:
Q_EMIT m_modelLockDialog->usdExternalDoAction(VOLUME_DOWN_KEY);
break;
case Qt::Key_VolumeUp:
Q_EMIT m_modelLockDialog->usdExternalDoAction(VOLUME_UP_KEY);
break;
case Qt::Key_MonBrightnessUp:
Q_EMIT m_modelLockDialog->usdExternalDoAction(BRIGHT_UP_KEY);
break;
case Qt::Key_MonBrightnessDown:
Q_EMIT m_modelLockDialog->usdExternalDoAction(BRIGHT_DOWN_KEY);
break;
case Qt::Key_TouchpadOn:
Q_EMIT m_modelLockDialog->usdExternalDoAction(TOUCHPAD_ON_KEY);
break;
case Qt::Key_TouchpadOff:
Q_EMIT m_modelLockDialog->usdExternalDoAction(TOUCHPAD_OFF_KEY);
break;
default:
break;
}
// 实现锁屏截图功能
QKeySequence keySequence = QKeySequence(e->modifiers() + e->key());
if (keySequence == listFromString(m_areaScreenShot)) {
Q_EMIT m_modelLockDialog->usdExternalDoAction(AREA_SCREENSHOT_KEY);
} else if (keySequence == listFromString(m_areaScreenShot2)) {
Q_EMIT m_modelLockDialog->usdExternalDoAction(AREA_SCREENSHOT_KEY);
} else if (keySequence == listFromString(m_screenShot)) {
Q_EMIT m_modelLockDialog->usdExternalDoAction(SCREENSHOT_KEY);
} else if (keySequence == listFromString(m_screenShot2)) {
Q_EMIT m_modelLockDialog->usdExternalDoAction(SCREENSHOT_KEY);
} else if (keySequence == listFromString(m_windowScreenshot)) {
Q_EMIT m_modelLockDialog->usdExternalDoAction(WINDOW_SCREENSHOT_KEY);
}
// 实现锁屏截图功能
QKeySequence keySequence = QKeySequence(e->modifiers() + e->key());
if (keySequence == listFromString(m_areaScreenShot)) {
Q_EMIT m_modelLockDialog->usdExternalDoAction(AREA_SCREENSHOT_KEY);
} else if (keySequence == listFromString(m_areaScreenShot2)) {
Q_EMIT m_modelLockDialog->usdExternalDoAction(AREA_SCREENSHOT_KEY);
} else if (keySequence == listFromString(m_screenShot)) {
Q_EMIT m_modelLockDialog->usdExternalDoAction(SCREENSHOT_KEY);
} else if (keySequence == listFromString(m_screenShot2)) {
Q_EMIT m_modelLockDialog->usdExternalDoAction(SCREENSHOT_KEY);
} else if (keySequence == listFromString(m_windowScreenshot)) {
Q_EMIT m_modelLockDialog->usdExternalDoAction(WINDOW_SCREENSHOT_KEY);
}
}
@ -852,16 +849,24 @@ void LockWidget::onShowVirtualKeyboard()
void LockWidget::onShowPowerListWidget()
{
if (m_powerListWidget->isHidden()) {
m_powerListWidget->show();
authDialog->hide();
m_powerListWidget->clearFocus();
buttonListWidget->clearFocus();
} else {
m_powerListWidget->hide();
authDialog->show();
authDialog->setFocus();
}
if (m_isInhibitStatus) {
authDialog->hide();
m_powerListWidget->hide();
buttonListWidget->hide();
m_timeWidget->hide();
}
if (m_userListWidget && m_userListWidget->isVisible())
m_userListWidget->hide();
if (m_virtualKeyboardWidget && m_virtualKeyboardWidget->isVisible())
@ -916,7 +921,7 @@ void LockWidget::onShowInhibitWarning(QStringList list, int type)
m_blockWidget->setGeometry(this->geometry());
m_blockWidget->setWarning(list, type);
m_blockWidget->show();
m_powerListWidget->hide();
m_isInhibitStatus = true;
}
void LockWidget::onMulUsersLogined(QString inhibitType)
@ -925,7 +930,7 @@ void LockWidget::onMulUsersLogined(QString inhibitType)
m_blockWidget->setGeometry(this->geometry());
m_blockWidget->setTips(tr("Multiple users are logged in at the same time.Are you sure you want to %1 this system?").arg(inhibitType));
m_blockWidget->show();
m_powerListWidget->hide();
m_isInhibitStatus = true;
}
void LockWidget::onConfirmBtnClicked()
@ -934,13 +939,17 @@ void LockWidget::onConfirmBtnClicked()
m_powerListWidget->hide();
authDialog->show();
buttonListWidget->show();
m_isInhibitStatus = false;
Q_EMIT m_modelLockDialog->setPowerManager(m_inhibitType);
}
void LockWidget::onCancelBtnClicked()
{
m_isInhibitStatus = false;
m_blockWidget->hide();
m_powerListWidget->show();
buttonListWidget->show();
m_timeWidget->show();
}
void LockWidget::onCustomRequestAccount(QString account)

View File

@ -153,6 +153,9 @@ private:
MyNetworkWidget *m_networkWidget = nullptr;
BatteryWidget *batteryWidget = nullptr;
VirtualKeyboardWidget *m_virtualKeyboardWidget = nullptr;
// 当前是否处于阻塞状态
bool m_isInhibitStatus = false;
BlockWidget *m_blockWidget = nullptr;
QString m_inhibitType;

View File

@ -117,7 +117,7 @@ void PowerListWidget::onListItemClicked(QListWidgetItem *item)
Q_EMIT showInhibitWarning(shutdownLockcheck, powerBtnList[i].m_inhibitType);
break;
} else if (m_modelLockDialog->getLoggedInUsersCount() > 1) {
Q_EMIT mulUsersLogined(powerBtnList[i].m_strName);
Q_EMIT mulUsersLogined(powerBtnList[i].setFuncName);
break;
}
}