Centralize the name of the updater application in AppInfo.h

This commit is contained in:
Robert Knight 2011-08-26 18:20:38 +01:00
parent 38c9cd9b41
commit 7597dee64a
4 changed files with 13 additions and 6 deletions

View file

@ -40,6 +40,7 @@ if (WIN32)
endif()
set (HEADERS
AppInfo.h
DirIterator.h
FileOps.h
Log.h

View file

@ -1,13 +1,14 @@
#include "UpdateDialogAscii.h"
#include "AppInfo.h"
#include "ProcessUtils.h"
#include "StringUtils.h"
const char* introMessage =
"Mendeley Updater (ASCII-art edition)\n"
"%s (ASCII-art edition)\n"
"====================================\n"
"\n"
"We have a nice graphical interface for the Mendeley Updater, but unfortunately\n"
"We have a nice graphical interface for the %s, but unfortunately\n"
"we can't show it to you :(\n"
"\n"
"You can fix this by installing the GTK 2 libraries.\n\n"
@ -17,13 +18,16 @@ void UpdateDialogAscii::init()
{
const char* path = "/tmp/update-progress";
m_output.open(path);
m_output << introMessage;
char message[4096];
sprintf(message,introMessage,AppInfo::name().c_str());
m_output << message;
std::string command = "xterm";
std::list<std::string> args;
args.push_back("-hold");
args.push_back("-T");
args.push_back("Mendeley Updater");
args.push_back(AppInfo::name());
args.push_back("-e");
args.push_back("tail");
args.push_back("-n+1");

View file

@ -1,5 +1,6 @@
#include "UpdateDialogGtk.h"
#include "AppInfo.h"
#include "StringUtils.h"
#include <glib.h>
@ -42,7 +43,7 @@ void UpdateDialogGtk::init(int argc, char** argv)
gtk_init(&argc,&argv);
m_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(m_window),"Mendeley Updater");
gtk_window_set_title(GTK_WINDOW(m_window),AppInfo::name().c_str());
gtk_window_set_resizable(GTK_WINDOW(m_window),false);
m_progressLabel = gtk_label_new("Installing Updates");

View file

@ -1,5 +1,6 @@
#include "UpdateDialogWin32.h"
#include "AppInfo.h"
#include "Log.h"
// enable themed controls
@ -90,7 +91,7 @@ void UpdateDialogWin32::init()
DWORD style = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX;
m_window.CreateEx(0 /* dwExStyle */,
updateDialogClassName /* class name */,
"Mendeley Updater",
AppInfo::name(),
style,
0, 0, width, height,
0 /* parent */, 0 /* menu */, 0 /* reserved */);