mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -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)
|
||||
# options
|
||||
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
|
||||
buf += self._renderDeckTree(children, depth+1)
|
||||
return buf
|
||||
|
|
|
@ -298,13 +298,15 @@ class Editor(object):
|
|||
# fixme: better image names
|
||||
b("text-speak", self.onAddMedia, "F3", _("Add pictures/audio/video (F3)"))
|
||||
b("media-record", self.onRecSound, "F5", _("Record audio (F5)"))
|
||||
b("tex", self.insertLatex, "Ctrl+t, t", _("LaTeX (Ctrl+t then t)"))
|
||||
b("math_sqrt", self.insertLatexEqn, "Ctrl+t, e",
|
||||
_("LaTeX equation (Ctrl+t then e)"))
|
||||
b("math_matrix", self.insertLatexMathEnv, "Ctrl+t, m",
|
||||
_("LaTeX math environment (Ctrl+t then m)"))
|
||||
but = b("text-xml", self.onHtmlEdit, "Ctrl+Shift+x",
|
||||
_("Source (Ctrl+Shift+x)"))
|
||||
b("adv", self.onAdvanced, text=u"▼")
|
||||
s = QShortcut(QKeySequence("Ctrl+t, t"), self.widget)
|
||||
s.connect(s, SIGNAL("activated()"), self.insertLatex)
|
||||
s = QShortcut(QKeySequence("Ctrl+t, e"), self.widget)
|
||||
s.connect(s, SIGNAL("activated()"), self.insertLatexEqn)
|
||||
s = QShortcut(QKeySequence("Ctrl+t, m"), self.widget)
|
||||
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):
|
||||
for b in self._buttons.values():
|
||||
|
@ -705,6 +707,21 @@ class Editor(object):
|
|||
return
|
||||
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
|
||||
######################################################################
|
||||
|
||||
|
|
|
@ -334,7 +334,7 @@
|
|||
<normaloff>:/icons/help.png</normaloff>:/icons/help.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Documentation</string>
|
||||
<string>&Guide</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>F1</string>
|
||||
|
@ -395,7 +395,7 @@
|
|||
<string>Fil&ters</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+T</string>
|
||||
<string>Ctrl+Shift+T</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionCardList">
|
||||
|
|
Loading…
Reference in a new issue