[SCM] Samba Shared Repository - branch master updated

Michael Adam obnox at samba.org
Wed Oct 1 08:56:04 MDT 2014


The branch, master has been updated
       via  fa9630e regedit: remove an old comment
       via  61cc518 regedit: print error msg if opening registry fails
       via  3b80f25 regedit: handle pgup/pgdn/home/end keys on lists
       via  b96c432 regedit: handle del and backspace in hexeditor
       via  3c6541c regedit: grow hexedit buffer as the user types
       via  4badab3 regedit: add a button to resize hexedit buffer
       via  8acb87e regedit: add a number input box
       via  5bbed3d regedit: don't expand single line text field buffer with cursor movement
       via  0076554 regedit: handle DEL key in text fields
       via  58db858 regedit: adjust some variable names to make them more distinct
       via  fd95b0a regedit: find previous items
       via  bcab659 regedit: search values and repeat search from cursor positions
       via  0924517 regedit: flesh out search dialog and simplify search opts
       via  982c06f regedit: don't use subwindows in hexedit
       via  c272178 regedit: use pad as a canvas for dialogs
       via  cc22cb5 regedit: clear value list after creating new key
       via  1b6445a regedit: use the right function to reopen a hive
       via  061d3e9 regedit: move cursor to edited value in list and report edit errors
       via  a728c39 regedit: Introduce a new API to build the dialogs.
       via  30ae8f1 regedit: improvements for hexedit
       via  42df2e6 regedit: add padding to fit REG_MULTI_SZ to the text field
       via  c94c765 regedit: simplify cleanup after loading children
       via  fec275a regedit: add a panic handler to restore terminal
       via  f9a2f2e regedit: make all hives descend from a root node
       via  41d5112 regedit: add a refresh command to clear cache and reload current path
       via  5732d3f regedit: reopen key after editing or removing values
       via  75045f0 regedit: reopen parent keys when adding or removing subkeys
       via  2a8beb9 regedit: set cursor after creating a new key
       via  baf491f regedit: set cursor to the parent node when ascending
       via  aba2b04 regedit: don't fail loading keys if just a few are unavailable
       via  df36fe7 regedit: include error description in popups
       via  0b334dd regedit: notify user if there's a failure loading subkeys
       via  5566251 regedit: handle awkward window sizes better
       via  c85cc6b regedit: use talloc typesafety features
       via  d38eba5 regedit: restore list cursor when window is resized
       via  ec6a7a7 regedit: make value list display data in multiple columns
       via  7ad7536 regedit: add multicolumn list widget
       via  0ab07cb regedit: add search feature.
       via  b8b8350 regedit: add a color scheme for path and context help sections
       via  bd8abef regedit: sort keys
       via  b5d0eb8 regedit: free value list subwindow
       via  c79837c regedit: add borders around key and value lists, and change headings
       via  b48f081 regedit: add padding for key labels when there's not a prefix.
       via  994f1ed regedit: add white on blue color scheme
       via  7e7c649 regedit: silence some warnings
      from  0fbce14 loadparm//init_copymap: Add braces around if/for blocks to match coding style

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit fa9630e368df2446c5893b2fe51bada7a38760aa
Author: Michael Adam <obnox at samba.org>
Date:   Wed Oct 1 11:36:36 2014 +0200

    regedit: remove an old comment
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    
    Autobuild-User(master): Michael Adam <obnox at samba.org>
    Autobuild-Date(master): Wed Oct  1 16:55:05 CEST 2014 on sn-devel-104

commit 61cc5185e5ccf1bb6d1201063ac3a62e3b7fcfbb
Author: Chris Davis <cd.rattan at gmail.com>
Date:   Thu Aug 7 06:17:28 2014 -0700

    regedit: print error msg if opening registry fails
    
    Signed-off-by: Chris Davis <cd.rattan at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit 3b80f256bac0842f4470f9d5361426d7cff88ea9
Author: Chris Davis <cd.rattan at gmail.com>
Date:   Sun Aug 10 18:26:14 2014 -0700

    regedit: handle pgup/pgdn/home/end keys on lists
    
    Signed-off-by: Chris Davis <cd.rattan at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit b96c43219480c442d0264834101e5bee675e3b04
Author: Chris Davis <cd.rattan at gmail.com>
Date:   Sat Aug 9 17:11:00 2014 -0700

    regedit: handle del and backspace in hexeditor
    
    Signed-off-by: Chris Davis <cd.rattan at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit 3c6541c44e2bfca2d1dfb7a971064d2c7143106f
Author: Chris Davis <cd.rattan at gmail.com>
Date:   Sat Aug 9 13:39:59 2014 -0700

    regedit: grow hexedit buffer as the user types
    
    Signed-off-by: Chris Davis <cd.rattan at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit 4badab3a6062a473b9651564ce43bb51c63457c1
