Author: jsrain
Date: Thu Aug 21 13:43:15 2008
New Revision: 50266
URL: http://svn.opensuse.org/viewcvs/yast?rev=50266&view=rev
Log:
dead code removal
Removed:
trunk/power-management/src/misc.ycp
Modified:
trunk/power-management/src/Makefile.am
trunk/power-management/src/PowerManagement.ycp
trunk/power-management/src/widgets.ycp
Modified: trunk/power-management/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/power-management/src/Makefile.am?rev=50266&r1=50265&r2=50266&view=diff
==============================================================================
--- trunk/power-management/src/Makefile.am (original)
+++ trunk/power-management/src/Makefile.am Thu Aug 21 13:43:15 2008
@@ -14,8 +14,7 @@
wizards.ycp \
dialogs.ycp \
widgets.ycp \
- commandline.ycp \
- misc.ycp
+ commandline.ycp
desktop_DATA = \
power-management.desktop
Modified: trunk/power-management/src/PowerManagement.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/power-management/src/PowerManagement.ycp?rev=50266&r1=50265&r2=50266&view=diff
==============================================================================
--- trunk/power-management/src/PowerManagement.ycp (original)
+++ trunk/power-management/src/PowerManagement.ycp Thu Aug 21 13:43:15 2008
@@ -153,39 +153,6 @@
return modified;
}
-global list<string> GetActions()
-{
- return permissions_actions;
-}
-
-global string GetPermission(string action)
-{
- return global_permissions[action]:nil;
-}
-
-global boolean SetPermission(string action, string permission)
-{
- if (!contains(permissions_actions, action))
- {
- y2error("Unknown action '%1', supported: %2", action, permissions_actions);
- return false;
- }
- else if (permission == nil)
- {
- y2error("Invalid permission: %1", permission);
- }
- else
- {
- if (global_permissions[action]:nil != permission)
- {
- modified = true;
- }
-
- global_permissions[action] = permission;
- return true;
- }
-}
-
/**
* Read all power-management settings
* @return true on success
@@ -284,7 +251,6 @@
string v = (string)SCR::Read (add (p, conf));
scheme[key] = v;
});
-y2internal ("Scheme: %1", scheme);
return scheme;
});
new_schemes = $[];
@@ -485,35 +451,20 @@
* @return summary of the current configuration
*/
global list<string> Summary() {
- string ac_scheme = "";
- string bat_scheme = "";
-
- string scheme = PowerManagement::global_settings["AC_SCHEME"]:"";
+ string scheme = PowerManagement::global_settings["SCHEME"]:"";
if (scheme == "")
- scheme = "performance";
-
- foreach (map s, schemes, ``{
- if (s["_scheme_id"]:"" == scheme)
- ac_scheme = s["SCHEME_DESCRIPTION"]:"";
- });
- if (ac_scheme == "")
- ac_scheme = scheme;
-
- scheme = PowerManagement::global_settings["BATTERY_SCHEME"]:"";
- if (scheme == "")
- scheme = "performance";
- foreach (map s, schemes, ``{
+ scheme = _("Default settings");
+ else
+ {
+ foreach (map s, schemes, ``{
if (s["_scheme_id"]:"" == scheme)
- bat_scheme = s["SCHEME_DESCRIPTION"]:"";
- });
- if (bat_scheme == "")
- bat_scheme = scheme;
+ scheme = s["SCHEME_DESCRIPTION"]:"";
+ });
+ }
list<string> ret = [
// summary text, %1 is scheme name
- sformat (_("AC Scheme: %1"), ac_scheme),
- // summary text, %1 is scheme name
- sformat (_("Battery Scheme: %1"), bat_scheme),
+ sformat (_("Selected Scheme: %1"), scheme),
];
y2milestone ("Power management summary: %1", ret);
@@ -531,21 +482,6 @@
}
/**
- * List all supported ACPI modes
- * @return a list containing all supported ACPI modes
- */
-global list<string> ACPIModes () {
- if (acpi_modes == nil)
- {
- string modes = (string)SCR::Read (.target.string, "/proc/acpi/sleep");
- list<string> spl = splitstring (modes, " \t");
- spl = filter (string s, spl, {return s != "" && s != "\n";});
- acpi_modes = spl;
- }
- return acpi_modes;
-}
-
-/**
* Translate a text using powersave mo-file
* @param text string to translate
* @return string translated text
Modified: trunk/power-management/src/widgets.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/power-management/src/widgets.ycp?rev=50266&r1=50265&r2=50266&view=diff
==============================================================================
--- trunk/power-management/src/widgets.ycp (original)
+++ trunk/power-management/src/widgets.ycp Thu Aug 21 13:43:15 2008
@@ -17,7 +17,6 @@
import "String";
include "power-management/helps.ycp";
-include "power-management/misc.ycp";
// scheme selection widget
@@ -559,310 +558,6 @@
];
}
-// cpu cooling policy widget
-
-/**
- * Init function of a widget
- * @param key string widget id
- */
-define void CoolingPolicyInit (string key) {
- string value = (string)
- PowerManagement::current_scheme["COOLING_POLICY"]:"";
- if (value == "")
- value = "passive";
- UI::ChangeWidget (`id (`cooling_policy), `Value, value);
- UI::ChangeWidget (`id (`overheat), `Value,
- PowerManagement::current_scheme["THERMAL_HOT_ACTION"]:
- "notify");
- UI::ChangeWidget (`id (`overheat_critical), `Value,
- PowerManagement::current_scheme["THERMAL_CRITICAL_ACTION"]:
- "suspend");
-}
-
-/**
- * Store settings of a widget
- * @param key string widget id
- * @param event map event that caused storing of widget settings
- */
-define void CoolingPolicyStore (string key, map event) {
- PowerManagement::current_scheme["COOLING_POLICY"]
- = (string)UI::QueryWidget (`id (`cooling_policy), `Value);
- PowerManagement::current_scheme["THERMAL_HOT_ACTION"]
- = (string)UI::QueryWidget (`id (`overheat), `Value);
- PowerManagement::current_scheme["THERMAL_CRITICAL_ACTION"]
- = (string)UI::QueryWidget (`id (`overheat_critical), `Value);
-}
-
-/**
- * Get description map of a widget
- * @return a map widget description map
- */
-define map getCoolingPolicyWidget () {
- return $[
- "widget" : `custom,
- // frame
- "custom_widget" : `Frame (_("Cooling Policy"), `VBox (
- // combo box
- `ComboBox (`id (`cooling_policy), `opt (`hstretch), _("&Status"), [
- //combo box item
- `item (`id ("active"), _("Active")),
- // combo box item
- `item (`id ("passive"),_("Passive")),
- ]),
- `ComboBox (`id (`overheat),
- `opt (`hstretch),
- // combo box
- _("&Overheat Temperature Action"), []),
-// GetAcpiThermalEventHandlers ()),
- `ComboBox (`id (`overheat_critical),
- `opt (`hstretch),
- // combo box
- _("&Critical Temperature Action"), [])
-// GetAcpiThermalEventHandlers ())
- )),
- "init" : CoolingPolicyInit,
- "store" : CoolingPolicyStore,
- "help" : HELPS["cooling_policy"]:"",
- ];
-}
-
-// allow screen saver widget
-
-/**
- * Init function of a widget
- * @param key string widget id
- */
-define void ScreensaverInit (string key) {
- boolean value = tolower ((string)
- PowerManagement::current_scheme["DISABLE_SCREEN_SAVER"]:"")
- == "yes"
- ? false
- : true;
- UI::ChangeWidget (`id ("enable_screensaver"), `Value, value);
-}
-
-/**
- * Store settings of a widget
- * @param key string widget id
- * @param event map event that caused storing of widget settings
- */
-define void ScreensaverStore (string key, map event) {
- PowerManagement::current_scheme["DISABLE_SCREEN_SAVER"]
- = (boolean)UI::QueryWidget (`id ("enable_screensaver"), `Value)
- ? "no"
- : "yes";
-}
-
-/**
- * Get description map of a widget
- * @return a map widget description map
- */
-define map getScreensaverWidget () {
- return $[
- "widget" : `custom,
- "custom_widget" : `Frame (
- // frame
- _("Screen Saver Settings"),
- `HBox (
- `HSpacing (2),
- `VBox (
- `VSpacing (1),
- `Left (`CheckBox (`id ("enable_screensaver"),
- // check box
- _("Enable &Screen Saver"))),
- `VSpacing (1)
- ),
- `HSpacing (2)
- )
- ),
- "help" : HELPS["allow_screensaver"]:"",
- "init" : ScreensaverInit,
- "store" : ScreensaverStore,
- ];
-}
-
-// DPMS widget
-
-/**
- * Handle function of a widget
- * @param key string widget id
- * @param event map event that will be handled
- * @return symbol for wizard sequencer
- */
-define symbol DpmsHandle (string key, map event) {
- boolean enabled = (boolean)UI::QueryWidget (`id (`enable_dpms), `Value);
- UI::ChangeWidget (`id (`dpms_stdby), `Enabled, enabled);
- UI::ChangeWidget (`id (`dpms_susp), `Enabled, enabled);
- UI::ChangeWidget (`id (`dpms_off), `Enabled, enabled);
- return nil;
-}
-
-/**
- * Init function of a widget
- * @param key string widget id
- */
-define void DpmsInit (string key) {
- boolean value = tolower ((string)
- PowerManagement::current_scheme["DISABLE_DPMS"]:"")
- == "yes"
- ? false
- : true;
- UI::ChangeWidget (`id (`enable_dpms), `Value, value);
- UI::ChangeWidget (`id (`dpms_stdby), `Value, tointeger (
- PowerManagement::current_scheme["DPMS_STANDBY"]:"10"));
- UI::ChangeWidget (`id (`dpms_susp), `Value, tointeger (
- PowerManagement::current_scheme["DPMS_SUSPEND"]:"20"));
- UI::ChangeWidget (`id (`dpms_off), `Value, tointeger (
- PowerManagement::current_scheme["DPMS_OFF"]:"30"));
- DpmsHandle (key, $[]);
-}
-
-/**
- * Store settings of a widget
- * @param key string widget id
- * @param event map event that caused storing of widget settings
- */
-define void DpmsStore (string key, map event) {
- PowerManagement::current_scheme["DISABLE_DPMS"]
- = (boolean)UI::QueryWidget (`id (`enable_dpms), `Value)
- ? "no"
- : "yes";
- PowerManagement::current_scheme["DPMS_STANDBY"]
- = sformat ("%1", UI::QueryWidget (`id (`dpms_stdby), `Value));
- PowerManagement::current_scheme["DPMS_SUSPEND"]
- = sformat ("%1", UI::QueryWidget (`id (`dpms_susp), `Value));
- PowerManagement::current_scheme["DPMS_OFF"]
- = sformat ("%1", UI::QueryWidget (`id (`dpms_off), `Value));
-}
-
-/**
- * Get description map of a widget
- * @return a map widget description map
- */
-define map getDpmsWidget () {
- return $[
- "widget" : `custom,
- "custom_widget" : `Frame (
- // frame
- // Display is a substantive (screen)
- _("Display Power Management Settings"),
- `HBox (
- `HSpacing (2),
- `VBox (
- `VSpacing (1),
- `Left (`CheckBox (`id (`enable_dpms), `opt (`notify),
- // check box
- // Display is a substantive (screen)
- _("Enable &Display Power Management"))),
- `VSpacing (1),
- `IntField (`id (`dpms_stdby),
- // int field
- // Display is a substantive (screen)
- _("Display S&tandby Time-Out (minutes)"), 0, 120, 1),
- `IntField (`id (`dpms_susp),
- // int field
- // Display is a substantive (screen)
- _("Display &Suspend Time-Out (minutes)"), 0, 120, 2),
- `IntField (`id (`dpms_off),
- // int field
- // Display is a substantive (screen)
- _("Display Power &Off Time-Out (minutes)"), 0, 120, 3),
- `VSpacing (1)
- ),
- `HSpacing (2)
- )
- ),
- "help" : HELPS["dpms"]:"",
- "init" : DpmsInit,
- "store" : DpmsStore,
- "handle" : DpmsHandle,
- ];
-}
-
-// suspend timeout widget
-
-/**
- * Handle function of a widget
- * @param key string widget id
- * @param event map event that will be handled
- * @return symbol for wizard sequencer
- */
-/*define symbol SuspendTimeoutHandle (string key, map event) {
- boolean enabled = (boolean)
- UI::QueryWidget (`id ("enable_suspend_timeout"), `Value);
- UI::ChangeWidget (`id ("suspend_timeout"), `Enabled, enabled);
- UI::ChangeWidget (`id ("suspend_method"), `Enabled, enabled);
- return nil;
-}
-
-/**
- * Init function of a widget
- * @param key string widget id
- */
-/*define void SuspendTimeoutInit (string key) {
- UI::ChangeWidget (`id ("suspend_method"), `Value,
- PowerManagement::current_scheme["SUSPEND_METHOD"]:"standby");
- string timeout_str = (string)
- PowerManagement::current_scheme["SUSPEND_TIMEOUT"]:"";
- if (timeout_str == "")
- timeout_str = "1";
- integer timeout = tointeger (timeout_str);
- UI::ChangeWidget (`id ("enable_suspend_timeout"), `Value,
- timeout != 0);
- UI::ChangeWidget (`id ("suspend_timeout"), `Value, timeout);
- SuspendTimeoutHandle (key, $[]);
-}
-
-/**
- * Store settings of a widget
- * @param key string widget id
- * @param event map event that caused storing of widget settings
- */
-/*define void SuspendTimeoutStore (string key, map event) {
- boolean enabled = (boolean)
- UI::QueryWidget (`id ("enable_suspend_timeout"), `Value);
- PowerManagement::current_scheme["SUSPEND_TIMEOUT"] = enabled
- ? sformat ("%1", UI::QueryWidget (`id ("suspend_timeout"), `Value))
- : "0";
- PowerManagement::current_scheme["SUSPEND_METHOD"]
- = (string)UI::QueryWidget (`id ("suspend_method"), `Value);
-}
-
-/**
- * Get description map of a widget
- * @return a map widget description map
- */
-/*define map getSuspendTimeoutWidget () {
- return $[
- "widget" : `custom,
- "custom_widget" : `Frame (_("Syspend Suspend Settings"), `HBox (
- `HSpacing (2),
- `VBox (
- `VSpacing (1),
- `Left (`CheckBox (`id ("enable_suspend_timeout"),
- `opt (`notify),
- _("Enable System Suspend Timeout"))),
- `IntField (`id ("suspend_timeout"),
- _("Suspend Timeout (minutes)"), 1, 360, 1),
- `ComboBox (`id ("suspend_method"), `opt (`hstretch),
- _("Suspend Method"),
- [
- `item (`id ("standby"), _("Standby")),
- `item (`id ("str"), _("Suspend to RAM")),
- `item (`id ("std"), _("Suspend to disk")),
- ]),
- `VSpacing (1)
- ),
- `HSpacing (2)
- )),
- "help" : HELPS["suspend_timeout"]:"",
- "init" : SuspendTimeoutInit,
- "store" : SuspendTimeoutStore,
- "handle" : SuspendTimeoutHandle,
- "handle_events" : ["enable_suspend_timeout"],
- ];
-}
-*/
// general settings
map > widgets = $[
@@ -872,11 +567,6 @@
"scheme_descr" : getSchemeDescrWidget (),
"hard_disk" : getHardDiskWidget (),
"cpu" : getCpuWidget (),
-
- "cooling_policy" : getCoolingPolicyWidget (),
- "screensaver" : getScreensaverWidget (),
- "dpms" : getDpmsWidget (),
-// "suspend_timeout" : getSuspendTimeoutWidget ()
];
/* EOF */
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org