Author: aschnell
Date: Mon Jun 23 11:48:37 2008
New Revision: 48485
URL: http://svn.opensuse.org/viewcvs/yast?rev=48485&view=rev
Log:
- remember default mount by
Modified:
branches/tmp/aschnell/part-redesign/storage/src/include/ep-settings.ycp
branches/tmp/aschnell/part-redesign/storage/src/modules/Storage.ycp
branches/tmp/aschnell/part-redesign/storage/src/modules/StorageSettings.ycp
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=48485&r1=48484&r2=48485&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 Jun 23 11:48:37 2008
@@ -8,62 +8,40 @@
textdomain "storage";
- map fs = $[ `ext2 : "ext2",
- `ext3 : "ext3",
- `reiserfs : "reiserfs" ];
-
-
- symbol default_mountby = `uuid;
- symbol default_fs = `ext2;
-
-
- void LoadSettings()
- {
- string tmp = (string) SCR::Read(.sysconfig.storage.DEFAULT_FS);
- foreach(symbol k, string v, fs, { if (tmp == v) default_fs = k; });
- }
-
-
- void SaveSettings()
- {
- SCR::Write(.sysconfig.storage.DEFAULT_FS, fs[default_fs]:"");
- }
-
-
void CreateSettingsPanel(any user_data)
{
UI::ReplaceWidget(`tree_panel,
Greasemonkey::Transform(
- `VBox(
- `IconAndHeading(_("Settings"), settings_icon),
`VBox(
- `Left(`ComboBoxSelected(`id(`display_name), `opt(`notify),
- //FIXME: find some better wording
- "Preferred Display Name",
- [`item(`id(`device), "Device Name"),
- `item(`id(`id), "Device ID"),
- `item(`id(`path), "Device Path")],
- `id(StorageSettings::GetDisplayName()))),
- `Left(`ComboBoxSelected(`id(`default_mountby),
- "Default Mount by",
- [`item(`id(`device), "Device Name"),
- `item(`id(`label), "Volume Label"),
- `item(`id(`uuid), "UUID"),
- `item(`id(`id), "Device ID"),
- `item(`id(`path), "Device Path")],
- `id(default_mountby))),
- `Left(`ComboBoxSelected(`id(`default_fs),
- "Default Filesystem",
- [`item(`id(`ext2), "Ext2"),
- `item(`id(`ext3), "Ext3"),
- `item(`id(`reiserfs), "ReiserFS"),
- `item(`id(`xfs), "XFS")],
- `id(default_fs)))
- ),
- `VStretch()
- )));
+ `IconAndHeading(_("Settings"), settings_icon),
+ `VBox(
+ `Left(`ComboBoxSelected(`id(`display_name), `opt(`notify),
+ _("Display Name"),
+ [ `item(`id(`device), _("Device Name")),
+ `item(`id(`id), _("Device ID")),
+ `item(`id(`path), _("Device Path")) ],
+ `id(StorageSettings::GetDisplayName()))),
+ `Left(`ComboBoxSelected(`id(`default_mountby),
+ _("Default Mount by"),
+ [ `item(`id(`device), _("Device Name")),
+ `item(`id(`label), _("Volume Label")),
+ `item(`id(`uuid), _("UUID")),
+ `item(`id(`id), _("Device ID")),
+ `item(`id(`path), _("Device Path")) ],
+ `id(Storage::GetDefaultMountBy()))),
+ `Left(`ComboBoxSelected(`id(`default_fs),
+ _("Default Filesystem"),
+ // TODO
+ [ `item(`id(`ext2), "Ext2"),
+ `item(`id(`ext3), "Ext3"),
+ `item(`id(`reiserfs), "ReiserFS"),
+ `item(`id(`xfs), "XFS") ],
+ `id(Storage::GetDefaultFs())))
+ ),
+ `VStretch()
+ )));
- Wizard::RestoreHelp("Settings help");
+ Wizard::RestoreHelp("TODO");
}
@@ -78,7 +56,7 @@
void DestroySettingsPanel(any user_data)
{
- default_mountby = (symbol) UI::QueryWidget(`id(`default_mountby), `Value);
- default_fs = (symbol) UI::QueryWidget(`id(`default_fs), `Value);
+ Storage::SetDefaultMountBy((symbol) UI::QueryWidget(`id(`default_mountby), `Value));
+ Storage::SetDefaultFs((symbol) UI::QueryWidget(`id(`default_fs), `Value));
}
}
Modified: branches/tmp/aschnell/part-redesign/storage/src/modules/Storage.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/storage/src/modules/Storage.ycp?rev=48485&r1=48484&r2=48485&view=diff
==============================================================================
--- branches/tmp/aschnell/part-redesign/storage/src/modules/Storage.ycp (original)
+++ branches/tmp/aschnell/part-redesign/storage/src/modules/Storage.ycp Mon Jun 23 11:48:37 2008
@@ -7002,6 +7002,36 @@
}
}
+
+global void SetDefaultFs(symbol mby)
+{
+ // TODO
+}
+
+
+global symbol GetDefaultFs()
+{
+ // TODO
+ // there is already Partitions::DefaultFs and Partitions::DefaultBootFs
+ return `ext3;
+}
+
+
+global void SetDefaultMountBy(symbol mby)
+{
+ integer val = fromSymbol( conv_mountby, mby );
+ LibStorage::StorageInterface::setDefaultMountBy(sint, val);
+}
+
+
+global symbol GetDefaultMountBy()
+{
+ integer val = LibStorage::StorageInterface::getDefaultMountBy(sint);
+ symbol ret = toSymbol(conv_mountby, val);
+ return ret;
+}
+
+
global symbol GetMountBy( string device )
{
integer val = 0;
Modified: branches/tmp/aschnell/part-redesign/storage/src/modules/StorageSettings.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/storage/src/modules/StorageSettings.ycp?rev=48485&r1=48484&r2=48485&view=diff
==============================================================================
--- branches/tmp/aschnell/part-redesign/storage/src/modules/StorageSettings.ycp (original)
+++ branches/tmp/aschnell/part-redesign/storage/src/modules/StorageSettings.ycp Mon Jun 23 11:48:37 2008
@@ -11,6 +11,9 @@
textdomain "storage";
+ import "Storage";
+
+
symbol display_name = nil;
list<symbol> hidden_fields = nil;
@@ -118,5 +121,17 @@
}), " ");
SCR::Write(.sysconfig.storage.HIDDEN_FIELDS, tmp);
}
+
+ if (true)
+ {
+ string tmp = substring(tostring(Storage::GetDefaultMountBy()), 1);
+ SCR::Write(.sysconfig.storage.DEVICE_NAMES, tmp);
+ }
+
+ if (true)
+ {
+ string tmp = substring(tostring(Storage::GetDefaultFs()), 1);
+ SCR::Write(.sysconfig.storage.DEFAULT_FS, tmp);
+ }
}
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org