Author: Chris Davis <cd.rattan at gmail.com>
Date:   Fri Aug 8 23:55:25 2014 -0700

    regedit: add a button to resize hexedit buffer
    
    Signed-off-by: Chris Davis <cd.rattan at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit 8acb87e42e8004c6a2f04085825fadad3cfbc5b2
Author: Chris Davis <cd.rattan at gmail.com>
Date:   Fri Aug 8 23:36:48 2014 -0700

    regedit: add a number input box
    
    Signed-off-by: Chris Davis <cd.rattan at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit 5bbed3d93dfddb0386401a032dc3321bc7f67e33
Author: Chris Davis <cd.rattan at gmail.com>
Date:   Fri Aug 8 22:25:50 2014 -0700

    regedit: don't expand single line text field buffer with cursor movement
    
    Signed-off-by: Chris Davis <cd.rattan at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit 00765544af53cdfcc6f602b1825f14b97b96beb1
Author: Chris Davis <cd.rattan at gmail.com>
Date:   Fri Aug 8 19:58:03 2014 -0700

    regedit: handle DEL key in text fields
    
    Signed-off-by: Chris Davis <cd.rattan at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit 58db858619339084c86a02fd226eaff0854c730f
Author: Chris Davis <cd.rattan at gmail.com>
Date:   Wed Aug 6 20:15:38 2014 -0700

    regedit: adjust some variable names to make them more distinct
    
    Signed-off-by: Chris Davis <cd.rattan at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit fd95b0aa96067d4c9ce60b73168bf9fe5c95ffac
Author: Chris Davis <cd.rattan at gmail.com>
Date:   Sat Aug 2 17:29:31 2014 -0700

    regedit: find previous items
    
    Signed-off-by: Chris Davis <cd.rattan at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit bcab659516382d5dc51b1558a895a9a26d81c6b8
Author: Chris Davis <cd.rattan at gmail.com>
Date:   Thu Jul 31 23:24:19 2014 -0700

    regedit: search values and repeat search from cursor positions
    
    Recovering the search position from the cursors is safer than retaining
    a pointer to the last node, as the pointer will become invalid if the
    user deletes the item or refreshes the cache.
    
    Signed-off-by: Chris Davis <cd.rattan at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit 09245177a4031fb1a1319071e745f0df10b1ee53
Author: Chris Davis <cd.rattan at gmail.com>
Date:   Wed Jul 30 22:04:50 2014 -0700

    regedit: flesh out search dialog and simplify search opts
    
    Signed-off-by: Chris Davis <cd.rattan at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit 982c06f55a0ef8a80a0f87c9e77200ce952f85b3
Author: Chris Davis <cd.rattan at gmail.com>
Date:   Mon Jul 28 23:23:32 2014 -0700

    regedit: don't use subwindows in hexedit
    
    Signed-off-by: Chris Davis <cd.rattan at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit c272178ccc6bb2f3b4a6621ef463489741c7e040
Author: Chris Davis <cd.rattan at gmail.com>
Date:   Mon Jul 28 23:04:10 2014 -0700

    regedit: use pad as a canvas for dialogs
    
    Drawing in a pad allows the dialog to maintain the same size even when
    the terminal window is shrunk to some awkwardly small size.  It also
    helps avoid hacks needed to update positions of subwindows when the
    panel is moved.
    
    Signed-off-by: Chris Davis <cd.rattan at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit cc22cb5cd44fdcc078211d2b82502ca219b1e928
Author: Chris Davis <cd.rattan at gmail.com>
Date:   Sun Jul 27 17:48:05 2014 -0700

    regedit: clear value list after creating new key
    
    Signed-off-by: Chris Davis <cd.rattan at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit 1b6445ae03521d788bf247eb550d1b51113fc8df
Author: Chris Davis <cd.rattan at gmail.com>
Date:   Sun Jul 27 17:39:06 2014 -0700

    regedit: use the right function to reopen a hive
    
    Signed-off-by: Chris Davis <cd.rattan at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit 061d3e9a66f7f71cc6532fa6b0bcf47bf0fe3e35
Author: Chris Davis <cd.rattan at gmail.com>
Date:   Sat Jul 26 19:49:33 2014 -0700

    regedit: move cursor to edited value in list and report edit errors
    
    Signed-off-by: Chris Davis <cd.rattan at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit a728c391d7d4f6474e37f7118ba6df14dc9da6fd
