Author: kmachalkova Date: Tue Apr 21 16:03:47 2009 New Revision: 56893 URL: http://svn.opensuse.org/viewcvs/yast?rev=56893&view=rev Log: Moving 'Rescan' button and other module configs menu to the main screen Modified: trunk/storage/storage/src/include/ep-all.ycp trunk/storage/storage/src/include/ep-hd.ycp Modified: trunk/storage/storage/src/include/ep-all.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-all.ycp?rev=56893&r1=56892&r2=56893&view=diff ============================================================================== --- trunk/storage/storage/src/include/ep-all.ycp (original) +++ trunk/storage/storage/src/include/ep-all.ycp Tue Apr 21 16:03:47 2009 @@ -7,9 +7,25 @@ { textdomain "storage"; + import "Arch"; + import "PackageCallbacks"; + import "PackageSystem"; + void CreateAllPanel(any user_data) { + + boolean IsAvailable ( string client ) + { + //in the installed system, we don't care if the client isn't there + //as the user will be prompted to install the pkg anyway (in CallConfig) + if ( !Stage::initial() ) + return true; + //check if the client is in inst-sys + else + return WFM::ClientExists(client); + } + string short_hostname = Hostname::CurrentHostname(); list<symbol> fields = StorageSettings::FilterTable([ `device, `udev_path, `udev_id, `size, @@ -21,14 +37,45 @@ term table_header = StorageFields::TableHeader(fields); list<term> table_contents = StorageFields::TableContents(fields, target_map, StorageFields::PredicateAll); - term buttons = `HBox(); + term buttons = `HBox( + // push button text + `PushButton(`id(`rescan), `opt(`key_F6), _("Rescan Devices")) + ); if (Mode::installation()) { // push button text buttons = add(buttons, `PushButton(`id(`import), _("Import Mount Points..."))); - buttons = add(buttons, `HStretch()); } + buttons = add(buttons, `HStretch()); + + list<term> configs = []; + + if (IsAvailable("iscsi-client")) { + // menu entry text + configs = add(configs, `item(`id(`iscsi), `icon("yast-iscsi-client"), _("Configure &iSCSI..."))); + } + + if (true) { + // menu entry text + configs = add(configs, `item(`id(`multipath), `icon("yast-iscsi-server"), _("Configure &Multipath..."))); + } + + if (Arch::s390() && IsAvailable("s390")) { + // menu entry text + configs = add(configs, `item(`id(`dasd), `icon("yast-dasd"), _("Configure &DASD..."))); + // menu entry text + configs = add(configs, `item(`id(`zfcp), `icon("yast-zfcp"), _("Configure &zFCP..."))); + // menu entry text + configs = add(configs, `item(`id(`xpram), `icon("yast-xpram"), _("Configure &XPRAM..."))); + } + + if (size(configs) > 0) { + // menu button text + buttons = add(buttons, `MenuButton(`opt(`key_F7), _("Configure..."), configs)); + } + + UI::ReplaceWidget(`tree_panel, Greasemonkey::Transform( `VBox( @@ -66,8 +113,55 @@ void HandleAllPanel(any user_data, map event) { + + boolean CheckAndInstallPackages( list <string> pkgs ) + { + if (Stage::initial()) + return true; + + boolean ret = false; + //switch off pkg-mgmt loading progress dialogs, + //because it just plain sucks + PackageCallbacks::RegisterEmptyProgressCallbacks(); + ret = PackageSystem::CheckAndInstallPackages(pkgs); + PackageCallbacks::RestorePreviousProgressCallbacks(); + + return ret; + } + + void CallConfig(string text, list<string> pkgs, string call) + { + boolean doit = true; + + if (!Storage::EqualBackupStates("expert-partitioner", "", true)) + { + doit = Popup::YesNo(text); + } + + if (doit) + { + if (pkgs == nil || CheckAndInstallPackages(pkgs)) + { + if (call != nil) + WFM::call(call); + RescanDisks(); + Storage::CreateTargetBackup("expert-partitioner"); + + UpdateMainStatus(); + UpdateNavigationTree(nil); + TreePanel::Create(); + } + } + } + switch (Event::IsWidgetActivated(event)) { + case `rescan: + // popup text + CallConfig(_("Rescaning disks cancels all current changes. +Really rescan disks?"), nil, nil); + break; + case `import: ImportMountPoints(); @@ -77,6 +171,45 @@ break; } + switch (Event::IsMenu(event)) + { + case `iscsi: + // popup text + CallConfig(_("Calling iSCSI configuration cancels all current changes. +Really call iSCSI configuration?"), ["yast2-iscsi-client"], "iscsi-client"); + break; + + case `multipath: + if ((ProductFeatures::GetBooleanFeature("partitioning", "use_separate_multipath_module") == true) || + (Mode::normal() && WFM::ClientExists("multipath"))) + // popup text + CallConfig(_("Calling Multipath configuration cancels all current changes. +Really call Multipath configuration?"), ["yast2-multipath"], "multipath"); + else + // popup text + CallConfig(_("Calling Multipath configuration cancels all current changes. +Really call Multipath configuration?"), nil, "multipath-simple"); + break; + + case `dasd: + // popup text + CallConfig(_("Calling DASD configuration cancels all current changes. +Really call DASD configuration?"), ["yast2-s390"], "dasd"); + break; + + case `zfcp: + // popup text + CallConfig(_("Calling zFCP configuration cancels all current changes. +Really call zFCP configuration?"), ["yast2-s390"], "zfcp"); + break; + + case `xpram: + // popup text + CallConfig(_("Calling XPRAM configuration cancels all current changes. +Really call XPRAM configuration?"), ["yast2-s390"], "xpram"); + break; + } + switch (Event::IsWidgetContextMenuActivated(event)) { case `table: Modified: trunk/storage/storage/src/include/ep-hd.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-hd.ycp?rev=56893&r1=56892&r2=56893&view=diff ============================================================================== --- trunk/storage/storage/src/include/ep-hd.ycp (original) +++ trunk/storage/storage/src/include/ep-hd.ycp Tue Apr 21 16:03:47 2009 @@ -8,8 +8,6 @@ textdomain "storage"; import "Arch"; - import "PackageCallbacks"; - import "PackageSystem"; import "Region"; import "Mode"; import "Stage"; @@ -66,16 +64,7 @@ return StorageFields::PredicateDiskType(disk, partition, [`CT_DMRAID, `CT_DMMULTIPATH, `CT_DISK]); } - boolean IsAvailable ( string client ) - { - //in the installed system, we don't care if the client isn't there - //as the user will be prompted to install the pkg anyway (in CallConfig) - if ( !Stage::initial() ) - return true; - //check if the client is in inst-sys - else - return WFM::ClientExists(client); - } + list<symbol> fields = StorageSettings::FilterTable([ `device, `udev_path, `udev_id, `size, `format, `type, `fs_type, `label, `mount_point, `mount_by, @@ -87,38 +76,9 @@ list<term> table_contents = StorageFields::TableContents(fields, target_map, Predicate); term buttons = `HBox( - // push button text - `PushButton(`id(`rescan), `opt(`key_F6), _("Rescan Disks")) + `HStretch() ); - buttons = add(buttons, `HStretch()); - - list<term> configs = []; - - if (IsAvailable("iscsi-client")) { - // menu entry text - configs = add(configs, `item(`id(`iscsi), `icon("yast-iscsi-client"), _("Configure &iSCSI..."))); - } - - if (true) { - // menu entry text - configs = add(configs, `item(`id(`multipath), `icon("yast-iscsi-server"), _("Configure &Multipath..."))); - } - - if (Arch::s390() && IsAvailable("s390")) { - // menu entry text - configs = add(configs, `item(`id(`dasd), `icon("yast-dasd"), _("Configure &DASD..."))); - // menu entry text - configs = add(configs, `item(`id(`zfcp), `icon("yast-zfcp"), _("Configure &zFCP..."))); - // menu entry text - configs = add(configs, `item(`id(`xpram), `icon("yast-xpram"), _("Configure &XPRAM..."))); - } - - if (size(configs) > 0) { - // menu button text - buttons = add(buttons, `MenuButton(`opt(`key_F7), _("Configure..."), configs)); - } - UI::ReplaceWidget(`tree_panel, Greasemonkey::Transform( `VBox( @@ -141,96 +101,6 @@ void HandleHdMainPanel(any user_data, map event) { - boolean CheckAndInstallPackages( list <string> pkgs ) - { - if (Stage::initial()) - return true; - - boolean ret = false; - //switch off pkg-mgmt loading progress dialogs, - //because it just plain sucks - PackageCallbacks::RegisterEmptyProgressCallbacks(); - ret = PackageSystem::CheckAndInstallPackages(pkgs); - PackageCallbacks::RestorePreviousProgressCallbacks(); - - return ret; - } - - void CallConfig(string text, list<string> pkgs, string call) - { - boolean doit = true; - - if (!Storage::EqualBackupStates("expert-partitioner", "", true)) - { - doit = Popup::YesNo(text); - } - - if (doit) - { - if (pkgs == nil || CheckAndInstallPackages(pkgs)) - { - if (call != nil) - WFM::call(call); - RescanDisks(); - Storage::CreateTargetBackup("expert-partitioner"); - - UpdateMainStatus(); - UpdateNavigationTree(nil); - TreePanel::Create(); - } - } - } - - - switch (Event::IsWidgetActivated(event)) - { - case `rescan: - // popup text - CallConfig(_("Rescaning disks cancels all current changes. -Really rescan disks?"), nil, nil); - break; - } - - switch (Event::IsMenu(event)) - { - case `iscsi: - // popup text - CallConfig(_("Calling iSCSI configuration cancels all current changes. -Really call iSCSI configuration?"), ["yast2-iscsi-client"], "iscsi-client"); - break; - - case `multipath: - if ((ProductFeatures::GetBooleanFeature("partitioning", "use_separate_multipath_module") == true) || - (Mode::normal() && WFM::ClientExists("multipath"))) - // popup text - CallConfig(_("Calling Multipath configuration cancels all current changes. -Really call Multipath configuration?"), ["yast2-multipath"], "multipath"); - else - // popup text - CallConfig(_("Calling Multipath configuration cancels all current changes. -Really call Multipath configuration?"), nil, "multipath-simple"); - break; - - case `dasd: - // popup text - CallConfig(_("Calling DASD configuration cancels all current changes. -Really call DASD configuration?"), ["yast2-s390"], "dasd"); - break; - - case `zfcp: - // popup text - CallConfig(_("Calling zFCP configuration cancels all current changes. -Really call zFCP configuration?"), ["yast2-s390"], "zfcp"); - break; - - case `xpram: - // popup text - CallConfig(_("Calling XPRAM configuration cancels all current changes. -Really call XPRAM configuration?"), ["yast2-s390"], "xpram"); - break; - } - - switch (Event::IsWidgetContextMenuActivated(event)) { case `table: -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org