mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
bare minimum to get ankiqt to start with the new libanki
This commit is contained in:
parent
9b14bd6ab0
commit
b4a794dcb3
8 changed files with 11 additions and 26 deletions
|
@ -6,7 +6,7 @@ from PyQt4.QtCore import *
|
|||
from PyQt4.QtGui import *
|
||||
|
||||
appName="Anki"
|
||||
appVersion="1.2.8"
|
||||
appVersion="1.99"
|
||||
appWebsite="http://ankisrs.net/"
|
||||
appWiki="http://ichi2.net/anki/wiki/"
|
||||
appHelpSite="http://ankisrs.net/docs/"
|
||||
|
|
|
@ -6,8 +6,7 @@
|
|||
|
||||
from PyQt4.QtGui import *
|
||||
from PyQt4.QtCore import *
|
||||
import os, sys, cPickle, locale, types, shutil, time, re
|
||||
from anki.utils import genID
|
||||
import os, sys, cPickle, locale, types, shutil, time, re, random
|
||||
|
||||
# compatability
|
||||
def unpickleWxFont(*args):
|
||||
|
@ -61,7 +60,7 @@ class Config(dict):
|
|||
'factEditorAdvanced': False,
|
||||
'forceLTR': False,
|
||||
'iconSize': 32,
|
||||
'id': genID(),
|
||||
'id': random.randrange(0, 2**63),
|
||||
'interfaceLang': "",
|
||||
'lastMsg': -1,
|
||||
'loadLastDeck': False,
|
||||
|
|
|
@ -10,9 +10,7 @@ import time, types, sys, re
|
|||
from operator import attrgetter, itemgetter
|
||||
import anki, anki.utils, ankiqt.forms
|
||||
from ankiqt import ui
|
||||
from anki.cards import cardsTable, Card
|
||||
from anki.facts import factsTable, fieldsTable, Fact
|
||||
from anki.utils import fmtTimeSpan, parseTags, findTag, addTags, deleteTags, \
|
||||
from anki.utils import fmtTimeSpan, parseTags, hasTag, addTags, delTags, \
|
||||
stripHTMLAlt, ids2str
|
||||
from ankiqt.ui.utils import saveGeom, restoreGeom, saveSplitter, restoreSplitter
|
||||
from ankiqt.ui.utils import saveHeader, restoreHeader, saveState, \
|
||||
|
|
|
@ -9,7 +9,6 @@ import ankiqt.forms
|
|||
import anki
|
||||
from anki.models import *
|
||||
from anki.facts import *
|
||||
from anki.fonts import toCanonicalFont
|
||||
from anki.cards import Card
|
||||
from anki.sound import playFromText, clearAudioQueue
|
||||
from ankiqt.ui.utils import saveGeom, restoreGeom, getBase, mungeQA, \
|
||||
|
|
|
@ -11,13 +11,11 @@ from PyQt4.QtGui import *
|
|||
from PyQt4.QtWebKit import QWebPage
|
||||
from PyQt4 import pyqtconfig
|
||||
QtConfig = pyqtconfig.Configuration()
|
||||
from anki import DeckStorage
|
||||
from anki import Deck
|
||||
from anki.errors import *
|
||||
from anki.sound import hasSound, playFromText, clearAudioQueue, stripSounds
|
||||
from anki.utils import addTags, deleteTags, parseTags, canonifyTags, \
|
||||
from anki.utils import addTags, parseTags, canonifyTags, \
|
||||
stripHTML, checksum
|
||||
from anki.media import rebuildMediaDir, downloadMissing, downloadRemote
|
||||
from anki.db import OperationalError, SessionHelper, sqlite
|
||||
from anki.stdmodels import BasicModel
|
||||
from anki.hooks import runHook, addHook, removeHook, _hooks, wrap
|
||||
from anki.deck import newCardOrderLabels, newCardSchedulingLabels
|
||||
|
@ -2812,6 +2810,8 @@ to work with this version of Anki."""))
|
|||
##########################################################################
|
||||
|
||||
def setupFonts(self):
|
||||
print "need setupFonts?"
|
||||
return
|
||||
for (s, p) in anki.fonts.substitutions():
|
||||
QFont.insertSubstitution(s, p)
|
||||
|
||||
|
@ -2859,15 +2859,6 @@ to work with this version of Anki."""))
|
|||
self.busyCursor = False
|
||||
self.updatingBusy = False
|
||||
self.mainThread = QThread.currentThread()
|
||||
self.oldSessionHelperGetter = SessionHelper.__getattr__
|
||||
SessionHelper.__getattr__ = wrap(SessionHelper.__getattr__,
|
||||
self.checkProgressHandler,
|
||||
pos="before")
|
||||
|
||||
def checkProgressHandler(self, ses, k):
|
||||
"Catch attempts to access the DB from a progress handler."
|
||||
if self.inDbHandler:
|
||||
raise Exception("Accessed DB while in progress handler")
|
||||
|
||||
def setProgressParent(self, parent):
|
||||
self.progressParent = parent
|
||||
|
|
|
@ -6,7 +6,6 @@ from PyQt4.QtCore import *
|
|||
import sys, re
|
||||
import ankiqt.forms
|
||||
import anki
|
||||
from anki.models import FieldModel, CardModel
|
||||
from ankiqt import ui
|
||||
|
||||
class ModelProperties(QDialog):
|
||||
|
|
|
@ -9,7 +9,7 @@ import anki
|
|||
from anki.sync import SyncClient, HttpSyncServerProxy, copyLocalMedia
|
||||
from anki.sync import SYNC_HOST, SYNC_PORT
|
||||
from anki.errors import *
|
||||
from anki import DeckStorage
|
||||
from anki import Deck
|
||||
from anki.db import sqlite
|
||||
import ankiqt.forms
|
||||
from anki.hooks import addHook, removeHook
|
||||
|
|
|
@ -8,7 +8,6 @@ import anki, anki.utils
|
|||
from anki.sound import playFromText
|
||||
from anki.utils import stripHTML
|
||||
from anki.hooks import runHook, runFilter
|
||||
from anki.media import stripMedia, escapeImages
|
||||
import types, time, re, os, urllib, sys, difflib
|
||||
import unicodedata as ucd
|
||||
from ankiqt import ui
|
||||
|
@ -113,9 +112,9 @@ class View(object):
|
|||
# problem is more complicated - if we percent-escape as utf8 it fixes
|
||||
# some images but breaks others. When filenames are normalized by
|
||||
# dropbox they become unreadable if we escape them.
|
||||
if not sys.platform.startswith("win32"):
|
||||
if not sys.platform.startswith("win32") and self.main.deck:
|
||||
# and self.main.config['mediaLocation'] == "dropbox"):
|
||||
b = escapeImages(b)
|
||||
b = self.main.deck.media.escapeImages(b)
|
||||
self.body.setHtml(b)
|
||||
|
||||
def write(self, text):
|
||||
|
|
Loading…
Reference in a new issue