Author: Chris Davis <cd.rattan at gmail.com>
Date:   Fri Jul 25 23:26:27 2014 -0700

    regedit: Introduce a new API to build the dialogs.
    
    This helps make new dialogs easier to create, because it provides some
    common building blocks and a consistent way to deal with user input.
    
    Dialogs are divided into sections that stack vertically, and common
    sections for typical UI things like text boxes, option lists, and
    buttons are provided.
    
    The old dialogs are rewritten to use this API.
    
    Signed-off-by: Chris Davis <cd.rattan at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit 30ae8f1014122258ff3b9415370fc679675929de
Author: Chris Davis <cd.rattan at gmail.com>
Date:   Fri Jul 25 23:16:52 2014 -0700

    regedit: improvements for hexedit
    
    This mainly enables setting the hexedit buffer after the editor is
    allocated.
    
    Signed-off-by: Chris Davis <cd.rattan at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit 42df2e643f68f5ec19e6a41eade29199a3266035
Author: Chris Davis <cd.rattan at gmail.com>
Date:   Fri Jul 18 13:35:14 2014 -0700

    regedit: add padding to fit REG_MULTI_SZ to the text field
    
    This fixes a bug loading REG_MULTI_SZ values into the editor dialog,
    since ncurses fields don't handle newline characters.
    
    Signed-off-by: Chris Davis <cd.rattan at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit c94c765f01dc145ee7f1abfe1379ed9c923f3d43
Author: Chris Davis <cd.rattan at gmail.com>
Date:   Mon Jul 7 21:30:49 2014 -0700

    regedit: simplify cleanup after loading children
    
    Signed-off-by: Chris Davis <cd.rattan at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit fec275a4a8e9ecd77fb30c4a242a2fe832d9f41c
Author: Chris Davis <cd.rattan at gmail.com>
Date:   Tue Jul 1 16:00:16 2014 -0700

    regedit: add a panic handler to restore terminal
    
    Signed-off-by: Chris Davis <cd.rattan at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit f9a2f2eb7cc3c69f20ab615dd98b750414672fe3
Author: Chris Davis <cd.rattan at gmail.com>
Date:   Mon Jun 30 23:19:53 2014 -0700

    regedit: make all hives descend from a root node
    
    This helps simplify cleanup, since each node's talloc context is the
    parent node, and freeing the root node will destroy the entire tree
    without any extra utility functions.
    
    It also wouldn't be hard to extend this later on to support browsing
    multiple registries at the same time.
    
    Signed-off-by: Chris Davis <cd.rattan at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit 41d5112407d7426d75671ac6967e62b080f63857
Author: Chris Davis <cd.rattan at gmail.com>
Date:   Mon Jun 30 23:14:20 2014 -0700

    regedit: add a refresh command to clear cache and reload current path
    
    This is needed to view changes made externally
    
    Signed-off-by: Chris Davis <cd.rattan at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 5732d3f01284a0080740f1cb69c91cf4893fb401
Author: Chris Davis <cd.rattan at gmail.com>
Date:   Fri Jun 27 19:33:03 2014 -0700

    regedit: reopen key after editing or removing values
    
    Signed-off-by: Chris Davis <cd.rattan at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit 75045f052a5bc00fc8ffe35514c60e2f1611c9e9
Author: Chris Davis <cd.rattan at gmail.com>
Date:   Fri Jun 27 18:01:36 2014 -0700

    regedit: reopen parent keys when adding or removing subkeys
    
    This clears any cache associated with the parent key,
    and ensures the changes will be noticed by the UI.
    
    Signed-off-by: Chris Davis <cd.rattan at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit 2a8beb99a49829adfbad1c887448e3a2caa32255
Author: Chris Davis <cd.rattan at gmail.com>
Date:   Thu Jun 26 07:51:22 2014 -0700

    regedit: set cursor after creating a new key
    
    Signed-off-by: Chris Davis <cd.rattan at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit baf491ff0bdb40520d8a093e5c08c8608ed3075a
Author: Chris Davis <cd.rattan at gmail.com>
Date:   Wed Jun 25 22:51:27 2014 -0700

    regedit: set cursor to the parent node when ascending
    
    Signed-off-by: Chris Davis <cd.rattan at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit aba2b04b6c5584db63d03adab57fe1fd12ee71b4
Author: Chris Davis <cd.rattan at gmail.com>
Date:   Wed Jun 25 22:29:06 2014 -0700

    regedit: don't fail loading keys if just a few are unavailable
    
    Sometimes a key might fail to open due to access restrictions.
    Only report failure if all keys failed to be opened.
    
    Signed-off-by: Chris Davis <cd.rattan at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit df36fe7998fee3fc22976aeb42c25e2a2f0d73c5
