ACC SHELL

Path : /usr/share/YaST2/include/partitioning/
File Upload :
Current File : //usr/share/YaST2/include/partitioning/ep-log.ycp

/**
 * File:	ep-log.ycp
 * Package:	yast2-storage
 * Summary:	Expert Partitioner
 * Authors:	Arvin Schnell <aschnell@suse.de>
 *
 * This file must only be included in other Expert Partitioner files ("ep-*.ycp").
 */
{
    textdomain "storage";

    import "LogViewCore";


    void CreateLogPanel(any user_data)
    {
	string file = "/var/log/messages";

	UI::ReplaceWidget(`tree_panel,
			  Greasemonkey::Transform(
			      `VBox(
				  // heading
				  `IconAndHeading(_("Log"), StorageIcons::log_icon),
				  // label for log view
				  `LogView(`id(`log), sformat(_("Contents of %1:"), file), 10, 0),
				  // push button text
				  `PushButton(`id(`update), _("Update"))
				  )
			      ));

	// helptext, %1 is replaced by a filename
	string helptext = sformat(_("This view shows the content of %1."), file);

	Wizard::RestoreHelp(helptext);

	LogViewCore::Start(`id(`log), $[ "file" : file ]);
    }


    void HandleLogPanel(any user_data, map event)
    {
	switch (Event::IsWidgetActivated(event))
	{
	    case `update:
		LogViewCore::Update(`id(`log));
		break;
	}

	switch (Event::IsTimeout(event))
	{
	    case `timeout:
		LogViewCore::Update(`id(`log));
		break;
	}
    }


    void DestroyLogPanel(any user_data)
    {
	LogViewCore::Stop();
    }
}

ACC SHELL 2018