From d39c407bf49fab58fa53c20bb3d301ee6e709c32 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Sat, 21 Nov 2020 17:49:23 +0800 Subject: 1) tdehwdevicetray: added support for unmount/unlock/lock operations. 2) minor changes and improvements to user messages. Signed-off-by: Michele Calgaro --- kcontrol/hwmanager/passworddlg.cpp | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'kcontrol/hwmanager/passworddlg.cpp') diff --git a/kcontrol/hwmanager/passworddlg.cpp b/kcontrol/hwmanager/passworddlg.cpp index d9f1f54a6..07b6027ae 100644 --- a/kcontrol/hwmanager/passworddlg.cpp +++ b/kcontrol/hwmanager/passworddlg.cpp @@ -22,20 +22,14 @@ #include "passworddlg.h" -PasswordDlg::PasswordDlg(TQString url, TQString iconName) : - KDialogBase(NULL, "PasswordDlg", true, i18n("Unlock Storage Device"), (Cancel|User1), User1, false, KGuiItem(i18n("Unlock"), "unlocked" )) +PasswordDlg::PasswordDlg() : + KDialogBase(NULL, "PasswordDlg", true, i18n("Unlock Storage Device"), (Cancel|User1), + User1, false, KGuiItem(i18n("Unlock"), "unlocked" )) { unlockDialog = new UnlockDialog(this); - - unlockDialog->descLabel->setText(unlockDialog->descLabel->text().arg(url)); - unlockDialog->descLabel->adjustSize(); - unlockDialog->adjustSize(); - enableButton( User1, false ); - - TQPixmap pixmap = TDEGlobal::iconLoader()->loadIcon(iconName, TDEIcon::NoGroup, TDEIcon::SizeLarge); - unlockDialog->encryptedIcon->setPixmap( pixmap ); - + unlockDialog->encryptedIcon->setPixmap(TDEGlobal::iconLoader()->loadIcon("drive-harddisk-locked", + TDEIcon::NoGroup, TDEIcon::SizeLarge)); connect(unlockDialog->passwordEdit, TQT_SIGNAL (textChanged(const TQString &)), this, TQT_SLOT (slotPasswordChanged(const TQString &))); setMainWidget(unlockDialog); @@ -46,6 +40,19 @@ PasswordDlg::~PasswordDlg() delete unlockDialog; } +void PasswordDlg::setDevice(TQString deviceName) +{ + unlockDialog->descLabel->setText("

" + deviceName + " is an encrypted storage device.

" + "

Please enter the password to unlock the storage device.

"); + unlockDialog->descLabel->adjustSize(); + unlockDialog->adjustSize(); +} + +void PasswordDlg::clearPassword() +{ + unlockDialog->passwordEdit->setText(TQString::null); +} + TQString PasswordDlg::getPassword() { return unlockDialog->passwordEdit->text(); -- cgit v1.2.1