r74747 - in /branches/upstream/libconfig-model-tkui-perl/current: ./ lib/Config/Model/ lib/Config/Model/Tk/ lib/Config/Model/Tk/icons/

ddumont-guest at users.alioth.debian.org ddumont-guest at users.alioth.debian.org
Thu May 19 11:16:41 UTC 2011


Author: ddumont-guest
Date: Thu May 19 11:08:50 2011
New Revision: 74747

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=74747
Log:
[svn-upgrade] new version libconfig-model-tkui-perl (1.324)

Added:
    branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/icons/gnome-next.png   (with props)
    branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/icons/gnome-previous.png   (with props)
Modified:
    branches/upstream/libconfig-model-tkui-perl/current/Build.PL
    branches/upstream/libconfig-model-tkui-perl/current/ChangeLog
    branches/upstream/libconfig-model-tkui-perl/current/MANIFEST
    branches/upstream/libconfig-model-tkui-perl/current/META.yml
    branches/upstream/libconfig-model-tkui-perl/current/README
    branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/AnyViewer.pm
    branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/CheckListEditor.pm
    branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/CheckListViewer.pm
    branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/HashEditor.pm
    branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/HashViewer.pm
    branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/LeafEditor.pm
    branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/LeafViewer.pm
    branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/ListEditor.pm
    branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/ListViewer.pm
    branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/NodeEditor.pm
    branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/NodeViewer.pm
    branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/NoteEditor.pm
    branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/Wizard.pm
    branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/TkUI.pm

