Commit graph

37 commits

Author SHA1 Message Date
Dan Winship
fae47c1916 tui: don't expand editor form to fullscreen horizontally
The form doesn't make use of the extra horizontal space, so it looks
bad to expand it rather than centering it.
2014-02-17 15:30:04 -05:00
Dan Winship
6ee48dc964 tui: fix flickering with large windows
Use newtPopWindowNoRefresh() rather than newtPopWindow() when
destroying a form, since often we have to destroy and then almost
immediately after re-create the same form, and we don't want that to
be visible.
2014-02-17 15:30:04 -05:00
Dan Winship
5d581b0d08 tui: handle Esc correctly from toplevel windows
The main "connect" and "edit" windows set the "escape-exits" flag, but
that just closed the form without exiting the app, leaving the user
trapped. Fix this by emitting a signal when the form quits, and
catching that. (And now we don't need to watch the "clicked" signal on
the quit buttons, since they have the "exit-on-activate" flag set.)
2014-02-17 15:30:04 -05:00
Dan Winship
12a2d64063 tui: handle Wi-Fi networks with multiple APs correctly 2014-02-17 15:30:04 -05:00
Jiří Klimeš
4401fd4ac7 tui: fix srcdir != builddir build 2014-02-13 18:28:30 +01:00
Jiří Klimeš
de15dafd1b tui: properly initialize InfiniBand transport-mode
We need to initialize transport-mode because default value is NULL,
which is not a valid mode.
2014-02-13 18:28:30 +01:00
Dan Winship
64c5395cb1 build: improve our use of glib's version macros to catch more bugs
We were setting GLIB_VERSION_MAX_ALLOWED to 2.34, since we provide
reimplementations of a few 2.34 functions in nm-glib-compat.h. But
this was turning off warnings for the 2.34+ APIs we *didn't* have
compat versions of too.

Fix this by setting MAX_ALLOWED to 2.32 (same as MIN_REQUIRED), and
defining macros to wrap calls to compat-ified functions and disable
deprecation warnings around them.

This points out several places where we were accidentally using 2.34
APIs without noticing, which need to be fixed now.
2014-02-13 11:24:37 -05:00
Dan Winship
9c4d86ee80 libnm-util, libnm-glib: add versioned deprecation/availability macros
Add versioned NM_DEPRECATED_IN_* and NM_AVAILABLE_IN_* macros, and tag
new/deprecated functions accordingly. (All currently-deprecated
functions are assumed to have been deprecated in 0.9.10.)

Add NM_VERSION_MIN_REQUIRED and NM_VERSION_MAX_ALLOWED macros which
can be set to determine which versions will cause warnings.

With the current settings, external consumers of the
libnm-util/libnm-glib APIs will have MIN_REQUIRED and MAX_ALLOWED both
set to NM_VERSION_0_9_8 by default, meaning they will get warnings
about functions added in 0.9.10. NM internally sets
NM_VERSION_MAX_ALLOWED to NM_VERSION_NEXT_STABLE to ensure that it is
always allowed to use all APIs.
2014-02-13 11:24:37 -05:00
Dan Winship
aa1b262091 tui: properly initialize the IP4 and IP6 settings on new connections
We need to initialize the methods.
2014-01-30 11:43:15 -05:00
Dan Winship
54dab9caf9 tui: fix a crash when creating a new connection
Make all the signals RUN_FIRST instead of RUN_LAST. In particular,
this fixes a crash when creating a new connection and activating the
listbox directly, in which case nmt_newt_listbox_activated() was
running after NmtAddConnection:create_connection() had already quit
the form and unrealized the listbox.
2014-01-30 11:43:15 -05:00
Thomas Haller
0ee3f23534 tui: use nm_remote_settings_get_connection_by_id()
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-01-27 15:39:51 -05:00
Dan Winship
36ed2e91bb tui: use the new libnm-util/libnm-glib device/connection utils
Use the new methods copied into libnm-util/libnm-glib from libnm-gtk,
and remove nmtui's local copies.
2014-01-27 15:39:51 -05:00
Dan Winship
6c332f33aa tui: add a (void) cast to avoid a coverity warning 2014-01-23 15:04:08 -05: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
Dan Winship
e9fe63cdaa trivial: annotate/adjust some code to appease Coverity 2014-01-16 14:23:45 -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
Dan Winship
eb34d3f3ff tui: remove a workaround for a fixed libnm-glib bug 2013-12-20 11:26:45 -05:00
Dan Winship
b9f1d0b361 tui: remove spare copy of nm-gvaluearray-compat.h
nmtui had its own copy of nm-gvaluearray-compat.h, which is already
available in ../include/
2013-12-20 11:26:28 -05:00
Dan Winship
2940ef7a63 tui: fix the "Device" entry on currently-active virtual devices
Virtual device types can only have an ifname in the "Device" entry,
but the code was accidentally filling in the MAC address too if the
device currently existed (which then made the entry value invalid).
2013-12-17 12:51:18 -05:00
Dan Winship
41ada32127 tui: hide the debugging-related command line options 2013-12-17 12:51:18 -05:00
Dan Winship
250ed1a7dd tui: fix the build so we don't install libtool wrapper scripts
The nmtui development tree didn't use libtool, and the rules that
worked to install links in those Makefiles ended up causing the
libtool wrapper scripts to get installed here. Fix.
2013-12-17 12:51:18 -05:00
Dan Winship
3bda3fb60c nmtui: initial import of nmtui
nmtui is a TUI (curses-based Text User Interface) for NetworkManager
2013-12-13 16:00:51 +01:00