mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 01:06:35 -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>
|
# Copyright: Damien Elmes <anki@ichi2.net>
|
||||||
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
# 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.QtCore import *
|
||||||
from PyQt4.QtGui import *
|
from PyQt4.QtGui import *
|
||||||
|
|
||||||
|
@ -30,9 +30,7 @@ sys.path.append(os.path.dirname(__file__))
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
|
||||||
def run():
|
def run():
|
||||||
import forms
|
|
||||||
import config
|
import config
|
||||||
import ui
|
|
||||||
|
|
||||||
# home on win32 is broken
|
# home on win32 is broken
|
||||||
if sys.platform == "win32":
|
if sys.platform == "win32":
|
||||||
|
@ -56,6 +54,14 @@ def run():
|
||||||
|
|
||||||
app = QApplication(sys.argv)
|
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
|
# setup paths for forms, icons
|
||||||
sys.path.append(modDir)
|
sys.path.append(modDir)
|
||||||
# jpeg module
|
# jpeg module
|
||||||
|
@ -74,6 +80,7 @@ def run():
|
||||||
return
|
return
|
||||||
|
|
||||||
# parse args
|
# parse args
|
||||||
|
import optparse
|
||||||
parser = optparse.OptionParser()
|
parser = optparse.OptionParser()
|
||||||
parser.usage = "%prog [<deck.anki>]"
|
parser.usage = "%prog [<deck.anki>]"
|
||||||
parser.add_option("-c", "--config", help="path to config dir",
|
parser.add_option("-c", "--config", help="path to config dir",
|
||||||
|
@ -110,6 +117,7 @@ def run():
|
||||||
|
|
||||||
# load main window
|
# load main window
|
||||||
ui.importAll()
|
ui.importAll()
|
||||||
|
|
||||||
ui.dialogs.registerDialogs()
|
ui.dialogs.registerDialogs()
|
||||||
mw = ui.main.AnkiQt(app, conf, args)
|
mw = ui.main.AnkiQt(app, conf, args)
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -77,6 +77,7 @@ class AnkiQt(QMainWindow):
|
||||||
except:
|
except:
|
||||||
ui.utils.showWarning(_("Broken plugin:\n\n%s") %
|
ui.utils.showWarning(_("Broken plugin:\n\n%s") %
|
||||||
traceback.format_exc())
|
traceback.format_exc())
|
||||||
|
ui.splash.hide()
|
||||||
|
|
||||||
def setupMainWindow(self):
|
def setupMainWindow(self):
|
||||||
# main window
|
# main window
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<RCC>
|
<RCC>
|
||||||
<qresource prefix="/" >
|
<qresource prefix="/" >
|
||||||
|
<file>icons/anki-logo.png</file>
|
||||||
<file>icons/download.png</file>
|
<file>icons/download.png</file>
|
||||||
<file>icons/preferences-plugin.png</file>
|
<file>icons/preferences-plugin.png</file>
|
||||||
<file>icons/system-software-update.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