Author: aschnell Date: Wed Mar 18 15:33:38 2009 New Revision: 56218 URL: http://svn.opensuse.org/viewcvs/yast?rev=56218&view=rev Log: - added refresh function to TreePanel and TabPanel since calling create for refresh is not good (e.g. for graph) (unfinished) Modified: trunk/storage/storage/src/include/ep-graph.ycp trunk/storage/storage/src/include/ep-main.ycp trunk/storage/storage/src/modules/TabPanel.ycp trunk/storage/storage/src/modules/TreePanel.ycp Modified: trunk/storage/storage/src/include/ep-graph.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-graph.ycp?rev=56218&r1=56217&r2=56218&view=diff ============================================================================== --- trunk/storage/storage/src/include/ep-graph.ycp (original) +++ trunk/storage/storage/src/include/ep-graph.ycp Wed Mar 18 15:33:38 2009 @@ -53,6 +53,15 @@ } + void RefreshGraphPanel(any user_data) + { + string filename = Directory::tmpdir + "/storage.gv"; + Storage::SaveGraph(filename); + + UI::ChangeWidget(`id(`graph), `Filename, filename); + } + + void HandleGraphPanel(any user_data, map event) { void GotoDevice(string device) Modified: trunk/storage/storage/src/include/ep-main.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-main.ycp?rev=56218&r1=56217&r2=56218&view=diff ============================================================================== --- trunk/storage/storage/src/include/ep-main.ycp (original) +++ trunk/storage/storage/src/include/ep-main.ycp Wed Mar 18 15:33:38 2009 @@ -100,8 +100,8 @@ `loop : $[ `create : CreateLoopMainPanel, `handle : HandleLoopMainPanel ], `dm : $[ `create : CreateDmMainPanel ], `nfs : $[ `create : CreateNfsMainPanel, `handle : HandleNfsMainPanel ], - `unused : $[ `create : CreateUnusedPanel, `handle: HandleUnusedPanel ], - `graph : $[ `create : CreateGraphPanel, `handle : HandleGraphPanel ], + `unused : $[ `create : CreateUnusedPanel, `handle : HandleUnusedPanel ], + `graph : $[ `create : CreateGraphPanel, `refresh : RefreshGraphPanel, `handle : HandleGraphPanel ], `summary : $[ `create : CreateSummaryPanel ], `settings : $[ `create : CreateSettingsPanel, `handle : HandleSettingsPanel, `destroy : DestroySettingsPanel ], `log : $[ `create : CreateLogPanel, `handle : HandleLogPanel, `destroy : DestroyLogPanel ] ]; Modified: trunk/storage/storage/src/modules/TabPanel.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/modules/TabPanel.ycp?rev=56218&r1=56217&r2=56218&view=diff ============================================================================== --- trunk/storage/storage/src/modules/TabPanel.ycp (original) +++ trunk/storage/storage/src/modules/TabPanel.ycp Wed Mar 18 15:33:38 2009 @@ -35,6 +35,17 @@ } } + void CallRefresh() + { + map tmp = data[current_item]:nil; + void(any) refresh_func = (void(any)) tmp[`refresh]:nil; + if (refresh_func != nil) + { + any user_data = tmp[`user_data]:nil; + refresh_func(user_data); + } + } + void CallHandle(map event) { map tmp = data[current_item]:nil; @@ -94,6 +105,11 @@ CallCreate(); } + global void Refresh() + { + CallRefresh(); + } + global void Handle(map event) { symbol widget = Event::IsMenu(event); Modified: trunk/storage/storage/src/modules/TreePanel.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/modules/TreePanel.ycp?rev=56218&r1=56217&r2=56218&view=diff ============================================================================== --- trunk/storage/storage/src/modules/TreePanel.ycp (original) +++ trunk/storage/storage/src/modules/TreePanel.ycp Wed Mar 18 15:33:38 2009 @@ -33,6 +33,17 @@ } } + void CallRefresh() + { + map tmp = data[current_item]:nil; + void(any) refresh_func = (void(any)) tmp[`refresh]:nil; + if (refresh_func != nil) + { + any user_data = tmp[`user_data]:nil; + refresh_func(user_data); + } + } + void CallHandle(map event) { map tmp = data[current_item]:nil; @@ -104,6 +115,11 @@ CallCreate(); } + global void Refresh() + { + CallRefresh(); + } + /** * Handle user input by either switching the panel or delegating the input * to the selected panel. -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org