mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
plugins -> add-ons; ditch separate download menu
Because of the extensive changes almost all plugins will require an update to work with 2.0, and add-ons is a slightly friendlier name.
This commit is contained in:
parent
8567a5d7ae
commit
1a0d273b78
4 changed files with 13 additions and 24 deletions
|
@ -8,7 +8,7 @@ from PyQt4.QtGui import *
|
|||
from aqt.utils import showInfo, showWarning, openFolder, isWin
|
||||
from anki.hooks import runHook
|
||||
|
||||
class PluginManager(object):
|
||||
class AddonManager(object):
|
||||
|
||||
def __init__(self, mw):
|
||||
self.mw = mw
|
||||
|
@ -45,7 +45,7 @@ class PluginManager(object):
|
|||
dir = self.mw.config.confDir
|
||||
if isWin:
|
||||
dir = dir.encode(sys.getfilesystemencoding())
|
||||
return os.path.join(dir, "plugins")
|
||||
return os.path.join(dir, "addons")
|
||||
|
||||
def clearPluginCache(self):
|
||||
"Clear .pyc files which may cause crashes if Python version updated."
|
|
@ -142,7 +142,7 @@ create table if not exists config (conf text not null);
|
|||
def _addAnkiDirs(self):
|
||||
base = self.confDir
|
||||
for x in (base,
|
||||
os.path.join(base, "plugins"),
|
||||
os.path.join(base, "addons"),
|
||||
os.path.join(base, "backups")):
|
||||
try:
|
||||
os.mkdir(x)
|
||||
|
|
|
@ -41,7 +41,7 @@ class AnkiQt(QMainWindow):
|
|||
self.setup()
|
||||
splash.update()
|
||||
# load plugins
|
||||
self.setupPlugins()
|
||||
self.setupAddons()
|
||||
splash.update()
|
||||
# show main window
|
||||
splash.finish(self)
|
||||
|
@ -254,9 +254,9 @@ title="%s">%s</button>''' % (
|
|||
if self.appUpdated:
|
||||
self.config['version'] = aqt.appVersion
|
||||
|
||||
def setupPlugins(self):
|
||||
import aqt.plugins
|
||||
self.pluginManager = aqt.plugins.PluginManager(self)
|
||||
def setupAddons(self):
|
||||
import aqt.addons
|
||||
self.addonManager = aqt.addons.AddonManager(self)
|
||||
|
||||
def setupThreads(self):
|
||||
self._mainThread = QThread.currentThread()
|
||||
|
|
|
@ -71,23 +71,11 @@
|
|||
<property name="title">
|
||||
<string>&File</string>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuDownload">
|
||||
<property name="title">
|
||||
<string>&Download</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="icons.qrc">
|
||||
<normaloff>:/icons/document-open-remote.png</normaloff>:/icons/document-open-remote.png</iconset>
|
||||
</property>
|
||||
<addaction name="actionOpenOnline"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionDownloadSharedDeck"/>
|
||||
<addaction name="actionDownloadSharedPlugin"/>
|
||||
</widget>
|
||||
<addaction name="actionNew"/>
|
||||
<addaction name="actionOpen"/>
|
||||
<addaction name="actionOpenRecent"/>
|
||||
<addaction name="menuDownload"/>
|
||||
<addaction name="actionOpenOnline"/>
|
||||
<addaction name="actionDownloadSharedDeck"/>
|
||||
<addaction name="actionImport"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionRename"/>
|
||||
|
@ -141,6 +129,7 @@
|
|||
<addaction name="actionDisableAllPlugins"/>
|
||||
<addaction name="separator"/>
|
||||
</widget>
|
||||
<addaction name="actionDownloadSharedPlugin"/>
|
||||
<addaction name="actionOpenPluginFolder"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="menuStartup"/>
|
||||
|
@ -565,7 +554,7 @@
|
|||
<normaloff>:/icons/document-open-remote.png</normaloff>:/icons/document-open-remote.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Personal Deck...</string>
|
||||
<string>Open Synced...</string>
|
||||
</property>
|
||||
<property name="iconText">
|
||||
<string>AnkiWeb</string>
|
||||
|
@ -580,7 +569,7 @@
|
|||
<normaloff>:/icons/download.png</normaloff>:/icons/download.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Shared Deck...</string>
|
||||
<string>Open Shared...</string>
|
||||
</property>
|
||||
<property name="iconText">
|
||||
<string>Download</string>
|
||||
|
@ -591,7 +580,7 @@
|
|||
</action>
|
||||
<action name="actionDownloadSharedPlugin">
|
||||
<property name="text">
|
||||
<string>Shared Plugin...</string>
|
||||
<string>Download Shared...</string>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>Download a plugin to add new features or change Anki's behaviour</string>
|
||||
|
|
Loading…
Reference in a new issue