1
0
mirror of https://github.com/gryf/wicd.git synced 2026-01-06 13:54:17 +01:00

Update copyrights and some docstrings.

Make trayicon network menu scan-triggering behave better.
This commit is contained in:
Dan O'Reilly
2009-03-22 17:36:55 -04:00
parent f79067c692
commit 65c72ba3a2
20 changed files with 76 additions and 66 deletions

View File

@@ -1,8 +1,10 @@
#!/usr/bin/python
""" autoconnect -- Triggers an automatic connection attempt. """
#
# Copyright (C) 2007 - 2008 Adam Blackburn
# Copyright (C) 2007 - 2008 Dan O'Reilly
# Copyright (C) 2007 - 2009 Adam Blackburn
# Copyright (C) 2007 - 2009 Dan O'Reilly
#
# 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

View File

@@ -7,8 +7,8 @@ Manages and loads the pluggable backends for wicd.
"""
#
# Copyright (C) 2008 Adam Blackburn
# Copyright (C) 2008 Dan O'Reilly
# Copyright (C) 2008-2009 Adam Blackburn
# Copyright (C) 2008-2009 Dan O'Reilly
#
# 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

View File

@@ -13,8 +13,8 @@ class WirelessInterface() -- Control a wireless network interface.
"""
#
# Copyright (C) 2008 Adam Blackburn
# Copyright (C) 2008 Dan O'Reilly
# Copyright (C) 2008-2009 Adam Blackburn
# Copyright (C) 2008-2009 Dan O'Reilly
#
# 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

View File

@@ -14,8 +14,8 @@ class WirelessInterface() -- Control a wireless network interface.
"""
#
# Copyright (C) 2008 Adam Blackburn
# Copyright (C) 2008 Dan O'Reilly
# Copyright (C) 2008-2009 Adam Blackburn
# Copyright (C) 2008-2009 Dan O'Reilly
#
# 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

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
""" Wicd Configuration Manager
""" configmanager -- Wicd configuration file manager
Wrapper around ConfigParser for wicd, though it should be
reusable for other purposes as well.
@@ -8,8 +8,8 @@ reusable for other purposes as well.
"""
#
# Copyright (C) 2008 Adam Blackburn
# Copyright (C) 2008 Dan O'Reilly
# Copyright (C) 2008-2009 Adam Blackburn
# Copyright (C) 2008-2009 Dan O'Reilly
#
# 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

View File

@@ -1,6 +1,6 @@
#!/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
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-2008 Dan O'Reilly
# Copyright (C) 2007-2009 Adam Blackburn
# Copyright (C) 2007-2009 Dan O'Reilly
#
# 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

View File

@@ -7,8 +7,8 @@ A module for managing wicd's dbus interfaces.
"""
#
# Copyright (C) 2008 Adam Blackburn
# Copyright (C) 2008 Dan O'Reilly
# Copyright (C) 2008-2009 Adam Blackburn
# Copyright (C) 2008-2009 Dan O'Reilly
#
# 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

View File

@@ -1,15 +1,14 @@
#!/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
Wicd user interface.
Module containing the code for the main wicd GUI.
"""
#
# Copyright (C) 2007 Adam Blackburn
# Copyright (C) 2007 Dan O'Reilly
# Copyright (C) 2007-2009 Adam Blackburn
# Copyright (C) 2007-2009 Dan O'Reilly
#
# 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

View File

@@ -1,7 +1,7 @@
""" guiutil - A collection of commonly used gtk/gui functions and classes. """
#
# Copyright (C) 2007 - 2008 Adam Blackburn
# Copyright (C) 2007 - 2008 Dan O'Reilly
# Copyright (C) 2007 - 2009 Adam Blackburn
# Copyright (C) 2007 - 2009 Dan O'Reilly
#
# 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

View File

@@ -2,7 +2,7 @@
#
# 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
# modify it under the terms of the GNU Lesser General Public

View File

@@ -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 - 2008 Dan O'Reilly
# Copyright (C) 2007 - 2009 Adam Blackburn
# Copyright (C) 2007 - 2009 Dan O'Reilly
#
# 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

View File

@@ -8,8 +8,8 @@ when appropriate.
"""
#
# Copyright (C) 2007 - 2008 Adam Blackburn
# Copyright (C) 2007 - 2008 Dan O'Reilly
# Copyright (C) 2007 - 2009 Adam Blackburn
# Copyright (C) 2007 - 2009 Dan O'Reilly
#
# 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

View File

@@ -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) 2007 Dan O'Reilly
# Copyright (C) 2008-2009 Adam Blackburn
# Copyright (C) 2008-2009 Dan O'Reilly
#
# 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

View File

@@ -19,9 +19,9 @@ class WiredConnectThread() -- Connection thread for wired
"""
#
# Copyright (C) 2007 - 2008 Adam Blackburn
# Copyright (C) 2007 - 2008 Dan O'Reilly
# Copyright (C) 2007 - 2008 Byron Hillis
# Copyright (C) 2007 - 2009 Adam Blackburn
# Copyright (C) 2007 - 2009 Dan O'Reilly
# Copyright (C) 2007 - 2009 Byron Hillis
#
# 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