Author: Chris Davis <cd.rattan at gmail.com>
Date:   Wed Jun 25 21:55:27 2014 -0700

    regedit: include error description in popups
    
    Signed-off-by: Chris Davis <cd.rattan at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit 0b334dd1911206bac633421e1667052200574d29
Author: Chris Davis <cd.rattan at gmail.com>
Date:   Wed Jun 25 21:48:52 2014 -0700

    regedit: notify user if there's a failure loading subkeys
    
    Signed-off-by: Chris Davis <cd.rattan at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit 55662513e14c026eb4cfa044ed772b31be5d6ab9
Author: Chris Davis <cd.rattan at gmail.com>
Date:   Mon Jun 16 17:36:16 2014 -0700

    regedit: handle awkward window sizes better
    
    This fixes some assertion failures and an infinte loop that occurs
    when the terminal window is shrunk down far enough to the point
    regedit can't fit everything on screen.
    
    Signed-off-by: Chris Davis <cd.rattan at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit c85cc6b8360284c64d60ff4d09ca8d5e03188f7b
Author: Chris Davis <cd.rattan at gmail.com>
Date:   Sat Jun 14 14:13:10 2014 -0700

    regedit: use talloc typesafety features
    
    Signed-off-by: Chris Davis <cd.rattan at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit d38eba5244d0615994249070adee1f3df4c0d4aa
Author: Chris Davis <cd.rattan at gmail.com>
Date:   Wed Jun 11 10:40:38 2014 -0700

    regedit: restore list cursor when window is resized
    
    Signed-off-by: Chris Davis <cd.rattan at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit ec6a7a7335f5b9e3a54b9967563ba198fc67b120
Author: Chris Davis <cd.rattan at gmail.com>
Date:   Tue Jun 10 10:35:19 2014 -0700

    regedit: make value list display data in multiple columns
    
    Signed-off-by: Chris Davis <cd.rattan at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit 7ad75367b2a42225a9f3539172e0b0e320d3a517
Author: Chris Davis <cd.rattan at gmail.com>
Date:   Mon Jun 9 18:29:56 2014 -0700

    regedit: add multicolumn list widget
    
    Widget works for lists with one or more column(s).
    Column headers are optional.
    
    As a test, the patch also modifies regedit to use the
    new widget for viewing registry keys. Valuelist still
    needs to be upgraded to use this.
    
    Signed-off-by: Chris Davis <cd.rattan at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit 0ab07cb8069ae59e45fb0f6016096d30de9b4142
Author: Chris Davis <cd.rattan at gmail.com>
Date:   Mon Jun 2 21:50:01 2014 -0700

    regedit: add search feature.
    
    Open up a search input with '/'. 'x' key gets the next
    result.
    
    This patch also ensures that keys are always sorted, so
    that the search order matches the order the keys appear
    on screen.
    
    TODO:
    	+ flesh out search interface
    	+ find previous
    	+ search values
    
    Signed-off-by: Chris Davis <cd.rattan at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit b8b83509ca080d48530fbde9b012b9c3eb1c42fe
Author: Chris Davis <cd.rattan at gmail.com>
Date:   Thu May 22 15:23:52 2014 -0700

    regedit: add a color scheme for path and context help sections
    
    Signed-off-by: Chris Davis <cd.rattan at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit bd8abef327e68cf1c1fc9c2cf6e0b11738971521
Author: Chris Davis <cd.rattan at gmail.com>
Date:   Wed May 21 17:08:06 2014 -0700

    regedit: sort keys
    
    Signed-off-by: Chris Davis <cd.rattan at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit b5d0eb8ee06908ad8171f71b648c43de6303047b
Author: Chris Davis <cd.rattan at gmail.com>
Date:   Wed May 21 15:03:50 2014 -0700

    regedit: free value list subwindow
    
    Signed-off-by: Chris Davis <cd.rattan at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit c79837c215de59fa07b665bb79149058f36828d7
Author: Chris Davis <cd.rattan at gmail.com>
Date:   Tue May 20 16:17:42 2014 -0700

    regedit: add borders around key and value lists, and change headings
    
    Signed-off-by: Chris Davis <cd.rattan at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit b48f081dc681a0a769165da43668b356c71fdb35
Author: Chris Davis <cd.rattan at gmail.com>
Date:   Mon May 19 17:34:01 2014 -0700

    regedit: add padding for key labels when there's not a prefix.
    
    Signed-off-by: Chris Davis <cd.rattan at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit 994f1ed301e2023f0e4c8afa7429388ea90362e1
Author: Chris Davis <cd.rattan at gmail.com>
Date:   Mon May 19 11:08:09 2014 -0700

    regedit: add white on blue color scheme
    
    Signed-off-by: Chris Davis <cd.rattan at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit 7e7c649376bd17c7ac9908bbd0ffc235e7cd18f7
