From 0f1a363af19d12e8bc38ec02f5a99ecbae1eadc1 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Tue, 28 Jan 2003 15:39:51 +0000 Subject: cleaning the utf8 support stuff: - consolidate check_for_xserver() to check for x11 access - introduce prepare_gtk2() to do what gtk+2 needs, so that tools that're not part of drakxtools (aka: rpmdrake, mcc, ...) can just do : unshift @::textdomains, 'drakconf'; prepare_gtk2(); --- perl-install/ugtk2.pm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'perl-install/ugtk2.pm') diff --git a/perl-install/ugtk2.pm b/perl-install/ugtk2.pm index 7b25900b3..16a9db1a2 100644 --- a/perl-install/ugtk2.pm +++ b/perl-install/ugtk2.pm @@ -14,7 +14,8 @@ use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK @icon_paths $force_center $force_focus gtkhide gtkdestroy gtkflush gtkset_mousecursor gtkset_mousecursor_normal gtkset_markup gtkmodify_font gtkset_property gtkset_mousecursor_wait gtkappend_text gtkprepend_text gtkinsert_text gtkroot gtksetstyle gtkappend_page) ], helpers => [ qw(add2notebook add_icon_path n_line_size fill_tiled fill_tiled_coords string_size - get_text_coord gtkcolor gtkset_background gtkfontinfo gtkcreate_img gtkcreate_pixbuf set_back_pixbuf) ], + get_text_coord gtkcolor gtkset_background gtkfontinfo gtkcreate_img gtkcreate_pixbuf set_back_pixbuf + prepare_gtk2) ], create => [ qw(create_box_with_title create_adjustment create_scrolled_window create_hbox create_vbox create_dialog destroy_window create_factory_menu create_menu create_notebook create_packtable create_vpaned create_hpaned create_okcancel) ], @@ -31,10 +32,11 @@ use common; use Gtk2; unless ($::no_ugtk_init) { - !$ENV{DISPLAY} || system('/usr/X11R6/bin/xtest') and die "Cannot be run in console mode.\n"; + !check_for_xserver() and die "Cannot be run in console mode.\n"; Gtk2->init(\@ARGV); } + $border = 5; @@ -1260,4 +1262,9 @@ sub ask_browse_tree_info_given_widgets { } +sub prepare_gtk2 { + c::bind_textdomain_codeset($_, 'UTF8') foreach 'libDrakX', @::textdomains; + $::need_utf8_i18n = 1; +} + 1; -- cgit v1.2.1