Skip to content

Commit

Permalink
Release v2.6.9
Browse files Browse the repository at this point in the history
  • Loading branch information
evpobr committed Jan 14, 2016
2 parents cba8f81 + 73c8201 commit c070102
Show file tree
Hide file tree
Showing 13 changed files with 135 additions and 161 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# FictionBook Editor Changelog

## v2.6.9

* Fixed bug, introduced in 2.6.9 - FBE cannot find plugins

## v2.6.8

* Upgade Visual Studio solution and projects to VS2015 version;
Expand Down
55 changes: 38 additions & 17 deletions ExportHTML/ExportHTML.rc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//Microsoft Developer Studio generated resource script.
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"

Expand All @@ -13,78 +13,99 @@
#undef APSTUDIO_READONLY_SYMBOLS

/////////////////////////////////////////////////////////////////////////////
// Russian resources
// Russian (Russia) resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS)
#ifdef _WIN32
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
#pragma code_page(1251)
#endif //_WIN32

/////////////////////////////////////////////////////////////////////////////
//
// REGISTRY
//

IDR_EXPORTHTML REGISTRY DISCARDABLE "ExportHTML.rgs"
IDR_EXPORTHTML REGISTRY "ExportHTML.rgs"


#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//

1 TEXTINCLUDE DISCARDABLE
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END

2 TEXTINCLUDE DISCARDABLE
2 TEXTINCLUDE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END

3 TEXTINCLUDE DISCARDABLE
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END

#endif // APSTUDIO_INVOKED

#endif // Russian resources
#endif // Russian (Russia) resources
/////////////////////////////////////////////////////////////////////////////


/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
// English (United States) resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32

/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//

IDD_CUSTOMSAVEDLG DIALOG DISCARDABLE 0, 0, 330, 32
STYLE DS_3DLOOK | DS_CONTROL | WS_CHILD | WS_CLIPSIBLINGS
IDD_CUSTOMSAVEDLG DIALOG 0, 0, 330, 32
STYLE DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD | WS_CLIPSIBLINGS
FONT 8, "MS Shell Dlg"
BEGIN
LTEXT "XSL Template:",IDC_STATIC,68,2,53,8
EDITTEXT IDC_TEMPLATE,130,0,164,12,ES_AUTOHSCROLL
PUSHBUTTON "...",IDC_BROWSE,297,0,15,12
CONTROL "Include document description",IDC_DOCINFO,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,69,19,108,8
CONTROL "Include document description",IDC_DOCINFO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,69,19,108,8
LTEXT "TOC depth:",IDC_STATIC,186,19,42,8
EDITTEXT IDC_TOCDEPTH,228,17,19,12,ES_NUMBER
END

#endif // English (U.S.) resources

/////////////////////////////////////////////////////////////////////////////
//
// Icon
//

// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_MAINICON ICON "res\\ExportHTML.ico"


/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//

#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO
BEGIN
IDD_CUSTOMSAVEDLG, DIALOG
BEGIN
END
END
#endif // APSTUDIO_INVOKED

#endif // English (United States) resources
/////////////////////////////////////////////////////////////////////////////


Expand Down
6 changes: 3 additions & 3 deletions ExportHTML/ExportHTML.rgs
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ HKCR
}
}