Author: Chris Davis <cd.rattan at gmail.com>
Date:   Mon Aug 4 21:48:04 2014 -0700

    regedit: silence some warnings
    
    Signed-off-by: Chris Davis <cd.rattan at gmail.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 source3/utils/regedit.c           |  483 +++++--
 source3/utils/regedit.h           |   18 +-
 source3/utils/regedit_dialog.c    | 2738 ++++++++++++++++++++++++++-----------
 source3/utils/regedit_dialog.h    |  204 +++-
 source3/utils/regedit_hexedit.c   |  243 +++-
 source3/utils/regedit_hexedit.h   |   38 +-
 source3/utils/regedit_list.c      |  591 ++++++++
 source3/utils/regedit_list.h      |   82 ++
 source3/utils/regedit_samba3.c    |    4 +-
 source3/utils/regedit_treeview.c  |  552 ++++++--
 source3/utils/regedit_treeview.h  |   29 +-
 source3/utils/regedit_valuelist.c |  401 ++++--
 source3/utils/regedit_valuelist.h |   35 +-
 source3/wscript_build             |    2 +-
 14 files changed, 4125 insertions(+), 1295 deletions(-)
 create mode 100644 source3/utils/regedit_list.c
 create mode 100644 source3/utils/regedit_list.h


Changeset truncated at 500 lines:

diff --git a/source3/utils/regedit.c b/source3/utils/regedit.c
index 21fd257..bff23ec 100644
--- a/source3/utils/regedit.c
+++ b/source3/utils/regedit.c
@@ -25,19 +25,20 @@
 #include "regedit_treeview.h"
 #include "regedit_valuelist.h"
 #include "regedit_dialog.h"
+#include "regedit_list.h"
 #include <ncurses.h>
 #include <menu.h>
 #include <panel.h>
 
 #define KEY_START_X 	0
-#define KEY_START_Y 	3
+#define KEY_START_Y 	1
 #define KEY_WIDTH 	(COLS / 4)
 #define KEY_HEIGHT	(LINES - KEY_START_Y - 2)
 #define VAL_START_X 	KEY_WIDTH
-#define VAL_START_Y 	3
+#define VAL_START_Y 	1
 #define VAL_WIDTH 	(COLS - KEY_WIDTH)
 #define VAL_HEIGHT	(LINES - VAL_START_Y - 2)
-#define HEADING_START_Y	(KEY_START_Y - 1)
+
 #define HELP1_START_Y	(LINES - 2)
 #define HELP1_START_X	0
 #define HELP1_WIDTH	(LINES)
@@ -51,12 +52,14 @@
 #define PATH_WIDTH_MAX	1024
 
 struct regedit {
+	struct registry_context *registry_context;
 	WINDOW *main_window;
 	WINDOW *path_label;
 	size_t path_len;
 	struct value_list *vl;
 	struct tree_view *keys;
 	bool tree_input;
+	struct regedit_search_opts active_search;
 };
 
 static struct regedit *regedit_main = NULL;
@@ -73,6 +76,8 @@ static void show_path(struct regedit *regedit)
 	}
 	copywin(regedit->path_label, regedit->main_window, 0, start_pad,
 		PATH_START_Y, start_win, PATH_START_Y, PATH_MAX_Y, false);
+
+	mvchgat(0, 0, COLS, A_BOLD, PAIR_YELLOW_CYAN, NULL);
 }
 
 static void print_path(struct regedit *regedit, struct tree_node *node)
@@ -81,53 +86,6 @@ static void print_path(struct regedit *regedit, struct tree_node *node)
 	show_path(regedit);
 }
 
