changeset 18623:37d5a2bb4160

maint: Merge away extra head.
author Rik <rik@octave.org>
date Fri, 04 Apr 2014 11:50:14 -0700
parents aff86394c201 (current diff) 359581bba58d (diff)
children ee125c82e01e
files
diffstat 31 files changed, 3225 insertions(+), 142 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/Makefile.am	Thu Apr 03 16:30:05 2014 -0700
+++ b/libgui/Makefile.am	Fri Apr 04 11:50:14 2014 -0700
@@ -34,7 +34,8 @@
   languages/pt_BR.ts \
   languages/pt_PT.ts \
   languages/ru_RU.ts \
-  languages/uk_UA.ts
+  languages/uk_UA.ts \
+  languages/zh_CN.ts
 
 LOCALES = $(patsubst languages/%.ts, languages/%.qm, $(TRANSLATIONS))
 
--- a/libgui/graphics/BaseControl.cc	Thu Apr 03 16:30:05 2014 -0700
+++ b/libgui/graphics/BaseControl.cc	Fri Apr 04 11:50:14 2014 -0700
@@ -195,6 +195,20 @@
 	    }
 	}
       break;
+    case QEvent::MouseMove:
+      if (qWidget<QWidget> ()->hasMouseTracking ())
+        {
+	  gh_manager::auto_lock lock;
+
+	  QMouseEvent* m = dynamic_cast<QMouseEvent*> (event);
+	  graphics_object go = object ();
+	  graphics_object fig = go.get_ancestor ("figure");
+
+          gh_manager::post_set (fig.get_handle (), "currentpoint",
+                                Utils::figureCurrentPoint (fig, m), false);
+          gh_manager::post_callback (fig.get_handle (), "windowbuttonmotionfcn");
+        }
+      break;
     case QEvent::KeyPress:
       if (m_keyPressHandlerDefined)
         {
--- a/libgui/graphics/Canvas.cc	Thu Apr 03 16:30:05 2014 -0700
+++ b/libgui/graphics/Canvas.cc	Fri Apr 04 11:50:14 2014 -0700
@@ -51,6 +51,41 @@
   m_redrawBlocked = block;
 }
 
+void Canvas::updateCurrentPoint(const graphics_object& fig,
+                                const graphics_object& obj, QMouseEvent* event)
+{
+  gh_manager::post_set (fig.get_handle (), "currentpoint",
+                        Utils::figureCurrentPoint (fig, event), false);
+
+  Matrix children = obj.get_properties ().get_children ();
+  octave_idx_type num_children = children.numel ();
+
+  for (int i = 0; i < num_children; i++)
+    {
+      graphics_object childObj (gh_manager::get_object (children(i)));
+
+      if (childObj.isa ("axes"))
+        {
+          axes::properties& ap = Utils::properties<axes> (childObj);
+          Matrix x_zlim = ap.get_transform_zlim ();
+          graphics_xform x_form = ap.get_transform ();
+
+          ColumnVector p1 = x_form.untransform (event->x (), event->y (),
+                                                x_zlim(0));
+          ColumnVector p2 = x_form.untransform (event->x (), event->y (),
+                                                x_zlim(1));
+
+          Matrix cp (2, 3, 0.0);
+
+          cp(0,0) = p1(0); cp(0,1) = p1(1); cp(0,2) = p1(2);
+          cp(1,0) = p2(0); cp(1,1) = p2(1); cp(1,2) = p2(2);
+
+          gh_manager::post_set (childObj.get_handle (), "currentpoint", cp,
+                                false);
+        }
+    }
+}
+
 void Canvas::canvasPaintEvent (void)
 {
   if (! m_redrawBlocked)
@@ -134,6 +169,19 @@
 	  break;
 	}
     }
+  else if (m_mouseMode == NoMode)
+    {
+      graphics_object obj = gh_manager::get_object (m_handle);
+
+      if (obj.valid_object ())
+        {
+          graphics_object figObj (obj.get_ancestor ("figure"));
+
+          updateCurrentPoint (figObj, obj, event);
+	  gh_manager::post_callback (figObj.get_handle (),
+				     "windowbuttonmotionfcn");
+        }
+    }
 }
 
 void Canvas::canvasMousePressEvent (QMouseEvent* event)
@@ -228,9 +276,7 @@
 	case NoMode:
 	  gh_manager::post_set (figObj.get_handle (), "selectiontype",
 				Utils::figureSelectionType (event), false);
-	  gh_manager::post_set (figObj.get_handle (), "currentpoint",
-				Utils::figureCurrentPoint (figObj, event),
-				false);
+          updateCurrentPoint (figObj, obj, event);
 	  gh_manager::post_callback (figObj.get_handle (),
 				     "windowbuttondownfcn");
           gh_manager::post_callback (currentObj.get_handle (),
@@ -321,9 +367,7 @@
         {
           graphics_object figObj (obj.get_ancestor ("figure"));
 
-	  gh_manager::post_set (figObj.get_handle (), "currentpoint",
-				Utils::figureCurrentPoint (figObj, event),
-				false);
+          updateCurrentPoint (figObj, obj, event);
           gh_manager::post_callback (figObj.get_handle (),
                                      "windowbuttonupfcn");
         }
--- a/libgui/graphics/Canvas.h	Thu Apr 03 16:30:05 2014 -0700
+++ b/libgui/graphics/Canvas.h	Fri Apr 04 11:50:14 2014 -0700
@@ -82,6 +82,9 @@
   bool canvasKeyPressEvent (QKeyEvent* event);
   bool canvasKeyReleaseEvent (QKeyEvent* event);
 
+  void updateCurrentPoint (const graphics_object& fig,
+                           const graphics_object& obj, QMouseEvent *event);
+
 private:
   graphics_handle m_handle;
   bool m_redrawBlocked;
--- a/libgui/graphics/Container.cc	Thu Apr 03 16:30:05 2014 -0700
+++ b/libgui/graphics/Container.cc	Fri Apr 04 11:50:14 2014 -0700
@@ -24,6 +24,7 @@
 #include <config.h>
 #endif
 
+#include <QChildEvent>
 #include <QVBoxLayout>
 
 #include "graphics.h"
@@ -95,4 +96,12 @@
     }
 }
 
+void Container::childEvent (QChildEvent* event)
+{
+  if (event->child ()->isWidgetType ())
+    {
+      qobject_cast<QWidget*> (event->child ())->setMouseTracking (hasMouseTracking ());
+    }
+}
+
 }; // namespace QtHandles
--- a/libgui/graphics/Container.h	Thu Apr 03 16:30:05 2014 -0700
+++ b/libgui/graphics/Container.h	Fri Apr 04 11:50:14 2014 -0700
@@ -45,6 +45,7 @@
   Canvas* canvas (const graphics_handle& handle, bool create = true);
 
 protected:
+  void childEvent (QChildEvent* event);
   void resizeEvent (QResizeEvent* event);
 
 private:
--- a/libgui/graphics/Figure.cc	Thu Apr 03 16:30:05 2014 -0700
+++ b/libgui/graphics/Figure.cc	Fri Apr 04 11:50:14 2014 -0700
@@ -141,6 +141,12 @@
     eventMask |= Canvas::KeyRelease;
   m_container->canvas (m_handle)->setEventMask (eventMask);
 
+  if (! fp.get_windowbuttonmotionfcn ().is_empty ())
+    {
+      m_container->setMouseTracking (true);
+      m_container->canvas (m_handle)->qWidget ()->setMouseTracking (true);
+    }
+
   connect (this, SIGNAL (asyncUpdate (void)),
            this, SLOT (updateContainer (void)));
 
@@ -302,6 +308,15 @@
       else
         m_container->canvas (m_handle)->addEventMask (Canvas::KeyRelease);
       break;
+    case figure::properties::ID_WINDOWBUTTONMOTIONFCN:
+        {
+          bool hasCallback = ! fp.get_windowbuttonmotionfcn ().is_empty ();
+
+          m_container->setMouseTracking (hasCallback);
+          foreach (QWidget* w, m_container->findChildren<QWidget*> ())
+            { w->setMouseTracking (hasCallback); }
+        }
+      break;
     default:
       break;
     }
--- a/libgui/graphics/Panel.cc	Thu Apr 03 16:30:05 2014 -0700
+++ b/libgui/graphics/Panel.cc	Fri Apr 04 11:50:14 2014 -0700
@@ -115,6 +115,12 @@
   m_container = new Container (frame);
   m_container->canvas (m_handle);
 
