Author: gedmurphy Date: Wed Nov 7 16:13:05 2007 New Revision: 30240
URL: http://svn.reactos.org/svn/reactos?rev=30240&view=rev Log: - set the colors combo box according to the .rdp file - add a note for server browsing
Modified: trunk/reactos/base/applications/mstsc/connectdialog.c trunk/reactos/base/applications/mstsc/resource.h trunk/reactos/base/applications/mstsc/win32.c
Modified: trunk/reactos/base/applications/mstsc/connectdialog.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/con... ============================================================================== --- trunk/reactos/base/applications/mstsc/connectdialog.c (original) +++ trunk/reactos/base/applications/mstsc/connectdialog.c Wed Nov 7 16:13:05 2007 @@ -262,6 +262,28 @@ { switch(LOWORD(wParam)) { + case IDC_SERVERCOMBO: + if (HIWORD(wParam) == CBN_SELCHANGE) + { + INT last, cur; + + cur = SendDlgItemMessage(hDlg, + IDC_SERVERCOMBO, + CB_GETCURSEL, + 0, + 0); + cur++; + + last = SendDlgItemMessage(hDlg, + IDC_SERVERCOMBO, + CB_GETCOUNT, + 0, + 0); + if (cur == last) + MessageBox(hDlg, _T("SMB is not yet supported"), _T("RDP error"), MB_ICONERROR); + } + break; + case IDC_SAVE: SaveRdpSettingsToFile(NULL, pInfo->pRdpSettings); break; @@ -548,6 +570,7 @@ DWORD MaxBpp = 0; UINT HighBpp; DWORD width, height; + UINT types[4];
pInfo->CurrentDisplayDevice = pInfo->DisplayDeviceList; /* Update global variable */
@@ -565,10 +588,26 @@ switch (MaxBpp) { case 32: - case 24: HighBpp = IDS_HIGHCOLOR24; break; - case 16: HighBpp = IDS_HIGHCOLOR16; break; - case 8: HighBpp = IDS_256COLORS; break; - } + case 24: + HighBpp = IDS_HIGHCOLOR24; + num = 4; + break; + + case 16: + HighBpp = IDS_HIGHCOLOR16; + num = 3; + break; + + case 8: + HighBpp = IDS_256COLORS; + num = 1; + break; + } + + types[0] = IDS_256COLORS; + types[1] = IDS_HIGHCOLOR15; + types[2] = IDS_HIGHCOLOR16; + types[3] = IDS_HIGHCOLOR24;
/* Fill color depths combo box */ SendDlgItemMessage(pInfo->hDisplayPage, @@ -576,7 +615,6 @@ CB_RESETCONTENT, 0, 0); - num = HighBpp - IDS_256COLORS;
for (i = 0, Current = pInfo->DisplayDeviceList->Settings; i <= num && Current != NULL; @@ -584,7 +622,7 @@ { TCHAR Buffer[64]; if (LoadString(hInst, - (IDS_256COLORS + i), + types[i], Buffer, sizeof(Buffer) / sizeof(TCHAR))) { @@ -604,7 +642,7 @@ IDC_BPPCOMBO, CB_SETITEMDATA, index, - Current->dmBitsPerPel); + types[i]); } } } @@ -731,7 +769,48 @@ }
if (GotDev) + { + INT bpp, num, i; + BOOL bSet = FALSE; + FillResolutionsAndColors(pInfo); + + /* set color combo */ + bpp = GetIntegerFromSettings(pInfo->pRdpSettings, L"session bpp"); + + num = SendDlgItemMessage(pInfo->hDisplayPage, + IDC_BPPCOMBO, + CB_GETCOUNT, + 0, + 0); + for (i = 0; i < num; i++) + { + INT data = SendDlgItemMessage(pInfo->hDisplayPage, + IDC_BPPCOMBO, + CB_GETITEMDATA, + i, + 0); + if (data == bpp) + { + SendDlgItemMessage(pInfo->hDisplayPage, + IDC_BPPCOMBO, + CB_SETCURSEL, + i, + 0); + bSet = TRUE; + break; + } + } + + if (!bSet) + { + SendDlgItemMessage(pInfo->hDisplayPage, + IDC_BPPCOMBO, + CB_SETCURSEL, + num - 1, + 0); + } + } }
Modified: trunk/reactos/base/applications/mstsc/resource.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/res... ============================================================================== --- trunk/reactos/base/applications/mstsc/resource.h (original) +++ trunk/reactos/base/applications/mstsc/resource.h Wed Nov 7 16:13:05 2007 @@ -1,4 +1,9 @@ #define IDC_STATIC -1 + +#define IDS_256COLORS 8 +#define IDS_HIGHCOLOR15 15 +#define IDS_HIGHCOLOR16 16 +#define IDS_HIGHCOLOR24 24
#define IDD_CONNECTDIALOG 101 #define IDD_GENERAL 105 @@ -32,8 +37,3 @@ #define IDS_PIXEL 3006 #define IDS_FULLSCREEN 3007 #define IDS_BROWSESERVER 3008 - -#define IDS_256COLORS 4000 -#define IDS_HIGHCOLOR15 4001 -#define IDS_HIGHCOLOR16 4002 -#define IDS_HIGHCOLOR24 4003
Modified: trunk/reactos/base/applications/mstsc/win32.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/win... ============================================================================== --- trunk/reactos/base/applications/mstsc/win32.c (original) +++ trunk/reactos/base/applications/mstsc/win32.c Wed Nov 7 16:13:05 2007 @@ -1271,46 +1271,6 @@ return (state == 0); }
-/*****************************************************************************/ -/* display the command line options available */ -static void -mi_show_params(void) -{ - char text1[512 * 4]; - TCHAR textx[512 * 4]; - TCHAR lcaption[64]; - - strcpy(text1, ""); - strcat(text1, "WinRDesktop - an RDP client based on rdesktop\r\n"); - strcat(text1, "You can't run this application without " ); - strcat(text1, "correct parameters\r\n"); - strcat(text1, "\r\n"); - strcat(text1, "command line options\r\n"); - strcat(text1, "\r\n"); - strcat(text1, "WinRDesktop [-g widthxheight] [-t port] [-a bpp]\r\n"); - strcat(text1, " [-f] [-u username] [-p password] [-d domain]\r\n"); - strcat(text1, " [-s shell] [-c working directory] [-n host name]\r\n"); - strcat(text1, " server-name-or-ip\r\n"); - strcat(text1, "\r\n"); - strcat(text1, "You can use a config file in the current directory\r\n"); - strcat(text1, "called WinRDesktop.ini\r\n"); - strcat(text1, "The file should look like this...\r\n"); - strcat(text1, "[main]\r\n"); - strcat(text1, "server=192.168.1.1\r\n"); - strcat(text1, "port=3389\r\n"); - strcat(text1, "username=user1\r\n"); - strcat(text1, "password=password1\r\n"); - strcat(text1, "bpp=16\r\n"); - strcat(text1, "geometry=800x600\r\n"); -#ifdef WITH_DEBUG - printf(text1); -#else /* WITH_DEBUG */ - str_to_uni(lcaption, "WinRDesktop"); - str_to_uni(textx, text1); - MessageBox(g_Wnd, textx, lcaption, MB_OK); -#endif /* WITH_DEBUG */ -} - #ifdef WITH_DEBUG /*****************************************************************************/ int @@ -1346,8 +1306,6 @@ ret = 0; } //} - else - mi_show_params();
WSACleanup();