mirror of
https://github.com/gryf/wicd.git
synced 2026-03-16 22:53:33 +01:00
Update copyrights and some docstrings.
Make trayicon network menu scan-triggering behave better.
This commit is contained in:
@@ -1,8 +1,10 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
|
|
||||||
|
""" autoconnect -- Triggers an automatic connection attempt. """
|
||||||
|
|
||||||
#
|
#
|
||||||
# Copyright (C) 2007 - 2008 Adam Blackburn
|
# Copyright (C) 2007 - 2009 Adam Blackburn
|
||||||
# Copyright (C) 2007 - 2008 Dan O'Reilly
|
# Copyright (C) 2007 - 2009 Dan O'Reilly
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License Version 2 as
|
# it under the terms of the GNU General Public License Version 2 as
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ Manages and loads the pluggable backends for wicd.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
#
|
#
|
||||||
# Copyright (C) 2008 Adam Blackburn
|
# Copyright (C) 2008-2009 Adam Blackburn
|
||||||
# Copyright (C) 2008 Dan O'Reilly
|
# Copyright (C) 2008-2009 Dan O'Reilly
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License Version 2 as
|
# it under the terms of the GNU General Public License Version 2 as
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ class WirelessInterface() -- Control a wireless network interface.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
#
|
#
|
||||||
# Copyright (C) 2008 Adam Blackburn
|
# Copyright (C) 2008-2009 Adam Blackburn
|
||||||
# Copyright (C) 2008 Dan O'Reilly
|
# Copyright (C) 2008-2009 Dan O'Reilly
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License Version 2 as
|
# it under the terms of the GNU General Public License Version 2 as
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ class WirelessInterface() -- Control a wireless network interface.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
#
|
#
|
||||||
# Copyright (C) 2008 Adam Blackburn
|
# Copyright (C) 2008-2009 Adam Blackburn
|
||||||
# Copyright (C) 2008 Dan O'Reilly
|
# Copyright (C) 2008-2009 Dan O'Reilly
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License Version 2 as
|
# it under the terms of the GNU General Public License Version 2 as
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
""" Wicd Configuration Manager
|
""" configmanager -- Wicd configuration file manager
|
||||||
|
|
||||||
Wrapper around ConfigParser for wicd, though it should be
|
Wrapper around ConfigParser for wicd, though it should be
|
||||||
reusable for other purposes as well.
|
reusable for other purposes as well.
|
||||||
@@ -8,8 +8,8 @@ reusable for other purposes as well.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
#
|
#
|
||||||
# Copyright (C) 2008 Adam Blackburn
|
# Copyright (C) 2008-2009 Adam Blackburn
|
||||||
# Copyright (C) 2008 Dan O'Reilly
|
# Copyright (C) 2008-2009 Dan O'Reilly
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License Version 2 as
|
# it under the terms of the GNU General Public License Version 2 as
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
""" Configure the scripts for a particular network.
|
""" configscript -- Configure the scripts for a particular network.
|
||||||
|
|
||||||
Script for configuring the scripts for a network passed in as a
|
Script for configuring the scripts for a network passed in as a
|
||||||
command line argument. This needs to run a separate process because
|
command line argument. This needs to run a separate process because
|
||||||
@@ -10,8 +10,8 @@ run as the current user.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
#
|
#
|
||||||
# Copyright (C) 2007-2008 Adam Blackburn
|
# Copyright (C) 2007-2009 Adam Blackburn
|
||||||
# Copyright (C) 2007-2008 Dan O'Reilly
|
# Copyright (C) 2007-2009 Dan O'Reilly
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License Version 2 as
|
# it under the terms of the GNU General Public License Version 2 as
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ A module for managing wicd's dbus interfaces.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
#
|
#
|
||||||
# Copyright (C) 2008 Adam Blackburn
|
# Copyright (C) 2008-2009 Adam Blackburn
|
||||||
# Copyright (C) 2008 Dan O'Reilly
|
# Copyright (C) 2008-2009 Dan O'Reilly
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License Version 2 as
|
# it under the terms of the GNU General Public License Version 2 as
|
||||||
|
|||||||
@@ -1,15 +1,14 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
|
|
||||||
""" Wicd GUI module.
|
""" gui -- The main wicd GUI module.
|
||||||
|
|
||||||
Module containg all the code (other than the tray icon) related to the
|
Module containing the code for the main wicd GUI.
|
||||||
Wicd user interface.
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
#
|
#
|
||||||
# Copyright (C) 2007 Adam Blackburn
|
# Copyright (C) 2007-2009 Adam Blackburn
|
||||||
# Copyright (C) 2007 Dan O'Reilly
|
# Copyright (C) 2007-2009 Dan O'Reilly
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License Version 2 as
|
# it under the terms of the GNU General Public License Version 2 as
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
""" guiutil - A collection of commonly used gtk/gui functions and classes. """
|
""" guiutil - A collection of commonly used gtk/gui functions and classes. """
|
||||||
#
|
#
|
||||||
# Copyright (C) 2007 - 2008 Adam Blackburn
|
# Copyright (C) 2007 - 2009 Adam Blackburn
|
||||||
# Copyright (C) 2007 - 2008 Dan O'Reilly
|
# Copyright (C) 2007 - 2009 Dan O'Reilly
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License Version 2 as
|
# it under the terms of the GNU General Public License Version 2 as
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#
|
#
|
||||||
# Copyright (C) 1999-2006 Keith Dart <keith@kdart.com>
|
# Copyright (C) 1999-2006 Keith Dart <keith@kdart.com>
|
||||||
# Copyright (C) 2008 Dan O'Reilly <oreilldf@gmail.com>
|
# Copyright (C) 2008-2009 Dan O'Reilly <oreilldf@gmail.com>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or
|
# This library is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU Lesser General Public
|
# modify it under the terms of the GNU Lesser General Public
|
||||||
|
|||||||
11
wicd/misc.py
11
wicd/misc.py
@@ -1,8 +1,13 @@
|
|||||||
""" Misc - miscellaneous functions for wicd """
|
""" misc - miscellaneous functions for wicd
|
||||||
|
|
||||||
|
This module contains a large variety of utility functions used
|
||||||
|
throughout wicd.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
#
|
#
|
||||||
# Copyright (C) 2007 - 2008 Adam Blackburn
|
# Copyright (C) 2007 - 2009 Adam Blackburn
|
||||||
# Copyright (C) 2007 - 2008 Dan O'Reilly
|
# Copyright (C) 2007 - 2009 Dan O'Reilly
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License Version 2 as
|
# it under the terms of the GNU General Public License Version 2 as
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ when appropriate.
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
#
|
#
|
||||||
# Copyright (C) 2007 - 2008 Adam Blackburn
|
# Copyright (C) 2007 - 2009 Adam Blackburn
|
||||||
# Copyright (C) 2007 - 2008 Dan O'Reilly
|
# Copyright (C) 2007 - 2009 Dan O'Reilly
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License Version 2 as
|
# it under the terms of the GNU General Public License Version 2 as
|
||||||
|
|||||||
@@ -1,6 +1,13 @@
|
|||||||
|
""" netentry -- Network entry widgets for the GUI.
|
||||||
|
|
||||||
|
This module provides GUI widgets used to represent wired and wireless
|
||||||
|
entries in the GUI's network list, as well as any settings dialogs
|
||||||
|
contained within them.
|
||||||
|
|
||||||
|
"""
|
||||||
#
|
#
|
||||||
# Copyright (C) 2007 Adam Blackburn
|
# Copyright (C) 2008-2009 Adam Blackburn
|
||||||
# Copyright (C) 2007 Dan O'Reilly
|
# Copyright (C) 2008-2009 Dan O'Reilly
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License Version 2 as
|
# it under the terms of the GNU General Public License Version 2 as
|
||||||
|
|||||||
@@ -19,9 +19,9 @@ class WiredConnectThread() -- Connection thread for wired
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
#
|
#
|
||||||
# Copyright (C) 2007 - 2008 Adam Blackburn
|
# Copyright (C) 2007 - 2009 Adam Blackburn
|
||||||
# Copyright (C) 2007 - 2008 Dan O'Reilly
|
# Copyright (C) 2007 - 2009 Dan O'Reilly
|
||||||
# Copyright (C) 2007 - 2008 Byron Hillis
|
# Copyright (C) 2007 - 2009 Byron Hillis
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License Version 2 as
|
# it under the terms of the GNU General Public License Version 2 as
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
|
|
||||||
""" Wicd Preferences Dialog.
|
""" prefs -- Wicd Preferences Dialog.
|
||||||
|
|
||||||
Displays the main settings dialog window for wicd and
|
Displays the main settings dialog window for wicd and
|
||||||
handles recieving/sendings the settings from/to the daemon.
|
handles recieving/sendings the settings from/to the daemon.
|
||||||
@@ -8,8 +8,8 @@ handles recieving/sendings the settings from/to the daemon.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
#
|
#
|
||||||
# Copyright (C) 2007 Adam Blackburn
|
# Copyright (C) 2008-2009 Adam Blackburn
|
||||||
# Copyright (C) 2007 Dan O'Reilly
|
# Copyright (C) 2008-2009 Dan O'Reilly
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License Version 2 as
|
# it under the terms of the GNU General Public License Version 2 as
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ Used for when a laptop enters hibernation/suspension.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
#
|
#
|
||||||
# Copyright (C) 2007 - 2008 Adam Blackburn
|
# Copyright (C) 2007 - 2009 Adam Blackburn
|
||||||
# Copyright (C) 2007 - 2008 Dan O'Reilly
|
# Copyright (C) 2007 - 2009 Dan O'Reilly
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License Version 2 as
|
# it under the terms of the GNU General Public License Version 2 as
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# -* coding: utf-8 -*-
|
# -* coding: utf-8 -*-
|
||||||
|
|
||||||
|
""" translations -- module for handling the translation strings for wicd. """
|
||||||
#
|
#
|
||||||
# Copyright (C) 2007 - 2009 Adam Blackburn
|
# Copyright (C) 2007 - 2009 Adam Blackburn
|
||||||
# Copyright (C) 2007 - 2009 Dan O'Reilly
|
# Copyright (C) 2007 - 2009 Dan O'Reilly
|
||||||
|
|||||||
@@ -14,14 +14,12 @@ class TrayIcon() -- Parent class of TrayIconGUI and IconConnectionInfo.
|
|||||||
class StatusTrayIconGUI() -- Implements the tray icon using a
|
class StatusTrayIconGUI() -- Implements the tray icon using a
|
||||||
gtk.StatusIcon.
|
gtk.StatusIcon.
|
||||||
class EggTrayIconGUI() -- Implements the tray icon using egg.trayicon.
|
class EggTrayIconGUI() -- Implements the tray icon using egg.trayicon.
|
||||||
def usage() -- Prints usage information.
|
|
||||||
def main() -- Runs the wicd frontend main loop.
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
#
|
#
|
||||||
# Copyright (C) 2007 - 2008 Adam Blackburn
|
# Copyright (C) 2007 - 2009 Adam Blackburn
|
||||||
# Copyright (C) 2007 - 2008 Dan O'Reilly
|
# Copyright (C) 2007 - 2009 Dan O'Reilly
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License Version 2 as
|
# it under the terms of the GNU General Public License Version 2 as
|
||||||
@@ -464,7 +462,6 @@ class TrayIcon(object):
|
|||||||
signal_img = 'signal-25.png'
|
signal_img = 'signal-25.png'
|
||||||
return wpath.images + signal_img
|
return wpath.images + signal_img
|
||||||
|
|
||||||
@catchdbus
|
|
||||||
def on_net_menu_activate(self, item):
|
def on_net_menu_activate(self, item):
|
||||||
""" Trigger a background scan to populate the network menu.
|
""" Trigger a background scan to populate the network menu.
|
||||||
|
|
||||||
@@ -475,18 +472,20 @@ class TrayIcon(object):
|
|||||||
mousing past the menu to select another menu item.
|
mousing past the menu to select another menu item.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
def dummy(x=None): pass
|
|
||||||
|
|
||||||
if self._is_scanning:
|
if self._is_scanning:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
self.init_network_menu()
|
self.init_network_menu()
|
||||||
time.sleep(.4)
|
gobject.timeout_add(800, self._trigger_scan_if_needed, item)
|
||||||
|
|
||||||
|
@catchdbus
|
||||||
|
def _trigger_scan_if_needed(self, item):
|
||||||
while gtk.events_pending():
|
while gtk.events_pending():
|
||||||
gtk.main_iteration()
|
gtk.main_iteration()
|
||||||
if item.state != gtk.STATE_PRELIGHT:
|
if item.state != gtk.STATE_PRELIGHT:
|
||||||
return True
|
return False
|
||||||
wireless.Scan(False)
|
wireless.Scan(False)
|
||||||
|
return False
|
||||||
|
|
||||||
@catchdbus
|
@catchdbus
|
||||||
def populate_network_menu(self, data=None):
|
def populate_network_menu(self, data=None):
|
||||||
@@ -535,7 +534,7 @@ class TrayIcon(object):
|
|||||||
net_menuitem.show()
|
net_menuitem.show()
|
||||||
|
|
||||||
def init_network_menu(self):
|
def init_network_menu(self):
|
||||||
""" Set the right-click menu for to the scanning state. """
|
""" Set the right-click network menu to the scanning state. """
|
||||||
net_menuitem = self.manager.get_widget("/Menubar/Menu/Connect/")
|
net_menuitem = self.manager.get_widget("/Menubar/Menu/Connect/")
|
||||||
submenu = net_menuitem.get_submenu()
|
submenu = net_menuitem.get_submenu()
|
||||||
self._clear_menu(submenu)
|
self._clear_menu(submenu)
|
||||||
@@ -592,6 +591,7 @@ class TrayIcon(object):
|
|||||||
if event.button == 1:
|
if event.button == 1:
|
||||||
self.toggle_wicd_gui()
|
self.toggle_wicd_gui()
|
||||||
elif event.button == 3:
|
elif event.button == 3:
|
||||||
|
self._menu_just_opened = True
|
||||||
self.init_network_menu()
|
self.init_network_menu()
|
||||||
self.menu.popup(None, None, None, event.button, event.time)
|
self.menu.popup(None, None, None, event.button, event.time)
|
||||||
|
|
||||||
@@ -629,6 +629,7 @@ class TrayIcon(object):
|
|||||||
|
|
||||||
def on_popup_menu(self, status, button, timestamp):
|
def on_popup_menu(self, status, button, timestamp):
|
||||||
""" Opens the right click menu for the tray icon. """
|
""" Opens the right click menu for the tray icon. """
|
||||||
|
self._menu_just_opened = True
|
||||||
self.init_network_menu()
|
self.init_network_menu()
|
||||||
self.menu.popup(None, None, None, button, timestamp)
|
self.menu.popup(None, None, None, button, timestamp)
|
||||||
|
|
||||||
|
|||||||
@@ -8,19 +8,16 @@ connection management, for both wireless and wired networks. The daemon
|
|||||||
must be run as root to control the networks, however the user interface
|
must be run as root to control the networks, however the user interface
|
||||||
components should be run as a normal user.
|
components should be run as a normal user.
|
||||||
|
|
||||||
class LogWriter() -- Class to redirect stdout and stderr to a log file.
|
class WicdDaemon() -- DBus interface to manage general wicd processes.
|
||||||
class ConnectionWizard() -- DBUS interface to manage the network.
|
class WiredDaemon() -- DBus interface to managed the wired network.
|
||||||
class ConnectionStatus() -- Updates the current connection state
|
class WirelessDaemon() -- DBus interface to managed the wireless network.
|
||||||
def usage() -- Print usage information.
|
|
||||||
def daemonize() -- Daemonize the current process with a double fork.
|
|
||||||
def main() -- The wicd daemon main loop.
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
#
|
#
|
||||||
# Copyright (C) 2007 - 2008 Adam Blackburn
|
# Copyright (C) 2007 - 2009 Adam Blackburn
|
||||||
# Copyright (C) 2007 - 2008 Dan O'Reilly
|
# Copyright (C) 2007 - 2009 Dan O'Reilly
|
||||||
# Copyright (C) 2007 - 2008 Byron Hillis
|
# Copyright (C) 2007 - 2009 Byron Hillis
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License Version 2 as
|
# it under the terms of the GNU General Public License Version 2 as
|
||||||
|
|||||||
@@ -6,18 +6,16 @@
|
|||||||
This module implements functions to control and obtain information from
|
This module implements functions to control and obtain information from
|
||||||
network interfaces.
|
network interfaces.
|
||||||
|
|
||||||
def SetDNS() -- Set the DNS servers of the system.
|
class BaseInterface() -- Control a network interface.
|
||||||
def GetWirelessInterfaces() -- Get the wireless interfaces available.
|
class BaseWiredInterface() -- Control a wired network interface.
|
||||||
class Interface() -- Control a network interface.
|
class BaseWirelessInterface() -- Control a wireless network interface.
|
||||||
class WiredInterface() -- Control a wired network interface.
|
|
||||||
class WirelessInterface() -- Control a wireless network interface.
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
#
|
#
|
||||||
# Copyright (C) 2007 - 2008 Adam Blackburn
|
# Copyright (C) 2007 - 2009 Adam Blackburn
|
||||||
# Copyright (C) 2007 - 2008 Dan O'Reilly
|
# Copyright (C) 2007 - 2009 Dan O'Reilly
|
||||||
# Copyright (C) 2007 - 2008 Byron Hillis
|
# Copyright (C) 2007 - 2009 Byron Hillis
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License Version 2 as
|
# it under the terms of the GNU General Public License Version 2 as
|
||||||
|
|||||||
Reference in New Issue
Block a user