1 ;; enwc-setup.el - Setup routines for ENWC
3 ;; Copyright (C) 2012,2013 Free Software Foundation, Inc.
6 ;; Keywords: enwc, network, wicd, manager, nm
8 ;; This file is part of ENWC
10 ;; ENWC is free software; you can redistribute it and/or modify it
11 ;; under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 3, or (at your option)
15 ;; ENWC is distributed in the hope that it will be useful, but WITHOUT
16 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17 ;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
18 ;; License for more details.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with ENWC; see the file COPYING. If not, write to the Free
22 ;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
30 (defun enwc-setup-backend (cur-back)
31 "Sets up ENWC to use the correct function for the backend CUR-BACK."
32 (let ((sym-name (symbol-name cur-back)))
33 (setq enwc-scan-func (intern (concat "enwc-"
36 enwc-get-nw-func (intern (concat "enwc-"
39 enwc-get-wireless-nw-prop-func (intern (concat "enwc-"
41 "-get-wireless-network-property"))
42 enwc-get-wireless-nw-props-func (intern (concat "enwc-"
44 "-get-wireless-nw-props"))
45 enwc-details-list (symbol-value (intern (concat "enwc-"
48 enwc-get-encryption-type-func (intern (concat "enwc-"
50 "-get-encryption-type"))
51 enwc-wireless-connect-func (intern (concat "enwc-"
54 enwc-get-current-nw-id-func (intern (concat "enwc-"
56 "-get-current-nw-id"))
57 enwc-check-connecting-func (intern (concat "enwc-"
60 enwc-get-wired-profiles-func (intern (concat "enwc-"
62 "-get-wired-profiles"))
63 enwc-is-wired-func (intern (concat "enwc-"
66 enwc-wired-connect-func (intern (concat "enwc-"
69 enwc-wired-disconnect-func (intern (concat "enwc-"
72 enwc-get-sec-types-func (intern (concat "enwc-"
75 enwc-get-ip-addr-func (intern (concat "enwc-"
78 enwc-get-netmask-func (intern (concat "enwc-"
81 enwc-get-gateway-func (intern (concat "enwc-"
84 enwc-get-dns-func (intern (concat "enwc-"
87 enwc-get-nw-info-func (intern (concat "enwc-"
90 enwc-save-nw-settings-func (intern (concat "enwc-"
94 (funcall (intern (concat "enwc-" sym-name "-setup")))))
98 This setups ENWC and confirms that one of the backends can be found
100 (setq global-mode-string (append global-mode-string
101 '(enwc-display-string)))
102 (run-at-time t 1 'enwc-update-mode-line)
105 (back-list enwc-backends))
106 (while (and back-list (not cur-back))
107 (setq cur-back (pop back-list))
108 (if (not (dbus-ping :system
109 (symbol-value (intern (concat "enwc-"
110 (symbol-name cur-back)
112 (setq cur-back nil)))
114 (enwc-setup-backend cur-back)
115 (error "No usable backend found."))))
117 (provide 'enwc-setup)