// the "About" item should be in the help menu
wxMenu *helpMenu = new wxMenu;
- helpMenu->Append(Minimal_About, _T(_("&About...\tF1")), _T(_("Show about dialog")));
+ helpMenu->Append(Minimal_About, _("&About...\tF1"), _("Show about dialog"));
- menuFile->Append(MenuConnect, _T(_("Connect")), _T(_("Connect to the director")));
- menuFile->Append(MenuDisconnect, _T(_("Disconnect")), _T(_("Disconnect of the director")));
+ menuFile->Append(MenuConnect, _("Connect"), _("Connect to the director"));
+ menuFile->Append(MenuDisconnect, _("Disconnect"), _("Disconnect of the director"));
menuFile->AppendSeparator();
- menuFile->Append(ChangeConfigFile, _T(_("Change of configuration file")), _T(_("Change your default configuration file")));
- menuFile->Append(EditConfigFile, _T(_("Edit your configuration file")), _T(_("Edit your configuration file")));
+ menuFile->Append(ChangeConfigFile, _("Change of configuration file"), _("Change your default configuration file"));
+ menuFile->Append(EditConfigFile, _("Edit your configuration file"), _("Edit your configuration file"));
menuFile->AppendSeparator();
- menuFile->Append(Minimal_Quit, _T(_("E&xit\tAlt-X")), _T(_("Quit this program")));
+ menuFile->Append(Minimal_Quit, _("E&xit\tAlt-X"), _("Quit this program"));
// now append the freshly created menu to the menu bar...
wxMenuBar *menuBar = new wxMenuBar();
- menuBar->Append(menuFile, _T(_("&File")));
- menuBar->Append(helpMenu, _T(_("&Help")));
+ menuBar->Append(menuFile, _("&File"));
+ menuBar->Append(helpMenu, _("&Help"));
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
CreateStatusBar(1);
- SetStatusText(wxString::Format(wxT(_("Welcome to bacula wx-console %s (%s)!\n")), wxT(VERSION), wxT(BDATE)));
+ SetStatusText(wxString::Format(_("Welcome to bacula wx-console %s (%s)!\n"), wxT(VERSION), wxT(BDATE)));
wxPanel* global = new wxPanel(this, -1);
/* Console */
wxPanel* consolePanel = new wxPanel(notebook, -1);
- notebook->AddPage(consolePanel, wxT(_("Console")));
+ notebook->AddPage(consolePanel, _("Console"));
consoleCtrl = new wxTextCtrl(consolePanel,-1,wxT(""),wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE | wxTE_READONLY | wxTE_RICH);
wxFont font(10, wxMODERN, wxNORMAL, wxNORMAL);
#if defined __WXGTK12__ && !defined __WXGTK20__ // Fix for "chinese" fonts under gtk+ 1.2
font.SetDefaultEncoding(wxFONTENCODING_ISO8859_1);
consoleCtrl->SetDefaultStyle(wxTextAttr(*wxBLACK, wxNullColour, font));
- Print(wxT(_("Warning : Unicode is disabled because you are using wxWidgets for GTK+ 1.2.\n")), CS_DEBUG);
+ Print(_("Warning : Unicode is disabled because you are using wxWidgets for GTK+ 1.2.\n"), CS_DEBUG);
#else
consoleCtrl->SetDefaultStyle(wxTextAttr(*wxBLACK, wxNullColour, font));
#if (wxUSE_UNICODE == 0) && __WXGTK20__
- Print(wxT(_("Warning : There is a problem with wxWidgets for GTK+ 2.0 without Unicode support when handling non-ASCII filenames: Every non-ASCII character in such filenames will be replaced by an interrogation mark.\nIf this behaviour disturbs you, please build wx-console against a Unicode version of wxWidgets for GTK+ 2.0.\n---\n")), CS_DEBUG);
+ Print(_("Warning : There is a problem with wxWidgets for GTK+ 2.0 without Unicode support when handling non-ASCII filenames: Every non-ASCII character in such filenames will be replaced by an interrogation mark.\nIf this behaviour disturbs you, please build wx-console against a Unicode version of wxWidgets for GTK+ 2.0.\n---\n"), CS_DEBUG);
#endif
#endif
- helpCtrl = new wxStaticText(consolePanel, -1, wxT(_("Type your command below:")));
+ helpCtrl = new wxStaticText(consolePanel, -1, _("Type your command below:"));
wxFlexGridSizer *consoleSizer = new wxFlexGridSizer(4, 1, 0, 0);
consoleSizer->AddGrowableCol(0);
consoleSizer->AddGrowableRow(0);
typeCtrl = new wxbHistoryTextCtrl(helpCtrl, consolePanel,TypeText,wxT(""),wxDefaultPosition,wxSize(200,20));
- sendButton = new wxButton(consolePanel, SendButton, wxT(_("Send")));
+ sendButton = new wxButton(consolePanel, SendButton, _("Send"));
wxFlexGridSizer *typeSizer = new wxFlexGridSizer(1, 2, 0, 0);
typeSizer->AddGrowableCol(0);
configfile = wxT("");
if (((wxTheApp->argc % 2) != 1)) {
- Print(wxT(_("Error while parsing command line arguments, using defaults.\n")), CS_DEBUG);
- Print(wxT(_("Usage: wx-console [-c configfile] [-w tmp]\n")), CS_DEBUG);
+ Print(_("Error while parsing command line arguments, using defaults.\n"), CS_DEBUG);
+ Print(_("Usage: wx-console [-c configfile] [-w tmp]\n"), CS_DEBUG);
}
else {
for (int c = 1; c < wxTheApp->argc; c += 2) {
console_thread::SetWorkingDirectory(wxTheApp->argv[c+1]);
}
if (wxTheApp->argv[c][0] != '-') {
- Print(wxT(_("Error while parsing command line arguments, using defaults.\n")), CS_DEBUG);
- Print(wxT(_("Usage: wx-console [-c configfile] [-w tmp]\n")), CS_DEBUG);
+ Print(_("Error while parsing command line arguments, using defaults.\n"), CS_DEBUG);
+ Print(_("Usage: wx-console [-c configfile] [-w tmp]\n"), CS_DEBUG);
break;
}
}
wxConfig::Get()->Write(wxT("/ConfigFile"), configfile);
int answer = wxMessageBox(
- wxString::Format(wxT(_(
+ 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)")),
+ "Do you want to edit it? (if you click No you will have to select another file)"),
configfile.c_str()),
- wxT(_("First run")),
+ _("First run"),
wxYES_NO | wxICON_QUESTION, this);
if (answer == wxYES) {
wxbConfigFileEditor(this, configfile).ShowModal();
while (err != wxT("")) {
int answer = wxMessageBox(
- wxString::Format(wxT(_(
+ wxString::Format(_(
"Unable to read %s\n"
"Error: %s\n"
- "Do you want to choose another one? (Press no to edit this file)")), configfile.c_str(), err.c_str()),
- wxT(_("Unable to read configuration file")),
+ "Do 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);
if (answer == wxNO) {
wxbConfigFileEditor(this, configfile).ShowModal();
return;
}
else { // (answer == wxYES)
- configfile = wxFileSelector(wxT(_("Please choose a configuration file to use")));
+ configfile = wxFileSelector(_("Please choose a configuration file to use"));
if ( !configfile.empty() ) {
err = console_thread::LoadConfig(configfile);
}
if ((err == wxT("")) && (config == wxT(""))) {
answer = wxMessageBox(
- wxT(_("This configuration file has been successfully read, use it as default?")),
- wxT(_("Configuration file read successfully")),
+ _("This configuration file has been successfully read, use it as default?"),
+ _("Configuration file read successfully"),
wxYES_NO | wxICON_QUESTION, this);
if (answer == wxYES) {
wxConfigBase::Get()->Write(wxT("/ConfigFile"), configfile);
}
// former was csprint
- Print(wxString::Format(wxT(_("Using this configuration file: %s\n")), configfile.c_str()), CS_DEBUG);
+ Print(wxString::Format(_("Using this configuration file: %s\n"), configfile.c_str()), CS_DEBUG);
ct = new console_thread();
ct->Create();
ct->Run();
- SetStatusText(wxT(_("Connecting to the director...")));
+ SetStatusText(_("Connecting to the director..."));
}
/* Register a new wxbDataParser */
parsers.RemoveAt(index);
}
else {
- Print(wxT(_("Failed to unregister a data parser !")), CS_DEBUG);
+ Print(_("Failed to unregister a data parser !"), CS_DEBUG);
}
}
void wxbMainFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
{
- Print(wxT(_("Quitting.\n")), CS_DEBUG);
+ Print(_("Quitting.\n"), CS_DEBUG);
if (ct != NULL) {
ct->Delete();
ct = NULL;
void wxbMainFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
wxString msg;
- msg.Printf( _T(_("Welcome to Bacula wx-console.\nWritten by Nicolas Boichat <nicolas@boichat.ch>\n(C) 2004 Kern Sibbald and John Walker\n")));
+ msg.Printf(_("Welcome to Bacula wx-console.\nWritten by Nicolas Boichat <nicolas@boichat.ch>\n(C) 2005 Kern Sibbald\n"));
- wxMessageBox(msg, _T(_("About Bacula wx-console")), wxOK | wxICON_INFORMATION, this);
+ wxMessageBox(msg, _("About Bacula wx-console"), wxOK | wxICON_INFORMATION, this);
}
void wxbMainFrame::OnChangeConfig(wxCommandEvent& event) {
wxString oriconfigfile;
wxConfig::Get()->Read(wxT("/ConfigFile"), &oriconfigfile);
- wxString configfile = wxFileSelector(wxT(_("Please choose your default configuration file")));
+ wxString configfile = wxFileSelector(_("Please choose your default configuration file"));
if ( !configfile.empty() ) {
if (oriconfigfile != configfile) {
int answer = wxMessageBox(
- wxT(_("Use this configuration file as default?")),
- wxT(_("Configuration file")),
+ _("Use this configuration file as default?"),
+ _("Configuration file"),
wxYES_NO | wxICON_QUESTION, this);
if (answer == wxYES) {
wxConfigBase::Get()->Write(wxT("/ConfigFile"), configfile);
if (status == CS_TERMINATED) {
consoleCtrl->AppendText(consoleBuffer);
consoleBuffer = wxT("");
- SetStatusText(wxT(_("Console thread terminated.")));
+ SetStatusText(_("Console thread terminated."));
consoleCtrl->PageDown();
ct = NULL;
DisablePanels();
- int answer = wxMessageBox( wxT(_("Connection to the director lost. Quit program?")),
- wxT(_("Connection lost")),
+ int answer = wxMessageBox( _("Connection to the director lost. Quit program?"),
+ _("Connection lost"),
wxYES_NO | wxICON_EXCLAMATION, this);
if (answer == wxYES) {
frame = NULL;
Close(true);
}
menuFile->Enable(MenuConnect, true);
- menuFile->SetLabel(MenuConnect, wxT(_("Connect")));
- menuFile->SetHelpString(MenuConnect, wxT(_("Connect to the director")));
+ menuFile->SetLabel(MenuConnect, _("Connect"));
+ menuFile->SetHelpString(MenuConnect, _("Connect to the director"));
menuFile->Enable(MenuDisconnect, false);
menuFile->Enable(ChangeConfigFile, true);
menuFile->Enable(EditConfigFile, true);
}
if (status == CS_CONNECTED) {
- SetStatusText(wxT(_("Connected to the director.")));
+ SetStatusText(_("Connected to the director."));
typeCtrl->ClearCommandList();
wxbDataTokenizer* dt = wxbUtils::WaitForEnd(wxT(".help"), true);
int i, j;
}
EnablePanels();
menuFile->Enable(MenuConnect, true);
- menuFile->SetLabel(MenuConnect, wxT(_("Reconnect")));
- menuFile->SetHelpString(MenuConnect, wxT(_("Reconnect to the director")));
+ menuFile->SetLabel(MenuConnect, _("Reconnect"));
+ menuFile->SetHelpString(MenuConnect, _("Reconnect to the director"));
menuFile->Enable(MenuDisconnect, true);
menuFile->Enable(ChangeConfigFile, true);
menuFile->Enable(EditConfigFile, true);
consoleCtrl->AppendText(consoleBuffer);
consoleBuffer = wxT("");
consoleCtrl->PageDown();
- SetStatusText(wxT(_("Disconnected of the director.")));
+ SetStatusText(_("Disconnected of the director."));
DisablePanels();
return;
}
}
if ((status == CS_PROMPT) && (promptcaught < 1) && (promptparser->isPrompt())) {
- Print(wxT(_("Unexpected question has been received.\n")), CS_DEBUG);
+ Print(_("Unexpected question has been received.\n"), CS_DEBUG);
// Print(wxString("(") << promptparser->getIntroString() << "/-/" << promptparser->getQuestionString() << ")\n", CS_DEBUG);
wxString message;
}
int res = ::wxGetSingleChoiceIndex(message,
- wxT(_("wx-console: unexpected director's question.")), n, choices, this);
+ _("wx-console: unexpected director's question."), n, choices, this);
if (res == -1) { //Cancel pressed
Send(wxT(".\n"));
}
}
else {
Send(::wxGetTextFromUser(message,
- wxT(_("wx-console: unexpected director's question.")),
+ _("wx-console: unexpected director's question."),
wxT(""), this) + wxT("\n"));
}
}
firstSizer->AddGrowableCol(0);
firstSizer->AddGrowableRow(0);
- start = new wxButton(this, RestoreStart, wxT(_("Enter restore mode")), wxDefaultPosition, wxSize(150, 30));
+ start = new wxButton(this, RestoreStart, _("Enter restore mode"), wxDefaultPosition, wxSize(150, 30));
firstSizer->Add(start, 0, wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 10);
- cancel = new wxButton(this, RestoreCancel, wxT(_("Cancel restore")), wxDefaultPosition, wxSize(150, 30));
+ cancel = new wxButton(this, RestoreCancel, _("Cancel restore"), wxDefaultPosition, wxSize(150, 30));
firstSizer->Add(cancel, 0, wxALIGN_CENTER_HORIZONTAL | wxALIGN_RIGHT, 10);
wxString elist[1];
treeSizer->Add(tree, 1, wxEXPAND, 0);
wxBoxSizer *treeCtrlSizer = new wxBoxSizer(wxHORIZONTAL);
- treeadd = new wxButton(treePanel, TreeAdd, wxT(_("Add")), wxDefaultPosition, wxSize(60, 25));
+ treeadd = new wxButton(treePanel, TreeAdd, _("Add"), wxDefaultPosition, wxSize(60, 25));
treeCtrlSizer->Add(treeadd, 0, wxLEFT | wxRIGHT, 3);
- treeremove = new wxButton(treePanel, TreeRemove, wxT(_("Remove")), wxDefaultPosition, wxSize(60, 25));
+ treeremove = new wxButton(treePanel, TreeRemove, _("Remove"), wxDefaultPosition, wxSize(60, 25));
treeCtrlSizer->Add(treeremove, 0, wxLEFT | wxRIGHT, 3);
- treerefresh = new wxButton(treePanel, TreeRefresh, wxT(_("Refresh")), wxDefaultPosition, wxSize(60, 25));
+ treerefresh = new wxButton(treePanel, TreeRefresh, _("Refresh"), wxDefaultPosition, wxSize(60, 25));
treeCtrlSizer->Add(treerefresh, 0, wxLEFT | wxRIGHT, 3);
treeSizer->Add(treeCtrlSizer, 1, wxALIGN_CENTER_HORIZONTAL, 0);
wxListItem info;
info.SetMask(wxLIST_MASK_TEXT | wxLIST_MASK_FORMAT);
- info.SetText(wxT(_("M")));
+ info.SetText(_("M"));
info.SetAlign(wxLIST_FORMAT_CENTER);
list->InsertColumn(0, info);
- info.SetText(wxT(_("Filename")));
+ info.SetText(_("Filename"));
info.SetAlign(wxLIST_FORMAT_LEFT);
list->InsertColumn(1, info);
- info.SetText(wxT(_("Size")));
+ info.SetText(_("Size"));
info.SetAlign(wxLIST_FORMAT_RIGHT);
list->InsertColumn(2, info);
- info.SetText(wxT(_("Date")));
+ info.SetText(_("Date"));
info.SetAlign(wxLIST_FORMAT_LEFT);
list->InsertColumn(3, info);
- info.SetText(wxT(_("Perm.")));
+ info.SetText(_("Perm."));
info.SetAlign(wxLIST_FORMAT_LEFT);
list->InsertColumn(4, info);
- info.SetText(wxT(_("User")));
+ info.SetText(_("User"));
info.SetAlign(wxLIST_FORMAT_RIGHT);
list->InsertColumn(5, info);
- info.SetText(wxT(_("Group")));
+ info.SetText(_("Group"));
info.SetAlign(wxLIST_FORMAT_RIGHT);
list->InsertColumn(6, info);
listSizer->Add(list, 1, wxEXPAND, 0);
wxBoxSizer *listCtrlSizer = new wxBoxSizer(wxHORIZONTAL);
- listadd = new wxButton(listPanel, ListAdd, wxT(_("Add")), wxDefaultPosition, wxSize(60, 25));
+ listadd = new wxButton(listPanel, ListAdd, _("Add"), wxDefaultPosition, wxSize(60, 25));
listCtrlSizer->Add(listadd, 0, wxLEFT | wxRIGHT, 5);
- listremove = new wxButton(listPanel, ListRemove, wxT(_("Remove")), wxDefaultPosition, wxSize(60, 25));
+ listremove = new wxButton(listPanel, ListRemove, _("Remove"), wxDefaultPosition, wxSize(60, 25));
listCtrlSizer->Add(listremove, 0, wxLEFT | wxRIGHT, 5);
- listrefresh = new wxButton(listPanel, ListRefresh, wxT(_("Refresh")), wxDefaultPosition, wxSize(60, 25));
+ listrefresh = new wxButton(listPanel, ListRefresh, _("Refresh"), wxDefaultPosition, wxSize(60, 25));
listCtrlSizer->Add(listrefresh, 0, wxLEFT | wxRIGHT, 5);
listSizer->Add(listCtrlSizer, 1, wxALIGN_CENTER_HORIZONTAL, 0);
treelistPanel->Show(false);
wxbConfig* config = new wxbConfig();
- config->Add(new wxbConfigParam(wxT(_("Job Name")), ConfigJobName, choice, 0, elist));
- config->Add(new wxbConfigParam(wxT(_("Client")), ConfigClient, choice, 0, elist));
- config->Add(new wxbConfigParam(wxT(_("Fileset")), ConfigFileset, choice, 0, elist));
- config->Add(new wxbConfigParam(wxT(_("Pool")), ConfigPool, choice, 0, elist));
- config->Add(new wxbConfigParam(wxT(_("Storage")), ConfigStorage, choice, 0, elist));
- config->Add(new wxbConfigParam(wxT(_("Before")), ConfigWhen, choice, 0, elist));
+ config->Add(new wxbConfigParam(_("Job Name"), ConfigJobName, choice, 0, elist));
+ config->Add(new wxbConfigParam(_("Client"), ConfigClient, choice, 0, elist));
+ config->Add(new wxbConfigParam(_("Fileset"), ConfigFileset, choice, 0, elist));
+ config->Add(new wxbConfigParam(_("Pool"), ConfigPool, choice, 0, elist));
+ config->Add(new wxbConfigParam(_("Storage"), ConfigStorage, choice, 0, elist));
+ config->Add(new wxbConfigParam(_("Before"), ConfigWhen, choice, 0, elist));
- configPanel = new wxbConfigPanel(this, config, wxT(_("Please configure parameters concerning files to restore :")), RestoreStart, RestoreCancel, -1);
+ configPanel = new wxbConfigPanel(this, config, _("Please configure parameters concerning files to restore :"), RestoreStart, RestoreCancel, -1);
configPanel->Show(true);
configPanel->Enable(false);
config = new wxbConfig();
- config->Add(new wxbConfigParam(wxT(_("Job Name")), -1, text, wxT("")));
- config->Add(new wxbConfigParam(wxT(_("Bootstrap")), -1, text, wxT("")));
- config->Add(new wxbConfigParam(wxT(_("Where")), ConfigWhere, modifiableText, wxT("")));
- wxString erlist[] = {wxT(_("always")), wxT(_("if newer")), wxT(_("if older")), wxT(_("never"))};
- config->Add(new wxbConfigParam(wxT(_("Replace")), ConfigReplace, choice, 4, erlist));
- config->Add(new wxbConfigParam(wxT(_("Fileset")), ConfigFileset, choice, 0, erlist));
- config->Add(new wxbConfigParam(wxT(_("Client")), ConfigClient, choice, 0, erlist));
- config->Add(new wxbConfigParam(wxT(_("Storage")), ConfigStorage, choice, 0, erlist));
- config->Add(new wxbConfigParam(wxT(_("When")), ConfigWhen, modifiableText, wxT("")));
- config->Add(new wxbConfigParam(wxT(_("Priority")), ConfigPriority, modifiableText, wxT("")));
-
- restorePanel = new wxbConfigPanel(this, config, wxT(_("Please configure parameters concerning files restoration :")), ConfigOk, ConfigCancel, ConfigApply);
+ config->Add(new wxbConfigParam(_("Job Name"), -1, text, wxT("")));
+ config->Add(new wxbConfigParam(_("Bootstrap"), -1, text, wxT("")));
+ config->Add(new wxbConfigParam(_("Where"), ConfigWhere, modifiableText, wxT("")));
+ wxString erlist[] = {_("always"), _("if newer"), _("if older"), _("never")};
+ config->Add(new wxbConfigParam(_("Replace"), ConfigReplace, choice, 4, erlist));
+ config->Add(new wxbConfigParam(_("Fileset"), ConfigFileset, choice, 0, erlist));
+ config->Add(new wxbConfigParam(_("Client"), ConfigClient, choice, 0, erlist));
+ config->Add(new wxbConfigParam(_("Storage"), ConfigStorage, choice, 0, erlist));
+ config->Add(new wxbConfigParam(_("When"), ConfigWhen, modifiableText, wxT("")));
+ config->Add(new wxbConfigParam(_("Priority"), ConfigPriority, modifiableText, wxT("")));
+
+ restorePanel = new wxbConfigPanel(this, config, _("Please configure parameters concerning files restoration :"), ConfigOk, ConfigCancel, ConfigApply);
restorePanel->Show(false);
----------------------------------------------------------------------------*/
wxString wxbRestorePanel::GetTitle() {
- return wxT(_("Restore"));
+ return _("Restore");
}
void wxbRestorePanel::EnablePanel(bool enable) {
void wxbRestorePanel::CmdStart() {
unsigned int i;
if (status == activable) {
- wxbMainFrame::GetInstance()->SetStatusText(wxT(_("Getting parameters list.")));
+ wxbMainFrame::GetInstance()->SetStatusText(_("Getting parameters list."));
wxbDataTokenizer* dt = wxbUtils::WaitForEnd(wxT(".clients\n"), true, false);
wxString str;
- configPanel->ClearRowChoices(wxT(_("Client")));
- restorePanel->ClearRowChoices(wxT(_("Client")));
+ configPanel->ClearRowChoices(_("Client"));
+ restorePanel->ClearRowChoices(_("Client"));
if (dt->GetCount() == 0) {
- wxbMainFrame::GetInstance()->SetStatusText(wxT(_("Error : no clients returned by the director.")));
+ wxbMainFrame::GetInstance()->SetStatusText(_("Error : no clients returned by the director."));
return;
}
for (i = 0; i < dt->GetCount(); i++) {
str = (*dt)[i];
str.RemoveLast();
- configPanel->AddRowChoice(wxT(_("Client")), str);
- restorePanel->AddRowChoice(wxT(_("Client")), str);
+ configPanel->AddRowChoice(_("Client"), str);
+ restorePanel->AddRowChoice(_("Client"), str);
}
delete dt;
dt = wxbUtils::WaitForEnd(wxT(".filesets\n"), true, false);
- configPanel->ClearRowChoices(wxT(_("Fileset")));
- restorePanel->ClearRowChoices(wxT(_("Fileset")));
+ configPanel->ClearRowChoices(_("Fileset"));
+ restorePanel->ClearRowChoices(_("Fileset"));
if (dt->GetCount() == 0) {
- wxbMainFrame::GetInstance()->SetStatusText(wxT(_("Error : no filesets returned by the director.")));
+ wxbMainFrame::GetInstance()->SetStatusText(_("Error : no filesets returned by the director."));
return;
}
for (i = 0; i < dt->GetCount(); i++) {
str = (*dt)[i];
str.RemoveLast();
- configPanel->AddRowChoice(wxT(_("Fileset")), str);
- restorePanel->AddRowChoice(wxT(_("Fileset")), str);
+ configPanel->AddRowChoice(_("Fileset"), str);
+ restorePanel->AddRowChoice(_("Fileset"), str);
}
delete dt;
dt = wxbUtils::WaitForEnd(wxT(".storage\n"), true, false);
- configPanel->ClearRowChoices(wxT(_("Storage")));
- restorePanel->ClearRowChoices(wxT(_("Storage")));
+ configPanel->ClearRowChoices(_("Storage"));
+ restorePanel->ClearRowChoices(_("Storage"));
if (dt->GetCount() == 0) {
- wxbMainFrame::GetInstance()->SetStatusText(wxT(_("Error : no storage returned by the director.")));
+ wxbMainFrame::GetInstance()->SetStatusText(_("Error : no storage returned by the director."));
return;
}
for (i = 0; i < dt->GetCount(); i++) {
str = (*dt)[i];
str.RemoveLast();
- configPanel->AddRowChoice(wxT(_("Storage")), str);
- restorePanel->AddRowChoice(wxT(_("Storage")), str);
+ configPanel->AddRowChoice(_("Storage"), str);
+ restorePanel->AddRowChoice(_("Storage"), str);
}
delete dt;
dt = wxbUtils::WaitForEnd(wxT(".jobs\n"), true, false);
- configPanel->ClearRowChoices(wxT(_("Job Name")));
+ configPanel->ClearRowChoices(_("Job Name"));
if (dt->GetCount() == 0) {
- wxbMainFrame::GetInstance()->SetStatusText(wxT(_("Error : no jobs returned by the director.")));
+ wxbMainFrame::GetInstance()->SetStatusText(_("Error : no jobs returned by the director."));
return;
}
for (i = 0; i < dt->GetCount(); i++) {
str = (*dt)[i];
str.RemoveLast();
- configPanel->AddRowChoice(wxT(_("Job Name")), str);
+ configPanel->AddRowChoice(_("Job Name"), str);
}
- configPanel->SetRowString(wxT(_("Job Name")), wxT(_("RestoreFiles")));
+ configPanel->SetRowString(_("Job Name"), _("RestoreFiles"));
delete dt;
dt = wxbUtils::WaitForEnd(wxT(".pools\n"), true, false);
- configPanel->ClearRowChoices(wxT(_("Pool")));
+ configPanel->ClearRowChoices(_("Pool"));
if (dt->GetCount() == 0) {
- wxbMainFrame::GetInstance()->SetStatusText(wxT(_("Error : no jobs returned by the director.")));
+ wxbMainFrame::GetInstance()->SetStatusText(_("Error : no jobs returned by the director."));
return;
}
for (i = 0; i < dt->GetCount(); i++) {
str = (*dt)[i];
str.RemoveLast();
- configPanel->AddRowChoice(wxT(_("Pool")), str);
+ configPanel->AddRowChoice(_("Pool"), str);
}
delete dt;
UpdateFirstConfig();
- wxbMainFrame::GetInstance()->SetStatusText(wxT(_("Please configure your restore parameters.")));
+ wxbMainFrame::GetInstance()->SetStatusText(_("Please configure your restore parameters."));
}
else if (status == entered) {
/* if (clientChoice->GetStringSelection().Length() < 1) {
wxbMainFrame::GetInstance()->SetStatusText(_("Please select a restore date."));
return;
}*/
- wxbMainFrame::GetInstance()->SetStatusText(wxT(_("Building restore tree...")));
+ wxbMainFrame::GetInstance()->SetStatusText(_("Building restore tree..."));
SetStatus(choosing);
str = (*dt)[dt->GetCount()-2];
str.RemoveLast();
}
- wxbMainFrame::GetInstance()->SetStatusText(wxString(wxT(_("Error while starting restore: "))) << str);
+ wxbMainFrame::GetInstance()->SetStatusText(wxString(_("Error while starting restore: ")) << str);
delete dt;
delete tableparser;
SetStatus(finished);
}
wxbUtils::WaitForEnd(wxT("unmark *\n"));
- wxTreeItemId root = tree->AddRoot(configPanel->GetRowString(wxT(_("Client"))), -1, -1, new wxbTreeItemData(wxT("/"), configPanel->GetRowString(wxT(_("Client"))), 0));
+ wxTreeItemId root = tree->AddRoot(configPanel->GetRowString(_("Client")), -1, -1, new wxbTreeItemData(wxT("/"), configPanel->GetRowString(_("Client")), 0));
currentTreeItem = root;
tree->Refresh();
tree->SelectItem(root);
CmdList(root);
- wxbMainFrame::GetInstance()->SetStatusText(wxT(_("Right click on a file or on a directory, or double-click on its mark to add it to the restore list.")));
+ wxbMainFrame::GetInstance()->SetStatusText(_("Right click on a file or on a directory, or double-click on its mark to add it to the restore list."));
tree->Expand(root);
}
else if (status == choosing) {
SetStatus(configuring);
for (i = 0; i < dt->GetCount(); i++) {
- if ((j = (*dt)[i].Find(wxT(_(" files selected to be restored.")))) > -1) {
+ if ((j = (*dt)[i].Find(_(" files selected to be restored."))) > -1) {
(*dt)[i].Mid(0, j).ToLong(&totfilemessages);
break;
}
- if ((j = (*dt)[i].Find(wxT(_(" file selected to be restored.")))) > -1) {
+ if ((j = (*dt)[i].Find(_(" file selected to be restored."))) > -1) {
(*dt)[i].Mid(0, j).ToLong(&totfilemessages);
break;
}
}
wxbMainFrame::GetInstance()->SetStatusText(
- wxString::Format(wxT(_("Please configure your restore (%ld files selected to be restored)...")), totfilemessages));
+ wxString::Format(_("Please configure your restore (%ld files selected to be restored)..."), totfilemessages));
UpdateSecondConfig(dt);
restorePanel->EnableApply(false);
if (totfilemessages == 0) {
- wxbMainFrame::GetInstance()->Print(wxT(_("Restore failed : no file selected.\n")), CS_DEBUG);
- wxbMainFrame::GetInstance()->SetStatusText(wxT(_("Restore failed : no file selected.")));
+ wxbMainFrame::GetInstance()->Print(_("Restore failed : no file selected.\n"), CS_DEBUG);
+ wxbMainFrame::GetInstance()->SetStatusText(_("Restore failed : no file selected."));
SetStatus(finished);
return;
}
jobid = wxT("");
EnableConfig(false);
- wxbMainFrame::GetInstance()->SetStatusText(wxT(_("Restoring, please wait...")));
+ wxbMainFrame::GetInstance()->SetStatusText(_("Restoring, please wait..."));
wxbDataTokenizer* dt;
int j;
for (i = 0; i < dt->GetCount(); i++) {
- if ((j = (*dt)[i].Find(wxT(_("Job started. JobId=")))) > -1) {
+ if ((j = (*dt)[i].Find(_("Job started. JobId="))) > -1) {
jobid = (*dt)[i].Mid(j+19);
- wxbMainFrame::GetInstance()->SetStatusText(wxT(_("Restore started, jobid=")) + jobid);
+ wxbMainFrame::GetInstance()->SetStatusText(_("Restore started, jobid=") + jobid);
break;
}
- if ((j = (*dt)[i].Find(wxT(_("Job failed.")))) > -1) {
- wxbMainFrame::GetInstance()->Print(wxT(_("Restore failed, please look at messages.\n")), CS_DEBUG);
- wxbMainFrame::GetInstance()->SetStatusText(wxT(_("Restore failed, please look at messages in console.")));
+ if ((j = (*dt)[i].Find(_("Job failed."))) > -1) {
+ wxbMainFrame::GetInstance()->Print(_("Restore failed, please look at messages.\n"), CS_DEBUG);
+ wxbMainFrame::GetInstance()->SetStatusText(_("Restore failed, please look at messages in console."));
return;
}
}
if (jobid == wxT("")) {
- wxbMainFrame::GetInstance()->Print(wxT(_("Failed to retrieve jobid.\n")), CS_DEBUG);
- wxbMainFrame::GetInstance()->SetStatusText(wxT(_("Failed to retrieve jobid.\n")));
+ wxbMainFrame::GetInstance()->Print(_("Failed to retrieve jobid.\n"), CS_DEBUG);
+ wxbMainFrame::GetInstance()->SetStatusText(_("Failed to retrieve jobid.\n"));
return;
}
delete dt;
wxDateTime scheduledtime;
- wxStringTokenizer stkz(restorePanel->GetRowString(wxT(_("When"))), wxT(" "), wxTOKEN_STRTOK);
+ wxStringTokenizer stkz(restorePanel->GetRowString(_("When")), wxT(" "), wxTOKEN_STRTOK);
if ((scheduledtime.ParseDate(stkz.GetNextToken()) == NULL) || // Date
(scheduledtime.ParseTime(stkz.GetNextToken()) == NULL)) { // Time
}
if (scheduledtime.Subtract(currenttime).IsLongerThan(wxTimeSpan::Seconds(150))) {
- wxbMainFrame::GetInstance()->Print(wxT(_("Restore is scheduled in more than two minutes, wx-console will not wait for its completion.\n")), CS_DEBUG);
- wxbMainFrame::GetInstance()->SetStatusText(wxT(_("Restore is scheduled in more than two minutes, wx-console will not wait for its completion.")));
+ wxbMainFrame::GetInstance()->Print(_("Restore is scheduled in more than two minutes, wx-console will not wait for its completion.\n"), CS_DEBUG);
+ wxbMainFrame::GetInstance()->SetStatusText(_("Restore is scheduled in more than two minutes, wx-console will not wait for its completion."));
SetStatus(finished);
return;
}
status = (*tableparser)[0][7].GetChar(0);
switch (status) {
case JS_Created:
- wxbMainFrame::GetInstance()->SetStatusText(wxT(_("Restore job created, but not yet running.")));
+ wxbMainFrame::GetInstance()->SetStatusText(_("Restore job created, but not yet running."));
waitforever = false;
break;
case JS_Running:
wxbMainFrame::GetInstance()->SetStatusText(
- wxString::Format(wxT(_("Restore job running, please wait (%ld of %ld files restored)...")), filemessages, totfilemessages));
+ wxString::Format(_("Restore job running, please wait (%ld of %ld files restored)..."), filemessages, totfilemessages));
waitforever = true;
break;
case JS_Terminated:
- wxbMainFrame::GetInstance()->SetStatusText(wxT(_("Restore job terminated successfully.")));
- wxbMainFrame::GetInstance()->Print(wxT(_("Restore job terminated successfully.\n")), CS_DEBUG);
+ wxbMainFrame::GetInstance()->SetStatusText(_("Restore job terminated successfully."));
+ wxbMainFrame::GetInstance()->Print(_("Restore job terminated successfully.\n"), CS_DEBUG);
waitforever = false;
ended = true;
break;
case JS_ErrorTerminated:
- wxbMainFrame::GetInstance()->SetStatusText(wxT(_("Restore job terminated in error, see messages in console.")));
- wxbMainFrame::GetInstance()->Print(wxT(_("Restore job terminated in error, see messages.\n")), CS_DEBUG);
+ wxbMainFrame::GetInstance()->SetStatusText(_("Restore job terminated in error, see messages in console."));
+ wxbMainFrame::GetInstance()->Print(_("Restore job terminated in error, see messages.\n"), CS_DEBUG);
waitforever = false;
ended = true;
break;
case JS_Error:
- wxbMainFrame::GetInstance()->SetStatusText(wxT(_("Restore job reported a non-fatal error.")));
+ wxbMainFrame::GetInstance()->SetStatusText(_("Restore job reported a non-fatal error."));
waitforever = false;
break;
case JS_FatalError:
- wxbMainFrame::GetInstance()->SetStatusText(wxT(_("Restore job reported a fatal error.")));
+ wxbMainFrame::GetInstance()->SetStatusText(_("Restore job reported a fatal error."));
waitforever = false;
ended = true;
break;
case JS_Canceled:
- wxbMainFrame::GetInstance()->SetStatusText(wxT(_("Restore job cancelled by user.")));
- wxbMainFrame::GetInstance()->Print(wxT(_("Restore job cancelled by user.\n")), CS_DEBUG);
+ wxbMainFrame::GetInstance()->SetStatusText(_("Restore job cancelled by user."));
+ wxbMainFrame::GetInstance()->Print(_("Restore job cancelled by user.\n"), CS_DEBUG);
waitforever = false;
ended = true;
break;
case JS_WaitFD:
- wxbMainFrame::GetInstance()->SetStatusText(wxT(_("Restore job is waiting on File daemon.")));
+ wxbMainFrame::GetInstance()->SetStatusText(_("Restore job is waiting on File daemon."));
waitforever = false;
break;
case JS_WaitMedia:
- wxbMainFrame::GetInstance()->SetStatusText(wxT(_("Restore job is waiting for new media.")));
+ wxbMainFrame::GetInstance()->SetStatusText(_("Restore job is waiting for new media."));
waitforever = false;
break;
case JS_WaitStoreRes:
- wxbMainFrame::GetInstance()->SetStatusText(wxT(_("Restore job is waiting for storage resource.")));
+ wxbMainFrame::GetInstance()->SetStatusText(_("Restore job is waiting for storage resource."));
waitforever = false;
break;
case JS_WaitJobRes:
- wxbMainFrame::GetInstance()->SetStatusText(wxT(_("Restore job is waiting for job resource.")));
+ wxbMainFrame::GetInstance()->SetStatusText(_("Restore job is waiting for job resource."));
waitforever = false;
break;
case JS_WaitClientRes:
- wxbMainFrame::GetInstance()->SetStatusText(wxT(_("Restore job is waiting for Client resource.")));
+ wxbMainFrame::GetInstance()->SetStatusText(_("Restore job is waiting for Client resource."));
waitforever = false;
break;
case JS_WaitMaxJobs:
- wxbMainFrame::GetInstance()->SetStatusText(wxT(_("Restore job is waiting for maximum jobs.")));
+ wxbMainFrame::GetInstance()->SetStatusText(_("Restore job is waiting for maximum jobs."));
waitforever = false;
break;
case JS_WaitStartTime:
- wxbMainFrame::GetInstance()->SetStatusText(wxT(_("Restore job is waiting for start time.")));
+ wxbMainFrame::GetInstance()->SetStatusText(_("Restore job is waiting for start time."));
waitforever = false;
break;
case JS_WaitPriority:
- wxbMainFrame::GetInstance()->SetStatusText(wxT(_("Restore job is waiting for higher priority jobs to finish.")));
+ wxbMainFrame::GetInstance()->SetStatusText(_("Restore job is waiting for higher priority jobs to finish."));
waitforever = false;
break;
}
}
if ((!waitforever) && (sw.Time() > 60000)) {
- wxbMainFrame::GetInstance()->Print(wxT(_("The restore job has not been started within one minute, wx-console will not wait for its completion anymore.\n")), CS_DEBUG);
- wxbMainFrame::GetInstance()->SetStatusText(wxT(_("The restore job has not been started within one minute, wx-console will not wait for its completion anymore.")));
+ wxbMainFrame::GetInstance()->Print(_("The restore job has not been started within one minute, wx-console will not wait for its completion anymore.\n"), CS_DEBUG);
+ wxbMainFrame::GetInstance()->SetStatusText(_("The restore job has not been started within one minute, wx-console will not wait for its completion anymore."));
break;
}
}
gauge->SetValue(totfilemessages);
if (status == JS_Terminated) {
- wxbMainFrame::GetInstance()->Print(wxT(_("Restore done successfully.\n")), CS_DEBUG);
- wxbMainFrame::GetInstance()->SetStatusText(wxT(_("Restore done successfully.")));
+ wxbMainFrame::GetInstance()->Print(_("Restore done successfully.\n"), CS_DEBUG);
+ wxbMainFrame::GetInstance()->SetStatusText(_("Restore done successfully."));
}
SetStatus(finished);
}
switch (status) {
case choosing:
- wxbMainFrame::GetInstance()->Send(wxT("quit\n"));
+ wxbMainFrame::GetInstance()->Send(wxT("quit\n"));
break;
case configuring:
- wxbMainFrame::GetInstance()->Send(wxT("no\n"));
+ wxbMainFrame::GetInstance()->Send(wxT("no\n"));
break;
default:
break;
void wxbRestorePanel::CmdConfigApply() {
if (cfgUpdated == 0) return;
- wxbMainFrame::GetInstance()->SetStatusText(wxT(_("Applying restore configuration changes...")));
+ wxbMainFrame::GetInstance()->SetStatusText(_("Applying restore configuration changes..."));
EnableConfig(false);
wxbUtils::WaitForPrompt(wxT("mod\n")); /* TODO: check results */
wxbUtils::WaitForPrompt(wxT("9\n"));
dt = new wxbDataTokenizer(true);
- wxbUtils::WaitForPrompt(restorePanel->GetRowString(wxT(_("Where"))) + wxT("\n"));
+ wxbUtils::WaitForPrompt(restorePanel->GetRowString(_("Where")) + wxT("\n"));
def = wxT("/tmp");
cfgUpdated = cfgUpdated & (~(1 << ConfigWhere));
}
wxbUtils::WaitForPrompt(wxT("mod\n")); /* TODO: check results */
wxbUtils::WaitForPrompt(wxT("10\n"));
dt = new wxbDataTokenizer(true);
- wxbUtils::WaitForPrompt(wxString() << (restorePanel->GetRowSelection(wxT(_("Replace")))+1) << wxT("\n"));
+ wxbUtils::WaitForPrompt(wxString() << (restorePanel->GetRowSelection(_("Replace"))+1) << wxT("\n"));
def = wxT("1");
cfgUpdated = cfgUpdated & (~(1 << ConfigReplace));
}
wxbUtils::WaitForPrompt(wxT("mod\n")); /* TODO: check results */
wxbUtils::WaitForPrompt(wxT("6\n"));
dt = new wxbDataTokenizer(true);
- wxbUtils::WaitForPrompt(restorePanel->GetRowString(wxT(("When"))) + wxT("\n"));
+ wxbUtils::WaitForPrompt(restorePanel->GetRowString(wxT("When")) + wxT("\n"));
def = wxT("");
cfgUpdated = cfgUpdated & (~(1 << ConfigWhen));
}
wxbUtils::WaitForPrompt(wxT("mod\n")); /* TODO: check results */
wxbUtils::WaitForPrompt(wxT("7\n"));
dt = new wxbDataTokenizer(true);
- wxbUtils::WaitForPrompt(restorePanel->GetRowString(wxT(_("Priority"))) + wxT("\n"));
+ wxbUtils::WaitForPrompt(restorePanel->GetRowString(_("Priority")) + wxT("\n"));
def = wxT("10");
cfgUpdated = cfgUpdated & (~(1 << ConfigPriority));
}
else if ((cfgUpdated >> ConfigClient) & 1) {
wxbUtils::WaitForPrompt(wxT("mod\n")); /* TODO: check results */
wxbPromptParser *pp = wxbUtils::WaitForPrompt(wxT("5\n"), true);
- int client = pp->getChoices()->Index(restorePanel->GetRowString(wxT(_("Client"))));
+ int client = pp->getChoices()->Index(restorePanel->GetRowString(_("Client")));
if (client == wxNOT_FOUND) {
- wxbMainFrame::GetInstance()->SetStatusText(wxT(_("Failed to find the selected client.")));
+ wxbMainFrame::GetInstance()->SetStatusText(_("Failed to find the selected client."));
failed = true;
client = 1;
}
else if ((cfgUpdated >> ConfigFileset) & 1) {
wxbUtils::WaitForPrompt(wxT("mod\n")); /* TODO: check results */
wxbPromptParser *pp = wxbUtils::WaitForPrompt(wxT("4\n"), true);
- int fileset = pp->getChoices()->Index(restorePanel->GetRowString(wxT(_("Fileset"))));
+ int fileset = pp->getChoices()->Index(restorePanel->GetRowString(_("Fileset")));
if (fileset == wxNOT_FOUND) {
- wxbMainFrame::GetInstance()->SetStatusText(wxT(_("Failed to find the selected fileset.")));
+ wxbMainFrame::GetInstance()->SetStatusText(_("Failed to find the selected fileset."));
failed = true;
fileset = 1;
}
else if ((cfgUpdated >> ConfigStorage) & 1) {
wxbUtils::WaitForPrompt(wxT("mod\n")); /* TODO: check results */
wxbPromptParser *pp = wxbUtils::WaitForPrompt(wxT("2\n"), true);
- int fileset = pp->getChoices()->Index(restorePanel->GetRowString(wxT(_("Storage"))));
+ int fileset = pp->getChoices()->Index(restorePanel->GetRowString(_("Storage")));
if (fileset == wxNOT_FOUND) {
- wxbMainFrame::GetInstance()->SetStatusText(wxT(_("Failed to find the selected storage.")));
+ wxbMainFrame::GetInstance()->SetStatusText(_("Failed to find the selected storage."));
failed = true;
fileset = 1;
}
unsigned int i;
for (i = 0; i < dt->GetCount(); i++) {
- if ((*dt)[i].Find(wxT(_("Run Restore job"))) == 0) {
+ if ((*dt)[i].Find(_("Run Restore job")) == 0) {
break;
}
}
EnableConfig(true);
if (!failed) {
- wxbMainFrame::GetInstance()->SetStatusText(wxT(_("Restore configuration changes were applied.")));
+ wxbMainFrame::GetInstance()->SetStatusText(_("Restore configuration changes were applied."));
}
delete dt;
/* Cancel restore */
void wxbRestorePanel::CmdConfigCancel() {
wxbUtils::WaitForEnd(wxT("no\n"));
- wxbMainFrame::GetInstance()->Print(wxT(_("Restore cancelled.\n")), CS_DEBUG);
- wxbMainFrame::GetInstance()->SetStatusText(wxT(_("Restore cancelled.")));
+ wxbMainFrame::GetInstance()->Print(_("Restore cancelled.\n"), CS_DEBUG);
+ wxbMainFrame::GetInstance()->SetStatusText(_("Restore cancelled."));
SetStatus(finished);
}
/* List jobs for a specified client */
void wxbRestorePanel::CmdListJobs() {
if (status == entered) {
- configPanel->ClearRowChoices(wxT(_("Before")));
+ configPanel->ClearRowChoices(_("Before"));
/*wxbUtils::WaitForPrompt("query\n");
wxbUtils::WaitForPrompt("6\n");*/
wxbTableParser* tableparser = new wxbTableParser(false);
wxbDataTokenizer* dt = wxbUtils::WaitForEnd(
- wxString(wxT(".backups client=")) + configPanel->GetRowString(wxT(_("Client"))) + wxT("\n"), true);
+ wxString(wxT(".backups client=") + configPanel->GetRowString(_("Client")) + wxT("\n"), true));
while (!tableparser->hasFinished()) {
wxTheApp->Yield(true);
if (!tableparser->GetCount() == 0) {
for (unsigned int i = 0; i < dt->Count(); i++) {
- if ((*dt)[i].Find(wxT(_("No results to list."))) == 0) {
- configPanel->AddRowChoice(wxT(_("Before")),
- wxT(_("No backup found for this client.")));
- configPanel->SetRowSelection(wxT(_("Before")), 0);
+ if ((*dt)[i].Find(_("No results to list.")) == 0) {
+ configPanel->AddRowChoice(_("Before"),
+ _("No backup found for this client."));
+ configPanel->SetRowSelection(_("Before"), 0);
configPanel->EnableApply(true); // Enabling the not existing apply button disables the ok button.
delete tableparser;
delete dt;
return;
}
- else if (((*dt)[i].Find(wxT(_("ERROR"))) > -1) ||
- ((*dt)[i].Find(wxT(_("Query failed"))) > -1)) {
- configPanel->AddRowChoice(wxT(_("Before")),
- wxT(_("Cannot get previous backups list, see console.")));
- configPanel->SetRowSelection(wxT(_("Before")), 0);
+ else if (((*dt)[i].Find(_("ERROR")) > -1) ||
+ ((*dt)[i].Find(_("Query failed")) > -1)) {
+ configPanel->AddRowChoice(_("Before"),
+ _("Cannot get previous backups list, see console."));
+ configPanel->SetRowSelection(_("Before"), 0);
configPanel->EnableApply(true); // Enabling the not existing apply button disables the ok button.
delete tableparser;
delete dt;
const wxChar* chr;
if ( ( (chr = datetime.ParseDate(str.GetData()) ) != NULL ) && ( datetime.ParseTime(++chr) != NULL ) ) {
datetime += wxTimeSpan::Seconds(1);
- configPanel->AddRowChoice(wxT(_("Before")),
+ configPanel->AddRowChoice(_("Before"),
datetime.Format(wxT("%Y-%m-%d %H:%M:%S")));
}
}
delete tableparser;
- configPanel->SetRowSelection(wxT(_("Before")), 0);
+ configPanel->SetRowSelection(_("Before"), 0);
configPanel->EnableApply(false); // Disabling the not existing apply button enables the ok button.
}
}
/* Update first config, adapting settings to the job name selected */
void wxbRestorePanel::UpdateFirstConfig() {
configPanel->Enable(false);
- wxbDataTokenizer* dt = wxbUtils::WaitForEnd(wxString(wxT(".defaults job=")) + configPanel->GetRowString(wxT(_("Job Name"))) + wxT("\n"), true, false);
+ wxbDataTokenizer* dt = wxbUtils::WaitForEnd(wxString(wxT(".defaults job=")) + configPanel->GetRowString(_("Job Name")) + wxT("\n"), true, false);
/* job=RestoreFiles
* pool=Default
* messages=Standard
if ((j = str.Find('=')) > -1) {
name = str.Mid(0, j);
if (name == wxT("pool")) {
- configPanel->SetRowString(wxT(_("Pool")), str.Mid(j+1));
+ configPanel->SetRowString(_("Pool"), str.Mid(j+1));
}
else if (name == wxT("client")) {
str = str.Mid(j+1);
- if ((str != configPanel->GetRowString(wxT(_("Client")))) ||
- (configPanel->GetRowString(wxT(_("Before"))) == wxT(""))) {
- configPanel->SetRowString(wxT(_("Client")), str);
+ if ((str != configPanel->GetRowString(_("Client"))) ||
+ (configPanel->GetRowString(_("Before"))) == wxT("")) {
+ configPanel->SetRowString(_("Client"), str);
dolistjobs = true;
}
}
else if (name == wxT("storage")) {
- configPanel->SetRowString(wxT(_("Storage")), str.Mid(j+1));
+ configPanel->SetRowString(_("Storage"), str.Mid(j+1));
}
else if (name == wxT("fileset")) {
- configPanel->SetRowString(wxT(_("Fileset")), str.Mid(j+1));
+ configPanel->SetRowString(_("Fileset"), str.Mid(j+1));
}
}
}
bool wxbRestorePanel::UpdateSecondConfig(wxbDataTokenizer* dt) {
unsigned int i;
for (i = 0; i < dt->GetCount(); i++) {
- if ((*dt)[i].Find(wxT(_("Run Restore job"))) == 0)
+ if ((*dt)[i].Find(_("Run Restore job")) == 0)
break;
}
int k;
- if ((k = (*dt)[++i].Find(wxT(_("JobName:")))) != 0) return false;
- restorePanel->SetRowString(wxT(_("Job Name")), (*dt)[i].Mid(10).Trim(false).RemoveLast());
- if ((k = (*dt)[++i].Find(wxT(_("Bootstrap:")))) != 0) return false;
- restorePanel->SetRowString(wxT(_("Bootstrap")), (*dt)[i].Mid(10).Trim(false).RemoveLast());
- if ((k = (*dt)[++i].Find(wxT(_("Where:")))) != 0) return false;
- restorePanel->SetRowString(wxT(_("Where")), (*dt)[i].Mid(10).Trim(false).RemoveLast());
+ if ((k = (*dt)[++i].Find(_("JobName:"))) != 0) return false;
+ restorePanel->SetRowString(_("Job Name"), (*dt)[i].Mid(10).Trim(false).RemoveLast());
+ if ((k = (*dt)[++i].Find(_("Bootstrap:"))) != 0) return false;
+ restorePanel->SetRowString(_("Bootstrap"), (*dt)[i].Mid(10).Trim(false).RemoveLast());
+ if ((k = (*dt)[++i].Find(_("Where:"))) != 0) return false;
+ restorePanel->SetRowString(_("Where"), (*dt)[i].Mid(10).Trim(false).RemoveLast());
- if ((k = (*dt)[++i].Find(wxT(_("Replace:")))) != 0) return false;
+ if ((k = (*dt)[++i].Find(_("Replace:"))) != 0) return false;
wxString str = (*dt)[i].Mid(10).Trim(false).RemoveLast();
- if (str == wxT(_("always"))) restorePanel->SetRowSelection(wxT(_("Replace")), 0);
- else if (str == wxT(_("ifnewer"))) restorePanel->SetRowSelection(wxT(_("Replace")), 1);
- else if (str == wxT(_("ifolder"))) restorePanel->SetRowSelection(wxT(_("Replace")), 2);
- else if (str == wxT(_("never"))) restorePanel->SetRowSelection(wxT(_("Replace")), 3);
- else restorePanel->SetRowSelection(wxT(_("Replace")), 0);
-
- if ((k = (*dt)[++i].Find(wxT(_("FileSet:")))) != 0) return false;
- restorePanel->SetRowString(wxT(_("Fileset")), (*dt)[i].Mid(10).Trim(false).RemoveLast());
- if ((k = (*dt)[++i].Find(wxT(_("Client:")))) != 0) return false;
- restorePanel->SetRowString(wxT(_("Client")), (*dt)[i].Mid(10).Trim(false).RemoveLast());
- if ((k = (*dt)[++i].Find(wxT(_("Storage:")))) != 0) return false;
- restorePanel->SetRowString(wxT(_("Storage")), (*dt)[i].Mid(10).Trim(false).RemoveLast());
- if ((k = (*dt)[++i].Find(wxT(_("When:")))) != 0) return false;
- restorePanel->SetRowString(wxT(_("When")), (*dt)[i].Mid(10).Trim(false).RemoveLast());
- if ((k = (*dt)[++i].Find(wxT(_("Priority:")))) != 0) return false;
- restorePanel->SetRowString(wxT(_("Priority")), (*dt)[i].Mid(10).Trim(false).RemoveLast());
+ if (str == _("always")) restorePanel->SetRowSelection(_("Replace"), 0);
+ else if (str == _("ifnewer")) restorePanel->SetRowSelection(_("Replace"), 1);
+ else if (str == _("ifolder")) restorePanel->SetRowSelection(_("Replace"), 2);
+ else if (str == _("never")) restorePanel->SetRowSelection(_("Replace"), 3);
+ else restorePanel->SetRowSelection(_("Replace"), 0);
+
+ if ((k = (*dt)[++i].Find(_("FileSet:"))) != 0) return false;
+ restorePanel->SetRowString(_("Fileset"), (*dt)[i].Mid(10).Trim(false).RemoveLast());
+ if ((k = (*dt)[++i].Find(_("Client:"))) != 0) return false;
+ restorePanel->SetRowString(_("Client"), (*dt)[i].Mid(10).Trim(false).RemoveLast());
+ if ((k = (*dt)[++i].Find(_("Storage:"))) != 0) return false;
+ restorePanel->SetRowString(_("Storage"), (*dt)[i].Mid(10).Trim(false).RemoveLast());
+ if ((k = (*dt)[++i].Find(_("When:"))) != 0) return false;
+ restorePanel->SetRowString(_("When"), (*dt)[i].Mid(10).Trim(false).RemoveLast());
+ if ((k = (*dt)[++i].Find(_("Priority:"))) != 0) return false;
+ restorePanel->SetRowString(_("Priority"), (*dt)[i].Mid(10).Trim(false).RemoveLast());
cfgUpdated = 0;
restorePanel->Layout();
configPanel->Layout();
centerSizer->Layout();
this->Layout();
- start->SetLabel(wxT(_("Enter restore mode")));
+ start->SetLabel(_("Enter restore mode"));
start->Enable(false);
configPanel->Enable(false);
tree->Enable(false);
this->Layout();
tree->DeleteAllItems();
list->DeleteAllItems();
- configPanel->ClearRowChoices(wxT(_("Client")));
- configPanel->ClearRowChoices(wxT(_("Before")));
+ configPanel->ClearRowChoices(_("Client"));
+ configPanel->ClearRowChoices(_("Before"));
wxbMainFrame::GetInstance()->EnablePanels();
newstatus = activable;
case activable:
cancelled = 0;
- start->SetLabel(wxT(_("Enter restore mode")));
+ start->SetLabel(_("Enter restore mode"));
start->Enable(true);
configPanel->Enable(false);
tree->Enable(false);
break;
case choosing:
start->Enable(true);
- start->SetLabel(wxT(_("Restore")));
+ start->SetLabel(_("Restore"));
centerSizer->Remove(configPanel);
configPanel->Show(false);
centerSizer->Add(treelistPanel, 1, wxEXPAND);
restorePanel->EnableApply(false);
break;
case restoring:
- start->SetLabel(wxT(_("Restoring...")));
+ start->SetLabel(_("Restoring..."));
gauge->Enable(true);
gauge->SetValue(0);
start->Enable(false);