After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 720844 - branch review: danw/tui (misc nmtui updates)
branch review: danw/tui (misc nmtui updates)
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: nmtui
git master
Other Linux
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-12-20 18:44 UTC by Dan Winship
Modified: 2014-01-27 20:43 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Dan Winship 2013-12-20 18:44:39 UTC
f5b2c8f tui: fix keyboard focus problem

  You aren't necessarily expected to figure out how/why this one works,
  but if you wanted to test it, open a connection with static IPs, and
  delete the last octet from an IP address; the cursor will jump back
  up to "Profile name". This fixes that.

696bd6c tui: don't center the buttons in a button box

  Just an aesthetic thing, and the patch should make sense because
  NmtNewt's geometry management is more-or-less like gtk's.

bef613d tui: don't bother making links (nmtui-edit, etc) in build tree

  "./nmtui-edit" from the build tree worked in my old nmtui repo (which
  didn't use libtool), but now it just does the same thing as "./nmtui",
  so there's no point in having it

99b3e99 tui: don't pop up a dialog on g_log messages

  g_warnings, etc, don't interact well with newt, because they write
  over the UI and mess up newt's internal cursor-position data, etc.
  My original fix was to intercept them and have them pop up dialog boxes
  (which is great because you can then attach gdb up go up a few frames
  to see exactly where the warning occurred), but this isn't very user-
  friendly, so this turns that behavior off by default (while still fixing
  the "warnings write over the UI" problem).

3d8863b tui: error out if NM is not running
6948b94 tui: localize startup/usage-related strings

  These should be pretty obvious

1d8b16d tui: fix the error-on-startup cases

  Misc fixes... apparently I'd only tested the non-error cases...

46dc525 tui: reorganize the main dialog

  More aesthetics...

4b16ed3 tui: rename nmt_newt_error_dialog() to nmt_newt_message_dialog()

  API aesthetics

cee5ef7 libnm-util: add a missing GValue transform needed by nmtui

  libnm-util defined a G_TYPE_STRV to G_TYPE_SLIST conversion, but
  not vice versa.

c2e3654 libnm-util, libnm-glib: add device/connection describing functions
9e2db63 tui: use the new libnm-util/libnm-glib device/connection utils

  This is the most major / most NetworkManager-as-a-whole-impacting
  patch in the series. This imports the stuff I added to libnm-gtk
  last year so gnome-shell and gnome-control-center could share some
  of nm-applet's code. We'll eventually want to port all of them to
  the new libnm-glib versions and remove the libnm-gtk ones.

75ff866 tui: correctly return errors from NmtSecretAgent

  Fixes return-if-fails when, eg, trying to activate a VPN

09d6bd2 tui: reorganize "nmtui connect" code
4754418 tui: implement deactivation in "nmtui connect"

  This is the last bit of functionality that was supposed to have been
  part of the initial nmtui release but wasn't.
Comment 1 Thomas Haller 2014-01-03 23:15:55 UTC
(In reply to comment #0)
> 4b16ed3 tui: rename nmt_newt_error_dialog() to nmt_newt_message_dialog()
> 
>   API aesthetics

Minor note, in general, could you write in the commit message something like:

 tui/trivial: rename...

(after being sure, that it's really a ~trivial~ rename)
Comment 2 Thomas Haller 2014-01-04 00:09:20 UTC
(In reply to comment #0)
> 4754418 tui: implement deactivation in "nmtui connect"
> 
>   This is the last bit of functionality that was supposed to have been
>   part of the initial nmtui release but wasn't.


+         activate = _("Activate");
+         activate_len = g_utf8_strlen (activate, -1);
+         deactivate = _("Deactivate");
+         deactivate_len = g_utf8_strlen (deactivate, -1);
+
+         activate_padding = MAX (0, deactivate_len - activate_len);
+         deactivate_padding = MAX (0, activate_len - deactivate_len);

Is this really correct? First, g_utf8_strlen counts Unicode code-points, which is not correct in the presense of combining characters.

Then, some Unicode characters, are wider in the terminal then normal letters (for example "汉字" is as wide as "xxx" -- at least in my terminal).

But since I don't know a better solution, it's maybe good enough.
Comment 3 Dan Winship 2014-01-06 17:50:17 UTC
(In reply to comment #2)
> Is this really correct? First, g_utf8_strlen counts Unicode code-points, which
> is not correct in the presense of combining characters.
> 
> Then, some Unicode characters, are wider in the terminal then normal letters
> (for example "汉字" is as wide as "xxx" -- at least in my terminal).
> 
> But since I don't know a better solution, it's maybe good enough.

Mmmm... you're right. I'll have to define "nmt_newt_strlen()" or something to deal with that. But anyway, using g_utf8_strlen() is consistent with the rest of the code, and this will get fixed along with the other cases later...
Comment 4 Dan Winship 2014-01-16 14:21:41 UTC
I pushed everything except the libnm-util/libnm-glib API changes
Comment 5 Thomas Haller 2014-01-17 20:10:26 UTC
I pushed two commits and a !fixup on top of your branch.
Comment 6 Dan Williams 2014-01-21 15:20:33 UTC
thaller's fixups look good.

For nm_connection_get_device_name(), could we perhaps rename that to something like nm_connection_get_virtual_device_description() or nm_connection_get_virtual_device_display_name() or something like that?  To me, _get_device_name() sounds like it's returning a functional setting property.

Other than that, +1.
Comment 7 Dan Winship 2014-01-27 20:43:17 UTC
ok, took thaller's fixes and dcbw's renaming suggestion, and then also made a few of the new methods static, since nothing was using the corresponding libnm-gtk versions yet, so let's not export them until/unless we need them.