From d2da293eaecf382e2fd2b6517b90df62ae21e127 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Sun, 16 Jun 2019 22:55:14 +0900 Subject: Adjusted to new icon names and renamed media types related to encrypted drives in a better way. Signed-off-by: Michele Calgaro --- tdeioslave/media/mounthelper/CMakeLists.txt | 2 +- tdeioslave/media/mounthelper/Makefile.am | 2 +- tdeioslave/media/mounthelper/decryptdialog.ui | 201 --------------------- tdeioslave/media/mounthelper/dialog.cpp | 26 +-- tdeioslave/media/mounthelper/dialog.h | 4 +- .../media/mounthelper/tdeio_media_mounthelper.cpp | 10 +- tdeioslave/media/mounthelper/unlockdialog.ui | 201 +++++++++++++++++++++ 7 files changed, 223 insertions(+), 223 deletions(-) delete mode 100644 tdeioslave/media/mounthelper/decryptdialog.ui create mode 100644 tdeioslave/media/mounthelper/unlockdialog.ui (limited to 'tdeioslave/media/mounthelper') diff --git a/tdeioslave/media/mounthelper/CMakeLists.txt b/tdeioslave/media/mounthelper/CMakeLists.txt index 766fe3def..90afad33f 100644 --- a/tdeioslave/media/mounthelper/CMakeLists.txt +++ b/tdeioslave/media/mounthelper/CMakeLists.txt @@ -26,7 +26,7 @@ link_directories( set( target tdeio_media_mounthelper ) set( ${target}_SRCS - tdeio_media_mounthelper.cpp decryptdialog.ui dialog.cpp + tdeio_media_mounthelper.cpp unlockdialog.ui dialog.cpp ) tde_add_executable( ${target} AUTOMOC diff --git a/tdeioslave/media/mounthelper/Makefile.am b/tdeioslave/media/mounthelper/Makefile.am index ce226f728..60f9dc809 100644 --- a/tdeioslave/media/mounthelper/Makefile.am +++ b/tdeioslave/media/mounthelper/Makefile.am @@ -3,7 +3,7 @@ bin_PROGRAMS = tdeio_media_mounthelper INCLUDES = -I$(srcdir)/../libmediacommon $(all_includes) AM_LDFLAGS = $(all_libraries) -tdeio_media_mounthelper_SOURCES = tdeio_media_mounthelper.cpp decryptdialog.ui dialog.cpp +tdeio_media_mounthelper_SOURCES = tdeio_media_mounthelper.cpp unlockdialog.ui dialog.cpp tdeio_media_mounthelper_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_TQT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_TDEIO) -ltdetexteditor tdeio_media_mounthelper_LDADD = ../libmediacommon/libmediacommon.la $(LIB_TDEIO) $(LIB_TDEUI) diff --git a/tdeioslave/media/mounthelper/decryptdialog.ui b/tdeioslave/media/mounthelper/decryptdialog.ui deleted file mode 100644 index 939f0a36a..000000000 --- a/tdeioslave/media/mounthelper/decryptdialog.ui +++ /dev/null @@ -1,201 +0,0 @@ - -DecryptDialog - - - DecryptDialog - - - - 0 - 0 - 207 - 172 - - - - - 5 - 3 - 0 - 0 - - - - Decrypting Storage Device - - - - unnamed - - - - layout5 - - - - unnamed - - - - layout4 - - - - unnamed - - - - encryptedIcon - - - - 0 - 0 - 0 - 0 - - - - - 48 - 48 - - - - - 32 - 32 - - - - true - - - AlignTop - - - - - spacer2_2 - - - Vertical - - - Expanding - - - - 31 - 41 - - - - - - - - descLabel - - - - 3 - 3 - 0 - 0 - - - - <p><b>%1</b> is an encrypted storage device.</p> -<p>Please enter the password to decrypt the storage device.</p> - - - WordBreak|AlignTop - - - - - - - layout4 - - - - unnamed - - - - textLabel1 - - - &Password: - - - passwordEdit - - - - - passwordEdit - - - true - - - - 5 - 0 - 1 - 0 - - - - Password - - - - - - - errorBox - - - - 3 - 3 - 0 - 0 - - - - Error - - - - unnamed - - - - errorLabel - - - - 3 - 3 - 0 - 0 - - - - - - - WordBreak|AlignTop - - - - - - - - diff --git a/tdeioslave/media/mounthelper/dialog.cpp b/tdeioslave/media/mounthelper/dialog.cpp index ffa97b3b7..f2cdb6b53 100644 --- a/tdeioslave/media/mounthelper/dialog.cpp +++ b/tdeioslave/media/mounthelper/dialog.cpp @@ -23,41 +23,41 @@ #include "dialog.h" Dialog::Dialog(TQString url, TQString iconName) : - KDialogBase(NULL, "Dialog", true, "Decrypt Storage Device", (Cancel|User1), User1, false, KGuiItem(i18n("Decrypt"), "decrypted" )) + KDialogBase(NULL, "Dialog", true, "Unlock Storage Device", (Cancel|User1), User1, false, KGuiItem(i18n("Unlock"), "unlocked" )) { - decryptDialog = new DecryptDialog(this); + unlockDialog = new UnlockDialog(this); - decryptDialog->errorBox->hide(); - decryptDialog->descLabel->setText(decryptDialog->descLabel->text().arg(url)); - decryptDialog->descLabel->adjustSize(); - decryptDialog->adjustSize(); + unlockDialog->errorBox->hide(); + 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); - decryptDialog->encryptedIcon->setPixmap( pixmap ); + unlockDialog->encryptedIcon->setPixmap( pixmap ); - connect(decryptDialog->passwordEdit, TQT_SIGNAL (textChanged(const TQString &)), this, TQT_SLOT (slotPasswordChanged(const TQString &))); + connect(unlockDialog->passwordEdit, TQT_SIGNAL (textChanged(const TQString &)), this, TQT_SLOT (slotPasswordChanged(const TQString &))); - setMainWidget(decryptDialog); + setMainWidget(unlockDialog); } Dialog::~Dialog() { - delete decryptDialog; + delete unlockDialog; } TQString Dialog::getPassword() { - return decryptDialog->passwordEdit->text(); + return unlockDialog->passwordEdit->text(); } void Dialog::slotDialogError(TQString errorMsg) { kdDebug() << __func__ << "(" << errorMsg << " )" << endl; - decryptDialog->errorLabel->setText(TQString("%1").arg(errorMsg)); - decryptDialog->errorBox->show(); + unlockDialog->errorLabel->setText(TQString("%1").arg(errorMsg)); + unlockDialog->errorBox->show(); } void Dialog::slotPasswordChanged(const TQString &text) diff --git a/tdeioslave/media/mounthelper/dialog.h b/tdeioslave/media/mounthelper/dialog.h index 6a164b8e8..8444ec7dd 100644 --- a/tdeioslave/media/mounthelper/dialog.h +++ b/tdeioslave/media/mounthelper/dialog.h @@ -34,7 +34,7 @@ #include #include -#include "decryptdialog.h" +#include "unlockdialog.h" class KryptoMedia; @@ -54,7 +54,7 @@ public slots: void slotPasswordChanged(const TQString &text); private: - DecryptDialog *decryptDialog; + UnlockDialog *unlockDialog; }; #endif // DIALOG_H_ diff --git a/tdeioslave/media/mounthelper/tdeio_media_mounthelper.cpp b/tdeioslave/media/mounthelper/tdeio_media_mounthelper.cpp index 75d703b95..f32268855 100644 --- a/tdeioslave/media/mounthelper/tdeio_media_mounthelper.cpp +++ b/tdeioslave/media/mounthelper/tdeio_media_mounthelper.cpp @@ -104,8 +104,8 @@ MountHelper::MountHelper() : TDEApplication() } if (!medium.needDecryption()) { - m_errorStr = i18n("%1 is already decrypted.").arg(url.prettyURL()); - TQTimer::singleShot(0, this, TQT_SLOT(error()) ); + m_errorStr = i18n("%1 is already unlocked.").arg(url.prettyURL()); + TQTimer::singleShot(0, this, TQT_SLOT(error())); return; } @@ -166,9 +166,9 @@ MountHelper::MountHelper() : TDEApplication() } } - /* If this is a decrypted volume and there is no error yet - * we try to teardown the decryption */ - if (m_errorStr.isNull() && medium.isEncrypted() && !medium.clearDeviceUdi().isNull()) + // If this is an unlocked encrypted volume and there is no error yet, we try to lock it + if (unmountResult.contains("result") && unmountResult["result"].toBool() && + medium.isEncrypted() && !medium.clearDeviceUdi().isNull()) { DCOPReply reply = mediamanager.call( "undecrypt", medium.id()); if (reply.isValid()) { diff --git a/tdeioslave/media/mounthelper/unlockdialog.ui b/tdeioslave/media/mounthelper/unlockdialog.ui new file mode 100644 index 000000000..99a46a9ac --- /dev/null +++ b/tdeioslave/media/mounthelper/unlockdialog.ui @@ -0,0 +1,201 @@ + +UnlockDialog + + + UnlockDialog + + + + 0 + 0 + 207 + 172 + + + + + 5 + 3 + 0 + 0 + + + + Decrypting Storage Device + + + + unnamed + + + + layout5 + + + + unnamed + + + + layout4 + + + + unnamed + + + + encryptedIcon + + + + 0 + 0 + 0 + 0 + + + + + 48 + 48 + + + + + 32 + 32 + + + + true + + + AlignTop + + + + + spacer2_2 + + + Vertical + + + Expanding + + + + 31 + 41 + + + + + + + + descLabel + + + + 3 + 3 + 0 + 0 + + + + <p><b>%1</b> is an encrypted storage device.</p> +<p>Please enter the password to decrypt the storage device.</p> + + + WordBreak|AlignTop + + + + + + + layout4 + + + + unnamed + + + + textLabel1 + + + &Password: + + + passwordEdit + + + + + passwordEdit + + + true + + + + 5 + 0 + 1 + 0 + + + + Password + + + + + + + errorBox + + + + 3 + 3 + 0 + 0 + + + + Error + + + + unnamed + + + + errorLabel + + + + 3 + 3 + 0 + 0 + + + + + + + WordBreak|AlignTop + + + + + + + + -- cgit v1.2.1