summaryrefslogtreecommitdiff
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* libnm-core, libnm, core: make NMConnection an interfaceDan Winship2014-08-163-3/+3
| | | | | | | | | | | | | | | | | | | | | | The fact that NMRemoteConnection has to be an NMConnection and therefore can't be an NMObject means that it needs to reimplement bits of NMObject functionality (and likewise NMObject needs some special magic to deal with it). Likewise, we will need a daemon-side equivalent of NMObject as part of the gdbus port, and we would want NMSettingsConnection to be able to inherit from this as well. Solve this problem by making NMConnection into an interface, and having NMRemoteConnection and NMSettingsConnection implement it. (We use some hacks to keep the GHashTable of NMSettings objects inside nm-connection.c rather than having to be implemented by the implementations.) Since NMConnection is no longer an instantiable type, this adds NMSimpleConnection to replace the various non-D-Bus-based uses of NMConnection throughout the code. nm_connection_new() becomes nm_simple_connection_new(), nm_connection_new_from_hash() becomes nm_simple_connection_new_from_hash(), and nm_connection_duplicate() becomes nm_simple_connection_new_clone().
* libnm: port NMRemoteSettings to NMObjectDan Winship2014-08-071-88/+17
| | | | | | | | | | | | | | | | | | | NMRemoteSettings duplicates a bunch of NMObject's functionality that it doesn't need to. In libnm-glib, it wouldn't have been possible to port NMRemoteSettings to NMObject without breaking ABI, but now in libnm we can do that. As a side effect of this, NMRemoteSettings gains a "connections" property, and "connection-added" and "connection-removed" signals (with the former replacing the old "new-connection" signal). This also removes the "connections-loaded" signal, since the connections will now always be loaded (via the initialization of the "connections" property) during init()/init_async(). Also, this removes NMRemoteConnection's "removed" signal, since it's redundant with the new NMRemoteSettings::connection-removed (and having the signal on NMRemoteSettings instead is more consistent with other objects).
* libnm: synchronize NMClient and NMRemoteSettings "is NM running" propertiesDan Winship2014-08-071-1/+1
| | | | | Rename NMClient:manager-running and NMRemoteSettings:service-running to both be :nm-running.
* libnm: add NetworkManager.h, disallow including individual headersDan Winship2014-08-016-31/+6
| | | | | | | | | | Add NetworkManager.h, which includes all of the other NM header, and require all external users of libnm to use that rather than the individual headers. (An exception is made for nm-dbus-interface.h, nm-vpn-dbus-interface.h, and nm-version.h, which can be included separately.)
* libnm: rename NetworkManager.h and NetworkManagerVPN.hDan Winship2014-08-019-14/+14
| | | | | | | "NetworkManager.h"'s name (and non-standard capitalization) suggest that it's some sort of high-level super-important header, but it's really just low-level D-Bus stuff. Rename it to "nm-dbus-interface.h" and likewise "NetworkManagerVPN.h" to "nm-vpn-dbus-interface.h"
* libnm: make the the use of GInitable mandatoryDan Winship2014-08-017-18/+21
| | | | | | | | | | | Remove _nm_object_ensure_inited(), etc; objects that implement GInitable are now mandatory-to-init(). Remove constructor() implementations that sometimes return NULL; do all the relevant checking in init() instead. Make nm_client_new() and nm_remote_settings_new() take a GCancellable and a GError**.
* libnm: consistently use "INTERFACE" rather than "IFACE" in macrosDan Winship2014-08-016-8/+8
| | | | | | Most D-Bus interface name macros used "INTERFACE" in their name (eg, NM_DBUS_INTERFACE), but a few used "IFACE" instead (eg, NM_DBUS_IFACE_SETTINGS). Make them consistent.
* all: port everything to libnmDan Winship2014-08-0118-92/+79
| | | | | | | | | | | Since the API has not changed at this point, this is mostly just a matter of updating Makefiles, and changing references to the library name in comments. NetworkManager cannot link to libnm due to the duplicated type/symbol names. So it links to libnm-core.la directly, which means that NetworkManager gets a separate copy of that code from libnm.so. Everything else links to libnm.
* build: more srcdir!=builddir fixesDan Winship2014-07-151-1/+0
| | | | | | | | nm-version.h was getting disted, making srcdir!=builddir work for tarball builds, but not for git builds. Also, remove "-I${top_builddir}/include" from all Makefile.ams, since there's nothing generated in include/ any more.
* libnm-util: move NetworkManager.h, etc, from include/ to hereDan Winship2014-07-151-2/+2
| | | | | | | | NetworkManager.h, NetworkManagerVPN.h, and nm-version.h are part of the libnm-util API, so move them to libnm-util. include/ still contains headers that are strictly NM-internal (eg, nm-glib-compat.h).
* examples: add Python dbus example indicating if WWAN is the default connectionDan Williams2014-06-202-1/+80
|
* examples: add Python D-Bus and GI examples for updating IPv4 setting methodDan Williams2014-06-104-2/+182
|
* examples: fix get-active-connections-dbus-glib.c exampleJiří Klimeš2014-06-091-45/+18
|
* libnm-glib: don't use deprecated nm_access_point_get_hw_address()Thomas Haller2014-06-071-1/+1
| | | | | | | | | nm_access_point_get_hw_address() is already deprecated since pre-0.9.0-beta3 (f30e15a04d56a922f50e20c3c155a452d635a187). However, it also is defined as NM_DEPRECATED_IN_0_9_10, because there are no deprecated macros for previous version. Signed-off-by: Thomas Haller <thaller@redhat.com>
* all: g_type_init() has been deprecated in GLib 2.35.0Jiří Klimeš2014-05-279-0/+18
| | | | | g_type_init() deprecation: https://bugzilla.gnome.org/show_bug.cgi?id=686161
* examples: update 70-wifi-wired-exclusive.sh (bgo #513488)Dan Williams2014-04-281-20/+9
| | | | | | | | | | Tighten up with suggestions from Johannes Buchner and mention his contribution. Also fixes operation with current nmcli since it changed from "802-3-ethernet" -> "ethernet" and thus the script was broken. https://bugzilla.gnome.org/show_bug.cgi?id=513488
* examples: fix qt demo to work without STL supportThomas Haller2014-04-041-2/+2
| | | | | | | | | | | | | | | | The function toStdString() is only available when QT was compiled with STL support. The configure script does not check STL support and might build the QT examples even if toStdString() is not available. Fix this, by not using the function. This fixes the previous commit f73e3669b3bb9b3547173896dcea8e2eb17d30ec that I pushed accidentally. https://bugzilla.gnome.org/show_bug.cgi?id=727608 Signed-off-by: Thomas Haller <thaller@redhat.com>
* examples: fix qt demo to work without STL supportThomas Haller2014-04-041-2/+2
| | | | | | | | | | | | | The function toStdString() is only available when QT was compiled with STL support. The configure script does not check STL support and might build the QT examples even if toStdString() is not available. Fix this, by not using the function. https://bugzilla.gnome.org/show_bug.cgi?id=727608 Signed-off-by: Thomas Haller <thaller@redhat.com>
* examples: use correct Mbit/s for bitratesJiří Klimeš2014-04-011-2/+2
|
* examples: fix Makefile.am to include all Python examples for distributionJiří Klimeš2014-03-071-1/+1
|
* example: simplify get-active-connections.py by using ID and Type propertiesJiří Klimeš2014-03-051-16/+3
|
* examples: add a GOI Python example for getting active connectionsJiří Klimeš2014-03-032-1/+49
|
* examples: also print type of active connectionsJiří Klimeš2014-03-031-1/+1
|
* examples: a Python GOI example for adding connections persistent vs. not savedJiří Klimeš2014-01-242-1/+103
|
* examples: update get_ips.py python example for DNS informationJiří Klimeš2014-01-231-4/+40
|
* examples: add an python example (using GI) getting device IPsJiří Klimeš2014-01-162-1/+129
|
* docs: update documentation linksWilliam Jon McCann2013-12-173-3/+3
| | | | Various GNOME services moved around so links need updating.
* examples: update examples for new device typesJiří Klimeš2013-11-293-2/+16
|
* coverity: fix various warnings detected with CoverityThomas Haller2013-11-131-5/+11
| | | | | | | | | | | | | These are (most likely) only warnings and not severe bugs. Some of these changes are mostly made to get a clean run of Coverity without any warnings. Error found by running Coverity scan https://bugzilla.redhat.com/show_bug.cgi?id=1025894 Co-Authored-By: Jiří Klimeš <jklimes@redhat.com> Signed-off-by: Thomas Haller <thaller@redhat.com>
* core: cleanup freeing of glib collections of pointersThomas Haller2013-10-221-2/+2
| | | | | | | | | | | | | | | | When freeing one of the collections such as GArray, GPtrArray, GSList, etc. it is common that the items inside the connections must be freed/unrefed too. The previous code often iterated over the collection first with e.g. g_ptr_array_foreach and passing e.g. g_free as GFunc argument. For one, this has the problem, that g_free has a different signature GDestroyNotify then the expected GFunc. Moreover, this can be simplified either by setting a clear function (g_ptr_array_set_clear_func) or by passing the destroy function to the free function (g_slist_free_full). Signed-off-by: Thomas Haller <thaller@redhat.com>
* examples: add an python example (using GI) showing Wi-Fi networksJiří Klimeš2013-09-262-1/+75
|
* examples: use GLib.MainLoop instead of deprecated GObject.MainLoop in pythonJiri Popelka2013-09-243-6/+6
| | | | | jklimes: made the change for new firewall-zone.py example as well.
* examples: group python examples - dbus vs. giJiří Klimeš2013-09-2416-14/+17
| | | | | Move examples using dbus-python ('dbus' module) and GObject introspection into their own directories.
* examples: add a python example getting/setting zone property using GIJiří Klimeš2013-09-242-1/+89
|
* build: switch from $(INCLUDES) to $(AM_CPPFLAGS) to make automake happyDan Winship2013-08-222-9/+7
| | | | | | | | | | | | | Unfortunately, $(AM_CPPFLAGS) gets overridden by per-target _CPPFLAGS variables, which $(INCLUDES) did not, so this requires some additional changes. In most places, I have just gotten rid of the per-target _CPPFLAGS variables; in directories with a single target, the per-target variable is unnecessary, and in directories with multiple targets, the per-target variable is often undesirable, since it forces some files to be compiled twice, even though there ends up being no difference between the two files.
* trivial: minor code cleanup in examples/pythonThomas Haller2013-08-063-7/+7
| | | | | | | There where cases, where TAB was mixed with SPACES. Replace TAB with SPACES. Additionally, make the script nm-state.py executable Signed-off-by: Thomas Haller <thaller@redhat.com>
* examples: update 70-wifi-wired-exclusive.sh for new nmcli syntaxJiří Klimeš2013-07-151-2/+4
|
* trivial: add gitignore for qt examplesPavel Šimerda2013-04-291-0/+2
|
* libnm-util: Fix transfer annotations of nm_{connection,setting}_need_secrets()Martin Pitt2013-04-191-4/+2
| | | | | | | | | | | The various need_secrets() implementation do allocate a fresh GPtrArray, but add static strings to them without dup'ing. Thus callers must _not_ free the array elements, only the array itself. Adjust documentation and annotations accordingly. Also adjust the corresponding comment in the goi-list-connections.py example. https://bugzilla.gnome.org/show_bug.cgi?id=698175
* all: use G_VALUE_INIT to initialize GValue variablesJiří Klimeš2013-03-251-3/+3
| | | | | It makes the initializations more explicit. G_VALUE_INIT is available since glib 2.30, and NM now require glib >= 2.32
* examples: remove GLIB_CHECK_VERSION checks from GDBus examplesDan Winship2013-02-262-12/+0
|
* examples: fix nm-state.py exampleJiří Klimeš2012-12-071-3/+18
|
* cli/examples: NM_802_11_MODE_AP mode is not valid for NMAccessPoint objectsJiří Klimeš2012-11-011-1/+0
|
* build: clean up GLib-related pkg-config usage (bgo #687218)Colin Walters2012-10-311-2/+2
| | | | | | | | | | | | | | | | | | | | | | We had separate checks for glib-2.0, gobject-2.0, gmodule-2.0, and gio-unix-2.0. It doesn't make sense to link a binary against all 4 because gio-unix-2.0 depends on glib-2.0 and gobject-2.0. Doing this actually breaks things in unusual circumstances. Generally, few bits of NM actually just use glib, and not gio. We might as well coalesce those requirements together, even if it means in some cases we "overlink". Additionally, I chose for now to fold gmodule-2.0 in as well, even though many fewer programs need it. The cost of overlinking is quite small. The benefit of this is less repeated junk in Makefile.am, as well as more centralized control over GLib. A followup patch will allow us to set -DGLIB_VERSION_MIN_REQUIRED in just one place, rather than having to replicate it 4 times. The NM configure is still suboptimal - for example, libpolkit-1 depends on gio-2.0, so really we should determine the compiler flags all in one pass. But it doesn't matter too much for now.
* wifi: support ap-mode with wpa_supplicantJan Luebbe2012-10-171-1/+4
| | | | | | | | | | A new value for NM80211Mode is introduced (NM_802_11_MODE_AP) and the new mode is passed to wpa_supplicant analogous to adhoc-mode. The places which need to know the interface mode have been extended to handle the new mode. If the configuration does not contain a fixed frequency, a channel is selected the same way as with adhoc-mode before.
* examples: fix python example file names in EXTRA_DISTJiří Klimeš2012-09-241-1/+2
|
* examples: fix add-system-connection.py -> add-connection.py renameJiří Klimeš2012-09-241-1/+1
| | | | | It fixes 'make dist' that fails otherwise. Found by pavlix.
* examples: add dispatcher example for exclusive wired/wifiDan Williams2012-09-203-1/+31
|
* examples: add a shell example listing active Wi-Fi networks on Wi-Fi devicesJiří Klimeš2012-09-032-1/+90
|
* examples: add a shell example for disconnecting devicesJiří Klimeš2012-08-312-1/+80
|