mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
splash screen
This commit is contained in:
parent
b161a09d71
commit
579802303d
4 changed files with 13 additions and 3 deletions
|
@ -1,7 +1,7 @@
|
|||
# Copyright: Damien Elmes <anki@ichi2.net>
|
||||
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
||||
|
||||
import os, sys, optparse, re, shutil
|
||||
import os, sys, shutil
|
||||
from PyQt4.QtCore import *
|
||||
from PyQt4.QtGui import *
|
||||
|
||||
|
@ -30,9 +30,7 @@ sys.path.append(os.path.dirname(__file__))
|
|||
##########################################################################
|
||||
|
||||
def run():
|
||||
import forms
|
||||
import config
|
||||
import ui
|
||||
|
||||
# home on win32 is broken
|
||||
if sys.platform == "win32":
|
||||
|
@ -56,6 +54,14 @@ def run():
|
|||
|
||||
app = QApplication(sys.argv)
|
||||
|
||||
# Create a pixmap - not needed if you have your own.
|
||||
import forms
|
||||
import ui
|
||||
pixmap = QPixmap(":/icons/anki-logo.png")
|
||||
ui.splash = QSplashScreen(pixmap)
|
||||
ui.splash.show()
|
||||
|
||||
|
||||
# setup paths for forms, icons
|
||||
sys.path.append(modDir)
|
||||
# jpeg module
|
||||
|
@ -74,6 +80,7 @@ def run():
|
|||
return
|
||||
|
||||
# parse args
|
||||
import optparse
|
||||
parser = optparse.OptionParser()
|
||||
parser.usage = "%prog [<deck.anki>]"
|
||||
parser.add_option("-c", "--config", help="path to config dir",
|
||||
|
@ -110,6 +117,7 @@ def run():
|
|||
|
||||
# load main window
|
||||
ui.importAll()
|
||||
|
||||
ui.dialogs.registerDialogs()
|
||||
mw = ui.main.AnkiQt(app, conf, args)
|
||||
try:
|
||||
|
|
|
@ -77,6 +77,7 @@ class AnkiQt(QMainWindow):
|
|||
except:
|
||||
ui.utils.showWarning(_("Broken plugin:\n\n%s") %
|
||||
traceback.format_exc())
|
||||
ui.splash.hide()
|
||||
|
||||
def setupMainWindow(self):
|
||||
# main window
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<RCC>
|
||||
<qresource prefix="/" >
|
||||
<file>icons/anki-logo.png</file>
|
||||
<file>icons/download.png</file>
|
||||
<file>icons/preferences-plugin.png</file>
|
||||
<file>icons/system-software-update.png</file>
|
||||
|
|
BIN
icons/anki-logo.png
Normal file
BIN
icons/anki-logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.6 KiB |
Loading…
Reference in a new issue