Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a splash screen on startup #1439

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 16 additions & 1 deletion gramps/gui/grampsgui.py
Expand Up @@ -38,7 +38,7 @@
#
#-------------------------------------------------------------------------
from gramps.gen.config import config
from gramps.gen.const import DATA_DIR, IMAGE_DIR, GTK_GETTEXT_DOMAIN
from gramps.gen.const import DATA_DIR, IMAGE_DIR, GTK_GETTEXT_DOMAIN, SPLASH
from gramps.gen.constfunc import has_display, lin
from gramps.gen.const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
Expand Down Expand Up @@ -440,6 +440,20 @@
"Gramps will terminate now."))
sys.exit(1)

# Create splash screen
try:
from gi.repository import Gtk, Gdk
splash = Gtk.Window()
splash.props.type_hint = Gdk.WindowTypeHint.SPLASHSCREEN
splash.set_decorated(False)
splash.set_position(Gtk.WindowPosition.CENTER)
splash.add(Gtk.Image().new_from_file(SPLASH))
splash.show_all()
while Gtk.events_pending():
Gtk.main_iteration()
except:
print("Failed to create splash screen")

#-------------------------------------------------------------------------
#
# Functions
Expand Down Expand Up @@ -710,3 +724,4 @@ def do_activate(self):
else:
print('Gramps is already running.')
self.window.present()
splash.destroy()