HKLM
HKCU
{
NoRemove Software
{
NoRemove Haali
NoRemove FBETeam
{
NoRemove FBE
NoRemove 'FictionBook Editor'
{
NoRemove Plugins
{
Expand Down
6 changes: 4 additions & 2 deletions ExportHTML/ExportHTML.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,11 @@
<ItemGroup>
<ResourceCompile Include="ExportHTML.rc" />
</ItemGroup>
<ItemGroup>
<Image Include="res\ExportHTML.ico" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\packages\wtl.9.1\build\native\wtl.targets" Condition="Exists('..\packages\wtl.9.1\build\native\wtl.targets')" />
</ImportGroup>
</Project>

</Project>
5 changes: 5 additions & 0 deletions ExportHTML/ExportHTML.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,9 @@
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<Image Include="res\ExportHTML.ico">
<Filter>Resource Files</Filter>
</Image>
</ItemGroup>
</Project>
Binary file added ExportHTML/res/ExportHTML.ico
Binary file not shown.
6 changes: 4 additions & 2 deletions ExportHTML/resource.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Microsoft Visual C++ generated include file.
// Used by ExportHTML.rc
//
#define IDR_EXPORTHTML 101
#define IDD_CUSTOMSAVEDLG 102
#define IDI_ICON1 104
#define IDI_MAINICON 104
#define IDC_BROWSE 1001
#define IDC_TEMPLATE 1002
#define IDC_DOCINFO 1003
Expand All @@ -13,7 +15,7 @@
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 104
#define _APS_NEXT_RESOURCE_VALUE 105
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1005
#define _APS_NEXT_SYMED_VALUE 102
Expand Down
4 changes: 2 additions & 2 deletions FBE.rc
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ IDB_TEXT BITMAP "res\\text.bmp"
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 2,6,0,0
FILEVERSION 2,6,9,0
PRODUCTVERSION 2,6,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
Expand All @@ -689,7 +689,7 @@ BEGIN
VALUE "Comments", "Release"
VALUE "CompanyName", "FBE Team"
VALUE "FileDescription", "FictionBook Editor"
VALUE "FileVersion", "2.6"
VALUE "FileVersion", "2.6.9.0"
VALUE "InternalName", "FBE"
VALUE "LegalCopyright", "Copyright 2010 � FBE Team, 2008 � LitRes, 2003 � Mike Matsnev"
VALUE "OriginalFilename", "FBE.exe"
Expand Down
6 changes: 2 additions & 4 deletions FBE.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<PreBuildEvent>
<Message>Copying requisite resources...</Message>
<Command>rd "$(TargetDir)"cmd /S /Q
xcopy "$(ProjectDir)files\*.*" "$(TargetDir)" /E /Q /Y
<Command>xcopy "$(ProjectDir)files\*.*" "$(TargetDir)" /E /Q /Y
</Command>
</PreBuildEvent>
<Midl>
Expand Down Expand Up @@ -131,8 +130,7 @@ gdiplus.lib;opengl32.lib;glu32.lib;%(AdditionalDependencies)</AdditionalDependen
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<PreBuildEvent>
<Message>Copying requisite resources...</Message>
<Command>rd "$(TargetDir)" cmd /S /Q
xcopy "$(ProjectDir)files\*.*" "$(TargetDir)" /E /Q /Y
<Command>xcopy "$(ProjectDir)files\*.*" "$(TargetDir)" /E /Q /Y
</Command>
</PreBuildEvent>
<Midl>
Expand Down
Binary file modified Installer/MakeInstaller.nsi
Binary file not shown.
91 changes: 46 additions & 45 deletions mainfrm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1139,61 +1139,62 @@ void CMainFrame::AddStaticText(CCustomStatic &st, HWND toolbarHwnd, int id, cons
void CMainFrame::InitPluginsType(HMENU hMenu, const TCHAR* type, UINT cmdbase, CSimpleArray<CLSID>& plist)
{
CRegKey rk;

if(rk.Open(HKEY_CURRENT_USER, _Settings.GetKeyPath() + L"\\Plugins") != ERROR_SUCCESS)
return;
int ncmd = 0;
for(int i = 0; ncmd < 20; ++i)
{
CString name;
DWORD size = 128; // enough for GUIDs
TCHAR* cp = name.GetBuffer(size);
FILETIME ft;
if(::RegEnumKeyEx(rk, i, cp, &size, 0, 0, 0, &ft) != ERROR_SUCCESS)
break;
name.ReleaseBuffer(size);
CRegKey pk;
if(pk.Open(rk, name) != ERROR_SUCCESS)
continue;
CString pt(U::QuerySV(pk, L"Type"));
CString ms(U::QuerySV(pk, L"Menu"));
if(pt.IsEmpty() || ms.IsEmpty() || pt != type)
continue;
CLSID clsid;
if(::CLSIDFromString((TCHAR*)(const TCHAR *)name, &clsid) != NOERROR)
continue;

// all checks pass, add to menu and remember clsid
plist.Add(clsid);
::AppendMenu(hMenu, MF_STRING, cmdbase + ncmd, ms);
CString hs = ms;
hs.Remove(L'&');
InitPluginHotkey(name, cmdbase + ncmd, pt + CString(L" | ") + hs);
// check if an icon is available
CString icon(U::QuerySV(pk, L"Icon"));
if(!icon.IsEmpty())
if (rk.Open(HKEY_CURRENT_USER, _Settings.GetKeyPath() + L"\\Plugins") == ERROR_SUCCESS)
{
for (int i = 0; ncmd < 20; ++i)
{
int cp = icon.ReverseFind(L',');
int iconID;
if(cp > 0 && _stscanf((const TCHAR *)icon + cp, L",%d", &iconID) == 1)
icon.Delete(cp, icon.GetLength() - cp);
else
iconID = 0;
CString name;
DWORD size = 128; // enough for GUIDs
TCHAR* cp = name.GetBuffer(size);
FILETIME ft;
if (::RegEnumKeyEx(rk, i, cp, &size, 0, 0, 0, &ft) != ERROR_SUCCESS)
break;
name.ReleaseBuffer(size);
CRegKey pk;
if (pk.Open(rk, name) != ERROR_SUCCESS)
continue;
CString pt(U::QuerySV(pk, L"Type"));
CString ms(U::QuerySV(pk, L"Menu"));
if (pt.IsEmpty() || ms.IsEmpty() || pt != type)
continue;
CLSID clsid;
if (::CLSIDFromString((TCHAR*)(const TCHAR *)name, &clsid) != NOERROR)
continue;

// try load from file first
HICON hIcon;
if(::ExtractIconEx(icon, iconID, NULL, &hIcon, 1) > 0 && hIcon)
// all checks pass, add to menu and remember clsid
plist.Add(clsid);
::AppendMenu(hMenu, MF_STRING, cmdbase + ncmd, ms);
CString hs = ms;
hs.Remove(L'&');
InitPluginHotkey(name, cmdbase + ncmd, pt + CString(L" | ") + hs);
// check if an icon is available
CString icon(U::QuerySV(pk, L"Icon"));
if (!icon.IsEmpty())
{
m_MenuBar.AddIcon(hIcon, cmdbase + ncmd);
::DestroyIcon(hIcon);
int cp = icon.ReverseFind(L',');
int iconID;
if (cp > 0 && _stscanf((const TCHAR *)icon + cp, L",%d", &iconID) == 1)
icon.Delete(cp, icon.GetLength() - cp);
else
iconID = 0;

// try load from file first
HICON hIcon;
if (::ExtractIconEx(icon, iconID, NULL, &hIcon, 1) > 0 && hIcon)
{
m_MenuBar.AddIcon(hIcon, cmdbase + ncmd);
::DestroyIcon(hIcon);
}
}
++ncmd;
}
++ncmd;
}

// Old path to provide searching of old plugins
CRegKey oldRk;
if(oldRk.Open(HKEY_LOCAL_MACHINE, L"Software\\Haali\\FBE\\Plugins") != ERROR_SUCCESS)
if(oldRk.Open(HKEY_LOCAL_MACHINE, L"Software\\Haali\\FBE\\Plugins", KEY_READ) != ERROR_SUCCESS)
goto skip;
else
{
Expand All @@ -1207,7 +1208,7 @@ void CMainFrame::InitPluginsType(HMENU hMenu, const TCHAR* type, UINT cmdbase, C
break;
name.ReleaseBuffer(size);
CRegKey pk;
if(pk.Open(oldRk, name) != ERROR_SUCCESS)
if(pk.Open(oldRk, name, KEY_READ) != ERROR_SUCCESS)
continue;
CString pt(U::QuerySV(pk, L"Type"));
CString ms(U::QuerySV(pk, L"Menu"));
Expand Down
Loading

0 comments on commit c070102

Please sign in to comment.