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:
Damien Elmes 2011-04-24 10:35:24 +09:00
parent 8567a5d7ae
commit 1a0d273b78
4 changed files with 13 additions and 24 deletions

View file

@ -8,7 +8,7 @@ from PyQt4.QtGui import *
from aqt.utils import showInfo, showWarning, openFolder, isWin from aqt.utils import showInfo, showWarning, openFolder, isWin
from anki.hooks import runHook from anki.hooks import runHook
class PluginManager(object): class AddonManager(object):
def __init__(self, mw): def __init__(self, mw):
self.mw = mw self.mw = mw
@ -45,7 +45,7 @@ class PluginManager(object):
dir = self.mw.config.confDir dir = self.mw.config.confDir
if isWin: if isWin:
dir = dir.encode(sys.getfilesystemencoding()) dir = dir.encode(sys.getfilesystemencoding())
return os.path.join(dir, "plugins") return os.path.join(dir, "addons")
def clearPluginCache(self): def clearPluginCache(self):
"Clear .pyc files which may cause crashes if Python version updated." "Clear .pyc files which may cause crashes if Python version updated."

View file

@ -142,7 +142,7 @@ create table if not exists config (conf text not null);
def _addAnkiDirs(self): def _addAnkiDirs(self):
base = self.confDir base = self.confDir
for x in (base, for x in (base,
os.path.join(base, "plugins"), os.path.join(base, "addons"),
os.path.join(base, "backups")): os.path.join(base, "backups")):
try: try:
os.mkdir(x) os.mkdir(x)

View file

@ -41,7 +41,7 @@ class AnkiQt(QMainWindow):
self.setup() self.setup()
splash.update() splash.update()
# load plugins # load plugins
self.setupPlugins() self.setupAddons()
splash.update() splash.update()
# show main window # show main window
splash.finish(self) splash.finish(self)
@ -254,9 +254,9 @@ title="%s">%s</button>''' % (
if self.appUpdated: if self.appUpdated:
self.config['version'] = aqt.appVersion self.config['version'] = aqt.appVersion
def setupPlugins(self): def setupAddons(self):
import aqt.plugins import aqt.addons
self.pluginManager = aqt.plugins.PluginManager(self) self.addonManager = aqt.addons.AddonManager(self)
def setupThreads(self): def setupThreads(self):
self._mainThread = QThread.currentThread() self._mainThread = QThread.currentThread()

View file

@ -71,23 +71,11 @@
<property name="title"> <property name="title">
<string>&amp;File</string> <string>&amp;File</string>
</property> </property>
<widget class="QMenu" name="menuDownload">
<property name="title">
<string>&amp;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="actionNew"/>
<addaction name="actionOpen"/> <addaction name="actionOpen"/>
<addaction name="actionOpenRecent"/> <addaction name="actionOpenRecent"/>
<addaction name="menuDownload"/> <addaction name="actionOpenOnline"/>
<addaction name="actionDownloadSharedDeck"/>
<addaction name="actionImport"/> <addaction name="actionImport"/>
<addaction name="separator"/> <addaction name="separator"/>
<addaction name="actionRename"/> <addaction name="actionRename"/>
@ -141,6 +129,7 @@
<addaction name="actionDisableAllPlugins"/> <addaction name="actionDisableAllPlugins"/>
<addaction name="separator"/> <addaction name="separator"/>
</widget> </widget>
<addaction name="actionDownloadSharedPlugin"/>
<addaction name="actionOpenPluginFolder"/> <addaction name="actionOpenPluginFolder"/>
<addaction name="separator"/> <addaction name="separator"/>
<addaction name="menuStartup"/> <addaction name="menuStartup"/>
@ -565,7 +554,7 @@
<normaloff>:/icons/document-open-remote.png</normaloff>:/icons/document-open-remote.png</iconset> <normaloff>:/icons/document-open-remote.png</normaloff>:/icons/document-open-remote.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Personal Deck...</string> <string>Open Synced...</string>
</property> </property>
<property name="iconText"> <property name="iconText">
<string>AnkiWeb</string> <string>AnkiWeb</string>
@ -580,7 +569,7 @@
<normaloff>:/icons/download.png</normaloff>:/icons/download.png</iconset> <normaloff>:/icons/download.png</normaloff>:/icons/download.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Shared Deck...</string> <string>Open Shared...</string>
</property> </property>
<property name="iconText"> <property name="iconText">
<string>Download</string> <string>Download</string>
@ -591,7 +580,7 @@
</action> </action>
<action name="actionDownloadSharedPlugin"> <action name="actionDownloadSharedPlugin">
<property name="text"> <property name="text">
<string>Shared Plugin...</string> <string>Download Shared...</string>
</property> </property>
<property name="statusTip"> <property name="statusTip">
<string>Download a plugin to add new features or change Anki's behaviour</string> <string>Download a plugin to add new features or change Anki's behaviour</string>