| 1 |
# (C) Copyright 2007-2025 Enthought, Inc., Austin, TX |
| 2 |
# All rights reserved. |
| 3 |
# |
| 4 |
# This software is provided without warranty under the terms of the BSD |
| 5 |
# license included in LICENSE.txt and may be redistributed only under |
| 6 |
# the conditions described in the aforementioned license. The license |
| 7 |
# is also available online at http://www.enthought.com/licenses/BSD.txt |
| 8 |
# |
| 9 |
# Thanks for using Enthought open source! |
| 10 |
|
| 11 |
""" The Acme Lab application. """ |
| 12 |
|
| 13 |
|
| 14 |
# Standard library imports. |
| 15 |
from logging import DEBUG |
| 16 |
|
| 17 |
from pyface.api import AboutDialog, ImageResource, SplashScreen |
| 18 |
|
| 19 |
# Enthought library imports. |
| 20 |
from envisage.ui.workbench.api import WorkbenchApplication |
| 21 |
|
| 22 |
|
| 23 |
class Acmelab(WorkbenchApplication): |
| 24 |
"""The Acme Lab application.""" |
| 25 |
|
| 26 |
#### 'IApplication' interface ############################################# |
| 27 |
|
| 28 |
# The application's globally unique Id. |
| 29 |
id = "acme.acmelab" |
| 30 |
|
| 31 |
#### 'WorkbenchApplication' interface ##################################### |
| 32 |
|
| 33 |
# Branding information. |
| 34 |
# |
| 35 |
# The icon used on window title bars etc. |
| 36 |
icon = ImageResource("acmelab.ico") |
| 37 |
|
| 38 |
# The name of the application (also used on window title bars etc). |
| 39 |
name = "Acme Lab" |
| 40 |
|
| 41 |
########################################################################### |
| 42 |
# 'WorkbenchApplication' interface. |
| 43 |
########################################################################### |
| 44 |
|
| 45 |
def _about_dialog_default(self): |
| 46 |
"""Trait initializer.""" |
| 47 |
|
| 48 |
about_dialog = AboutDialog( |
| 49 |
parent=self.workbench.active_window.control, |
| 50 |
image=ImageResource("about"), |
| 51 |
) |
| 52 |
|
| 53 |
return about_dialog |
| 54 |
|
| 55 |
def _splash_screen_default(self): |
| 56 |
"""Trait initializer.""" |
| 57 |
|
| 58 |
splash_screen = SplashScreen( |
| 59 |
image=ImageResource("splash"), |
| 60 |
show_log_messages=True, |
| 61 |
log_level=DEBUG, |
| 62 |
) |
| 63 |
|
| 64 |
return splash_screen |