summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2008-05-12 12:27:23 +0000
committerOlivier Blin <oblin@mandriva.com>2008-05-12 12:27:23 +0000
commit963d65ea1471f599a11803e730fa738e2878e611 (patch)
tree6cc32d8616746384b03e379b20041399caab2d3c
parenteb2c8523b6bc72e6d671159dfb39594c2632c08c (diff)
downloaddrakx-net-963d65ea1471f599a11803e730fa738e2878e611.tar
drakx-net-963d65ea1471f599a11803e730fa738e2878e611.tar.gz
drakx-net-963d65ea1471f599a11803e730fa738e2878e611.tar.bz2
drakx-net-963d65ea1471f599a11803e730fa738e2878e611.tar.xz
drakx-net-963d65ea1471f599a11803e730fa738e2878e611.zip
allow to disable D-Bus usage by setting NET_APPLET_DBUS=no in /etc/sysconfig/drakx-net
(saves about 5200 kB of RSS memory) this disables Interactive Firewall and switching wireless network in the background without being root
-rwxr-xr-xbin/net_applet5
1 files changed, 4 insertions, 1 deletions
diff --git a/bin/net_applet b/bin/net_applet
index c48612a..05a2a37 100755
--- a/bin/net_applet
+++ b/bin/net_applet
@@ -25,6 +25,7 @@ use Gtk2::TrayIcon;
use ugtk2 qw(:create :helpers :wrappers :dialogs);
my $onstartupfile = "$ENV{HOME}/.net_applet";
+my $system_file = '/etc/sysconfig/drakx-net';
shouldStart() or die "$onstartupfile should be set to TRUE or use net_applet --force\n";
#- Allow multiple instances, but only one per user:
@@ -51,6 +52,8 @@ my %pixbufs =
);
my %wireless_networks;
+my %global_settings = getVarsFromSh($system_file);
+
sub get_state_message {
my ($o_interface) = @_;
my $interface = $o_interface || $current_interface;
@@ -145,7 +148,7 @@ gtkadd(my $icon = Gtk2::TrayIcon->new("Net_Applet"),
$icon->show_all;
my ($dbus, $monitor, $ifw, $interactive_cb, $ifw_alert);
-eval { $dbus = dbus_object::system_bus() };
+eval { $dbus = dbus_object::system_bus() } if !defined($global_settings{NET_APPLET_DBUS}) || text2bool($global_settings{NET_APPLET_DBUS});
eval { $monitor = network::monitor->new($dbus) } if $dbus;
eval {
$ifw = network::ifw->new($dbus, sub {