GtkWidget *dir_select;
GtkWidget *about1; /* about box */
GtkWidget *label_dialog;
-GdkFont *text_font = NULL;
PangoFontDescription *font_desc;
+PangoFontDescription *console_font_desc = NULL;
pthread_mutex_t cmd_mutex = PTHREAD_MUTEX_INITIALIZER;
pthread_cond_t cmd_wait;
char cmd[1000];
{
fprintf(stderr, _(
"Copyright (C) 2002-2005 Kern Sibbald\n"
-"\nVersion: " VERSION " (" BDATE ") %s %s %s\n\n"
+"\nVersion: %s (%s) %s %s %s\n\n"
"Usage: gnome-console [-s] [-c config_file] [-d debug_level] [config_file]\n"
" -c <file> set configuration file to file\n"
" -dnn set debug level to nn\n"
" -s no signals\n"
" -t test - read configuration and exit\n"
" -? print this message.\n"
-"\n"), HOST_OS, DISTNAME, DISTVER);
+"\n"), VERSION, BDATE, HOST_OS, DISTNAME, DISTVER);
exit(1);
}
const char *gargv[2] = {"gnome-console", NULL};
CONFONTRES *con_font;
+ setlocale(LC_ALL, "");
+ bindtextdomain("bacula", LOCALEDIR);
+ textdomain("bacula");
+
init_stack_dump();
my_name_is(argc, argv, "gnome-console");
init_msg(NULL, NULL);
parse_config(configfile);
- if (init_tls() != 0) {
- Emsg0(M_ERROR_TERM, 0, _("TLS library initialization failed.\n"));
+ if (init_crypto() != 0) {
+ Emsg0(M_ERROR_TERM, 0, _("Cryptography library initialization failed.\n"));
}
if (!check_resources()) {
gtk_widget_show(console);
/*
- * Thanks to Phil Stracchino for providing the font configuration code.
- * original default:
- text_font = gdk_font_load("-misc-fixed-medium-r-normal-*-*-130-*-*-c-*-koi8-r");
- * this works for me:
- text_font = gdk_font_load("-Bigelow & Holmes-lucida console-medium-r-semi condensed-*-12-0-100-100-m-0-iso8859-1");
- * and, new automagic:font specification!
+ * Gtk2/pango have different font names. Gnome2 comes with "Monospace 10"
*/
LockRes();
Dmsg1(400, "No fontface for %s\n", con_font->hdr.name);
continue;
}
- text_font = gdk_font_load(con_font->fontface);
- if (text_font == NULL) {
+ Dmsg1(100, "Now loading: %s\n",con_font->fontface);
+ console_font_desc = pango_font_description_from_string(con_font->fontface);
+ if (console_font_desc == NULL) {
Dmsg2(400, "Load of requested ConsoleFont \"%s\" (%s) failed!\n",
con_font->hdr.name, con_font->fontface);
} else {
}
UnlockRes();
- if (text_font == NULL) {
- Dmsg1(400, "Attempting to load fallback font %s\n",
- "-misc-fixed-medium-r-normal-*-*-130-*-*-c-*-iso8859-1");
- text_font = gdk_font_load("-misc-fixed-medium-r-normal-*-*-130-*-*-c-*-iso8859-1");
- }
font_desc = pango_font_description_from_string("LucidaTypewriter 9");
gtk_widget_modify_font(console, font_desc);
- gtk_widget_modify_font(text1, font_desc);
gtk_widget_modify_font(entry1, font_desc);
gtk_widget_modify_font(status1, font_desc);
+ if (console_font_desc) {
+ gtk_widget_modify_font(text1, console_font_desc);
+ pango_font_description_free(console_font_desc);
+ } else {
+ gtk_widget_modify_font(text1, font_desc);
+ }
pango_font_description_free(font_desc);
if (test_config) {
}
-static GList *get_and_fill_combo(GtkWidget *dialog, const char *combo_name, const char *cm)
+static GList *get_and_fill_combo(GtkWidget *dialog, const char *combo_name, const char *dircmd)
{
GtkWidget *combo;
GList *options;
combo = lookup_widget(dialog, combo_name);
- options = get_list(cmd);
+ options = get_list((char *)dircmd);
if (combo && options) {
gtk_combo_set_popdown_strings(GTK_COMBO(combo), options);
}
/* Initialize Console TLS context */
if (cons && (cons->tls_enable || cons->tls_require)) {
/* Generate passphrase prompt */
- bsnprintf(buf, sizeof(buf), "Passphrase for Console \"%s\" TLS private key: ", cons->hdr.name);
+ bsnprintf(buf, sizeof(buf), _("Passphrase for Console \"%s\" TLS private key: "), cons->hdr.name);
/* Initialize TLS context:
* Args: CA certfile, CA certdir, Certfile, Keyfile,
/* Initialize Director TLS context */
if (dir->tls_enable || dir->tls_require) {
/* Generate passphrase prompt */
- bsnprintf(buf, sizeof(buf), "Passphrase for Director \"%s\" TLS private key: ", dir->hdr.name);
+ bsnprintf(buf, sizeof(buf), _("Passphrase for Director \"%s\" TLS private key: "), dir->hdr.name);
/* Initialize TLS context:
* Args: CA certfile, CA certdir, Certfile, Keyfile,
}
- UA_sock = bnet_connect(NULL, 5, 15, "Director daemon", dir->address,
+ UA_sock = bnet_connect(NULL, 5, 15, _("Director daemon"), dir->address,
NULL, dir->DIRport, 0);
if (UA_sock == NULL) {
return 0;
return 0;
}
- set_status(" Initializing ...");
+ set_status(_(" Initializing ..."));
bnet_fsend(UA_sock, "autodisplay on");
fill_combo(restore_dialog, "combo_restore_pool", pool_list);
fill_combo(restore_dialog, "combo_restore_storage", storage_list);
- set_status(" Connected");
+ set_status(_(" Connected"));
return 1;
}
if (already_here) /* avoid recursive temination problems */
exit(1);
already_here = true;
- cleanup_tls();
+ cleanup_crypto();
disconnect_from_director((gpointer)NULL);
gtk_main_quit();
exit(0);
void set_status_ready()
{
- gtk_label_set_text(GTK_LABEL(status1), " Ready");
+ gtk_label_set_text(GTK_LABEL(status1), _(" Ready"));
ready = true;
// set_scroll_bar_to_end();
}