tdeioslave media: added initial support for unlocking/locking of encrypted devices.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/35/head
Michele Calgaro 5 years ago
parent 11beb56580
commit 3676cf129d
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -1417,7 +1417,6 @@ void HALBackend::slotResult(TDEIO::Job *job)
if (job->error() == TDEIO::ERR_COULD_NOT_UNMOUNT) { if (job->error() == TDEIO::ERR_COULD_NOT_UNMOUNT) {
TQString proclist(listUsingProcesses(medium)); TQString proclist(listUsingProcesses(medium));
qerror = "<qt>";
qerror += "<p>" + i18n("Unfortunately, the device <b>%1</b> (%2) named <b>'%3'</b> and " qerror += "<p>" + i18n("Unfortunately, the device <b>%1</b> (%2) named <b>'%3'</b> and "
"currently mounted at <b>%4</b> could not be unmounted. ").arg( "currently mounted at <b>%4</b> could not be unmounted. ").arg(
"system:/media/" + medium->name(), "system:/media/" + medium->name(),
@ -1430,7 +1429,6 @@ void HALBackend::slotResult(TDEIO::Job *job)
if (!proclist.isEmpty()) { if (!proclist.isEmpty()) {
qerror += proclist; qerror += proclist;
} }
qerror += "</qt>";
} else if (job->error()) { } else if (job->error()) {
qerror = job->errorText(); qerror = job->errorText();
} }

@ -297,7 +297,6 @@ TQStringVariantMap MediaManager::unmount(const TQString &uid)
TQStringVariantMap MediaManager::unlock(const TQString &uid, const TQString &password) TQStringVariantMap MediaManager::unlock(const TQString &uid, const TQString &password)
{ {
TQStringVariantMap result; TQStringVariantMap result;
/*
#ifdef COMPILE_TDEHARDWAREBACKEND #ifdef COMPILE_TDEHARDWAREBACKEND
if (!m_tdebackend) { if (!m_tdebackend) {
result["errStr"] = i18n("Feature only available with the TDE hardware backend"); result["errStr"] = i18n("Feature only available with the TDE hardware backend");
@ -306,8 +305,6 @@ TQStringVariantMap MediaManager::unlock(const TQString &uid, const TQString &pas
} }
return m_tdebackend->unlock(uid, password); return m_tdebackend->unlock(uid, password);
#elif defined COMPILE_HALBACKEND #elif defined COMPILE_HALBACKEND
*/
#if defined COMPILE_HALBACKEND
if (!m_halbackend) { if (!m_halbackend) {
result["errStr"] = i18n("Feature only available with HAL"); result["errStr"] = i18n("Feature only available with HAL");
result["result"] = false; result["result"] = false;
@ -328,7 +325,6 @@ TQStringVariantMap MediaManager::unlock(const TQString &uid, const TQString &pas
TQStringVariantMap MediaManager::lock(const TQString &uid) TQStringVariantMap MediaManager::lock(const TQString &uid)
{ {
TQStringVariantMap result; TQStringVariantMap result;
/*
#ifdef COMPILE_TDEHARDWAREBACKEND #ifdef COMPILE_TDEHARDWAREBACKEND
if (!m_tdebackend) { if (!m_tdebackend) {
result["errStr"] = i18n("Feature only available with the TDE hardware backend"); result["errStr"] = i18n("Feature only available with the TDE hardware backend");
@ -337,8 +333,6 @@ TQStringVariantMap MediaManager::lock(const TQString &uid)
} }
return m_tdebackend->lock(uid); return m_tdebackend->lock(uid);
#elif defined COMPILE_HALBACKEND #elif defined COMPILE_HALBACKEND
*/
#if defined COMPILE_HALBACKEND
if (!m_halbackend) { if (!m_halbackend) {
result["errStr"] = i18n("Feature only available with HAL"); result["errStr"] = i18n("Feature only available with HAL");
result["result"] = false; result["result"] = false;

@ -1441,7 +1441,7 @@ TQStringVariantMap TDEBackend::unmount(const TQString &id)
// Failed as BUSY // Failed as BUSY
TQString processesUsingDev = listUsingProcesses(medium); TQString processesUsingDev = listUsingProcesses(medium);
if (!processesUsingDev.isNull()) { if (!processesUsingDev.isNull()) {
if (KMessageBox::warningYesNo(0, i18n("<qt>The device <b>%1</b> (%2) named <b>'%3'</b> and currently " if (KMessageBox::warningYesNo(0, i18n("The device <b>%1</b> (%2) named <b>'%3'</b> and currently "
"mounted at <b>%4</b> can not be unmounted at this time.<p>%5<p><b>Would you like to forcibly " "mounted at <b>%4</b> can not be unmounted at this time.<p>%5<p><b>Would you like to forcibly "
"terminate these processes?</b><br><i>All unsaved data would be lost</i>").arg("system:/media/" + "terminate these processes?</b><br><i>All unsaved data would be lost</i>").arg("system:/media/" +
medium->name()).arg(medium->deviceNode()).arg(medium->prettyLabel()).arg(medium->prettyBaseURL().pathOrURL()) medium->name()).arg(medium->deviceNode()).arg(medium->prettyLabel()).arg(medium->prettyBaseURL().pathOrURL())
@ -1480,6 +1480,91 @@ TQStringVariantMap TDEBackend::unmount(const TQString &id)
return result; return result;
} }
TQStringVariantMap TDEBackend::unlock(const TQString &id, const TQString &password)
{
kdDebug(1219) << "TDEBackend::unlock for id " << id << endl;
TQStringVariantMap result;
const Medium* medium = m_mediaList.findById(id);
if (!medium) {
result["errStr"] = i18n("No such medium: %1").arg(id);
result["result"] = false;
return result;
}
if (!medium->isEncrypted() || !medium->clearDeviceUdi().isNull()) {
result["result"] = true;
return result;
}
TDEHardwareDevices *hwdevices = TDEGlobal::hardwareDevices();
TDEStorageDevice *sdevice = hwdevices->findDiskByUID(medium->id());
if (!sdevice) {
result["errStr"] = i18n("Internal error. Couldn't find medium.");
result["result"] = false;
return result;
}
TQStringVariantMap unlockResult = sdevice->unlockDevice(password);
if (unlockResult["result"].toBool() == false) {
TQString qerror = i18n("Unable to unlock the device.");
TQString errStr = unlockResult.contains("errStr") ? unlockResult["errStr"].toString() : TQString::null;
if (!errStr.isEmpty()) {
qerror.append(i18n("<p>Technical details:<br>").append(errStr));
result["errStr"] = qerror;
result["result"] = false;
return result;
}
}
result["result"] = unlockResult["unlockedDevice"];
result["result"] = true;
return result;
}
TQStringVariantMap TDEBackend::lock(const TQString &id)
{
kdDebug(1219) << "TDEBackend::lock for id " << id << endl;
TQStringVariantMap result;
const Medium* medium = m_mediaList.findById(id);
if (!medium) {
result["errStr"] = i18n("No such medium: %1").arg(id);
result["result"] = false;
return result;
}
if (!medium->isEncrypted() || !medium->clearDeviceUdi().isNull()) {
result["result"] = true;
return result;
}
TDEHardwareDevices *hwdevices = TDEGlobal::hardwareDevices();
TDEStorageDevice *sdevice = hwdevices->findDiskByUID(medium->id());
if (!sdevice) {
result["errStr"] = i18n("Internal error. Couldn't find medium.");
result["result"] = false;
return result;
}
TQStringVariantMap lockResult = sdevice->lockDevice();
if (lockResult["result"].toBool() == false) {
TQString qerror = i18n("Unable to lock the device.");
TQString errStr = lockResult.contains("errStr") ? lockResult["errStr"].toString() : TQString::null;
if (!errStr.isEmpty()) {
qerror.append(i18n("<p>Technical details:<br>").append(errStr));
result["errStr"] = qerror;
result["result"] = false;
return result;
}
}
result["result"] = true;
return result;
}
void TDEBackend::slotResult(TDEIO::Job *job) void TDEBackend::slotResult(TDEIO::Job *job)
{ {
TDEHardwareDevices *hwdevices = TDEGlobal::hardwareDevices(); TDEHardwareDevices *hwdevices = TDEGlobal::hardwareDevices();
@ -1491,7 +1576,6 @@ void TDEBackend::slotResult(TDEIO::Job *job)
if (job->error() == TDEIO::ERR_COULD_NOT_UNMOUNT) { if (job->error() == TDEIO::ERR_COULD_NOT_UNMOUNT) {
TQString proclist(listUsingProcesses(medium)); TQString proclist(listUsingProcesses(medium));
qerror = "<qt>";
qerror += "<p>" + i18n("Unfortunately, the device <b>%1</b> (%2) named <b>'%3'</b> and " qerror += "<p>" + i18n("Unfortunately, the device <b>%1</b> (%2) named <b>'%3'</b> and "
"currently mounted at <b>%4</b> could not be unmounted. ").arg( "currently mounted at <b>%4</b> could not be unmounted. ").arg(
"system:/media/" + medium->name(), "system:/media/" + medium->name(),
@ -1504,7 +1588,6 @@ void TDEBackend::slotResult(TDEIO::Job *job)
if (!proclist.isEmpty()) { if (!proclist.isEmpty()) {
qerror += proclist; qerror += proclist;
} }
qerror += "</qt>";
} else if (job->error()) { } else if (job->error()) {
qerror = job->errorText(); qerror = job->errorText();
} }

@ -71,8 +71,8 @@ public:
TQStringVariantMap mount(const TQString &id); TQStringVariantMap mount(const TQString &id);
TQStringVariantMap mount(const Medium *medium); TQStringVariantMap mount(const Medium *medium);
TQStringVariantMap unmount(const TQString &id); TQStringVariantMap unmount(const TQString &id);
// TQStringVariantMap unlock(const TQString &id, const TQString &password); TQStringVariantMap unlock(const TQString &id, const TQString &password);
// TQStringVariantMap lock(const TQString &id); TQStringVariantMap lock(const TQString &id);
private: private:
/** /**

@ -45,16 +45,16 @@ const Medium MountHelper::findMedium(const KURL &url)
DCOPRef mediamanager("kded", "mediamanager"); DCOPRef mediamanager("kded", "mediamanager");
// Try filename first // Try filename first
DCOPReply reply = mediamanager.call( "properties", url.fileName() ); DCOPReply reply = mediamanager.call("properties", url.fileName());
if ( !reply.isValid() ) { if (!reply.isValid()) {
m_errorStr = i18n("The TDE mediamanager is not running.")+"\n"; m_errorStr = i18n("The TDE mediamanager is not running.")+"\n";
return Medium(TQString::null, TQString::null, TQString::null); return Medium(TQString::null, TQString::null, TQString::null);
} }
const Medium& medium = Medium::create(reply); const Medium& medium = Medium::create(reply);
if ( medium.id().isEmpty() ) { if (medium.id().isEmpty()) {
// Try full URL now // Try full URL now
reply = mediamanager.call( "properties", url.prettyURL() ); reply = mediamanager.call("properties", url.prettyURL());
if ( !reply.isValid() ) { if (!reply.isValid()) {
m_errorStr = i18n("Internal Error"); m_errorStr = i18n("Internal Error");
return Medium(TQString::null, TQString::null, TQString::null); return Medium(TQString::null, TQString::null, TQString::null);
} }
@ -72,20 +72,19 @@ MountHelper::MountHelper() : TDEApplication()
KURL url(args->url(0)); KURL url(args->url(0));
const Medium medium = findMedium(url); const Medium medium = findMedium(url);
if (medium.id().isEmpty()) if (medium.id().isEmpty())
{ {
if (m_errorStr.isEmpty()) { if (m_errorStr.isEmpty()) {
m_errorStr+= i18n("%1 cannot be found.").arg(url.prettyURL()); m_errorStr+= i18n("%1 cannot be found.").arg(url.prettyURL());
} }
TQTimer::singleShot(0, this, TQT_SLOT(error()) ); TQTimer::singleShot(0, this, TQT_SLOT(error()));
return; return;
} }
if (!medium.isMountable() && !args->isSet("e") && !args->isSet("s")) if (!medium.isMountable() && !args->isSet("e") && !args->isSet("s"))
{ {
m_errorStr = i18n("%1 is not a mountable media.").arg(url.prettyURL()); m_errorStr = i18n("%1 is not a mountable media.").arg(url.prettyURL());
TQTimer::singleShot(0, this, TQT_SLOT(error()) ); TQTimer::singleShot(0, this, TQT_SLOT(error()));
return; return;
} }
@ -94,12 +93,48 @@ MountHelper::MountHelper() : TDEApplication()
m_isCdrom = medium.mimeType().find("dvd") != -1 || medium.mimeType().find("cd") != -1; m_isCdrom = medium.mimeType().find("dvd") != -1 || medium.mimeType().find("cd") != -1;
if (args->isSet("d")) if (args->isSet("m"))
{
// Mount drive
DCOPRef mediamanager("kded", "mediamanager");
DCOPReply reply = mediamanager.call("mount", medium.id());
TQStringVariantMap mountResult;
if (reply.isValid()) {
reply.get(mountResult);
}
if (mountResult.contains("result") && mountResult["result"].toBool()) {
::exit(0);
}
else {
m_errorStr = mountResult.contains("errStr") ? mountResult["errStr"].toString() : i18n("Unknown mount error.");
TQTimer::singleShot(0, this, TQT_SLOT(error()));
}
}
else if (args->isSet("u"))
{
// Unmount drive
DCOPRef mediamanager("kded", "mediamanager");
DCOPReply reply = mediamanager.call("unmount", medium.id());
TQStringVariantMap unmountResult;
if (reply.isValid()) {
reply.get(unmountResult);
}
if (unmountResult.contains("result") && unmountResult["result"].toBool()) {
::exit(0);
}
else {
m_errorStr = unmountResult.contains("errStr") ? unmountResult["errStr"].toString() : i18n("Unknown unmount error.");
kdDebug() << "medium unmount " << m_errorStr << endl;
TQTimer::singleShot(0, this, TQT_SLOT(error()));
}
}
else if (args->isSet("k"))
{ {
// Unlock drive
if (!medium.isEncrypted()) if (!medium.isEncrypted())
{ {
m_errorStr = i18n("%1 is not an encrypted media.").arg(url.prettyURL()); m_errorStr = i18n("%1 is not an encrypted media.").arg(url.prettyURL());
TQTimer::singleShot(0, this, TQT_SLOT(error()) ); TQTimer::singleShot(0, this, TQT_SLOT(error()));
return; return;
} }
if (!medium.needDecryption()) if (!medium.needDecryption())
@ -115,34 +150,38 @@ MountHelper::MountHelper() : TDEApplication()
TQString mime = medium.mimeType(); TQString mime = medium.mimeType();
iconName = KMimeType::mimeType(mime)->icon(mime, false); iconName = KMimeType::mimeType(mime)->icon(mime, false);
} }
m_mediumId = medium.id(); m_mediumId = medium.id();
dialog = new Dialog(url.prettyURL(), iconName); dialog = new Dialog(url.prettyURL(), iconName);
connect(dialog, TQT_SIGNAL(user1Clicked()), this, TQT_SLOT(slotSendPassword()));
connect(dialog, TQT_SIGNAL(cancelClicked()), this, TQT_SLOT(slotCancel()));
connect(this, TQT_SIGNAL(signalPasswordError(TQString)), dialog, TQT_SLOT(slotDialogError(TQString)));
dialog->show(); dialog->show();
connect(dialog, TQT_SIGNAL (user1Clicked()), this, TQT_SLOT (slotSendPassword()));
connect(dialog, TQT_SIGNAL (cancelClicked()), this, TQT_SLOT (slotCancel()));
connect(this, TQT_SIGNAL (signalPasswordError(TQString)), dialog, TQT_SLOT (slotDialogError(TQString)));
} }
else if (args->isSet("u")) else if (args->isSet("l"))
{ {
DCOPRef mediamanager("kded", "mediamanager"); // Lock drive
DCOPReply reply = mediamanager.call("unmount", medium.id()); DCOPRef mediamanager("kded", "mediamanager");
TQStringVariantMap unmountResult; DCOPReply reply = mediamanager.call("lock", medium.id());
if (reply.isValid()) { TQStringVariantMap lockResult;
reply.get(unmountResult); if (reply.isValid()) {
} reply.get(lockResult);
if (unmountResult.contains("result") && unmountResult["result"].toBool()) { }
if (lockResult.contains("result") && lockResult["result"].toBool()) {
::exit(0); ::exit(0);
} }
else { else {
m_errorStr = unmountResult.contains("errStr") ? unmountResult["errStr"].toString() : i18n("Unknown unmount error."); m_errorStr = lockResult.contains("errStr") ? lockResult["errStr"].toString() : i18n("Unknown lock error.");
kdDebug() << "medium unmount " << m_errorStr << endl; kdDebug() << "medium lock " << m_errorStr << endl;
error(); TQTimer::singleShot(0, this, TQT_SLOT(error()));
} }
} }
else if (args->isSet("s") || args->isSet("e")) else if (args->isSet("e"))
{ {
invokeEject(device, true);
}
else if (args->isSet("s"))
{
// Safely remove drive
DCOPRef mediamanager("kded", "mediamanager"); DCOPRef mediamanager("kded", "mediamanager");
/* /*
@ -157,11 +196,11 @@ MountHelper::MountHelper() : TDEApplication()
TQStringVariantMap unmountResult; TQStringVariantMap unmountResult;
if (medium.isMounted()) if (medium.isMounted())
{ {
DCOPReply reply = mediamanager.call( "unmount", medium.id()); DCOPReply reply = mediamanager.call("unmount", medium.id());
if (reply.isValid()) { if (reply.isValid()) {
reply.get(unmountResult); reply.get(unmountResult);
if (unmountResult["result"].toBool()) { if (unmountResult.contains("result") && !unmountResult["result"].toBool()) {
reply.get(m_errorStr); m_errorStr = unmountResult.contains("errStr") ? unmountResult["errStr"].toString() : i18n("Unknown unmount error.");
} }
} }
} }
@ -170,38 +209,26 @@ MountHelper::MountHelper() : TDEApplication()
if (unmountResult.contains("result") && unmountResult["result"].toBool() && if (unmountResult.contains("result") && unmountResult["result"].toBool() &&
medium.isEncrypted() && !medium.clearDeviceUdi().isNull()) medium.isEncrypted() && !medium.clearDeviceUdi().isNull())
{ {
DCOPReply reply = mediamanager.call( "undecrypt", medium.id()); DCOPReply reply = mediamanager.call("lock", medium.id());
if (reply.isValid()) { if (reply.isValid()) {
TQStringVariantMap undecryptResult; TQStringVariantMap lockResult;
reply.get(undecryptResult); reply.get(lockResult);
if (undecryptResult["result"].toBool()) { if (lockResult.contains("result") && !lockResult["result"].toBool()) {
reply.get(m_errorStr); m_errorStr = lockResult.contains("errStr") ? lockResult["errStr"].toString() : i18n("Unknown lock error.");
} }
} }
} }
if (m_errorStr.isNull()) { if (m_errorStr.isEmpty()) {
invokeEject(device, true); invokeEject(device, true);
} }
else { else {
error(); TQTimer::singleShot(0, this, TQT_SLOT(error()));
} }
} }
else else
{ {
DCOPRef mediamanager("kded", "mediamanager"); TDECmdLineArgs::usage();
DCOPReply reply = mediamanager.call("mount", medium.id());
TQStringVariantMap mountResult;
if (reply.isValid()) {
reply.get(mountResult);
}
if (mountResult.contains("result") && mountResult["result"].toBool()) {
::exit(0);
}
else {
m_errorStr = mountResult.contains("errStr") ? mountResult["errStr"].toString() : i18n("Unknown mount error.");
error();
}
} }
} }
@ -212,7 +239,7 @@ void MountHelper::invokeEject(const TQString &device, bool quiet)
TDEHardwareDevices *hwdevices = TDEGlobal::hardwareDevices(); TDEHardwareDevices *hwdevices = TDEGlobal::hardwareDevices();
TDEGenericDevice *hwdevice = hwdevices->findByDeviceNode(device); TDEGenericDevice *hwdevice = hwdevices->findByDeviceNode(device);
if (hwdevice->type() == TDEGenericDeviceType::Disk) { if (hwdevice->type() == TDEGenericDeviceType::Disk) {
TDEStorageDevice* sdevice = static_cast<TDEStorageDevice*>(hwdevice); TDEStorageDevice *sdevice = static_cast<TDEStorageDevice*>(hwdevice);
if (sdevice->ejectDrive()) { if (sdevice->ejectDrive()) {
// Success! // Success!
::exit(0); ::exit(0);
@ -228,28 +255,21 @@ void MountHelper::invokeEject(const TQString &device, bool quiet)
*proc << "-q"; *proc << "-q";
} }
*proc << device; *proc << device;
connect( proc, TQT_SIGNAL(processExited(TDEProcess *)), connect(proc, TQT_SIGNAL(processExited(TDEProcess*)), this, TQT_SLOT(ejectFinished(TDEProcess*)));
this, TQT_SLOT( ejectFinished(TDEProcess *) ) );
proc->start(); proc->start();
} }
void MountHelper::ejectFinished(TDEProcess* proc) void MountHelper::ejectFinished(TDEProcess *proc)
{ {
/* //If eject failed, report the error stored in m_errorStr
* If eject failed, report the error stored in m_errorStr
*/
if (proc->normalExit() && proc->exitStatus() == 0) { if (proc->normalExit() && proc->exitStatus() == 0) {
::exit(0); ::exit(0);
} else { }
if (m_errorStr.isEmpty()) { else {
if (m_isCdrom) if (!m_errorStr.isEmpty()) {
m_errorStr = i18n("The device was successfully unmounted, but the tray could not be opened"); TQTimer::singleShot(0, this, TQT_SLOT(error()));
else
m_errorStr = i18n("The device was successfully unmounted, but could not be ejected");
} }
//X Comment this because the error is useless as long as the unmount is successful. ::exit(0);
//X TQTimer::singleShot(0, this, TQT_SLOT(error()));
::exit(0);
} }
} }
@ -269,19 +289,19 @@ void MountHelper::slotSendPassword()
{ {
DCOPRef mediamanager("kded", "mediamanager"); DCOPRef mediamanager("kded", "mediamanager");
DCOPReply reply = mediamanager.call( "decrypt", m_mediumId, dialog->getPassword() ); DCOPReply reply = mediamanager.call("unlock", m_mediumId, dialog->getPassword());
TQStringVariantMap decryptResult; TQStringVariantMap unlockResult;
if (reply.isValid()) { if (reply.isValid()) {
reply.get(decryptResult); reply.get(unlockResult);
} }
if (decryptResult.contains("result") && decryptResult["result"].toBool()) { if (unlockResult.contains("result") && unlockResult["result"].toBool()) {
::exit(0); ::exit(0);
} }
else { else {
m_errorStr = decryptResult.contains("errStr") ? decryptResult["errStr"].toString() : i18n("Unknown decrypt error."); m_errorStr = unlockResult.contains("errStr") ? unlockResult["errStr"].toString() : i18n("Unknown unlock error.");
kdDebug() << "medium decrypt " << m_errorStr << endl; kdDebug() << "medium unlock " << m_errorStr << endl;
emit signalPasswordError(m_errorStr); emit signalPasswordError(m_errorStr);
error(); TQTimer::singleShot(0, this, TQT_SLOT(error()));
} }
} }
@ -292,12 +312,13 @@ void MountHelper::slotCancel()
static TDECmdLineOptions options[] = static TDECmdLineOptions options[] =
{ {
{ "d", I18N_NOOP("Decrypt given URL"), 0 }, { "m", I18N_NOOP("Mount given URL"), 0 },
{ "u", I18N_NOOP("Unmount given URL"), 0 }, { "u", I18N_NOOP("Unmount given URL"), 0 },
{ "m", I18N_NOOP("Mount given URL (default)"), 0 }, { "k", I18N_NOOP("Unlock given URL"), 0 },
{ "e", I18N_NOOP("Eject given URL via tdeeject"), 0}, { "l", I18N_NOOP("Lock given URL"), 0 },
{ "s", I18N_NOOP("Unmount and Eject given URL (necessary for some USB devices)"), 0}, { "e", I18N_NOOP("Eject given URL"), 0},
{"!+URL", I18N_NOOP("media:/ URL to mount/unmount/eject/remove"), 0 }, { "s", I18N_NOOP("Safely remove (unmount and eject) given URL"), 0},
{"!+URL", I18N_NOOP("media:/URL to mount/unmount/unlock/lock/eject/remove"), 0 },
TDECmdLineLastOption TDECmdLineLastOption
}; };
@ -308,13 +329,15 @@ int main(int argc, char **argv)
"tdeio_media_mounthelper", "tdeio_media_mounthelper", "tdeio_media_mounthelper", "tdeio_media_mounthelper",
"0.1"); "0.1");
TDECmdLineArgs::addCmdLineOptions( options ); TDECmdLineArgs::addCmdLineOptions(options);
TDEGlobal::locale()->setMainCatalogue("tdeio_media"); TDEGlobal::locale()->setMainCatalogue("tdeio_media");
TDEApplication::addCmdLineOptions(); TDEApplication::addCmdLineOptions();
if (TDECmdLineArgs::parsedArgs()->count()==0)
{
TDECmdLineArgs::usage();
}
if (TDECmdLineArgs::parsedArgs()->count()==0) TDECmdLineArgs::usage(); TDEApplication *app = new MountHelper();
TDEApplication *app = new MountHelper();
TDEStartupInfo::appStarted(); TDEStartupInfo::appStarted();
app->dcopClient()->attach(); app->dcopClient()->attach();
return app->exec(); return app->exec();

@ -107,7 +107,7 @@
</property> </property>
<property name="text"> <property name="text">
<string>&lt;p&gt;&lt;b&gt;%1&lt;/b&gt; is an encrypted storage device.&lt;/p&gt; <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> &lt;p&gt;Please enter the password to unlock the storage device.&lt;/p&gt;</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>WordBreak|AlignTop</set> <set>WordBreak|AlignTop</set>

@ -13,7 +13,8 @@
tde_create_translated_desktop( tde_create_translated_desktop(
SOURCE SOURCE
media_decrypt.desktop media_mount.desktop media_unmount.desktop media_mount.desktop media_unmount.desktop
media_unlock.desktop media_lock.desktop
media_eject.desktop media_safelyremove.desktop media_eject.desktop media_safelyremove.desktop
DESTINATION ${DATA_INSTALL_DIR}/konqueror/servicemenus DESTINATION ${DATA_INSTALL_DIR}/konqueror/servicemenus
PO_DIR tdeioslave-desktops PO_DIR tdeioslave-desktops

@ -1,3 +1,3 @@
servicesdir = $(kde_datadir)/konqueror/servicemenus servicesdir = $(kde_datadir)/konqueror/servicemenus
services_DATA = media_decrypt.desktop media_mount.desktop media_unmount.desktop media_eject.desktop media_safelyremove.desktop services_DATA = media_mount.desktop media_unmount.desktop media_unlock.desktop media_lock.desktop media_eject.desktop media_safelyremove.desktop

@ -0,0 +1,11 @@
[Desktop Entry]
X-TDE-ServiceTypes=media/removable_encrypted_unlocked,media/hdd_encrypted_unlocked,media/cdrom_encrypted_unlocked,media/cd-rw_encrypted_unlocked,media/dvd_encrypted_unlocked
Actions=MediaLock;
X-TDE-Priority=TopLevel
X-TDE-MediaNotifierHide=true
[Desktop Action MediaLock]
Exec=tdeio_media_mounthelper -l %u
Icon=encrypted
Name=Lock
Loading…
Cancel
Save