If there is a problem installing the update, suggest that the user download a fresh copy from mendeley.com

* Centralize the error message text shown to the user in the event of a problem
   installing the update in AppInfo::updateErrorMessage() and add a section
   suggesting that the user should download a new copy from mendeley.com
This commit is contained in:
Robert Knight 2011-08-29 18:57:12 +01:00
parent cdf2c2c6ba
commit c253cecfa6
4 changed files with 16 additions and 3 deletions

View file

@ -52,3 +52,12 @@ std::string AppInfo::logFilePath()
return appDataPath(organizationName(),appName()) + '/' + "update-log.txt";
}
std::string AppInfo::updateErrorMessage(const std::string& details)
{
std::string result = "There was a problem installing the update:\n\n";
result += details;
result += "\n\nYou can try downloading and installing the latest version of "
"Mendeley Desktop from http://www.mendeley.com/download-mendeley-desktop";
return result;
}

View file

@ -15,6 +15,11 @@ class AppInfo
static std::string organizationName();
static std::string logFilePath();
/** Returns a message to display to the user in the event
* of a problem installing the update.
*/
static std::string updateErrorMessage(const std::string& details);
};
inline std::string AppInfo::name()

View file

@ -103,7 +103,7 @@ gboolean UpdateDialogGtk::notify(void* _message)
case UpdateMessage::UpdateFailed:
{
dialog->m_hadError = true;
std::string errorMessage = "There was a problem installing the update:\n\n" + message->message;
std::string errorMessage = AppInfo::updateErrorMessage(message->message);
GtkWidget* errorDialog = gtk_message_dialog_new (GTK_WINDOW(dialog->m_window),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_ERROR,

View file

@ -171,8 +171,7 @@ LRESULT WINAPI UpdateDialogWin32::windowProc(HWND window, UINT message, WPARAM w
case UpdateMessage::UpdateFailed:
{
m_hadError = true;
std::string text = "There was a problem installing the update:\n\n" +
message->message;
std::string text = AppInfo::updateErrorMessage(message->message);
MessageBox(m_window.GetHwnd(),text.c_str(),"Update Problem",MB_OK);
}
break;