Modified: branches/upstream/libconfig-model-tkui-perl/current/Build.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-tkui-perl/current/Build.PL?rev=74747&op=diff
==============================================================================
--- branches/upstream/libconfig-model-tkui-perl/current/Build.PL (original)
+++ branches/upstream/libconfig-model-tkui-perl/current/Build.PL Thu May 19 11:08:50 2011
@@ -51,7 +51,7 @@
     'Tk::ObjScanner' => '0'
   },
   'requires' => {
-    'Config::Model' => '1.235',
+    'Config::Model' => '1.244',
     'Exception::Class' => '0',
     'File::Slurp' => '0',
     'Log::Log4perl' => '1.11',

Modified: branches/upstream/libconfig-model-tkui-perl/current/ChangeLog
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-tkui-perl/current/ChangeLog?rev=74747&op=diff
==============================================================================
--- branches/upstream/libconfig-model-tkui-perl/current/ChangeLog (original)
+++ branches/upstream/libconfig-model-tkui-perl/current/ChangeLog Thu May 19 11:08:50 2011
@@ -1,3 +1,10 @@
+2011-05-17  Dominique Dumont  <domi.dumont at free.fr> 1.324
+
+   * Depends on Config::Model 1.244
+   * TkUI: added search widget (menu "Edit -> Search" or
+     just hit <Ctrl-F>)
+   * ListEditor: fix bug that prevented to push a null value
+
 2011-04-11  Dominique Dumont  <domi.dumont at free.fr> 1.323
 
     * LeafEditor: show value help widget only when useful
@@ -22,7 +29,7 @@
 
         * LeafViewer: removed 'apply fix' button. This one is reserved for 
         LeafEditor
-        
+
 2011-01-09  Dominique Dumont  <domi.dumont at free.fr> 1.319
 
         * LeafEditor: added fix button to fix warnings (if model provides a fix)

Modified: branches/upstream/libconfig-model-tkui-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-tkui-perl/current/MANIFEST?rev=74747&op=diff
==============================================================================
--- branches/upstream/libconfig-model-tkui-perl/current/MANIFEST (original)
+++ branches/upstream/libconfig-model-tkui-perl/current/MANIFEST Thu May 19 11:08:50 2011
@@ -25,6 +25,8 @@
 lib/Config/Model/Tk/icons/down.png
 lib/Config/Model/Tk/icons/eraser.png
 lib/Config/Model/Tk/icons/fontsizeup.png
+lib/Config/Model/Tk/icons/gnome-next.png
+lib/Config/Model/Tk/icons/gnome-previous.png
 lib/Config/Model/Tk/icons/next.png
 lib/Config/Model/Tk/icons/remove.png
 lib/Config/Model/Tk/icons/rotate_cw.png

Modified: branches/upstream/libconfig-model-tkui-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-tkui-perl/current/META.yml?rev=74747&op=diff
==============================================================================
--- branches/upstream/libconfig-model-tkui-perl/current/META.yml (original)
+++ branches/upstream/libconfig-model-tkui-perl/current/META.yml Thu May 19 11:08:50 2011
@@ -9,7 +9,7 @@
 configure_requires:
   Module::Build: 0.3601
 dynamic_config: 0
-generated_by: 'Dist::Zilla version 4.200004, CPAN::Meta::Converter version 2.110930'
+generated_by: 'Dist::Zilla version 4.200006, CPAN::Meta::Converter version 2.110930'
 license: lgpl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -18,7 +18,7 @@
 recommends:
   Tk::ObjScanner: 0
 requires:
-  Config::Model: 1.235
+  Config::Model: 1.244
   Exception::Class: 0
   File::Slurp: 0
   Log::Log4perl: 1.11
@@ -26,4 +26,4 @@
   Tk: 0
   Tk::DirSelect: 0
   Tk::Tree: 0
-version: 1.323
+version: 1.324

Modified: branches/upstream/libconfig-model-tkui-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-tkui-perl/current/README?rev=74747&op=diff
==============================================================================
--- branches/upstream/libconfig-model-tkui-perl/current/README (original)
+++ branches/upstream/libconfig-model-tkui-perl/current/README Thu May 19 11:08:50 2011
@@ -23,6 +23,20 @@
     Copyright (C) 2007-2009 David Miller <miller at oxygen-icons.org>
     and others.
   See /usr/share/doc/oxygen-icon-theme/copyright on a Debian machine
+- gnome-*.png from   gnome-icon-theme   are GPLv2:
+  Copyright © 2002-2008:
+   Ulisse Perusin <uli.peru at gmail.com>
+   Riccardo Buzzotta <raozuzu at yahoo.it>
+   Josef Vybíral <cornelius at vybiral.info>
+   Hylke Bons <h.bons at student.rug.nl>
+   Ricardo González <rick at jinlabs.com>
+   Lapo Calamandrei <calamandrei at gmail.com>
+   Rodney Dawes <dobey at novell.com>
+   Luca Ferretti <elle.uca at libero.it>
+   Tuomas Kuosmanen <tigert at gimp.org>
+   Andreas Nilsson <nisses.mail at home.se>
+   Jakub Steiner <jimmac at novell.com>
+  See /usr/share/doc/gnome-icon-theme/copyright on a Debian machine
   
 
 

Modified: branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/AnyViewer.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/AnyViewer.pm?rev=74747&op=diff
==============================================================================
--- branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/AnyViewer.pm (original)
+++ branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/AnyViewer.pm Thu May 19 11:08:50 2011
@@ -27,7 +27,7 @@
 
 package Config::Model::Tk::AnyViewer ;
 BEGIN {
-  $Config::Model::Tk::AnyViewer::VERSION = '1.323';
+  $Config::Model::Tk::AnyViewer::VERSION = '1.324';
 }
 
 use strict;

Modified: branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/CheckListEditor.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/CheckListEditor.pm?rev=74747&op=diff
==============================================================================
--- branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/CheckListEditor.pm (original)
+++ branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/CheckListEditor.pm Thu May 19 11:08:50 2011
@@ -9,7 +9,7 @@
 #
 package Config::Model::Tk::CheckListEditor ;
 BEGIN {
-  $Config::Model::Tk::CheckListEditor::VERSION = '1.323';
+  $Config::Model::Tk::CheckListEditor::VERSION = '1.324';
 }
 
 use strict;

Modified: branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/CheckListViewer.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/CheckListViewer.pm?rev=74747&op=diff
==============================================================================
--- branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/CheckListViewer.pm (original)
+++ branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/CheckListViewer.pm Thu May 19 11:08:50 2011
@@ -9,7 +9,7 @@
 #
 package Config::Model::Tk::CheckListViewer ;
 BEGIN {
-  $Config::Model::Tk::CheckListViewer::VERSION = '1.323';
+  $Config::Model::Tk::CheckListViewer::VERSION = '1.324';
 }
 
 use strict;

Modified: branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/HashEditor.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/HashEditor.pm?rev=74747&op=diff
==============================================================================
--- branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/HashEditor.pm (original)
+++ branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/HashEditor.pm Thu May 19 11:08:50 2011
@@ -9,7 +9,7 @@
 #
 package Config::Model::Tk::HashEditor;
 BEGIN {
-  $Config::Model::Tk::HashEditor::VERSION = '1.323';
+  $Config::Model::Tk::HashEditor::VERSION = '1.324';
 }
 
 use strict;

Modified: branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/HashViewer.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/HashViewer.pm?rev=74747&op=diff
==============================================================================
--- branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/HashViewer.pm (original)
+++ branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/HashViewer.pm Thu May 19 11:08:50 2011
@@ -9,7 +9,7 @@
 #
 package Config::Model::Tk::HashViewer ;
 BEGIN {
-  $Config::Model::Tk::HashViewer::VERSION = '1.323';
+  $Config::Model::Tk::HashViewer::VERSION = '1.324';
 }
 
 use strict;

Modified: branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/LeafEditor.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/LeafEditor.pm?rev=74747&op=diff
==============================================================================
--- branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/LeafEditor.pm (original)
+++ branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/LeafEditor.pm Thu May 19 11:08:50 2011
@@ -9,7 +9,7 @@
 #
 package Config::Model::Tk::LeafEditor ;
 BEGIN {
-  $Config::Model::Tk::LeafEditor::VERSION = '1.323';
+  $Config::Model::Tk::LeafEditor::VERSION = '1.324';
 }
 
 use strict;

Modified: branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/LeafViewer.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/LeafViewer.pm?rev=74747&op=diff
==============================================================================
--- branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/LeafViewer.pm (original)
+++ branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/LeafViewer.pm Thu May 19 11:08:50 2011
@@ -9,7 +9,7 @@
 #
 package Config::Model::Tk::LeafViewer ;
 BEGIN {
-  $Config::Model::Tk::LeafViewer::VERSION = '1.323';
+  $Config::Model::Tk::LeafViewer::VERSION = '1.324';
 }
 
 use strict;
@@ -108,10 +108,6 @@
 
     my $std = $leaf->fetch(qw/mode standard check no/) ;
 
-    warn "FIXME: remove work-around now that Config::Model 1.242 is out."
-        if $Config::Model::VERSION > 1.241 ;
-    my $normal = $leaf->fetch(qw/check no/) ;
-    
     if (defined $leaf->upstream_default) {
 	push @items, "upstream_default value: " . $leaf->upstream_default ;
     }

Modified: branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/ListEditor.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/ListEditor.pm?rev=74747&op=diff
==============================================================================
--- branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/ListEditor.pm (original)
+++ branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/ListEditor.pm Thu May 19 11:08:50 2011
@@ -9,7 +9,7 @@
 #
 package Config::Model::Tk::ListEditor ;
 BEGIN {
-  $Config::Model::Tk::ListEditor::VERSION = '1.323';
+  $Config::Model::Tk::ListEditor::VERSION = '1.324';
 }
 
 use strict;
@@ -232,7 +232,7 @@
     my $cargo_type = $list->cargo_type ;
     my $value_type = $list->get_cargo_info('value_type') ; # may be undef
     if ($cargo_type eq 'leaf' and $value_type ne 'enum' and $value_type ne 'reference') {
-	return unless $add;
+	return unless length($add);
 	eval {$list->push($add) ;};
     }
     else {
@@ -255,7 +255,7 @@
     my @new_idx = $list->get_all_indexes ;
     $logger->debug("new list idx: ". join(',', at new_idx));
 
-    my $insert = $add || $#new_idx ;
+    my $insert = length($add) ? $add : $#new_idx ;
     $tklist->insert('end',$insert);
 
     return 1 ;

Modified: branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/ListViewer.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/ListViewer.pm?rev=74747&op=diff
==============================================================================
--- branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/ListViewer.pm (original)
+++ branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/ListViewer.pm Thu May 19 11:08:50 2011
@@ -9,7 +9,7 @@
 #
 package Config::Model::Tk::ListViewer ;
 BEGIN {
-  $Config::Model::Tk::ListViewer::VERSION = '1.323';
+  $Config::Model::Tk::ListViewer::VERSION = '1.324';
 }
 
 use strict;

Modified: branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/NodeEditor.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/NodeEditor.pm?rev=74747&op=diff
==============================================================================
--- branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/NodeEditor.pm (original)
+++ branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/NodeEditor.pm Thu May 19 11:08:50 2011
@@ -9,7 +9,7 @@
 #
 package Config::Model::Tk::NodeEditor ;
 BEGIN {
-  $Config::Model::Tk::NodeEditor::VERSION = '1.323';
+  $Config::Model::Tk::NodeEditor::VERSION = '1.324';
 }
 
 use strict;

Modified: branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/NodeViewer.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/NodeViewer.pm?rev=74747&op=diff
==============================================================================
--- branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/NodeViewer.pm (original)
+++ branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/NodeViewer.pm Thu May 19 11:08:50 2011
@@ -9,7 +9,7 @@
 #
 package Config::Model::Tk::NodeViewer ;
 BEGIN {
-  $Config::Model::Tk::NodeViewer::VERSION = '1.323';
+  $Config::Model::Tk::NodeViewer::VERSION = '1.324';
 }
 
 use strict;

Modified: branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/NoteEditor.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/NoteEditor.pm?rev=74747&op=diff
==============================================================================
--- branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/NoteEditor.pm (original)
+++ branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/NoteEditor.pm Thu May 19 11:08:50 2011
@@ -9,7 +9,7 @@
 #
 package Config::Model::Tk::NoteEditor ;
 BEGIN {
-  $Config::Model::Tk::NoteEditor::VERSION = '1.323';
+  $Config::Model::Tk::NoteEditor::VERSION = '1.324';
 }
 
 use strict;

Modified: branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/Wizard.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/Wizard.pm?rev=74747&op=diff
==============================================================================
--- branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/Wizard.pm (original)
+++ branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/Wizard.pm Thu May 19 11:08:50 2011
@@ -10,7 +10,7 @@
 
 package Config::Model::Tk::Wizard ;
 BEGIN {
-  $Config::Model::Tk::Wizard::VERSION = '1.323';
+  $Config::Model::Tk::Wizard::VERSION = '1.324';
 }
 
 use strict;

Added: branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/icons/gnome-next.png
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/icons/gnome-next.png?rev=74747&op=file
==============================================================================
Binary file - no diff available.

Propchange: branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/icons/gnome-next.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/icons/gnome-previous.png
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/icons/gnome-previous.png?rev=74747&op=file
==============================================================================
Binary file - no diff available.

Propchange: branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/Tk/icons/gnome-previous.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/TkUI.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/TkUI.pm?rev=74747&op=diff
==============================================================================
--- branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/TkUI.pm (original)
+++ branches/upstream/libconfig-model-tkui-perl/current/lib/Config/Model/TkUI.pm Thu May 19 11:08:50 2011
@@ -11,7 +11,7 @@
 
 package Config::Model::TkUI ;
 BEGIN {
-  $Config::Model::TkUI::VERSION = '1.323';
+  $Config::Model::TkUI::VERSION = '1.324';
 }
 
 use strict;
@@ -56,6 +56,7 @@
 
 my $cust_img ;
 my $tool_img ;
+my %gnome_img;
 
 my $mod_file = 'Config/Model/TkUI.pm' ;
 $icon_path = $INC{$mod_file} ;
@@ -97,6 +98,8 @@
 	$warn_img = $cw->Photo(-file => $icon_path.'dialog-warning.png');
 	# snatched from openclipart-png
 	$tool_img = $cw->Photo(-file => $icon_path.'tools_nicu_buculei_01.png');
+	$gnome_img{next} = $cw->Photo(-file => $icon_path.'gnome-next.png');
+	$gnome_img{previous} = $cw->Photo(-file => $icon_path.'gnome-previous.png');
     }
 
     foreach my $parm (qw/-root/) {
@@ -155,6 +158,7 @@
 	 # [ qw/command cut   -command/, sub{ $cw->edit_cut }],
 	 [ command => 'copy (Ctrl-C)', '-command', sub{ $cw->edit_copy }],
 	 [ command => 'paste (Ctrl-V)','-command', sub{ $cw->edit_paste }],
+	 [ command => 'find (Ctrl-F)','-command', sub{ $cw->pack_find_widget; }],
 	];
     $menubar->cascade( -label => 'Edit', -menuitems => $edit_items ) ;
 
@@ -225,20 +229,24 @@
     # bind button3 as double-button-1 does not work
     my $b3_sub = sub{my $item = $tree->nearest($tree->pointery - $tree->rooty) ;
 		     $cw->on_select($item)} ;
-    $tree->bind('<Button-3>', $b3_sub) ;
+    $cw->bind('<Button-3>', $b3_sub) ;
+    $cw->bind('<Double-Button-1>', $b3_sub) ;
 
     # bind button2 to get cut buffer content and try to store cut buffer content
     my $b2_sub = sub{my $item = $tree->nearest($tree->pointery - $tree->rooty) ;
 		     $cw->on_cut_buffer_dump($item)} ;
-    $tree->bind('<Button-2>', $b2_sub) ;
-
-    $tree->bind('<Control-c>',  sub{ $cw->edit_copy }) ;
-    $tree->bind('<Control-v>',  sub{ $cw->edit_paste }) ;
+    $cw->bind('<Button-2>', $b2_sub) ;
+
+    $cw->bind('<Control-c>',  sub{ $cw->edit_copy }) ;
+    $cw->bind('<Control-v>',  sub{ $cw->edit_paste }) ;
+    $cw->bind('<Control-f>',  sub{ $cw->pack_find_widget }) ;
 
     # bind button2 to get cut buffer content and try to store cut buffer content
     #my $key_sub = sub{my $item = $tree->nearest($tree->pointery - $tree->rooty) ;
     #$cw->on_key_press($item)} ;
     #$tree->bind('<KeyPress>', $key_sub) ;
+
+    my $find_frame = $cw->create_find_widget ;
 
     $args->{-title} = $title;
     $cw->SUPER::Populate($args) ;
@@ -261,6 +269,7 @@
     $cw->Advertise( menubar => $menubar );
     $cw->Advertise( right_frame => $eh_frame );
     $cw->Advertise( ed_frame => $e_frame );
+    $cw->Advertise( find_frame => $find_frame );
 
     $cw->Delegates ;
 }
