6 |
# |
# |
7 |
# This program is free software; you can redistribute it and/or modify |
# This program is free software; you can redistribute it and/or modify |
8 |
# it under the terms of the GNU General Public License as published by |
# it under the terms of the GNU General Public License as published by |
9 |
# the Free Software Foundation; either version 2, or (at your option) |
# the Free Software Foundation; only version 2, no any other version. |
|
# any later version. |
|
10 |
# |
# |
11 |
# This program is distributed in the hope that it will be useful, |
# This program is distributed in the hope that it will be useful, |
12 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
109 |
|
|
110 |
##### subfonctions ##### |
##### subfonctions ##### |
111 |
|
|
112 |
|
# takes the list of label+path in the glueconf struct, and build the gtk table |
113 |
|
# correcponding, with the best widget to represent the infos, and a help button |
114 |
sub construct_table { |
sub construct_table { |
115 |
my ($struct) = shift; |
my ($struct) = shift; |
116 |
mycreate_packtable({}, |
mycreate_packtable({}, |
134 |
) |
) |
135 |
} |
} |
136 |
|
|
137 |
# this fonction builds the users list |
# builds the users list |
138 |
sub build_user_list { |
sub build_user_list { |
139 |
#we clear the list in case it wasn't empty |
#we clear the list in case it wasn't empty |
140 |
$users_clist_model->clear(); |
$users_clist_model->clear(); |
243 |
} |
} |
244 |
|
|
245 |
|
|
246 |
# the function called when the user clicks on the Apply button |
# called when the user clicks on the Apply button |
247 |
sub save { |
sub save { |
248 |
|
|
249 |
# we ask the $sys_network object to write itself back to the real config file |
# we ask the $sys_network object to write itself back to the real config file |
252 |
$struct->writeConf(); |
$struct->writeConf(); |
253 |
} |
} |
254 |
|
|
255 |
# the function called when the user clicks on the OK button |
# called when the user clicks on the OK button |
256 |
sub save_exit { |
sub save_exit { |
257 |
|
|
258 |
# we save the settings |
# we save the settings |
262 |
Gtk2->main_quit(); |
Gtk2->main_quit(); |
263 |
} |
} |
264 |
|
|
265 |
# the function called when the user clicks on the Cancel button |
# called when the user clicks on the Cancel button |
266 |
sub cancel_exit { |
sub cancel_exit { |
267 |
|
|
268 |
# we exit the gtk2 main loop |
# we exit the gtk2 main loop |
269 |
Gtk2->main_quit(); |
Gtk2->main_quit(); |
270 |
} |
} |
271 |
|
|
272 |
|
# call create_packtable, but ensure labels are right-justified (not very clean) |
273 |
sub mycreate_packtable { |
sub mycreate_packtable { |
274 |
my ($options, @l) = @_; |
my ($options, @l) = @_; |
275 |
create_packtable($options, map { [ map { ref $_ ? $_ : gtkpack_( Gtk2::HBox->new(0,0), |
create_packtable($options, map { [ map { ref $_ ? $_ : gtkpack_( Gtk2::HBox->new(0,0), |