Added wizard page for clipboard selection and additional server parameters
This commit is contained in:
parent
6848b03538
commit
1fbd38f3b4
|
@ -181,6 +181,8 @@ void CConfig::Save(const char *filename)
|
|||
setAttribute(root, L"XDMCPHost", xdmcp_host.c_str());
|
||||
setAttribute(root, L"XDMCPBroadcast", broadcast?L"True":L"False");
|
||||
setAttribute(root, L"XDMCPIndirect", indirect?L"True":L"False");
|
||||
setAttribute(root, L"Clipboard", clipboard?L"True":L"False");
|
||||
setAttribute(root, L"ExtraParams", extra_params.c_str());
|
||||
|
||||
VARIANT var = VariantString(filename);
|
||||
HRCALL(doc->save(var), "save");
|
||||
|
@ -271,7 +273,8 @@ void CConfig::Load(const char *filename)
|
|||
getAttribute(root, L"XDMCPHost", xdmcp_host);
|
||||
getAttributeBool(root, L"XDMCPBroadcast", broadcast);
|
||||
getAttributeBool(root, L"XDMCPIndirect", indirect);
|
||||
|
||||
getAttributeBool(root, L"Clipboard", clipboard);
|
||||
getAttribute(root, L"ExtraParams", extra_params);
|
||||
|
||||
|
||||
doc->Release();
|
||||
|
|
|
@ -40,14 +40,18 @@ struct CConfig
|
|||
bool broadcast;
|
||||
bool indirect;
|
||||
std::string xdmcp_host;
|
||||
bool clipboard;
|
||||
std::string extra_params;
|
||||
#ifdef _DEBUG
|
||||
CConfig() : window(MultiWindow), client(StartProgram), local(false), display("1"),
|
||||
protocol("Putty"), program("xterm"), host("lupus"), user("ago"),
|
||||
broadcast(false), indirect(false), xdmcp_host("lupus") {};
|
||||
broadcast(false), indirect(false), xdmcp_host("lupus"),
|
||||
clipboard(true), extra_params() {};
|
||||
#else
|
||||
CConfig() : window(MultiWindow), client(StartProgram), local(false), display("0"),
|
||||
protocol("Putty"), program("xterm"), host(""), user(""),
|
||||
broadcast(true), indirect(false), xdmcp_host("") {};
|
||||
broadcast(true), indirect(false), xdmcp_host(""),
|
||||
clipboard(true), extra_params() {};
|
||||
#endif
|
||||
void Load(const char* filename);
|
||||
void Save(const char* filename);
|
||||
|
|
|
@ -59,6 +59,7 @@ class CMyWizard : public CWizard
|
|||
AddPage(IDD_PROGRAM, IDS_PROGRAM_TITLE, IDS_PROGRAM_SUBTITLE);
|
||||
AddPage(IDD_XDMCP, IDS_XDMCP_TITLE, IDS_XDMCP_SUBTITLE);
|
||||
//AddPage(IDD_FONTPATH, IDS_FONTPATH_TITLE, IDS_FONTPATH_SUBTITLE);
|
||||
AddPage(IDD_CLIPBOARD, IDS_CLIPBOARD_TITLE, IDS_CLIPBOARD_SUBTITLE);
|
||||
AddPage(IDD_FINISH, IDS_FINISH_TITLE, IDS_FINISH_SUBTITLE);
|
||||
}
|
||||
|
||||
|
@ -124,7 +125,7 @@ class CMyWizard : public CWizard
|
|||
} else if (IsDlgButtonChecked(hwndDlg, IDC_CLIENT_NONE))
|
||||
{
|
||||
config.client = CConfig::NoClient;
|
||||
SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_FINISH);
|
||||
SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_CLIPBOARD);
|
||||
} else
|
||||
SetWindowLong(hwndDlg, DWL_MSGRESULT, -1);
|
||||
return TRUE;
|
||||
|
@ -156,7 +157,7 @@ class CMyWizard : public CWizard
|
|||
if (!config.local && (config.host.empty() || config.program.empty()))
|
||||
SetWindowLong(hwndDlg, DWL_MSGRESULT, -1);
|
||||
else
|
||||
SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_FINISH);
|
||||
SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_CLIPBOARD);
|
||||
return TRUE;
|
||||
case IDD_XDMCP:
|
||||
// Check for broadcast
|
||||
|
@ -185,8 +186,23 @@ class CMyWizard : public CWizard
|
|||
if (!config.broadcast && config.xdmcp_host.empty())
|
||||
SetWindowLong(hwndDlg, DWL_MSGRESULT, -1);
|
||||
else
|
||||
SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_FINISH);
|
||||
SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_CLIPBOARD);
|
||||
return TRUE;
|
||||
case IDD_CLIPBOARD:
|
||||
// check for clipboard
|
||||
if (IsDlgButtonChecked(hwndDlg, IDC_CLIPBOARD))
|
||||
config.clipboard = true;
|
||||
else
|
||||
config.clipboard = false;
|
||||
// read parameters
|
||||
{
|
||||
char buffer[512];
|
||||
GetDlgItemText(hwndDlg, IDC_EXTRA_PARAMS, buffer, 512);
|
||||
buffer[511] = 0;
|
||||
config.extra_params = buffer;
|
||||
}
|
||||
SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_FINISH);
|
||||
return TRUE;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -218,7 +234,7 @@ class CMyWizard : public CWizard
|
|||
SetWindowLong(hwndDlg, DWL_MSGRESULT, IDD_CLIENTS);
|
||||
return TRUE;
|
||||
case IDD_FONTPATH:
|
||||
case IDD_FINISH: // temporary. fontpath is disabled
|
||||
case IDD_CLIPBOARD: // temporary. fontpath is disabled
|
||||
switch (config.client)
|
||||
{
|
||||
case CConfig::NoClient:
|
||||
|
@ -416,6 +432,10 @@ class CMyWizard : public CWizard
|
|||
// Set hostname
|
||||
SetDlgItemText(hwndDlg, IDC_XDMCP_HOST, config.xdmcp_host.c_str());
|
||||
break;
|
||||
case IDD_CLIPBOARD:
|
||||
CheckDlgButton(hwndDlg, IDC_CLIPBOARD, config.clipboard?BST_CHECKED:BST_UNCHECKED);
|
||||
SetDlgItemText(hwndDlg, IDC_EXTRA_PARAMS, config.extra_params.c_str());
|
||||
break;
|
||||
|
||||
}
|
||||
case WM_COMMAND:
|
||||
|
@ -514,6 +534,13 @@ class CMyWizard : public CWizard
|
|||
buffer += config.xdmcp_host;
|
||||
}
|
||||
}
|
||||
if (config.clipboard)
|
||||
buffer += "-clipboard ";
|
||||
if (!config.extra_params.empty())
|
||||
{
|
||||
buffer += config.extra_params;
|
||||
buffer += " ";
|
||||
}
|
||||
|
||||
// Construct client commandline
|
||||
if (config.client == CConfig::StartProgram)
|
||||
|
|
|
@ -95,11 +95,16 @@ BEGIN
|
|||
LTEXT STR_XDMCP_QUERY_DESC,IDC_XDMCP_QUERY_DESC,7,56,300,42
|
||||
END
|
||||
|
||||
IDD_FONTPATH DIALOGEX 0, 0, 317, 143
|
||||
IDD_CLIPBOARD DIALOGEX 0, 0, 317, 143
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU | DS_CENTERMOUSE
|
||||
CAPTION STR_CAPTION_FONTPATH
|
||||
CAPTION STR_CAPTION_CLIPBOARD
|
||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||
BEGIN
|
||||
AUTOCHECKBOX STR_CLIPBOARD,IDC_CLIPBOARD,7,14,300,10
|
||||
LTEXT STR_CLIPBOARD_DESC,IDC_CLIPBOARD_DESC,19,28,280,27
|
||||
|
||||
LTEXT STR_EXTRA_PARAMS_DESC,IDC_EXTRA_PARAMS_DESC,7,56,280,10
|
||||
EDITTEXT IDC_EXTRA_PARAMS,7,70,128,12
|
||||
END
|
||||
|
||||
IDD_FINISH DIALOGEX 0, 0, 317, 143
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#define IDD_PROGRAM 104
|
||||
#define IDD_XDMCP 105
|
||||
#define IDD_FONTPATH 106
|
||||
#define IDD_CLIPBOARD 107
|
||||
|
||||
#define IDS_DISPLAY_TITLE 300
|
||||
#define IDS_DISPLAY_SUBTITLE 301
|
||||
|
@ -46,6 +47,8 @@
|
|||
#define IDS_FONTPATH_SUBTITLE 309
|
||||
#define IDS_FINISH_TITLE 310
|
||||
#define IDS_FINISH_SUBTITLE 311
|
||||
#define IDS_CLIPBOARD_TITLE 312
|
||||
#define IDS_CLIPBOARD_SUBTITLE 313
|
||||
#define IDS_SAVE_TITLE 320
|
||||
#define IDS_SAVE_FILETITLE 321
|
||||
#define IDS_SAVE_FILTER 322
|
||||
|
@ -89,3 +92,8 @@
|
|||
#define IDC_FINISH_DESC 250
|
||||
#define IDC_FINISH_SAVE 251
|
||||
#define IDC_FINISH_SAVE_DESC 252
|
||||
|
||||
#define IDC_CLIPBOARD 260
|
||||
#define IDC_CLIPBOARD_DESC 261
|
||||
#define IDC_EXTRA_PARAMS 262
|
||||
#define IDC_EXTRA_PARAMS_DESC 263
|
||||
|
|
|
@ -57,6 +57,11 @@
|
|||
|
||||
#define STR_CAPTION_FONTPATH "Fontpath settings"
|
||||
|
||||
#define STR_CAPTION_CLIPBOARD "Clipboard settings"
|
||||
#define STR_CLIPBOARD "Clipboard"
|
||||
#define STR_CLIPBOARD_DESC "Start the integrated clipboard manager"
|
||||
#define STR_EXTRA_PARAMS_DESC "Additional parameters for Xming"
|
||||
|
||||
#define STR_CAPTION_FINISH "Finish configuration"
|
||||
#define STR_FINISH_DESC "Configuration is complete. Clish Finish to start Xming."
|
||||
#define STR_FINISH_SAVE_DESC "You may also save the configuration for later use."
|
||||
|
@ -74,6 +79,8 @@
|
|||
#define STR_FONTPATH_SUBTITLE ""
|
||||
#define STR_FINISH_TITLE "Configuration complete"
|
||||
#define STR_FINISH_SUBTITLE ""
|
||||
#define STR_CLIPBOARD_TITLE "Clipboard settings"
|
||||
#define STR_CLIPBOARD_SUBTITLE ""
|
||||
|
||||
#define STR_SAVE_TITLE "Save configuration"
|
||||
#define STR_SAVE_FILETITLE "Filename"
|
||||
|
@ -93,6 +100,8 @@ BEGIN
|
|||
IDS_FONTPATH_SUBTITLE STR_FONTPATH_SUBTITLE
|
||||
IDS_FINISH_TITLE STR_FINISH_TITLE
|
||||
IDS_FINISH_SUBTITLE STR_FINISH_SUBTITLE
|
||||
IDS_CLIPBOARD_TITLE STR_CLIPBOARD_TITLE
|
||||
IDS_CLIPBOARD_SUBTITLE STR_CLIPBOARD_SUBTITLE
|
||||
IDS_SAVE_TITLE STR_SAVE_TITLE
|
||||
IDS_SAVE_FILETITLE STR_SAVE_FILETITLE
|
||||
IDS_SAVE_FILTER STR_SAVE_FILTER
|
||||
|
|
Loading…
Reference in New Issue