Am 10.06.2013 13:43, schrieb Angelo Naselli:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
AFAICS the only difference to former code is that the column to check can at be at first or last column now. I think this complicates the code unnessecarily. For me YTableMode is not clearly defined, e.g. what's the difference between YTableCheckBoxOnFirstColumn and YTableMultiSelection? Well not all is ncurses ;) Multiselection as you changed now is not very different, since you change in your last commit the event sent from Activated to ValueChanged.
No, I only added additional return ValueChanged if item is toggled (which is conform to NCMultiSelectionBox). see commit 0b69bb499fa5e2b011aa614dfcf0df884b45456a NCTable::NCTable( YWidget * parent, YTableHeader *tableHeader, bool multiSelection ) : YTable( parent, tableHeader, multiSelection ) , NCPadWidget( parent ) @@ -529,6 +543,10 @@ NCursesEvent NCTable::wHandleInput( wint_t key ) else { toggleCurrentItem(); + if ( notify() && immediateMode() ) + { + return NCursesEvent::ValueChanged; + } } break;
As i said IMO that's wrong for multiselection, but i see, it's easier in ncurses, even if it does not work in such a way in GUI.
A multiselection is something different in GUI (Qt/Gtk) and who ported it in ncurses did by using checkboxes, that i think it's a great idea.
What i need is having checkboxes in YTable in GUI, so Multiselection is not the solution. As discussed in this thread, a check-box column at the beginning or at the end seemed ok.
I think it doesn't make sense to have the checkable column at last column for ncurses (not as easy to scroll here as in qt/gtk).
My suggestion is not to change libyui-ncurses because 'old' code fulfills the requirements (in my opinion). Well it does not fullfill mine, or at least what i'm trying to port under libyui. I need check box to manage a package manager, and with my implementation i have. |Package │Version │Release [ ]│texmacs │1.0.7.16│3.mga3... [x]│vim-X11 │7.3.762 │5.mga3... [ ]│xemacs │21.4.22 │18.mag3... In GUI that cannot be managed by multiselection
I also needed for the font manager something like Enable Update Font [X] [ ] Core [X] [X] Core Updates
But you stopped my previous implementation to avoid any user confusions. And at the moment i have to study another way to do that.
Another remark: Change below would break usage in yast disk:
diff --git a/src/NCTable.cc b/src/NCTable.cc
@@ -543,7 +587,7 @@ NCursesEvent NCTable::wHandleInput( wint_t key ) else { toggleCurrentItem(); - if ( notify() && immediateMode() ) + if ( notify() || immediateMode() )
-> breaks 'yast disk' module/volume management (when adding a volume group and selecting a device). { return NCursesEvent::ValueChanged; }
hmm, I'm sorry for that, but then i cannot understand how it works :/
as said, and written in code immediate mode include notify, so "and clause" is useless, because immediate mode already means notify. Moreover if i set only notify, i don't have an notification in ncurses... So i wonder where i'm wrong?
Cheers, Angelo
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iEYEARECAAYFAlG1u+QACgkQqEs9DA4DquD2hwCfValzDhcG7Kz7Cx9MN/6faJI9 oRcAoJLFkjuX05/W9dudftOD9nO9O5HA =zGC/ -----END PGP SIGNATURE-----
-- Gabriele Mohr SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) Maxfeldstr. 5 Tel: +49 911 740 53 362 90409 Nürnberg Email: gs@suse.de ----------------------------------------------------------------- -- To unsubscribe, e-mail: libyui-devel+unsubscribe@opensuse.org To contact the owner, e-mail: libyui-devel+owner@opensuse.org