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: $!");
$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);
{
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;
}
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);