1
0
mirror of https://github.com/gryf/wicd.git synced 2025-12-22 14:07:59 +01:00

experimental:

- Fix some syntax/import problems created during the merge
This commit is contained in:
imdano
2008-09-06 19:53:25 +00:00
parent 345b7ce0b9
commit 687d932065
4 changed files with 23 additions and 18 deletions

View File

@@ -38,8 +38,8 @@ from wicd import misc
from wicd import wpath from wicd import wpath
from wicd.misc import noneToString from wicd.misc import noneToString
from wicd.netentry import WiredNetworkEntry, WirelessNetworkEntry from wicd.netentry import WiredNetworkEntry, WirelessNetworkEntry
from wicd.prefs import PreferencesDialog
from wicd.dbusmanager import DBusManager from wicd.dbusmanager import DBusManager
from wicd.prefs import PreferencesDialog
if __name__ == '__main__': if __name__ == '__main__':
wpath.chdir(__file__) wpath.chdir(__file__)
@@ -84,7 +84,6 @@ def setup_dbus(dbus_man=None):
wired = dbus_ifaces['wired'] wired = dbus_ifaces['wired']
return True return True
def error(parent, message): def error(parent, message):
""" Shows an error dialog """ """ Shows an error dialog """
dialog = gtk.MessageDialog(parent, gtk.DIALOG_MODAL, gtk.MESSAGE_ERROR, dialog = gtk.MessageDialog(parent, gtk.DIALOG_MODAL, gtk.MESSAGE_ERROR,
@@ -93,14 +92,6 @@ def error(parent, message):
dialog.run() dialog.run()
dialog.destroy() dialog.destroy()
def alert(parent, message):
""" Shows an error dialog """
dialog = gtk.MessageDialog(parent, gtk.DIALOG_MODAL, gtk.MESSAGE_WARNING,
gtk.BUTTONS_OK)
dialog.set_markup(message)
dialog.run()
dialog.destroy()
######################################## ########################################
##### GTK EXTENSION CLASSES ##### GTK EXTENSION CLASSES
######################################## ########################################

View File

@@ -28,7 +28,6 @@ import gobject
import pango import pango
from wicd import misc from wicd import misc
from wicd import gui
from wicd.misc import checkboxTextboxToggle, noneToBlankString from wicd.misc import checkboxTextboxToggle, noneToBlankString
daemon = None daemon = None
@@ -37,6 +36,14 @@ wired = None
language = misc.get_language_list_gui() language = misc.get_language_list_gui()
def alert(parent, message):
""" Shows an alert dialog """
dialog = gtk.MessageDialog(parent, gtk.DIALOG_MODAL, gtk.MESSAGE_WARNING,
gtk.BUTTONS_OK)
dialog.set_markup(message)
dialog.run()
dialog.destroy()
class PreferencesDialog(object): class PreferencesDialog(object):
def __init__(self, wTree, dbus): def __init__(self, wTree, dbus):
global daemon, wireless, wired global daemon, wireless, wired
@@ -229,7 +236,7 @@ class PreferencesDialog(object):
wired.SetWiredAutoConnectMethod(1) wired.SetWiredAutoConnectMethod(1)
if self.backends[self.backendcombo.get_active()] != daemon.GetSavedBackend(): if self.backends[self.backendcombo.get_active()] != daemon.GetSavedBackend():
gui.alert(self.dialog, language["backend_alert"]) alert(self.dialog, language["backend_alert"])
daemon.SetBackend(self.backends[self.backendcombo.get_active()]) daemon.SetBackend(self.backends[self.backendcombo.get_active()])
# External Programs Tab # External Programs Tab

View File

@@ -63,6 +63,8 @@ if __name__ == '__main__':
misc.RenameProcess("wicd") misc.RenameProcess("wicd")
wireless_conf = wpath.etc + "wireless-settings.conf"
wired_conf = wpath.etc + "wired-settings.conf"
class WicdDaemon(dbus.service.Object): class WicdDaemon(dbus.service.Object):
def __init__(self, bus_name, object_path="/org/wicd/daemon", def __init__(self, bus_name, object_path="/org/wicd/daemon",
@@ -1414,7 +1416,7 @@ def main(argv):
# Open the DBUS session # Open the DBUS session
bus = dbus.SystemBus() bus = dbus.SystemBus()
wicd_bus = dbus.service.BusName('org.wicd.daemon', bus=bus) wicd_bus = dbus.service.BusName('org.wicd.daemon', bus=bus)
daemon = WicdDaemon(wicd_bus, auto_connect=auto_scan) daemon = WicdDaemon(wicd_bus, auto_connect=auto_connect)
gobject.threads_init() gobject.threads_init()
if not no_poll: if not no_poll:

View File

@@ -15,8 +15,9 @@ current = os.path.dirname(os.path.realpath(__file__)) + '/'
# These paths are replaced when setup.py configure is run # These paths are replaced when setup.py configure is run
# All of these paths *MUST* end in a / # All directory paths *MUST* end in a /
# except the python one, of course as it is an executable
# DIRECTORIES
lib = '/usr/lib/wicd/' lib = '/usr/lib/wicd/'
share = '/usr/share/wicd/' share = '/usr/share/wicd/'
@@ -26,14 +27,12 @@ encryption = '/etc/wicd/encryption/templates/'
bin = '/usr/bin/' bin = '/usr/bin/'
networks = '/var/lib/wicd/configurations/' networks = '/var/lib/wicd/configurations/'
log = '/var/log/wicd/' log = '/var/log/wicd/'
backends = '/usr/lib/wicd/backends/'
# other, less useful entries
resume = '/etc/acpi/resume.d/' resume = '/etc/acpi/resume.d/'
suspend = '/etc/acpi/suspend.d/' suspend = '/etc/acpi/suspend.d/'
sbin = '/usr/sbin/' sbin = '/usr/sbin/'
dbus = '/etc/dbus-1/system.d/' dbus = '/etc/dbus-1/system.d/'
desktop = '/usr/share/applications/' desktop = '/usr/share/applications/'
backends= '/usr/lib/wicd/backends/'
translations = '/usr/share/locale/' translations = '/usr/share/locale/'
icons = '/usr/share/icons/hicolor/' icons = '/usr/share/icons/hicolor/'
autostart = '/etc/xdg/autostart/' autostart = '/etc/xdg/autostart/'
@@ -42,6 +41,9 @@ docdir = '/usr/share/doc/wicd/'
mandir = '/usr/share/man/' mandir = '/usr/share/man/'
kdedir = '/usr/share/autostart/' kdedir = '/usr/share/autostart/'
# FILES
# python begins the file section
python = '/usr/bin/python' python = '/usr/bin/python'
pidfile = '/var/run/wicd/wicd.pid' pidfile = '/var/run/wicd/wicd.pid'
# stores something like other/wicd # stores something like other/wicd
@@ -49,6 +51,9 @@ pidfile = '/var/run/wicd/wicd.pid'
initfile = 'init/debian/wicd' initfile = 'init/debian/wicd'
# stores only the file name, i.e. wicd # stores only the file name, i.e. wicd
initfilename = 'wicd' initfilename = 'wicd'
# BOOLEANS
no_install_init = False no_install_init = False
no_install_man = False no_install_man = False
no_install_kde = False no_install_kde = False