init_package(os::utf8_argv(0), string(), string(),
top_build_dir_is_one_level_up);
} catch (ExceptionMessage const & message) {
- if (message.type_ == ErrorException) {
- Alert::error(message.title_, message.details_);
- lyx_exit(1);
- } else if (message.type_ == WarningException) {
- Alert::warning(message.title_, message.details_);
- }
+ LYXERR(Debug::LOCALE, message.title_ + ", " + message.details_);
}
+ // FIXME: This breaks out of source build under Windows.
locale_init();
// Here we need to parse the command line. At least
prepareExit();
return exit_status;
}
-
+
// FIXME
/* Create a CoreApplication class that will provide the main event loop
* and the socket callback registering. With Qt4, only QtCore
break;
}
}
-
+
// create the first main window
lyx::dispatch(FuncRequest(LFUN_WINDOW_NEW, geometryArg));
(err_sig != SIGHUP && !getEnv("LYXDEBUG").empty())) {
#else
if (err_sig == SIGSEGV || !getEnv("LYXDEBUG").empty()) {
-#endif
+#endif
#ifdef _MSC_VER
// with abort() it crashes again.
exit(err_sig);
// This must happen after package initialization and after lyxrc is
// read, therefore it can't be done by a static object.
ConverterCache::init();
-
+
return true;
}
firstrun = false;
}
- FileName absfile =
+ FileName absfile =
FileName(addName(package().user_support().absFileName(), file));
return !absfile.exists()
|| configure_script.lastModified() > absfile.lastModified();
}
-int parse_batch(string const &, string const &, string &)
+int parse_batch(string const &, string const &, string &)
{
use_gui = false;
return 0;
}
-int parse_force(string const & arg, string const &, string &)
+int parse_force(string const & arg, string const &, string &)
{
if (arg == "all") {
force_overwrite = ALL_FILES;
void setSpellChecker()
{
-#if defined(USE_MACOSX_PACKAGING)
+ SpellChecker::ChangeNumber speller_change_number =singleton_->pimpl_->spell_checker_ ?
+ singleton_->pimpl_->spell_checker_->changeNumber() : 0;
+
if (lyxrc.spellchecker == "native") {
+#if defined(USE_MACOSX_PACKAGING)
if (!singleton_->pimpl_->apple_spell_checker_)
singleton_->pimpl_->apple_spell_checker_ = new AppleSpellChecker();
singleton_->pimpl_->spell_checker_ = singleton_->pimpl_->apple_spell_checker_;
- return;
- }
+#else
+ singleton_->pimpl_->spell_checker_ = 0;
#endif
+ } else if (lyxrc.spellchecker == "aspell") {
#if defined(USE_ASPELL)
- if (lyxrc.spellchecker == "aspell") {
if (!singleton_->pimpl_->aspell_checker_)
singleton_->pimpl_->aspell_checker_ = new AspellChecker();
singleton_->pimpl_->spell_checker_ = singleton_->pimpl_->aspell_checker_;
- return;
- }
+#else
+ singleton_->pimpl_->spell_checker_ = 0;
#endif
+ } else if (lyxrc.spellchecker == "enchant") {
#if defined(USE_ENCHANT)
- if (lyxrc.spellchecker == "enchant") {
if (!singleton_->pimpl_->enchant_checker_)
singleton_->pimpl_->enchant_checker_ = new EnchantChecker();
singleton_->pimpl_->spell_checker_ = singleton_->pimpl_->enchant_checker_;
- return;
- }
+#else
+ singleton_->pimpl_->spell_checker_ = 0;
#endif
+ } else if (lyxrc.spellchecker == "hunspell") {
#if defined(USE_HUNSPELL)
- if (lyxrc.spellchecker == "hunspell") {
if (!singleton_->pimpl_->hunspell_checker_)
singleton_->pimpl_->hunspell_checker_ = new HunspellChecker();
singleton_->pimpl_->spell_checker_ = singleton_->pimpl_->hunspell_checker_;
- return;
- }
+#else
+ singleton_->pimpl_->spell_checker_ = 0;
#endif
- singleton_->pimpl_->spell_checker_ = 0;
+ } else {
+ singleton_->pimpl_->spell_checker_ = 0;
+ }
+ if (singleton_->pimpl_->spell_checker_) {
+ singleton_->pimpl_->spell_checker_->changeNumber(speller_change_number);
+ singleton_->pimpl_->spell_checker_->advanceChangeNumber();
+ }
}
} // namespace lyx