diff options
author | damien <damien@mandriva.com> | 2001-09-20 22:40:10 +0000 |
---|---|---|
committer | damien <damien@mandriva.com> | 2001-09-20 22:40:10 +0000 |
commit | ae888856513a42229b121584f38c122ad611613b (patch) | |
tree | a259edc4f8bfb3c62888ef0734775506ee64c743 | |
parent | b1bae597952d52a6648d9b3efc75dbe0627953d6 (diff) | |
download | control-center-ae888856513a42229b121584f38c122ad611613b.tar control-center-ae888856513a42229b121584f38c122ad611613b.tar.gz control-center-ae888856513a42229b121584f38c122ad611613b.tar.bz2 control-center-ae888856513a42229b121584f38c122ad611613b.tar.xz control-center-ae888856513a42229b121584f38c122ad611613b.zip |
added print and modified makefile to launch printerdrak not embedded
-rw-r--r-- | Makefile | 1 | ||||
-rwxr-xr-x | print.pm | 62 |
2 files changed, 63 insertions, 0 deletions
@@ -24,6 +24,7 @@ install: all install -s -m755 $(NAME) $(RPM_BUILD_ROOT)/usr/X11R6/bin/ install -m755 clock.pm $(RPM_BUILD_ROOT)/usr/sbin/ install -m755 menus.pm $(RPM_BUILD_ROOT)/usr/sbin/ + install -m755 print.pm $(RPM_BUILD_ROOT)/usr/sbin/ install -m755 logdrake $(RPM_BUILD_ROOT)/usr/sbin/ # install -m644 pixmaps/*.xpm $(RPM_BUILD_ROOT)/usr/share/icons/ install -m644 pixmaps/*.png $(RPM_BUILD_ROOT)/usr/share/icons/ diff --git a/print.pm b/print.pm new file mode 100755 index 00000000..654f101e --- /dev/null +++ b/print.pm @@ -0,0 +1,62 @@ +#!/usr/bin/perl -w + +use POSIX; +use Gtk; +use lib qw(/usr/lib/libDrakX); +use interactive; +use standalone; +init Gtk; +Gtk->set_locale; +use strict; + +#------------------------------------------------------------- +# i18n routines +# IMPORTANT: next two routines have to be redefined here to +# get correct namespace (drakconf instead of libDrakX) +# (This version is now UTF8 compliant - Sg 2001-08-18) +#------------------------------------------------------------- + +sub _ { + my $s = shift @_; my $t = translate($s); + sprintf $t, @_; +} + +sub translate { + my ($s) = @_; + $s ? c::dgettext('drakconf', $s) : ''; +} + +my $_sbindir = "/usr/sbin/"; +$::isEmbedded = ($::XID, $::CCPID) = "@ARGV" =~ /--embedded (\w+) (\w+)/; +my $window = $::isEmbedded ? new Gtk::Plug ($::XID) : new Gtk::Window -toplevel; +$window->signal_connect ( delete_event => \&quit_global ); +my $vbox = new Gtk::VBox(0,0); +$window->set_title(_("Printing configuration")); +$window->add($vbox); +$vbox->pack_start(new Gtk::Label(_("Printing configuration")),0,0,5); +$vbox->pack_start(new Gtk::HSeparator,0,0,5); +my $table = new Gtk::Table (2,1, 0); +$table->set_border_width(5); +$table->set_row_spacings(5); +$table->set_col_spacings(5); +my $hbox = new Gtk::HBox(0,0); +$vbox->pack_start($hbox,1,1,1); +$hbox->pack_start($table,0,0,5); +$table->attach (new Gtk::Label(_("Click here to configure the printing system")), 0, 1, 0, 1, 'fill', 'fill', 0, 0); +my $b1 = new Gtk::Button(_("Configure...")); +$b1->signal_connect( clicked => sub { system("$_sbindir/printerdrake &"); } ); +$table->attach ($b1, 1, 2, 0, 1, 'fill', 'fill', 0, 0); +$vbox->pack_start(new Gtk::HSeparator,0,0,5); +my $bbox = new Gtk::HButtonBox; +$vbox->pack_start($bbox,0,0,5); +$bbox->set_layout(-end); +my $button_ok = new Gtk::Button _("Done"); +$button_ok->signal_connect ( clicked => sub { $::isEmbedded ? kill('USR1', $::CCPID) : Gtk->exit(0); }); +$button_ok->can_default(1); +$bbox->add($button_ok); + +$window->show_all; + +Gtk->main_iteration while Gtk->events_pending; +$::isEmbedded and kill 'USR2', $::CCPID; +Gtk->main; |