11// Author: Kang Lin <kl222@126.com>
22
3+ #include < QWhatsThisClickedEvent>
4+ #include < QDesktopServices>
35#include < QMessageBox>
46#include < QFileDialog>
57#include < QLoggingCategory>
@@ -16,6 +18,7 @@ CParameterPluginUI::CParameterPluginUI(QWidget *parent) :
1618 m_pPara(nullptr )
1719{
1820 ui->setupUi (this );
21+
1922 setWindowTitle (tr (" Plugin" ));
2023 if (RabbitCommon::CTools::HasAdministratorPrivilege ()) {
2124 ui->cbPromptAdminPrivilege ->setText (" " );
@@ -25,7 +28,21 @@ CParameterPluginUI::CParameterPluginUI(QWidget *parent) :
2528 tr (" Prompt administrator privilege" ));
2629 ui->cbPromptAdminPrivilege ->show ();
2730 }
31+
2832 ui->pbEncryptKey ->setToolTip (tr (" Enable view password" ));
33+
34+ QString szPasswordUrl;
35+ szPasswordUrl = " <a href=https://github.com/KangLin/RabbitRemoteControl/wiki/UserManual#password-security>" + tr (" Password Security" ) + " </a>" ;
36+ ui->gbPassword ->setWhatsThis (szPasswordUrl);
37+ ui->gbPassword ->installEventFilter (this );
38+ ui->pbEncryptKey ->setWhatsThis (szPasswordUrl);
39+ ui->pbEncryptKey ->installEventFilter (this );
40+ ui->cbSystemCredential ->setWhatsThis (szPasswordUrl);
41+ ui->cbSystemCredential ->installEventFilter (this );
42+ ui->leEncryptKey ->setWhatsThis (szPasswordUrl);
43+ ui->leEncryptKey ->installEventFilter (this );
44+ ui->gpEncryptKey ->setWhatsThis (szPasswordUrl);
45+ ui->gpEncryptKey ->installEventFilter (this );
2946}
3047
3148CParameterPluginUI::~CParameterPluginUI ()
@@ -198,3 +215,15 @@ void CParameterPluginUI::on_cbCaptureAllKeyboard_checkStateChanged(const Qt::Che
198215{
199216 ui->gpDesktopShortcutsSctipt ->setEnabled (Qt::CheckState::Checked == arg1);
200217}
218+
219+ bool CParameterPluginUI::eventFilter (QObject *watched, QEvent *event)
220+ {
221+ if (event->type () == QEvent::WhatsThisClicked) {
222+ QWhatsThisClickedEvent* e = (QWhatsThisClickedEvent*)event;
223+ if (e) {
224+ qDebug (log) << e->href ();
225+ return QDesktopServices::openUrl (e->href ());
226+ }
227+ }
228+ return QWidget::eventFilter (watched, event);
229+ }
0 commit comments