summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2005-05-30 11:00:54 +0000
committerOlivier Blin <oblin@mandriva.org>2005-05-30 11:00:54 +0000
commit04e1fa6112d1ea337b7cdbede04fb38cec62e245 (patch)
tree5983e6c4a1f91183db0013a20b14ebc7f4955c31
parent2210d2f335f1042d741fa8e8fd918a97f965c9ef (diff)
downloadcontrol-center-04e1fa6112d1ea337b7cdbede04fb38cec62e245.tar
control-center-04e1fa6112d1ea337b7cdbede04fb38cec62e245.tar.gz
control-center-04e1fa6112d1ea337b7cdbede04fb38cec62e245.tar.bz2
control-center-04e1fa6112d1ea337b7cdbede04fb38cec62e245.tar.xz
control-center-04e1fa6112d1ea337b7cdbede04fb38cec62e245.zip
move netprofile stuff in network::network
-rwxr-xr-xcontrol-center25
1 files changed, 12 insertions, 13 deletions
diff --git a/control-center b/control-center
index 5ff7341f..c29cbff5 100755
--- a/control-center
+++ b/control-center
@@ -29,7 +29,7 @@ use standalone;
use common;
use detect_devices;
use lang;
-use network::netconnect; # for profiles
+use network::network;
# i18n: IMPORTANT: to get correct namespace (drakconf instead of libDrakX)
BEGIN { unshift @::textdomains, 'drakconf' }
@@ -1011,7 +1011,7 @@ my %shared_translations = (
);
# for profiles:
-my ($netcnx, $netc, $intf) = ({}, {}, {});
+my ($netc);
my @profiles;
my $mdk_rel = common::mandrake_release();
@@ -1093,7 +1093,7 @@ my @menu_items = (
{ transient => $dialog });
return 1;
}
- network::netconnect::add_profile($netcnx, $prof);
+ network::network::netprofile_add($netc, $prof);
update_profiles();
$dialog->destroy;
}),
@@ -1106,24 +1106,24 @@ my @menu_items = (
}, undef, '<Item>' ],
[ $shared_translations{profiles} . $shared_translations{delete}, undef, sub {
- return if !$window_global->realized && $netcnx->{PROFILE} ne "default";
+ return if !$window_global->realized && $netc->{PROFILE} ne "default";
my $dialog = _create_dialog(N("Delete profile"), { stock => 'gtk-dialog-warning' });
gtkpack($dialog->vbox,
Gtk2::Label->new(N("Profile to delete:")),
my $combo_dialog = Gtk2::OptionMenu->new,
);
- $combo_dialog->set_popdown_strings(grep { ! /default/ } network::netconnect::get_profiles());
+ $combo_dialog->set_popdown_strings(grep { ! /default/ } network::network::netprofile_list());
gtkpack($dialog->action_area,
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 $netcnx->{PROFILE}) {
+ if ($profile2delete eq $netc->{PROFILE}) {
err_dialog(N("Warning"), N("You can not delete the current profile"));
return 1;
}
$dialog->destroy;
Gtk2->main_quit;
- network::netconnect::del_profile($profile2delete);
+ network::network::netprofile_delete($profile2delete);
update_profiles(1);
}),
);
@@ -1165,8 +1165,8 @@ sub update_profiles {
my ($removing) = @_;
my $done;
$factory->delete_item(get_path("<main>", $shared_translations{profiles} . profile2menu($_))) foreach @profiles;
- network::netconnect::read_net_conf($netcnx, $netc, $intf);
- @profiles = network::netconnect::get_profiles();
+ network::network::netprofile_read($netc);
+ @profiles = network::network::netprofile_list();
foreach my $prof (@profiles) {
$factory->create_item([ $shared_translations{profiles} . profile2menu($prof), undef, sub {
return unless $done;
@@ -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?", $netcnx->{PROFILE}, $prof), { transient => $window_global })) {
+Are you sure you want to do the switch?", $netc->{PROFILE}, $prof), { transient => $window_global })) {
$done = 0;
enable_profile_entry($prof, 0);
$done = 1;
@@ -1187,9 +1187,8 @@ Are you sure you want to do the switch?", $netcnx->{PROFILE}, $prof), { transien
}
# wait message is needed
$done = 0;
- enable_profile_entry($netcnx->{PROFILE}, 0);
- $netcnx->{PROFILE} = $prof;
- network::netconnect::set_profile($netcnx);
+ enable_profile_entry($netc->{PROFILE}, 0);
+ network::network::netprofile_set($netcnx, $prof);
enable_profile_entry($prof, 1) if !$removing;
$done = 1;
}, undef, '<CheckItem>' ]); # Radio