X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiApplication.cpp;h=030668f2e94c275b728e5d23eae09e9eb65722e0;hb=425d092204118ea6c24c28e85fdf03fcf2bb51a4;hp=8eaa682c7de90e4976758be7b77b83528ad7b481;hpb=1cd45c2ae17fa6cda303f41a49fecba1ed5f0b45;p=lyx.git diff --git a/src/frontends/qt4/GuiApplication.cpp b/src/frontends/qt4/GuiApplication.cpp index 8eaa682c7d..030668f2e9 100644 --- a/src/frontends/qt4/GuiApplication.cpp +++ b/src/frontends/qt4/GuiApplication.cpp @@ -38,6 +38,7 @@ #include "FuncRequest.h" #include "FuncStatus.h" #include "Intl.h" +#include "KeyMap.h" #include "Language.h" #include "LaTeXFeatures.h" #include "Lexer.h" @@ -47,6 +48,7 @@ #include "LyXRC.h" #include "Server.h" #include "Session.h" +#include "SpellChecker.h" #include "version.h" #include "support/lassert.h" @@ -120,6 +122,7 @@ #include #include +#include #include using namespace std; @@ -223,6 +226,7 @@ PngMap sorted_png_map[] = { { "Cap", "cap2" }, { "Cup", "cup2" }, { "Delta", "delta2" }, + { "Diamond", "diamond2" }, { "Downarrow", "downarrow2" }, { "Gamma", "gamma2" }, { "Lambda", "lambda2" }, @@ -649,8 +653,8 @@ public: struct GuiApplication::Private { - Private(): language_model_(0), global_menubar_(0), - encoded_last_key(0), meta_fake_bit(NoModifier) + Private(): language_model_(0), meta_fake_bit(NoModifier), + global_menubar_(0) { #ifdef Q_WS_WIN /// WMF Mime handler for Windows clipboard. @@ -693,9 +697,6 @@ struct GuiApplication::Private /// delayed FuncRequests std::queue func_request_queue_; - /// the last character added to the key sequence, in UCS4 encoded form - char_type encoded_last_key; - /// KeySequence keyseq; /// @@ -879,7 +880,7 @@ bool GuiApplication::getStatus(FuncRequest const & cmd, FuncStatus & flag) const // This function runs "configure" and then rereads lyx.defaults to // reconfigure the automatic settings. -static void reconfigure(LyXView * lv, string const & option) +static void reconfigure(GuiView * lv, string const & option) { // emit message signal. if (lv) @@ -949,10 +950,7 @@ void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr) // Set current_view_ to zero to forbid GuiWorkArea::redraw() // to skip the refresh. current_view_ = 0; - BufferList::iterator it = theBufferList().begin(); - BufferList::iterator const end = theBufferList().end(); - for (; it != end; ++it) - (*it)->changed(); + theBufferList().changed(false); // Restore current_view_ current_view_ = view; break; @@ -1022,6 +1020,7 @@ void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr) Buffer * buf = current_view_->loadDocument(fname, false); if (buf) { current_view_->setBuffer(buf); + buf->setReadonly(true); buf->updateLabels(); buf->errors("Parse"); } @@ -1152,7 +1151,7 @@ docstring GuiApplication::viewStatusMessage() void GuiApplication::handleKeyFunc(FuncCode action) { - char_type c = d->encoded_last_key; + char_type c = 0; if (d->keyseq.length()) c = 0; @@ -1175,7 +1174,7 @@ void GuiApplication::processKeySym(KeySymbol const & keysym, KeyModifier state) { LYXERR(Debug::KEY, "KeySym is " << keysym.getSymbolName()); - LyXView * lv = theApp()->currentWindow(); + GuiView * lv = currentView(); // Do nothing if we have nothing (JMarc) if (!keysym.isOK()) { @@ -1191,10 +1190,6 @@ void GuiApplication::processKeySym(KeySymbol const & keysym, KeyModifier state) return; } - //Encoding const * encoding = lv->documentBufferView()->cursor().getEncoding(); - //encoded_last_key = keysym.getISOEncoded(encoding ? encoding->name() : ""); - // FIXME: encoded_last_key shadows the member variable of the same - // name. Is that intended? char_type encoded_last_key = keysym.getUCSEncoded(); // Do a one-deep top-level lookup for @@ -1425,7 +1420,7 @@ void GuiApplication::setGuiLanguage() setRcGuiLanguage(); QString const default_language = toqstr(Messages::defaultLanguage()); - LYXERR(Debug::LOCALE, "Tring to set default locale to: " << default_language); + LYXERR(Debug::LOCALE, "Trying to set default locale to: " << default_language); QLocale const default_locale(default_language); QLocale::setDefault(default_locale); @@ -1438,7 +1433,7 @@ void GuiApplication::setGuiLanguage() // c.f. http://doc.trolltech.com/4.1/qtranslator.html#load if (!d->qt_trans_.load(language_name, QLibraryInfo::location(QLibraryInfo::TranslationsPath))) { - LYXERR(Debug::LOCALE, "Could not find Qt translations for locale " + LYXERR(Debug::LOCALE, "Could not find Qt translations for locale " << language_name); } else { LYXERR(Debug::LOCALE, "Successfully installed Qt translations for locale " @@ -1496,8 +1491,8 @@ QAbstractItemModel * GuiApplication::languageModel() QStandardItemModel * lang_model = new QStandardItemModel(this); lang_model->insertColumns(0, 1); int current_row; - Languages::const_iterator it = languages.begin(); - Languages::const_iterator end = languages.end(); + Languages::const_iterator it = lyx::languages.begin(); + Languages::const_iterator end = lyx::languages.end(); for (; it != end; ++it) { current_row = lang_model->rowCount(); lang_model->insertRows(current_row, 1);