home *** CD-ROM | disk | FTP | other *** search
- /**
- * Module: StorageClients.ycp
- *
- * Authors: Thomas Fehr <fehr@suse.de>
- * Arvin Schnell <arvin@suse.de>
- *
- * Purpose: Define callbacks for libstorage.
- *
- * $Id: StorageClients.ycp 27261 2006-01-23 18:36:33Z fehr $
- */
-
- {
- module "StorageClients";
-
- import "Label";
- import "Popup";
- import "Report";
- import "StorageCallbacks";
-
- textdomain "storage";
-
- boolean enable_popup = false;
- list<string> texts = [];
-
-
- global void ProgressBar (string id, integer cur, integer max)
- {
- integer f = 100 * cur / max;
- UI::ChangeWidget (`id(`progress), `Value, f);
- }
-
- global void EnablePopup()
- {
- y2milestone( "EnablePopup" );
- enable_popup = true;
- if( size(texts)>0 )
- {
- y2milestone( "EnablePopup texts:%1", texts );
- foreach( string s, texts,
- ``{
- Report::Message(s);
- });
- }
- texts = [];
- }
-
-
- global void ShowInstallInfo (string text)
- {
- UI::ChangeWidget (`id(`progress), `Label, text);
- }
-
-
- global void InfoPopup (string text)
- {
- y2milestone( "InfoPopup enable:%1 txt:%2", enable_popup, text );
- if( enable_popup )
- Report::Message(text);
- else
- texts = add( texts, text );
- }
-
- global boolean YesNoPopup (string text)
- {
- y2milestone( "YesNoPopup txt:%1", text );
- return Report::AnyQuestion( Popup::NoHeadline(), text,
- Label::YesButton(), Label::NoButton(),
- `yes );
- }
-
- global define void InstallCallbacks()
- {
- y2milestone( "InstallCallbacks" );
- StorageCallbacks::ProgressBar ("StorageClients::ProgressBar");
- StorageCallbacks::ShowInstallInfo ("StorageClients::ShowInstallInfo");
- StorageCallbacks::InfoPopup ("StorageClients::InfoPopup");
- StorageCallbacks::YesNoPopup ("StorageClients::YesNoPopup");
- }
-
- }
-