Author: kmachalkova
Date: Mon Jan 26 17:44:54 2009
New Revision: 55048
URL: http://svn.opensuse.org/viewcvs/yast?rev=55048&view=rev
Log:
Implementing our own variant of Popup::AnyQuestion
List of LVs/partitions can be long - show it as
RichText (Popup.ycp is rather unflexible in this
aspect)
Modified:
trunk/storage/storage/src/include/ep-dialogs.ycp
trunk/storage/storage/src/include/ep-lvm-dialogs.ycp
Modified: trunk/storage/storage/src/include/ep-dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-dialogs.ycp?rev=55048&r1=55047&r2=55048&view=diff
==============================================================================
--- trunk/storage/storage/src/include/ep-dialogs.ycp (original)
+++ trunk/storage/storage/src/include/ep-dialogs.ycp Mon Jan 26 17:44:54 2009
@@ -5,6 +5,7 @@
* Authors: Arvin Schnell
*/
{
+ import "Icon";
include "partitioning/custom_part_lib.ycp";
textdomain "storage";
@@ -835,4 +836,54 @@
UI::CloseDialog();
}
+
+ boolean ConfirmRecursiveDelete( string device, list<string> partitions,
+ string headline, string text_before,
+ string text_after )
+ {
+ string plist = "<ul>";
+
+ foreach( string one_part, partitions, {
+ plist = plist + "<li>" + one_part + "</li>";
+ });
+
+ plist = plist + "</ul>";
+
+ term button_box = `ButtonBox (
+ `PushButton(`id(`yes), `opt(`okButton), Label::DeleteButton() ),
+ `PushButton(`id(`no_button), `opt(`default, `cancelButton), Label::CancelButton())
+ );
+
+ map display_info = UI::GetDisplayInfo();
+ boolean has_image_support = display_info["HasImageSupport"]:false;
+
+ term layout =
+ `VBox (
+ `VSpacing (0.4),
+ `HBox (
+ has_image_support ? `Top (`Image(Icon::IconPath ("question"))) : `Empty(),
+ `HSpacing (1),
+ `VBox (
+ `Left (`Heading (headline)),
+ `VSpacing (0.2),
+ `Left( `Label( text_before ) ),
+ `VSpacing (0.2),
+ `Left(`RichText(plist)),
+ `VSpacing (0.2),
+ `Left(`Label( text_after)),
+ button_box
+ )
+ )
+ );
+
+ boolean success = (boolean) UI::OpenDialog( layout);
+ any ret = nil;
+
+ if( success ){
+ ret = UI::UserInput();
+ UI::CloseDialog();
+ }
+
+ return (ret == `yes);
+ }
}
Modified: trunk/storage/storage/src/include/ep-lvm-dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-lvm-dialogs.ycp?rev=55048&r1=55047&r2=55048&view=diff
==============================================================================
--- trunk/storage/storage/src/include/ep-lvm-dialogs.ycp (original)
+++ trunk/storage/storage/src/include/ep-lvm-dialogs.ycp Mon Jan 26 17:44:54 2009
@@ -75,22 +75,14 @@
boolean ConfirmVgDelete( string vgname, list <string> log_volumes )
{
- string lvlist = "";
-
- foreach( string one_volume, log_volumes, {
- lvlist = lvlist + one_volume + "\n";
- });
-
- //pop-up dialog title
- return Popup::AnyQuestion( _("Confirm Deleting of Volume Group"),
- //pop-up dialog message: %1 is vol.group name, %2 is a list of log. volumes
+ return ConfirmRecursiveDelete( vgname, log_volumes,
+ //pop-up dialog title
+ _("Confirm Deleting of Volume Group"),
+ //pop-up dialog message part 1: %1 is vol.group name
sformat( _("The volume group \"%1\" contains at least one logical
-volume. If you proceed, the following volumes will be deleted:\n
-%2
-Really delete volume group \"%1\" and all related logical volumes?"), vgname, lvlist),
- _("Delete"),
- _("Cancel"),
- `focus_no
+volume. If you proceed, the following volumes will be deleted:"), vgname),
+ //pop-up dialog message part 2: %1 is vol.group name
+ sformat( _("Really delete volume group \"%1\" and all related logical volumes?"), vgname)
);
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org