Joel Holdsworth : winecfg: Moved about panel code into about.c.
Alexandre Julliard
julliard at winehq.org
Mon Jun 7 10:02:29 CDT 2010
Module: wine
Branch: master
Commit: 7342bce80d2863813255dad7869f1574a90f18bb
URL: http://source.winehq.org/git/wine.git/?a=commit;h=7342bce80d2863813255dad7869f1574a90f18bb
Author: Joel Holdsworth <joel at airwebreathe.org.uk>
Date: Wed Jun 2 23:56:00 2010 +0100
winecfg: Moved about panel code into about.c.
---
programs/winecfg/Makefile.in | 1 +
programs/winecfg/about.c | 92 ++++++++++++++++++++++++++++++++++++++++++
programs/winecfg/main.c | 60 ---------------------------
programs/winecfg/winecfg.h | 1 +
4 files changed, 94 insertions(+), 60 deletions(-)
diff --git a/programs/winecfg/Makefile.in b/programs/winecfg/Makefile.in
index ae8fbd0..73ec486 100644
--- a/programs/winecfg/Makefile.in
+++ b/programs/winecfg/Makefile.in
@@ -7,6 +7,7 @@ APPMODE = -mwindows
IMPORTS = uuid comdlg32 comctl32 shell32 ole32 winmm shlwapi uxtheme user32 gdi32 advapi32 kernel32
C_SRCS = \
+ about.c \
appdefaults.c \
audio.c \
drive.c \
diff --git a/programs/winecfg/about.c b/programs/winecfg/about.c
new file mode 100644
index 0000000..7a88e4f
--- /dev/null
+++ b/programs/winecfg/about.c
@@ -0,0 +1,92 @@
+/*
+ * WineCfg about panel
+ *
+ * Copyright 2002 Jaco Greeff
+ * Copyright 2003 Dimitrie O. Paun
+ * Copyright 2003 Mike Hearn
+ * Copyright 2010 Joel Holdsworth
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ *
+ */
+
+#include <windows.h>
+#include <commctrl.h>
+#include <wine/debug.h>
+
+#include "resource.h"
+#include "winecfg.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(winecfg);
+
+INT_PTR CALLBACK
+AboutDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
+{
+ char *owner, *org;
+
+ switch (uMsg)
+ {
+ case WM_NOTIFY:
+ switch(((LPNMHDR)lParam)->code)
+ {
+ case PSN_APPLY:
+ /*save registration info to registry */
+ owner = get_text(hDlg, IDC_ABT_OWNER);
+ org = get_text(hDlg, IDC_ABT_ORG);
+
+ set_reg_key(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion",
+ "RegisteredOwner", owner ? owner : "");
+ set_reg_key(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion",
+ "RegisteredOrganization", org ? org : "");
+ set_reg_key(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows NT\\CurrentVersion",
+ "RegisteredOwner", owner ? owner : "");
+ set_reg_key(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows NT\\CurrentVersion",
+ "RegisteredOrganization", org ? org : "");
+ apply();
+
+ HeapFree(GetProcessHeap(), 0, owner);
+ HeapFree(GetProcessHeap(), 0, org);
+ break;
+ }
+ break;
+
+ case WM_INITDIALOG:
+ /* read owner and organization info from registry, load it into text box */
+ owner = get_reg_key(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows NT\\CurrentVersion",
+ "RegisteredOwner", "");
+ org = get_reg_key(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows NT\\CurrentVersion",
+ "RegisteredOrganization", "");
+
+ SetDlgItemText(hDlg, IDC_ABT_OWNER, owner);
+ SetDlgItemText(hDlg, IDC_ABT_ORG, org);
+
+ SendMessage(GetParent(hDlg), PSM_UNCHANGED, 0, 0);
+
+ HeapFree(GetProcessHeap(), 0, owner);
+ HeapFree(GetProcessHeap(), 0, org);
+ break;
+
+ case WM_COMMAND:
+ switch(HIWORD(wParam))
+ {
+ case EN_CHANGE:
+ /* enable apply button */
+ SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0);
+ break;
+ }
+ break;
+ }
+ return FALSE;
+}
diff --git a/programs/winecfg/main.c b/programs/winecfg/main.c
index 83a5f05..fdefefb 100644
--- a/programs/winecfg/main.c
+++ b/programs/winecfg/main.c
@@ -60,66 +60,6 @@ PropSheetCallback (HWND hWnd, UINT uMsg, LPARAM lParam)
return 0;
}
-static INT_PTR CALLBACK
-AboutDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
-{
- char *owner, *org;
-
- switch (uMsg) {
-
- case WM_NOTIFY:
- switch(((LPNMHDR)lParam)->code)
- {
- case PSN_APPLY:
- /*save registration info to registry */
- owner = get_text(hDlg, IDC_ABT_OWNER);
- org = get_text(hDlg, IDC_ABT_ORG);
-
- set_reg_key(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion",
- "RegisteredOwner", owner ? owner : "");
- set_reg_key(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion",
- "RegisteredOrganization", org ? org : "");
- set_reg_key(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows NT\\CurrentVersion",
- "RegisteredOwner", owner ? owner : "");
- set_reg_key(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows NT\\CurrentVersion",
- "RegisteredOrganization", org ? org : "");
- apply();
-
- HeapFree(GetProcessHeap(), 0, owner);
- HeapFree(GetProcessHeap(), 0, org);
- break;
- }
- break;
-
- case WM_INITDIALOG:
- /* read owner and organization info from registry, load it into text box */
- owner = get_reg_key(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows NT\\CurrentVersion",
- "RegisteredOwner", "");
- org = get_reg_key(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows NT\\CurrentVersion",
- "RegisteredOrganization", "");
-
- SetDlgItemText(hDlg, IDC_ABT_OWNER, owner);
- SetDlgItemText(hDlg, IDC_ABT_ORG, org);
-
- SendMessage(GetParent(hDlg), PSM_UNCHANGED, 0, 0);
-
- HeapFree(GetProcessHeap(), 0, owner);
- HeapFree(GetProcessHeap(), 0, org);
- break;
-
- case WM_COMMAND:
- switch(HIWORD(wParam))
- {
- case EN_CHANGE:
- /* enable apply button */
- SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0);
- break;
- }
- break;
- }
- return FALSE;
-}
-
#define NUM_PROPERTY_PAGES 7
static INT_PTR
diff --git a/programs/winecfg/winecfg.h b/programs/winecfg/winecfg.h
index d730d84..4d4a92f 100644
--- a/programs/winecfg/winecfg.h
+++ b/programs/winecfg/winecfg.h
@@ -87,6 +87,7 @@ INT_PTR CALLBACK AppDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
INT_PTR CALLBACK LibrariesDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK AudioDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK ThemeDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
+INT_PTR CALLBACK AboutDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
/* Drive management */
BOOL load_drives(void);
More information about the wine-cvs
mailing list