]> git.zerfleddert.de Git - snom-frontend/commitdiff
make "exterm" dialog box configurable
authorMichael Gernoth <michael@gernoth.net>
Sat, 10 Jul 2010 17:01:53 +0000 (19:01 +0200)
committerMichael Gernoth <michael@gernoth.net>
Sat, 10 Jul 2010 17:01:53 +0000 (19:01 +0200)
snom.pl
snomrc

diff --git a/snom.pl b/snom.pl
index 93b1eee690a6e581d842b2c0974d4366cb161513..608e62fbab5a907cd2458fd9992980242b1358e2 100755 (executable)
--- 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 %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: $!");
 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();
 
 $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 $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();
 {
        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;
 }
 
        return TRUE;
 }
 
@@ -428,6 +427,12 @@ sub KBDInput
 
 sub UpdatePhoneInfo
 {
 
 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);
        
        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 7508377d6c28a23adc8b5b9ecc8e76fa294e3cbb..3db18bebbc1f14230f220f8ee4854801bf8f8367 100644 (file)
--- a/snomrc
+++ b/snomrc
@@ -5,8 +5,10 @@ host=192.168.0.6
 
 [Michael]
 host=192.168.100.34
 
 [Michael]
 host=192.168.100.34
+extern=0
 
 [Uni]
 host=cipphone.informatik.uni-erlangen.de
 login=admin
 password=geheim
 
 [Uni]
 host=cipphone.informatik.uni-erlangen.de
 login=admin
 password=geheim
+extern=09
Impressum, Datenschutz