diff gui/win32/dialogs.c @ 36694:eed2fb870f43

Rename symbolic constants of GUI help message texts. Create a kind of GUI namespace and don't add place or kind of usage to the name unless it's advantageous. This reduces the amount of definitions as well. Arrange them alphabetically.
author ib
date Wed, 05 Feb 2014 16:39:38 +0000
parents e1e9f2ea17c9
children
line wrap: on
line diff
--- a/gui/win32/dialogs.c	Wed Feb 05 16:03:44 2014 +0000
+++ b/gui/win32/dialogs.c	Wed Feb 05 16:39:38 2014 +0000
@@ -51,7 +51,7 @@
 
     if (subdata)
     {
-        mp_msg(MSGT_GPLAYER, MSGL_INFO, MSGTR_DeletingSubtitles);
+        mp_msg(MSGT_GPLAYER, MSGL_INFO, MSGTR_GUI_MSG_RemovingSubtitle);
         sub_free(subdata);
         subdata = NULL;
         vo_sub = NULL;
@@ -75,7 +75,7 @@
 
     if (name)
     {
-        mp_msg(MSGT_GPLAYER, MSGL_INFO, MSGTR_LoadingSubtitles, name);
+        mp_msg(MSGT_GPLAYER, MSGL_INFO, MSGTR_GUI_MSG_LoadingSubtitle, name);
         subdata = sub_read_file(strdup(name), (guiInfo.sh_video ? guiInfo.sh_video->fps : 0));
         if (!subdata) mp_msg(MSGT_GPLAYER, MSGL_ERR, MSGTR_CantLoadSub,name);
         sub_name = (malloc(2 * sizeof(char*))); /* when mplayer will be restarted */
@@ -110,7 +110,7 @@
                            "Avisynth Scripts (*.avs)\0*.avs\0"
                            "Audio Files (*.mp3;*.wav;*.ra)\0*.mp3;*.wav;*.ra\000";
     fileopen.nFilterIndex = 0;
-    fileopen.lpstrTitle = acp(MSGTR_FileSelect);
+    fileopen.lpstrTitle = acp(MSGTR_GUI_SelectFile);
     fileopen.Flags = OFN_ALLOWMULTISELECT | OFN_FILEMUSTEXIST| OFN_LONGNAMES | OFN_EXPLORER| OFN_READONLY | OFN_HIDEREADONLY;
     fileopen.lpstrFile = filelist;
     fileopen.lpstrCustomFilter = NULL;
@@ -171,7 +171,7 @@
     subtitleopen.lpstrFilter = "All Files (*.*)\0*.*\0"
                                "Subtitle Files (*.srt;*.txt;*.vob)\0*.srt;*.txt;*.vob\0";
     subtitleopen.nFilterIndex = 0;
-    subtitleopen.lpstrTitle = acp(MSGTR_SubtitleSelect);
+    subtitleopen.lpstrTitle = acp(MSGTR_GUI_SelectSubtitle);
     subtitleopen.Flags = OFN_FILEMUSTEXIST | OFN_LONGNAMES | OFN_EXPLORER | OFN_READONLY | OFN_HIDEREADONLY;
     subtitleopen.lpstrFile = subtitlefile;
     subtitleopen.lpstrCustomFilter = NULL;
@@ -195,7 +195,7 @@
     playlistopen.lpstrFilter = "All Files (*.*)\0*.*\0"
                                "Playlist Files (*.m3u;*.pls;*.txt)\0*.m3u;*.pls;*.txt\0";
     playlistopen.nFilterIndex = 0;
-    playlistopen.lpstrTitle = acp(MSGTR_PlaylistSelect);
+    playlistopen.lpstrTitle = acp(MSGTR_GUI_WIN32_SelectPlaylist);
     playlistopen.Flags = OFN_FILEMUSTEXIST | OFN_LONGNAMES | OFN_EXPLORER | OFN_READONLY | OFN_HIDEREADONLY;
     playlistopen.lpstrFile = playlistfile;
     playlistopen.lpstrCustomFilter = NULL;
@@ -222,7 +222,7 @@
     playlistsave.hInstance = GetModuleHandle(NULL);
     playlistsave.lpstrFilter = "Playlist Files (*.pls)\0*.pls\0";
     playlistsave.nFilterIndex = 0;
-    playlistsave.lpstrTitle = acp(MSGTR_PlaylistSave);
+    playlistsave.lpstrTitle = acp(MSGTR_GUI_WIN32_SavePlaylist);
     playlistsave.Flags = OFN_LONGNAMES | OFN_EXPLORER | OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY;
     playlistsave.lpstrFile = playlistname;
     playlistsave.lpstrCustomFilter = NULL;
@@ -270,7 +270,7 @@
     switch (iMsg)
     {
         case WM_CREATE:
-            wdg = CreateWindow("button", acp(MSGTR_Ok),
+            wdg = CreateWindow("button", acp(MSGTR_GUI_Ok),
                                WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
                                4, 43, 80, 25, hwnd,
                                (HMENU) ID_OK,
@@ -278,7 +278,7 @@
                                NULL);
             SendMessage(wdg, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0);
 
-            wdg = CreateWindow("button", acp(MSGTR_Cancel),
+            wdg = CreateWindow("button", acp(MSGTR_GUI_Cancel),
                                WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
                                90, 43, 80, 25, hwnd,
                                (HMENU) ID_CANCEL,
@@ -360,7 +360,7 @@
             switch (LOWORD(wParam))
             {
                 case VK_RETURN:
-                    SendMessage(FindWindow(NULL, acp(MSGTR_Network)), WM_COMMAND, (WPARAM) ID_OK, 0);
+                    SendMessage(FindWindow(NULL, acp(MSGTR_GUI_NetworkStreaming)), WM_COMMAND, (WPARAM) ID_OK, 0);
                     break;
             }
     }
@@ -375,7 +375,7 @@
     int x, y;
 
     if(add) addurl = TRUE;
-    if(FindWindow(NULL, acp(MSGTR_Network))) return;
+    if(FindWindow(NULL, acp(MSGTR_GUI_NetworkStreaming))) return;
     wc.style         = CS_HREDRAW | CS_VREDRAW;
     wc.lpfnWndProc   = OpenUrlWndProc;
     wc.cbClsExtra    = 0;
@@ -384,13 +384,13 @@
     wc.hCursor       = LoadCursor(NULL,IDC_ARROW);
     wc.hIcon         = gui->icon;
     wc.hbrBackground = SOLID_GREY2;
-    wc.lpszClassName = acp(MSGTR_Network);
+    wc.lpszClassName = acp(MSGTR_GUI_NetworkStreaming);
     wc.lpszMenuName  = NULL;
     RegisterClass(&wc);
     x = (GetSystemMetrics(SM_CXSCREEN) / 2) - (320 / 2);
     y = (GetSystemMetrics(SM_CYSCREEN) / 2) - (100 / 2);
-    hWnd = CreateWindow(acp(MSGTR_Network),
-                        acp(MSGTR_Network),
+    hWnd = CreateWindow(acp(MSGTR_GUI_NetworkStreaming),
+                        acp(MSGTR_GUI_NetworkStreaming),
                         WS_POPUPWINDOW | WS_CAPTION,
                         x,
                         y,
@@ -408,13 +408,13 @@
 static void create_playlistmenu(gui_t *gui)
 {
     gui->playlistmenu = CreatePopupMenu();
-    AppendMenu(gui->playlistmenu, MF_STRING, ID_ADDFILE, acp(MSGTR_PLAYLIST_AddFile"..."));
-    AppendMenu(gui->playlistmenu, MF_STRING, ID_ADDURL, acp(MSGTR_PLAYLIST_AddURL"..."));
+    AppendMenu(gui->playlistmenu, MF_STRING, ID_ADDFILE, acp(MSGTR_GUI_WIN32_AddFile"..."));
+    AppendMenu(gui->playlistmenu, MF_STRING, ID_ADDURL, acp(MSGTR_GUI_WIN32_AddURL"..."));
     AppendMenu(gui->playlistmenu, MF_SEPARATOR, 0, 0);
-    AppendMenu(gui->playlistmenu, MF_STRING, ID_REMOVE, acp(MSGTR_Remove));
-    AppendMenu(gui->playlistmenu, MF_STRING, ID_CLEAR, acp(MSGTR_Clear));
+    AppendMenu(gui->playlistmenu, MF_STRING, ID_REMOVE, acp(MSGTR_GUI_Remove));
+    AppendMenu(gui->playlistmenu, MF_STRING, ID_CLEAR, acp(MSGTR_GUI_Clear));
     AppendMenu(gui->playlistmenu, MF_SEPARATOR, 0, 0);
-    AppendMenu(gui->playlistmenu, MF_STRING, ID_CLOSE, acp(MSGTR_Close));
+    AppendMenu(gui->playlistmenu, MF_STRING, ID_CLOSE, acp(MSGTR_GUI_WIN32_Close));
 }
 
 static void updatetracklist(HWND hwnd)
@@ -440,7 +440,7 @@
     {
         case WM_CREATE:
         {
-            wdg = CreateWindow("button", acp(MSGTR_MENU_Play),
+            wdg = CreateWindow("button", acp(MSGTR_GUI_Play),
                                WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
                                4, 10, 80, 25, hwnd,
                                (HMENU) ID_PLAY,
@@ -448,7 +448,7 @@
                                NULL);
             SendMessage(wdg, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0);
 
-            wdg = CreateWindow ("button", acp(MSGTR_Up),
+            wdg = CreateWindow ("button", acp(MSGTR_GUI_WIN32_Up),
                                 WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
                                 4, 37, 80, 25, hwnd,
                                 (HMENU) ID_UP,
@@ -456,7 +456,7 @@
                                 NULL);
             SendMessage(wdg, WM_SETFONT,(WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0);
 
-            wdg = CreateWindow ("button", acp(MSGTR_Down),
+            wdg = CreateWindow ("button", acp(MSGTR_GUI_WIN32_Down),
                                 WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
                                 4, 64, 80, 25, hwnd,
                                 (HMENU) ID_DOWN,
@@ -464,7 +464,7 @@
                                 NULL);
             SendMessage(wdg, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT),0);
 
-            wdg = CreateWindow ("button", acp(MSGTR_Remove),
+            wdg = CreateWindow ("button", acp(MSGTR_GUI_Remove),
                                 WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
                                 4, 91, 80, 25, hwnd,
                                 (HMENU) ID_REMOVE,
@@ -472,7 +472,7 @@
                                 NULL);
             SendMessage(wdg, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT),0);
 
-            wdg = CreateWindow ("button", acp(MSGTR_Load),
+            wdg = CreateWindow ("button", acp(MSGTR_GUI_WIN32_Load),
                                 WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
                                 4, 118, 80, 25, hwnd,
                                 (HMENU) ID_PLAYLISTLOAD,
@@ -480,7 +480,7 @@
                                 NULL);
             SendMessage(wdg, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT),0);
 
-            wdg = CreateWindow ("button", acp(MSGTR_Save),
+            wdg = CreateWindow ("button", acp(MSGTR_GUI_WIN32_Save),
                                 WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
                                 4, 145, 80, 25, hwnd,
                                 (HMENU) ID_PLAYLISTSAVE,
@@ -488,7 +488,7 @@
                                 NULL);
             SendMessage(wdg, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT),0);
 
-            wdg = CreateWindow ("button", acp(MSGTR_Close),
+            wdg = CreateWindow ("button", acp(MSGTR_GUI_WIN32_Close),
                                 WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
                                 4, 193, 80, 25, hwnd,
                                 (HMENU) ID_CLOSE,
@@ -610,13 +610,13 @@
 
 void update_playlistwindow(void)
 {
-    HWND hWnd = FindWindow(NULL, acp(MSGTR_PlayList));
+    HWND hWnd = FindWindow(NULL, acp(MSGTR_GUI_Playlist));
     if (hWnd) updatetracklist(hWnd);
 }
 
 void display_playlistwindow(gui_t *gui)
 {
-    HWND hWnd = FindWindow(NULL, acp(MSGTR_PlayList));
+    HWND hWnd = FindWindow(NULL, acp(MSGTR_GUI_Playlist));
     HINSTANCE hInstance = GetModuleHandle(NULL);
     WNDCLASS wc;
     int x, y;
@@ -635,14 +635,14 @@
     wc.hCursor       = LoadCursor(NULL,IDC_ARROW);
     wc.hIcon         = gui->icon;
     wc.hbrBackground = SOLID_GREY2;
-    wc.lpszClassName = acp(MSGTR_PlayList);
+    wc.lpszClassName = acp(MSGTR_GUI_Playlist);
     wc.lpszMenuName  = NULL;
     RegisterClass(&wc);
     create_playlistmenu(gui);
     x = (GetSystemMetrics(SM_CXSCREEN) / 2) - (400 / 2);   /* Erik: center popup window on screen */
     y = (GetSystemMetrics(SM_CYSCREEN) / 2) - (254 / 2);
-    hWnd = CreateWindow(acp(MSGTR_PlayList),
-                        acp(MSGTR_PlayList),
+    hWnd = CreateWindow(acp(MSGTR_GUI_Playlist),
+                        acp(MSGTR_GUI_Playlist),
                         WS_POPUPWINDOW | WS_CAPTION | WS_MINIMIZEBOX,
                         x,
                         y,
@@ -734,7 +734,7 @@
 
 void display_skinbrowser(gui_t* gui)
 {
-    HWND hWnd = FindWindow(NULL, acp(MSGTR_SkinBrowser));
+    HWND hWnd = FindWindow(NULL, acp(MSGTR_GUI_SkinBrowser));
     HINSTANCE hInstance = GetModuleHandle(NULL);
     WNDCLASS wc;
     int x, y;
@@ -753,13 +753,13 @@
     wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
     wc.hIcon         = gui->icon;
     wc.hbrBackground = SOLID_GREY2;
-    wc.lpszClassName = acp(MSGTR_SkinBrowser);
+    wc.lpszClassName = acp(MSGTR_GUI_SkinBrowser);
     wc.lpszMenuName  = NULL;
     RegisterClass(&wc);
     x = (GetSystemMetrics(SM_CXSCREEN) / 2) - (180 / 2);
     y = (GetSystemMetrics(SM_CYSCREEN) / 2) - (102 / 2);
-    hWnd = CreateWindow(acp(MSGTR_SkinBrowser),
-                        acp(MSGTR_SkinBrowser),
+    hWnd = CreateWindow(acp(MSGTR_GUI_SkinBrowser),
+                        acp(MSGTR_GUI_SkinBrowser),
                         WS_POPUPWINDOW |WS_CAPTION,
                         x,
                         y,
@@ -786,7 +786,7 @@
     switch (iMsg)
     {
         case WM_CREATE:
-            wdg = CreateWindow("button", acp(MSGTR_Ok),
+            wdg = CreateWindow("button", acp(MSGTR_GUI_Ok),
                                WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
                                4, 43, 80, 25, hwnd,
                                (HMENU) ID_OK,
@@ -794,7 +794,7 @@
                                NULL);
                               SendMessage(wdg, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0);
 
-            wdg = CreateWindow("button", acp(MSGTR_Cancel),
+            wdg = CreateWindow("button", acp(MSGTR_GUI_Cancel),
                                WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
                                90, 43, 80, 25, hwnd,
                                (HMENU) ID_CANCEL,
@@ -871,7 +871,7 @@
     int x, y;
 
     if (guiInfo.StreamType != STREAMTYPE_DVD) return;
-    if (FindWindow(NULL, acp(MSGTR_SelectTitleChapter"..."))) return;
+    if (FindWindow(NULL, acp(MSGTR_GUI_WIN32_SelectTitleChapter"..."))) return;
 
     wc.style         = CS_HREDRAW | CS_VREDRAW;
     wc.lpfnWndProc   = TitleChapterWndProc;
@@ -881,13 +881,13 @@
     wc.hCursor       = LoadCursor(NULL,IDC_ARROW);
     wc.hIcon         = gui->icon;
     wc.hbrBackground = SOLID_GREY2;
-    wc.lpszClassName = acp(MSGTR_SelectTitleChapter"...");
+    wc.lpszClassName = acp(MSGTR_GUI_WIN32_SelectTitleChapter"...");
     wc.lpszMenuName  = NULL;
     RegisterClass(&wc);
     x = (GetSystemMetrics(SM_CXSCREEN) / 2) - (180 / 2);
     y = (GetSystemMetrics(SM_CYSCREEN) / 2) - (100 / 2);
-    hWnd = CreateWindow(acp(MSGTR_SelectTitleChapter"..."),
-                        acp(MSGTR_SelectTitleChapter"..."),
+    hWnd = CreateWindow(acp(MSGTR_GUI_WIN32_SelectTitleChapter"..."),
+                        acp(MSGTR_GUI_WIN32_SelectTitleChapter"..."),
                         WS_POPUPWINDOW | WS_CAPTION,
                         x,
                         y,
@@ -910,7 +910,7 @@
     {
         case WM_CREATE:
         {
-            btn = CreateWindow("button", acp(MSGTR_Clear),
+            btn = CreateWindow("button", acp(MSGTR_GUI_Clear),
                                WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
                                157, 143, 80, 25, hwnd,
                                (HMENU) ID_DEFAULTS,
@@ -918,7 +918,7 @@
                                NULL);
             SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0);
 
-            btn = CreateWindow("button", acp(MSGTR_Close),
+            btn = CreateWindow("button", acp(MSGTR_GUI_WIN32_Close),
                                WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
                                243, 143, 80, 25, hwnd,
                                (HMENU) ID_CLOSE,
@@ -926,7 +926,7 @@
                                NULL);
             SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0);
 
-            label = CreateWindow("static", acp(MSGTR_EQU_Brightness":"),
+            label = CreateWindow("static", acp(MSGTR_GUI_Brightness":"),
                                  WS_CHILD | WS_VISIBLE,
                                  12, 122, 70, 15, hwnd,
                                  NULL,
@@ -934,7 +934,7 @@
                                  NULL);
             SendMessage(label, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0);
 
-            label = CreateWindow("static", acp(MSGTR_EQU_Contrast":"),
+            label = CreateWindow("static", acp(MSGTR_GUI_Contrast":"),
                                  WS_CHILD | WS_VISIBLE,
                                  99, 122, 70, 15, hwnd,
                                  NULL,
@@ -942,14 +942,14 @@
                                  NULL);
             SendMessage(label, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0);
 
-            label = CreateWindow("static", acp(MSGTR_EQU_Hue":"),
+            label = CreateWindow("static", acp(MSGTR_GUI_Hue":"),
                                  WS_CHILD | WS_VISIBLE,
                                  191, 122, 70, 15, hwnd,
                                  NULL,
                                  ((LPCREATESTRUCT) lParam) -> hInstance, NULL);
             SendMessage(label, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0);
 
-            label = CreateWindow("static", acp(MSGTR_EQU_Saturation":"),
+            label = CreateWindow("static", acp(MSGTR_GUI_Saturation":"),
                                  WS_CHILD | WS_VISIBLE,
                                  260, 122, 70, 15, hwnd,
                                  NULL,
@@ -1085,7 +1085,7 @@
     int x, y;
 
     if(!guiInfo.sh_video) return;
-    if(FindWindow(NULL, acp(MSGTR_Equalizer))) return;
+    if(FindWindow(NULL, acp(MSGTR_GUI_Equalizer))) return;
     wc.style         = CS_HREDRAW | CS_VREDRAW;
     wc.lpfnWndProc   = EqWndProc;
     wc.cbClsExtra    = 0;
@@ -1094,13 +1094,13 @@
     wc.hCursor       = LoadCursor(NULL,IDC_ARROW);
     wc.hIcon         = gui->icon;
     wc.hbrBackground = SOLID_GREY2;
-    wc.lpszClassName = acp(MSGTR_Equalizer);
+    wc.lpszClassName = acp(MSGTR_GUI_Equalizer);
     wc.lpszMenuName  = NULL;
     RegisterClass(&wc);
     x = (GetSystemMetrics(SM_CXSCREEN) / 2) - (332 / 2);
     y = (GetSystemMetrics(SM_CYSCREEN) / 2) - (200 / 2);
-    hWnd = CreateWindow(acp(MSGTR_Equalizer),
-                        acp(MSGTR_Equalizer),
+    hWnd = CreateWindow(acp(MSGTR_GUI_Equalizer),
+                        acp(MSGTR_GUI_Equalizer),
                         WS_POPUPWINDOW | WS_CAPTION,
                         x,
                         y,