From 1f0259bfe8b23638a550916821b6dbd080fc7998 Mon Sep 17 00:00:00 2001 From: Nicolas Boichat Date: Fri, 19 Aug 2005 14:09:45 +0000 Subject: [PATCH] Put all multi-line strings on one line to fix VC++ compile errors... git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2340 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/wx-console/authenticate.c | 10 ++++++---- bacula/src/wx-console/console_conf.c | 22 +++++++++++++--------- bacula/src/wx-console/console_thread.cpp | 10 +++------- bacula/src/wx-console/wxbmainframe.cpp | 8 ++------ 4 files changed, 24 insertions(+), 26 deletions(-) diff --git a/bacula/src/wx-console/authenticate.c b/bacula/src/wx-console/authenticate.c index fc477f4768..bf2994b3cc 100644 --- a/bacula/src/wx-console/authenticate.c +++ b/bacula/src/wx-console/authenticate.c @@ -25,6 +25,11 @@ */ +/* _("...") macro returns a wxChar*, so if we need a char*, we need to convert it with: + * wxString(_("...")).mb_str(*wxConvCurrent) */ + +#include + #include "bacula.h" #include "console_conf.h" #include "jcr.h" @@ -140,10 +145,7 @@ int authenticate_director(JCR *jcr, DIRRES *director, CONRES *cons) bail_out: stop_bsock_timer(tid); - csprint( _("Director authorization problem.\n" - "Most likely the passwords do not agree.\n" - "If you are using TLS, there may have been a certificate validation error during the TLS handshake.\n" - "Please see http://www.bacula.org/rel-manual/faq.html#AuthorizationErrors for help.\n")); + csprint( _("Director authorization problem.\nMost likely the passwords do not agree.\nIf you are using TLS, there may have been a certificate validation error during the TLS handshake.\nPlease see http://www.bacula.org/rel-manual/faq.html#AuthorizationErrors for help.\n")); return 0; } diff --git a/bacula/src/wx-console/console_conf.c b/bacula/src/wx-console/console_conf.c index 7c327610e6..4c2dc4ae1b 100644 --- a/bacula/src/wx-console/console_conf.c +++ b/bacula/src/wx-console/console_conf.c @@ -34,6 +34,10 @@ */ +/* _("...") macro returns a wxChar*, so if we need a char*, we need to convert it with: + * wxString(_("...")).mb_str(*wxConvCurrent) */ + +#include #include "bacula.h" #include "console_conf.h" @@ -121,7 +125,7 @@ void dump_resource(int type, RES *reshdr, void sendit(void *sock, const char *fm int recurse = 1; if (res == NULL) { - printf(_("No record for %d %s\n"), type, res_to_str(type)); + printf(wxString(_("No record for %d %s\n")).mb_str(*wxConvCurrent), type, res_to_str(type)); return; } if (type < 0) { /* no recursion */ @@ -130,15 +134,15 @@ void dump_resource(int type, RES *reshdr, void sendit(void *sock, const char *fm } switch (type) { case R_CONSOLE: - printf(_("Console: name=%s rcfile=%s histfile=%s\n"), reshdr->name, + printf(wxString(_("Console: name=%s rcfile=%s histfile=%s\n")).mb_str(*wxConvCurrent), reshdr->name, res->res_cons.rc_file, res->res_cons.hist_file); break; case R_DIRECTOR: - printf(_("Director: name=%s address=%s DIRport=%d\n"), reshdr->name, + printf(wxString(_("Director: name=%s address=%s DIRport=%d\n")).mb_str(*wxConvCurrent), reshdr->name, res->res_dir.address, res->res_dir.DIRport); break; default: - printf(_("Unknown resource type %d\n"), type); + printf(wxString(_("Unknown resource type %d\n")).mb_str(*wxConvCurrent), type); } if (recurse && res->res_dir.hdr.next) { dump_resource(type, res->res_dir.hdr.next, sendit, sock); @@ -213,7 +217,7 @@ void free_resource(RES *sres, int type) } break; default: - printf(_("Unknown resource type %d\n"), type); + printf(wxString(_("Unknown resource type %d\n")).mb_str(*wxConvCurrent), type); } /* Common stuff again -- free the resource, recurse to next one */ free(res); @@ -239,7 +243,7 @@ void save_resource(int type, RES_ITEM *items, int pass) for (i=0; items[i].name; i++) { if (items[i].flags & ITEM_REQUIRED) { if (!bit_is_set(i, res_all.res_dir.hdr.item_present)) { - Emsg2(M_ABORT, 0, _("%s item is required in %s resource, but not found.\n"), + Emsg2(M_ABORT, 0, wxString(_("%s item is required in %s resource, but not found.\n")).mb_str(*wxConvCurrent), items[i].name, resources[rindex]); } } @@ -258,7 +262,7 @@ void save_resource(int type, RES_ITEM *items, int pass) break; default: - Emsg1(M_ERROR, 0, _("Unknown resource type %d\n"), type); + Emsg1(M_ERROR, 0, wxString(_("Unknown resource type %d\n")).mb_str(*wxConvCurrent), type); error = 1; break; } @@ -285,7 +289,7 @@ void save_resource(int type, RES_ITEM *items, int pass) size = sizeof(DIRRES); break; default: - printf(_("Unknown resource type %d\n"), type); + printf(wxString(_("Unknown resource type %d\n")).mb_str(*wxConvCurrent), type); error = 1; size = 1; break; @@ -301,7 +305,7 @@ void save_resource(int type, RES_ITEM *items, int pass) for (next=res_head[rindex]; next->next; next=next->next) { if (strcmp(next->name, res->res_dir.hdr.name) == 0) { Emsg2(M_ERROR_TERM, 0, - _("Attempt to define second %s resource named \"%s\" is not permitted.\n"), + wxString(_("Attempt to define second %s resource named \"%s\" is not permitted.\n")).mb_str(*wxConvCurrent), resources[rindex].name, res->res_dir.hdr.name); } } diff --git a/bacula/src/wx-console/console_thread.cpp b/bacula/src/wx-console/console_thread.cpp index 0ef8b068d5..76e075fedd 100644 --- a/bacula/src/wx-console/console_thread.cpp +++ b/bacula/src/wx-console/console_thread.cpp @@ -98,17 +98,14 @@ static int check_resources() } if ((!director->tls_ca_certfile && !director->tls_ca_certdir) && director->tls_enable) { - Jmsg(NULL, M_FATAL, 0, wxString(_("Neither \"TLS CA Certificate\"" - " or \"TLS CA Certificate Dir\" are defined for Director \"%s\" in config file.\n" - " At least one CA certificate store is required.\n")).mb_str(*wxConvCurrent), + Jmsg(NULL, M_FATAL, 0, wxString(_("Neither \"TLS CA Certificate\" or \"TLS CA Certificate Dir\" are defined for Director \"%s\" in config file.\nAt least one CA certificate store is required.\n")).mb_str(*wxConvCurrent), director->hdr.name); xOK = false; } } if (numdir == 0) { - Jmsg(NULL, M_FATAL, 0, wxString(_("No Director resource defined in config file.\n" - "Without that I don't how to speak to the Director :-(\n")).mb_str(*wxConvCurrent)); + Jmsg(NULL, M_FATAL, 0, wxString(_("No Director resource defined in config file.\nWithout that I don't how to speak to the Director :-(\n")).mb_str(*wxConvCurrent)); xOK = false; } @@ -127,8 +124,7 @@ static int check_resources() } if ((!cons->tls_ca_certfile && !cons->tls_ca_certdir) && cons->tls_enable) { - Jmsg(NULL, M_FATAL, 0, wxString(_("Neither \"TLS CA Certificate\"" - " or \"TLS CA Certificate Dir\" are defined for Console \"%s\" in config file.\n")).mb_str(*wxConvCurrent), + Jmsg(NULL, M_FATAL, 0, wxString(_("Neither \"TLS CA Certificate\" or \"TLS CA Certificate Dir\" are defined for Console \"%s\" in config file.\n")).mb_str(*wxConvCurrent), cons->hdr.name); xOK = false; } diff --git a/bacula/src/wx-console/wxbmainframe.cpp b/bacula/src/wx-console/wxbmainframe.cpp index 0a71c1213a..66f3844246 100644 --- a/bacula/src/wx-console/wxbmainframe.cpp +++ b/bacula/src/wx-console/wxbmainframe.cpp @@ -394,9 +394,7 @@ void wxbMainFrame::StartConsoleThread(const wxString& config) { int answer = wxMessageBox( wxString::Format(_( - "It seems that it is the first time you run wx-console.\n" - "This file (%s) has been choosen as default configuration file.\n" - "Do you want to edit it? (if you click No you will have to select another file)"), + "It seems that it is the first time you run wx-console.\nThis file (%s) has been choosen as default configuration file.\nDo you want to edit it? (if you click No you will have to select another file)"), configfile.c_str()), _("First run"), wxYES_NO | wxICON_QUESTION, this); @@ -415,9 +413,7 @@ void wxbMainFrame::StartConsoleThread(const wxString& config) { while (err != wxT("")) { int answer = wxMessageBox( wxString::Format(_( - "Unable to read %s\n" - "Error: %s\n" - "Do you want to choose another one? (Press no to edit this file)"), + "Unable to read %s\nError: %s\nDo you want to choose another one? (Press no to edit this file)"), configfile.c_str(), err.c_str()), _("Unable to read configuration file"), wxYES_NO | wxCANCEL | wxICON_ERROR, this); -- 2.39.5