+07-05-2004 :
+ - console_thread : Added support for the new parse_config which
+ returns a status code.
+ - wxbMainFrame/console_thread : A command line parameter now
+ allows the user to choose his config file.
+
06-05-2004 :
- wxbMainFrame : Corrected font bug in GTK+ 1.2
- console_thread : Added support for Mac OS X configuration
FEATURES
--------
-wxbRestorePanel : When cancelling, check for commands results
-
general : Show nice messages boxes when errors occurs.
+console_thread : Check for config file parsing error messages
+ in console file.
+
+console_thread : Allow the user to choose his config file.
+
+console_thread : Allow the user to choose his director when there's multiple
+ directors.
+
Mac OS X : Integrate Mac OS X into the automake process
(note : add -DNO_GCC_PRAGMA to CPPFLAGS, build app,
define HAVE_MACOSX)
[postponed to July:]
+wxbRestorePanel : When cancelling, check for commands results
+
general : Do not quit when configuration file not found.
wxbRestorePanel : Add a way to cancel restore when building tree
wxbRestorePanel : Use ".default job=RestoreFiles" to get defaults parameters
when changing a restore parameter fails.
-console_thread : Allow the user to choose his config file.
-
-console_thread : Allow the user to choose his director when there's multiple
- directors.
-
wxbDataParser : Add a boolean in the constructor to avoid storing data is
will not be used.
char TERM_msg[] = "2999 Terminate\n";
#endif
-#ifdef HAVE_MACOSX
-#define CONFIGFILE "/Library/Preferences/org.bacula.wxconsole/wx-console.conf"
-#else
-#define CONFIGFILE "./wx-console.conf"
-#endif
-
/* Imported functions */
int authenticate_director(JCR *jcr, DIRRES *director, CONRES *cons);
// class constructor
-console_thread::console_thread() {
+console_thread::console_thread(wxString configfile) {
UA_sock = NULL;
+ this->configfile = configfile;
}
// class destructor
init_stack_dump();
my_name_is(0, NULL, "wx-console");
//textdomain("bacula-console");
- init_msg(NULL, NULL);
+
+ MSGS* msgs = (MSGS *)malloc(sizeof(MSGS));
+ memset(msgs, 0, sizeof(MSGS));
+ for (int i=1; i<=M_MAX; i++) {
+#ifndef WIN32
+ add_msg_dest(msgs, MD_STDOUT, i, NULL, NULL);
+#endif
+ add_msg_dest(msgs, MD_SYSLOG, i, NULL, NULL);
+ add_msg_dest(msgs, MD_CONSOLE, i, NULL, NULL);
+ }
+
+ init_msg(NULL, msgs);
+ init_console_msg(".");
/* TODO (#4#): Allow the user to choose his config file. */
- parse_config(CONFIGFILE);
-
+ if (!parse_config(configfile.c_str(), 0)) {
+ csprint("Unable to read configuration file.\n");
+ csprint(NULL, CS_END);
+ csprint(NULL, CS_DISCONNECTED);
+ csprint(NULL, CS_TERMINATED);
+ #ifdef HAVE_WIN32
+ Exit();
+ #endif
+ return NULL;
+ }
+
+ init_msg(NULL, NULL);
+
LockRes();
DIRRES *dir = (DIRRES *)GetNextRes(R_DIRECTOR, NULL);
UnlockRes();
{
public:
// class constructor
- console_thread();
+ console_thread(wxString configfile);
// class destructor
~console_thread();
private:
BSOCK* UA_sock;
JCR jcr;
+ wxString configfile;
};
int pm_cst_strcpy(POOLMEM **pm, const char *str);
else {
promptparser = new wxbPromptParser();
}
- ct = new console_thread();
+
+ wxString configfile;
+
+
+ if ((wxTheApp->argc == 3) && (wxString(wxTheApp->argv[1]) == "-c")) {
+ configfile = wxTheApp->argv[2];
+ }
+ else {
+#ifdef HAVE_MACOSX
+ configfile = "/Library/Preferences/org.bacula.wxconsole.conf";
+#else
+ configfile = "./wx-console.conf";
+#endif
+ if (wxTheApp->argc > 1) {
+ Print("Error while parsing command line arguments, using defaults.\n", CS_DEBUG);
+ Print("Usage: wx-console [-c configfile]\n", CS_DEBUG);
+ }
+ }
+
+ ct = new console_thread(configfile);
ct->Create();
ct->Run();
SetStatusText("Connecting to the director...");