-/* load all available hives */
-static struct tree_node *load_hives(TALLOC_CTX *mem_ctx,
-				    struct registry_context *ctx)
-{
-	const char *hives[] = {
-		"HKEY_CLASSES_ROOT",
-		"HKEY_CURRENT_USER",
-		"HKEY_LOCAL_MACHINE",
-		"HKEY_PERFORMANCE_DATA",
-		"HKEY_USERS",
-		"HKEY_CURRENT_CONFIG",
-		"HKEY_DYN_DATA",
-		"HKEY_PERFORMANCE_TEXT",
-		"HKEY_PERFORMANCE_NLSTEXT",
-		NULL
-	};
-	struct tree_node *root, *prev, *node;
-	struct registry_key *key;
-	WERROR rv;
-	size_t i;
-
-	root = NULL;
-	prev = NULL;
-
-	for (i = 0; hives[i] != NULL; ++i) {
-		rv = reg_get_predefined_key_by_name(ctx, hives[i], &key);
-		if (!W_ERROR_IS_OK(rv)) {
-			continue;
-		}
-
-		node = tree_node_new(mem_ctx, NULL, hives[i], key);
-		if (node == NULL) {
-			return NULL;
-		}
-
-		if (root == NULL) {
-			root = node;
-		}
-		if (prev) {
-			tree_node_append(prev, node);
-		}
-		prev = node;
-	}
-
-	return root;
-}
-
 static void print_help(struct regedit *regedit)
 {
 	const char *khelp = "[n] New Key [s] New Subkey [d] Del Key "
@@ -136,8 +94,9 @@ static void print_help(struct regedit *regedit)
 			    "[b] Edit binary";
 	const char *msg = "KEYS";
 	const char *help = khelp;
-	const char *genhelp = "[TAB] Switch sections [q] Quit regedit "
-			      "[UP] List up [DOWN] List down";
+	const char *genhelp = "[TAB] Switch sections [q] Quit "
+			      "[UP] List up [DOWN] List down "
+			      "[/] Search [x] Next";
 	int i, pad;
 
 	if (!regedit->tree_input) {
@@ -147,15 +106,16 @@ static void print_help(struct regedit *regedit)
 
 	move(HELP1_START_Y, HELP1_START_X);
 	clrtoeol();
-	attron(A_REVERSE);
+	attron(COLOR_PAIR(PAIR_BLACK_CYAN));
 	mvaddstr(HELP1_START_Y, HELP1_START_X, help);
 	pad = COLS - strlen(msg) - strlen(help);
 	for (i = 0; i < pad; ++i) {
 		addch(' ');
 	}
-	attron(A_BOLD);
+	attroff(COLOR_PAIR(PAIR_BLACK_CYAN));
+	attron(COLOR_PAIR(PAIR_YELLOW_CYAN) | A_BOLD);
 	addstr(msg);
-	attroff(A_REVERSE | A_BOLD);
+	attroff(COLOR_PAIR(PAIR_YELLOW_CYAN) | A_BOLD);
 
 	move(HELP2_START_Y, HELP2_START_X);
 	clrtoeol();
@@ -164,24 +124,13 @@ static void print_help(struct regedit *regedit)
 
 static void print_heading(struct regedit *regedit)
 {
-	move(HEADING_START_Y, 0);
-	clrtoeol();
-
 	if (regedit->tree_input) {
-		attron(A_REVERSE);
-	} else {
-		attroff(A_REVERSE);
-	}
-	mvprintw(HEADING_START_Y, KEY_START_X, "Key");
-	attroff(A_REVERSE);
-
-	if (!regedit->tree_input) {
-		attron(A_REVERSE);
+		tree_view_set_selected(regedit->keys, true);
+		value_list_set_selected(regedit->vl, false);
 	} else {
-		attroff(A_REVERSE);
+		tree_view_set_selected(regedit->keys, false);
+		value_list_set_selected(regedit->vl, true);
 	}
-	mvprintw(HEADING_START_Y, VAL_START_X, "Value");
-	attroff(A_REVERSE);
 
 	print_help(regedit);
 }
@@ -190,17 +139,17 @@ static void load_values(struct regedit *regedit)
 {
 	struct tree_node *node;
 
-	node = item_userptr(current_item(regedit->keys->menu));
+	node = tree_view_get_current_node(regedit->keys);
 	value_list_load(regedit->vl, node->key);
 }
 
 static void add_reg_key(struct regedit *regedit, struct tree_node *node,
 			bool subkey)
 {
-	char *name;
+	const char *name;
 	const char *msg;
 
-	if (!subkey && !node->parent) {
+	if (!subkey && tree_node_is_top_level(node)) {
 		return;
 	}
 
@@ -234,69 +183,262 @@ static void add_reg_key(struct regedit *regedit, struct tree_node *node,
 				new_node = tree_node_new(parent, parent,
 							 name, new_key);
 				SMB_ASSERT(new_node);
-				tree_node_append_last(list, new_node);
+				tree_node_insert_sorted(list, new_node);
+			} else {
+				/* Reopen the parent key to make sure the
+				   new subkey will be noticed. */
+				tree_node_reopen_key(regedit->registry_context,
+						     parent);
 			}
 
 			list = tree_node_first(node);
 			tree_view_clear(regedit->keys);
 			tree_view_update(regedit->keys, list);
+			if (!subkey) {
+				node = new_node;
+			}
+			tree_view_set_current_node(regedit->keys, node);
+			load_values(regedit);
 		} else {
+			msg = get_friendly_werror_msg(rv);
 			dialog_notice(regedit, DIA_ALERT, "New Key",
-				      "Failed to create key.");
+				      "Failed to create key: %s", msg);
 		}
-		talloc_free(name);
+		talloc_free(discard_const(name));
 	}
 }
 
