summaryrefslogtreecommitdiffstats
path: root/control-center
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2005-06-08 07:45:26 +0000
committerOlivier Blin <oblin@mandriva.org>2005-06-08 07:45:26 +0000
commit6dfa990ffb1189fd19d1635e2765b213b4bef6bd (patch)
tree2ad1e2cda37011dea86f5b8751cf8e2a4f5e5183 /control-center
parent8b999588e97b2de35d8b6760a9674869de44e7d7 (diff)
downloadcontrol-center-6dfa990ffb1189fd19d1635e2765b213b4bef6bd.tar
control-center-6dfa990ffb1189fd19d1635e2765b213b4bef6bd.tar.gz
control-center-6dfa990ffb1189fd19d1635e2765b213b4bef6bd.tar.bz2
control-center-6dfa990ffb1189fd19d1635e2765b213b4bef6bd.tar.xz
control-center-6dfa990ffb1189fd19d1635e2765b213b4bef6bd.zip
fix profiles
Diffstat (limited to 'control-center')
-rwxr-xr-xcontrol-center20
1 files changed, 10 insertions, 10 deletions
diff --git a/control-center b/control-center
index c29cbff5..e9df3e4e 100755
--- a/control-center
+++ b/control-center
@@ -1011,7 +1011,7 @@ my %shared_translations = (
);
# for profiles:
-my ($netc);
+my $net = {};
my @profiles;
my $mdk_rel = common::mandrake_release();
@@ -1093,7 +1093,7 @@ my @menu_items = (
{ transient => $dialog });
return 1;
}
- network::network::netprofile_add($netc, $prof);
+ network::network::netprofile_add($net, $prof);
update_profiles();
$dialog->destroy;
}),
@@ -1106,7 +1106,7 @@ my @menu_items = (
}, undef, '<Item>' ],
[ $shared_translations{profiles} . $shared_translations{delete}, undef, sub {
- return if !$window_global->realized && $netc->{PROFILE} ne "default";
+ return if !$window_global->realized && $net->{PROFILE} ne "default";
my $dialog = _create_dialog(N("Delete profile"), { stock => 'gtk-dialog-warning' });
gtkpack($dialog->vbox,
Gtk2::Label->new(N("Profile to delete:")),
@@ -1117,7 +1117,7 @@ my @menu_items = (
gtksignal_connect(Gtk2::Button->new(N("Cancel")), clicked => sub { $dialog->destroy }),
gtksignal_connect(Gtk2::Button->new(N("Ok")), clicked => sub {
my $profile2delete = $combo_dialog->entry->get_text;
- if ($profile2delete eq $netc->{PROFILE}) {
+ if ($profile2delete eq $net->{PROFILE}) {
err_dialog(N("Warning"), N("You can not delete the current profile"));
return 1;
}
@@ -1165,12 +1165,12 @@ sub update_profiles {
my ($removing) = @_;
my $done;
$factory->delete_item(get_path("<main>", $shared_translations{profiles} . profile2menu($_))) foreach @profiles;
- network::network::netprofile_read($netc);
+ network::network::netprofile_read($net);
@profiles = network::network::netprofile_list();
foreach my $prof (@profiles) {
$factory->create_item([ $shared_translations{profiles} . profile2menu($prof), undef, sub {
return unless $done;
- if ($netcnx->{PROFILE} eq $prof) {
+ if ($net->{PROFILE} eq $prof) {
$done = 0;
enable_profile_entry($prof, 1);
$done = 1;
@@ -1179,7 +1179,7 @@ sub update_profiles {
if (!warn_dialog(N("Warning"),
N("We are about to switch from the \"%s\" profile to the \"%s\" profile.
-Are you sure you want to do the switch?", $netc->{PROFILE}, $prof), { transient => $window_global })) {
+Are you sure you want to do the switch?", $net->{PROFILE}, $prof), { transient => $window_global })) {
$done = 0;
enable_profile_entry($prof, 0);
$done = 1;
@@ -1187,14 +1187,14 @@ Are you sure you want to do the switch?", $netc->{PROFILE}, $prof), { transient
}
# wait message is needed
$done = 0;
- enable_profile_entry($netc->{PROFILE}, 0);
- network::network::netprofile_set($netcnx, $prof);
+ enable_profile_entry($net->{PROFILE}, 0);
+ network::network::netprofile_set($net, $prof);
enable_profile_entry($prof, 1) if !$removing;
$done = 1;
}, undef, '<CheckItem>' ]); # Radio
}
$factory->get_widget(get_path("<main>", $shared_translations{profiles}, $shared_translations{delete}))->set_sensitive(@profiles > 1);
- eval { $factory->get_widget(get_path("<main>", $shared_translations{profiles} . profile2menu($netcnx->{PROFILE})))->set_active(1) };
+ eval { $factory->get_widget(get_path("<main>", $shared_translations{profiles} . profile2menu($net->{PROFILE})))->set_active(1) };
print "error is «$@»\n" if $@;
$done = 1;
}