mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
.ide: sf.net bug #2834384 fixed (thanks dolik.rce)
git-svn-id: svn://ultimatepp.org/upp/trunk@2382 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
33bd81ed97
commit
2b08da2c2c
3 changed files with 47 additions and 11 deletions
|
|
@ -48,26 +48,49 @@ int GetClipboardFormatCode(const char *format_id)
|
|||
return format_map[f];
|
||||
}
|
||||
|
||||
void ClipboardLog(const char *txt)
|
||||
{
|
||||
#ifdef flagCHECKCLIPBOARD
|
||||
FileAppend f(GetExeDirFile("clip.log"));
|
||||
f << txt << ": " << GetLastErrorMessage() << "\n";
|
||||
#endif
|
||||
}
|
||||
|
||||
void ClearClipboard()
|
||||
{
|
||||
GuiLock __;
|
||||
sClipMap().Clear();
|
||||
#ifdef flagCHECKCLIPBOARD
|
||||
DeleteFile(GetExeDirFile("clip.log"));
|
||||
#endif
|
||||
ClipboardLog("* ClearClipboard");
|
||||
if(OpenClipboard(utilityHWND)) {
|
||||
EmptyClipboard();
|
||||
CloseClipboard();
|
||||
if(!EmptyClipboard())
|
||||
ClipboardLog("EmptyClipboard ERROR");
|
||||
if(!CloseClipboard())
|
||||
ClipboardLog("CloseClipboard ERROR");
|
||||
}
|
||||
#ifdef flagCHECKCLIPBOARD
|
||||
else {
|
||||
ClipboardLog("OpenClipboard ERROR");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetClipboardRaw(int format, const byte *data, int length)
|
||||
{
|
||||
GuiLock __;
|
||||
HANDLE handle = NULL;
|
||||
ClipboardLog("* SetClipboardRaw");
|
||||
if(data) {
|
||||
handle = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, length + 2);
|
||||
byte *ptr;
|
||||
if(!handle)
|
||||
if(!handle) {
|
||||
ClipboardLog("GlobalAlloc ERROR");
|
||||
return;
|
||||
}
|
||||
if(!(ptr = (byte *)GlobalLock(handle))) {
|
||||
ClipboardLog("GlobalLock ERROR");
|
||||
GlobalFree(handle);
|
||||
return;
|
||||
}
|
||||
|
|
@ -77,6 +100,7 @@ void SetClipboardRaw(int format, const byte *data, int length)
|
|||
GlobalUnlock(handle);
|
||||
}
|
||||
if(!SetClipboardData(format, handle)) {
|
||||
ClipboardLog("SetClipboardData ERROR");
|
||||
LLOG("SetClipboardData error: " << GetLastErrorMessage());
|
||||
GlobalFree(handle);
|
||||
}
|
||||
|
|
@ -85,10 +109,14 @@ void SetClipboardRaw(int format, const byte *data, int length)
|
|||
void AppendClipboard(int format, const byte *data, int length)
|
||||
{
|
||||
GuiLock __;
|
||||
ClipboardLog("* AppendClipboard");
|
||||
if(OpenClipboard(utilityHWND)) {
|
||||
SetClipboardRaw(format, data, length);
|
||||
CloseClipboard();
|
||||
if(!CloseClipboard())
|
||||
ClipboardLog("CloseClipboard ERROR");
|
||||
}
|
||||
else
|
||||
ClipboardLog("OpenClipboard ERROR");
|
||||
}
|
||||
|
||||
void AppendClipboard(const char *format, const byte *data, int length)
|
||||
|
|
|
|||
|
|
@ -210,13 +210,20 @@ void LocalHost::Launch(const char *_cmdline, bool console)
|
|||
#endif
|
||||
#ifdef PLATFORM_POSIX
|
||||
String script = ConfigFile("console-script-" + AsString(getpid()) + ".tmp");
|
||||
if(console) {
|
||||
FileStream out(script, FileStream::CREATE, 0777);
|
||||
out << "#!/bin/sh\n"
|
||||
<< cmdline << '\n'
|
||||
<< "echo \"<--- Finished, press any key to close the window --->\"\nread\n";
|
||||
cmdline = LinuxHostConsole + " sh " + script;
|
||||
int c = LinuxHostConsole.FindFirstOf(" ");
|
||||
String lc = c < 0 ? LinuxHostConsole : LinuxHostConsole.Left(c);
|
||||
if(FileExists(lc)){
|
||||
if(console){
|
||||
FileStream out(script, FileStream::CREATE, 0777);
|
||||
out << "#!/bin/sh\n"
|
||||
<< cmdline << '\n'
|
||||
<< "echo \"<--- Finished, press any key to close the window --->\"\nread\n";
|
||||
cmdline = LinuxHostConsole + " sh " + script;
|
||||
}
|
||||
}
|
||||
else
|
||||
if(LinuxHostConsole.GetCount())
|
||||
PutConsole("Warning: Terminal '"+lc+"' not found, executing in background.");
|
||||
Buffer<char> cmd_buf(strlen(cmdline) + 1);
|
||||
char *cmd_out = cmd_buf;
|
||||
Vector<char *> args;
|
||||
|
|
|
|||
|
|
@ -86,7 +86,8 @@ mainconfig
|
|||
"" = "GUI .USEMALLOC",
|
||||
"" = ".NOGTK GUI",
|
||||
"" = "GUI HEAPDBG CHECKINIT",
|
||||
"" = "GUI TESTINSTALL";
|
||||
"" = "GUI TESTINSTALL",
|
||||
"" = "GUI CHECKCLIPBOARD";
|
||||
|
||||
custom() "",
|
||||
"",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue