[yast-commit] r46832 - in /branches/tmp/aschnell/part-redesign/storage/src: include/ep-main.ycp modules/TabPanel.ycp modules/TreePanel.ycp
Author: aschnell Date: Fri Apr 18 14:35:53 2008 New Revision: 46832 URL: http://svn.opensuse.org/viewcvs/yast?rev=46832&view=rev Log: - stricter types Modified: branches/tmp/aschnell/part-redesign/storage/src/include/ep-main.ycp branches/tmp/aschnell/part-redesign/storage/src/modules/TabPanel.ycp branches/tmp/aschnell/part-redesign/storage/src/modules/TreePanel.ycp Modified: branches/tmp/aschnell/part-redesign/storage/src/include/ep-main.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/storage/src/include/ep-main.ycp?rev=46832&r1=46831&r2=46832&view=diff ============================================================================== --- branches/tmp/aschnell/part-redesign/storage/src/include/ep-main.ycp (original) +++ branches/tmp/aschnell/part-redesign/storage/src/include/ep-main.ycp Fri Apr 18 14:35:53 2008 @@ -40,7 +40,8 @@ include "partitioning/ep-log.ycp"; - map data = $[]; + map<any, map> data = $[]; + list<term> MakeNavigationTree(map open_items) { Modified: branches/tmp/aschnell/part-redesign/storage/src/modules/TabPanel.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/storage/src/modules/TabPanel.ycp?rev=46832&r1=46831&r2=46832&view=diff ============================================================================== --- branches/tmp/aschnell/part-redesign/storage/src/modules/TabPanel.ycp (original) +++ branches/tmp/aschnell/part-redesign/storage/src/modules/TabPanel.ycp Fri Apr 18 14:35:53 2008 @@ -4,8 +4,9 @@ * Summary: Expert Partitioner * Authors: Arvin Schnell <aschnell@suse.de> * - * The DumbTab widget must have id `tab. The ids of the items of the DumbTab widget - * must be made of symbols. + * The DumbTab widget must have id `tab. The ids of the items of the DumbTab + * widget must be made of symbols. The id must be the first argument of the + * items. */ { module "TabPanel"; @@ -55,6 +56,18 @@ } + void Check() + { + list<symbol> items1 = maplist(symbol s, map m, data, { return s; }); + + list<symbol> items2 = maplist(term t, (list<term>) UI::QueryWidget(`id(`tab), `Items), + { return t[0, 0]:`none; }); + + if (sort(items1) != sort(items2)) + y2warning("DumbTab items and callback data do not match"); + } + + void AddToHistory() { history = filter(symbol s, history, { return s != current_item; }); @@ -68,14 +81,10 @@ global void Init(map<symbol, map> d) { data = d; + Check(); - list<symbol> item1 = maplist(term t, (list<term>) UI::QueryWidget(`id(`tab), `Items), - { return t[0, 0]:`none; }); - list<symbol> item2 = maplist(symbol s, map m, data, { return s; }); - if (sort(item1) != sort(item2)) - y2warning("DumbTab items and callback data do not match"); - - current_item = find(symbol s, history, { return contains(item1, s); }); + list<symbol> items = maplist(symbol s, map m, data, { return s; }); + current_item = find(symbol s, history, { return contains(items, s); }); if (current_item != nil) { Modified: branches/tmp/aschnell/part-redesign/storage/src/modules/TreePanel.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/storage/src/modules/TreePanel.ycp?rev=46832&r1=46831&r2=46832&view=diff ============================================================================== --- branches/tmp/aschnell/part-redesign/storage/src/modules/TreePanel.ycp (original) +++ branches/tmp/aschnell/part-redesign/storage/src/modules/TreePanel.ycp Fri Apr 18 14:35:53 2008 @@ -4,13 +4,15 @@ * Summary: Expert Partitioner * Authors: Arvin Schnell <aschnell@suse.de> * - * The Tree widget must have id `tree. + * The Tree widget must have id `tree. The ids of the items of the Tree + * widget must be made of symbols or strings. The id must be the first + * argument of the items. */ { module "TreePanel"; - map data = nil; + map<any, map> data = nil; any current_item = nil; @@ -52,15 +54,24 @@ } + void Check() + { + list<any> items1 = maplist(any a, map m, data, { return a; }); + + // TODO: likely not worth it, rather clumsy + } + + /** * Initialises internal data and calls the create function of the * selected panel. * * When calling this function the Tree widget must already exist. */ - global void Init(map d) + global void Init(map<any, map> d) { data = d; + Check(); current_item = UI::QueryWidget(`tree, `CurrentItem); CallCreate(); @@ -69,7 +80,7 @@ /** * Update the contents of the Tree widget. */ - global void Update(map d, list tree, any new_item) + global void Update(map<any, map> d, list tree, any new_item) { any old_item = current_item; @@ -86,12 +97,14 @@ { CallDestroy(); data = d; + Check(); current_item = new_item; CallCreate(); } else { data = d; + Check(); } } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
aschnell@svn.opensuse.org