winecfg: Select the just installed theme

André Hentschel nerv at dawncrow.de
Thu Feb 24 16:20:14 CST 2011


... so that the user just has to click "apply"
---
 programs/winecfg/theme.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/programs/winecfg/theme.c b/programs/winecfg/theme.c
index 4ab3689..f76a286 100644
--- a/programs/winecfg/theme.c
+++ b/programs/winecfg/theme.c
@@ -694,6 +694,9 @@ static void on_theme_install(HWND dialog)
       shfop.fFlags = FOF_NOCONFIRMMKDIR;
       if (SHFileOperationW (&shfop) == 0)
       {
+          int i;
+          ThemeFile* theme = NULL;
+
           scan_theme_files();
           if (!fill_theme_list (GetDlgItem (dialog, IDC_THEME_THEMECOMBO),
               GetDlgItem (dialog, IDC_THEME_COLORCOMBO),
@@ -707,6 +710,19 @@ static void on_theme_install(HWND dialog)
           {
               enable_size_and_color_controls (dialog, TRUE);
           }
+
+          /* Select the just installed theme. */
+          for (i = 0; i < themeFilesCount; i++)
+          {
+              theme = DSA_GetItemPtr (themeFiles, i);
+              if (lstrcmpiW (theme->themeFileName, themeFilePath) == 0)
+              {
+                  SendMessageW (GetDlgItem (dialog, IDC_THEME_THEMECOMBO), CB_SETCURSEL, i+1, 0);
+                  on_theme_changed(dialog);
+                  SendMessageW (GetParent(dialog), PSM_CHANGED, 0, 0);
+                  break;
+              }
+          }
       }
       else
           WINE_TRACE("copy operation failed\n");
-- 

Best Regards, André Hentschel



More information about the wine-patches mailing list