https://git.reactos.org/?p=reactos.git;a=commitdiff;h=535b8dda8de52d85a5ad7…
commit 535b8dda8de52d85a5ad7c361524e9c100db37b6
Author: Eric Kohl <eric.kohl(a)reactos.org>
AuthorDate: Mon May 6 23:55:42 2019 +0200
Commit: Eric Kohl <eric.kohl(a)reactos.org>
CommitDate: Mon May 6 23:55:42 2019 +0200
[POWERCFG] Implement the power scheme 'Save As' feature
CORE-12565
---
dll/cpl/powercfg/lang/bg-BG.rc | 11 +++
dll/cpl/powercfg/lang/cs-CZ.rc | 11 +++
dll/cpl/powercfg/lang/de-DE.rc | 12 +++
dll/cpl/powercfg/lang/el-GR.rc | 11 +++
dll/cpl/powercfg/lang/en-US.rc | 11 +++
dll/cpl/powercfg/lang/es-ES.rc | 11 +++
dll/cpl/powercfg/lang/fr-FR.rc | 11 +++
dll/cpl/powercfg/lang/he-IL.rc | 11 +++
dll/cpl/powercfg/lang/id-ID.rc | 11 +++
dll/cpl/powercfg/lang/it-IT.rc | 11 +++
dll/cpl/powercfg/lang/ja-JP.rc | 11 +++
dll/cpl/powercfg/lang/nl-NL.rc | 11 +++
dll/cpl/powercfg/lang/no-NO.rc | 11 +++
dll/cpl/powercfg/lang/pl-PL.rc | 11 +++
dll/cpl/powercfg/lang/ro-RO.rc | 11 +++
dll/cpl/powercfg/lang/ru-RU.rc | 11 +++
dll/cpl/powercfg/lang/sk-SK.rc | 11 +++
dll/cpl/powercfg/lang/sq-AL.rc | 11 +++
dll/cpl/powercfg/lang/th-TH.rc | 11 +++
dll/cpl/powercfg/lang/tr-TR.rc | 11 +++
dll/cpl/powercfg/lang/uk-UA.rc | 11 +++
dll/cpl/powercfg/lang/zh-CN.rc | 11 +++
dll/cpl/powercfg/lang/zh-TW.rc | 11 +++
dll/cpl/powercfg/powershemes.c | 217 +++++++++++++++++++++++++++++++++--------
dll/cpl/powercfg/resource.h | 3 +
25 files changed, 436 insertions(+), 38 deletions(-)
diff --git a/dll/cpl/powercfg/lang/bg-BG.rc b/dll/cpl/powercfg/lang/bg-BG.rc
index 08e2a23a79..232a3fdf1a 100644
--- a/dll/cpl/powercfg/lang/bg-BG.rc
+++ b/dll/cpl/powercfg/lang/bg-BG.rc
@@ -101,6 +101,17 @@ BEGIN
LTEXT "Трябва да освободите дисково пространство, за да може да заспива
компютърът ви. ", IDC_TOLESSFREESPACE, 10, 115, 220, 20
END
+IDD_SAVEPOWERSCHEME DIALOGEX 0, 0, 190, 62
+STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Save Scheme"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ LTEXT "Save this power scheme as:", -1, 7, 7, 104, 8
+ EDITTEXT IDC_SCHEMENAME, 7, 18, 176, 14, ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE |
WS_BORDER | WS_TABSTOP
+ PUSHBUTTON "OK", IDOK, 79, 40, 50, 14
+ DEFPUSHBUTTON "Cancel", IDCANCEL, 133, 40, 50, 14
+END
+
STRINGTABLE
BEGIN
IDS_CPLNAME_1 "Захранване"
diff --git a/dll/cpl/powercfg/lang/cs-CZ.rc b/dll/cpl/powercfg/lang/cs-CZ.rc
index 693691dd85..47dfff878b 100644
--- a/dll/cpl/powercfg/lang/cs-CZ.rc
+++ b/dll/cpl/powercfg/lang/cs-CZ.rc
@@ -101,6 +101,17 @@ BEGIN
LTEXT "Pro funkci režim spánku musíte uvolnit místo na disku. ",
IDC_TOLESSFREESPACE, 15, 135, 224, 20
END
+IDD_SAVEPOWERSCHEME DIALOGEX 0, 0, 190, 62
+STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Save Scheme"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ LTEXT "Save this power scheme as:", -1, 7, 7, 104, 8
+ EDITTEXT IDC_SCHEMENAME, 7, 18, 176, 14, ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE |
WS_BORDER | WS_TABSTOP
+ PUSHBUTTON "OK", IDOK, 79, 40, 50, 14
+ DEFPUSHBUTTON "Cancel", IDCANCEL, 133, 40, 50, 14
+END
+
STRINGTABLE
BEGIN
IDS_CPLNAME_1 "Možnosti napájení"
diff --git a/dll/cpl/powercfg/lang/de-DE.rc b/dll/cpl/powercfg/lang/de-DE.rc
index e39538f5ce..85c789a021 100644
--- a/dll/cpl/powercfg/lang/de-DE.rc
+++ b/dll/cpl/powercfg/lang/de-DE.rc
@@ -103,6 +103,18 @@ BEGIN
LTEXT "Geben Sie Speicherplatz frei, bevor Sie den Computer in den Ruhezustand
versetzen.", IDC_TOLESSFREESPACE, 10, 115, 220, 20
END
+IDD_SAVEPOWERSCHEME DIALOGEX 0, 0, 190, 62
+STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Schema speichern"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ LTEXT "Energieschema speichern unter:", -1, 7, 7, 104, 8
+ EDITTEXT IDC_SCHEMENAME, 7, 18, 176, 14, ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE |
WS_BORDER | WS_TABSTOP
+ PUSHBUTTON "OK", IDOK, 79, 40, 50, 14
+ DEFPUSHBUTTON "Abbrechen", IDCANCEL, 133, 40, 50, 14
+END
+
+
STRINGTABLE
BEGIN
IDS_CPLNAME_1 "Energie"
diff --git a/dll/cpl/powercfg/lang/el-GR.rc b/dll/cpl/powercfg/lang/el-GR.rc
index 5db1535555..a27f5fce7d 100644
--- a/dll/cpl/powercfg/lang/el-GR.rc
+++ b/dll/cpl/powercfg/lang/el-GR.rc
@@ -103,6 +103,17 @@ BEGIN
LTEXT "Θα πρέπει να ελευθερώσετε χώρο στο δίσκο σας πριν ο υπολογιστής σας
μπορέσει αν τεθεί σε κατάσταση αδρανοποίησης. ", IDC_TOLESSFREESPACE, 15, 135, 224,
20
END
+IDD_SAVEPOWERSCHEME DIALOGEX 0, 0, 190, 62
+STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Save Scheme"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ LTEXT "Save this power scheme as:", -1, 7, 7, 104, 8
+ EDITTEXT IDC_SCHEMENAME, 7, 18, 176, 14, ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE |
WS_BORDER | WS_TABSTOP
+ PUSHBUTTON "OK", IDOK, 79, 40, 50, 14
+ DEFPUSHBUTTON "Cancel", IDCANCEL, 133, 40, 50, 14
+END
+
STRINGTABLE
BEGIN
IDS_CPLNAME_1 "Επιλογές Ενέργειας"
diff --git a/dll/cpl/powercfg/lang/en-US.rc b/dll/cpl/powercfg/lang/en-US.rc
index 3de63ad589..b37b408efa 100644
--- a/dll/cpl/powercfg/lang/en-US.rc
+++ b/dll/cpl/powercfg/lang/en-US.rc
@@ -101,6 +101,17 @@ BEGIN
LTEXT "You must free some disk space before your computer can hibernate. ",
IDC_TOLESSFREESPACE, 15, 135, 224, 20
END
+IDD_SAVEPOWERSCHEME DIALOGEX 0, 0, 190, 62
+STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Save Scheme"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ LTEXT "Save this power scheme as:", -1, 7, 7, 104, 8
+ EDITTEXT IDC_SCHEMENAME, 7, 18, 176, 14, ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE |
WS_BORDER | WS_TABSTOP
+ PUSHBUTTON "OK", IDOK, 79, 40, 50, 14
+ DEFPUSHBUTTON "Cancel", IDCANCEL, 133, 40, 50, 14
+END
+
STRINGTABLE
BEGIN
IDS_CPLNAME_1 "Power Options"
diff --git a/dll/cpl/powercfg/lang/es-ES.rc b/dll/cpl/powercfg/lang/es-ES.rc
index 1ce2f75af3..042b4d83ac 100644
--- a/dll/cpl/powercfg/lang/es-ES.rc
+++ b/dll/cpl/powercfg/lang/es-ES.rc
@@ -103,6 +103,17 @@ BEGIN
LTEXT "Debe liberar algo de espacio en el disco para que su equipo pueda
hibernar. ", IDC_TOLESSFREESPACE, 15, 135, 224, 20
END
+IDD_SAVEPOWERSCHEME DIALOGEX 0, 0, 190, 62
+STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Save Scheme"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ LTEXT "Save this power scheme as:", -1, 7, 7, 104, 8
+ EDITTEXT IDC_SCHEMENAME, 7, 18, 176, 14, ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE |
WS_BORDER | WS_TABSTOP
+ PUSHBUTTON "OK", IDOK, 79, 40, 50, 14
+ DEFPUSHBUTTON "Cancel", IDCANCEL, 133, 40, 50, 14
+END
+
STRINGTABLE
BEGIN
IDS_CPLNAME_1 "Opciones de energía"
diff --git a/dll/cpl/powercfg/lang/fr-FR.rc b/dll/cpl/powercfg/lang/fr-FR.rc
index cd2b5be88f..5d86976625 100644
--- a/dll/cpl/powercfg/lang/fr-FR.rc
+++ b/dll/cpl/powercfg/lang/fr-FR.rc
@@ -103,6 +103,17 @@ BEGIN
LTEXT "Vous devez libérer de l'espace avant que votre ordinateur ne se mette
en veille. ", IDC_TOLESSFREESPACE, 10, 115, 220, 20
END
+IDD_SAVEPOWERSCHEME DIALOGEX 0, 0, 190, 62
+STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Save Scheme"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ LTEXT "Save this power scheme as:", -1, 7, 7, 104, 8
+ EDITTEXT IDC_SCHEMENAME, 7, 18, 176, 14, ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE |
WS_BORDER | WS_TABSTOP
+ PUSHBUTTON "OK", IDOK, 79, 40, 50, 14
+ DEFPUSHBUTTON "Cancel", IDCANCEL, 133, 40, 50, 14
+END
+
STRINGTABLE
BEGIN
IDS_CPLNAME_1 "Options d'alimentation"
diff --git a/dll/cpl/powercfg/lang/he-IL.rc b/dll/cpl/powercfg/lang/he-IL.rc
index 6fbce224fb..595e036cc9 100644
--- a/dll/cpl/powercfg/lang/he-IL.rc
+++ b/dll/cpl/powercfg/lang/he-IL.rc
@@ -103,6 +103,17 @@ BEGIN
LTEXT "You must free some disk space before your computer can hibernate. ",
IDC_TOLESSFREESPACE, 15, 135, 224, 20
END
+IDD_SAVEPOWERSCHEME DIALOGEX 0, 0, 190, 62
+STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Save Scheme"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ LTEXT "Save this power scheme as:", -1, 7, 7, 104, 8
+ EDITTEXT IDC_SCHEMENAME, 7, 18, 176, 14, ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE |
WS_BORDER | WS_TABSTOP
+ PUSHBUTTON "OK", IDOK, 79, 40, 50, 14
+ DEFPUSHBUTTON "Cancel", IDCANCEL, 133, 40, 50, 14
+END
+
STRINGTABLE
BEGIN
IDS_CPLNAME_1 "אפשרויות צריכת חשמל"
diff --git a/dll/cpl/powercfg/lang/id-ID.rc b/dll/cpl/powercfg/lang/id-ID.rc
index f5f1718d1a..9478d1c45d 100644
--- a/dll/cpl/powercfg/lang/id-ID.rc
+++ b/dll/cpl/powercfg/lang/id-ID.rc
@@ -103,6 +103,17 @@ BEGIN
LTEXT "Anda harus membebaskan beberapa ruang disk sebelum komputer anda bisa
hibernasi. ", IDC_TOLESSFREESPACE, 10, 115, 220, 20
END
+IDD_SAVEPOWERSCHEME DIALOGEX 0, 0, 190, 62
+STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Save Scheme"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ LTEXT "Save this power scheme as:", -1, 7, 7, 104, 8
+ EDITTEXT IDC_SCHEMENAME, 7, 18, 176, 14, ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE |
WS_BORDER | WS_TABSTOP
+ PUSHBUTTON "OK", IDOK, 79, 40, 50, 14
+ DEFPUSHBUTTON "Cancel", IDCANCEL, 133, 40, 50, 14
+END
+
STRINGTABLE
BEGIN
IDS_CPLNAME_1 "Opsi Tenaga"
diff --git a/dll/cpl/powercfg/lang/it-IT.rc b/dll/cpl/powercfg/lang/it-IT.rc
index be2159ea7f..119f2c8cb9 100644
--- a/dll/cpl/powercfg/lang/it-IT.rc
+++ b/dll/cpl/powercfg/lang/it-IT.rc
@@ -101,6 +101,17 @@ BEGIN
LTEXT "Deve essere liberato dello spazio su disco prima che il computer possa
essere sospeso.", IDC_TOLESSFREESPACE, 10, 129, 220, 20
END
+IDD_SAVEPOWERSCHEME DIALOGEX 0, 0, 190, 62
+STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Save Scheme"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ LTEXT "Save this power scheme as:", -1, 7, 7, 104, 8
+ EDITTEXT IDC_SCHEMENAME, 7, 18, 176, 14, ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE |
WS_BORDER | WS_TABSTOP
+ PUSHBUTTON "OK", IDOK, 79, 40, 50, 14
+ DEFPUSHBUTTON "Cancel", IDCANCEL, 133, 40, 50, 14
+END
+
STRINGTABLE
BEGIN
IDS_CPLNAME_1 "Opzioni di risparmio energetico"
diff --git a/dll/cpl/powercfg/lang/ja-JP.rc b/dll/cpl/powercfg/lang/ja-JP.rc
index 51fd7a89ac..2b2d0cd101 100644
--- a/dll/cpl/powercfg/lang/ja-JP.rc
+++ b/dll/cpl/powercfg/lang/ja-JP.rc
@@ -103,6 +103,17 @@ BEGIN
LTEXT "休止状態をサポートするには、ディスクの空き領域を増やす必要があります。 ", IDC_TOLESSFREESPACE, 15, 135,
224, 20
END
+IDD_SAVEPOWERSCHEME DIALOGEX 0, 0, 190, 62
+STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Save Scheme"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ LTEXT "Save this power scheme as:", -1, 7, 7, 104, 8
+ EDITTEXT IDC_SCHEMENAME, 7, 18, 176, 14, ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE |
WS_BORDER | WS_TABSTOP
+ PUSHBUTTON "OK", IDOK, 79, 40, 50, 14
+ DEFPUSHBUTTON "Cancel", IDCANCEL, 133, 40, 50, 14
+END
+
STRINGTABLE
BEGIN
IDS_CPLNAME_1 "電源オプション"
diff --git a/dll/cpl/powercfg/lang/nl-NL.rc b/dll/cpl/powercfg/lang/nl-NL.rc
index 7795ae4ac6..bae8278f81 100644
--- a/dll/cpl/powercfg/lang/nl-NL.rc
+++ b/dll/cpl/powercfg/lang/nl-NL.rc
@@ -101,6 +101,17 @@ BEGIN
LTEXT "U heeft onvoldoende schijfruimte om slaapstand in te schakelen. ",
IDC_TOLESSFREESPACE, 10, 115, 220, 20
END
+IDD_SAVEPOWERSCHEME DIALOGEX 0, 0, 190, 62
+STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Save Scheme"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ LTEXT "Save this power scheme as:", -1, 7, 7, 104, 8
+ EDITTEXT IDC_SCHEMENAME, 7, 18, 176, 14, ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE |
WS_BORDER | WS_TABSTOP
+ PUSHBUTTON "OK", IDOK, 79, 40, 50, 14
+ DEFPUSHBUTTON "Cancel", IDCANCEL, 133, 40, 50, 14
+END
+
STRINGTABLE
BEGIN
IDS_CPLNAME_1 "Energie opties"
diff --git a/dll/cpl/powercfg/lang/no-NO.rc b/dll/cpl/powercfg/lang/no-NO.rc
index e2b03d65b4..891f4e9de8 100644
--- a/dll/cpl/powercfg/lang/no-NO.rc
+++ b/dll/cpl/powercfg/lang/no-NO.rc
@@ -103,6 +103,17 @@ BEGIN
LTEXT "Du trenger ledig plass før din datamaskin kan gå i dvalemodus. ",
IDC_TOLESSFREESPACE, 15, 135, 224, 20
END
+IDD_SAVEPOWERSCHEME DIALOGEX 0, 0, 190, 62
+STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Save Scheme"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ LTEXT "Save this power scheme as:", -1, 7, 7, 104, 8
+ EDITTEXT IDC_SCHEMENAME, 7, 18, 176, 14, ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE |
WS_BORDER | WS_TABSTOP
+ PUSHBUTTON "OK", IDOK, 79, 40, 50, 14
+ DEFPUSHBUTTON "Cancel", IDCANCEL, 133, 40, 50, 14
+END
+
STRINGTABLE
BEGIN
IDS_CPLNAME_1 "Strømvalg"
diff --git a/dll/cpl/powercfg/lang/pl-PL.rc b/dll/cpl/powercfg/lang/pl-PL.rc
index 99f7fa8be3..de7cb29f38 100644
--- a/dll/cpl/powercfg/lang/pl-PL.rc
+++ b/dll/cpl/powercfg/lang/pl-PL.rc
@@ -109,6 +109,17 @@ BEGIN
LTEXT "Musisz zwolnić więcej miejsca na dysku przed przejściem w stan
hibernacji. ", IDC_TOLESSFREESPACE, 10, 115, 220, 20
END
+IDD_SAVEPOWERSCHEME DIALOGEX 0, 0, 190, 62
+STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Save Scheme"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ LTEXT "Save this power scheme as:", -1, 7, 7, 104, 8
+ EDITTEXT IDC_SCHEMENAME, 7, 18, 176, 14, ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE |
WS_BORDER | WS_TABSTOP
+ PUSHBUTTON "OK", IDOK, 79, 40, 50, 14
+ DEFPUSHBUTTON "Cancel", IDCANCEL, 133, 40, 50, 14
+END
+
STRINGTABLE
BEGIN
IDS_CPLNAME_1 "Opcje zasilania"
diff --git a/dll/cpl/powercfg/lang/ro-RO.rc b/dll/cpl/powercfg/lang/ro-RO.rc
index 91d767fe02..a24f6f06c0 100644
--- a/dll/cpl/powercfg/lang/ro-RO.rc
+++ b/dll/cpl/powercfg/lang/ro-RO.rc
@@ -106,6 +106,17 @@ BEGIN
LTEXT "Este necesar mai mult spațiu liber pe dispozitivul de stocare înainte de
a putea activa funcționalitatea de hibernare.", IDC_TOLESSFREESPACE, 15, 135, 224,
30
END
+IDD_SAVEPOWERSCHEME DIALOGEX 0, 0, 190, 62
+STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Save Scheme"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ LTEXT "Save this power scheme as:", -1, 7, 7, 104, 8
+ EDITTEXT IDC_SCHEMENAME, 7, 18, 176, 14, ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE |
WS_BORDER | WS_TABSTOP
+ PUSHBUTTON "OK", IDOK, 79, 40, 50, 14
+ DEFPUSHBUTTON "Cancel", IDCANCEL, 133, 40, 50, 14
+END
+
STRINGTABLE
BEGIN
IDS_CPLNAME_1 "Alimentare"
diff --git a/dll/cpl/powercfg/lang/ru-RU.rc b/dll/cpl/powercfg/lang/ru-RU.rc
index 2f33e3156b..4877cf2573 100644
--- a/dll/cpl/powercfg/lang/ru-RU.rc
+++ b/dll/cpl/powercfg/lang/ru-RU.rc
@@ -103,6 +103,17 @@ BEGIN
LTEXT "Для возможности перехода в спящий режим требуется освободить место на
диске.", IDC_TOLESSFREESPACE, 10, 127, 220, 20
END
+IDD_SAVEPOWERSCHEME DIALOGEX 0, 0, 190, 62
+STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Save Scheme"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ LTEXT "Save this power scheme as:", -1, 7, 7, 104, 8
+ EDITTEXT IDC_SCHEMENAME, 7, 18, 176, 14, ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE |
WS_BORDER | WS_TABSTOP
+ PUSHBUTTON "OK", IDOK, 79, 40, 50, 14
+ DEFPUSHBUTTON "Cancel", IDCANCEL, 133, 40, 50, 14
+END
+
STRINGTABLE
BEGIN
IDS_CPLNAME_1 "Электропитание"
diff --git a/dll/cpl/powercfg/lang/sk-SK.rc b/dll/cpl/powercfg/lang/sk-SK.rc
index 1fad264770..f52c6c39e2 100644
--- a/dll/cpl/powercfg/lang/sk-SK.rc
+++ b/dll/cpl/powercfg/lang/sk-SK.rc
@@ -109,6 +109,17 @@ BEGIN
LTEXT "Pred prechodom počítača do režimu dlhodobého spánku, musíte uvoľniť časť
miesta na disku.", IDC_TOLESSFREESPACE, 15, 135, 224, 20
END
+IDD_SAVEPOWERSCHEME DIALOGEX 0, 0, 190, 62
+STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Save Scheme"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ LTEXT "Save this power scheme as:", -1, 7, 7, 104, 8
+ EDITTEXT IDC_SCHEMENAME, 7, 18, 176, 14, ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE |
WS_BORDER | WS_TABSTOP
+ PUSHBUTTON "OK", IDOK, 79, 40, 50, 14
+ DEFPUSHBUTTON "Cancel", IDCANCEL, 133, 40, 50, 14
+END
+
STRINGTABLE
BEGIN
IDS_CPLNAME_1 "Možnosti napájania"
diff --git a/dll/cpl/powercfg/lang/sq-AL.rc b/dll/cpl/powercfg/lang/sq-AL.rc
index 19cd847868..2859e71e66 100644
--- a/dll/cpl/powercfg/lang/sq-AL.rc
+++ b/dll/cpl/powercfg/lang/sq-AL.rc
@@ -106,6 +106,17 @@ BEGIN
LTEXT "Ju duhet të lironi një hapësirë në disk para se kompjuteri juaj mund të
hibernate. ", IDC_TOLESSFREESPACE, 15, 135, 224, 20
END
+IDD_SAVEPOWERSCHEME DIALOGEX 0, 0, 190, 62
+STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Save Scheme"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ LTEXT "Save this power scheme as:", -1, 7, 7, 104, 8
+ EDITTEXT IDC_SCHEMENAME, 7, 18, 176, 14, ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE |
WS_BORDER | WS_TABSTOP
+ PUSHBUTTON "OK", IDOK, 79, 40, 50, 14
+ DEFPUSHBUTTON "Cancel", IDCANCEL, 133, 40, 50, 14
+END
+
STRINGTABLE
BEGIN
IDS_CPLNAME_1 "Opsionet e energjisë"
diff --git a/dll/cpl/powercfg/lang/th-TH.rc b/dll/cpl/powercfg/lang/th-TH.rc
index 7bed2d3467..c5a8979e2d 100644
--- a/dll/cpl/powercfg/lang/th-TH.rc
+++ b/dll/cpl/powercfg/lang/th-TH.rc
@@ -101,6 +101,17 @@ BEGIN
LTEXT "You must free some disk space before your computer can hibernate. ",
IDC_TOLESSFREESPACE, 15, 135, 224, 20
END
+IDD_SAVEPOWERSCHEME DIALOGEX 0, 0, 190, 62
+STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Save Scheme"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ LTEXT "Save this power scheme as:", -1, 7, 7, 104, 8
+ EDITTEXT IDC_SCHEMENAME, 7, 18, 176, 14, ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE |
WS_BORDER | WS_TABSTOP
+ PUSHBUTTON "OK", IDOK, 79, 40, 50, 14
+ DEFPUSHBUTTON "Cancel", IDCANCEL, 133, 40, 50, 14
+END
+
STRINGTABLE
BEGIN
IDS_CPLNAME_1 "ตัวเลือกค่าพลังงาน"
diff --git a/dll/cpl/powercfg/lang/tr-TR.rc b/dll/cpl/powercfg/lang/tr-TR.rc
index bd6c81844f..c1209bd8d3 100644
--- a/dll/cpl/powercfg/lang/tr-TR.rc
+++ b/dll/cpl/powercfg/lang/tr-TR.rc
@@ -103,6 +103,17 @@ BEGIN
LTEXT "Bilgisayarınız anıkta bekleyebilmeden önce biraz disk alanı
oluşturmalısınız.", IDC_TOLESSFREESPACE, 15, 135, 224, 20
END
+IDD_SAVEPOWERSCHEME DIALOGEX 0, 0, 190, 62
+STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Save Scheme"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ LTEXT "Save this power scheme as:", -1, 7, 7, 104, 8
+ EDITTEXT IDC_SCHEMENAME, 7, 18, 176, 14, ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE |
WS_BORDER | WS_TABSTOP
+ PUSHBUTTON "OK", IDOK, 79, 40, 50, 14
+ DEFPUSHBUTTON "Cancel", IDCANCEL, 133, 40, 50, 14
+END
+
STRINGTABLE
BEGIN
IDS_CPLNAME_1 "Güç Seçenekleri"
diff --git a/dll/cpl/powercfg/lang/uk-UA.rc b/dll/cpl/powercfg/lang/uk-UA.rc
index 488c42f468..91d7eb2f53 100644
--- a/dll/cpl/powercfg/lang/uk-UA.rc
+++ b/dll/cpl/powercfg/lang/uk-UA.rc
@@ -109,6 +109,17 @@ BEGIN
LTEXT "Перед переведенням комп'ютера до сплячого режиму слід звільнити місце
на диску. ", IDC_TOLESSFREESPACE, 10, 115, 220, 20
END
+IDD_SAVEPOWERSCHEME DIALOGEX 0, 0, 190, 62
+STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Save Scheme"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ LTEXT "Save this power scheme as:", -1, 7, 7, 104, 8
+ EDITTEXT IDC_SCHEMENAME, 7, 18, 176, 14, ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE |
WS_BORDER | WS_TABSTOP
+ PUSHBUTTON "OK", IDOK, 79, 40, 50, 14
+ DEFPUSHBUTTON "Cancel", IDCANCEL, 133, 40, 50, 14
+END
+
STRINGTABLE
BEGIN
IDS_CPLNAME_1 "Електроживлення"
diff --git a/dll/cpl/powercfg/lang/zh-CN.rc b/dll/cpl/powercfg/lang/zh-CN.rc
index 43155283b9..1257571f99 100644
--- a/dll/cpl/powercfg/lang/zh-CN.rc
+++ b/dll/cpl/powercfg/lang/zh-CN.rc
@@ -103,6 +103,17 @@ BEGIN
LTEXT "在计算机进入休眠之前,您必须释放一些磁盘空间。", IDC_TOLESSFREESPACE, 15, 135, 224, 20
END
+IDD_SAVEPOWERSCHEME DIALOGEX 0, 0, 190, 62
+STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Save Scheme"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ LTEXT "Save this power scheme as:", -1, 7, 7, 104, 8
+ EDITTEXT IDC_SCHEMENAME, 7, 18, 176, 14, ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE |
WS_BORDER | WS_TABSTOP
+ PUSHBUTTON "OK", IDOK, 79, 40, 50, 14
+ DEFPUSHBUTTON "Cancel", IDCANCEL, 133, 40, 50, 14
+END
+
STRINGTABLE
BEGIN
IDS_CPLNAME_1 "电源选项"
diff --git a/dll/cpl/powercfg/lang/zh-TW.rc b/dll/cpl/powercfg/lang/zh-TW.rc
index cf8c9e2e2c..34e83fd26e 100644
--- a/dll/cpl/powercfg/lang/zh-TW.rc
+++ b/dll/cpl/powercfg/lang/zh-TW.rc
@@ -103,6 +103,17 @@ BEGIN
LTEXT "在電腦進入休眠之前,您必須釋放一些磁碟空間。", IDC_TOLESSFREESPACE, 15, 135, 224, 20
END
+IDD_SAVEPOWERSCHEME DIALOGEX 0, 0, 190, 62
+STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Save Scheme"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ LTEXT "Save this power scheme as:", -1, 7, 7, 104, 8
+ EDITTEXT IDC_SCHEMENAME, 7, 18, 176, 14, ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE |
WS_BORDER | WS_TABSTOP
+ PUSHBUTTON "OK", IDOK, 79, 40, 50, 14
+ DEFPUSHBUTTON "Cancel", IDCANCEL, 133, 40, 50, 14
+END
+
STRINGTABLE
BEGIN
IDS_CPLNAME_1 "電源選項"
diff --git a/dll/cpl/powercfg/powershemes.c b/dll/cpl/powercfg/powershemes.c
index c237a21368..56c9ae1f3f 100644
--- a/dll/cpl/powercfg/powershemes.c
+++ b/dll/cpl/powercfg/powershemes.c
@@ -26,9 +26,18 @@ typedef struct _POWER_SCHEMES_PAGE_DATA
{
LIST_ENTRY PowerSchemesList;
PPOWER_SCHEME pActivePowerScheme;
+ PPOWER_SCHEME pSelectedPowerScheme;
} POWER_SCHEMES_PAGE_DATA, *PPOWER_SCHEMES_PAGE_DATA;
+typedef struct _SAVE_POWER_SCHEME_DATA
+{
+ PPOWER_SCHEMES_PAGE_DATA pPageData;
+ PPOWER_SCHEME pNewScheme;
+ HWND hwndPage;
+} SAVE_POWER_SCHEME_DATA, *PSAVE_POWER_SCHEME_DATA;
+
+
UINT Sec[]=
{
60,
@@ -51,7 +60,7 @@ UINT Sec[]=
static
-BOOL
+PPOWER_SCHEME
AddPowerScheme(
PPOWER_SCHEMES_PAGE_DATA pPageData,
UINT uId,
@@ -68,7 +77,7 @@ AddPowerScheme(
HEAP_ZERO_MEMORY,
sizeof(POWER_SCHEME));
if (pScheme == NULL)
- return FALSE;
+ return NULL;
pScheme->uId = uId;
CopyMemory(&pScheme->PowerPolicy, pp, sizeof(POWER_POLICY));
@@ -108,9 +117,10 @@ done:
HeapFree(GetProcessHeap(), 0, pScheme->pszDescription);
HeapFree(GetProcessHeap(), 0, pScheme);
+ pScheme = NULL;
}
- return bResult;
+ return pScheme;
}
@@ -187,6 +197,7 @@ DestroySchemesList(
}
pPageData->pActivePowerScheme = NULL;
+ pPageData->pSelectedPowerScheme = NULL;
}
@@ -291,29 +302,34 @@ static
VOID
LoadConfig(
HWND hwndDlg,
- PPOWER_SCHEMES_PAGE_DATA pPageData)
+ PPOWER_SCHEMES_PAGE_DATA pPageData,
+ PPOWER_SCHEME pScheme)
{
- PPOWER_SCHEME pScheme;
INT i = 0, iCurSel = 0;
TCHAR szTemp[MAX_PATH];
TCHAR szConfig[MAX_PATH];
PPOWER_POLICY pp;
- iCurSel = (INT)SendDlgItemMessage(hwndDlg,
- IDC_ENERGYLIST,
- CB_GETCURSEL,
- 0,
- 0);
- if (iCurSel == CB_ERR)
- return;
+ if (pScheme == NULL)
+ {
+ iCurSel = (INT)SendDlgItemMessage(hwndDlg,
+ IDC_ENERGYLIST,
+ CB_GETCURSEL,
+ 0,
+ 0);
+ if (iCurSel == CB_ERR)
+ return;
+
+ pScheme = (PPOWER_SCHEME)SendDlgItemMessage(hwndDlg,
+ IDC_ENERGYLIST,
+ CB_GETITEMDATA,
+ (WPARAM)iCurSel,
+ 0);
+ if (pScheme == (PPOWER_SCHEME)CB_ERR)
+ return;
+ }
- pScheme = (PPOWER_SCHEME)SendDlgItemMessage(hwndDlg,
- IDC_ENERGYLIST,
- CB_GETITEMDATA,
- (WPARAM)iCurSel,
- 0);
- if (pScheme == (PPOWER_SCHEME)CB_ERR)
- return;
+ pPageData->pSelectedPowerScheme = pScheme;
if (LoadString(hApplet, IDS_CONFIG1, szTemp, MAX_PATH))
{
@@ -493,23 +509,9 @@ Pos_SaveData(
PPOWER_SCHEMES_PAGE_DATA pPageData)
{
PPOWER_SCHEME pScheme;
- INT iCurSel, tmp;
+ INT tmp;
- iCurSel = (INT)SendDlgItemMessage(hwndDlg,
- IDC_ENERGYLIST,
- CB_GETCURSEL,
- 0,
- 0);
- if (iCurSel == CB_ERR)
- return;
-
- pScheme = (PPOWER_SCHEME)SendDlgItemMessage(hwndDlg,
- IDC_ENERGYLIST,
- CB_GETITEMDATA,
- (WPARAM)iCurSel,
- 0);
- if (pScheme == (PPOWER_SCHEME)CB_ERR)
- return;
+ pScheme = pPageData->pSelectedPowerScheme;
tmp = (INT)SendDlgItemMessage(hwndDlg, IDC_MONITORACLIST,
CB_GETCURSEL,
@@ -637,7 +639,7 @@ DelScheme(
if (iCurSel != CB_ERR)
SendMessage(hList, CB_SETCURSEL, iCurSel, 0);
- LoadConfig(hwnd, pPageData);
+ LoadConfig(hwnd, pPageData, NULL);
return TRUE;
}
@@ -645,6 +647,144 @@ DelScheme(
}
+static
+BOOL
+SavePowerScheme(
+ HWND hwndDlg,
+ PSAVE_POWER_SCHEME_DATA pSaveSchemeData)
+{
+ PPOWER_SCHEMES_PAGE_DATA pPageData;
+ PPOWER_SCHEME pScheme;
+ TCHAR szSchemeName[512];
+ BOOL bRet = FALSE;
+
+ pPageData = pSaveSchemeData->pPageData;
+
+ GetDlgItemText(hwndDlg, IDC_SCHEMENAME, szSchemeName, ARRAYSIZE(szSchemeName));
+
+ pScheme = AddPowerScheme(pPageData,
+ -1,
+ (_tcslen(szSchemeName) + 1) * sizeof(TCHAR),
+ szSchemeName,
+ sizeof(TCHAR),
+ TEXT(""),
+ &pPageData->pSelectedPowerScheme->PowerPolicy);
+ if (pScheme != NULL)
+ {
+ if (WritePwrScheme(&pScheme->uId,
+ pScheme->pszName,
+ pScheme->pszDescription,
+ &pScheme->PowerPolicy))
+ {
+ pSaveSchemeData->pNewScheme = pScheme;
+ bRet = TRUE;
+ }
+ else
+ {
+ DeletePowerScheme(pScheme);
+ }
+ }
+
+ return bRet;
+}
+
+
+INT_PTR
+CALLBACK
+SaveSchemeDlgProc(
+ HWND hwndDlg,
+ UINT uMsg,
+ WPARAM wParam,
+ LPARAM lParam)
+{
+ PSAVE_POWER_SCHEME_DATA pSaveSchemeData;
+
+ pSaveSchemeData = (PSAVE_POWER_SCHEME_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
+
+ switch (uMsg)
+ {
+ case WM_INITDIALOG:
+ pSaveSchemeData = (PSAVE_POWER_SCHEME_DATA)lParam;
+ SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pSaveSchemeData);
+
+ SetDlgItemText(hwndDlg,
+ IDC_SCHEMENAME,
+
pSaveSchemeData->pPageData->pSelectedPowerScheme->pszName);
+ return TRUE;
+
+ case WM_COMMAND:
+ switch(LOWORD(wParam))
+ {
+ case IDOK:
+ EndDialog(hwndDlg, SavePowerScheme(hwndDlg, pSaveSchemeData));
+ break;
+
+ case IDCANCEL:
+ EndDialog(hwndDlg, FALSE);
+ break;
+ }
+ break;
+ }
+
+ return FALSE;
+}
+
+
+static
+VOID
+SaveScheme(
+ HWND hwndDlg,
+ PPOWER_SCHEMES_PAGE_DATA pPageData)
+{
+ SAVE_POWER_SCHEME_DATA SaveSchemeData;
+ POWER_POLICY BackupPowerPolicy;
+ HWND hwndList;
+ INT index;
+
+ SaveSchemeData.pPageData = pPageData;
+ SaveSchemeData.pNewScheme = NULL;
+ SaveSchemeData.hwndPage = hwndDlg;
+
+ CopyMemory(&BackupPowerPolicy,
+ &pPageData->pSelectedPowerScheme->PowerPolicy,
+ sizeof(POWER_POLICY));
+
+ Pos_SaveData(hwndDlg, pPageData);
+
+ if (DialogBoxParam(hApplet,
+ MAKEINTRESOURCE(IDD_SAVEPOWERSCHEME),
+ hwndDlg,
+ SaveSchemeDlgProc,
+ (LPARAM)&SaveSchemeData))
+ {
+ if (SaveSchemeData.pNewScheme)
+ {
+ hwndList = GetDlgItem(hwndDlg, IDC_ENERGYLIST);
+
+ index = (INT)SendMessage(hwndList,
+ CB_ADDSTRING,
+ 0,
+ (LPARAM)SaveSchemeData.pNewScheme->pszName);
+ if (index != CB_ERR)
+ {
+ SendMessage(hwndList,
+ CB_SETITEMDATA,
+ index,
+ (LPARAM)SaveSchemeData.pNewScheme);
+
+ SendMessage(hwndList, CB_SETCURSEL, (WPARAM)index, 0);
+
+ LoadConfig(hwndDlg, pPageData, SaveSchemeData.pNewScheme);
+ }
+ }
+ }
+
+ CopyMemory(&pPageData->pSelectedPowerScheme->PowerPolicy,
+ &BackupPowerPolicy,
+ sizeof(POWER_POLICY));
+}
+
+
static BOOL
CreateEnergyList(
HWND hwndDlg,
@@ -716,7 +856,7 @@ CreateEnergyList(
(LPARAM)pScheme->pszName);
pPageData->pActivePowerScheme = pScheme;
- LoadConfig(hwndDlg, pPageData);
+ LoadConfig(hwndDlg, pPageData, pScheme);
}
ListEntry = ListEntry->Flink;
@@ -785,7 +925,7 @@ PowerSchemesDlgProc(
case IDC_ENERGYLIST:
if (HIWORD(wParam) == CBN_SELCHANGE)
{
- LoadConfig(hwndDlg, pPageData);
+ LoadConfig(hwndDlg, pPageData, NULL);
PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
}
break;
@@ -795,6 +935,7 @@ PowerSchemesDlgProc(
break;
case IDC_SAVEAS_BTN:
+ SaveScheme(hwndDlg, pPageData);
break;
case IDC_MONITORACLIST:
diff --git a/dll/cpl/powercfg/resource.h b/dll/cpl/powercfg/resource.h
index e6f5d6574f..7227bd8d2b 100644
--- a/dll/cpl/powercfg/resource.h
+++ b/dll/cpl/powercfg/resource.h
@@ -107,6 +107,9 @@
#define IDC_DELETE_BTN 504
#define IDC_SAVEAS_BTN 505
+#define IDD_SAVEPOWERSCHEME 75
+#define IDC_SCHEMENAME 620
+
#define IDS_ALPERTLOWENERGY 715
#define IDS_ALPERTCRITICLEENERGY 716
#define IDS_CRITCLENERGY 717