Commit Graph

9413 Commits

Author SHA1 Message Date
Thomas Haller
40562b0aa5 trivial: rename field to give it a unique name
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-20 21:51:04 +01:00
Jiří Klimeš
07adfe4de4 cli: fix TAB-completion and 'goto' after saving connection
On 'save' we replace settings in the local connection, so we also need to
update stored setting pointers.
2014-01-20 17:38:11 +01:00
Dan Williams
f36bfd2039 trivial: remove stray '\' 2014-01-17 10:55:46 -06:00
Dan Williams
4478d86ea8 trivial: fix variable shadowing 2014-01-17 10:26:42 -06:00
Dan Winship
94c29932e2 tui: fix build 2014-01-16 14:54:39 -05:00
Thomas Haller
177c767320 core/platform: fix wrong calculation of address lifetime/preferred for kernel addresses
When receiving an IPv4/IPv6 address from the kernel, platform set the
timestamp to an invalid value before. The address timestamp must be set
to *now*, because the lifetime and preferred arguments are counting from
now.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-16 20:44:29 +01:00
Dan Winship
e9fe63cdaa trivial: annotate/adjust some code to appease Coverity 2014-01-16 14:23:45 -05:00
Dan Winship
a7249cc619 core: fix a possible crash if given an empty IP4 config
update_system_hostname() was bailing out if (there is no IP4 config or
the IP4 config has no addresses) AND (there is no IP6 config or the
IP6 config has no addresses), but it would then hit an assertion and
crash if there was a valid IP6 config along with an IP4 config with no
addresses. Fix that and get rid of some redundancy.