+enum search_flags {
+	SEARCH_NEXT = (1<<0),
+	SEARCH_PREV = (1<<1),
+	SEARCH_REPEAT = (1<<2)
+};
+static WERROR regedit_search(struct regedit *regedit, struct tree_node *node,
+			     struct value_item *vitem, unsigned flags)
+{
+	struct regedit_search_opts *opts;
+	struct tree_node *found;
+	struct value_item *found_value;
+	bool search_key, need_sync;
+	char *save_value_name;
+	WERROR rv;
+	bool (*iterate)(struct tree_node **, bool, WERROR *);
+	struct value_item *(*find_item)(struct value_list *,
+				        struct value_item *,
+				        const char *,
+				        regedit_search_match_fn_t);
+
+	opts = &regedit->active_search;
+
+	if (!opts->query || !opts->match) {
+		return WERR_OK;
+	}
+
+	SMB_ASSERT(opts->search_key || opts->search_value);
+
+	rv = WERR_OK;
+	found = NULL;
+	found_value = NULL;
+	save_value_name = NULL;
+	search_key = opts->search_key;
+	need_sync = false;
+	iterate = tree_node_next;
+	find_item = value_list_find_next_item;
+
+	if (flags & SEARCH_PREV) {
+		iterate = tree_node_prev;
+		find_item = value_list_find_prev_item;
+	}
+
+	if (opts->search_value) {
+		struct value_item *it;
+
+		it = value_list_get_current_item(regedit->vl);
+		if (it) {
+			save_value_name = talloc_strdup(regedit,
+							it->value_name);
+			if (save_value_name == NULL) {
+				return WERR_NOMEM;
+			}
+		}
+
+		if (vitem) {
+			search_key = false;
+		}
+	}
+
+	if (!vitem && (flags & SEARCH_REPEAT)) {
+		if (opts->search_value) {
+			search_key = false;
+		} else if (!iterate(&node, opts->search_recursive, &rv)) {
+			beep();
+			return rv;
+		}
+	}
+
+	do {
+		if (search_key) {
+			SMB_ASSERT(opts->search_key == true);
+			if (opts->match(node->name, opts->query)) {
+				found = node;
+			} else if (opts->search_value) {
+				search_key = false;
+			}
+		}
+		if (!search_key) {
+			SMB_ASSERT(opts->search_value == true);
+			if (!vitem) {
+				rv = value_list_load_quick(regedit->vl,
+							   node->key);
+				if (!W_ERROR_IS_OK(rv)) {
+					goto out;
+				}
+				need_sync = true;
+			}
+			found_value = find_item(regedit->vl, vitem, opts->query,
+						opts->match);
+			if (found_value) {
+				found = node;
+			} else {
+				vitem = NULL;
+				search_key = opts->search_key;
+			}
+		}
+	} while (!found && iterate(&node, opts->search_recursive, &rv));
+
+	if (!W_ERROR_IS_OK(rv)) {
+		goto out;
+	}
+
+	if (found) {
+		/* Put the cursor on the node that was found */
+		if (!tree_view_is_node_visible(regedit->keys, found)) {
+			tree_view_update(regedit->keys,
+					 tree_node_first(found));
+			print_path(regedit, found);
+		}
+		tree_view_set_current_node(regedit->keys, found);
+		if (found_value) {
+			if (need_sync) {
+				value_list_sync(regedit->vl);
+			}
+			value_list_set_current_item(regedit->vl, found_value);
+			regedit->tree_input = false;
+		} else {
+			load_values(regedit);
+			regedit->tree_input = true;
+		}
+		tree_view_show(regedit->keys);
+		value_list_show(regedit->vl);
+		print_heading(regedit);
+	} else {
+		if (need_sync) {
+			load_values(regedit);
+			value_list_set_current_item_by_name(regedit->vl,
+							    save_value_name);
+		}
+		beep();
+	}
+
+out:
+	talloc_free(save_value_name);
+
+	return rv;
+}
+
+static void regedit_search_repeat(struct regedit *regedit, unsigned flags)
+{
+	struct tree_node *node;
+	struct value_item *vitem;
+	struct regedit_search_opts *opts;
+
+	opts = &regedit->active_search;
+	if (opts->query == NULL) {
+		return;
+	}
+
+	node = tree_view_get_current_node(regedit->keys);
+	vitem = NULL;
+	if (opts->search_value && !regedit->tree_input) {
+		vitem = value_list_get_current_item(regedit->vl);
+	}
+	regedit_search(regedit, node, vitem, flags | SEARCH_REPEAT);
+}
+
 static void handle_tree_input(struct regedit *regedit, int c)
 {
 	struct tree_node *node;
 
 	switch (c) {
 	case KEY_DOWN:
-		menu_driver(regedit->keys->menu, REQ_DOWN_ITEM);
+		tree_view_driver(regedit->keys, ML_CURSOR_DOWN);
 		load_values(regedit);
 		break;
 	case KEY_UP:
-		menu_driver(regedit->keys->menu, REQ_UP_ITEM);
+		tree_view_driver(regedit->keys, ML_CURSOR_UP);
+		load_values(regedit);
+		break;
+	case KEY_NPAGE:
+		tree_view_driver(regedit->keys, ML_CURSOR_PGDN);
+		load_values(regedit);
+		break;
+	case KEY_PPAGE:
+		tree_view_driver(regedit->keys, ML_CURSOR_PGUP);
+		load_values(regedit);
+		break;
+	case KEY_HOME:
+		tree_view_driver(regedit->keys, ML_CURSOR_HOME);
+		load_values(regedit);
+		break;
+	case KEY_END:
+		tree_view_driver(regedit->keys, ML_CURSOR_END);
 		load_values(regedit);
 		break;
 	case '\n':
 	case KEY_ENTER:
 	case KEY_RIGHT:
-		node = item_userptr(current_item(regedit->keys->menu));
+		node = tree_view_get_current_node(regedit->keys);
 		if (node && tree_node_has_children(node)) {
-			tree_node_load_children(node);
-			print_path(regedit, node->child_head);
-			tree_view_update(regedit->keys, node->child_head);
-			value_list_load(regedit->vl, node->child_head->key);
+			WERROR rv;
+
+			rv = tree_node_load_children(node);
+			if (W_ERROR_IS_OK(rv)) {
+				print_path(regedit, node->child_head);
+				tree_view_update(regedit->keys, node->child_head);
+				value_list_load(regedit->vl, node->child_head->key);
+			} else {
+				const char *msg = get_friendly_werror_msg(rv);
+				dialog_notice(regedit, DIA_ALERT, "Loading Subkeys",
+					      "Failed to load subkeys: %s", msg);
+			}
 		}
 		break;
 	case KEY_LEFT:
-		node = item_userptr(current_item(regedit->keys->menu));
-		if (node && node->parent) {
+		node = tree_view_get_current_node(regedit->keys);
+		if (node && !tree_node_is_top_level(node)) {
 			print_path(regedit, node->parent);
-			node = tree_node_first(node->parent);
-			tree_view_update(regedit->keys, node);
+			node = node->parent;
+			tree_view_update(regedit->keys, tree_node_first(node));
+			tree_view_set_current_node(regedit->keys, node);
 			value_list_load(regedit->vl, node->key);
 		}
 		break;
 	case 'n':
 	case 'N':
-		node = item_userptr(current_item(regedit->keys->menu));
+		node = tree_view_get_current_node(regedit->keys);
 		add_reg_key(regedit, node, false);
 		break;
 	case 's':
 	case 'S':
-		node = item_userptr(current_item(regedit->keys->menu));
+		node = tree_view_get_current_node(regedit->keys);
 		add_reg_key(regedit, node, true);
 		break;
 	case 'd':
 	case 'D': {
 		int sel;
 
-		node = item_userptr(current_item(regedit->keys->menu));
-		if (!node->parent) {
+		node = tree_view_get_current_node(regedit->keys);
+		if (tree_node_is_top_level(node)) {
 			break;
 		}
 		sel = dialog_notice(regedit, DIA_CONFIRM,
@@ -310,9 +452,11 @@ static void handle_tree_input(struct regedit *regedit, int c)
 
 			rv = reg_key_del(node, parent->key, node->name);
 			if (W_ERROR_IS_OK(rv)) {
+				tree_node_reopen_key(regedit->registry_context,
+						     parent);
 				tree_view_clear(regedit->keys);
 				pop = tree_node_pop(&node);
-				tree_node_free_recursive(pop);
+				talloc_free(pop);
 				node = parent->child_head;
 				if (node == NULL) {
 					node = tree_node_first(parent);
@@ -321,8 +465,9 @@ static void handle_tree_input(struct regedit *regedit, int c)
 				tree_view_update(regedit->keys, node);
 				value_list_load(regedit->vl, node->key);
 			} else {
+				const char *msg = get_friendly_werror_msg(rv);
 				dialog_notice(regedit, DIA_ALERT, "Delete Key",
-					      "Failed to delete key.");
+					      "Failed to delete key: %s", msg);
 			}
 		}
 		break;
@@ -337,13 +482,27 @@ static void handle_value_input(struct regedit *regedit, int c)
 {
 	struct value_item *vitem;
 	bool binmode = false;
+	WERROR err;
+	int sel;
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list