forked from mia/Aegisub
Fix crash on right click due to no spell checker
This commit is contained in:
parent
139132a964
commit
0b8b286767
3 changed files with 18 additions and 13 deletions
|
@ -475,12 +475,6 @@ find_package(OpenGL REQUIRED)
|
||||||
include_directories(${OPENGL_INCLUDE_DIR})
|
include_directories(${OPENGL_INCLUDE_DIR})
|
||||||
target_link_libraries (Aegisub ${OPENGL_LIBRARIES})
|
target_link_libraries (Aegisub ${OPENGL_LIBRARIES})
|
||||||
|
|
||||||
find_package(Hunspell REQUIRED)
|
|
||||||
include_directories(${HUNSPELL_INCLUDE_DIR})
|
|
||||||
target_link_libraries (Aegisub ${HUNSPELL_LIBRARIES})
|
|
||||||
add_definitions("-DWITH_HUNSPELL")
|
|
||||||
target_sources(Aegisub PRIVATE src/spellchecker_hunspell.cpp)
|
|
||||||
|
|
||||||
find_package(Iconv REQUIRED)
|
find_package(Iconv REQUIRED)
|
||||||
include_directories(${Iconv_INCLUDE_DIRS})
|
include_directories(${Iconv_INCLUDE_DIRS})
|
||||||
target_link_libraries (Aegisub ${Iconv_LIBRARIES})
|
target_link_libraries (Aegisub ${Iconv_LIBRARIES})
|
||||||
|
@ -545,6 +539,14 @@ if (FFTW_FOUND)
|
||||||
add_definitions("-DWITH_FFTW3")
|
add_definitions("-DWITH_FFTW3")
|
||||||
endif(FFTW_FOUND)
|
endif(FFTW_FOUND)
|
||||||
|
|
||||||
|
find_package(Hunspell)
|
||||||
|
if (HUNSPELL_FOUND)
|
||||||
|
include_directories(${HUNSPELL_INCLUDE_DIR})
|
||||||
|
target_link_libraries (Aegisub ${HUNSPELL_LIBRARIES})
|
||||||
|
add_definitions("-DWITH_HUNSPELL")
|
||||||
|
target_sources(Aegisub PRIVATE src/spellchecker_hunspell.cpp)
|
||||||
|
endif (HUNSPELL_FOUND)
|
||||||
|
|
||||||
#ifdef WITH_LIBPULSE
|
#ifdef WITH_LIBPULSE
|
||||||
#add_definitions("-DWITH_LIBPULSE")
|
#add_definitions("-DWITH_LIBPULSE")
|
||||||
#target_sources(Aegisub PRIVATE src/audio_player_pulse.cpp)
|
#target_sources(Aegisub PRIVATE src/audio_player_pulse.cpp)
|
||||||
|
|
|
@ -22,10 +22,12 @@
|
||||||
#include <libaegisub/make_unique.h>
|
#include <libaegisub/make_unique.h>
|
||||||
#include <libaegisub/spellchecker.h>
|
#include <libaegisub/spellchecker.h>
|
||||||
|
|
||||||
|
#ifdef __APPLE__
|
||||||
namespace agi {
|
namespace agi {
|
||||||
class OptionValue;
|
class OptionValue;
|
||||||
std::unique_ptr<agi::SpellChecker> CreateCocoaSpellChecker(OptionValue *opt);
|
std::unique_ptr<agi::SpellChecker> CreateCocoaSpellChecker(OptionValue *opt);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
std::unique_ptr<agi::SpellChecker> SpellCheckerFactory::GetSpellChecker() {
|
std::unique_ptr<agi::SpellChecker> SpellCheckerFactory::GetSpellChecker() {
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
|
|
|
@ -388,7 +388,7 @@ void SubsTextEditCtrl::OnContextMenu(wxContextMenuEvent &event) {
|
||||||
currentWord = line_text.substr(currentWordPos.first, currentWordPos.second);
|
currentWord = line_text.substr(currentWordPos.first, currentWordPos.second);
|
||||||
|
|
||||||
wxMenu menu;
|
wxMenu menu;
|
||||||
if (spellchecker)
|
if (spellchecker) {
|
||||||
AddSpellCheckerEntries(menu);
|
AddSpellCheckerEntries(menu);
|
||||||
|
|
||||||
// Append language list
|
// Append language list
|
||||||
|
@ -397,6 +397,7 @@ void SubsTextEditCtrl::OnContextMenu(wxContextMenuEvent &event) {
|
||||||
to_wx(OPT_GET("Tool/Spell Checker/Language")->GetString()),
|
to_wx(OPT_GET("Tool/Spell Checker/Language")->GetString()),
|
||||||
to_wx(spellchecker->GetLanguageList())));
|
to_wx(spellchecker->GetLanguageList())));
|
||||||
menu.AppendSeparator();
|
menu.AppendSeparator();
|
||||||
|
}
|
||||||
|
|
||||||
AddThesaurusEntries(menu);
|
AddThesaurusEntries(menu);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue