summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de>2005-04-11 10:16:25 +0000
committerAlexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de>2005-04-11 10:16:25 +0000
commit867721ab65ce4a185cbc894d8969e9c6b460e1fc (patch)
treed3c67b6c47078bac8d9ba6cb9657f0dba4bac344
parent6870f13c45a0300e598725b23cd613df522e234e (diff)
Added wizard page for clipboard selection and additional server parameters
-rw-r--r--config.cc5
-rw-r--r--config.h8
-rwxr-xr-xmain.cc35
-rwxr-xr-xresources/dialog.rc9
-rwxr-xr-xresources/resources.h8
-rw-r--r--resources/strings.rc9
6 files changed, 65 insertions, 9 deletions
diff --git a/config.cc b/config.cc
index a70dd4f..695d013 100644
--- a/config.cc
+++ b/config.cc
@@ -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();
diff --git a/config.h b/config.h
index 29f9352..ef0a6f9 100644
--- a/config.h
+++ b/config.h
@@ -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);
diff --git a/main.cc b/main.cc
index c8438a5..0309489 100755
--- a/main.cc
+++ b/main.cc
@@ -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)
diff --git a/resources/dialog.rc b/resources/dialog.rc
index 381304c..a59d616 100755
--- a/resources/dialog.rc
+++ b/resources/dialog.rc
@@ -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
diff --git a/resources/resources.h b/resources/resources.h
index f268052..405780f 100755
--- a/resources/resources.h
+++ b/resources/resources.h
@@ -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
diff --git a/resources/strings.rc b/resources/strings.rc
index 238511d..17bcaa5 100644
--- a/resources/strings.rc
+++ b/resources/strings.rc
@@ -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