From 5166be73c82e447955742d88efd7bec038f3cad6 Mon Sep 17 00:00:00 2001 From: damien Date: Sun, 8 Apr 2001 23:29:12 +0000 Subject: added timezone --- clock.pm | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'clock.pm') diff --git a/clock.pm b/clock.pm index b73ee508..77c623b4 100755 --- a/clock.pm +++ b/clock.pm @@ -2,10 +2,17 @@ use POSIX; use Gtk; +use lib qw(/usr/lib/libDrakX); +use interactive; +use standalone; +use common qw(:common :file :functional :system); +use timezone; +use Data::Dumper; init Gtk; #use strict; $::isEmbedded = ($::XID, $::CCPID) = "@ARGV" =~ /--embedded (\w+) (\w+)/; +my $in = vnew interactive('su'); my $pi=3.1416; my $pixmap; my $radius; @@ -14,7 +21,7 @@ my $dRadians_min; my $dRadians_sec; my $Radian; my $timer; -my $midx, $midy; +my ($midx, $midy); my $first=1; my $is24; my $h_old; @@ -26,11 +33,23 @@ $window->add($vbox); $window->signal_connect ( delete_event => \&quit_global ); my $hbox = new Gtk::HBox(0,0); $vbox->pack_start($hbox, 1, 1, 0); +my $vbox1 = new Gtk::VBox(0,0); +$hbox->pack_start($vbox1, 1, 1, 0); my $calendar = new Gtk::Calendar; -$hbox->pack_start($calendar, 1, 1, 0); +$vbox1->pack_start($calendar, 1, 1, 0); $calendar->signal_connect ( $_ => \&cal_changed ) foreach ('month-changed', 'day-selected', 'day-selected-double-click', 'prev-month', 'next-month', 'prev-year', 'next-year'); +my $button_time = new Gtk::Button "Time Zone"; +$vbox1->pack_start($button_time, 0, 1, 10); +$button_time->signal_connect ( clicked => sub { + $in->{timezone}={}; + add2hash($in->{timezone}, { timezone::read('') }); + print "###\n" . Data::Dumper->Dump([$in],['$in']) . "\n###\n"; + $in->{timezone}{timezone} = $in->ask_from_treelist('', _("Which is your timezone?"), '/', [ timezone::getTimeZones('') ], $in->{timezone}{timezone}); + $in->{timezone}{UTC} = $in->ask_yesorno('', _("Is your hardware clock set to GMT?"), $in->{timezone}{UTC}); + timezone::write('', $in->{timezone}); + }); my $vbox2 = new Gtk::VBox(0,0); $hbox->pack_start($vbox2, 1, 1, 0); my $drawing_area = new Gtk::DrawingArea; -- cgit v1.2.1