[ros-diffs] [gedmurphy] 30241: - add code to set changes to the main configuration and use it for the resolution slider - fix a bug in showing the current resolution in the label

gedmurphy at svn.reactos.org gedmurphy at svn.reactos.org
Wed Nov 7 14:49:32 CET 2007


Author: gedmurphy
Date: Wed Nov  7 16:49:31 2007
New Revision: 30241

URL: http://svn.reactos.org/svn/reactos?rev=30241&view=rev
Log:
- add code to set changes to the main configuration and use it for the resolution slider
- fix a bug in showing the current resolution in the label

Modified:
    trunk/reactos/base/applications/mstsc/connectdialog.c
    trunk/reactos/base/applications/mstsc/rdpfile.c
    trunk/reactos/base/applications/mstsc/todo.h

Modified: trunk/reactos/base/applications/mstsc/connectdialog.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/connectdialog.c?rev=30241&r1=30240&r2=30241&view=diff
==============================================================================
--- trunk/reactos/base/applications/mstsc/connectdialog.c (original)
+++ trunk/reactos/base/applications/mstsc/connectdialog.c Wed Nov  7 16:49:31 2007
@@ -557,6 +557,14 @@
                        0,
                        (LPARAM)Buffer);
 
+    /* save new settings */
+    SetIntegerToSettings(pInfo->pRdpSettings,
+                         L"desktopwidth",
+                         pInfo->DisplayDeviceList->Resolutions[position].dmPelsWidth);
+    SetIntegerToSettings(pInfo->pRdpSettings,
+                         L"desktopheight",
+                         pInfo->DisplayDeviceList->Resolutions[position].dmPelsHeight);
+
 }
 
 
@@ -568,7 +576,6 @@
     TCHAR Pixel[64];
     DWORD index, i, num;
     DWORD MaxBpp = 0;
-    UINT HighBpp;
     DWORD width, height;
     UINT types[4];
 
@@ -588,20 +595,9 @@
     switch (MaxBpp)
     {
         case 32:
-        case 24: 
-            HighBpp = IDS_HIGHCOLOR24;
-            num = 4;
-            break;
-
-        case 16: 
-            HighBpp = IDS_HIGHCOLOR16;
-            num = 3;
-            break;
-
-        case 8:
-            HighBpp = IDS_256COLORS;
-            num = 1;
-            break;
+        case 24: num = 4; break;
+        case 16: num = 3; break;
+        case 8:  num = 1; break;
     }
 
     types[0] = IDS_256COLORS;
@@ -659,23 +655,6 @@
                        TRUE,
                        MAKELONG(0, pInfo->DisplayDeviceList->ResolutionsCount)); //extra 1 for full screen
 
-    if (LoadString(hInst,
-                   IDS_PIXEL,
-                   Pixel,
-                   sizeof(Pixel) / sizeof(TCHAR)))
-    {
-        _stprintf(Buffer,
-                  Pixel,
-                  pInfo->CurrentDisplayDevice->CurrentSettings->dmPelsWidth,
-                  pInfo->CurrentDisplayDevice->CurrentSettings->dmPelsHeight,
-                  Pixel);
-        SendDlgItemMessage(pInfo->hDisplayPage,
-                           IDC_SETTINGS_RESOLUTION_TEXT,
-                           WM_SETTEXT,
-                           0,
-                           (LPARAM)Buffer);
-    }
-
     width = GetIntegerFromSettings(pInfo->pRdpSettings, L"desktopwidth");
     height = GetIntegerFromSettings(pInfo->pRdpSettings, L"desktopheight");
 
@@ -693,6 +672,23 @@
                                    index);
                 break;
             }
+        }
+
+        if (LoadString(hInst,
+                       IDS_PIXEL,
+                       Pixel,
+                       sizeof(Pixel) / sizeof(TCHAR)))
+        {
+            _stprintf(Buffer,
+                      Pixel,
+                      width,
+                      height,
+                      Pixel);
+            SendDlgItemMessage(pInfo->hDisplayPage,
+                               IDC_SETTINGS_RESOLUTION_TEXT,
+                               WM_SETTEXT,
+                               0,
+                               (LPARAM)Buffer);
         }
     }
 }

Modified: trunk/reactos/base/applications/mstsc/rdpfile.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/rdpfile.c?rev=30241&r1=30240&r2=30241&view=diff
==============================================================================
--- trunk/reactos/base/applications/mstsc/rdpfile.c (original)
+++ trunk/reactos/base/applications/mstsc/rdpfile.c Wed Nov  7 16:49:31 2007
@@ -16,6 +16,64 @@
     L"compression",
 };
 
+
+
+BOOL
+SetIntegerToSettings(PRDPSETTINGS pRdpSettings,
+                     LPWSTR lpKey,
+                     INT Value)
+{
+    BOOL bRet = FALSE;
+
+    if (pRdpSettings)
+    {
+        INT i;
+
+        for (i = 0; i < pRdpSettings->NumSettings; i++)
+        {
+            if (wcscmp(pRdpSettings->pSettings[i].Key, lpKey) == 0)
+            {
+                if (pRdpSettings->pSettings[i].Type == L'i')
+                {
+                    pRdpSettings->pSettings[i].Value.i = Value;
+                    bRet = TRUE;
+                    break;
+                }
+            }
+        }
+    }
+
+    return bRet;
+}
+
+
+BOOL
+SetStringToSettings(PRDPSETTINGS pRdpSettings,
+                    LPWSTR lpKey,
+                    LPWSTR lpValue)
+{
+    BOOL bRet = FALSE;
+
+    if (pRdpSettings)
+    {
+        INT i;
+
+        for (i = 0; i < pRdpSettings->NumSettings; i++)
+        {
+            if (wcscmp(pRdpSettings->pSettings[i].Key, lpKey) == 0)
+            {
+                if (pRdpSettings->pSettings[i].Type == L's')
+                {
+                    wcscpy(pRdpSettings->pSettings[i].Value.i, lpValue);
+                    bRet = TRUE;
+                    break;
+                }
+            }
+        }
+    }
+
+    return bRet;
+}
 
 
 INT

Modified: trunk/reactos/base/applications/mstsc/todo.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/todo.h?rev=30241&r1=30240&r2=30241&view=diff
==============================================================================
--- trunk/reactos/base/applications/mstsc/todo.h (original)
+++ trunk/reactos/base/applications/mstsc/todo.h Wed Nov  7 16:49:31 2007
@@ -22,3 +22,5 @@
 BOOL SaveRdpSettingsToFile(LPWSTR lpFile, PRDPSETTINGS pRdpSettings);
 INT GetIntegerFromSettings(PRDPSETTINGS pSettings, LPWSTR lpValue);
 LPWSTR GetStringFromSettings(PRDPSETTINGS pSettings, LPWSTR lpValue);
+BOOL SetIntegerToSettings(PRDPSETTINGS pRdpSettings, LPWSTR lpKey, INT Value);
+BOOL SetStringToSettings(PRDPSETTINGS pRdpSettings, LPWSTR lpKey, LPWSTR lpValue);




More information about the Ros-diffs mailing list