Author: kmachalkova
Date: Fri Feb 6 17:14:37 2009
New Revision: 55314
URL: http://svn.opensuse.org/viewcvs/yast?rev=55314&view=rev
Log:
- Add HTML summary of storage settings (if modified)
to partitioning summary on both sum-up screens
- Write configuration also when only sysconfig settings
were modified
Modified:
trunk/storage/storage/src/include/ep-main.ycp
trunk/storage/storage/src/include/ep-settings.ycp
trunk/storage/storage/src/include/ep-summary.ycp
trunk/storage/storage/src/modules/StorageSettings.ycp
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=55314&r1=55313&r2=55314&view=diff
==============================================================================
--- trunk/storage/storage/src/include/ep-main.ycp (original)
+++ trunk/storage/storage/src/include/ep-main.ycp Fri Feb 6 17:14:37 2009
@@ -76,7 +76,7 @@
{
if (Mode::normal())
{
- string next_label = Storage::EqualBackupStates("expert-partitioner", "", true) ?
+ string next_label = Storage::EqualBackupStates("expert-partitioner", "", true) ?
Label::FinishButton() : Label::NextButton();
Wizard::SetNextButton(`next, next_label);
@@ -229,8 +229,9 @@
boolean ReallyQuit( string label )
{
// popup text, %1 will be replaces with button text
- string text = sformat(_("You have changed the partitioning. These changes will be lost
-if you exit the partitioner with %1. Really exit?"), deletechars(label, "&"));
+ string text = sformat(_("You have changed the partitioning or storage settings. These changes
+will be lost if you exit the partitioner with %1.
+Really exit?"), deletechars(label, "&"));
return Popup::YesNo(text);
}
@@ -251,7 +252,11 @@
symbol SummaryDialog()
{
symbol ret = `none;
- string summary = Storage::ChangeText();
+ string summary = Storage::ChangeText() +
+ ( StorageSettings::GetModified() ?
+ StorageSettings::Summary() :
+ "");
+
y2milestone("Summary of changes: %1", summary);
Wizard::CreateDialog();
@@ -364,7 +369,7 @@
} break;
case `next: {
- if (!Storage::EqualBackupStates("expert-partitioner", "", true))
+ if (!Storage::EqualBackupStates("expert-partitioner", "", true) || StorageSettings::GetModified())
{
if (!check_created_partition_table(Storage::GetTargetMap(),
Stage::initial() && !Mode::repair()))
Modified: trunk/storage/storage/src/include/ep-settings.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-settings.ycp?rev=55314&r1=55313&r2=55314&view=diff
==============================================================================
--- trunk/storage/storage/src/include/ep-settings.ycp (original)
+++ trunk/storage/storage/src/include/ep-settings.ycp Fri Feb 6 17:14:37 2009
@@ -61,12 +61,12 @@
// dialog heading
`IconAndHeading(_("Settings"), StorageIcons::settings_icon),
`VBox(
- `Left(`ComboBoxSelected(`id(`default_mountby),
+ `Left(`ComboBoxSelected(`id(`default_mountby),`opt(`notify),
// combo box label
_("Default Mount by"),
CBItems,
`id(Storage::GetDefaultMountBy()))),
- `Left(`ComboBoxSelected(`id(`default_fs),
+ `Left(`ComboBoxSelected(`id(`default_fs),`opt(`notify),
// combo box label
_("Default File System"),
[
@@ -96,7 +96,7 @@
//This looks extremely ugly, but obviously there are few other means how
//to make MultiSelection widget smaller, yet still readable
`Left(`HBox(
- `MultiSelectionBox(`id(`visible_fields), `opt(`shrinkable),
+ `MultiSelectionBox(`id(`visible_fields), `opt(`shrinkable, `notify),
// multi selection box label
_("Visible Information On Storage Devices"),
PreselectVisibleFields()),
@@ -138,24 +138,16 @@
StorageSettings::SetDisplayName((symbol) UI::QueryWidget(`id(`display_name), `Value));
UpdateNavigationTree(nil);
}
+ if (!StorageSettings::GetModified())
+ {
+ StorageSettings::SetModified();
+ Wizard::SetNextButton(`next, Label::NextButton());
+ }
}
void DestroySettingsPanel(any user_data)
{
- list<symbol> InvertVisibleFields(list<symbol> hidden_fields, list <integer> selected)
- {
- foreach(integer i, Integer::Range(size(visible_fields)), {
- list<symbol> fields = visible_fields[i, `fields]:[];
- if (contains(selected, i))
- hidden_fields = multiset::difference(hidden_fields, fields);
- else
- hidden_fields = multiset::union(hidden_fields, fields);
- });
-
- return hidden_fields;
- }
-
list<integer> selected = (list<integer>) UI::QueryWidget(`id(`visible_fields), `SelectedItems);
list <string> selected_labels = [];
@@ -168,7 +160,6 @@
Storage::SetDefaultMountBy( default_mount );
Partitions::SetDefaultFs( default_fs );
- StorageSettings::SetHiddenFields(InvertVisibleFields(StorageSettings::GetHiddenFields(), selected));
- StorageSettings::CreateSummary( mount_bys[default_mount]:"", substring( tostring(default_fs), 1), selected_labels);
+ StorageSettings::InvertVisibleFields(visible_fields, selected);
}
}
Modified: trunk/storage/storage/src/include/ep-summary.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-summary.ycp?rev=55314&r1=55313&r2=55314&view=diff
==============================================================================
--- trunk/storage/storage/src/include/ep-summary.ycp (original)
+++ trunk/storage/storage/src/include/ep-summary.ycp Fri Feb 6 17:14:37 2009
@@ -10,11 +10,14 @@
void CreateSummaryPanel(any user_data)
{
- string summary = Storage::ChangeText();
+ string part_summary = Storage::ChangeText();
+ string config_summary = ( StorageSettings::GetModified() ?
+ StorageSettings::Summary() :
+ _("<p>No changes to storage settings.</p>") );
- if (isempty(summary))
+ if (isempty(part_summary))
{
- summary = _("<p>No changes to partitioning.</p>");
+ part_summary = _("<p>No changes to partitioning.</p>");
}
UI::ReplaceWidget(`tree_panel,
@@ -22,7 +25,7 @@
`VBox(
// dialog heading
`IconAndHeading(_("Installation Summary"), StorageIcons::summary_icon),
- `RichText(`id(`summary), summary)
+ `RichText(`id(`summary), part_summary + config_summary)
))
);
Modified: trunk/storage/storage/src/modules/StorageSettings.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/modules/StorageSettings.ycp?rev=55314&r1=55313&r2=55314&view=diff
==============================================================================
--- trunk/storage/storage/src/modules/StorageSettings.ycp (original)
+++ trunk/storage/storage/src/modules/StorageSettings.ycp Fri Feb 6 17:14:37 2009
@@ -13,16 +13,16 @@
import "Storage";
import "Partitions";
+ import "Integer";
symbol display_name = nil;
list<symbol> hidden_fields = nil;
+ list <string> visible_fields = [];
boolean modified = false;
- string summary = "";
-
global boolean GetModified()
{
return modified;
@@ -126,7 +126,26 @@
return filter(symbol field, fields, { return !setcontains(hidden, field); });
}
- global void CreateSummary( string default_mount, string default_fs, list <string> labels )
+ global void InvertVisibleFields(list < map