From: Michael Gernoth Date: Sat, 10 Jul 2010 17:01:53 +0000 (+0200) Subject: make "exterm" dialog box configurable X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/snom-frontend/commitdiff_plain/2b127e29cae4de25b8fb79f05e0ef3d29df2538c?hp=b4c10db9bc70e920a92cff57002c06cfa4d2daa2 make "exterm" dialog box configurable --- diff --git a/snom.pl b/snom.pl index 93b1eee..608e62f 100755 --- a/snom.pl +++ b/snom.pl @@ -18,6 +18,7 @@ my %g_key = (); my %g_arrows; my $g_host = Gtk2::ComboBox->new_text(); my $g_identity = Gtk2::ComboBox->new_text(); +my $cbextern = Gtk2::CheckButton->new("extern"); my $ua = LWP::UserAgent->new; open(INIFILE,"<$ENV{HOME}/.snomrc") || die("can't open config: $ENV{HOME}/.snomrc: $!"); @@ -150,9 +151,6 @@ $display->signal_connect(enter_notify_event => \&DisplayMouseOver, TRUE); $display->signal_connect(leave_notify_event => \&DisplayMouseOver, FALSE); $display->show(); -my $cbextern = Gtk2::CheckButton->new("extern"); -$cbextern->show(); - my $dialbox = Gtk2::HBox->new(0, 30); $dialbox->pack_start($display, 0, 0, 0); $dialbox->pack_start($cbextern, 0, 0, 0); @@ -310,11 +308,12 @@ sub DialNumber { my ($entry) = @_; my ($num) = $entry->get_text(); - if ($cbextern->get_active){ - snom_number("09".$num) - } else { - snom_number($num); + + if ($cbextern->get_active && defined(${$Config{$sections[$g_host->get_active]}}{extern})) { + $num = ${$Config{$sections[$g_host->get_active]}}{extern} . $num; } + + snom_number($num); return TRUE; } @@ -428,6 +427,12 @@ sub KBDInput sub UpdatePhoneInfo { + if (defined(${$Config{$sections[$g_host->get_active]}}{extern})) { + $cbextern->show(); + } else { + $cbextern->hide(); + } + my $req = HTTP::Request->new(GET => "http://".${$Config{$sections[$g_host->get_active]}}{host}."/"); my $response = $ua->request($req); diff --git a/snomrc b/snomrc index 7508377..3db18be 100644 --- a/snomrc +++ b/snomrc @@ -5,8 +5,10 @@ host=192.168.0.6 [Michael] host=192.168.100.34 +extern=0 [Uni] host=cipphone.informatik.uni-erlangen.de login=admin password=geheim +extern=09