mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 22:42:25 -04:00
move tex & html editing into advanced menu
This commit is contained in:
parent
ff967298ca
commit
4a84a304ae
3 changed files with 27 additions and 10 deletions
|
@ -85,7 +85,7 @@ body { margin: 1em; -webkit-user-select: none; }
|
||||||
buf += " <a class=deck href='open:%d'>%s</a></td>"% (did, name)
|
buf += " <a class=deck href='open:%d'>%s</a></td>"% (did, name)
|
||||||
# options
|
# options
|
||||||
buf += "<td align=right class=opts>%s</td></tr>" % self.mw.button(
|
buf += "<td align=right class=opts>%s</td></tr>" % self.mw.button(
|
||||||
link="opts:%d"%did, name="<img valign=bottom src='qrc:/icons/gears.png'>▾")
|
link="opts:%d"%did, name="<img valign=bottom src='qrc:/icons/gears.png'>▾")
|
||||||
# children
|
# children
|
||||||
buf += self._renderDeckTree(children, depth+1)
|
buf += self._renderDeckTree(children, depth+1)
|
||||||
return buf
|
return buf
|
||||||
|
|
|
@ -298,13 +298,15 @@ class Editor(object):
|
||||||
# fixme: better image names
|
# fixme: better image names
|
||||||
b("text-speak", self.onAddMedia, "F3", _("Add pictures/audio/video (F3)"))
|
b("text-speak", self.onAddMedia, "F3", _("Add pictures/audio/video (F3)"))
|
||||||
b("media-record", self.onRecSound, "F5", _("Record audio (F5)"))
|
b("media-record", self.onRecSound, "F5", _("Record audio (F5)"))
|
||||||
b("tex", self.insertLatex, "Ctrl+t, t", _("LaTeX (Ctrl+t then t)"))
|
b("adv", self.onAdvanced, text=u"▼")
|
||||||
b("math_sqrt", self.insertLatexEqn, "Ctrl+t, e",
|
s = QShortcut(QKeySequence("Ctrl+t, t"), self.widget)
|
||||||
_("LaTeX equation (Ctrl+t then e)"))
|
s.connect(s, SIGNAL("activated()"), self.insertLatex)
|
||||||
b("math_matrix", self.insertLatexMathEnv, "Ctrl+t, m",
|
s = QShortcut(QKeySequence("Ctrl+t, e"), self.widget)
|
||||||
_("LaTeX math environment (Ctrl+t then m)"))
|
s.connect(s, SIGNAL("activated()"), self.insertLatexEqn)
|
||||||
but = b("text-xml", self.onHtmlEdit, "Ctrl+Shift+x",
|
s = QShortcut(QKeySequence("Ctrl+t, m"), self.widget)
|
||||||
_("Source (Ctrl+Shift+x)"))
|
s.connect(s, SIGNAL("activated()"), self.insertLatexMathEnv)
|
||||||
|
s = QShortcut(QKeySequence("Ctrl+shift+x"), self.widget)
|
||||||
|
s.connect(s, SIGNAL("activated()"), self.onHtmlEdit)
|
||||||
|
|
||||||
def enableButtons(self, val=True):
|
def enableButtons(self, val=True):
|
||||||
for b in self._buttons.values():
|
for b in self._buttons.values():
|
||||||
|
@ -705,6 +707,21 @@ class Editor(object):
|
||||||
return
|
return
|
||||||
self.addMedia(file)
|
self.addMedia(file)
|
||||||
|
|
||||||
|
# Advanced menu
|
||||||
|
######################################################################
|
||||||
|
|
||||||
|
def onAdvanced(self):
|
||||||
|
m = QMenu(self.mw)
|
||||||
|
a = m.addAction(_("LaTeX"))
|
||||||
|
a.connect(a, SIGNAL("triggered()"), self.insertLatex)
|
||||||
|
a = m.addAction(_("LaTeX Equation"))
|
||||||
|
a.connect(a, SIGNAL("triggered()"), self.insertLatexEqn)
|
||||||
|
a = m.addAction(_("LaTeX Math Env."))
|
||||||
|
a.connect(a, SIGNAL("triggered()"), self.insertLatexMathEnv)
|
||||||
|
a = m.addAction(_("Edit HTML"))
|
||||||
|
a.connect(a, SIGNAL("triggered()"), self.onHtmlEdit)
|
||||||
|
m.exec_(QCursor.pos())
|
||||||
|
|
||||||
# LaTeX
|
# LaTeX
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
|
|
|
@ -334,7 +334,7 @@
|
||||||
<normaloff>:/icons/help.png</normaloff>:/icons/help.png</iconset>
|
<normaloff>:/icons/help.png</normaloff>:/icons/help.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&Documentation</string>
|
<string>&Guide</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="shortcut">
|
<property name="shortcut">
|
||||||
<string>F1</string>
|
<string>F1</string>
|
||||||
|
@ -395,7 +395,7 @@
|
||||||
<string>Fil&ters</string>
|
<string>Fil&ters</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="shortcut">
|
<property name="shortcut">
|
||||||
<string>Ctrl+T</string>
|
<string>Ctrl+Shift+T</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionCardList">
|
<action name="actionCardList">
|
||||||
|
|
Loading…
Reference in a new issue