+  if (frame->hasMouseTracking ())
+    {
+      foreach (QWidget* w, frame->findChildren<QWidget*> ())
+        { w->setMouseTracking (true); }
+    }
+
   QString title = Utils::fromStdString (pp.get_title ());
   if (! title.isEmpty ())
     {
--- a/libgui/languages/translators	Thu Apr 03 16:30:05 2014 -0700
+++ b/libgui/languages/translators	Fri Apr 04 11:50:14 2014 -0700
@@ -11,3 +11,4 @@
 ru_RU Andriy Shinkarchuck <adriano32.gnu@gmail.com>
 uk_UA Andriy Shinkarchuck <adriano32.gnu@gmail.com>
 nl_NL Sander van Rijn <svr003@gmail.com>
+zh_CN Jeff Bai <aosc@members.fsf.org>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libgui/languages/zh_CN.ts	Fri Apr 04 11:50:14 2014 -0700
@@ -0,0 +1,2118 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="zh_CN">
+    <extra-po-header-po_revision_date></extra-po-header-po_revision_date>
+    <extra-po-headers>MIME-Version,Content-Type,Content-Transfer-Encoding,Plural-Forms,X-Language,X-Qt-Contexts,Project-Id-Version,POT-Creation-Date,PO-Revision-Date,Last-Translator,Language-Team,Language,X-Generator</extra-po-headers>
+    <extra-po-header-x_generator>Poedit 1.6.4</extra-po-header-x_generator>
+    <extra-po-header-language_team>安同开源社区 &lt;aosc@members.fsf.org&gt;</extra-po-header-language_team>
+    <extra-po-header-project_id_version>octave</extra-po-header-project_id_version>
+    <extra-po-header-pot_creation_date></extra-po-header-pot_creation_date>
+    <extra-po-header-language>zh_CN</extra-po-header-language>
+    <extra-po-header-last_translator>Jeff Bai &lt;jeffbaichina@members.fsf.org&gt;</extra-po-header-last_translator>
+<context>
+    <name>ListDialog</name>
+    <message>
+        <location filename="../src/dialog.cc" line="+251"/>
+        <source>Select All</source>
+        <translation>全选</translation>
+    </message>
+</context>
+<context>
+    <name>QObject</name>
+    <message>
+        <location filename="../src/workspace-model.cc" line="+75"/>
+        <source>automatic</source>
+        <translation>自动</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>function</source>
+        <translation>函数</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>global</source>
+        <translation>全局</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>hidden</source>
+        <translation>隐藏的</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>inherited</source>
+        <translation>继承的</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>persistent</source>
+        <translation>持续的</translation>
+    </message>
+    <message>
+        <location filename="../qterminal/libqterminal/QTerminal.cc" line="+65"/>
+        <source>foreground</source>
+        <translation>前台</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>background</source>
+        <translation>后台</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>selection</source>
+        <translation>选择</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>cursor</source>
+        <translation>光标</translation>
+    </message>
+    <message>
+        <location filename="../src/main-window.cc" line="+1900"/>
+        <source>&lt;p&gt;&lt;strong&gt;A Note about Octave&apos;s New GUI&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;One of the biggest new features for Octave 3.8 is a graphical user interface.  It is the one thing that users have requested most often over the last few years and now it is almost ready.  But because it is not quite as polished as we would like, we have decided to wait until the 4.0.x release series before making the GUI the default interface.&lt;/p&gt;&lt;p&gt;Given the length of time and the number of bug fixes and improvements since the last major release, we also decided against delaying the release of all these new improvements any longer just to perfect the GUI.  So please enjoy the 3.8 release of Octave and the preview of the new GUI.  We believe it is working reasonably well, but we also know that there are some obvious rough spots and many things that could be improved.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;We Need Your Help&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;There are many ways that you can help us fix the remaining problems, complete the GUI, and improve the overall user experience for both novices and experts alike (links will open an external browser):&lt;/p&gt;&lt;p&gt;&lt;ul&gt;&lt;li&gt;If you are a skilled software developer, you can help by contributing your time to help &lt;a href=&quot;http://octave.org/get-involved.html&quot;&gt;develop Octave&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;If Octave does not work properly, you are encouraged to &lt;a href=&quot;http://octave.org/bugs.html&quot;&gt;report problems &lt;/a&gt; that you find.&lt;/li&gt;&lt;li&gt;Whether you are a user or developer, you can &lt;a href=&quot;http://octave.org/donate.html&quot;&gt;help to fund the project&lt;/a&gt;.  Octave development takes a lot of time and expertise.  Your contributions help to ensure that Octave will continue to improve.&lt;/li&gt;&lt;/ul&gt;&lt;/p&gt;&lt;p&gt;We hope you find Octave to be useful.  Please help us make it even better for the future!&lt;/p&gt;</source>
+        <translation>&lt;p&gt;&lt;strong&gt;关于 Octave 新用户界面的一点注意事项&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Octave 最重要的一个新特性就是图形界面。这是用户在过往几年需求最大、最多的一个特性,现在这个界面终于基本就绪了。但是这个界面现在恐怕还不特别完善、尚需打磨,所以我们计划在 4.0.x 发行系列才将图形界面作为默认的用户界面。&lt;/p&gt;&lt;p&gt;考虑到这个版本的和上个主要版本之间开发时长和修复的 Bug 数量还有一部分的改进,我们决定不再推迟发行以打磨界面。所以请尽情享用 Octave 的 3.8 版本以及新界面的预览吧。我们认为这个版本已经相当可用,不过我们也知道这个发行存在一定量的粗糙细节和很多可以做得更好的地方。&lt;/p&gt;&lt;p&gt;&lt;strong&gt;我们需要你的帮助&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;你有很多方法可以帮助我们处理依然存在的问题,完善用户界面,并给专家和新手们改进用户体验 (以下链接会打开外部浏览器):&lt;/p&gt;&lt;p&gt;&lt;ul&gt;&lt;li&gt;如果你是一个有一定经验的软件爱你开发者,你可以使用你的闲时来帮助我们 &lt;a href=&quot;http://octave.org/get-involved.html&quot;&gt;develop Octave&lt;/a&gt;。&lt;/li&gt;&lt;li&gt;如果 Octave 工作不正常,我们鼓励你 &lt;a href=&quot;http://octave.org/bugs.html&quot;&gt;报告问题&lt;/a&gt;。&lt;/li&gt;&lt;li&gt;无论你是开发者还是用户,你可以 &lt;a href=&quot;http://octave.org/donate.html&quot;&gt;资助我们&lt;/a&gt;。Octave 的开发需要大量时间和经验。你的贡献让我们有信心让 Octave 继续变得更好。&lt;/li&gt;&lt;/ul&gt;&lt;/p&gt;&lt;p&gt;我们希望 Octave 可以给你带来一定的帮助。请帮助我们让 Octave 的未来变得更好!&lt;/p&gt;</translation>
+    </message>
+</context>
+<context>
+    <name>QTerminal</name>
+    <message>
+        <location filename="../qterminal/libqterminal/QTerminal.h" line="+121"/>
+        <source>Copy</source>
+        <translation>复制</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Paste</source>
+        <translation>粘贴</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Clear All</source>
+        <translation>清空</translation>
+    </message>
+</context>
+<context>
+    <name>QWinTerminalImpl</name>
+    <message>
+        <location filename="../qterminal/libqterminal/win32/QWinTerminalImpl.cpp" line="+1536"/>
+        <source>copied selection to clipboard</source>
+        <translation>复制选定区域到剪贴板</translation>
+    </message>
+</context>
+<context>
+    <name>documentation_dock_widget</name>
+    <message>
+        <location filename="../src/documentation-dock-widget.cc" line="+34"/>
+        <source>Documentation</source>
+        <translation>文档</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>See the documentation for help.</source>
+        <translation>阅读文档以获取帮助。</translation>
+    </message>
+</context>
+<context>
+    <name>file_editor</name>
+    <message>
+        <location filename="../src/m-editor/file-editor.cc" line="+346"/>
+        <location line="+22"/>
+        <location line="+18"/>
+        <location line="+59"/>
+        <location line="+28"/>
+        <source>Octave Editor</source>
+        <translation>Octave 编辑器</translation>
+    </message>
+    <message>
+        <location line="-269"/>
+        <source>Octave Files (*.m);;All Files (*)</source>
+        <translation>Octave 文件 (*.m);;所有文件 (*)</translation>
+    </message>
+    <message>
+        <location line="-40"/>
+        <source>New Function</source>
+        <translation>新建函数</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>New function name:
+</source>
+        <translation>新建函数的名称:
+</translation>
+    </message>
+    <message>
+        <location line="+281"/>
+        <source>File not saved! A file with the selected name
+%1
+is already open in the editor</source>
+        <translation>文件未保存!一个带有相同名称
+%1
+的文件在编辑器中被打开</translation>
+    </message>
+    <message>
+        <location line="+255"/>
+        <source>&amp;%1 %2</source>
+        <translation>&amp;%1 %2</translation>
+    </message>
+    <message>
+        <location line="+175"/>
+        <source>&amp;New File</source>
+        <translation>新建文件 (&amp;N)</translation>
+    </message>
+    <message>
+        <location line="+6"/>
+        <source>&amp;Save File</source>
+        <translation>保存文件 (&amp;S)</translation>
+    </message>
+    <message>
+        <location line="-3"/>
+        <source>&amp;Open File...</source>
+        <translation>打开文件 (&amp;O) ...</translation>
+    </message>
+    <message>
+        <location line="+6"/>
+        <source>Save File &amp;As...</source>
+        <translation>文件另存为 (&amp;A)...</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Print...</source>
+        <translation>打印...</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>&amp;Undo</source>
+        <translation>撤销 (&amp;U) </translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>&amp;Redo</source>
+        <translation>重做 (&amp;R)</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>&amp;Copy</source>
+        <translation>复制 (&amp;C)</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Cu&amp;t</source>
+        <translation>剪切 (&amp;T)</translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Paste</source>
+        <translation>粘贴</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>&amp;Next Bookmark</source>
+        <translation>下一个书签 (&amp;N)</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Pre&amp;vious Bookmark</source>
+        <translation>上一个书签 (&amp;V)</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Toggle &amp;Bookmark</source>
+        <translation>打开/关闭书签 (&amp;B)</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>&amp;Remove All Bookmarks</source>
+        <translation>移除所有书签 (&amp;R)</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>&amp;Next Breakpoint</source>
+        <translation>下一个断点 (&amp;N)</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Pre&amp;vious Breakpoint</source>
+        <translation>上一个断点 (&amp;V)</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Toggle &amp;Breakpoint</source>
+        <translation>打开/关闭断点 (&amp;B)</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>&amp;Remove All Breakpoints</source>
+        <translation>移除所有断点 (&amp;R)</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>&amp;Comment</source>
+        <translation>注释 (&amp;C)</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>&amp;Uncomment</source>
+        <translation>取消注释 (&amp;U)</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>&amp;Find and Replace...</source>
+        <translation>查找并替换 (&amp;F) ...</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Save File and Run</source>
+        <translation>保存文件并运行</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Go &amp;to Line...</source>
+        <translation>跳至行 (&amp;T) ...</translation>
+    </message>
+    <message>
+        <location line="+55"/>
+        <source>&amp;Recent Editor Files</source>
+        <translation>最近编辑器文件 (&amp;R)</translation>
+    </message>
+    <message>
+        <location line="+11"/>
+        <source>&amp;Edit Function</source>
+        <translation>编辑函数 (&amp;E)</translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>&amp;Close</source>
+        <translation>关闭 (&amp;C)</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Close All</source>
+        <translation>关闭全部</translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Close Other Files</source>
+        <translation>关闭其他文件</translation>
+    </message>
+    <message>
+        <location line="+31"/>
+        <source>&amp;Preferences...</source>
+        <translation>首选项 (&amp;P) ...</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>&amp;Styles Preferences...</source>
+        <translation>风格首选项 (&amp;S) ...</translation>
+    </message>
+    <message>
+        <location line="+16"/>
+        <source>Run &amp;Selection</source>
+        <translation>运行选定部分 (&amp;S)</translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>&amp;Help</source>
+        <translation>帮助 (&amp;H)</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>&amp;Help on Keyword</source>
+        <translation>帮助关键字 (&amp;H)</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>&amp;Documentation on Keyword</source>
+        <translation>文档关键字 (&amp;D)</translation>
+    </message>
+    <message>
+        <location line="-741"/>
+        <source>Could not open file
+%1
+for read: %2.</source>
+        <translation>数据文件
+%1
+无法打开/读取: %2.</translation>
+    </message>
+    <message>
+        <location line="+22"/>
+        <source>File
+%1
+does not exist. Do you want to create it?</source>
+        <translation>数据文件
+%1
+不存在。你希望创建它么?</translation>
+    </message>
+    <message>
+        <location line="+18"/>
+        <source>Could not open file
+%1
+for write: %2.</source>
+        <translation>数据文件
+%1
+无法打开/写入: %2.</translation>
+    </message>
+    <message>
+        <location line="+87"/>
+        <source>The associated file editor tab has disappeared.</source>
+        <translation>关联文件的编辑标签消失了。</translation>
+    </message>
+    <message>
+        <location line="+521"/>
+        <source>&amp;File</source>
+        <translation>文件 (&amp;F)</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>New &amp;Function...</source>
+        <translation>新建函数 (&amp;F) ...</translation>
+    </message>
+    <message>
+        <location line="+34"/>
+        <source>&amp;Edit</source>
+        <translation>编辑 (&amp;E)</translation>
+    </message>
+    <message>
+        <location line="+30"/>
+        <source>&amp;Debug</source>
+        <translation>除错 (&amp;D)</translation>
+    </message>
+    <message>
+        <location line="+9"/>
+        <source>&amp;Run</source>
+        <translation>运行 (&amp;R)</translation>
+    </message>
+</context>
+<context>
+    <name>file_editor_tab</name>
+    <message>
+        <location filename="../src/m-editor/file-editor-tab.cc" line="+803"/>
+        <source>Goto line</source>
+        <translation>前往行</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Line number</source>
+        <translation>行数</translation>
+    </message>
+    <message>
+        <location line="+71"/>
+        <location line="+69"/>
+        <source>&lt;unnamed&gt;</source>
+        <translation>&lt;未命名&gt;</translation>
+    </message>
+    <message>
+        <location line="-12"/>
+        <source>Do you want to save or discard the changes?</source>
+        <translation>你希望保存还是丢弃更改?</translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Do you want to cancel closing, save or discard the changes?</source>
+        <translation>你希望关闭,保存还是丢弃更改?</translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <location line="+122"/>
+        <location line="+150"/>
+        <location line="+22"/>
+        <source>Octave Editor</source>
+        <translation>Octave 编辑器</translation>
+    </message>
+    <message>
+        <location line="-293"/>
+        <source>The file
+%1
+is about to be closed but has been modified.
+%2</source>
+        <translation>数据文件
+%1
+即将要被关闭,但是它已经被更改。
+%2</translation>
+    </message>
+    <message>
+        <location line="+201"/>
+        <source>Octave Files (*.m);;All Files (*)</source>
+        <translation>Octave 文件 (*.m);;所有文件 (*)</translation>
+    </message>
+    <message>
+        <location line="+86"/>
+        <source>
+
+Warning: The contents in the editor is modified!</source>
+        <translation>
+
+警告: 编辑器中内容已经被修改!</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>It seems that the file
+%1
+has been deleted or renamed. Do you want to save it now?%2</source>
+        <translation>数据文件
+%1
+已经被修改或重命名。你希望现在保存这个文件吗?%2</translation>
+    </message>
+    <message>
+        <location line="-172"/>
+        <source>Could not open file %1 for write:
+%2.</source>
+        <translation>无法打开文件 %1 以写入:
+%2.</translation>
+    </message>
+    <message>
+        <location line="-975"/>
+        <source>Line:</source>
+        <translation>行: </translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Col:</source>
+        <translation>列: </translation>
+    </message>
+    <message>
+        <location line="+1122"/>
+        <source>It seems that &apos;%1&apos; has been modified by another application. Do you want to reload it?</source>
+        <translation>看起来 &apos;%1&apos; 已经被其他应用修改。你希望重新载入这个文件吗?</translation>
+    </message>
+</context>
+<context>
+    <name>files_dock_widget</name>
+    <message>
+        <location filename="../src/files-dock-widget.cc" line="+68"/>
+        <source>File Browser</source>
+        <translation>文件浏览器</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Browse your files.</source>
+        <translation>浏览你的文件。</translation>
+    </message>
+    <message>
+        <location line="+18"/>
+        <source>Enter the path or filename</source>
+        <translation>输入路径或文件名</translation>
+    </message>
+    <message>
+        <location line="+11"/>
+        <source>Move up one directory</source>
+        <translation>向上一级移动</translation>
+    </message>
+    <message>
+        <location line="+17"/>
+        <source>Actions on current directory</source>
+        <translation>在当前目录的操作</translation>
+    </message>
+    <message>
+        <location line="+373"/>
+        <source>Find Files...</source>
+        <translation>查找文件...</translation>
+    </message>
+    <message>
+        <location line="+13"/>
+        <source>New File</source>
+        <translation>新建文件</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>New Directory</source>
+        <translation>新建目录</translation>
+    </message>
+    <message>
+        <location line="-323"/>
+        <source>Double-click a file to open it</source>
+        <translation>双击一个文件以打开它</translation>
+    </message>
+    <message>
+        <location line="-79"/>
+        <source>Show Octave directory</source>
+        <translation>显示 Octave 目录</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Go to current Octave directory</source>
+        <translation>前往当前的 Octave 目录</translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Set Octave directory</source>
+        <translation>设置 Octave 目录</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Set Octave directroy to current browser directory</source>
+        <translation>设置 Octave 路径为当前浏览的目录</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Show Home Directory</source>
+        <translation>显示主目录</translation>
+    </message>
+    <message>
+        <location line="+12"/>
+        <source>Search Directory...</source>
+        <translation>搜索目录...</translation>
+    </message>
+    <message>
+        <location line="+8"/>
+        <source>New File...</source>
+        <translation>新建文件...</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>New Directory...</source>
+        <translation>新建目录...</translation>
+    </message>
+    <message>
+        <location line="+276"/>
+        <source>File size</source>
+        <translation>文件大小</translation>
+    </message>
+    <message>
+        <location line="+8"/>
+        <source>File type</source>
+        <translation>文件类型</translation>
+    </message>
+    <message>
+        <location line="+8"/>
+        <source>Date modified</source>
+        <translation>修改日期</translation>
+    </message>
+    <message>
+        <location line="+8"/>
+        <source>Show hidden</source>
+        <translation>显示隐藏文件</translation>
+    </message>
+    <message>
+        <location line="+24"/>
+        <source>Open</source>
+        <translation>打开</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Open in Default Application</source>
+        <translation>使用默认应用程序打开</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Copy Selection to Clipboard</source>
+        <translation>复制选中到剪贴板</translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Run</source>
+        <translation>运行</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Load Data</source>
+        <translation>载入数据</translation>
+    </message>
+    <message>
+        <location line="+6"/>
+        <source>Set Current Directory</source>
+        <translation>设置当前目录</translation>
+    </message>
+    <message>
+        <location line="+8"/>
+        <source>Rename</source>
+        <translation>重命名</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Delete</source>
+        <translation>删除</translation>
+    </message>
+    <message>
+        <location line="+108"/>
+        <source>Rename file/directory</source>
+        <translation>重命名文件/目录</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Rename file/directory:
+</source>
+        <translation>重命名文件/目录:
+</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>
+ to: </source>
+        <translation>
+到: </translation>
+    </message>
+    <message>
+        <location line="+25"/>
+        <location line="+14"/>
+        <source>Delete file/directory</source>
+        <translation>删除文件/目录</translation>
+    </message>
+    <message>
+        <location line="-13"/>
+        <source>Are you sure you want to delete
+</source>
+        <translation>你确实希望删除
+</translation>
+    </message>
+    <message>
+        <location line="+14"/>
+        <source>Can not delete a directory that is not empty</source>
+        <translation>不能删除一个非空目录</translation>
+    </message>
+    <message>
+        <location line="+144"/>
+        <source>Set directory of file browser</source>
+        <translation>设置目录到文件浏览器</translation>
+    </message>
+    <message>
+        <location line="+29"/>
+        <source>Create File</source>
+        <translation>创建文件</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Create file in
+</source>
+        <comment>String ends with \n!</comment>
+        <translation>创建文件于
+</translation>
+    </message>
+    <message>
+        <location line="+17"/>
+        <source>Create Directory</source>
+        <translation>创建目录</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Create folder in
+</source>
+        <comment>String ends with \n!</comment>
+        <translation>创建目录于
+</translation>
+    </message>
+</context>
+<context>
+    <name>final_page</name>
+    <message>
+        <location filename="../src/welcome-wizard.cc" line="+194"/>
+        <source>Enjoy!</source>
+        <translation>尽情享受吧!</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Previous</source>
+        <translation>上一个</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Finish</source>
+        <translation>完成</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Cancel</source>
+        <translation>取消</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>&lt;html&gt;&lt;body&gt;
+&lt;p&gt;We hope you find Octave to be a useful tool.&lt;/p&gt;
+&lt;p&gt;If you encounter problems, there are a number of ways to get help, including commercial support options, a mailing list, a wiki, and other commnity-based support channels.
+You can find more information about each of these by visiting &lt;a href=&quot;http://octave.org/support.html&quot;&gt;http://octave.org/support.html&lt;/a&gt; (opens in external browser).&lt;/p&gt;
+&lt;/body&gt;&lt;/html&gt;</source>
+        <translation>&lt;html&gt;&lt;body&gt;
+&lt;p&gt;我们希望 Octave 能给你带来便利和帮助。&lt;/p&gt;
+&lt;p&gt;当你在使用过程中遇到问题时,有许多办法获取帮助,包括商业支持选项、一个邮件列表、一个百科以及其他社区的支持频道。
+你也可以访问这里以获取更多的信息 &lt;a href=&quot;http://octave.org/support.html&quot;&gt;http://octave.org/support.html&lt;/a&gt; (将会在外部浏览器打开)。&lt;/p&gt;
+&lt;/body&gt;&lt;/html&gt;</translation>
+    </message>
+    <message>
+        <location line="+21"/>
+        <source>&lt;html&gt;&lt;head&gt;
+&lt;style&gt;
+a:link { text-decoration: underline; color: #0000ff; }
+&lt;/style&gt;
+&lt;head/&gt;&lt;body&gt;
+&lt;p&gt;For more information about Octave:&lt;/p&gt;
+&lt;ul&gt;
+&lt;li&gt;Visit &lt;a href=&quot;http://octave.org&quot;&gt;http://octave.org&lt;/a&gt; (opens in external browser)&lt;/li&gt;
+&lt;li&gt;Get the documentation online as &lt;a href=&quot;http://www.gnu.org/software/octave/doc/interpreter/index.html&quot;&gt;html&lt;/a&gt;- or &lt;a href=&quot;http://www.gnu.org/software/octave/octave.pdf&quot;&gt;pdf&lt;/span&gt;&lt;/a&gt;-document (opens in external browser)&lt;/li&gt;
+&lt;li&gt;Open the documentation browser of the Octave GUI with the help menu&lt;/li&gt;
+&lt;/ul&gt;
+&lt;/body&gt;&lt;/html&gt;</source>
+        <translation>&lt;html&gt;&lt;head&gt;
+&lt;style&gt;
+a:link { text-decoration: underline; color: #0000ff; }
+&lt;/style&gt;
+&lt;head/&gt;&lt;body&gt;
+&lt;p&gt;欲了解更多关于 Octave 的信息: &lt;/p&gt;
+&lt;ul&gt;
+&lt;li&gt;访问 &lt;a href=&quot;http://octave.org&quot;&gt;http://octave.org&lt;/a&gt; (在外部浏览器打开)&lt;/li&gt;
+&lt;li&gt;从 &lt;a href=&quot;http://www.gnu.org/software/octave/doc/interpreter/index.html&quot;&gt;html&lt;/a&gt;- 或 &lt;a href=&quot;http://www.gnu.org/software/octave/octave.pdf&quot;&gt;获取 PDF 格式的&lt;/span&gt;&lt;/a&gt;-文档 (在外部浏览器打开)&lt;/li&gt;
+&lt;li&gt;在 Octave GUI 的帮助菜单打开帮助文档。&lt;/li&gt;
+&lt;/ul&gt;
+&lt;/body&gt;&lt;/html&gt;</translation>
+    </message>
+</context>
+<context>
+    <name>find_dialog</name>
+    <message>
+        <location filename="../src/m-editor/find-dialog.cc" line="+77"/>
+        <source>Find &amp;what:</source>
+        <translation>搜索 (&amp;W) : </translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Re&amp;place with:</source>
+        <translation>替换为 (&amp;P) : </translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Match &amp;case</source>
+        <translation>匹配大小写 (&amp;C)</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Search from &amp;start</source>
+        <translation>从开头搜索 (&amp;S)</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>&amp;Wrap while searching</source>
+        <translation>搜索时循环 (&amp;W)</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>&amp;Find Next</source>
+        <translation>查找下一个 (&amp;F)</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Find &amp;Previous</source>
+        <translation>查找上一个 (&amp;P)</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>&amp;Replace</source>
+        <translation>替换 (&amp;R)</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Replace &amp;All</source>
+        <translation>替换全部 (&amp;A)</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>&amp;More...</source>
+        <translation>更多 (&amp;M) ...</translation>
+    </message>
+    <message>
+        <location line="+13"/>
+        <source>&amp;Whole words</source>
+        <translation>整个单词 (&amp;W)</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Regular E&amp;xpressions</source>
+        <translation>常规表达式 (&amp;X)</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Search &amp;backward</source>
+        <translation>反向搜索 (&amp;B)</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Search se&amp;lection</source>
+        <translation>搜索选中 (&amp;L)</translation>
+    </message>
+    <message>
+        <location line="+71"/>
+        <source>Search from end</source>
+        <translation>从尾部搜索</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Search from start</source>
+        <translation>从开头搜索</translation>
+    </message>
+    <message>
+        <location line="+121"/>
+        <source>Replace Result</source>
+        <translation>替换结果</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>%1 items replaced</source>
+        <translation>%1 项已替换</translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Find Result</source>
+        <translation>查找结果</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>No more matches found</source>
+        <translation>没有更多匹配项</translation>
+    </message>
+</context>
+<context>
+    <name>find_files_dialog</name>
+    <message>
+        <location filename="../src/find-files-dialog.cc" line="+52"/>
+        <source>Find Files</source>
+        <translation>查找文件</translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Named:</source>
+        <translation>名称: </translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Enter the filename expression</source>
+        <translation>输入文件名表达式</translation>
+    </message>
+    <message>
+        <location line="+6"/>
+        <source>Start in:</source>
+        <translation>从: </translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Enter the start directory</source>
+        <translation>进入初始目录</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Browse...</source>
+        <translation>浏览...</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Browse for start directory</source>
+        <translation>从初始目录浏览</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Recurse directories</source>
+        <translation>递归目录</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Search recursively through directories for matching files</source>
+        <translation>递归搜索目录以查找匹配文件</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Include directories</source>
+        <translation>包含目录</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Include matching directories in search results</source>
+        <translation>在搜索结果中包含匹配目录</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Name case insensitive</source>
+        <translation>名称大小写敏感</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Set matching name is case insensitive</source>
+        <translation>设置匹配名称大小写敏感</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Contains text:</source>
+        <translation>包含文字: </translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Search must match text</source>
+        <translation>搜索必须匹配文字</translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Text to match</source>
+        <translation>要匹配的文字</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Text case insensitive</source>
+        <translation>文字大小写敏感</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Set text content is case insensitive</source>
+        <translation>设置文字内容大小写敏感</translation>
+    </message>
+    <message>
+        <location line="+11"/>
+        <source>Search results</source>
+        <translation>搜索结果</translation>
+    </message>
+    <message>
+        <location line="+17"/>
+        <source>Idle.</source>
+        <translation>空闲。</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Find</source>
+        <translation>查找</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Start search for matching files</source>
+        <translation>开始查找匹配文件</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Stop</source>
+        <translation>停止</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Stop searching</source>
+        <translation>停止搜索</translation>
+    </message>
+    <message>
+        <location line="+15"/>
+        <source>File name/location</source>
+        <translation>文件名称/位置</translation>
+    </message>
+    <message>
+        <location line="+17"/>
+        <source>File contents</source>
+        <translation>文件内容</translation>
+    </message>
+    <message>
+        <location line="+105"/>
+        <source>Searching...</source>
+        <translation>正在搜索...</translation>
+    </message>
+    <message>
+        <location line="+32"/>
+        <source>Set search directory</source>
+        <translation>设置搜索目录</translation>
+    </message>
+</context>
+<context>
+    <name>find_files_model</name>
+    <message>
+        <location filename="../src/find-files-model.cc" line="+82"/>
+        <source>Filename</source>
+        <translation>文件名</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Directory</source>
+        <translation>目录</translation>
+    </message>
+</context>
+<context>
+    <name>history_dock_widget</name>
+    <message>
+        <location filename="../src/history-dock-widget.cc" line="+43"/>
+        <source>Browse and search the command history.</source>
+        <translation>浏览并搜索命令历史。</translation>
+    </message>
+    <message>
+        <location line="+24"/>
+        <source>Double-click a command to transfer it to the terminal.</source>
+        <translation>双击一个命令以传递到终端。</translation>
+    </message>
+    <message>
+        <location line="+9"/>
+        <source>Enter text to filter the command history.</source>
+        <translation>输入文字以过滤命令历史。</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Command History</source>
+        <translation>命令历史</translation>
+    </message>
+    <message>
+        <location line="+21"/>
+        <source>Copy</source>
+        <translation>复制</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Evaluate</source>
+        <translation>评估</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Create script</source>
+        <translation>创建脚本</translation>
+    </message>
+</context>
+<context>
+    <name>initial_page</name>
+    <message>
+        <location filename="../src/welcome-wizard.cc" line="-179"/>
+        <source>Welcome to Octave!</source>
+        <translation>欢迎来到 Octave!</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Next</source>
+        <translation>下一个</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Cancel</source>
+        <translation>取消</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>&lt;html&gt;&lt;body&gt;
+&lt;p&gt;You seem to be using the Octave graphical interface for the first time on this computer.
+Click &apos;Next&apos; to create a configuration file and launch Octave.&lt;/p&gt;
+&lt;p&gt;The configuration file is stored in&lt;br&gt;%1.&lt;/p&gt;
+&lt;/body&gt;&lt;/html&gt;</source>
+        <translation>&lt;html&gt;&lt;body&gt;
+&lt;p&gt;看起来这是你第一次在这台电脑上使用 Octave 图形界面。
+点击 &apos;下一步&apos; 以创建一个配置文件并启动 Octave .&lt;/p&gt;
+&lt;p&gt;配置文件存放于&lt;br&gt;%1.&lt;/p&gt;
+&lt;/body&gt;&lt;/html&gt;</translation>
+    </message>
+</context>
+<context>
+    <name>main_window</name>
+    <message>
+        <location filename="../src/main-window.cc" line="-1696"/>
+        <source>Load Workspace</source>
+        <translation>载入工作空间</translation>
+    </message>
+    <message>
+        <location line="+645"/>
+        <location line="+876"/>
+        <source>About Octave</source>
+        <translation>关于 Octave</translation>
+    </message>
+    <message>
+        <location line="-371"/>
+        <source>&amp;File</source>
+        <translation>文件 (&amp;F)</translation>
+    </message>
+    <message>
+        <location line="+54"/>
+        <source>New</source>
+        <translation>新建</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Script</source>
+        <translation>脚本</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Figure</source>
+        <translation>图形</translation>
+    </message>
+    <message>
+        <location line="-59"/>
+        <source>Open...</source>
+        <translation>打开...</translation>
+    </message>
+    <message>
+        <location line="+20"/>
+        <source>Preferences...</source>
+        <translation>首选项...</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Exit</source>
+        <translation>退出</translation>
+    </message>
+    <message>
+        <location line="+53"/>
+        <source>&amp;Edit</source>
+        <translation>编辑 (&amp;E)</translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Undo</source>
+        <translation>撤销</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Copy</source>
+        <translation>复制</translation>
+    </message>
+    <message>
+        <location line="+6"/>
+        <source>Paste</source>
+        <translation>粘贴</translation>
+    </message>
+    <message>
+        <location line="-1265"/>
+        <source>Save Workspace As</source>
+        <translation>工作空间另存为</translation>
+    </message>
+    <message>
+        <location line="+124"/>
+        <source>The release notes file &apos;%1&apos; is empty.</source>
+        <translation>发行注记文件 &apos;%1&apos; 是空的。</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>The release notes file &apos;%1&apos; cannot be read.</source>
+        <translation>发行注记文件 &apos;%1&apos; 无法读取。</translation>
+    </message>
+    <message>
+        <location line="+13"/>
+        <source>Octave Release Notes</source>
+        <translation>Octave 发行注记</translation>
+    </message>
+    <message>
+        <location line="+189"/>
+        <source>Octave Community News</source>
+        <translation>Octave 社区新闻</translation>
+    </message>
+    <message>
+        <location line="+939"/>
+        <source>Clear Clipboard</source>
+        <translation>清空剪贴板</translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Find Files...</source>
+        <translation>查找文件...</translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Clear Command Window</source>
+        <translation>清空命令窗口</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Clear Command History</source>
+        <translation>清空命令历史</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Clear Workspace</source>
+        <translation>清空工作空间</translation>
+    </message>
+    <message>
+        <location line="+40"/>
+        <source>De&amp;bug</source>
+        <translation>除错 (&amp;B)</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Step</source>
+        <translation>步骤</translation>
+    </message>
+    <message>
+        <location line="+12"/>
+        <source>Continue</source>
+        <translation>继续</translation>
+    </message>
+    <message>
+        <location line="+9"/>
+        <source>Exit Debug Mode</source>
+        <translation>退出除错模式</translation>
+    </message>
+    <message>
+        <location line="+51"/>
+        <source>Show File Browser</source>
+        <translation>显示文件浏览器</translation>
+    </message>
+    <message>
+        <location line="+26"/>
+        <source>File Browser</source>
+        <translation>文件浏览器</translation>
+    </message>
+    <message>
+        <location line="+194"/>
+        <source>&lt;strong&gt;You are using a release candidate of Octave&apos;s experimental GUI.&lt;/strong&gt;  Octave is under continuous improvement and the GUI will be the default interface for the 4.0 release.  For more information, select the &quot;Release Notes&quot; item in the &quot;News&quot; menu of the GUI, or visit &lt;a href=&quot;http://octave.org&quot;&gt;http://octave.org&lt;/a&gt;.</source>
+        <translation>&lt;strong&gt;你正在使用一个候选发布版本的 Octave GUI .&lt;/strong&gt;  Octave 目前正在不停改进以让此图形界面成为 4.0 的默认界面。欲了解更多详情,请选择 GUI 中 &quot;新闻&quot; 目录下的 &quot;发行注记&quot;,或访问 &lt;a href=&quot;http://octave.org&quot;&gt;http://octave.org&lt;/a&gt;.</translation>
+    </message>
+    <message>
+        <location line="-288"/>
+        <source>Step In</source>
+        <translation>步进</translation>
+    </message>
+    <message>
+        <location line="-151"/>
+        <source>Load Workspace...</source>
+        <translation>载入工作空间...</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Save Workspace As...</source>
+        <translation>工作空间另存为...</translation>
+    </message>
+    <message>
+        <location line="+41"/>
+        <source>Function...</source>
+        <translation>函数...</translation>
+    </message>
+    <message>
+        <location line="+111"/>
+        <source>Step Out</source>
+        <translation>步出</translation>
+    </message>
+    <message>
+        <location line="+108"/>
+        <source>Reset Default Window Layout</source>
+        <translation>复位为默认窗口布局</translation>
+    </message>
+    <message>
+        <location line="+77"/>
+        <source>Octave Packages</source>
+        <translation>Octave 软件包</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Share Code</source>
+        <translation>共享代码</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Contribute to Octave</source>
+        <translation>贡献 Octave</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Octave Developer Resources</source>
+        <translation>Octave 开发者资源</translation>
+    </message>
+    <message>
+        <location line="+32"/>
+        <source>On Disk</source>
+        <translation>磁盘上</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Online</source>
+        <translation>在线</translation>
+    </message>
+    <message>
+        <location line="+12"/>
+        <source>&amp;News</source>
+        <translation>新闻 (&amp;N)</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Release Notes</source>
+        <translation>发行注记</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Community News</source>
+        <translation>社区新闻</translation>
+    </message>
+    <message>
+        <location line="+50"/>
+        <source>More Info</source>
+        <translation>更多信息</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Hide</source>
+        <translation>隐藏</translation>
+    </message>
+    <message>
+        <location line="+47"/>
+        <location line="+66"/>
+        <source>Experimental GUI Info</source>
+        <translation>实验性 GUI 信息</translation>
+    </message>
+    <message>
+        <location line="+27"/>
+        <source>Enter directory name</source>
+        <translation>输入目录名</translation>
+    </message>
+    <message>
+        <location line="+9"/>
+        <source>Current Directory: </source>
+        <translation>当前目录: </translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>One directory up</source>
+        <translation>向上一级</translation>
+    </message>
+    <message>
+        <location line="-1283"/>
+        <location line="+1286"/>
+        <source>Browse directories</source>
+        <translation>浏览目录</translation>
+    </message>
+    <message>
+        <location line="-405"/>
+        <source>&amp;Window</source>
+        <translation>窗口 (&amp;W)</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Show Command Window</source>
+        <translation>显示命令窗口</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Show Command History</source>
+        <translation>显示命令历史</translation>
+    </message>
+    <message>
+        <location line="+8"/>
+        <source>Show Workspace</source>
+        <translation>显示工作空间</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Show Editor</source>
+        <translation>显示编辑器</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Show Documentation</source>
+        <translation>显示文档</translation>
+    </message>
+    <message>
+        <location line="+6"/>
+        <source>Command Window</source>
+        <translation>命令窗口</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Command History</source>
+        <translation>命令历史</translation>
+    </message>
+    <message>
+        <location line="+8"/>
+        <source>Workspace</source>
+        <translation>工作空间</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Editor</source>
+        <translation>编辑器</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <location line="+121"/>
+        <source>Documentation</source>
+        <translation>文档</translation>
+    </message>
+    <message>
+        <location line="-48"/>
+        <source>&amp;Help</source>
+        <translation>帮助 (&amp;H)</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Report Bug</source>
+        <translation>报告问题</translation>
+    </message>
+</context>
+<context>
+    <name>news_reader</name>
+    <message>
+        <location line="-1282"/>
+        <source>&lt;html&gt;
+&lt;body&gt;
+&lt;p&gt;
+Octave&apos;s community news source seems to be unavailable.
+&lt;/p&gt;
+&lt;p&gt;
+For the latest news, please check
+&lt;a href=&quot;http://octave.org/community-news.html&quot;&gt;http://octave.org/community-news.html&lt;/a&gt;
+when you have a connection to the web (link opens in an external browser).
+&lt;/p&gt;
+&lt;p&gt;
+&lt;small&gt;&lt;em&gt;&amp;mdash; The Octave Developers, </source>
+        <translation>&lt;html&gt;
+&lt;body&gt;
+&lt;p&gt;
+Octave 的社区新闻来源似乎不可用。
+&lt;/p&gt;
+&lt;p&gt;
+当你的网络连接可用时,要获取最新新闻,请查阅
+&lt;a href=&quot;http://octave.org/community-news.html&quot;&gt;http://octave.org/community-news.html&lt;/a&gt;
+(将在外部浏览器打开) .
+&lt;/p&gt;
+&lt;p&gt;
+&lt;small&gt;&lt;em&gt;&amp;mdash; Octave 开发者</translation>
+    </message>
+    <message>
+        <location line="+18"/>
+        <source>&lt;html&gt;
+&lt;body&gt;
+&lt;p&gt;
+Connecting to the web to display the latest Octave Community news has been disabled.
+&lt;/p&gt;
+&lt;p&gt;
+For the latest news, please check
+&lt;a href=&quot;http://octave.org/community-news.html&quot;&gt;http://octave.org/community-news.html&lt;/a&gt;
+when you have a connection to the web (link opens in an external browser)
+or enable web connections for news in Octave&apos;s network settings dialog.
+&lt;/p&gt;
+&lt;p&gt;
+&lt;small&gt;&lt;em&gt;&amp;mdash; The Octave Developers, </source>
+        <translation>&lt;html&gt;
+&lt;body&gt;
+&lt;p&gt;
+连接到互联网以获取 Octave 社区新闻的选项已经被禁用。
+&lt;/p&gt;
+&lt;p&gt;
+在网络连接可用时,要获取最新新闻,请查阅
+&lt;a href=&quot;http://octave.org/community-news.html&quot;&gt;http://octave.org/community-news.html&lt;/a&gt;
+(将在外部浏览器打开链接)。
+或者在 Octave 网络设置对话框打开网络连接。
+&lt;/p&gt;
+&lt;p&gt;
+&lt;small&gt;&lt;em&gt;&amp;mdash; Octave 开发者</translation>
+    </message>
+</context>
+<context>
+    <name>octave_dock_widget</name>
+    <message>
+        <location filename="../src/octave-dock-widget.cc" line="+61"/>
+        <location line="+163"/>
+        <source>Undock widget</source>
+        <translation>移动挂件</translation>
+    </message>
+    <message>
+        <location line="-153"/>
+        <source>Hide widget</source>
+        <translation>隐藏挂件</translation>
+    </message>
+    <message>
+        <location line="+104"/>
+        <source>Dock widget</source>
+        <translation>停靠挂件</translation>
+    </message>
+</context>
+<context>
+    <name>octave_qscintilla</name>
+    <message>
+        <location filename="../src/m-editor/octave-qscintilla.cc" line="+130"/>
+        <source>Help on</source>
+        <translation>开启帮助</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Documentation on</source>
+        <translation>开启文档</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Edit</source>
+        <translation>编辑</translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>&amp;Run Selection</source>
+        <translation>运行选定项 (&amp;R)</translation>
+    </message>
+</context>
+<context>
+    <name>octave_qt_link</name>
+    <message>
+        <location filename="../src/octave-qt-link.cc" line="+94"/>
+        <location line="+6"/>
+        <location line="+7"/>
+        <source>Yes</source>
+        <translation>是</translation>
+    </message>
+    <message>
+        <location line="-13"/>
+        <source>No</source>
+        <translation>不</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>File
+%1
+does not exist. Do you want to create it?</source>
+        <translation>文件
+%1
+不存在。你希望创建它吗?</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Octave Editor</source>
+        <translation>Octave 编辑器</translation>
+    </message>
+    <message>
+        <location line="+211"/>
+        <source>The file %1 does not exist in the load path.  To debug the function you are editing, you must either change to the directory %2 or add that directory to the load path.</source>
+        <translation>文件 %1 不存在于载入路径。要给当前编辑的函数除错,你必须切换到目录 %2 或添加那个目录到载入路径。</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>The file %1 is shadowed by a file with the same name in the load path.  To debug the function you are editing, change to the directory %2.</source>
+        <translation>文件 %1 在相同目录被创建影子文件。要给当前编辑的函数除错,请切换到目录 %2 .</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Change Directory or Add Directory to Load Path</source>
+        <translation>切换目录或添加目录到载入路径</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Change Directory</source>
+        <translation>切换目录</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Add Directory to Load Path</source>
+        <translation>添加目录到载入路径</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Cancel</source>
+        <translation>取消</translation>
+    </message>
+</context>
+<context>
+    <name>resource_manager</name>
+    <message>
+        <location filename="../src/resource-manager.cc" line="+235"/>
+        <source>The settings file
+%1
+does not exist and can not be created.
+Make sure you have read and write permissions to
+%2
+
+Octave GUI must be closed now.</source>
+        <translation>配置文件
+%1
+不存在且不能被创建。
+请确定你在如下目录有写入权限。
+%2
+besitzt.
+Die Octave Benutzeroberfläche muss jetzt geschlossen werden.</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Octave Critical Error</source>
+        <translation>Octave 严重错误</translation>
+    </message>
+</context>
+<context>
+    <name>settings_dialog</name>
+    <message>
+        <location filename="../src/settings-dialog.ui" line="+29"/>
+        <source>Settings</source>
+        <translation>设置</translation>
+    </message>
+    <message>
+        <location line="+13"/>
+        <source>General</source>
+        <translation>常规</translation>
+    </message>
+    <message>
+        <location line="+97"/>
+        <source>Octave logo only</source>
+        <translation>仅 Octave 徽标</translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Letter icons</source>
+        <translation>字母图标</translation>
+    </message>
+    <message>
+        <location line="+46"/>
+        <source>Editor</source>
+        <translation> 编辑器</translation>
+    </message>
+    <message>
+        <location line="+71"/>
+        <source>Color</source>
+        <translation>颜色</translation>
+    </message>
+    <message>
+        <location line="+120"/>
+        <source>Indent width</source>
+        <translation>缩进宽度</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Tab indents line</source>
+        <translation>Tab 键缩进行</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Auto indentation</source>
+        <translation>自动缩进</translation>
+    </message>
+    <message>
+        <location line="+20"/>
+        <source>Tab width</source>
+        <translation>Tab 键宽度</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Show indentation guides</source>
+        <translation>显示缩进参考线</translation>
+    </message>
+    <message>
+        <location line="+17"/>
+        <source>Backspace unindents line</source>
+        <translation>退格键删除缩进符</translation>
+    </message>
+    <message>
+        <location line="+155"/>
+        <source>Match keywords</source>
+        <translation>匹配关键字</translation>
+    </message>
+    <message>
+        <location line="+13"/>
+        <source>Case sensitive</source>
+        <translation>大小写敏感</translation>
+    </message>
+    <message>
+        <location line="+13"/>
+        <source>Replace word by suggested one</source>
+        <translation>使用建议的单词替换原有的</translation>
+    </message>
+    <message>
+        <location line="+23"/>
+        <source>Match words in document</source>
+        <translation>在文档中匹配单词</translation>
+    </message>
+    <message>
+        <location line="+61"/>
+        <source>Restore editor tabs from previous session on startup</source>
+        <translation>在启动时恢复上次会话的编辑器标签</translation>
+    </message>
+    <message>
+        <location line="+60"/>
+        <source>Use custom file editor</source>
+        <translation>使用自定义文件编辑器</translation>
+    </message>
+    <message>
+        <location line="+32"/>
+        <source>Editor Styles</source>
+        <translation>编辑器风格</translation>
+    </message>
+    <message>
+        <location line="+24"/>
+        <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Select font, font size (as a difference from the default size), font style (&lt;b&gt;b&lt;/b&gt;old, &lt;b&gt;i&lt;/b&gt;talic, &lt;b&gt;u&lt;/b&gt;nderline), text color and background color (for the latter, the color pink (255,0,255) is a placeholder for the default background color).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+        <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;选择字体和字体大小 (和默认大小不同),以及字体风格 (&lt;b&gt;粗&lt;/b&gt;体, &lt;b&gt;斜&lt;/b&gt;体, &lt;b&gt;下&lt;/b&gt;划线), 文字颜色和背景色 (对于后者,粉红色 (255,0,255) 是默认背景颜色的占位符)。&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+    </message>
+    <message>
+        <location line="+108"/>
+        <source>Terminal Colors</source>
+        <translation>终端颜色</translation>
+    </message>
+    <message>
+        <location line="+45"/>
+        <source>Font</source>
+        <translation>字体</translation>
+    </message>
+    <message>
+        <location line="-757"/>
+        <source>Show line numbers</source>
+        <translation>显示行数</translation>
+    </message>
+    <message>
+        <location line="+27"/>
+        <source>Highlight current line</source>
+        <translation>高亮当前行</translation>
+    </message>
+    <message>
+        <location line="+262"/>
+        <source>Code completion</source>
+        <translation>代码补全</translation>
+    </message>
+    <message>
+        <location line="-282"/>
+        <source>Show complete path in window title</source>
+        <translation>在窗口标题显示完整路径</translation>
+    </message>
+    <message>
+        <location line="-72"/>
+        <source>Graphic icons</source>
+        <translation>图形图标</translation>
+    </message>
+    <message>
+        <location line="+55"/>
+        <source>Show whitespace</source>
+        <translation>显示空白</translation>
+    </message>
+    <message>
+        <location line="+27"/>
+        <source>Do not show whitespace used for indentation</source>
+        <translation>不要显示缩进的空白空间</translation>
+    </message>
+    <message>
+        <location line="+290"/>
+        <source># of characters typed before completion list displayed</source>
+        <translation>在补全列表显示前输入字符的数量</translation>
+    </message>
+    <message>
+        <location line="+194"/>
+        <source>Create nonexistent files without prompting</source>
+        <translation>在创建不存在的文件时不提示</translation>
+    </message>
+    <message>
+        <location line="+57"/>
+        <source>command line (%f=file, %l=line):</source>
+        <translation>命令行 (%f=文件, %l=行数): </translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>emacs</source>
+        <translation>Emacs</translation>
+    </message>
+    <message>
+        <location line="+67"/>
+        <source>Terminal</source>
+        <translation>终端</translation>
+    </message>
+    <message>
+        <location line="+15"/>
+        <source>Cursor type:</source>
+        <translation>光标类型: </translation>
+    </message>
+    <message>
+        <location line="+23"/>
+        <source>Cursor blinking</source>
+        <translation>光标闪烁</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Use foreground color</source>
+        <translation>使用前景色</translation>
+    </message>
+    <message>
+        <location line="+94"/>
+        <source>Font size</source>
+        <translation>字体大小</translation>
+    </message>
+    <message>
+        <location line="+35"/>
+        <source>File Browser</source>
+        <translation>文件浏览器</translation>
+    </message>
+    <message>
+        <location line="+6"/>
+        <source>Show file size</source>
+        <translation>显示文件大小</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Show file type</source>
+        <translation>显示文件类型</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Show date of last modification</source>
+        <translation>显示最后修改日期</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Show hidden files</source>
+        <translation>显示隐藏文件</translation>
+    </message>
+    <message>
+        <location line="+14"/>
+        <source>Alternating row colors</source>
+        <translation>备选列颜色</translation>
+    </message>
+    <message>
+        <location line="+21"/>
+        <source>Workspace</source>
+        <translation>工作空间</translation>
+    </message>
+    <message>
+        <location line="+30"/>
+        <source>Storage Class Colors</source>
+        <translation>存储类颜色</translation>
+    </message>
+    <message>
+        <location line="+35"/>
+        <source>Network</source>
+        <translation>网络</translation>
+    </message>
+    <message>
+        <location line="+8"/>
+        <source>Allow Octave to connect to the Octave web site to display current news and information</source>
+        <translation>允许 Octave 连接到 Octave 站点以显示当前新闻和信息</translation>
+    </message>
+    <message>
+        <location line="+46"/>
+        <source>Use proxy server</source>
+        <translation>使用代理服务器</translation>
+    </message>
+    <message>
+        <location line="-23"/>
+        <source>HttpProxy</source>
+        <translation>HTTP Proxy</translation>
+    </message>
+    <message>
+        <location line="-1129"/>
+        <source>Icon set for dock widgets</source>
+        <translation>挂件的图标集</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Language (requires restart)</source>
+        <translation>语言 (需要重启)</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>Icon size</source>
+        <translation>图标大小</translation>
+    </message>
+    <message>
+        <location line="+991"/>
+        <source>Synchronize Octave working directory with file browser</source>
+        <translation>使用文件浏览器同步 Octave 工作目录</translation>
+    </message>
+    <message>
+        <location line="+129"/>
+        <source>Socks5Proxy</source>
+        <translation>Socks5Proxy</translation>
+    </message>
+    <message>
+        <location line="-16"/>
+        <source>Hostname:</source>
+        <translation>主机名: </translation>
+    </message>
+    <message>
+        <location line="+44"/>
+        <source>Proxy type:</source>
+        <translation>代理类型: </translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>Port:</source>
+        <translation>端口: </translation>
+    </message>
+    <message>
+        <location line="-27"/>
+        <source>Username:</source>
+        <translation>用户名: </translation>
+    </message>
+    <message>
+        <location line="+37"/>
+        <source>Password:</source>
+        <translation>密码: </translation>
+    </message>
+    <message>
+        <location filename="../src/settings-dialog.cc" line="+71"/>
+        <location line="+4"/>
+        <location line="+389"/>
+        <source>System setting</source>
+        <translation>系统设置</translation>
+    </message>
+    <message>
+        <location line="-286"/>
+        <source>IBeam Cursor</source>
+        <translation>IBeam 光标</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Block Cursor</source>
+        <translation>块状光标</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Underline Cursor</source>
+        <translation>给光标添加下划线</translation>
+    </message>
+    <message>
+        <location line="+144"/>
+        <source>Difference to the default size</source>
+        <translation>和默认大小的差别</translation>
+    </message>
+    <message>
+        <location line="+6"/>
+        <source>Background color, pink (255,0,255) means default</source>
+        <translation>背景颜色,粉红色 (255,0,255) 代表默认值</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>b</source>
+        <comment>short form for bold</comment>
+        <translation>b</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>i</source>
+        <comment>short form for italic</comment>
+        <translation>i</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>u</source>
+        <comment>short form for underlined</comment>
+        <translation>u</translation>
+    </message>
+</context>
+<context>
+    <name>setup_community_news</name>
+    <message>
+        <location filename="../src/welcome-wizard.cc" line="+44"/>
+        <source>Community News</source>
+        <translation>社区新闻</translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Previous</source>
+        <translation>上一个</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Next</source>
+        <translation>下一个</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Cancel</source>
+        <translation>取消</translation>
+    </message>
+    <message>
+        <location line="+7"/>
+        <source>&lt;html&gt;&lt;body&gt;
+&lt;p&gt;When the Octave GUI starts, it will check the Octave web site for current news and information about the Octave community.
+The check will happen at most once each day and news will only be displayed if there is something new since the last time you viewed the news.&lt;/p&gt;
+&lt;p&gt;You may also view the news by selecting the &quot;Community News&quot; item in the &quot;Help&quot; menu in the GUI, or by visiting
+&lt;a href=&quot;http://octave.org/community-news.html&quot;&gt;http://octave.org/community-news.html&lt;/a&gt;.&lt;/p&gt;
+&lt;/body&gt;&lt;/html&gt;</source>
+        <translation>&lt;html&gt;&lt;body&gt;
+&lt;p&gt;当 Octave GUI 启动的时候,它会检查 Octave 站点上关于 Octave 社区的新闻和信息。
+每天会检查一次新闻消息,而只有在你上次阅读新闻起有新的新闻出现时才会弹出。&lt;/p&gt;
+&lt;p&gt;你也可以点选 GUI 上的 &quot;社区新闻&quot; 以直接阅读新闻,或直接访问:
+&lt;a href=&quot;http://octave.org/community-news.html&quot;&gt;http://octave.org/community-news.html&lt;/a&gt;.&lt;/p&gt;
+&lt;/body&gt;&lt;/html&gt;</translation>
+    </message>
+    <message>
+        <location line="+26"/>
+        <source>&lt;html&gt;&lt;head&gt;
+&lt;style&gt;
+a:link { text-decoration: underline; color: #0000ff; }
+&lt;/style&gt;
+&lt;head/&gt;&lt;body&gt;
+&lt;p&gt;Allow Octave to connect to the Octave web site when it starts to display current news and information about the Octave community.&lt;/p&gt;
+&lt;/body&gt;&lt;/html&gt;</source>
+        <translation>&lt;html&gt;&lt;head&gt;
+&lt;style&gt;
+a:link { text-decoration: underline; color: #0000ff; }
+&lt;/style&gt;
+&lt;head/&gt;&lt;body&gt;
+&lt;p&gt;允许 Octave 在显示关于 Octave 社区的新闻和信息时连接到 Octave 站点。&lt;/p&gt;
+&lt;/body&gt;&lt;/html&gt;</translation>
+    </message>
+</context>
+<context>
+    <name>terminal_dock_widget</name>
+    <message>
+        <location filename="../src/terminal-dock-widget.cc" line="+38"/>
+        <source>Command Window</source>
+        <translation>命令窗口</translation>
+    </message>
+</context>
+<context>
+    <name>webinfo</name>
+    <message>
+        <location filename="../src/qtinfo/webinfo.cc" line="+80"/>
+        <source>Type here and press &apos;Return&apos; to search</source>
+        <translation>在这里输入并按下回车以搜索</translation>
+    </message>
+    <message>
+        <location line="+4"/>
+        <source>Global search</source>
+        <translation>全局搜索</translation>
+    </message>
+</context>
+<context>
+    <name>welcome_wizard</name>
+    <message>
+        <location filename="../src/welcome-wizard.cc" line="+135"/>
+        <source>Welcome to GNU Octave</source>
+        <translation>欢迎来到 GNU Octave</translation>
+    </message>
+</context>
+<context>
+    <name>workspace_model</name>
+    <message>
+        <location filename="../src/workspace-model.cc" line="-42"/>
+        <source>Name</source>
+        <translation>名称</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Class</source>
+        <translation>类</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Dimension</source>
+        <translation>维度</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Value</source>
+        <translation>值</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Storage Class</source>
+        <translation>存储类</translation>
+    </message>
+    <message>
+        <location line="+109"/>
+        <source>Right click to copy, rename, or display</source>
+        <translation>右击以复制,重命名或显示</translation>
+    </message>
+    <message>
+        <location line="+37"/>
+        <location line="+2"/>
+        <source>complex</source>
+        <translation>复杂度</translation>
+    </message>
+</context>
+<context>
+    <name>workspace_view</name>
+    <message>
+        <location filename="../src/workspace-view.cc" line="+47"/>
+        <source>Workspace</source>
+        <translation>工作区</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>View the variables in the active workspace.</source>
+        <translation>显示当前活动工作区的变量。</translation>
+    </message>
+    <message>
+        <location line="+76"/>
+        <source>Copy</source>
+        <translation>复制</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Rename</source>
+        <translation>重命名</translation>
+    </message>
+    <message>
+        <location line="+8"/>
+        <source>Only top-level symbols may be renamed.</source>
+        <translation>只有顶级符号才能被重命名。</translation>
+    </message>
+    <message>
+        <location line="+125"/>
+        <source>View the variables in the active workspace.&lt;br&gt;</source>
+        <translation>显示当前活动工作区的变量。&lt;br&gt;</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Colors for the storage class:</source>
+        <translation>存储类的颜色: </translation>
+    </message>
+</context>
+</TS>
--- a/libgui/qterminal/libqterminal/QTerminal.cc	Thu Apr 03 16:30:05 2014 -0700
+++ b/libgui/qterminal/libqterminal/QTerminal.cc	Fri Apr 04 11:50:14 2014 -0700
@@ -118,4 +118,5 @@
     (cursorUseForegroundColor,
      settings->value ("terminal/color_c",
                       QVariant (colors.at (3))).value<QColor> ());
+  setScrollBufferSize (settings->value ("terminal/history_buffer",1000).toInt() );
 }
--- a/libgui/qterminal/libqterminal/QTerminal.h	Thu Apr 03 16:30:05 2014 -0700
+++ b/libgui/qterminal/libqterminal/QTerminal.h	Fri Apr 04 11:50:14 2014 -0700
@@ -81,6 +81,8 @@
   virtual void setCursorColor (bool useForegroundColor,
                                const QColor& color) = 0;
 
+  virtual void setScrollBufferSize(int value=1000) = 0;
+
 signals:
 
   void report_status_message (const QString&);
--- a/libgui/qterminal/libqterminal/unix/QUnixTerminalImpl.cpp	Thu Apr 03 16:30:05 2014 -0700
+++ b/libgui/qterminal/libqterminal/unix/QUnixTerminalImpl.cpp	Fri Apr 04 11:50:14 2014 -0700
@@ -69,13 +69,23 @@
     m_terminalModel = new TerminalModel(m_kpty);
     m_terminalModel->setAutoClose(true);
     m_terminalModel->setCodec(QTextCodec::codecForName("UTF-8"));
-    m_terminalModel->setHistoryType(HistoryTypeBuffer(1000));
+    m_terminalModel->setHistoryType(HistoryTypeBuffer (1000));
     m_terminalModel->setDarkBackground(true);
     m_terminalModel->setKeyBindings("");
     m_terminalModel->run();
     m_terminalModel->addView(m_terminalView);
     connectToPty();
 }
+void QUnixTerminalImpl::setScrollBufferSize(int value)
+{
+  if (value > 0)
+    {
+      m_terminalModel->clearHistory ();
+      m_terminalModel->setHistoryType (HistoryTypeBuffer ( value ));
+    }
+  else
+    m_terminalModel->setHistoryType (HistoryTypeNone ());
+}
 
 void QUnixTerminalImpl::connectToPty()
 {
--- a/libgui/qterminal/libqterminal/unix/QUnixTerminalImpl.h	Thu Apr 03 16:30:05 2014 -0700
+++ b/libgui/qterminal/libqterminal/unix/QUnixTerminalImpl.h	Fri Apr 04 11:50:14 2014 -0700
@@ -47,7 +47,7 @@
     void setForegroundColor (const QColor& color);
     void setSelectionColor (const QColor& color);
     void setCursorColor (bool useForegroundColor, const QColor& color);
-
+    void setScrollBufferSize(int value);
     QString selectedText();
 
 public slots:
--- a/libgui/qterminal/libqterminal/win32/QWinTerminalImpl.cpp	Thu Apr 03 16:30:05 2014 -0700
+++ b/libgui/qterminal/libqterminal/win32/QWinTerminalImpl.cpp	Fri Apr 04 11:50:14 2014 -0700
@@ -205,6 +205,7 @@
   void setForegroundColor (const QColor& color);
   void setSelectionColor (const QColor& color);
   void setCursorColor (bool useForegroundColor, const QColor& color);
+  void setScrollBufferSize (int value);
 
   void drawTextBackground (QPainter& p, int cx1, int cy1, int cx2, int cy2,
                            int cw, int ch);
@@ -597,6 +598,14 @@
   m_cursorColor = useForegroundColor ? QColor () : color;
 }
 
+void QConsolePrivate::setScrollBufferSize (int value)
+{
+// FIXME: not tested code follows
+//  CONSOLE_SCREEN_BUFFER_INFO sbi;
+//  GetConsoleScreenBufferInfo (m_stdOut, &sbi);
+//  m_bufferSize = QSize (sbi.dwSize.X, qMax (sbi.dwSize.Y, (SHORT)value));
+}
+
 void QConsolePrivate::drawTextBackground (QPainter& p, int cx1, int cy1,
                                           int cx2, int cy2, int cw, int ch)
 {
@@ -1512,6 +1521,13 @@
   d->setCursorColor (useForegroundColor, color);
 }
 
+void QWinTerminalImpl::setScrollBufferSize(int value)
+{
+// FIXME: not tested code follows
+//  d->setScrollBufferSize (value);
+}
+
+
 //////////////////////////////////////////////////////////////////////////////
 
 void QWinTerminalImpl::setTerminalFont (const QFont& f)
--- a/libgui/qterminal/libqterminal/win32/QWinTerminalImpl.h	Thu Apr 03 16:30:05 2014 -0700
+++ b/libgui/qterminal/libqterminal/win32/QWinTerminalImpl.h	Fri Apr 04 11:50:14 2014 -0700
@@ -60,6 +60,7 @@
   void setForegroundColor (const QColor& color);
   void setSelectionColor (const QColor& color);
   void setCursorColor (bool useForegoundColor, const QColor& color);
+  void setScrollBufferSize(int value);
 
   QString selectedText ();
 
--- a/libgui/src/dialog.cc	Thu Apr 03 16:30:05 2014 -0700
+++ b/libgui/src/dialog.cc	Fri Apr 04 11:50:14 2014 -0700
@@ -485,23 +485,25 @@
 
   string_result = selectedFiles ();
 
+  if (testOption (QFileDialog::ShowDirsOnly)  == true &&
+      string_result.size () > 0)
+    {
+      path = string_result[0];
+    }
+  else
+    {
+      path = directory ().absolutePath ();
+    }
+
   // Matlab expects just the file name, whereas the file dialog gave us
-  // pull path names, so fix it.
+  // full path names, so fix it.
 
   for (int i = 0; i < string_result.size (); i++)
     string_result[i] = QFileInfo (string_result[i]).fileName ();
 
-  path = directory ().absolutePath ();
-
   // if not showing only dirs, add end slash for the path component
   if (testOption (QFileDialog::ShowDirsOnly)  == false)
     path = path + "/";
-  else
-    {
-      // if name was provided in uigetdir, add to path
-      if (string_result.size() > 0)
-        path = path + "/" + string_result[0];
-    }
 
   // convert to native slashes
   path = QDir::toNativeSeparators (path);
--- a/libgui/src/m-editor/file-editor.cc	Thu Apr 03 16:30:05 2014 -0700
+++ b/libgui/src/m-editor/file-editor.cc	Fri Apr 04 11:50:14 2014 -0700
@@ -28,6 +28,8 @@
 
 #include "file-editor.h"
 #include "resource-manager.h"
+#include "shortcut-manager.h"
+
 #include <QVBoxLayout>
 #include <QApplication>
 #include <QFile>
@@ -1552,6 +1554,10 @@
 {
   if (set)
     {
+
+      shortcut_manager::set_shortcut (_save_action, "editor_file:save");
+      shortcut_manager::set_shortcut (_save_as_action, "editor_file:save_as");
+
       _comment_selection_action->setShortcut (Qt::ControlModifier + Qt::Key_R);
       _uncomment_selection_action->setShortcut (Qt::SHIFT
                                                 + Qt::ControlModifier
@@ -1586,12 +1592,11 @@
       _context_run_action->setShortcut (Qt::Key_F9);
 
       _context_edit_action->setShortcut (Qt::ControlModifier + Qt::Key_E);
-      _save_action->setShortcut (QKeySequence::Save);
-      _save_as_action->setShortcut (QKeySequence::SaveAs);
       _close_action->setShortcut (QKeySequence::Close);
 
       _redo_action->setShortcut (QKeySequence::Redo);
       _undo_action->setShortcut (QKeySequence::Undo);
+
     }
   else
     {
--- a/libgui/src/main-window.cc	Thu Apr 03 16:30:05 2014 -0700
+++ b/libgui/src/main-window.cc	Fri Apr 04 11:50:14 2014 -0700
@@ -51,6 +51,7 @@
 #endif
 #include "main-window.h"
 #include "settings-dialog.h"
+#include "shortcut-manager.h"
 
 #include "__init_qt__.h"
 
@@ -680,6 +681,9 @@
   int icon_size = settings->value ("toolbar_icon_size",16).toInt ();
   _main_tool_bar->setIconSize (QSize (icon_size,icon_size));
 
+  set_global_shortcuts (true);
+  set_global_shortcuts (command_window_has_focus ());
+
   resource_manager::update_network_settings ();
 }
 
@@ -1442,15 +1446,15 @@
 
   file_menu->addSeparator ();
 
-  QAction *load_workspace_action
+  _load_workspace_action
     = file_menu->addAction (tr ("Load Workspace..."));
 
-  QAction *save_workspace_action
+  _save_workspace_action
     = file_menu->addAction (tr ("Save Workspace As..."));
 
   file_menu->addSeparator ();
 
-  QAction *preferences_action
+  _preferences_action
     = file_menu->addAction (QIcon (":/actions/icons/configure.png"),
                             tr ("Preferences..."));
 
@@ -1459,7 +1463,7 @@
   _exit_action = file_menu->addAction (tr ("Exit"));
   _exit_action->setShortcutContext (Qt::ApplicationShortcut);
 
-  connect (preferences_action, SIGNAL (triggered ()),
+  connect (_preferences_action, SIGNAL (triggered ()),
            this, SLOT (process_settings_dialog_request ()));
 
 #ifdef HAVE_QSCINTILLA
@@ -1467,10 +1471,10 @@
            editor_window, SLOT (request_open_file ()));
 #endif
 
-  connect (load_workspace_action, SIGNAL (triggered ()),
+  connect (_load_workspace_action, SIGNAL (triggered ()),
            this, SLOT (handle_load_workspace_request ()));
 
-  connect (save_workspace_action, SIGNAL (triggered ()),
+  connect (_save_workspace_action, SIGNAL (triggered ()),
            this, SLOT (handle_save_workspace_request ()));
 
   connect (_exit_action, SIGNAL (triggered ()),
@@ -1491,8 +1495,8 @@
   _new_function_action->setEnabled (true);
   _new_function_action->setShortcutContext (Qt::ApplicationShortcut);
 
-  QAction *new_figure_action = new_menu->addAction (tr ("Figure"));
-  new_figure_action->setEnabled (true);
+  _new_figure_action = new_menu->addAction (tr ("Figure"));
+  _new_figure_action->setEnabled (true);
 
 #ifdef HAVE_QSCINTILLA
   connect (_new_script_action, SIGNAL (triggered ()),
@@ -1502,7 +1506,7 @@
            editor_window, SLOT (request_new_function ()));
 #endif
 
-  connect (new_figure_action, SIGNAL (triggered ()),
+  connect (_new_figure_action, SIGNAL (triggered ()),
            this, SLOT (handle_new_figure_request ()));
 }
 
@@ -1515,22 +1519,18 @@
 
   _undo_action
     = edit_menu->addAction (QIcon (":/actions/icons/undo.png"), tr ("Undo"));
-  _undo_action->setShortcut (QKeySequence::Undo);
 
   edit_menu->addSeparator ();
 
   _copy_action
     = edit_menu->addAction (QIcon (":/actions/icons/editcopy.png"),
                             tr ("Copy"), this, SLOT (copyClipboard ()));
-  _copy_action->setShortcut (QKeySequence::Copy);
-
 
   _paste_action
     = edit_menu->addAction (QIcon (":/actions/icons/editpaste.png"),
                             tr ("Paste"), this, SLOT (pasteClipboard ()));
-  _paste_action->setShortcut (QKeySequence::Paste);
-
-  QAction * select_all_action
+
+  _select_all_action
     = edit_menu->addAction (tr ("Select All"), this, SLOT (selectAll ()));
 
   _clear_clipboard_action
@@ -1543,25 +1543,25 @@
 
   edit_menu->addSeparator ();
 
-  QAction *clear_command_window_action
+  _clear_command_window_action
     = edit_menu->addAction (tr ("Clear Command Window"));
 
-  QAction *clear_command_history
+  _clear_command_history_action
     = edit_menu->addAction (tr ("Clear Command History"));
 
-  QAction *clear_workspace_action
+  _clear_workspace_action
     = edit_menu->addAction (tr ("Clear Workspace"));
 
   connect (_find_files_action, SIGNAL (triggered ()),
            this, SLOT (find_files ()));
 
-  connect (clear_command_window_action, SIGNAL (triggered ()),
+  connect (_clear_command_window_action, SIGNAL (triggered ()),
            this, SLOT (handle_clear_command_window_request ()));
 
-  connect (clear_command_history, SIGNAL (triggered ()),
+  connect (_clear_command_history_action, SIGNAL (triggered ()),
            this, SLOT (handle_clear_history_request ()));
 
-  connect (clear_workspace_action, SIGNAL (triggered ()),
+  connect (_clear_workspace_action, SIGNAL (triggered ()),
            this, SLOT (handle_clear_workspace_request ()));
 
   connect (_clipboard, SIGNAL (changed (QClipboard::Mode)),
@@ -2282,17 +2282,26 @@
   if (set_shortcuts)
     {
 
-      _open_action->setShortcut (QKeySequence::Open);
-      _new_script_action->setShortcut (QKeySequence::New);
-      _new_function_action->setShortcut (Qt::ControlModifier
-                                       + Qt::ShiftModifier
-                                       + Qt::Key_N);
-
-      _exit_action->setShortcut (QKeySequence::Quit);
-
-      _find_files_action->setShortcut (Qt::ControlModifier
-                                       + Qt::ShiftModifier
-                                       + Qt::Key_F);
+      // file menu
+      shortcut_manager::set_shortcut (_open_action, "main_file:open_file");
+      shortcut_manager::set_shortcut (_new_script_action, "main_file:new_file");
+      shortcut_manager::set_shortcut (_new_function_action, "main_file:new_function");
+      shortcut_manager::set_shortcut (_new_function_action, "main_file:new_figure");
+      shortcut_manager::set_shortcut (_load_workspace_action, "main_file:load_workspace");
+      shortcut_manager::set_shortcut (_save_workspace_action, "main_file:save_workspace");
+      shortcut_manager::set_shortcut (_preferences_action, "main_file:preferences");
+      shortcut_manager::set_shortcut (_exit_action,"main_file:exit");
+
+      // edit menu
+      shortcut_manager::set_shortcut (_copy_action, "main_edit:copy");
+      shortcut_manager::set_shortcut (_paste_action, "main_edit:paste");
+      shortcut_manager::set_shortcut (_undo_action, "main_edit:undo");
+      shortcut_manager::set_shortcut (_select_all_action, "main_edit:select_all");
+      shortcut_manager::set_shortcut (_clear_clipboard_action, "main_edit:clear_clipboard");
+      shortcut_manager::set_shortcut (_find_files_action, "main_edit:find_in_files");
+      shortcut_manager::set_shortcut (_clear_command_history_action, "main_edit:clear_history");
+      shortcut_manager::set_shortcut (_clear_command_window_action, "main_edit:clear_command_window");
+      shortcut_manager::set_shortcut (_clear_workspace_action, "main_edit:clear_workspace");
 
     }
   else
@@ -2300,13 +2309,26 @@
 
       QKeySequence no_key = QKeySequence ();
 
+      // file menu
       _open_action->setShortcut (no_key);
       _new_script_action->setShortcut (no_key);
       _new_function_action->setShortcut (no_key);
-
+      _new_function_action->setShortcut (no_key);
+      _load_workspace_action->setShortcut (no_key);
+      _save_workspace_action->setShortcut (no_key);
+      _preferences_action->setShortcut (no_key);
       _exit_action->setShortcut (no_key);
 
+      // edit menu
+      //_copy_action->setShortcut (no_key);
+      //_paste_action->setShortcut (no_key);
+      //_undo_action->setShortcut (no_key);
+      _select_all_action->setShortcut (no_key);
+      _clear_clipboard_action->setShortcut (no_key);
       _find_files_action->setShortcut (no_key);
+      _clear_command_history_action->setShortcut (no_key);
+      _clear_command_window_action->setShortcut (no_key);
+      _clear_workspace_action->setShortcut (no_key);
 
     }
 
--- a/libgui/src/main-window.h	Thu Apr 03 16:30:05 2014 -0700
+++ b/libgui/src/main-window.h	Fri Apr 04 11:50:14 2014 -0700
@@ -315,14 +315,21 @@
   QAction *_new_script_action;
   QAction *_new_function_action;
   QAction *_open_action;
+  QAction *_new_figure_action;
+  QAction *_load_workspace_action;
+  QAction *_save_workspace_action;
+  QAction *_preferences_action;
+  QAction *_exit_action;
 
   QAction *_copy_action;
   QAction *_paste_action;
   QAction *_clear_clipboard_action;
   QAction *_undo_action;
-
+  QAction *_clear_command_window_action;
+  QAction *_clear_command_history_action;
+  QAction *_clear_workspace_action;
   QAction *_find_files_action;
-  QAction *_exit_action;
+  QAction *_select_all_action;
 
   // Toolbars.
   QComboBox *_current_directory_combo_box;
--- a/libgui/src/module.mk	Thu Apr 03 16:30:05 2014 -0700
+++ b/libgui/src/module.mk	Fri Apr 04 11:50:14 2014 -0700
@@ -96,6 +96,7 @@
   src/moc-terminal-dock-widget.cc \
   src/moc-color-picker.cc \
   src/moc-resource-manager.cc \
+  src/moc-shortcut-manager.cc \
   src/moc-welcome-wizard.cc \
   src/moc-workspace-model.cc \
   src/moc-workspace-view.cc \
@@ -133,6 +134,7 @@
   src/qtinfo/webinfo.h \
   src/resource-manager.h \
   src/settings-dialog.h \
+  src/shortcut-manager.h \
   src/thread-manager.h \
   src/terminal-dock-widget.h \
   src/color-picker.h \
@@ -160,6 +162,7 @@
   src/qtinfo/webinfo.cc \
   src/resource-manager.cc \
   src/settings-dialog.cc \
+  src/shortcut-manager.cc \
   src/thread-manager.cc \
   src/terminal-dock-widget.cc \
   src/color-picker.cc \
--- a/libgui/src/octave-gui.cc	Thu Apr 03 16:30:05 2014 -0700
+++ b/libgui/src/octave-gui.cc	Fri Apr 04 11:50:14 2014 -0700
@@ -48,6 +48,7 @@
 
 #include "welcome-wizard.h"
 #include "resource-manager.h"
+#include "shortcut-manager.h"
 #include "main-window.h"
 #include "octave-gui.h"
 #include "thread-manager.h"
@@ -85,42 +86,11 @@
   int m_result;
 };
 
-#if ! defined (__WIN32__) || defined (__CYGWIN__)
-static int fdstderr = -1;
-#endif
+// Disable all Qt messages by default.
 
-// Custom message handler for filtering some messages from Qt.
-
-void
+static void
 message_handler (QtMsgType type, const char *msg)
 {
-#if ! defined (__WIN32__) || defined (__CYGWIN__)
-  static FILE *errstream = fdopen (fdstderr, "a+");
-#else
-  static FILE *errstream = stderr;
-#endif
-
-  switch (type)
-    {
-    case QtDebugMsg:
-      gnulib::fprintf (errstream, "Debug: %s\n", msg);
-      break;
-
-    case QtWarningMsg:
-      gnulib::fprintf (errstream, "Warning: %s\n", msg);
-      break;
-
-    case QtCriticalMsg:
-      gnulib::fprintf (errstream, "Critical: %s\n", msg);
-      break;
-
-    case QtFatalMsg:
-      gnulib::fprintf (errstream, "Fatal: %s\n", msg);
-      abort ();
-
-    default:
-      break;
-    }
 }
 
 // If START_GUI is false, we still set up the QApplication so that we
@@ -131,14 +101,11 @@
 {
   octave_thread_manager::block_interrupt_signal ();
 
-#if ! defined (__WIN32__) || defined (__CYGWIN__)
-  // Store the file descriptor associated with the STDERR stream.  Send
-  // Qt messages there instead of to the STDERR stream that will be
-  // associated with the GUI command window.
-  fdstderr = gnulib::dup (STDERR_FILENO);
-#endif
+  std::string show_gui_msgs = octave_env::getenv ("OCTAVE_SHOW_GUI_MESSAGES");
 
-  qInstallMsgHandler (message_handler);
+  // Installing our handler suppresses the messages.
+  if (show_gui_msgs.empty ())
+    qInstallMsgHandler (message_handler);
 
   if (start_gui)
     {
@@ -192,6 +159,9 @@
         octave_env::putenv ("TERM", "cygwin");
 #endif
 
+      // shortcut manager
+      shortcut_manager::init_data ();
+
       // Create and show main window.
 
       main_window w;
--- a/libgui/src/settings-dialog.cc	Thu Apr 03 16:30:05 2014 -0700
+++ b/libgui/src/settings-dialog.cc	Fri Apr 04 11:50:14 2014 -0700
@@ -25,6 +25,7 @@
 #endif
 
 #include "resource-manager.h"
+#include "shortcut-manager.h"
 #include "workspace-model.h"
 #include "settings-dialog.h"
 #include "ui-settings-dialog.h"
@@ -57,6 +58,8 @@
 {
   ui->setupUi (this);
 
+  shortcut_manager::fill_treewidget (ui->shortcuts_treewidget);
+
   QSettings *settings = resource_manager::get_settings ();
 
   // restore last geometry
@@ -191,6 +194,8 @@
     settings->value ("terminal/fontName","Courier New").toString ()) );
   ui->terminal_fontSize->setValue (
     settings->value ("terminal/fontSize", 10).toInt ());
+  ui->terminal_history_buffer->setValue (
+     settings->value ("terminal/history_buffer",1000).toInt ());
 
   // file browser
   ui->showFileSize->setChecked (
@@ -626,6 +631,8 @@
                       ui->terminal_cursorUseForegroundColor->isChecked ());
   settings->setValue ("terminal/focus_after_command",
                       ui->terminal_focus_command->isChecked ());
+  settings->setValue ("terminal/history_buffer",
+                      ui->terminal_history_buffer->value() );
 
   // the cursor
   QString cursorType;
@@ -671,6 +678,8 @@
 
   write_terminal_colors (settings);
 
+  shortcut_manager::write_shortcuts ();
+
   settings->setValue ("settings/last_tab",ui->tabWidget->currentIndex ());
   settings->setValue ("settings/geometry",saveGeometry ());
   settings->sync ();
--- a/libgui/src/settings-dialog.ui	Thu Apr 03 16:30:05 2014 -0700
+++ b/libgui/src/settings-dialog.ui	Fri Apr 04 11:50:14 2014 -0700
@@ -32,7 +32,7 @@
       </size>
      </property>
      <property name="currentIndex">
-      <number>1</number>
+      <number>6</number>
      </property>
      <widget class="QWidget" name="tab_general">
       <property name="enabled">
@@ -1165,6 +1165,12 @@
             <layout class="QVBoxLayout" name="verticalLayout_8">
              <item>
               <layout class="QGridLayout" name="gridLayout_7">
+               <property name="sizeHint" stdset="0">
+                <size>
+                 <width>40</width>
+                 <height>20</height>
+                </size>
+               </property>
                <item row="1" column="2">
                 <layout class="QHBoxLayout" name="horizontalLayout_13">
                  <item>
@@ -1255,6 +1261,62 @@
                  </item>
                 </layout>
                </item>
+               <item row="2" column="2">
+                <layout class="QHBoxLayout" name="horizontalLayout_5">
+                 <property name="topMargin">
+                  <number>0</number>
+                 </property>
+                 <item>
+                  <widget class="QSpinBox" name="terminal_history_buffer">
+                   <property name="minimum">
+                    <number>0</number>
+                   </property>
+                   <property name="maximum">
+                    <number>5000</number>
+                   </property>
+                   <property name="singleStep">
+                    <number>20</number>
+                   </property>
+                   <property name="value">
+                    <number>1000</number>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <widget class="QLabel" name="label_20">
+                   <property name="text">
+                    <string>(Changing buffer size clears history)</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <spacer name="horizontalSpacer_16">
+                   <property name="orientation">
+                    <enum>Qt::Horizontal</enum>
+                   </property>
+                   <property name="sizeHint" stdset="0">
+                    <size>
+                     <width>40</width>
+                     <height>20</height>
+                    </size>
+                   </property>
+                  </spacer>
+                 </item>
+                </layout>
+               </item>
+               <item row="2" column="0">
+                <widget class="QLabel" name="label_19">
+                 <property name="minimumSize">
+                  <size>
+                   <width>100</width>
+                   <height>20</height>
+                  </size>
+                 </property>
+                 <property name="text">
+                  <string>History buffer Size</string>
+                 </property>
+                </widget>
+               </item>
                <item row="0" column="1">
                 <spacer name="horizontalSpacer_28">
                  <property name="orientation">
@@ -1271,19 +1333,6 @@
                  </property>
                 </spacer>
                </item>
-               <item row="1" column="3">
-                <spacer name="horizontalSpacer_26">
-                 <property name="orientation">
-                  <enum>Qt::Horizontal</enum>
-                 </property>
-                 <property name="sizeHint" stdset="0">
-                  <size>
-                   <width>40</width>
-                   <height>20</height>
-                  </size>
-                 </property>
-                </spacer>
-               </item>
               </layout>
              </item>
              <item>
@@ -1340,6 +1389,9 @@
              <property name="orientation">
               <enum>Qt::Vertical</enum>
              </property>
+             <property name="sizeType">
+              <enum>QSizePolicy::Expanding</enum>
+             </property>
              <property name="sizeHint" stdset="0">
               <size>
                <width>20</width>
@@ -1596,6 +1648,132 @@
        </item>
       </layout>
      </widget>
+     <widget class="QWidget" name="tab_shortcuts">
+      <attribute name="title">
+       <string>Shortcuts</string>
+      </attribute>
+      <layout class="QVBoxLayout" name="verticalLayout_27">
+       <item>
+        <widget class="QScrollArea" name="scrollArea_7">
+         <property name="widgetResizable">
+          <bool>true</bool>
+         </property>
+         <widget class="QWidget" name="scrollAreaWidgetContents_8">
+          <property name="geometry">
+           <rect>
+            <x>0</x>
+            <y>0</y>
+            <width>678</width>
+            <height>378</height>
+           </rect>
+          </property>
+          <layout class="QVBoxLayout" name="verticalLayout_25">
+           <item>
+            <layout class="QVBoxLayout" name="verticalLayout_26">
+             <property name="sizeConstraint">
+              <enum>QLayout::SetDefaultConstraint</enum>
+             </property>
+             <property name="topMargin">
+              <number>0</number>
+             </property>
+             <item>
+              <widget class="QLabel" name="label_21">
+               <property name="text">
+                <string>Enter a new shortcut by double clicking on the related row.</string>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <layout class="QHBoxLayout" name="horizontalLayout_10">
+               <property name="topMargin">
+                <number>0</number>
+               </property>
+               <item>
+                <widget class="QTreeWidget" name="shortcuts_treewidget">
+                 <property name="sizePolicy">
+                  <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+                   <horstretch>0</horstretch>
+                   <verstretch>0</verstretch>
+                  </sizepolicy>
+                 </property>
+                 <property name="sizeIncrement">
+                  <size>
+                   <width>0</width>
+                   <height>0</height>
+                  </size>
+                 </property>
+                 <property name="baseSize">
+                  <size>
+                   <width>0</width>
+                   <height>0</height>
+                  </size>
+                 </property>
+                 <property name="lineWidth">
+                  <number>0</number>
+                 </property>
+                 <property name="alternatingRowColors">
+                  <bool>true</bool>
+                 </property>
+                 <property name="animated">
+                  <bool>false</bool>
+                 </property>
+                 <property name="allColumnsShowFocus">
+                  <bool>false</bool>
+                 </property>
+                 <property name="headerHidden">
+                  <bool>false</bool>
+                 </property>
+                 <property name="columnCount">
+                  <number>3</number>
+                 </property>
+                 <attribute name="headerCascadingSectionResizes">
+                  <bool>false</bool>
+                 </attribute>
+                 <attribute name="headerDefaultSectionSize">
+                  <number>120</number>
+                 </attribute>
+                 <attribute name="headerHighlightSections">
+                  <bool>false</bool>
+                 </attribute>
+                 <attribute name="headerMinimumSectionSize">
+                  <number>64</number>
+                 </attribute>
+                 <attribute name="headerStretchLastSection">
+                  <bool>true</bool>
+                 </attribute>
+                 <column>
+                  <property name="text">
+                   <string>Action</string>
+                  </property>
+                 </column>
+                 <column>
+                  <property name="text">
+                   <string>Default Shortcut</string>
+                  </property>
+                  <property name="textAlignment">
+                   <set>AlignLeft|AlignVCenter</set>
+                  </property>
+                 </column>
+                 <column>
+                  <property name="text">
+                   <string>Actual Shortcut</string>
+                  </property>
+                  <property name="textAlignment">
+                   <set>AlignLeft|AlignVCenter</set>
+                  </property>
+                 </column>
+                </widget>
+               </item>
+              </layout>
+             </item>
+            </layout>
+           </item>
+          </layout>
+         </widget>
+        </widget>
+       </item>
+      </layout>
+     </widget>
      <widget class="QWidget" name="tab_network">
       <attribute name="title">
        <string>Network</string>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libgui/src/shortcut-manager.cc	Fri Apr 04 11:50:14 2014 -0700
@@ -0,0 +1,402 @@
+/*
+
+Copyright (C) 2014 Torsten <ttl@justmail.de>
+
+This file is part of Octave.
+
+Octave is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 3 of the License, or (at your
+option) any later version.
+
+Octave is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with Octave; see the file COPYING.  If not, see
+<http://www.gnu.org/licenses/>.
+
+*/
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <QMessageBox>
+#include <QDebug>
+#include <QGridLayout>
+#include <QVBoxLayout>
+#include <QDialogButtonBox>
+#include <QPushButton>
+#include <QLineEdit>
+#include <QCheckBox>
+#include <QHeaderView>
+#include <QAction>
+
+#include "error.h"
+#include "resource-manager.h"
+#include "shortcut-manager.h"
+#include "singleton-cleanup.h"
+
+shortcut_manager *shortcut_manager::instance = 0;
+
+shortcut_manager::shortcut_manager ()
+{
+  setObjectName ("Shortcut_Manager");
+}
+
+shortcut_manager::~shortcut_manager ()
+{
+}
+
+bool
+shortcut_manager::instance_ok (void)
+{
+  bool retval = true;
+
+  if (! instance)
+    {
+      instance = new shortcut_manager ();
+
+      if (instance)
+        singleton_cleanup_list::add (cleanup_instance);
+    }
+
+  if (! instance)
+    {
+      ::error ("unable to create shortcut_manager object!");
+
+      retval = false;
+    }
+
+  return retval;
+}
+
+void
+shortcut_manager::do_init_data ()
+{
+  // actions of the main window
+  init (tr ("New File"), "main_file:new_file", QKeySequence::New );
+  init (tr ("New Function"), "main_file:new_function", QKeySequence ("Ctrl+Shift+N") );
+  init (tr ("New Figure"), "main_file:new_figure", QKeySequence () );
+  init (tr ("Open File"), "main_file:open_file", QKeySequence::Open );
+  init (tr ("Load Workspace"), "main_file:load_workspace", QKeySequence () );
+  init (tr ("Save Workspace As"), "main_file:save_workspace", QKeySequence () );
+  init (tr ("Preferences"), "main_file:preferences", QKeySequence () );
+  init (tr ("Exit Octave"), "main_file:exit", QKeySequence::Quit );
+
+  init (tr ("Copy"), "main_edit:copy", QKeySequence::Copy);
+  init (tr ("Paste"), "main_edit:paste", QKeySequence::Paste);
+  init (tr ("Undo"), "main_edit:undo", QKeySequence::Undo);
+  init (tr ("Select All"), "main_edit:select_all", QKeySequence () );
+  init (tr ("Clear Clipboard"), "main_edit:clear_clipboard", QKeySequence () );
+  init (tr ("Find in Files"), "main_edit:find_in_files", QKeySequence (Qt::ControlModifier + Qt::ShiftModifier + Qt::Key_F) );
+  init (tr ("Clear Command Window"), "main_edit:clear_command_window", QKeySequence () );
+  init (tr ("Clear Command History"), "main_edit:clear_history", QKeySequence () );
+  init (tr ("Clear Workspace"), "main_edit:clear_workspace", QKeySequence () );
+
+  // actions of the editor
+  init (tr ("Save File"), "editor_file:save", QKeySequence::Save );
+  init (tr ("Save File As"), "editor_file:save_as", QKeySequence::SaveAs );
+}
+
+void
+shortcut_manager::init (QString description, QString key, QKeySequence def_sc)
+{
+  QSettings *settings = resource_manager::get_settings ();
+
+  settings->beginGroup ("shortcuts");
+  QKeySequence actual = QKeySequence (settings->value (key, def_sc).toString ());
+  settings->endGroup ();
+
+  shortcut_t shortcut_info;
+  shortcut_info.description = description;
+  shortcut_info.settings_key = key;
+  shortcut_info.actual_sc = actual;
+  shortcut_info.default_sc = def_sc;
+  _sc << shortcut_info;
+
+  if (! actual.isEmpty ())
+    _shortcut_hash[actual] = _sc.count ();  // offset of 1 to avoid 0
+  _action_hash[key] = _sc.count ();  // offset of 1 to avoid 0
+}
+
+void
+shortcut_manager::do_fill_treewidget (QTreeWidget *tree_view)
+{
+  _dialog = 0;
+  _level_hash.clear ();
+
+  tree_view->header ()->setResizeMode (QHeaderView::ResizeToContents);
+
+  QTreeWidgetItem *main = new QTreeWidgetItem (tree_view);
+  main->setText (0, tr ("Main"));
+  main->setExpanded (true);
+  QTreeWidgetItem *main_file = new QTreeWidgetItem (main);
+  main_file->setText (0, tr ("File"));
+  QTreeWidgetItem *main_edit = new QTreeWidgetItem (main);
+  main_edit->setText (0, tr ("Edit"));
+  QTreeWidgetItem *main_debug = new QTreeWidgetItem (main);
+  main_debug->setText (0, tr ("Debug"));
+  QTreeWidgetItem *main_window = new QTreeWidgetItem (main);
+  main_window->setText (0, tr ("Window"));
+  QTreeWidgetItem *main_help = new QTreeWidgetItem (main);
+  main_help->setText (0, tr ("Help"));
+  QTreeWidgetItem *main_news = new QTreeWidgetItem (main);
+  main_news->setText (0, tr ("News"));
+
+  _level_hash["main_file"]   = main_file;
+  _level_hash["main_edit"]   = main_edit;
+  _level_hash["main_debug"]   = main_debug;
+  _level_hash["main_window"]   = main_window;
+  _level_hash["main_help"]   = main_help;
+  _level_hash["main_news"]   = main_news;
+
+  QTreeWidgetItem *editor = new QTreeWidgetItem (tree_view);
+  editor->setText (0, tr ("Editor"));
+  editor->setExpanded (true);
+  QTreeWidgetItem *editor_file = new QTreeWidgetItem (editor);
+  editor_file->setText (0, tr ("File"));
+  QTreeWidgetItem *editor_edit = new QTreeWidgetItem (editor);
+  editor_edit->setText (0, tr ("Edit"));
+  QTreeWidgetItem *editor_view = new QTreeWidgetItem (editor);
+  editor_view->setText (0, tr ("View"));
+  QTreeWidgetItem *editor_debug = new QTreeWidgetItem (editor);
+  editor_debug->setText (0, tr ("Debug"));
+  QTreeWidgetItem *editor_run = new QTreeWidgetItem (editor);
+  editor_run->setText (0, tr ("Run"));
+  QTreeWidgetItem *editor_help = new QTreeWidgetItem (editor);
+  editor_help->setText (0, tr ("Help"));
+
+  _level_hash["editor_file"] = editor_file;
+  _level_hash["editor_edit"] = editor_edit;
+  _level_hash["editor_view"] = editor_view;
+  _level_hash["editor_debug"] = editor_debug;
+  _level_hash["editor_run"] = editor_run;
+  _level_hash["editor_help"] = editor_help;
+
+  connect (tree_view, SIGNAL (itemDoubleClicked (QTreeWidgetItem*, int)),
+           this, SLOT (handle_double_clicked (QTreeWidgetItem*, int)));
+
+  for (int i = 0; i < _sc.count (); i++)
+    {
+      shortcut_t shortcut_info = _sc.at (i);
+
+      QTreeWidgetItem* section = _level_hash[shortcut_info.settings_key.section(':',0,0)];
+      QTreeWidgetItem* tree_item = new QTreeWidgetItem (section);
+
+      tree_item->setText (0, shortcut_info.description);
+      tree_item->setText (1, shortcut_info.default_sc);
+      tree_item->setText (2, shortcut_info.actual_sc);
+
+      _item_index_hash[tree_item] = i + 1; // index+1 to avoid 0
+      _index_item_hash[i] = tree_item;
+    }
+}
+
+void
+shortcut_manager::do_write_shortcuts ()
+{
+  QSettings *settings = resource_manager::get_settings ();
+
+  settings->beginGroup ("shortcuts");
+  for (int i = 0; i < _sc.count (); i++)
+    settings->setValue(_sc.at (i).settings_key, _sc.at (i).actual_sc.toString ());
+  settings->endGroup ();
+
+  settings->sync ();
+
+  delete _dialog;
+}
+
+void
+shortcut_manager::do_set_shortcut (QAction* action, const QString& key)
+{
+  QSettings *settings = resource_manager::get_settings ();
+
+  int index = _action_hash[key] - 1;
+
+  action->setShortcut (
+    settings->value ("shortcuts/" + key, _sc.at (index).default_sc).toString ());
+}
+
+void
+shortcut_manager::handle_double_clicked (QTreeWidgetItem* item, int)
+{
+  int i = _item_index_hash[item];
+  if (i == 0)
+    return;  // top-level-item clicked
+
+  shortcut_dialog (i-1); // correct to index starting at 0
+}
+
+void
+shortcut_manager::shortcut_dialog (int index)
+{
+  if (! _dialog)
+    {
+      _dialog = new QDialog (this);
+
+      _dialog->setWindowTitle (tr ("Enter new Shortcut"));
+
+      QVBoxLayout *box = new QVBoxLayout(_dialog);
+
+      QLabel *help = new QLabel (tr ("Apply the desired shortcut or click "
+                                     "on the right button to reset the "
+                                     "shortcut to its default."));
+      help->setWordWrap (true);
+      box->addWidget (help);
+
+      QCheckBox *direct = new QCheckBox (tr ("Enter shortcut directly by performing it"));
+      direct->setCheckState (Qt::Checked);
+      box->addWidget (direct);
+
+      QGridLayout *grid = new QGridLayout();
+
+      QLabel *actual = new QLabel (tr ("Actual shortcut"));
+      _edit_actual = new enter_shortcut (_dialog);
+      _edit_actual->setAlignment (Qt::AlignHCenter);
+      grid->addWidget (actual, 0, 0);
+      grid->addWidget (_edit_actual, 0, 1);
+
+      QLabel *def = new QLabel (tr ("Default shortcut"));
+      _label_default = new QLabel (_dialog);
+      _label_default->setAlignment (Qt::AlignHCenter);
+      grid->addWidget (def, 1, 0);
+      grid->addWidget (_label_default, 1, 1);
+
+      QPushButton *set_default = new QPushButton (tr ("Set to default"));
+      grid->addWidget (set_default, 0, 2);
+      connect (set_default, SIGNAL (clicked ()),
+               this, SLOT (shortcut_dialog_set_default ()));
+
+      box->addLayout (grid);
+
+      QDialogButtonBox *button_box = new QDialogButtonBox (QDialogButtonBox::Ok
+                                                   | QDialogButtonBox::Cancel);
+      QList<QAbstractButton *> buttons = button_box->buttons ();
+      for (int i = 0; i < buttons.count (); i++)
+        buttons.at (i)->setShortcut (QKeySequence ());
+      connect(button_box, SIGNAL (accepted ()), _dialog, SLOT (accept ()));
+      connect(button_box, SIGNAL (rejected ()), _dialog, SLOT (reject ()));
+      box->addWidget (button_box);
+
+      _dialog->setLayout (box);
+
+      connect (direct, SIGNAL (stateChanged (int)),
+               _edit_actual, SLOT (handle_direct_shortcut (int)));
+      connect (_dialog, SIGNAL (finished (int)),
+               this, SLOT (shortcut_dialog_finished (int)));
+
+    }
+
+  _edit_actual->setText (_sc.at (index).actual_sc);
+  _label_default->setText (_sc.at (index).default_sc);
+  _handled_index = index;
+
+  _edit_actual->setFocus ();
+  _dialog->setFocusProxy (_edit_actual);
+  _dialog->exec ();
+}
+
+void
+shortcut_manager::shortcut_dialog_finished (int result)
+{
+  if (result == QDialog::Rejected)
+    return;
+
+  int double_index = _shortcut_hash[_edit_actual->text()] - 1;
+
+  if (double_index >= 0 && double_index != _handled_index)
+    {
+      int ret = QMessageBox::warning(this, tr("Double Shortcut"),
+                  tr ("The chosen shortcut\n  \"%1\"\n"
+                      "is already used for the action\n  \"%2\".\n"
+                      "Do you want to use the shortcut anyhow removing it "
+                      "from the previous action?")
+                     .arg (_edit_actual->text())
+                     .arg (_sc.at (double_index).description),
+                  QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes);
+
+      if (ret == QMessageBox::Yes)
+        {
+          shortcut_t double_shortcut = _sc.at (double_index);
+          double_shortcut.actual_sc = QKeySequence ();
+          _sc.replace (double_index, double_shortcut);
+          _index_item_hash[double_index]->setText (1, QKeySequence ());
+        }
+      else
+        return;
+    }
+
+  shortcut_t shortcut = _sc.at (_handled_index);
+  if (! shortcut.actual_sc.isEmpty ())
+    _shortcut_hash.remove (shortcut.actual_sc);
+  shortcut.actual_sc = _edit_actual->text();
+  _sc.replace (_handled_index, shortcut);
+
+  _index_item_hash[_handled_index]->setText (2, shortcut.actual_sc);
+
+  if (! shortcut.actual_sc.isEmpty ())
+    _shortcut_hash[shortcut.actual_sc] = _handled_index + 1; // index+1 to avoid 0
+}
+
+void
+shortcut_manager::shortcut_dialog_set_default ()
+{
+  _edit_actual->setText (_label_default->text ());
+}
+
+
+
+enter_shortcut::enter_shortcut (QWidget *p) : QLineEdit (p)
+{
+  _direct_shortcut = true;
+}
+
+enter_shortcut::~enter_shortcut ()
+{
+}
+
+void
+enter_shortcut::handle_direct_shortcut (int state)
+{
+  if (state)
+    _direct_shortcut = true;
+  else
+    _direct_shortcut = false;
+}
+
+void
+enter_shortcut::keyPressEvent (QKeyEvent *e)
+{
+  if (! _direct_shortcut)
+    {
+      QLineEdit::keyPressEvent (e);
+      return;
+    }
+
+  if (e->type () == QEvent::KeyPress)
+    {
+      int key = e->key ();
+
+      if (key == Qt::Key_unknown || key == 0 || key >= 16777248)
+        return;
+
+      Qt::KeyboardModifiers modifiers = e->modifiers ();
+
+      if(modifiers & Qt::ShiftModifier)
+        key += Qt::SHIFT;
+      if(modifiers & Qt::ControlModifier)
+        key += Qt::CTRL;
+      if(modifiers & Qt::AltModifier)
+        key += Qt::ALT;
+      if(modifiers & Qt::MetaModifier)
+        key += Qt::META;
+
+      setText (QKeySequence(key));
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libgui/src/shortcut-manager.h	Fri Apr 04 11:50:14 2014 -0700
@@ -0,0 +1,139 @@
+/*
+
+Copyright (C) 2014 Torsten <ttl@justmail.de>
+
+This file is part of Octave.
+
+Octave is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 3 of the License, or (at your
+option) any later version.
+
+Octave is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with Octave; see the file COPYING.  If not, see
+<http://www.gnu.org/licenses/>.
+
+*/
+
+#ifndef SHORTCUT_MANAGER_H
+#define SHORTCUT_MANAGER_H
+
+#include <QWidget>
+#include <QTreeWidget>
+#include <QLineEdit>
+#include <QKeyEvent>
+#include <QLabel>
+
+
+class enter_shortcut : public QLineEdit
+{
+  Q_OBJECT
+
+public:
+  enter_shortcut (QWidget *p = 0);
+  ~enter_shortcut ();
+
+  virtual void  keyPressEvent (QKeyEvent *e);
+
+public slots:
+  void handle_direct_shortcut (int);
+
+private:
+  bool _direct_shortcut;
+
+};
+
+
+class shortcut_manager : public QWidget
+{
+  Q_OBJECT
+
+public:
+  shortcut_manager ();
+  ~shortcut_manager ();
+
+  static void init_data ()
+  {
+    if (instance_ok ())
+      instance->do_init_data ();
+  }
+
+  static void write_shortcuts ()
+  {
+    if (instance_ok ())
+      instance->do_write_shortcuts ();
+  }
+
+  static void set_shortcut (QAction *action, const QString& key)
+  {
+    if (instance_ok ())
+      instance->do_set_shortcut (action, key);
+  }
+
+  static void fill_treewidget (QTreeWidget *tree_view)
+  {
+    if (instance_ok ())
+      instance->do_fill_treewidget (tree_view);
+  }
+
+public slots:
+
+signals:
+
+protected:
+
+protected slots:
+
+  void handle_double_clicked (QTreeWidgetItem*, int);
+  void shortcut_dialog_finished (int);
+  void shortcut_dialog_set_default ();
+
+private:
+
+  static shortcut_manager *instance;
+  static void cleanup_instance (void) { delete instance; instance = 0; }
+
+  // No copying!
+
+  shortcut_manager (const shortcut_manager&);
+  shortcut_manager& operator = (const shortcut_manager&);
+
+  static bool instance_ok (void);
+
+  void init (QString, QString, QKeySequence);
+  void do_init_data ();
+  void do_write_shortcuts ();
+  void do_set_shortcut (QAction *action, const QString& key);
+  void do_fill_treewidget (QTreeWidget *tree_view);
+  void shortcut_dialog (int);
+
+  struct shortcut_t
+  {
+    QString description;
+    QString settings_key;
+    QKeySequence actual_sc;
+    QKeySequence default_sc;
+    QTreeWidgetItem *tree_item;
+  };
+
+  QList<shortcut_t> _sc;
+  QHash<QString, int> _shortcut_hash;
+  QHash<QString, int> _action_hash;
+  QHash <QString, QTreeWidgetItem*> _level_hash;
+  QHash<int, QTreeWidgetItem*> _index_item_hash;
+  QHash<QTreeWidgetItem*, int> _item_index_hash;
+
+  QDialog *_dialog;
+  enter_shortcut *_edit_actual;
+  QLabel *_label_default;
+  int _handled_index;
+
+};
+
+
+#endif // SHORTCUT_MANAGER_H
--- a/libinterp/corefcn/oct-stream.cc	Thu Apr 03 16:30:05 2014 -0700
+++ b/libinterp/corefcn/oct-stream.cc	Fri Apr 04 11:50:14 2014 -0700
@@ -3394,6 +3394,18 @@
 
 template <class T, class V>
 static void
+convert_chars (const void *data, void *conv_data, octave_idx_type n_elts)
+{
+  const T *tt_data = static_cast<const T *> (data);
+
+  V *vt_data = static_cast<V *> (conv_data);
+
+  for (octave_idx_type i = 0; i < n_elts; i++)
+    vt_data[i] = tt_data[i];
+}
+
+template <class T, class V>
+static void
 convert_ints (const T *data, void *conv_data, octave_idx_type n_elts,
               bool swap)
 {
@@ -3403,6 +3415,9 @@
 
   for (octave_idx_type i = 0; i < n_elts; i++)
     {
+      // Yes, we want saturation semantics when converting to an integer
+      // type.
+
       V val (data[i]);
 
       vt_data[i] = val.value ();
@@ -3413,6 +3428,20 @@
 }
 
 template <class T>
+class ultimate_element_type
+{
+public:
+  typedef T type;
+};
+
+template <class T>
+class ultimate_element_type<octave_int<T> >
+{
+public:
+  typedef T type;
+};
+
+template <class T>
 static bool
 convert_data (const T *data, void *conv_data, octave_idx_type n_elts,
               oct_data_conv::data_type output_type,
@@ -3427,18 +3456,26 @@
 
   bool do_float_conversion =  flt_fmt != oct_mach_info::float_format ();
 
-  // We use octave_intN classes here instead of converting directly to
-  // intN_t so that we get integer saturation semantics.
+  typedef typename ultimate_element_type<T>::type ult_elt_type;
 
   switch (output_type)
     {
     case oct_data_conv::dt_char:
+      convert_chars<ult_elt_type, char> (data, conv_data, n_elts);
+      break;
+
     case oct_data_conv::dt_schar:
+      convert_chars<ult_elt_type, signed char> (data, conv_data, n_elts);
+      break;
+
+    case oct_data_conv::dt_uchar:
+      convert_chars<ult_elt_type, unsigned char> (data, conv_data, n_elts);
+      break;
+
     case oct_data_conv::dt_int8:
       convert_ints<T, octave_int8> (data, conv_data, n_elts, swap);
       break;
 
-    case oct_data_conv::dt_uchar:
     case oct_data_conv::dt_uint8:
       convert_ints<T, octave_uint8> (data, conv_data, n_elts, swap);
       break;
--- a/libinterp/dldfcn/__init_fltk__.cc	Thu Apr 03 16:30:05 2014 -0700
+++ b/libinterp/dldfcn/__init_fltk__.cc	Fri Apr 04 11:50:14 2014 -0700
@@ -42,6 +42,10 @@
 
 #ifdef HAVE_FLTK
 
+#if defined (HAVE_X_WINDOWS)
+#include <X11/Xlib.h>
+#endif
+
 #include <map>
 #include <set>
 #include <sstream>
@@ -73,6 +77,7 @@
 
 #include "cmd-edit.h"
 #include "lo-ieee.h"
+#include "oct-env.h"
 
 #include "display.h"
 #include "file-ops.h"
@@ -674,6 +679,14 @@
   Fl_Menu_Bar* menubar;
 };
 
+#if defined (HAVE_X_WINDOWS)
+static int
+xerror_handler (Display *, XErrorEvent *)
+{
+  return 0;
+}
+#endif
+
 class plot_window : public Fl_Window
 {
   friend class fltk_uimenu;
@@ -762,7 +775,18 @@
           // Set WM_CLASS which allows window managers to properly group
           // related windows.  Otherwise, the class is just "FLTK"
           xclass ("Octave");
+
           show ();
+
+#if defined (HAVE_X_WINDOWS)
+          std::string show_gui_msgs
+            = octave_env::getenv ("OCTAVE_SHOW_GUI_MESSAGES");
+
+          // Installing our handler suppresses the messages.
+          if (show_gui_msgs.empty ())
+            XSetErrorHandler (xerror_handler);
+#endif
+
           if (fp.get_currentaxes ().ok ())
             show_canvas ();
           else
--- a/scripts/image/imread.m	Thu Apr 03 16:30:05 2014 -0700
+++ b/scripts/image/imread.m	Fri Apr 04 11:50:14 2014 -0700
@@ -75,7 +75,17 @@
 ## Controls the image region that is read.  Takes as value a cell array
 ## with two arrays of 3 elements @code{@{@var{rows} @var{cols}@}}.  The
 ## elements in the array are the start, increment and end pixel to be
-## read.  If the increment value is omitted, defaults to 1.
+## read.  If the increment value is omitted, defaults to 1.  For example,
+## the following are all equivalent:
+##
+## @example
+## @group
+## imread (filename, "PixelRegion", @{[200 600] [300 700]@});
+## imread (filename, "PixelRegion", @{[200 1 600] [300 1 700]@});
+## imread (filename)(200:600, 300:700);
+## @end group
+## @end example
+##
 ## @end table
 ##
 ## @seealso{imwrite, imfinfo, imformats}
@@ -130,6 +140,24 @@
 %! assert (A(:,:,2), uint8 ([0, 255, 0; 255,  28, 255; 0, 255, 0]));
 %! assert (A(:,:,3), uint8 ([0, 255, 0; 255,  36, 255; 0, 255, 0]));
 
+%!function [r, cmap, a] = write_and_read (w, varargin)
+%!  filename = [tmpnam() ".tif"];
+%!  unwind_protect
+%!    imwrite (w, filename);
+%!    [r, cmap, a] = imread (filename, varargin{:});
+%!  unwind_protect_cleanup
+%!    unlink (filename);
+%!  end_unwind_protect
+%!endfunction
+
+## test PixelRegion option
+%!testif HAVE_MAGICK
+%! w = randi (255, 100, 100, "uint8");
+%! [r, cmap, a] = write_and_read (w, "PixelRegion", {[50 70] [20 40]});
+%! assert (r, w(50:70, 20:40))
+%! [r, cmap, a] = write_and_read (w, "PixelRegion", {[50 2 70] [20 3 40]});
+%! assert (r, w(50:2:70, 20:3:40))
+
 ## If a file does not exist, it's the job of imread to check the file
 ## exists before sending it over to __imread__ or whatever function
 ## is defined in imformats to handle that specific format.  This is the
--- a/scripts/optimization/fminunc.m	Thu Apr 03 16:30:05 2014 -0700
+++ b/scripts/optimization/fminunc.m	Fri Apr 04 11:50:14 2014 -0700
@@ -21,16 +21,16 @@
 ## -*- texinfo -*-
 ## @deftypefn  {Function File} {} fminunc (@var{fcn}, @var{x0})
 ## @deftypefnx {Function File} {} fminunc (@var{fcn}, @var{x0}, @var{options})
-## @deftypefnx {Function File} {[@var{x}, @var{fvec}, @var{info}, @var{output}, @var{grad}, @var{hess}] =} fminunc (@var{fcn}, @dots{})
+## @deftypefnx {Function File} {[@var{x}, @var{fval}, @var{info}, @var{output}, @var{grad}, @var{hess}] =} fminunc (@var{fcn}, @dots{})
 ## Solve an unconstrained optimization problem defined by the function
 ## @var{fcn}.
 ##
-## @var{fcn} should accepts a vector (array) defining the unknown variables,
+## @var{fcn} should accept a vector (array) defining the unknown variables,
 ## and return the objective function value, optionally with gradient.
-## In other words, this function attempts to determine a vector @var{x} such
-## that @code{@var{fcn} (@var{x})} is a local minimum.
-## @var{x0} determines a starting guess.  The shape of @var{x0} is preserved
-## in all calls to @var{fcn}, but otherwise is treated as a column vector.
+## @code{fminunc} attempts to determine a vector @var{x} such that
+## @code{@var{fcn} (@var{x})} is a local minimum.  @var{x0} determines a
+## starting guess.  The shape of @var{x0} is preserved in all calls to
+## @var{fcn}, but otherwise is treated as a column vector.
 ## @var{options} is a structure specifying additional options.
 ## Currently, @code{fminunc} recognizes these options:
 ## @qcode{"FunValCheck"}, @qcode{"OutputFcn"}, @qcode{"TolX"},
@@ -39,42 +39,46 @@
 ## @qcode{"TypicalX"}, @qcode{"AutoScaling"}.
 ##
 ## If @qcode{"GradObj"} is @qcode{"on"}, it specifies that @var{fcn},
-## called with 2 output arguments, also returns the Jacobian matrix
-## of right-hand sides at the requested point.  @qcode{"TolX"} specifies
-## the termination tolerance in the unknown variables, while
-## @qcode{"TolFun"} is a tolerance for equations.  Default is @code{1e-7}
-## for both @qcode{"TolX"} and @qcode{"TolFun"}.
+## when called with 2 output arguments, also returns the Jacobian matrix
+## of partial first derivatives at the requested point.
+## @code{TolX} specifies the termination tolerance for the unknown variables
+## @var{x}, while @code{TolFun} is a tolerance for the objective function
+## value @var{fval}.  The default is @code{1e-7} for both options.
 ##
-## For description of the other options, see @code{optimset}.
+## For a description of the other options, see @code{optimset}.
 ##
-## On return, @var{fval} contains the value of the function @var{fcn}
-## evaluated at @var{x}, and @var{info} may be one of the following values:
+## On return, @var{x} is the location of the minimum and @var{fval} contains
+## the value of the objective function at @var{x}.  @var{info} may be one of the
+## following values:
 ##
 ## @table @asis
 ## @item 1
 ## Converged to a solution point.  Relative gradient error is less than
-## specified
-## by TolFun.
+## specified by @code{TolFun}.
 ##
 ## @item 2
-## Last relative step size was less that TolX.
+## Last relative step size was less than @code{TolX}.
 ##
 ## @item 3
-## Last relative decrease in function value was less than TolF.
+## Last relative change in function value was less than @code{TolFun}.
 ##
 ## @item 0
-## Iteration limit exceeded.
+## Iteration limit exceeded---either maximum numer of algorithm iterations
+## @code{MaxIter} or maximum number of function evaluations @code{MaxFunEvals}.
+##
+## @item -1
+## Alogrithm terminated by @code{OutputFcn}.
 ##
 ## @item -3
 ## The trust region radius became excessively small.
 ## @end table
 ##
-## Optionally, fminunc can also yield a structure with convergence statistics
-## (@var{output}), the output gradient (@var{grad}) and approximate Hessian
-## (@var{hess}).
+## Optionally, @code{fminunc} can return a structure with convergence statistics
+## (@var{output}), the output gradient (@var{grad}) at the solution @var{x},
+## and approximate Hessian (@var{hess}) at the solution @var{x}.
 ##
-## Notes: If you only have a single nonlinear equation of one variable then
-## using @code{fminbnd} is usually a much better idea.  The algorithm used is a
+## Notes: If have only a single nonlinear equation of one variable then using
+## @code{fminbnd} is usually a much better idea.  The algorithm used is a
 ## gradient search which depends on the objective function being differentiable.
 ## If the function has discontinuities it may be better to use a derivative-free
 ## algorithm such as @code{fminsearch}.
@@ -221,7 +225,7 @@
       delta = factor * max (xn, 1);
     endif
 
-    ## FIXME -- why tolf*n*xn? If abs (e) ~ abs(x) * eps is a vector
+    ## FIXME: why tolf*n*xn?  If abs (e) ~ abs(x) * eps is a vector
     ## of perturbations of x, then norm (hesr*e) <= eps*xn, i.e. by
     ## tolf ~ eps we demand as much accuracy as we can expect.
     if (norm (grad) <= tolf*n*xn)
@@ -287,13 +291,13 @@
         x += s;
         xn = norm (dg .* x);
         fval = fval1;
-        nsuciter ++;
+        nsuciter++;
         suc = true;
       endif
 
       niter ++;
 
-      ## FIXME: should outputfcn be only called after a successful iteration?
+      ## FIXME: should outputfcn be called only after a successful iteration?
       if (! isempty (outfcn))
         optimvalues.iter = niter;
         optimvalues.funccount = nfev;
@@ -344,8 +348,7 @@
 
 endfunction
 
-## An assistant function that evaluates a function handle and checks for
-## bad results.
+## A helper function that evaluates a function and checks for bad results.
 function [fx, gx] = guarded_eval (fun, x)
   if (nargout > 1)
     [fx, gx] = fun (x);
--- a/test/io.tst	Thu Apr 03 16:30:05 2014 -0700
+++ b/test/io.tst	Fri Apr 04 11:50:14 2014 -0700
@@ -439,6 +439,18 @@
 %! assert (__prog_output_assert__ ("ok"));
 
 %!test
+%! x = char (128:255)';
+%! nm = tmpnam ();
+%! id = fopen (nm, "wb");
+%! fwrite (id, x);
+%! fclose (id);
+%! id = fopen (nm, "rb");
+%! y = fread (id, Inf, "uchar=>char");
+%! fclose (id);
+%! unlink (nm);
+%! assert (x, y);
+
+%!test
 %! nm = tmpnam ();
 %! id = fopen (nm, "wb");
 %! if (id > 0)