/[libconf]/libconf/applications/network/lan_conf
ViewVC logotype

Diff of /libconf/applications/network/lan_conf

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by dams, Sun Nov 2 17:55:50 2003 UTC revision 1.3 by dams, Fri Nov 14 00:42:06 2003 UTC
# Line 75  $global_notebook->append_page(gtkpack_(g Line 75  $global_notebook->append_page(gtkpack_(g
75                               );                               );
76  $global_notebook->append_page(gtkpack_(gtkset_border_width(Gtk2::VBox->new(0,5), 5),  $global_notebook->append_page(gtkpack_(gtkset_border_width(Gtk2::VBox->new(0,5), 5),
77                      0, gtkadd(new Gtk2::Frame(N('IPV6')),                      0, gtkadd(new Gtk2::Frame(N('IPV6')),
78                                gtkpack__(gtkset_border_width(Gtk2::VBox->new(0,5), 5),                                gtkset_border_width(mycreate_packtable({},
79                                          getBestWidget($sys_network->{general}, '{NETWORKING_IPV6}', N('Activate IPV6')),                                      [ getBestWidget($sys_network->{general}, '{NETWORKING_IPV6}', N('Activate IPV6')) ],
80                                          getBestWidget($sys_network->{general}, '{IPV6FORWARDING}', N('IPV6 Forwarding')),                                      [ getBestWidget($sys_network->{general}, '{IPV6FORWARDING}', N('IPV6 Forwarding')) ],
81                                          getBestWidget($sys_network->{general}, '{IPV6INIT}', N('IPV6 Init')),                                      [ getBestWidget($sys_network->{general}, '{IPV6INIT}', N('IPV6 Init')) ],
82                                          getBestWidget($sys_network->{general}, '{IPV6_AUTOCONF}', N('IPV6 Autoconf')),                                      [ getBestWidget($sys_network->{general}, '{IPV6_AUTOCONF}', N('IPV6 Autoconf')) ],
83                                          getBestWidget($sys_network->{general}, '{IPV6_ROUTER}', N('IPV6 Router')),                                      [ getBestWidget($sys_network->{general}, '{IPV6_ROUTER}', N('IPV6 Router')) ],
84                                          getBestWidget($sys_network->{general}, '{IPV6_AUTOTUNNEL}', N('IPV6 Autotunnel')),                                      [ getBestWidget($sys_network->{general}, '{IPV6_AUTOTUNNEL}', N('IPV6 Autotunnel')) ],
85                                          gtkpack__(Gtk2::HBox->new(0,5), N('IPV6 Default gateway : '), getBestWidget($sys_network->{general}, '{IPV6_DEFAULTGW}')),                                      [ N('IPV6 Default gateway'), getBestWidget($sys_network->{general}, '{IPV6_DEFAULTGW}') ],
86                                          gtkpack__(Gtk2::HBox->new(0,5), N('IPV6 Default device : '), getBestWidget($sys_network->{general}, '{IPV6_DEFAULTDEV}')),                                      [ N('IPV6 Default device'), getBestWidget($sys_network->{general}, '{IPV6_DEFAULTDEV}') ],
87                                          gtkpack__(Gtk2::HBox->new(0,5), N('IPV6 Radvd pidfile : '), getBestWidget($sys_network->{general}, '{IPV6_RADVD_PIDFILE}')),                                      [ N('IPV6 Radvd pidfile'), getBestWidget($sys_network->{general}, '{IPV6_RADVD_PIDFILE}') ],
88                                          gtkpack__(Gtk2::HBox->new(0,5), N('IPV6 to IPV4 Radvd pidfile : '), getBestWidget($sys_network->{general}, '{IPV6TO4_RADVD_PIDFILE}')),                                      [ N('IPV6 to IPV4 Radvd pidfile'), getBestWidget($sys_network->{general}, '{IPV6TO4_RADVD_PIDFILE}') ],
89                                          gtkpack__(Gtk2::HBox->new(0,5), N('IPV6 Radvd trigger action : '), getBestWidget($sys_network->{general}, '{IPV6_RADVD_TRIGGER_ACTION}')),                                      [ N('IPV6 Radvd trigger action'), getBestWidget($sys_network->{general}, '{IPV6_RADVD_TRIGGER_ACTION}') ],
90                                         ),                                     ), 5),
91                               ),                               ),
92                                        ),                                        ),
93                                Gtk2::Label->new(N('IPV6')),                                Gtk2::Label->new(N('IPV6')),
# Line 100  $main_notebook->append_page(gtkpack_(gtk Line 100  $main_notebook->append_page(gtkpack_(gtk
100                                                 gtkpack__(gtkset_border_width(Gtk2::HBox->new(0,5), 5),                                                 gtkpack__(gtkset_border_width(Gtk2::HBox->new(0,5), 5),
101                                                           my $int_clist = Gtk2::TreeView->new_with_model($int_clist_tree_model),                                                           my $int_clist = Gtk2::TreeView->new_with_model($int_clist_tree_model),
102                                                           gtkadd(gtkset_layout(my $int_button_box = new Gtk2::VButtonBox, 'end'),                                                           gtkadd(gtkset_layout(my $int_button_box = new Gtk2::VButtonBox, 'end'),
103                                                                  gtksignal_connect(new Gtk2::Button(N("Add")), clicked => sub { }),                                                                  gtksignal_connect(new Gtk2::Button(N("Add")), clicked => \&add_interface ),
104                                                                  gtksignal_connect(new Gtk2::Button(N("Configure")), clicked => sub { }),                                                                  gtksignal_connect(new Gtk2::Button(N("Configure")), clicked => sub {
105                                                                                          configure_interface($$sys_network->{interfaces}{},
106                                                                                                              N('Configure network interface'),
107                                                                                                              1)
108                                                                                      }),
109                                                                  gtksignal_connect(new Gtk2::Button(N("Delete")), clicked => sub { }),                                                                  gtksignal_connect(new Gtk2::Button(N("Delete")), clicked => sub { }),
110                                                                 )                                                                 )
111                                                          ),                                                          ),
# Line 129  Gtk2->main; Line 133  Gtk2->main;
133    
134    
135    
136    sub add_interface {
137        my $interface = new Libconf::Glueconf::Ifconfig('/tmp/dummy_interface');
138        set_interface($interface, N('Add new network interface'));
139        system("rm -f /tmp/dummy_interface");
140    }
141    
142    
143    sub set_interface {
144        my ($interface, $title, $lock_device) = @_;
145        $lock_device ||= 0;
146        my $interface_notebook = gtkset_border_width(new Gtk2::Notebook, 5);
147        $interface_notebook->append_page(
148                                         gtkset_border_width(mycreate_packtable({},
149                                               [ N('Device'), gtkset_active(getBestWidget($interface, '{DEVICE}'), !$lock_device) ],
150                                               [ N('Boot protocol'), getBestWidget($interface, '{BOOTPROTO }') ],
151                                               [ N('IP address'), getBestWidget($interface, '{IPADDR}') ],
152                                               [ N('Netmask'), getBestWidget($interface, '{NETMASK}') ],
153                                               [ getBestWidget($interface, '{ONBOOT}', N('Start at boot')) ],
154                                               [ getBestWidget($interface, '{MII_NOT_SUPPORTED}', N("Don't support mii tools")) ],
155                                               [ N('DHCP client'), getBestWidget($interface, '{DHCP_CLIENT}') ],
156                                               [ N('DHCP timeout'), getBestWidget($interface, '{DHCP_TIMEOUT}') ],
157                                              ), 5),
158                                         Gtk2::Label->new(N('Basic settings'))
159                                        );
160        $interface_notebook->append_page(
161                                         gtkset_border_width(mycreate_packtable({},
162                                               [ N('Name'), getBestWidget($interface, '{NAME}') ],
163                                               [ N('Gateway'), getBestWidget($interface, '{GATEWAY}') ],
164                                               [ getBestWidget($interface, '{USERCTL}', N('User Control')) ],
165                                               [ N('MTU'), getBestWidget($interface, '{MTU}') ],
166                                               [ getBestWidget($interface, '{PEERDNS}', N('Use peer DNS')) ],
167                                               [ N('DNS 1'), getBestWidget($interface, '{DNS1}') ],
168                                               [ N('DNS 2'), getBestWidget($interface, '{DNS2}') ],
169                                               [ getBestWidget($interface, '{FIREWALL_MODS}', N('Modify Firewall')) ],
170                                               [ N('SRC address'), getBestWidget($interface, '{SRCADDR}') ],
171                                              ), 5),
172                                         Gtk2::Label->new(N('Advanced settings'))
173                                        );
174        if (create_dialog($title,
175                          $interface_notebook,
176                          { stock => 'gtk-dialog-info',
177                            cancel => 1,
178                          })) {
179            $sys_network->{interfaces}{$interface->{DEVICE}} = $interface;
180            print Dumper($sys_network) . "\n";
181        }
182    }
183    
184  sub mycreate_packtable {  sub mycreate_packtable {
185      my ($options, @l) = @_;      my ($options, @l) = @_;
186      my $w = Gtk2::Table->new(0, 0, $options->{homogeneous} || 0);      my $w = Gtk2::Table->new(0, 0, $options->{homogeneous} || 0);

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26