summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog29
-rwxr-xr-xclock.pl70
-rwxr-xr-xcontrol-center18
-rwxr-xr-xmenus_launcher.pl57
-rwxr-xr-xprint_launcher.pl44
5 files changed, 106 insertions, 112 deletions
diff --git a/ChangeLog b/ChangeLog
index d3476b05..4968d87a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,32 @@
+2002-11-17 20:32 alus
+
+ * po/pl.po: logi -> dziennik
+
+2002-11-15 10:12 tvignaud
+
+ * Makefile: fix version detection for new spec file
+
+2002-11-15 09:57 tvignaud
+
+ * drakconf.spec: 9.1-0.1mdk
+
+2002-11-15 09:50 tvignaud
+
+ * control-center: fix locale initialization so that locales get
+ translated
+
+2002-11-14 17:50 tvignaud
+
+ * drakconf.spec: 9.0-8mdk
+
+2002-11-14 15:43 tvignaud
+
+ * drakxconf: perl_checker fixes
+
+2002-11-14 15:35 tvignaud
+
+ * ChangeLog: [no log message]
+
2002-11-14 15:30 tvignaud
* clock.pl, menus_launcher.pl, print_launcher.pl:
diff --git a/clock.pl b/clock.pl
index ebf207f4..2eb0aa22 100755
--- a/clock.pl
+++ b/clock.pl
@@ -3,15 +3,11 @@
use strict;
use lib qw(/usr/lib/libDrakX);
use POSIX;
-use my_gtk;
+use common;
+use my_gtk qw(:helpers :wrappers :various);;
use interactive;
use standalone;
use timezone;
-init Gtk;
-Gtk->set_locale;
-#use strict;
-use MDK::Common;
-
#-------------------------------------------------------------
# i18n
@@ -37,11 +33,13 @@ my $is24;
my $h_old;
my ($old_year, $old_month, $old_day);
my $its_reset = 0;
-my $window = $::isEmbedded ? new Gtk::Plug ($::XID) : new Gtk::Window -toplevel;
+
+my $my_win = my_gtk->new('print_launcher');
+$my_win->{rwindow}->set_title(N("DrakClock")) unless $::isEmbedded;
+
my $vbox = new Gtk::VBox(0,0);
-$window->set_title(N("DrakClock"));
-$window->add($vbox);
-$window->signal_connect (delete_event => \&quit_global);
+$my_win->{window}->add($vbox);
+$my_win->{window}->signal_connect (delete_event => sub { my_gtk->exit(0) });
my $hbox = new Gtk::HBox(0,0);
$vbox->pack_start($hbox, 1, 1, 0);
my $vbox1 = new Gtk::VBox(0,0);
@@ -54,7 +52,7 @@ $calendar->signal_connect ($_ => \&cal_changed)
my $button_time = new Gtk::Button N("Time Zone");
$vbox1->pack_start($button_time, 0, 1, 10);
$button_time->signal_connect (clicked => sub {
- local $::isEmbedded = 0;
+ local $::isEmbedded = 0; # to prevent sub window embedding
$in->{timezone} = {};
add2hash($in->{timezone}, timezone::read(''));
my $timezone = $in->{timezone}{timezone};
@@ -106,36 +104,19 @@ $spinner_s->signal_connect (button_release_event => \&spinned);
my $bbox = new Gtk::HButtonBox;
$bbox->set_layout(-end);
$vbox->pack_start($bbox, 0, 0, 5);
-my $button_ok = new Gtk::Button N("OK");
-$button_ok->signal_connect (clicked => sub {
+$bbox->add(gtksignal_connect(new Gtk::Button(N("OK")),
+ clicked => sub {
my ($year, $month, $day) = $calendar->get_date;
$month++;
my ($hour, $min, $sec) = ($adj_h->get_value, $adj_m->get_value, $adj_s->get_value);
- $a = "date " .
- ($month<10 ? "0" : "") . $month .
- ($day<10 ? "0" : "") . $day .
- ($hour<10 ? "0" : "") . $hour .
- ($min<10 ? "0" : "") . $min .
- $year . "." .
- ($sec<10 ? "0" : "") . $sec;
- system($a);
+ system("date " .
+ join('', map { print_it0($_) } ($month, $day, $hour, $min, $year)) . '.' . print_it0($sec));
-e '/sbin/hwclock' and system('/sbin/hwclock --systohc');
- quit_global();
- });
-$bbox->add($button_ok);
-my $button_cancel = new Gtk::Button N("Cancel");
-my $button_reset = new Gtk::Button N("Reset");
-$button_cancel->signal_connect (clicked => sub {
- quit_global();
- Gtk->timeout_remove($timer);
- $timer = Gtk->timeout_add(120, sub { time_to_rad(localtime(time)); Repaint($drawing_area) });
- time_to_rad(localtime(time)); Repaint($drawing_area);
- $calendar->select_month($old_month, $old_year);
- $calendar->select_day($old_day);
- $button_reset->set_sensitive(0);
- });
-$bbox->add($button_cancel);
-$button_reset->signal_connect (clicked => sub {
+ my_gtk->exit(0);
+ } ));
+$bbox->add(gtksignal_connect(new Gtk::Button(N("Cancel")), clicked => sub { my_gtk->exit(0) }));
+my $button_reset;
+$button_reset = gtksignal_connect(new Gtk::Button(N("Reset")), clicked => sub {
$its_reset = 1;
$timer = Gtk->timeout_add(120, sub { time_to_rad(localtime(time)); Repaint($drawing_area) });
time_to_rad(localtime(time)); Repaint($drawing_area);
@@ -144,9 +125,10 @@ $button_reset->signal_connect (clicked => sub {
$button_reset->set_sensitive(0);
$its_reset = 0;
});
+
$bbox->add($button_reset);
-$window->show_all;
+$my_win->{window}->show_all;
Gtk->main_iteration while Gtk->events_pending;
$calendar->realize;
@@ -157,7 +139,8 @@ $calendar->select_month($old_month, $old_year);
$calendar->select_day($old_day);
$button_reset->set_sensitive(0);
$timer = Gtk->timeout_add(120, sub { time_to_rad(localtime(time)); Repaint($drawing_area) });
-Gtk->main;
+
+$my_win->main;
my_gtk->exit(0);
sub cal_changed {
@@ -166,12 +149,10 @@ sub cal_changed {
}
sub changed {
- if ($h_old > $adj_h->get_value && $adj_h->get_value < ($is24 ? 18 : 6) && $h_old > ($is24 ? 18 : 6) && $h_old < ($is24 ? 24 : 12)) {
- $h_old = $adj_h->get_value;
+ if ($h_old > $adj_h->get_value && $adj_h->get_value < ($is24 ? 18 : 6) && $h_old > ($is24 ? 18 : 6) && $h_old < ($is24 ? 24 : 12)) {
$is24 = !$is24;
}
elsif ($h_old < $adj_h->get_value && $adj_h->get_value > ($is24 ? 18 : 6) && $h_old < ($is24 ? 18 : 6) && ($adj_h->get_value-$h_old != 12)) {
- $h_old = $adj_h->get_value;
$is24 = !$is24;
}
$h_old = $adj_h->get_value;
@@ -216,8 +197,6 @@ sub determine_radian {
($r, $i);
}
-sub quit_global { my_gtk->exit() }
-
sub expose_event {
my ($widget) = @_;
$widget->window->draw_pixmap (
@@ -336,3 +315,6 @@ sub DrawPointAt {
$cx + 95/100 * $radius * sin ($dRadians),
$cy - 95/100 * $radius * cos ($dRadians))
}
+
+
+sub print_it0 { sprintf("%02d", @_[0]) }
diff --git a/control-center b/control-center
index 51a60a56..49edb0c8 100755
--- a/control-center
+++ b/control-center
@@ -34,27 +34,24 @@ use standalone;
use common;
use interactive;
use detect_devices;
-use my_gtk qw(:helpers :wrappers :various);
use ugtk qw(:helpers :wrappers :various);
+use my_gtk qw(:helpers :wrappers :various);
use strict;
#---
-# i18n
-# IMPORTANT: next code is needed to get correct namespace
-# (drakconf instead of libDrakX)
-# (This version is now UTF8 compliant - Sg 2001-08-18)
+# i18n :
+# IMPORTANT to get correct namespace (drakconf instead of libDrakX)
#---
-
push @::textdomains, 'drakconf';
# set the locale, needed for proper fontset and charset selection
-Gtk->set_locale;
+#Gtk->set_locale;
use Config;
use POSIX qw(uname);
-my $in = 'interactive'->vnew('su', 'default');
+my $in = 'interactive'->vnew('su', 'default'); # just to get root capabilities
-my ($_version, $conffile, $class_install) = ("9.0", "/etc/mcc.conf","/etc/sysconfig/system");
+my ($_version, $conffile, $class_install) = ("9.1", "/etc/mcc.conf","/etc/sysconfig/system");
#we'll show log only once and don't restart it with new embedded process
my $show_log = 1;
@@ -428,7 +425,8 @@ my ($notebook_width, $notebook_height) = (540, 420);
$notebook_global->set_usize(40, $index * 50);
$emb_box->set_usize(40, $index * 50);
-if ($ENV{LANGUAGE} !~ /zh|sl|nl/) {
+unless (defined $log_check_box) {
+ print "BUG with LANGUAGE $ENV{LANGUAGE}\n";
$log_check_box->set_active($logs);
$embedded_check_box->set_active($embedded);
}
diff --git a/menus_launcher.pl b/menus_launcher.pl
index ce94c41f..e598f362 100755
--- a/menus_launcher.pl
+++ b/menus_launcher.pl
@@ -2,72 +2,61 @@
use strict;
use lib qw(/usr/lib/libDrakX);
-use ugtk;
-use my_gtk;
use common;
+use my_gtk qw(:helpers :wrappers :various);;
use interactive;
use standalone;
-init Gtk;
-Gtk->set_locale;
#-------------------------------------------------------------
# i18n
-# IMPORTANT: next code is needed to get correct namespace
-# (drakconf instead of libDrakX)
+# IMPORTANT: next code is needed to get correct namespace : drakconf instead of libDrakX
# (This version is now UTF8 compliant - Sg 2001-08-18)
#-------------------------------------------------------------
push @::textdomains, 'drakconf';
my $bindir = "/usr/bin/";
-my $window = $::isEmbedded ? new Gtk::Plug ($::XID) : new Gtk::Window -toplevel;
-$window->signal_connect (delete_event => sub {
- ugtk::gtkset_mousecursor_normal();
+my $my_win = my_gtk->new('print_launcher');
+$my_win->{rwindow}->set_title(N("Menu Configuration Center")) unless $::isEmbedded;
+$my_win->{window}->signal_connect(delete_event => sub {
+ gtkset_mousecursor_normal();
my_gtk->exit(0);
} );
-my $vbox = new Gtk::VBox(0,0);
-$window->set_title(N("Menu Configuration Center"));
-$window->add($vbox);
-$vbox->pack_start(new Gtk::Label(N("Menu Configuration Center") . N("\n\nChoose which menu you want to configure")),0,0,5);
-$vbox->pack_start(new Gtk::HSeparator,0,0,5);
-my $table = new Gtk::Table (3,2, 0);
+my $vbox = new Gtk::VBox(0, 0);
+$my_win->{window}->add($vbox);
+$vbox->pack_start(new Gtk::Label(N("Menu Configuration Center") . N("\n\nChoose which menu you want to configure")), 0, 0, 5);
+$vbox->pack_start(new Gtk::HSeparator, 0, 0, 5);
+my $table = new Gtk::Table (3, 2, 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);
+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(N("System menu")), 0, 1, 0, 1, 'fill', 'fill', 0, 0);
-my $b1 = new Gtk::Button(N("Configure..."));
-$b1->signal_connect(clicked => sub { system("$bindir/menudrake --systemmenu &") } );
+my $b1 = gtksignal_connect(new Gtk::Button(N("Configure...")), clicked => sub { system("$bindir/menudrake --systemmenu &") } );
$table->attach ($b1, 1, 2, 0, 1, 'fill', 'fill', 0, 0);
$table->attach (new Gtk::Label(N("User menu")), 0, 1, 1, 2, 'fill', 'fill', 0, 0);
my (@user_info, @usernames);
setpwent();
do { @user_info = getpwent();
- my ($uname, $uid) = @user_info[0,2];
+ my ($uname, $uid) = @user_info[0, 2];
push (@usernames, $uname) if $uid > 500 && $uname eq $ENV{INITIAL_USER};
} while (@user_info);
my $combo = new Gtk::Combo;
$combo->set_popdown_strings (@usernames, "root");
$table->attach ($combo, 2, 3, 1, 2, 'fill', 'fill', 0, 0);
-my $b2 = new Gtk::Button(N("Configure..."));
-$b2->signal_connect(clicked => sub { my $a = $combo->entry->get_text();
- $a eq "root" ?
- system("$bindir/menudrake --usermenu &") :
- system(" su $a -c \"$bindir/menudrake &\"");
- } );
+my $b2 = gtksignal_connect(new Gtk::Button(N("Configure...")),
+ clicked => sub { system($combo->entry->get_text() eq "root" ? "$bindir/menudrake --usermenu &" : " su $a -c \"$bindir/menudrake &\"") } );
$table->attach ($b2, 1, 2, 1, 2, 'fill', 'fill', 0, 0);
-$vbox->pack_start(new Gtk::HSeparator,0,0,5);
+$vbox->pack_start(new Gtk::HSeparator, 0, 0, 5);
my $bbox = new Gtk::HButtonBox;
-$vbox->pack_start($bbox,0,0,5);
+$vbox->pack_start($bbox, 0, 0, 5);
$bbox->set_layout(-end);
-my $button_ok = new Gtk::Button N("Done");
-$button_ok->signal_connect (clicked => sub { my_gtk->exit(0) });
+my $button_ok = gtksignal_connect(new Gtk::Button(N("Done")), clicked => sub { my_gtk->exit(0) });
$button_ok->can_default(1);
$bbox->add($button_ok);
-$window->show_all;
-
-Gtk->main;
+$my_win->{window}->show_all;
+$my_win->main;
my_gtk->exit(0);
diff --git a/print_launcher.pl b/print_launcher.pl
index 0ef2762c..28a1e9e0 100755
--- a/print_launcher.pl
+++ b/print_launcher.pl
@@ -12,45 +12,41 @@ Gtk->set_locale;
#-------------------------------------------------------------
# i18n
-# IMPORTANT: next code is needed to get correct namespace
-# (drakconf instead of libDrakX)
+# IMPORTANT: next code is needed to get correct namespace : drakconf instead of libDrakX
# (This version is now UTF8 compliant - Sg 2001-08-18)
#-------------------------------------------------------------
push @::textdomains, 'drakconf';
my $sbindir = "/usr/sbin/";
-my $window = $::isEmbedded ? new Gtk::Plug ($::XID) : new Gtk::Window -toplevel;
-$window->signal_connect (delete_event => delete_event => sub {
- ugtk::gtkset_mousecursor_normal();
+my $my_win = my_gtk->new('print_launcher');
+$my_win->{rwindow}->set_title(N("Printing configuration")) unless $::isEmbedded;
+$my_win->{rwindow}->signal_connect (delete_event => sub {
+ gtkset_mousecursor_normal();
my_gtk->exit(0);
-} );
-my $vbox = new Gtk::VBox(0,0);
-$window->set_title(N("Printing configuration"));
-$window->add($vbox);
-$vbox->pack_start(new Gtk::Label(N("Printing configuration")),0,0,5);
-$vbox->pack_start(new Gtk::HSeparator,0,0,5);
-my $table = new Gtk::Table (2,1, 0);
+ } );
+my $vbox = new Gtk::VBox(0, 0);
+$my_win->{window}->add($vbox);
+$vbox->pack_start(new Gtk::Label(N("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);
+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(N("Click here to configure the printing system")), 0, 1, 0, 1, 'fill', 'fill', 0, 0);
-my $b1 = new Gtk::Button(N("Configure..."));
-$b1->signal_connect(clicked => sub { system("$sbindir/printerdrake &") } );
+my $b1 = gtksignal_connect(new Gtk::Button(N("Configure...")), 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);
+$vbox->pack_start(new Gtk::HSeparator, 0, 0, 5);
my $bbox = new Gtk::HButtonBox;
-$vbox->pack_start($bbox,0,0,5);
+$vbox->pack_start($bbox, 0, 0, 5);
$bbox->set_layout(-end);
-my $button_ok = new Gtk::Button N("Done");
-$button_ok->signal_connect (clicked => sub { my_gtk->exit(0) });
+my $button_ok = gtksignal_connect(new Gtk::Button(N("Done")), clicked => sub { my_gtk->exit(0) });
$button_ok->can_default(1);
$bbox->add($button_ok);
-$window->show_all;
-
-Gtk->main;
+$my_win->{window}->show_all;
+$my_win->main;
my_gtk->exit(0);