@@ -1046,6 +1055,73 @@
       ) ;
 }
 
+sub create_find_widget {
+    my $cw = shift ;
+    my $f = $cw -> Frame(-relief => 'ridge', -borderwidth => 1 , ) ;
+    my $remove_img = $cw->Photo( -file => $icon_path . 'remove.png' );
+
+    $f -> Button (
+        -image   => $remove_img,
+        -command => sub { $f -> packForget() ;},
+        -relief => 'flat',
+    ) -> pack(-side => 'left');
+
+    my $searcher = $cw->{root}->tree_searcher(type => 'all') ;
+    
+    my $search = '';
+    my @result ;
+    $f -> Label (-text => 'Find: ') -> pack(-side => 'left') ;
+    my $e = $f -> Entry (
+        -textvariable => \$search,
+        -validate => 'key',
+        # ditch the search results when find entry is modified.
+        -validatecommand => sub {  @result = () ; return 1 ;} ,
+    ) ->pack (-side => 'left') ;
+    
+    $cw->Advertise( find_entry => $e) ;
+    
+    foreach my $direction (qw/previous next/) {
+        my $s = sub { $cw -> find_item($direction, $searcher,\$search, \@result) ;};
+        $f -> Button (
+            -compound => 'left',
+            -image => $gnome_img{$direction} ,
+            -text   => ucfirst($direction),
+            -command => $s,
+            -relief => 'flat',
+        ) -> pack(-side => 'left');
+    }
+    
+    return $f ;
+}
+
+sub pack_find_widget {
+    my $cw = shift;
+    $cw->Subwidget('find_frame')->pack(-anchor => 'w', -fill => 'x'); 
+    $cw->Subwidget('find_entry') -> focus ;
+}
+
+sub find_item {
+    my ($cw, $direction, $searcher, $search_ref, $result) = @_ ;
+
+    my $find_frame = $cw ->Subwidget('find_frame') ;
+
+    # search the tree, store the result 
+    @$result = $searcher->search($$search_ref) unless @$result ;
+    
+    # and jump in the list widget any time next is hit.
+    if (@$result) {
+        if ( defined $cw->{old_path} and $direction eq 'next' ) {
+            push @$result, shift @$result ;
+        }
+        elsif (defined $cw->{old_path}) {
+            unshift @$result, pop @$result ;
+        }
+        my $path = $result->[0];
+        $cw->{old_path} = $path ;
+
+        $cw->force_element_display($cw->{root}->grab($path)) ;
+    }
+}
 1;
 
 __END__
@@ -1138,6 +1214,16 @@
 
 =back
 
+=head2 Search
+
+Hit C<Ctrl-F> or use menu C<< Edit -> Search >> to open a search widget at the bottom 
+of the window.
+
+Enter a keyword in the entry widget and click on C<Next> button.
+
+The keyword will be searched in the configuration tree, in element name, in element value and 
+in documentation.
+
 =head2 Editor widget
 
 The right side of the widget is either a viewer or an editor. When
@@ -1157,10 +1243,7 @@
 =head1 TODO
 
 - Document widget options. (-root_model and -store_sub, -quit)
-- add better navigation
 - add tabular view ?
-- improve look and feel
-- add search element or search value
 - expand the whole tree at once
 - add plug-in mechanism so that dedicated widget
   can be used for some config Class (Could be handy for
@@ -1172,7 +1255,7 @@
 
 =head1 LICENSE
 
-    Copyright (c) 2008-2010 Dominique Dumont.
+    Copyright (c) 2008-2011 Dominique Dumont.
 
     This file is part of Config-Model.
 




More information about the Pkg-perl-cvs-commits mailing list