diff options
author | damien <damien@mandriva.com> | 2001-03-03 06:20:43 +0000 |
---|---|---|
committer | damien <damien@mandriva.com> | 2001-03-03 06:20:43 +0000 |
commit | 355dfd6be1a2c9773a9e6ed72903cda12a2c7c7b (patch) | |
tree | 5752d30fbe029ff1eaa38cf4f054856c13822760 | |
parent | b8514b44c04ec66879a5e142333a2fa28401c97a (diff) | |
download | control-center-355dfd6be1a2c9773a9e6ed72903cda12a2c7c7b.tar control-center-355dfd6be1a2c9773a9e6ed72903cda12a2c7c7b.tar.gz control-center-355dfd6be1a2c9773a9e6ed72903cda12a2c7c7b.tar.bz2 control-center-355dfd6be1a2c9773a9e6ed72903cda12a2c7c7b.tar.xz control-center-355dfd6be1a2c9773a9e6ed72903cda12a2c7c7b.zip |
updated
-rwxr-xr-x | clock.pm | 13 | ||||
-rwxr-xr-x | control-center3 | 12 |
2 files changed, 16 insertions, 9 deletions
@@ -57,7 +57,7 @@ $hbox2->pack_start($spinner_s, 0, 0, 0); my $bbox = new Gtk::HButtonBox; $bbox->set_layout(-end); -$vbox->pack_start($bbox, 1, 1, 5); +$vbox->pack_start($bbox, 0, 0, 5); my $button_ok = new Gtk::Button "OK"; $button_ok->signal_connect ( clicked => sub { system("date -s " . $adj_h->set_value($hour) . ":" . $adj_m->set_value($min) . ":" . $adj_s->set_value($sec)); @@ -67,10 +67,11 @@ $bbox->add($button_ok ); my $button_cancel = new Gtk::Button "Cancel"; my $button_reset = new Gtk::Button "Reset"; $button_cancel->signal_connect ( clicked => sub { + quit_global(); + Gtk->timeout_remove($timer); $timer=Gtk->timeout_add(120, sub { time_to_rad(); Repaint($drawing_area) }); time_to_rad(); Repaint($drawing_area); $button_reset->set_sensitive(0); - quit_global(); }); $bbox->add($button_cancel ); $button_reset->signal_connect ( clicked => sub { @@ -84,6 +85,8 @@ $button_reset->set_sensitive(0); $window->show_all; $timer=Gtk->timeout_add(120, sub { time_to_rad(); Repaint($drawing_area) }); +Gtk->main_iteration while Gtk->events_pending; +$::isEmbedded and kill USR2, $::CCPID; Gtk->main; @@ -147,7 +150,7 @@ sub rad_to_time { sub time_to_rad { my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);# now_tm = localtime (&now); - $dRadians_hour = $hour % 12 * $pi / 6.0; + $dRadians_hour = $hour % 12 * $pi / 6.0 + ($pi * $min / 360.0); $dRadians_min = $min * $pi / 30.0; $dRadians_sec = $sec * $pi / 30.0; $adj_h->set_value($hour); @@ -160,7 +163,7 @@ sub Repaint { my ($drawing_area) = @_; - $dRadians_hour = POSIX::floor($dRadians_hour / $pi * 6 + 0.5) * $pi / 6.0; + my $dRadians_hour_real = POSIX::floor($dRadians_hour / $pi*6 + 0.5) * $pi/6.0 + $dRadians_min / 12; $dRadians_min = POSIX::floor($dRadians_min / $pi * 30 + 0.5) * $pi / 30.0; $dRadians_sec = POSIX::floor($dRadians_sec / $pi * 30 + 0.5) * $pi / 30.0; $pixmap->draw_rectangle($drawing_area->style->white_gc, 1, 0, 0, @@ -178,7 +181,7 @@ sub Repaint my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);# now_tm = localtime (&now); my $dRadians; foreach ([$gray_gc, 5], [$black_gc, 0]) { - DrawHour ($pixmap, $_->[0], $midx, $midy, $dRadians_hour, $_->[1]); + DrawHour ($pixmap, $_->[0], $midx, $midy, $dRadians_hour_real, $_->[1]); DrawMin ($pixmap, $_->[0], $midx, $midy, $dRadians_min, $_->[1]); DrawSec ($pixmap, $_->[0], $midx, $midy, $dRadians_sec, $_->[1]); } diff --git a/control-center3 b/control-center3 index 73758fa4..2668f6b0 100755 --- a/control-center3 +++ b/control-center3 @@ -136,7 +136,7 @@ $vbox_global_left->pack_start($tree,1,1,0); map { create_tree_item($tree, $_->[0] , "$xpm_path_l/$_->[1]",1); } ([_("Boot"), 'drakboot-mdk.png'] , [_("Hardware"), 'logo.png'] , [_("User and Groups"),'adduserdrake-mdk.png'], - [_("Network & Internet"),'draknet-mdk.png'] , [_("Menu Customization"),'menudrake-mdk.png'] , [_("Font Management"),'drakfont-mdk.png']); + [_("Network & Internet"),'draknet-mdk.png'] , [_("System"),'menudrake-mdk.png'] , [_("Font Management"),'drakfont-mdk.png']); map { create_tree_item($treeitem_sub[int($_->[2])],$_->[0], "$xpm_path_l/$_->[1]",0); @@ -145,7 +145,7 @@ map { [_("Printer"),'printer-mdk.png',4] , [_("Keyboard"), 'keyboard-mdk.png',4], [_("Users Config"),'item.png',3] , [_("Internet & Network") , 'draknet-mdk.png',2] , [_("Gateway Config"),'drakgw-mdk.png',2], - [_("User Menus") , 'item.png',1] , [_("System Menus") , 'item.png',1] , + [_("Date & Time") , 'item.png',1], [_("System Menus") , 'item.png',1], [_("User Menus") , 'item.png',1] , [_("Fonts"), 'drakfont-mdk.png',0] ); @@ -154,7 +154,8 @@ my %tree_exec = (_("Boot Config") => "$_sbindir/drakboot", _("Boot Disk") => "$_ _("Hardware") => "$_bindir/harddrake-auth" , _("Mouse") => "$_sbindir/mousedrake" , _("Printer") => "$_sbindir/printerdrake" , _("Keyboard") => "$_sbindir/keyboarddrake" , _("Users Config") => "$_bindir/userdrake" , _("Internet & Network") => "$_sbindir/draknet" , - _("Gateway Config") => "$_sbindir/drakgw" , _("User Menus") => "$_bindir/menudrake" , + _("Gateway Config") => "$_sbindir/drakgw" , _("Date & Time") => "/home/damien/cvs/soft/control-center/clock.pm", + _("User Menus") => "$_bindir/menudrake" , _("System Menus") => "$_bindir/menudrake", _("Fonts") => "$_xbindir/drakfont" ); @@ -163,7 +164,10 @@ my %tree_launched; $window_global->show_all; -$SIG{USR1} = sub { $notebook_global->set_page(0); }; # embedded applications will send me that signal in order to "hide" them +$SIG{USR1} = sub { + ${$tree_launched{$_}->[1]}->deselect() foreach (keys %tree_launched); + $notebook_global->set_page(0); +}; # embedded applications will send me that signal in order to "hide" them $SIG{TERM} = sub { quit_global(); }; # embedded applications will send me that signal in order to quit the cc. my $global_vbox; my $global_time_tag; |