Author: aschnell
Date: Mon Mar 17 15:04:53 2008
New Revision: 45531
URL: http://svn.opensuse.org/viewcvs/yast?rev=45531&view=rev
Log:
- automatically update log
Modified:
branches/tmp/aschnell/part-redesign/storage/src/include/ep-log.ycp
branches/tmp/aschnell/part-redesign/storage/src/include/ep-main.ycp
branches/tmp/aschnell/part-redesign/storage/src/include/ep-settings.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-log.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/storage/src/include/ep-log.ycp?rev=45531&r1=45530&r2=45531&view=diff
==============================================================================
--- branches/tmp/aschnell/part-redesign/storage/src/include/ep-log.ycp (original)
+++ branches/tmp/aschnell/part-redesign/storage/src/include/ep-log.ycp Mon Mar 17 15:04:53 2008
@@ -9,38 +9,39 @@
textdomain "storage";
- // TODO: use yast2/library/log/src/LogView.ycp (but need modification)
-
-
- void RefreshLog()
- {
- // TODO: limit number of lines
- // TODO: jump to last line / keep position
- string file_content = (string) SCR::Read (.target.string, "/var/log/messages");
- UI::ChangeWidget (`id(`log), `Value, file_content);
- }
+ import "LogViewCore";
void CreateLogPanel(any user_data)
{
+ string file = "/var/log/messages";
+ integer max_lines = 100;
+
UI::ReplaceWidget(`tree_panel,
`VBox(
- `Left(`Heading("Log")),
- `LogView(`id(`log), "/var/log/messages", 10, 0),
- `PushButton(`id(`refresh), "Refresh")
+ `Left(`Heading(_("Log"))),
+ `LogView(`id(`log), sformat(_("Content of %1:"), file), 10, max_lines)
));
- RefreshLog();
+ Wizard::RestoreHelp("Log help TODO");
- Wizard::RestoreHelp("Log help");
+ LogViewCore::Start($[ "widget" : `log,
+ "file" : file,
+ "max_lines" : max_lines ]);
}
void HandleLogPanel(any user_data, any widget)
{
- if (widget == `refresh)
+ if (widget == `timeout)
{
- RefreshLog();
+ LogViewCore::Update();
}
}
+
+
+ void DestroyLogPanel(any user_data)
+ {
+ LogViewCore::Stop();
+ }
}
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=45531&r1=45530&r2=45531&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 Mon Mar 17 15:04:53 2008
@@ -69,8 +69,8 @@
`dm : $[ `create : CreateDmMainPanel, `handle : HandleDmMainPanel ],
`nfs : $[ `create : CreateNfsMainPanel, `handle : HandleNfsMainPanel ],
`unused : $[ `create : CreateUnusedPanel, `handle : HandleUnusedPanel ],
- `settings : $[ `create : CreateSettingsPanel, `save : SaveSettingsPanel ],
- `log : $[ `create : CreateLogPanel, `handle : HandleLogPanel ] ];
+ `settings : $[ `create : CreateSettingsPanel, `destroy : DestroySettingsPanel ],
+ `log : $[ `create : CreateLogPanel, `handle : HandleLogPanel, `destroy : DestroyLogPanel ] ];
map subtree = $[];
@@ -219,7 +219,9 @@
repeat
{
- widget = Wizard::UserInput();
+ map event = Wizard::WaitForEvent(500);
+ widget = event["ID"]:nil;
+
TreePanel::Handle(widget);
if (widget == `back || widget == `abort)
@@ -258,7 +260,7 @@
}
until (widget == `back || widget == `abort || widget == `next);
- TreePanel::Save();
+ TreePanel::Destroy();
if (widget == `back || widget == `abort)
{
Modified: branches/tmp/aschnell/part-redesign/storage/src/include/ep-settings.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/storage/src/include/ep-settings.ycp?rev=45531&r1=45530&r2=45531&view=diff
==============================================================================
--- branches/tmp/aschnell/part-redesign/storage/src/include/ep-settings.ycp (original)
+++ branches/tmp/aschnell/part-redesign/storage/src/include/ep-settings.ycp Mon Mar 17 15:04:53 2008
@@ -64,7 +64,7 @@
}
- void SaveSettingsPanel(any user_data)
+ void DestroySettingsPanel(any user_data)
{
preferred_displayname = (symbol) UI::QueryWidget(`id(`preferred_displayname), `Value);
default_mountby = (symbol) UI::QueryWidget(`id(`default_mountby), `Value);
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=45531&r1=45530&r2=45531&view=diff
==============================================================================
--- branches/tmp/aschnell/part-redesign/storage/src/modules/TabPanel.ycp (original)
+++ branches/tmp/aschnell/part-redesign/storage/src/modules/TabPanel.ycp Mon Mar 17 15:04:53 2008
@@ -40,14 +40,14 @@
}
}
- void CallSave()
+ void CallDestroy()
{
map tmp = (map) data[current_item]:nil;
- void(any) save_func = (void(any)) tmp[`save]:nil;
- if (save_func != nil)
+ void(any) destroy_func = (void(any)) tmp[`destroy]:nil;
+ if (destroy_func != nil)
{
any user_data = tmp[`user_data]:nil;
- save_func(user_data);
+ destroy_func(user_data);
}
}
@@ -76,7 +76,7 @@
if (haskey(data, widget))
{
- CallSave();
+ CallDestroy();
current_item = widget;
CallCreate();
}
@@ -86,9 +86,9 @@
}
}
- global void Save()
+ global void Destroy()
{
- CallSave();
+ CallDestroy();
}
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=45531&r1=45530&r2=45531&view=diff
==============================================================================
--- branches/tmp/aschnell/part-redesign/storage/src/modules/TreePanel.ycp (original)
+++ branches/tmp/aschnell/part-redesign/storage/src/modules/TreePanel.ycp Mon Mar 17 15:04:53 2008
@@ -40,14 +40,14 @@
}
}
- void CallSave()
+ void CallDestroy()
{
map tmp = (map) data[current_item]:nil;
- void(any) save_func = (void(any)) tmp[`save]:nil;
- if (save_func != nil)
+ void(any) destroy_func = (void(any)) tmp[`destroy]:nil;
+ if (destroy_func != nil)
{
any user_data = tmp[`user_data]:nil;
- save_func(user_data);
+ destroy_func(user_data);
}
}
@@ -84,7 +84,7 @@
if (old_item != new_item)
{
- CallSave();
+ CallDestroy();
data = d;
current_item = new_item;
CallCreate();
@@ -103,7 +103,7 @@
{
if (widget == `tree)
{
- CallSave();
+ CallDestroy();
current_item = UI::QueryWidget(`tree, `CurrentItem);
CallCreate();
}
@@ -114,10 +114,10 @@
}
/**
- * Delegating saving to the selected panel.
+ * Delegating destroying to the selected panel.
*/
- global void Save()
+ global void Destroy()
{
- CallSave();
+ CallDestroy();
}
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org