diff --git a/libretroshare/src/retroshare/rsinit.h b/libretroshare/src/retroshare/rsinit.h index e6c63eaa2..c071d4caf 100644 --- a/libretroshare/src/retroshare/rsinit.h +++ b/libretroshare/src/retroshare/rsinit.h @@ -118,7 +118,7 @@ class RsInit * This wrapper is used to lock the profile first before * finalising the login */ - static int LockAndLoadCertificates(bool autoLoginNT); + static int LockAndLoadCertificates(bool autoLoginNT, std::string& lockFilePath); /*! @@ -155,7 +155,7 @@ class RsInit static bool RsTryAutoLogin() ; /* Lock/unlock profile directory */ - static int LockConfigDirectory(const std::string& accountDir); + static int LockConfigDirectory(const std::string& accountDir, std::string& lockFilePath); static void UnlockConfigDirectory(); /* The true LoadCertificates() method */ diff --git a/libretroshare/src/rsserver/rsinit.cc b/libretroshare/src/rsserver/rsinit.cc index baeebfa3f..71ee2fb27 100644 --- a/libretroshare/src/rsserver/rsinit.cc +++ b/libretroshare/src/rsserver/rsinit.cc @@ -1053,10 +1053,11 @@ int RsInit::GetPGPLoginDetails(std::string id, std::string &name, std::stri * 1 : Another instance already has the lock * 2 : Unexpected error */ -int RsInit::LockConfigDirectory(const std::string& accountDir) +int RsInit::LockConfigDirectory(const std::string& accountDir, std::string& lockFilePath) { const std::string lockFile = accountDir + RsInitConfig::dirSeperator + "lock"; + lockFilePath = lockFile; /******************************** WINDOWS/UNIX SPECIFIC PART ******************/ #ifndef WINDOWS_SYS if(RsInitConfig::lockHandle != -1) @@ -1418,9 +1419,9 @@ bool RsInit::LoadPassword(std::string id, std::string inPwd) * 2 : unexpected error while locking * 3 : unexpected error while loading certificates */ -int RsInit::LockAndLoadCertificates(bool autoLoginNT) +int RsInit::LockAndLoadCertificates(bool autoLoginNT, std::string& lockFilePath) { - int retVal = LockConfigDirectory(RsInitConfig::configDir); + int retVal = LockConfigDirectory(RsInitConfig::configDir, lockFilePath); if(retVal != 0) return retVal; diff --git a/retroshare-gui/src/gui/GenCertDialog.cpp b/retroshare-gui/src/gui/GenCertDialog.cpp index f0b2e860b..f1e31a767 100644 --- a/retroshare-gui/src/gui/GenCertDialog.cpp +++ b/retroshare-gui/src/gui/GenCertDialog.cpp @@ -322,7 +322,8 @@ void GenCertDialog::checkChanged(int i) void GenCertDialog::loadCertificates() { - int retVal = RsInit::LockAndLoadCertificates(false); + std::string lockFile; + int retVal = RsInit::LockAndLoadCertificates(false, lockFile); switch(retVal) { case 0: close(); diff --git a/retroshare-gui/src/gui/StartDialog.cpp b/retroshare-gui/src/gui/StartDialog.cpp index 4c3cc6eed..8c53dd3de 100644 --- a/retroshare-gui/src/gui/StartDialog.cpp +++ b/retroshare-gui/src/gui/StartDialog.cpp @@ -152,7 +152,8 @@ void StartDialog::loadPerson() void StartDialog::loadCertificates() { /* Final stage of loading */ - int retVal = RsInit::LockAndLoadCertificates(ui.autologin_checkbox->isChecked()); + std::string lockFile; + int retVal = RsInit::LockAndLoadCertificates(ui.autologin_checkbox->isChecked(), lockFile); switch(retVal) { case 0: close(); @@ -161,12 +162,14 @@ void StartDialog::loadCertificates() tr("Multiple instances"), tr("Another RetroShare using the same profile is " "already running on your system. Please close " - "that instance first, or choose another profile") ); + "that instance first, or choose another profile\n" + "lock file:\n ")+ QString::fromStdString(lockFile)); break; case 2: QMessageBox::warning( this, tr("Multiple instances"), tr("An unexpected error occurred when Retroshare" - "tried to acquire the single instance lock") ); + "tried to acquire the single instance lock\n" + "lock file:\n ")+ QString::fromStdString(lockFile)); break; case 3: QMessageBox::warning( this, tr("Login Failure"), diff --git a/retroshare-gui/src/main.cpp b/retroshare-gui/src/main.cpp index e9b691ab2..66dd28926 100644 --- a/retroshare-gui/src/main.cpp +++ b/retroshare-gui/src/main.cpp @@ -166,20 +166,23 @@ int main(int argc, char *argv[]) } // true: note auto-login is active - int retVal = RsInit::LockAndLoadCertificates(true); + std::string lockFile; + int retVal = RsInit::LockAndLoadCertificates(true, lockFile); switch(retVal) { case 0: break; case 1: QMessageBox::warning( 0, QObject::tr("Multiple instances"), QObject::tr("Another RetroShare using the same profile is " - "already running on your system. Please close " - "that instance first") ); + "already running on your system. Please close " + "that instance first\n Lock file:\n") + + QString::fromStdString(lockFile)); return 1; case 2: QMessageBox::critical( 0, QObject::tr("Multiple instances"), QObject::tr("An unexpected error occurred when Retroshare" - "tried to acquire the single instance lock") ); + "tried to acquire the single instance lock\n Lock file:\n") + + QString::fromStdString(lockFile)); return 1; case 3: QMessageBox::critical( 0, QObject::tr("Login Failure"),