]> git.lyx.org Git - lyx.git/blobdiff - src/lyxfunc.C
cleanup after svn hang-up, #undef CursorShape. Should be compilable ganin now.
[lyx.git] / src / lyxfunc.C
index 8a61978bdbef0b61044b9a94c801080309b53911..89c92637b88bfea81ab21001faa877d049e94dbe 100644 (file)
@@ -775,10 +775,10 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                case LFUN_CANCEL:
                        keyseq.reset();
                        meta_fake_bit = key_modifier::none;
-                       if (view()->available())
+                       if (view()->buffer())
                                // cancel any selection
                                dispatch(FuncRequest(LFUN_MARK_OFF));
-                       setMessage(lyx::from_utf8(N_("Cancel")));
+                       setMessage(_("Cancel"));
                        break;
 
                case LFUN_META_PREFIX:
@@ -998,7 +998,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                        break;
 
                case LFUN_LYX_QUIT:
-                       if (view()->available()) {
+                       if (view()->buffer()) {
                                // save cursor Position for opened files to .lyx/session
                                LyX::ref().session().saveFilePosition(owner->buffer()->fileName(),
                                        boost::tie(view()->cursor().pit(), view()->cursor().pos()) );
@@ -1026,7 +1026,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                case LFUN_HELP_OPEN: {
                        string const arg = argument;
                        if (arg.empty()) {
-                               setErrorMessage(lyx::from_utf8(N_("Missing argument")));
+                               setErrorMessage(_("Missing argument"));
                                break;
                        }
                        string const fname = i18nLibFileSearch("doc", arg, "lyx");
@@ -1283,7 +1283,8 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                case LFUN_BUFFER_CHILD_OPEN: {
                        string const filename =
                                makeAbsPath(argument, owner->buffer()->filePath());
-                       setMessage(lyx::from_utf8(N_("Opening child document ")) +
+                       // FIXME Should use bformat
+                       setMessage(_("Opening child document ") +
                                         makeDisplayPath(filename) + lyx::from_ascii("..."));
                        view()->savePosition(0);
                        string const parentfilename = owner->buffer()->fileName();
@@ -1362,8 +1363,8 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                        string lyx_name;
                        string const x11_name = split(argument, lyx_name, ' ');
                        if (lyx_name.empty() || x11_name.empty()) {
-                               setErrorMessage(lyx::from_utf8(N_("Syntax: set-color <lyx_name>"
-                                                       " <x11_name>")));
+                               setErrorMessage(_("Syntax: set-color <lyx_name>"
+                                                       " <x11_name>"));
                                break;
                        }
 
@@ -1487,6 +1488,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                        }
 
                        if (defaults.writeFile(defaults.fileName()))
+                               // FIXME Should use bformat
                                setMessage(_("Document defaults saved in ")
                                           + makeDisplayPath(fname));
                        else
@@ -1591,7 +1593,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                }
                }
 
-               if (view()->available()) {
+               if (view()->buffer()) {
                        // Redraw screen unless explicitly told otherwise.
                        // This also initializes the position cache for all insets
                        // in (at least partially) visible top-level paragraphs.
@@ -1616,7 +1618,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
        if (!quitting)
                // FIXME UNICODE: _() does not support anything but ascii.
                // Do we need a lyx::to_ascii() method?
-               sendDispatchMessage(_(lyx::to_utf8(getMessage())), cmd);
+               sendDispatchMessage(getMessage(), cmd);
 }
 
 
@@ -1669,7 +1671,7 @@ void LyXFunc::sendDispatchMessage(docstring const & msg, FuncRequest const & cmd
                dispatch_msg += lyx::from_utf8('(' + rtrim(comname) + ')');
        }
 
-       lyxerr[Debug::ACTION] << "verbose dispatch msg " 
+       lyxerr[Debug::ACTION] << "verbose dispatch msg "
                << lyx::to_utf8(dispatch_msg) << endl;
        if (!dispatch_msg.empty())
                owner->message(dispatch_msg);
@@ -1690,7 +1692,7 @@ void LyXFunc::menuNew(string const & name, bool fromTemplate)
        string initpath = lyxrc.document_path;
        string filename(name);
 
-       if (view()->available()) {
+       if (view()->buffer()) {
                string const trypath = owner->buffer()->filePath();
                // If directory is writeable, use this as default.
                if (isDirWriteable(trypath))
@@ -1742,7 +1744,7 @@ void LyXFunc::open(string const & fname)
 {
        string initpath = lyxrc.document_path;
 
-       if (view()->available()) {
+       if (view()->buffer()) {
                string const trypath = owner->buffer()->filePath();
                // If directory is writeable, use this as default.
                if (isDirWriteable(trypath))
@@ -1819,7 +1821,7 @@ void LyXFunc::doImport(string const & argument)
        if (filename.empty()) {
                string initpath = lyxrc.document_path;
 
-               if (view()->available()) {
+               if (view()->buffer()) {
                        string const trypath = owner->buffer()->filePath();
                        // If directory is writeable, use this as default.
                        if (isDirWriteable(trypath))
@@ -1940,7 +1942,7 @@ string const LyXFunc::viewStatusMessage()
        if (keyseq.length() > 0 && !keyseq.deleted())
                return keyseq.printOptions();
 
-       if (!view()->available())
+       if (!view()->buffer())
                return lyx::to_utf8(_("Welcome to LyX!"));
 
        return view()->cursor().currentState();