Sort of pointed out by Coverity.
2014-01-16 14:23:45 -05:00
Jiří Klimeš
577d5ef324 libgsystem: update libgsystem to latest master
Fix for compilation with GLib 2.32.
2014-01-16 18:04:27 +01:00
Jiří Klimeš
68fe50ff3a examples: add an python example (using GI) getting device IPs 2014-01-16 17:37:16 +01:00
Jiří Klimeš
7ffbbae3a0 libnm-glib; fix introspection annotations so that <ipv6>.get_address() worked
Without the correct annotation, the functions didn't work correctly in Python
(causing segmentation fault).
2014-01-16 17:37:16 +01:00
Thomas Haller
e18da9f6ae libndp: update libndp
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-16 15:41:57 +01:00
Thomas Haller
bde2ba3371 gsystem: update libgsystem
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-16 15:41:26 +01:00
Dan Winship
86e14fd6a9 tui: various fixes
https://bugzilla.gnome.org/show_bug.cgi?id=720844
2014-01-16 09:19:07 -05:00
Dan Winship
46ef9029bc tui: fix activation of "new" Wi-Fi networks
When activating a never-before-used Wi-Fi network, we need to call
nm_client_add_and_activate_connection(), not
nm_client_activate_connection(). (We still pass a NULL connection,
since NM will attempt to auto-fill it for us, and will succeed as long
as it's not an 802.1x connection.)
2014-01-16 09:19:07 -05:00
Dan Winship
64cb43b3b2 tui: add nmt_newt_text_width()
We were using g_utf8_strlen() to measure strings for layout, but that
counts combining marks too, and also fails to deal with "fullwidth"
(ie, double-width) CJK characters.

Add a new utility function to do a better job of this (based on code
from vte), and use it everywhere.
2014-01-16 09:19:07 -05:00
Dan Winship
1d40b9f872 tui: implement deactivation in "nmtui connect" 2014-01-16 09:19:07 -05:00
Dan Winship
0fe46a5839 tui: reorganize "nmtui connect" code
Make NmtConnectConnectionList just a dumb connection list, and have
the actual connecting code be in nmtui-connect.c
2014-01-16 09:19:06 -05:00
Dan Winship
c0663e42d0 tui: correctly return errors from NmtSecretAgent 2014-01-16 09:19:06 -05:00
Dan Winship
4c0ac46a99 libnm-util: add a missing GValue transform needed by nmtui 2014-01-16 09:19:06 -05:00
Dan Winship
c1017d04df tui: rename nmt_newt_error_dialog() to nmt_newt_message_dialog() 2014-01-16 09:19:06 -05:00
Dan Winship
eb9cd6da08 tui: reorganize the main dialog
"Cancel" didn't really make sense here, but changing it to "Quit" is
also weird because if you were going to use the "OK" button you'd have
to tab past "Quit" first... So make it be an option in the menu
instead.
2014-01-16 09:19:06 -05:00
Dan Winship
867c3cdae0 tui: fix the error-on-startup cases 2014-01-16 09:19:06 -05:00
Dan Winship
ed6b8f8c1d tui: localize startup/usage-related strings 2014-01-16 09:19:06 -05:00
Dan Winship
bbb416a6a7 tui: error out if NM is not running 2014-01-16 09:19:06 -05:00
Dan Winship
034d812433 tui: don't pop up a dialog on g_log messages
Unless NMTUI_DEBUG is set, don't pop up a dialog when a
g_warning/critical/etc occurs. Just hide the main screen briefly so
the error doesn't get printed over the UI, and restore it after; any
messages that get logged will be visible after nmtui exits.
2014-01-16 09:19:06 -05:00
Dan Winship
9c8845c35d tui: don't bother making links (nmtui-edit, etc) in build tree
They end up not working right from the build tree anyway, because the
nmtui libtool wrapper doesn't pass its argv[0] on to the actual
binary.
2014-01-16 09:19:06 -05:00
Dan Winship
8c12177f78 tui: don't center the buttons in a button box
Since we can't align buttons to half-character positions, they end up
looking more random than centered:

  |   <Add>   |
  | <Edit...> |
  | <Delete>  |

So just let them be left-aligned instead. It looks better.
2014-01-16 09:19:06 -05:00
Dan Winship
33d544f472 tui: fix keyboard focus problem
The keyboard focus was getting reset to the first widget any time a
widget changed validity, because the form wasn't updating priv->focus
when it should have.
2014-01-16 09:19:06 -05:00
Jiří Klimeš
d3170f3f1b trivial: fix typo in man page 2014-01-16 09:55:48 +01:00
Jiří Klimeš
080b3a43b5 man: update nmcli-examples manual page 2014-01-15 17:40:02 +01:00
Jiří Klimeš
55a92f826b man: update and define logging domains in NetworkManager.conf manual page 2014-01-15 17:40:02 +01:00
Thomas Haller
f027c4ad0e core: reset auto-retry counter when a connection gets updated
This restores the behaviour, that was removed in commit
e299d7b30f.

https://bugzilla.redhat.com/show_bug.cgi?id=1040528

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-15 17:01:53 +01:00
Thomas Haller
0cdd4ada5b core: add signal CONNECTION_UPDATED_BY_USER to NMSettings
This forwards the signal UPDATED_BY_USER received from one of their
NMConnection.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-15 17:01:53 +01:00
Thomas Haller
85f3da8351 core: emit UPDATED_BY_USER signal when reloading connection from file
Now UPDATED_BY_USER signal gets emitted immediately after the connection
is updated, rather then only after it is successfully saved.

This means, that the signal will be emitted earlier then before (right
after changing the connection, but before it gets commited).
Furthermore, the signal will also be emitted for connections that
get changed but are not to be saved.

Currently, the only subscriber to this signal is NMSettings
(default_wired_connection_updated_by_user_cb), which should be fine with
this change of semantics (even better).

https://bugzilla.redhat.com/show_bug.cgi?id=1040528

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-15 17:01:53 +01:00
Thomas Haller
22cbc77bae core: trivial rename NMSettings signal dbus-updated to updated-by-user
https://bugzilla.redhat.com/show_bug.cgi?id=1040528

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-15 17:01:53 +01:00
Thomas Haller
ff6315cbab libnm-util: only emit one CHANGED signal when adding several settings
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-15 17:01:53 +01:00
Thomas Haller
123bf9eea4 libnm-util: raise CHANGED signal in nm_connection_update_secrets only on change
This changes behaviour of nm_connection_update_secrets() in that it will
now return %TRUE, if there are no secrets to be cleared. Seems more
correct, to return success if there is nothing to do.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-15 17:01:53 +01:00
Thomas Haller
0f38213129 libnm-util: raise CHANGED signal in nm_connection_clear_secrets only on change
Often, nm_connection_clear_secrets does have no consequences, because
there is nothing to be cleared. Only raise a signal, if something
actually changed.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-15 17:01:53 +01:00
Jiří Klimeš
f53f39847a libnm-glib: add NMActiveConnection:vpn property
It is mainly useful for GObject introspection users helping them to find out
whether the connection is VPN easier.
2014-01-15 13:10:42 +01:00
Yuri Chornoivan
06f8b577ad po: update Ukrainian (uk) translation (bgo #722130)
https://bugzilla.gnome.org/show_bug.cgi?id=722130

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-13 21:31:06 +01:00
Christian Kirbach
68575ee30d po: update German (de) translation (bgo #722061)
https://bugzilla.gnome.org/show_bug.cgi?id=722061

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-13 17:35:25 +01:00
Thomas Haller
4dd6ab8f4b libnl-util: refactor nm_utils_ip4_prefix_to_netmask/netmask_to_prefix
- use a more efficient implementation for prefix_to_netmask
- fix netmask_to_prefix to behave consistently in case of
  invalid netmask
- remove unused duplicated functions from NetworkManagerUtils.c
- add test functions

Based-on-patch-by: Pavel Šimerda <psimerda@redhat.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
Related: https://bugzilla.gnome.org/show_bug.cgi?id=721771
2014-01-10 13:34:57 -06:00
Jiří Klimeš
a6432ef4d1 cli: fix printing error on incorrect 'nmcli -f blah dev show'
Don't print extra empty lines before the error.
2014-01-10 13:21:27 +01:00
Thomas Haller
446516bcfa cli/bash-completion: trivial rename of functions
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-10 12:12:13 +01:00
Thomas Haller
e59be00d93 cli/bash-completion: add second level help option
Commands now support help at the second level. Add completion for it.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-10 12:12:13 +01:00
Thomas Haller
b4d9958b76 cli/bash-completion: only complete active connections for nmcli con down
Only complete the ids/uuids for active connections in
`nmcli connection down <type> <TAB>`.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-10 12:12:13 +01:00
Thomas Haller
8c659b79ed cli/bash-completion: cleanup/refactor by making functions generic
Instead of having several bash functions that return some values
via nmcli, add few functions that accept parameters.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-10 12:12:13 +01:00
Thomas Haller
aa931ab1f2 cli/bash-completion: fix wrong completion for nmcli device wimax
wimax does not support these arguments. This was a copy&paste error from wifi.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-10 12:11:43 +01:00
Thomas Haller
630a1ccbce cli/bash-completion: remove not yet implemented device type 'adsl'
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-10 11:10:03 +01:00