Autosyncing with Wine HEAD

svn path=/trunk/; revision=31788
This commit is contained in:
The Wine Synchronizer 2008-01-14 15:50:17 +00:00
parent 9eb1c01f64
commit 5df342fc2e
5 changed files with 120 additions and 23 deletions

View file

@ -332,38 +332,39 @@ static void UIINSERTOBJECTDLG_SelectCreateFromFile(InsertObjectDlgInfo* pdlgInfo
*/
static BOOL UIINSERTOBJECTDLG_PopulateObjectTypes(InsertObjectDlgInfo* pdlgInfo)
{
static const WCHAR szClsid[] = {'C','L','S','I','D',0};
static const WCHAR szInsertable[] = {'I','n','s','e','r','t','a','b','l','e',0};
static const WCHAR szNotInsertable[] = {'N','o','t','I','n','s','e','r','t','a','b','l','e',0};
DWORD i;
LONG len;
HKEY hkclsids;
HKEY hkey;
CLSID clsid;
HRESULT ret;
CHAR szclsid[128];
CHAR keydesc[MAX_PATH];
CHAR keyname[MAX_PATH];
WCHAR wszclsid[128];
WCHAR keydesc[MAX_PATH];
WCHAR keyname[MAX_PATH];
WCHAR szclsid[128];
DWORD index = 0;
UIINSERTOBJECTDLG_FreeObjectTypes(pdlgInfo);
RegOpenKeyExA(HKEY_CLASSES_ROOT, "CLSID", 0, KEY_READ, &hkclsids);
RegOpenKeyExW(HKEY_CLASSES_ROOT, szClsid, 0, KEY_READ, &hkclsids);
while (ERROR_SUCCESS == (ret = RegEnumKeyA(hkclsids, index, szclsid, MAX_PATH)))
while (ERROR_SUCCESS == (ret = RegEnumKeyW(hkclsids, index, szclsid, sizeof(szclsid)/sizeof(szclsid[0]))))
{
index++;
RegOpenKeyExA(hkclsids, szclsid, 0, KEY_READ, &hkey);
RegOpenKeyExW(hkclsids, szclsid, 0, KEY_READ, &hkey);
len = MAX_PATH;
if (ERROR_SUCCESS != RegQueryValueA(hkey, "Insertable", keyname, &len))
len = sizeof(keyname);
if (ERROR_SUCCESS != RegQueryValueW(hkey, szInsertable, keyname, &len))
continue;
len = MAX_PATH;
if (ERROR_SUCCESS == RegQueryValueA(hkey, "NotInsertable", keyname, &len))
len = sizeof(keyname);
if (ERROR_SUCCESS == RegQueryValueW(hkey, szNotInsertable, keyname, &len))
continue;
RtlMultiByteToUnicodeN(wszclsid, MAX_PATH, NULL, szclsid, MAX_PATH);
CLSIDFromString(wszclsid, &clsid);
CLSIDFromString(szclsid, &clsid);
for (i = 0; i < pdlgInfo->lpOleUIInsertObject->cClsidExclude; i++)
if (IsEqualGUID(&pdlgInfo->lpOleUIInsertObject->lpClsidExclude[i], &clsid))
@ -372,14 +373,14 @@ static BOOL UIINSERTOBJECTDLG_PopulateObjectTypes(InsertObjectDlgInfo* pdlgInfo)
if (i < pdlgInfo->lpOleUIInsertObject->cClsidExclude)
continue;
len = MAX_PATH;
if (ERROR_SUCCESS == RegQueryValueA(hkey, NULL, keydesc, &len))
len = sizeof(keydesc);
if (ERROR_SUCCESS == RegQueryValueW(hkey, NULL, keydesc, &len))
{
CLSID* lpclsid = HeapAlloc(GetProcessHeap(), 0, sizeof(CLSID));
memcpy(lpclsid, &clsid, sizeof(CLSID));
len = SendMessageA(pdlgInfo->hwndObjTypeLB, LB_ADDSTRING, 0, (LPARAM)keydesc);
SendMessageA(pdlgInfo->hwndObjTypeLB, LB_SETITEMDATA, (WPARAM)len, (LPARAM)lpclsid);
len = SendMessageW(pdlgInfo->hwndObjTypeLB, LB_ADDSTRING, 0, (LPARAM)keydesc);
SendMessageW(pdlgInfo->hwndObjTypeLB, LB_SETITEMDATA, (WPARAM)len, (LPARAM)lpclsid);
}
}
@ -471,17 +472,15 @@ static BOOL UIINSERTOBJECTDLG_OnOpen(InsertObjectDlgInfo* pdlgInfo)
}
else if (BST_CHECKED == SendMessageA(pdlgInfo->hwndCreateFromFileCB, BM_GETCHECK, 0, 0))
{
char fname[MAX_PATH];
if (pdlgInfo->lpOleUIInsertObject->lpszFile)
{
HRESULT hres;
WCHAR wcsFile[MAX_PATH];
SendMessageA(pdlgInfo->hwndFileTB, WM_GETTEXT, (WPARAM)MAX_PATH, (LPARAM)fname);
lstrcpynA(pdlgInfo->lpOleUIInsertObject->lpszFile, fname, pdlgInfo->lpOleUIInsertObject->cchFile);
if (SendMessageW(pdlgInfo->hwndFileTB, WM_GETTEXT, MAX_PATH, (LPARAM)wcsFile))
WideCharToMultiByte(CP_ACP, 0, wcsFile, -1,
pdlgInfo->lpOleUIInsertObject->lpszFile, pdlgInfo->lpOleUIInsertObject->cchFile, NULL, NULL);
RtlMultiByteToUnicodeN(wcsFile, MAX_PATH, NULL, fname, MAX_PATH);
if (ERROR_SUCCESS == (hres = GetClassFile(wcsFile, &pdlgInfo->lpOleUIInsertObject->clsid)))
{
if (pdlgInfo->lpOleUIInsertObject->dwFlags & IOF_CREATEFILEOBJECT)

View file

@ -1,5 +1,6 @@
<?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
<group>
<module name="oledlg" type="win32dll" baseaddress="${BASEADDRESS_OLEDLG}" installbase="system32" installname="oledlg.dll" allowwarnings="true">
<importlibrary definition="oledlg.spec.def" />
<include base="oledlg">.</include>
@ -20,3 +21,4 @@
<file>rsrc.rc</file>
<file>oledlg.spec</file>
</module>
</group>

View file

@ -0,0 +1,95 @@
/*
* Copyright 2007 Vitaly Lipatov for Etersoft
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
UIINSERTOBJECT DIALOG DISCARDABLE 0, 0, 294, 151
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Âñòàâèòü îáúåêò"
FONT 8, "MS Shell Dlg"
BEGIN
LISTBOX IDC_OBJTYPELIST,82,19,131,66,LBS_SORT |
LBS_NOINTEGRALHEIGHT | WS_VISIBLE | WS_VSCROLL |
WS_TABSTOP
LTEXT "Òèï îáúåêòà:",IDC_OBJTYPELBL,82,7,53,8,WS_VISIBLE
DEFPUSHBUTTON "OK",IDOK,221,7,66,14
PUSHBUTTON "Îòìåíà",IDCANCEL,221,24,66,14
GROUPBOX "Ðåçóëüòàò",IDC_RESULT,7,103,208,41
CONTROL "Ñîçäàòü íîâûé",IDC_CREATENEW,"Button",BS_AUTORADIOBUTTON |
WS_GROUP,7,20,62,10
CONTROL "Ñîçäàòü ýëåìåíò óïðàâëåíèÿ",IDC_CREATECONTROL,"Button",
BS_AUTORADIOBUTTON | NOT WS_VISIBLE,7,54,62,10
CONTROL "Ñîçäàòü èç ôàéëà",IDC_CREATEFROMFILE,"Button",
BS_AUTORADIOBUTTON,7,37,67,10
LTEXT "",IDC_RESULTDESC,49,112,159,23
PUSHBUTTON "&Äîáàâèòü ýëåìåíò óïðàâëåíèÿ...",IDC_ADDCONTROL,81,88,63,14,NOT WS_VISIBLE
CONTROL "Display As Icon",IDC_ASICON,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP | NOT WS_VISIBLE,223,58,64,10
PUSHBUTTON "Âûáðàòü...",IDC_BROWSE,83,53,50,14,NOT WS_VISIBLE
LTEXT "Ôàéë:",IDC_FILELBL,83,27,20,8, NOT WS_VISIBLE
EDITTEXT IDC_FILE,83,37,132,13,ES_AUTOHSCROLL | NOT WS_VISIBLE
END
STRINGTABLE DISCARDABLE
{
IDS_RESULTOBJDESC "Äîáàâëåíèå íîâîãî îáúåêòà %s â äîêóìåíò"
IDS_RESULTFILEOBJDESC "Äîáàâëåíèå îáúåêòà èç ôàéëà â äîêóìåíò. Ðàáîòàòü ñ îáúåêòîì ìîæíî áóäåò â ñîçäàâøåé åãî ïðîãðàììå."
IDS_BROWSE "Ïðîñìîòð"
IDS_NOTOLEMOD "Ôàéë íå ÿâëÿåòñÿ êîððåêòíûì ìîäóëåì OLE. Íåâîçìîæíî çàðåãèñòðèðîâàòü ýëåìåíò óïðàâëåíèÿ OLE."
IDS_NOTOLEMODCAPTION "Äîáàâèòü ýëåìåíò óïðàâëåíèÿ"
}
IDD_PASTESPECIAL4 DIALOG DISCARDABLE 3, 15, 293, 140
STYLE DS_MODALFRAME | DS_SETFONT | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Ñïåöèàëüíàÿ âñòàâêà"
FONT 8, "MS Shell Dlg"
BEGIN
LTEXT "Èñòî÷íèê:", -1, 6, 9, 30, 8, WS_VISIBLE | WS_GROUP
CONTROL "&Âñòàâèòü", IDC_PS_PASTE, "Button", BS_AUTORADIOBUTTON | WS_TABSTOP | WS_GROUP | WS_VISIBLE,
6, 38, 55, 10
CONTROL "Âñòàâèòü &Ññûëêó", IDC_PS_PASTELINK, "Button", BS_AUTORADIOBUTTON | WS_VISIBLE,
6, 63, 55, 10
LTEXT "&Êàê:", -1, 65, 25, 16, 8, WS_VISIBLE | WS_GROUP
LISTBOX IDC_PS_PASTELIST, 65, 36, 153, 57, LBS_NOTIFY | LBS_USETABSTOPS | WS_VSCROLL | WS_BORDER | NOT WS_VISIBLE
LISTBOX IDC_PS_PASTELINKLIST, 65, 36, 153, 57, LBS_NOTIFY | LBS_USETABSTOPS | WS_VSCROLL | WS_BORDER | NOT WS_VISIBLE
LISTBOX IDC_PS_DISPLAYLIST, 65, 36, 153, 57, LBS_NOTIFY | LBS_USETABSTOPS | WS_VSCROLL | WS_BORDER | WS_VISIBLE
CONTROL "OK", IDOK, "Button", BS_DEFPUSHBUTTON | WS_TABSTOP | WS_GROUP | WS_VISIBLE, 224, 6, 66, 14
CONTROL "Îòìåíà", IDCANCEL, "Button", BS_PUSHBUTTON | WS_TABSTOP | WS_VISIBLE, 224, 23, 66, 14
CONTROL "Ñ&ïðàâêà", IDC_OLEUIHELP, "Button", BS_PUSHBUTTON | WS_TABSTOP | WS_VISIBLE, 224, 42, 66, 14
CONTROL "&Ïîêàçûâàòü êàê çíà÷îê", IDC_PS_DISPLAYASICON, "Button", BS_AUTOCHECKBOX | WS_TABSTOP | WS_VISIBLE, 224, 59, 66, 14
CONTROL "", IDC_PS_ICONDISPLAY, "Static", SS_ICON | WS_VISIBLE, 224, 75, 66, 44
CONTROL "Èçìåíèòü &çíà÷îê...", IDC_PS_CHANGEICON, "Button", BS_PUSHBUTTON | WS_TABSTOP | WS_VISIBLE, 224, 123, 66, 14
CONTROL "", IDC_PS_RESULTIMAGE, "Static", SS_ICON | WS_VISIBLE, 8, 101, 42, 34
CONTROL "<< result text goes here >>", IDC_PS_RESULTTEXT, "Static", SS_NOPREFIX | WS_VISIBLE, 54, 100, 159, 35
CONTROL "Ðåçóëüòàò", -1, "Button", BS_GROUPBOX | WS_GROUP | WS_VISIBLE, 6, 90, 212, 48
CONTROL "", IDC_PS_SOURCETEXT, "Edit", ES_READONLY | ES_AUTOHSCROLL | WS_VISIBLE, 37, 9, 180, 8
END
STRINGTABLE DISCARDABLE
{
IDS_PS_PASTE_DATA "Âñòàâêà ñîäåðæèìîãî áóôåðà îáìåíà â äîêóìåíò êàê %s."
IDS_PS_PASTE_OBJECT "Âñòàâêà ñîäåðæèìîãî áóôåðà îáìåíà â äîêóìåíò òàê, ÷òî åãî ìîæíî àêòèâèðîâàòü, èñïîëüçóÿ %s."
IDS_PS_PASTE_OBJECT_AS_ICON "Âñòàâêà ñîäåðæèìîãî áóôåðà îáìåíà â äîêóìåíò òàê, ÷òî åãî ìîæíî àêòèâèðîâàòü, èñïîëüçóÿ %s. Îí áóäåò îòîáðàæàòüñÿ â âèäå çíà÷êà."
IDS_PS_PASTE_LINK_DATA "Âñòàâêà ñîäåðæèìîãî áóôåðà îáìåíà â äîêóìåíò êàê %s. Äàííûå áóäóò ñâÿçàíû ñ èñõîäíûì ôàéëîì, òàê ÷òî èçìåíåíèÿ â í¸ì áóäóò îòðàæàòüñÿ â äîêóìåíòå."
IDS_PS_PASTE_LINK_OBJECT "Âñòàâêà èçîáðàæåíèÿ èç áóôåðà îáìåíà â äîêóìåíò. Èçáðàæåíèå áóäåò ñâÿçàíî ñ èñõîäíûì ôàéëîì, òàê ÷òî èçìåíåíèÿ â í¸ì áóäóò îòðàæàòüñÿ â äîêóìåíòå."
IDS_PS_PASTE_LINK_OBJECT_AS_ICON "Âñòàâêà ññûëêè, êîòîðàÿ áóäåò óêàçûâàòü íà ðàñïîëîæåíèå ñîäåðæèìîãî áóôåðà îáìåíà. Ññûëêà áóäåò ñâÿçàíà ñ èñõîäíûì ôàéëîì, òàê ÷òî èçìåíåíèÿ â í¸ì áóäóò îòðàæàòüñÿ â äîêóìåíòå."
IDS_PS_NON_OLE "Âñòàâêà ñîäåðæèìîå áóôåðà îáìåíà â äîêóìåíò."
IDS_PS_UNKNOWN_TYPE "Íåèçâåñòíûé òèï"
IDS_PS_UNKNOWN_SRC "Íåèçâåñòíûé èñòî÷íèê"
IDS_PS_UNKNOWN_APP "ïðîãðàììà, êîòîðàÿ åãî ñîçäàëà"
}

View file

@ -434,7 +434,7 @@ static void update_result_text(HWND hdlg, const ps_struct_t *ps_struct)
LoadStringW(OLEDLG_hInstance, res_id, resource_txt, sizeof(resource_txt)/sizeof(WCHAR));
if((ptr = strstrW(resource_txt, percent_s)))
{
/* FIXME handle %s in ResultText. Sub appname if IDS_PS_PASTE_OBJECT{_AS_ICON}. Else sub appropiate type name */
/* FIXME handle %s in ResultText. Sub appname if IDS_PS_PASTE_OBJECT{_AS_ICON}. Else sub appropriate type name */
size_t result_txt_len = strlenW(pent->lpstrResultText);
ptrdiff_t offs = (char*)ptr - (char*)resource_txt;
result_txt = HeapAlloc(GetProcessHeap(), 0, (strlenW(resource_txt) + result_txt_len - 1) * sizeof(WCHAR));

View file

@ -46,6 +46,7 @@
#include "oledlg_No.rc"
#include "oledlg_Pl.rc"
#include "oledlg_Pt.rc"
#include "oledlg_Ru.rc"
#include "oledlg_Sv.rc"
#include "oledlg_Tr.rc"
#include "oledlg_Uk.rc"