View File

@@ -1,6 +1,6 @@
#!/usr/bin/python
""" Wicd Preferences Dialog.
""" prefs -- Wicd Preferences Dialog.
Displays the main settings dialog window for wicd and
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) 2007 Dan O'Reilly
# Copyright (C) 2008-2009 Adam Blackburn
# Copyright (C) 2008-2009 Dan O'Reilly
#
# 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

View File

@@ -8,8 +8,8 @@ Used for when a laptop enters hibernation/suspension.
"""
#
# Copyright (C) 2007 - 2008 Adam Blackburn
# Copyright (C) 2007 - 2008 Dan O'Reilly
# Copyright (C) 2007 - 2009 Adam Blackburn
# Copyright (C) 2007 - 2009 Dan O'Reilly
#
# 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

View File

@@ -1,6 +1,7 @@
#!/usr/bin/env python
# -* coding: utf-8 -*-
""" translations -- module for handling the translation strings for wicd. """
#
# Copyright (C) 2007 - 2009 Adam Blackburn
# Copyright (C) 2007 - 2009 Dan O'Reilly

View File

@@ -14,14 +14,12 @@ class TrayIcon() -- Parent class of TrayIconGUI and IconConnectionInfo.
class StatusTrayIconGUI() -- Implements the tray icon using a
gtk.StatusIcon.
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 - 2008 Dan O'Reilly
# Copyright (C) 2007 - 2009 Adam Blackburn
# Copyright (C) 2007 - 2009 Dan O'Reilly
#
# 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
@@ -464,7 +462,6 @@ class TrayIcon(object):
signal_img = 'signal-25.png'
return wpath.images + signal_img
@catchdbus
def on_net_menu_activate(self, item):
""" 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.
"""
def dummy(x=None): pass
if self._is_scanning:
return True
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():
gtk.main_iteration()
if item.state != gtk.STATE_PRELIGHT:
return True
return False
wireless.Scan(False)
return False
@catchdbus
def populate_network_menu(self, data=None):
@@ -535,7 +534,7 @@ class TrayIcon(object):
net_menuitem.show()
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/")
submenu = net_menuitem.get_submenu()
self._clear_menu(submenu)
@@ -592,6 +591,7 @@ class TrayIcon(object):
if event.button == 1:
self.toggle_wicd_gui()
elif event.button == 3:
self._menu_just_opened = True
self.init_network_menu()
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):
""" Opens the right click menu for the tray icon. """
self._menu_just_opened = True
self.init_network_menu()
self.menu.popup(None, None, None, button, timestamp)

View File

@@ -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
components should be run as a normal user.
class LogWriter() -- Class to redirect stdout and stderr to a log file.
class ConnectionWizard() -- DBUS interface to manage the network.
class ConnectionStatus() -- Updates the current connection state
def usage() -- Print usage information.
def daemonize() -- Daemonize the current process with a double fork.
def main() -- The wicd daemon main loop.
class WicdDaemon() -- DBus interface to manage general wicd processes.
class WiredDaemon() -- DBus interface to managed the wired network.
class WirelessDaemon() -- DBus interface to managed the wireless network.
"""
#
# Copyright (C) 2007 - 2008 Adam Blackburn
# Copyright (C) 2007 - 2008 Dan O'Reilly
# Copyright (C) 2007 - 2008 Byron Hillis
# Copyright (C) 2007 - 2009 Adam Blackburn
# Copyright (C) 2007 - 2009 Dan O'Reilly
# Copyright (C) 2007 - 2009 Byron Hillis
#
# 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

View File

@@ -6,18 +6,16 @@
This module implements functions to control and obtain information from
network interfaces.
def SetDNS() -- Set the DNS servers of the system.
def GetWirelessInterfaces() -- Get the wireless interfaces available.
class Interface() -- Control a network interface.
class WiredInterface() -- Control a wired network interface.
class WirelessInterface() -- Control a wireless network interface.
class BaseInterface() -- Control a network interface.
class BaseWiredInterface() -- Control a wired network interface.
class BaseWirelessInterface() -- Control a wireless network interface.
"""
#
# Copyright (C) 2007 - 2008 Adam Blackburn
# Copyright (C) 2007 - 2008 Dan O'Reilly
# Copyright (C) 2007 - 2008 Byron Hillis
# Copyright (C) 2007 - 2009 Adam Blackburn
# Copyright (C) 2007 - 2009 Dan O'Reilly
# Copyright (C) 2007 - 2009 Byron Hillis
#
# 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