[winecfg] Localize app specific title

Paul Vriens Paul.Vriens at xs4all.nl
Mon Feb 13 13:12:34 CST 2006


Hi,

the title shown in winecfg is always in English when configuring stuff
for an specific application.

Any remarks on the patch? Would this work for every language? (I mean
will the name of the app always be after the IDS_WINECFG_TITLE_APP)

Cheers,

Paul.

diff --git a/programs/winecfg/En.rc b/programs/winecfg/En.rc
index 22bdeb0..6d5594d 100644
--- a/programs/winecfg/En.rc
+++ b/programs/winecfg/En.rc
@@ -199,6 +199,7 @@ BEGIN
     IDS_TAB_AUDIO           "Audio"
     IDS_TAB_ABOUT           "About"
     IDS_WINECFG_TITLE       "Wine configuration"
+    IDS_WINECFG_TITLE_APP   "Wine configuration for"
     IDS_THEMEFILE           "Theme files"
     IDS_THEMEFILE_SELECT    "Select a theme file"
     IDS_AUDIO_MISSING       "There is no audio driver currently specified in the registry.\n\nA recommended driver has been selected for you.\nYou can use this driver or select another driver if available.\n\nYou must click Apply for the selection to take effect."
diff --git a/programs/winecfg/resource.h b/programs/winecfg/resource.h
index 4fac41f..85bf11c 100644
--- a/programs/winecfg/resource.h
+++ b/programs/winecfg/resource.h
@@ -39,6 +39,7 @@
 #define IDS_WINECFG_TITLE               13
 #define IDS_THEMEFILE                   14
 #define IDS_THEMEFILE_SELECT            15
+#define IDS_WINECFG_TITLE_APP           16   /* App specific title */
 #define IDD_MAINDLG                     101
 #define IDB_WINE                        104
 #define IDD_ABOUTCFG                    107
diff --git a/programs/winecfg/winecfg.c b/programs/winecfg/winecfg.c
index df2b05f..f87ccf0 100644
--- a/programs/winecfg/winecfg.c
+++ b/programs/winecfg/winecfg.c
@@ -53,23 +53,22 @@ HMENU hPopupMenus = 0;
  */
 void set_window_title(HWND dialog)
 {
-    char *newtitle;
+    char newtitle[1024];

     /* update the window title  */
     if (current_app)
     {
-        const char *template = "Wine Configuration for %s";
-        newtitle = HeapAlloc(GetProcessHeap(), 0, strlen(template) + strlen(current_app) + 1);
-        sprintf(newtitle, template, current_app);
+        char prefix[1024];
+        LoadString(GetModuleHandle(NULL), IDS_WINECFG_TITLE_APP, prefix, 1024);
+        sprintf(newtitle, "%s %s", prefix, current_app);
     }
     else
     {
-        newtitle = strdupA("Wine Configuration");
+        LoadString(GetModuleHandle(NULL), IDS_WINECFG_TITLE, newtitle, 1024);
     }

     WINE_TRACE("setting title to %s\n", newtitle);
     SendMessage(GetParent(dialog), PSM_SETTITLE, 0, (LPARAM) newtitle);
-    HeapFree(GetProcessHeap(), 0, newtitle);
 }




More information about the wine-devel mailing list