summaryrefslogtreecommitdiffstats
path: root/tdeioslave/media/mediamanager
diff options
context:
space:
mode:
Diffstat (limited to 'tdeioslave/media/mediamanager')
-rw-r--r--tdeioslave/media/mediamanager/CMakeLists.txt2
-rw-r--r--tdeioslave/media/mediamanager/dialog.cpp26
-rw-r--r--tdeioslave/media/mediamanager/dialog.h4
-rw-r--r--tdeioslave/media/mediamanager/halbackend.cpp27
-rw-r--r--tdeioslave/media/mediamanager/medialist.cpp2
-rw-r--r--tdeioslave/media/mediamanager/tdehardwarebackend.cpp32
-rw-r--r--tdeioslave/media/mediamanager/unlockdialog.ui (renamed from tdeioslave/media/mediamanager/decryptdialog.ui)8
7 files changed, 51 insertions, 50 deletions
diff --git a/tdeioslave/media/mediamanager/CMakeLists.txt b/tdeioslave/media/mediamanager/CMakeLists.txt
index a28515188..3216bb34f 100644
--- a/tdeioslave/media/mediamanager/CMakeLists.txt
+++ b/tdeioslave/media/mediamanager/CMakeLists.txt
@@ -49,7 +49,7 @@ tde_add_kpart( ${target} AUTOMOC
SOURCES
mediamanager.cpp mediamanager.skel medialist.cpp
backendbase.cpp fstabbackend.cpp removablebackend.cpp
- decryptdialog.ui dialog.cpp
+ unlockdialog.ui dialog.cpp
mediadirnotify.cpp mediadirnotify.skel
${HAL_MEDIA_BACKEND} ${TDEHWBACKEND}
LINK mediacommon-static tdeinit_kded-shared ${HAL_MEDIA_LIBRARIES}
diff --git a/tdeioslave/media/mediamanager/dialog.cpp b/tdeioslave/media/mediamanager/dialog.cpp
index ffa97b3b7..5f655ccce 100644
--- a/tdeioslave/media/mediamanager/dialog.cpp
+++ b/tdeioslave/media/mediamanager/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, "Unlock", 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("<b>%1</b>").arg(errorMsg));
- decryptDialog->errorBox->show();
+ unlockDialog->errorLabel->setText(TQString("<b>%1</b>").arg(errorMsg));
+ unlockDialog->errorBox->show();
}
void Dialog::slotPasswordChanged(const TQString &text)
diff --git a/tdeioslave/media/mediamanager/dialog.h b/tdeioslave/media/mediamanager/dialog.h
index 6a164b8e8..8444ec7dd 100644
--- a/tdeioslave/media/mediamanager/dialog.h
+++ b/tdeioslave/media/mediamanager/dialog.h
@@ -34,7 +34,7 @@
#include <tqlabel.h>
#include <tqgroupbox.h>
-#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/mediamanager/halbackend.cpp b/tdeioslave/media/mediamanager/halbackend.cpp
index ae14a580f..9c1382bf8 100644
--- a/tdeioslave/media/mediamanager/halbackend.cpp
+++ b/tdeioslave/media/mediamanager/halbackend.cpp
@@ -40,18 +40,15 @@
#include <kstandarddirs.h>
#include <kprocess.h>
-#define MOUNT_SUFFIX ( \
- (medium->isMounted() ? TQString("_mounted") : TQString("_unmounted")) + \
- (medium->isEncrypted() ? (halClearVolume ? "_decrypted" : "_encrypted") : "" ) \
- )
-#define MOUNT_ICON_SUFFIX ( \
- (medium->isMounted() ? TQString("_mount") : TQString("_unmount")) + \
- (medium->isEncrypted() ? (halClearVolume ? "_decrypt" : "_encrypt") : "" ) \
- )
-#define MOUNTED_ICON_SUFFIX ( \
- (medium->isMounted() ? TQString("-mounted") : TQString("")) + \
- (medium->isEncrypted() ? (halClearVolume ? "-decrypted" : "-encrypted") : "" ) \
- )
+#define MOUNT_SUFFIX (medium->isEncrypted() ? \
+ (TQString("_encrypted") + (sdevice->isDiskOfType(TDEDiskDeviceType::UnlockedCrypt) ? "_unlocked" : "_locked")) : \
+ (medium->isMounted() ? TQString("_mounted") : TQString("_unmounted")))
+
+#define MOUNT_ICON_SUFFIX (medium->isMounted() ? TQString("_mount") : TQString("_unmount"))
+
+#define MOUNTED_ICON_SUFFIX (medium->isEncrypted() ? \
+ (sdevice->isDiskOfType(TDEDiskDeviceType::UnlockedCrypt) ? "-unlocked" : "-locked") : \
+ (medium->isMounted() ? TQString("-mounted") : TQString("")))
/* Static instance of this class, for static HAL callbacks */
static HALBackend* s_HALBackend;
@@ -515,7 +512,7 @@ void HALBackend::setVolumeProperties(Medium* medium)
if (clearUdi != NULL) {
kdDebug(1219) << "HALBackend::setVolumeProperties : crypto clear volume avail - " << clearUdi << endl;
halClearVolume = libhal_volume_from_udi(m_halContext, clearUdi);
- // ignore if halClearVolume is NULL -> just not decrypted in this case
+ // ignore if halClearVolume is NULL -> just not unlocked in this case
clearUdiString = clearUdi;
libhal_free_string(clearUdi);
}
@@ -928,7 +925,7 @@ TQStringList HALBackend::mountoptions(const TQString &name)
volume_udi = clearUdi;
libhal_free_string(clearUdi);
} else {
- // if not decrypted yet then no mountoptions
+ // if not unlocked yet then no mountoptions
return TQStringList();
}
libhal_volume_free(halVolume);
@@ -1569,7 +1566,7 @@ TQStringVariantMap HALBackend::mount(const Medium *medium)
qerror = mount_priv(medium->id().latin1(), mount_point.utf8(), options, noptions, dbus_connection);
} else {
// see if we have a clear volume
- error = i18n("Cannot mount encrypted drives!");
+ error = i18n("Cannot mount encrypted locked drives!");
LibHalVolume* halVolume = libhal_volume_from_udi(m_halContext, medium->id().latin1());
if (halVolume) {
char* clearUdi = libhal_volume_crypto_get_clear_volume_udi(m_halContext, halVolume);
diff --git a/tdeioslave/media/mediamanager/medialist.cpp b/tdeioslave/media/mediamanager/medialist.cpp
index fa7aef5f5..b06824d0c 100644
--- a/tdeioslave/media/mediamanager/medialist.cpp
+++ b/tdeioslave/media/mediamanager/medialist.cpp
@@ -126,7 +126,7 @@ bool MediaList::removeMedium(const TQString &id, bool allowNotification)
bool MediaList::changeMediumState(const Medium &medium, bool allowNotification)
{
- kdDebug(1219) << "MediaList::changeMediumState(const Medium &)" << endl;
+ kdDebug(1219) << "MediaList::changeMediumState(const Medium &) for id " << medium.id() << endl;
if ( !m_idMap.contains(medium.id()) ) return false;
diff --git a/tdeioslave/media/mediamanager/tdehardwarebackend.cpp b/tdeioslave/media/mediamanager/tdehardwarebackend.cpp
index 02971639d..c16be644c 100644
--- a/tdeioslave/media/mediamanager/tdehardwarebackend.cpp
+++ b/tdeioslave/media/mediamanager/tdehardwarebackend.cpp
@@ -37,19 +37,15 @@
#include "dialog.h"
-#define MOUNT_SUFFIX ( \
- (medium->isMounted() ? TQString("_mounted") : TQString("_unmounted")) + \
- (medium->isEncrypted() ? (sdevice->isDiskOfType(TDEDiskDeviceType::UnlockedCrypt) ? "_decrypted" : "_encrypted") : "" ) \
- )
-#define MOUNT_ICON_SUFFIX ( \
- (medium->isMounted() ? TQString("_mount") : TQString("_unmount")) + \
- (medium->isEncrypted() ? (sdevice->isDiskOfType(TDEDiskDeviceType::UnlockedCrypt) ? "_decrypt" : "_encrypt") : "" ) \
- )
-#define MOUNTED_ICON_SUFFIX ( \
- (medium->isMounted() ? TQString("-mounted") : TQString("")) + \
- (medium->isEncrypted() ? (sdevice->isDiskOfType(TDEDiskDeviceType::UnlockedCrypt) ? "-decrypted" : "-encrypted") : "" ) \
- )
+#define MOUNT_SUFFIX (medium->isEncrypted() ? \
+ (TQString("_encrypted") + (sdevice->isDiskOfType(TDEDiskDeviceType::UnlockedCrypt) ? "_unlocked" : "_locked")) : \
+ (medium->isMounted() ? TQString("_mounted") : TQString("_unmounted")))
+#define MOUNT_ICON_SUFFIX (medium->isMounted() ? TQString("_mount") : TQString("_unmount"))
+
+#define MOUNTED_ICON_SUFFIX (medium->isEncrypted() ? \
+ (sdevice->isDiskOfType(TDEDiskDeviceType::UnlockedCrypt) ? "-unlocked" : "-locked") : \
+ (medium->isMounted() ? TQString("-mounted") : TQString("")))
/* Constructor */
TDEBackend::TDEBackend(MediaList &list, TQObject* parent)
@@ -463,6 +459,8 @@ void TDEBackend::ResetProperties(TDEStorageDevice * sdevice, bool allowNotificat
void TDEBackend::setVolumeProperties(Medium* medium)
{
+ kdDebug(1219) << "TDEBackend::setVolumeProperties for " << medium->id() << endl;
+
TDEHardwareDevices *hwdevices = TDEGlobal::hardwareDevices();
TDEStorageDevice * sdevice = hwdevices->findDiskByUID(medium->id());
@@ -1188,6 +1186,8 @@ void TDEBackend::slotPasswordCancel() {
TQStringVariantMap TDEBackend::mount(const Medium *medium)
{
+ kdDebug(1219) << "TDEBackend::mount for medium " << medium->name() << endl;
+
TQStringVariantMap result;
if (medium->isMounted()) {
result["result"] = true;
@@ -1301,7 +1301,7 @@ TQStringVariantMap TDEBackend::mount(const Medium *medium)
if (mountedPath.isEmpty()) {
if (mountResult.contains("retCode") && mountResult["retCode"].toInt() == 0) {
// Mounting was successful
- // Because the TDE hardware backend is event driven it might take a little while for the new unencrypted mapped device to show up
+ // Because the TDE hardware backend is event driven it might take a little while for the new enlock mapped device to show up
// Wait up to 30 seconds for it to appear...
for (int i=0;i<300;i++) {
mountedPath = sdevice->mountPath();
@@ -1321,7 +1321,7 @@ TQStringVariantMap TDEBackend::mount(const Medium *medium)
continue_trying_to_decrypt = true;
}
else {
- qerror = i18n("Cannot mount encrypted drives!");
+ qerror = i18n("Cannot mount encrypted locked drives!");
qerror = i18n("Unable to mount this device.");
TQString errStr = mountResult.contains("errStr") ? mountResult["errStr"].toString() : TQString::null;
if (!errStr.isEmpty()) {
@@ -1357,6 +1357,8 @@ TQStringVariantMap TDEBackend::mount(const Medium *medium)
TQStringVariantMap TDEBackend::mount(const TQString &id)
{
+ kdDebug(1219) << "TDEBackend::mount for id " << id << endl;
+
const Medium *medium = m_mediaList.findById(id);
if (!medium) {
TQStringVariantMap result;
@@ -1369,6 +1371,8 @@ TQStringVariantMap TDEBackend::mount(const TQString &id)
TQStringVariantMap TDEBackend::unmount(const TQString &id)
{
+ kdDebug(1219) << "TDEBackend::unmount for id " << id << endl;
+
TQStringVariantMap result;
const Medium* medium = m_mediaList.findById(id);
diff --git a/tdeioslave/media/mediamanager/decryptdialog.ui b/tdeioslave/media/mediamanager/unlockdialog.ui
index 939f0a36a..b5b3b78bd 100644
--- a/tdeioslave/media/mediamanager/decryptdialog.ui
+++ b/tdeioslave/media/mediamanager/unlockdialog.ui
@@ -1,8 +1,8 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
-<class>DecryptDialog</class>
+<class>UnlockDialog</class>
<widget class="TQWidget">
<property name="name">
- <cstring>DecryptDialog</cstring>
+ <cstring>UnlockDialog</cstring>
</property>
<property name="geometry">
<rect>
@@ -106,8 +106,8 @@
</sizepolicy>
</property>
<property name="text">
- <string>&lt;p&gt;&lt;b&gt;%1&lt;/b&gt; is an encrypted storage device.&lt;/p&gt;
-&lt;p&gt;Please enter the password to decrypt the storage device.&lt;/p&gt;</string>
+ <string>&lt;p&gt;&lt;b&gt;%1&lt;/b&gt; is an encrypted locked storage device.&lt;/p&gt;
+&lt;p&gt;Please enter the password to unlock the storage device.&lt;/p&gt;</string>
</property>
<property name="alignment">
<set>WordBreak|AlignTop</set>